aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-10-19 15:19:19 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-10-19 15:19:19 -0400
commite05dacd71db0a5da7c1a44bcaab2a8a240b9c233 (patch)
tree31382cf1c7d62c03126448affb2fc86e8c4aaa8b /arch/arm
parent3ab0b83bf6a1e834f4b884150d8012990c75d25d (diff)
parentddffeb8c4d0331609ef2581d84de4d763607bd37 (diff)
Merge commit 'v3.7-rc1' into stable/for-linus-3.7
* commit 'v3.7-rc1': (10892 commits) Linux 3.7-rc1 x86, boot: Explicitly include autoconf.h for hostprogs perf: Fix UAPI fallout ARM: config: make sure that platforms are ordered by option string ARM: config: sort select statements alphanumerically UAPI: (Scripted) Disintegrate include/linux/byteorder UAPI: (Scripted) Disintegrate include/linux UAPI: Unexport linux/blk_types.h UAPI: Unexport part of linux/ppp-comp.h perf: Handle new rbtree implementation procfs: don't need a PATH_MAX allocation to hold a string representation of an int vfs: embed struct filename inside of names_cache allocation if possible audit: make audit_inode take struct filename vfs: make path_openat take a struct filename pointer vfs: turn do_path_lookup into wrapper around struct filename variant audit: allow audit code to satisfy getname requests from its names_list vfs: define struct filename and have getname() return it btrfs: Fix compilation with user namespace support enabled userns: Fix posix_acl_file_xattr_userns gid conversion userns: Properly print bluetooth socket uids ...
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig774
-rw-r--r--arch/arm/Kconfig.debug53
-rw-r--r--arch/arm/Makefile163
-rw-r--r--arch/arm/boot/Makefile2
-rw-r--r--arch/arm/boot/compressed/.gitignore1
-rw-r--r--arch/arm/boot/compressed/Makefile9
-rw-r--r--arch/arm/boot/compressed/decompress.c3
-rw-r--r--arch/arm/boot/compressed/head.S76
-rw-r--r--arch/arm/boot/compressed/misc.c6
-rw-r--r--arch/arm/boot/dts/Makefile105
-rw-r--r--arch/arm/boot/dts/am335x-bone.dts60
-rw-r--r--arch/arm/boot/dts/am335x-evm.dts100
-rw-r--r--arch/arm/boot/dts/am33xx.dtsi71
-rw-r--r--arch/arm/boot/dts/armada-370-xp.dtsi5
-rw-r--r--arch/arm/boot/dts/armada-370.dtsi44
-rw-r--r--arch/arm/boot/dts/armada-xp-db.dts4
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78230.dtsi57
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78260.dtsi70
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78460.dtsi70
-rw-r--r--arch/arm/boot/dts/at91sam9260.dtsi13
-rw-r--r--arch/arm/boot/dts/at91sam9263.dtsi15
-rw-r--r--arch/arm/boot/dts/at91sam9g20.dtsi4
-rw-r--r--arch/arm/boot/dts/at91sam9g25ek.dts12
-rw-r--r--arch/arm/boot/dts/at91sam9g45.dtsi25
-rw-r--r--arch/arm/boot/dts/at91sam9m10g45ek.dts8
-rw-r--r--arch/arm/boot/dts/at91sam9n12.dtsi24
-rw-r--r--arch/arm/boot/dts/at91sam9n12ek.dts8
-rw-r--r--arch/arm/boot/dts/at91sam9x5.dtsi34
-rw-r--r--arch/arm/boot/dts/bcm2835-rpi-b.dts12
-rw-r--r--arch/arm/boot/dts/bcm2835.dtsi39
-rw-r--r--arch/arm/boot/dts/dbx5x0.dtsi (renamed from arch/arm/boot/dts/db8500.dtsi)71
-rw-r--r--arch/arm/boot/dts/dove-cm-a510.dts38
-rw-r--r--arch/arm/boot/dts/dove-cubox.dts42
-rw-r--r--arch/arm/boot/dts/dove-dove-db.dts38
-rw-r--r--arch/arm/boot/dts/dove.dtsi143
-rw-r--r--arch/arm/boot/dts/ea3250.dts109
-rw-r--r--arch/arm/boot/dts/elpida_ecb240abacn.dtsi67
-rw-r--r--arch/arm/boot/dts/exynos4.dtsi248
-rw-r--r--arch/arm/boot/dts/exynos4210-origen.dts77
-rw-r--r--arch/arm/boot/dts/exynos4210-pinctrl.dtsi457
-rw-r--r--arch/arm/boot/dts/exynos4210-smdkv310.dts54
-rw-r--r--arch/arm/boot/dts/exynos4210-trats.dts237
-rw-r--r--arch/arm/boot/dts/exynos4210.dtsi201
-rw-r--r--arch/arm/boot/dts/exynos5250-smdk5250.dts59
-rw-r--r--arch/arm/boot/dts/exynos5250.dtsi60
-rw-r--r--arch/arm/boot/dts/highbank.dts18
-rw-r--r--arch/arm/boot/dts/hrefv60plus.dts95
-rw-r--r--arch/arm/boot/dts/imx23-evk.dts3
-rw-r--r--arch/arm/boot/dts/imx23-olinuxino.dts57
-rw-r--r--arch/arm/boot/dts/imx23-stmp378x_devb.dts2
-rw-r--r--arch/arm/boot/dts/imx23.dtsi43
-rw-r--r--arch/arm/boot/dts/imx27-phytec-phycore.dts6
-rw-r--r--arch/arm/boot/dts/imx27.dtsi1
-rw-r--r--arch/arm/boot/dts/imx28-apx4devkit.dts2
-rw-r--r--arch/arm/boot/dts/imx28-cfa10049.dts99
-rw-r--r--arch/arm/boot/dts/imx28-evk.dts29
-rw-r--r--arch/arm/boot/dts/imx28-m28evk.dts83
-rw-r--r--arch/arm/boot/dts/imx28-tx28.dts23
-rw-r--r--arch/arm/boot/dts/imx28.dtsi130
-rw-r--r--arch/arm/boot/dts/imx51-babbage.dts44
-rw-r--r--arch/arm/boot/dts/imx51.dtsi153
-rw-r--r--arch/arm/boot/dts/imx53-ard.dts59
-rw-r--r--arch/arm/boot/dts/imx53-evk.dts39
-rw-r--r--arch/arm/boot/dts/imx53-qsb.dts42
-rw-r--r--arch/arm/boot/dts/imx53-smd.dts46
-rw-r--r--arch/arm/boot/dts/imx53.dtsi206
-rw-r--r--arch/arm/boot/dts/imx6q-arm2.dts21
-rw-r--r--arch/arm/boot/dts/imx6q-sabrelite.dts31
-rw-r--r--arch/arm/boot/dts/imx6q-sabresd.dts25
-rw-r--r--arch/arm/boot/dts/imx6q.dtsi325
-rw-r--r--arch/arm/boot/dts/integrator.dtsi76
-rw-r--r--arch/arm/boot/dts/integratorap.dts68
-rw-r--r--arch/arm/boot/dts/integratorcp.dts110
-rw-r--r--arch/arm/boot/dts/kirkwood-dnskw.dtsi10
-rw-r--r--arch/arm/boot/dts/kirkwood-dockstar.dts57
-rw-r--r--arch/arm/boot/dts/kirkwood-iconnect.dts50
-rw-r--r--arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts105
-rw-r--r--arch/arm/boot/dts/kirkwood-km_kirkwood.dts29
-rw-r--r--arch/arm/boot/dts/kirkwood.dtsi12
-rw-r--r--arch/arm/boot/dts/mmp2.dtsi5
-rw-r--r--arch/arm/boot/dts/msm8660-surf.dts19
-rw-r--r--arch/arm/boot/dts/msm8960-cdp.dts41
-rw-r--r--arch/arm/boot/dts/omap2420-h4.dts2
-rw-r--r--arch/arm/boot/dts/omap2420.dtsi48
-rw-r--r--arch/arm/boot/dts/omap2430.dtsi92
-rw-r--r--arch/arm/boot/dts/omap3-beagle-xm.dts (renamed from arch/arm/boot/dts/omap3-beagle.dts)54
-rw-r--r--arch/arm/boot/dts/omap3-evm.dts13
-rw-r--r--arch/arm/boot/dts/omap3-overo.dtsi57
-rw-r--r--arch/arm/boot/dts/omap3-tobi.dts35
-rw-r--r--arch/arm/boot/dts/omap3.dtsi94
-rw-r--r--arch/arm/boot/dts/omap36xx.dtsi25
-rw-r--r--arch/arm/boot/dts/omap4-panda.dts58
-rw-r--r--arch/arm/boot/dts/omap4-sdp.dts184
-rw-r--r--arch/arm/boot/dts/omap4.dtsi203
-rw-r--r--arch/arm/boot/dts/omap5-evm.dts122
-rw-r--r--arch/arm/boot/dts/omap5.dtsi156
-rw-r--r--arch/arm/boot/dts/phy3250.dts16
-rw-r--r--arch/arm/boot/dts/prima2-cb.dts424
-rw-r--r--arch/arm/boot/dts/prima2-evb.dts37
-rw-r--r--arch/arm/boot/dts/prima2.dtsi640
-rw-r--r--arch/arm/boot/dts/pxa27x.dtsi14
-rw-r--r--arch/arm/boot/dts/pxa2xx.dtsi132
-rw-r--r--arch/arm/boot/dts/pxa3xx.dtsi32
-rw-r--r--arch/arm/boot/dts/pxa910-dkb.dts137
-rw-r--r--arch/arm/boot/dts/pxa910.dtsi9
-rw-r--r--arch/arm/boot/dts/snowball.dts19
-rw-r--r--arch/arm/boot/dts/spear300-evb.dts3
-rw-r--r--arch/arm/boot/dts/spear320-evb.dts2
-rw-r--r--arch/arm/boot/dts/tegra20-harmony.dts220
-rw-r--r--arch/arm/boot/dts/tegra20-medcom-wide.dts58
-rw-r--r--arch/arm/boot/dts/tegra20-paz00.dts173
-rw-r--r--arch/arm/boot/dts/tegra20-plutux.dts50
-rw-r--r--arch/arm/boot/dts/tegra20-seaboard.dts188
-rw-r--r--arch/arm/boot/dts/tegra20-tamonten.dtsi449
-rw-r--r--arch/arm/boot/dts/tegra20-tec.dts53
-rw-r--r--arch/arm/boot/dts/tegra20-ventana.dts206
-rw-r--r--arch/arm/boot/dts/tegra20-whistler.dts295
-rw-r--r--arch/arm/boot/dts/tegra20.dtsi6
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu-a02.dts87
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu-a04.dts98
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu.dts171
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu.dtsi475
-rw-r--r--arch/arm/boot/dts/tegra30.dtsi2
-rw-r--r--arch/arm/boot/dts/tps65217.dtsi56
-rw-r--r--arch/arm/boot/dts/tps65910.dtsi86
-rw-r--r--arch/arm/boot/dts/twl4030.dtsi6
-rw-r--r--arch/arm/boot/dts/twl6030.dtsi26
-rw-r--r--arch/arm/boot/dts/vt8500-bv07.dts36
-rw-r--r--arch/arm/boot/dts/vt8500.dtsi116
-rw-r--r--arch/arm/boot/dts/wm8505-ref.dts36
-rw-r--r--arch/arm/boot/dts/wm8505.dtsi143
-rw-r--r--arch/arm/boot/dts/wm8650-mid.dts36
-rw-r--r--arch/arm/boot/dts/wm8650.dtsi147
-rw-r--r--arch/arm/common/Kconfig4
-rw-r--r--arch/arm/common/it8152.c12
-rw-r--r--arch/arm/configs/afeb9260_defconfig1
-rw-r--r--arch/arm/configs/armadillo800eva_defconfig3
-rw-r--r--arch/arm/configs/at91rm9200_defconfig2
-rw-r--r--arch/arm/configs/at91sam9261_defconfig2
-rw-r--r--arch/arm/configs/at91sam9263_defconfig3
-rw-r--r--arch/arm/configs/at91sam9g20_defconfig2
-rw-r--r--arch/arm/configs/at91sam9rl_defconfig2
-rw-r--r--arch/arm/configs/bcm2835_defconfig95
-rw-r--r--arch/arm/configs/bcmring_defconfig79
-rw-r--r--arch/arm/configs/cam60_defconfig1
-rw-r--r--arch/arm/configs/corgi_defconfig1
-rw-r--r--arch/arm/configs/cpu9260_defconfig2
-rw-r--r--arch/arm/configs/cpu9g20_defconfig2
-rw-r--r--arch/arm/configs/ep93xx_defconfig1
-rw-r--r--arch/arm/configs/imx_v6_v7_defconfig8
-rw-r--r--arch/arm/configs/kirkwood_defconfig38
-rw-r--r--arch/arm/configs/kzm9d_defconfig1
-rw-r--r--arch/arm/configs/kzm9g_defconfig3
-rw-r--r--arch/arm/configs/lpc32xx_defconfig7
-rw-r--r--arch/arm/configs/marzen_defconfig17
-rw-r--r--arch/arm/configs/mini2440_defconfig1
-rw-r--r--arch/arm/configs/mmp2_defconfig5
-rw-r--r--arch/arm/configs/multi_v7_defconfig57
-rw-r--r--arch/arm/configs/mv78xx0_defconfig1
-rw-r--r--arch/arm/configs/mvebu_defconfig2
-rw-r--r--arch/arm/configs/mxs_defconfig42
-rw-r--r--arch/arm/configs/nhk8815_defconfig1
-rw-r--r--arch/arm/configs/omap2plus_defconfig1
-rw-r--r--arch/arm/configs/orion5x_defconfig1
-rw-r--r--arch/arm/configs/pnx4008_defconfig472
-rw-r--r--arch/arm/configs/prima2_defconfig7
-rw-r--r--arch/arm/configs/pxa3xx_defconfig1
-rw-r--r--arch/arm/configs/pxa910_defconfig4
-rw-r--r--arch/arm/configs/qil-a9260_defconfig3
-rw-r--r--arch/arm/configs/s3c6400_defconfig3
-rw-r--r--arch/arm/configs/sam9_l9260_defconfig2
-rw-r--r--arch/arm/configs/spitz_defconfig1
-rw-r--r--arch/arm/configs/stamp9g20_defconfig1
-rw-r--r--arch/arm/configs/tegra_defconfig53
-rw-r--r--arch/arm/configs/usb-a9260_defconfig1
-rw-r--r--arch/arm/crypto/Makefile9
-rw-r--r--arch/arm/crypto/aes-armv4.S1112
-rw-r--r--arch/arm/crypto/aes_glue.c108
-rw-r--r--arch/arm/crypto/sha1-armv4-large.S503
-rw-r--r--arch/arm/crypto/sha1_glue.c179
-rw-r--r--arch/arm/include/asm/Kbuild19
-rw-r--r--arch/arm/include/asm/arch_timer.h8
-rw-r--r--arch/arm/include/asm/assembler.h37
-rw-r--r--arch/arm/include/asm/barrier.h7
-rw-r--r--arch/arm/include/asm/cacheflush.h15
-rw-r--r--arch/arm/include/asm/current.h15
-rw-r--r--arch/arm/include/asm/delay.h9
-rw-r--r--arch/arm/include/asm/dma-mapping.h1
-rw-r--r--arch/arm/include/asm/exec.h6
-rw-r--r--arch/arm/include/asm/glue-cache.h17
-rw-r--r--arch/arm/include/asm/gpio.h2
-rw-r--r--arch/arm/include/asm/hardirq.h2
-rw-r--r--arch/arm/include/asm/hardware/cache-tauros2.h5
-rw-r--r--arch/arm/include/asm/hardware/iop3xx.h12
-rw-r--r--arch/arm/include/asm/hardware/linkup-l1110.h48
-rw-r--r--arch/arm/include/asm/hwcap.h27
-rw-r--r--arch/arm/include/asm/io.h75
-rw-r--r--arch/arm/include/asm/ipcbuf.h1
-rw-r--r--arch/arm/include/asm/leds.h50
-rw-r--r--arch/arm/include/asm/mach/arch.h7
-rw-r--r--arch/arm/include/asm/mach/map.h8
-rw-r--r--arch/arm/include/asm/mach/pci.h13
-rw-r--r--arch/arm/include/asm/memory.h11
-rw-r--r--arch/arm/include/asm/module.h8
-rw-r--r--arch/arm/include/asm/msgbuf.h31
-rw-r--r--arch/arm/include/asm/mutex.h9
-rw-r--r--arch/arm/include/asm/opcodes-virt.h (renamed from arch/arm/mach-mxs/include/mach/entry-macro.S)34
-rw-r--r--arch/arm/include/asm/opcodes.h181
-rw-r--r--arch/arm/include/asm/page.h2
-rw-r--r--arch/arm/include/asm/param.h31
-rw-r--r--arch/arm/include/asm/parport.h18
-rw-r--r--arch/arm/include/asm/perf_event.h9
-rw-r--r--arch/arm/include/asm/pgtable.h2
-rw-r--r--arch/arm/include/asm/pmu.h77
-rw-r--r--arch/arm/include/asm/processor.h5
-rw-r--r--arch/arm/include/asm/ptrace.h129
-rw-r--r--arch/arm/include/asm/segment.h11
-rw-r--r--arch/arm/include/asm/sembuf.h25
-rw-r--r--arch/arm/include/asm/serial.h19
-rw-r--r--arch/arm/include/asm/setup.h172
-rw-r--r--arch/arm/include/asm/shmbuf.h42
-rw-r--r--arch/arm/include/asm/signal.h127
-rw-r--r--arch/arm/include/asm/smp.h48
-rw-r--r--arch/arm/include/asm/socket.h72
-rw-r--r--arch/arm/include/asm/sockios.h13
-rw-r--r--arch/arm/include/asm/swab.h37
-rw-r--r--arch/arm/include/asm/syscall.h5
-rw-r--r--arch/arm/include/asm/system.h1
-rw-r--r--arch/arm/include/asm/termbits.h198
-rw-r--r--arch/arm/include/asm/termios.h92
-rw-r--r--arch/arm/include/asm/thread_info.h8
-rw-r--r--arch/arm/include/asm/timex.h10
-rw-r--r--arch/arm/include/asm/tlb.h4
-rw-r--r--arch/arm/include/asm/types.h16
-rw-r--r--arch/arm/include/asm/uaccess.h58
-rw-r--r--arch/arm/include/asm/unaligned.h19
-rw-r--r--arch/arm/include/asm/unistd.h435
-rw-r--r--arch/arm/include/asm/vfpmacros.h6
-rw-r--r--arch/arm/include/asm/virt.h69
-rw-r--r--arch/arm/include/debug/highbank.S (renamed from arch/arm/mach-highbank/include/mach/debug-macro.S)6
-rw-r--r--arch/arm/include/debug/icedcc.S90
-rw-r--r--arch/arm/include/debug/mvebu.S (renamed from arch/arm/mach-mvebu/include/mach/debug-macro.S)3
-rw-r--r--arch/arm/include/debug/picoxcell.S (renamed from arch/arm/mach-picoxcell/include/mach/debug-macro.S)4
-rw-r--r--arch/arm/include/debug/socfpga.S (renamed from arch/arm/mach-socfpga/include/mach/debug-macro.S)0
-rw-r--r--arch/arm/include/debug/vexpress.S (renamed from arch/arm/mach-vexpress/include/mach/debug-macro.S)0
-rw-r--r--arch/arm/include/uapi/asm/Kbuild19
-rw-r--r--arch/arm/include/uapi/asm/a.out.h (renamed from arch/arm/include/asm/a.out.h)0
-rw-r--r--arch/arm/include/uapi/asm/byteorder.h (renamed from arch/arm/include/asm/byteorder.h)0
-rw-r--r--arch/arm/include/uapi/asm/fcntl.h (renamed from arch/arm/include/asm/fcntl.h)0
-rw-r--r--arch/arm/include/uapi/asm/hwcap.h29
-rw-r--r--arch/arm/include/uapi/asm/ioctls.h (renamed from arch/arm/include/asm/ioctls.h)0
-rw-r--r--arch/arm/include/uapi/asm/kvm_para.h (renamed from arch/arm/include/asm/kvm_para.h)0
-rw-r--r--arch/arm/include/uapi/asm/mman.h (renamed from arch/arm/include/asm/mman.h)0
-rw-r--r--arch/arm/include/uapi/asm/posix_types.h (renamed from arch/arm/include/asm/posix_types.h)0
-rw-r--r--arch/arm/include/uapi/asm/ptrace.h138
-rw-r--r--arch/arm/include/uapi/asm/setup.h187
-rw-r--r--arch/arm/include/uapi/asm/sigcontext.h (renamed from arch/arm/include/asm/sigcontext.h)0
-rw-r--r--arch/arm/include/uapi/asm/signal.h127
-rw-r--r--arch/arm/include/uapi/asm/stat.h (renamed from arch/arm/include/asm/stat.h)0
-rw-r--r--arch/arm/include/uapi/asm/statfs.h (renamed from arch/arm/include/asm/statfs.h)0
-rw-r--r--arch/arm/include/uapi/asm/swab.h53
-rw-r--r--arch/arm/include/uapi/asm/unistd.h450
-rw-r--r--arch/arm/kernel/Makefile11
-rw-r--r--arch/arm/kernel/arch_timer.c383
-rw-r--r--arch/arm/kernel/asm-offsets.c2
-rw-r--r--arch/arm/kernel/atags.h14
-rw-r--r--arch/arm/kernel/atags_compat.c (renamed from arch/arm/kernel/compat.c)4
-rw-r--r--arch/arm/kernel/atags_parse.c238
-rw-r--r--arch/arm/kernel/atags_proc.c (renamed from arch/arm/kernel/atags.c)0
-rw-r--r--arch/arm/kernel/bios32.c63
-rw-r--r--arch/arm/kernel/calls.S3
-rw-r--r--arch/arm/kernel/compat.h11
-rw-r--r--arch/arm/kernel/debug.S87
-rw-r--r--arch/arm/kernel/entry-common.S19
-rw-r--r--arch/arm/kernel/head.S18
-rw-r--r--arch/arm/kernel/hw_breakpoint.c62
-rw-r--r--arch/arm/kernel/hyp-stub.S223
-rw-r--r--arch/arm/kernel/leds.c121
-rw-r--r--arch/arm/kernel/machine_kexec.c29
-rw-r--r--arch/arm/kernel/perf_event.c347
-rw-r--r--arch/arm/kernel/perf_event_cpu.c295
-rw-r--r--arch/arm/kernel/perf_event_v6.c12
-rw-r--r--arch/arm/kernel/perf_event_v7.c32
-rw-r--r--arch/arm/kernel/perf_event_xscale.c10
-rw-r--r--arch/arm/kernel/pmu.c36
-rw-r--r--arch/arm/kernel/process.c80
-rw-r--r--arch/arm/kernel/ptrace.c19
-rw-r--r--arch/arm/kernel/sched_clock.c8
-rw-r--r--arch/arm/kernel/setup.c260
-rw-r--r--arch/arm/kernel/signal.c1
-rw-r--r--arch/arm/kernel/smp.c147
-rw-r--r--arch/arm/kernel/smp_twd.c48
-rw-r--r--arch/arm/kernel/suspend.c17
-rw-r--r--arch/arm/kernel/sys_arm.c63
-rw-r--r--arch/arm/kernel/time.c17
-rw-r--r--arch/arm/kernel/traps.c11
-rw-r--r--arch/arm/lib/delay.c34
-rw-r--r--arch/arm/lib/getuser.S23
-rw-r--r--arch/arm/lib/putuser.S6
-rw-r--r--arch/arm/mach-at91/Kconfig26
-rw-r--r--arch/arm/mach-at91/Makefile.boot24
-rw-r--r--arch/arm/mach-at91/at91rm9200.c1
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c94
-rw-r--r--arch/arm/mach-at91/at91sam9260.c3
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c92
-rw-r--r--arch/arm/mach-at91/at91sam9261.c2
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c74
-rw-r--r--arch/arm/mach-at91/at91sam9263.c6
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c163
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c4
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c12
-rw-r--r--arch/arm/mach-at91/at91sam9n12.c2
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c2
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c64
-rw-r--r--arch/arm/mach-at91/at91sam9x5.c3
-rw-r--r--arch/arm/mach-at91/at91x40.c2
-rw-r--r--arch/arm/mach-at91/at91x40_time.c4
-rw-r--r--arch/arm/mach-at91/board-afeb-9260v1.c14
-rw-r--r--arch/arm/mach-at91/board-carmeva.c14
-rw-r--r--arch/arm/mach-at91/board-cpu9krea.c17
-rw-r--r--arch/arm/mach-at91/board-cpuat91.c13
-rw-r--r--arch/arm/mach-at91/board-csb337.c16
-rw-r--r--arch/arm/mach-at91/board-eb9200.c14
-rw-r--r--arch/arm/mach-at91/board-ecbat91.c32
-rw-r--r--arch/arm/mach-at91/board-eco920.c36
-rw-r--r--arch/arm/mach-at91/board-flexibity.c14
-rw-r--r--arch/arm/mach-at91/board-foxg20.c16
-rw-r--r--arch/arm/mach-at91/board-kafa.c17
-rw-r--r--arch/arm/mach-at91/board-kb9202.c37
-rw-r--r--arch/arm/mach-at91/board-neocore926.c13
-rw-r--r--arch/arm/mach-at91/board-picotux200.c14
-rw-r--r--arch/arm/mach-at91/board-qil-a9260.c14
-rw-r--r--arch/arm/mach-at91/board-rm9200dk.c17
-rw-r--r--arch/arm/mach-at91/board-rm9200ek.c17
-rw-r--r--arch/arm/mach-at91/board-rsi-ews.c16
-rw-r--r--arch/arm/mach-at91/board-sam9-l9260.c39
-rw-r--r--arch/arm/mach-at91/board-sam9260ek.c16
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c16
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c13
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c16
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c13
-rw-r--r--arch/arm/mach-at91/board-stamp9g20.c14
-rw-r--r--arch/arm/mach-at91/board-usb-a926x.c2
-rw-r--r--arch/arm/mach-at91/board-yl-9200.c16
-rw-r--r--arch/arm/mach-at91/clock.c2
-rw-r--r--arch/arm/mach-at91/include/mach/at91_twi.h68
-rw-r--r--arch/arm/mach-at91/include/mach/at_hdmac.h61
-rw-r--r--arch/arm/mach-at91/include/mach/atmel-mci.h2
-rw-r--r--arch/arm/mach-at91/include/mach/board.h1
-rw-r--r--arch/arm/mach-at91/include/mach/hardware.h4
-rw-r--r--arch/arm/mach-at91/include/mach/uncompress.h6
-rw-r--r--arch/arm/mach-at91/leds.c105
-rw-r--r--arch/arm/mach-at91/pm.c5
-rw-r--r--arch/arm/mach-at91/setup.c6
-rw-r--r--arch/arm/mach-bcm2835/Makefile1
-rw-r--r--arch/arm/mach-bcm2835/Makefile.boot3
-rw-r--r--arch/arm/mach-bcm2835/bcm2835.c64
-rw-r--r--arch/arm/mach-bcm2835/include/mach/bcm2835_soc.h (renamed from arch/arm/mach-picoxcell/include/mach/hardware.h)18
-rw-r--r--arch/arm/mach-bcm2835/include/mach/debug-macro.S21
-rw-r--r--arch/arm/mach-bcm2835/include/mach/timex.h (renamed from arch/arm/mach-pnx4008/include/mach/param.h)11
-rw-r--r--arch/arm/mach-bcm2835/include/mach/uncompress.h45
-rw-r--r--arch/arm/mach-bcmring/Kconfig19
-rw-r--r--arch/arm/mach-bcmring/Makefile8
-rw-r--r--arch/arm/mach-bcmring/Makefile.boot6
-rw-r--r--arch/arm/mach-bcmring/arch.c199
-rw-r--r--arch/arm/mach-bcmring/clock.c223
-rw-r--r--arch/arm/mach-bcmring/clock.h33
-rw-r--r--arch/arm/mach-bcmring/core.c228
-rw-r--r--arch/arm/mach-bcmring/core.h31
-rw-r--r--arch/arm/mach-bcmring/csp/Makefile3
-rw-r--r--arch/arm/mach-bcmring/csp/chipc/Makefile1
-rw-r--r--arch/arm/mach-bcmring/csp/chipc/chipcHw.c776
-rw-r--r--arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c293
-rw-r--r--arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c124
-rw-r--r--arch/arm/mach-bcmring/csp/chipc/chipcHw_str.c64
-rw-r--r--arch/arm/mach-bcmring/csp/dmac/Makefile1
-rw-r--r--arch/arm/mach-bcmring/csp/dmac/dmacHw.c917
-rw-r--r--arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c1017
-rw-r--r--arch/arm/mach-bcmring/csp/tmr/Makefile1
-rw-r--r--arch/arm/mach-bcmring/csp/tmr/tmrHw.c576
-rw-r--r--arch/arm/mach-bcmring/dma.c1518
-rw-r--r--arch/arm/mach-bcmring/dma_device.c593
-rw-r--r--arch/arm/mach-bcmring/include/cfg_global.h13
-rw-r--r--arch/arm/mach-bcmring/include/cfg_global_defines.h40
-rw-r--r--arch/arm/mach-bcmring/include/csp/cache.h35
-rw-r--r--arch/arm/mach-bcmring/include/csp/delay.h36
-rw-r--r--arch/arm/mach-bcmring/include/csp/dmacHw.h596
-rw-r--r--arch/arm/mach-bcmring/include/csp/errno.h32
-rw-r--r--arch/arm/mach-bcmring/include/csp/intcHw.h40
-rw-r--r--arch/arm/mach-bcmring/include/csp/module.h32
-rw-r--r--arch/arm/mach-bcmring/include/csp/reg.h114
-rw-r--r--arch/arm/mach-bcmring/include/csp/secHw.h65
-rw-r--r--arch/arm/mach-bcmring/include/csp/stdint.h30
-rw-r--r--arch/arm/mach-bcmring/include/csp/string.h34
-rw-r--r--arch/arm/mach-bcmring/include/csp/tmrHw.h263
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/cap.h63
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/cap_inline.h409
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h1123
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h1673
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h530
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h872
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h145
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h406
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h73
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h246
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/mm_addr.h101
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/mm_io.h147
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/secHw_def.h100
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/secHw_inline.h79
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/tmrHw_reg.h82
-rw-r--r--arch/arm/mach-bcmring/include/mach/dma.h630
-rw-r--r--arch/arm/mach-bcmring/include/mach/entry-macro.S76
-rw-r--r--arch/arm/mach-bcmring/include/mach/hardware.h57
-rw-r--r--arch/arm/mach-bcmring/include/mach/irqs.h132
-rw-r--r--arch/arm/mach-bcmring/include/mach/memory_settings.h67
-rw-r--r--arch/arm/mach-bcmring/include/mach/reg_nand.h66
-rw-r--r--arch/arm/mach-bcmring/include/mach/reg_umi.h237
-rw-r--r--arch/arm/mach-bcmring/include/mach/timer.h77
-rw-r--r--arch/arm/mach-bcmring/include/mach/timex.h25
-rw-r--r--arch/arm/mach-bcmring/include/mach/uncompress.h43
-rw-r--r--arch/arm/mach-bcmring/irq.c126
-rw-r--r--arch/arm/mach-bcmring/mm.c60
-rw-r--r--arch/arm/mach-bcmring/timer.c61
-rw-r--r--arch/arm/mach-clps711x/Kconfig10
-rw-r--r--arch/arm/mach-clps711x/Makefile3
-rw-r--r--arch/arm/mach-clps711x/autcpu12.c19
-rw-r--r--arch/arm/mach-clps711x/ceiva.c64
-rw-r--r--arch/arm/mach-clps711x/common.c89
-rw-r--r--arch/arm/mach-clps711x/include/mach/clps711x.h9
-rw-r--r--arch/arm/mach-clps711x/include/mach/debug-macro.S8
-rw-r--r--arch/arm/mach-clps711x/include/mach/hardware.h48
-rw-r--r--arch/arm/mach-clps711x/include/mach/timex.h23
-rw-r--r--arch/arm/mach-clps711x/p720t-leds.c63
-rw-r--r--arch/arm/mach-clps711x/p720t.c62
-rw-r--r--arch/arm/mach-davinci/Kconfig23
-rw-r--r--arch/arm/mach-davinci/aemif.c2
-rw-r--r--arch/arm/mach-davinci/asp.h49
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c8
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c185
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c8
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c8
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c8
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c25
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c86
-rw-r--r--arch/arm/mach-davinci/board-mityomapl138.c4
-rw-r--r--arch/arm/mach-davinci/board-neuros-osd2.c8
-rw-r--r--arch/arm/mach-davinci/board-sffsdr.c4
-rw-r--r--arch/arm/mach-davinci/board-tnetv107x-evm.c6
-rw-r--r--arch/arm/mach-davinci/da830.c48
-rw-r--r--arch/arm/mach-davinci/da850.c160
-rw-r--r--arch/arm/mach-davinci/davinci.h6
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c8
-rw-r--r--arch/arm/mach-davinci/devices.c15
-rw-r--r--arch/arm/mach-davinci/dm355.c4
-rw-r--r--arch/arm/mach-davinci/dm365.c6
-rw-r--r--arch/arm/mach-davinci/dm644x.c19
-rw-r--r--arch/arm/mach-davinci/dm646x.c2
-rw-r--r--arch/arm/mach-davinci/include/mach/aemif.h36
-rw-r--r--arch/arm/mach-davinci/include/mach/asp.h137
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h21
-rw-r--r--arch/arm/mach-davinci/include/mach/i2c.h26
-rw-r--r--arch/arm/mach-davinci/include/mach/keyscan.h42
-rw-r--r--arch/arm/mach-davinci/include/mach/mmc.h39
-rw-r--r--arch/arm/mach-davinci/include/mach/mux.h42
-rw-r--r--arch/arm/mach-davinci/include/mach/nand.h90
-rw-r--r--arch/arm/mach-davinci/include/mach/psc.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/spi.h89
-rw-r--r--arch/arm/mach-davinci/include/mach/tnetv107x.h4
-rw-r--r--arch/arm/mach-davinci/include/mach/usb.h59
-rw-r--r--arch/arm/mach-davinci/usb.c2
-rw-r--r--arch/arm/mach-dove/Kconfig7
-rw-r--r--arch/arm/mach-dove/Makefile4
-rw-r--r--arch/arm/mach-dove/common.c171
-rw-r--r--arch/arm/mach-dove/common.h4
-rw-r--r--arch/arm/mach-dove/include/mach/bridge-regs.h16
-rw-r--r--arch/arm/mach-dove/include/mach/dove.h134
-rw-r--r--arch/arm/mach-dove/include/mach/gpio.h9
-rw-r--r--arch/arm/mach-dove/include/mach/io.h19
-rw-r--r--arch/arm/mach-dove/include/mach/pm.h54
-rw-r--r--arch/arm/mach-dove/irq.c11
-rw-r--r--arch/arm/mach-dove/mpp.c1
-rw-r--r--arch/arm/mach-dove/pcie.c49
-rw-r--r--arch/arm/mach-ebsa110/Makefile4
-rw-r--r--arch/arm/mach-ebsa110/core.c8
-rw-r--r--arch/arm/mach-ebsa110/core.h12
-rw-r--r--arch/arm/mach-ebsa110/leds.c81
-rw-r--r--arch/arm/mach-ep93xx/adssphere.c1
-rw-r--r--arch/arm/mach-ep93xx/core.c6
-rw-r--r--arch/arm/mach-ep93xx/dma.c2
-rw-r--r--arch/arm/mach-ep93xx/edb93xx.c4
-rw-r--r--arch/arm/mach-ep93xx/gesbc9312.c1
-rw-r--r--arch/arm/mach-ep93xx/include/mach/dma.h93
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h35
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ep93xx_spi.h29
-rw-r--r--arch/arm/mach-ep93xx/include/mach/fb.h56
-rw-r--r--arch/arm/mach-ep93xx/simone.c2
-rw-r--r--arch/arm/mach-ep93xx/snappercl15.c2
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c12
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.h (renamed from arch/arm/mach-ep93xx/include/mach/ts72xx.h)10
-rw-r--r--arch/arm/mach-ep93xx/vision_ep9307.c4
-rw-r--r--arch/arm/mach-exynos/Kconfig184
-rw-r--r--arch/arm/mach-exynos/Makefile.boot3
-rw-r--r--arch/arm/mach-exynos/clock-exynos4.c31
-rw-r--r--arch/arm/mach-exynos/clock-exynos5.c172
-rw-r--r--arch/arm/mach-exynos/common.c26
-rw-r--r--arch/arm/mach-exynos/common.h5
-rw-r--r--arch/arm/mach-exynos/dev-audio.c2
-rw-r--r--arch/arm/mach-exynos/dev-ohci.c2
-rw-r--r--arch/arm/mach-exynos/dma.c2
-rw-r--r--arch/arm/mach-exynos/hotplug.c18
-rw-r--r--arch/arm/mach-exynos/include/mach/map.h12
-rw-r--r--arch/arm/mach-exynos/include/mach/ohci.h21
-rw-r--r--arch/arm/mach-exynos/include/mach/sysmmu.h2
-rw-r--r--arch/arm/mach-exynos/mach-armlex4210.c1
-rw-r--r--arch/arm/mach-exynos/mach-exynos4-dt.c32
-rw-r--r--arch/arm/mach-exynos/mach-exynos5-dt.c17
-rw-r--r--arch/arm/mach-exynos/mach-nuri.c16
-rw-r--r--arch/arm/mach-exynos/mach-origen.c19
-rw-r--r--arch/arm/mach-exynos/mach-smdk4x12.c12
-rw-r--r--arch/arm/mach-exynos/mach-smdkv310.c17
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c14
-rw-r--r--arch/arm/mach-exynos/platsmp.c29
-rw-r--r--arch/arm/mach-exynos/setup-fimd0.c2
-rw-r--r--arch/arm/mach-exynos/setup-i2c0.c2
-rw-r--r--arch/arm/mach-exynos/setup-i2c1.c2
-rw-r--r--arch/arm/mach-exynos/setup-i2c2.c2
-rw-r--r--arch/arm/mach-exynos/setup-i2c3.c2
-rw-r--r--arch/arm/mach-exynos/setup-i2c4.c2
-rw-r--r--arch/arm/mach-exynos/setup-i2c5.c2
-rw-r--r--arch/arm/mach-exynos/setup-i2c6.c2
-rw-r--r--arch/arm/mach-exynos/setup-i2c7.c2
-rw-r--r--arch/arm/mach-footbridge/Kconfig2
-rw-r--r--arch/arm/mach-footbridge/Makefile4
-rw-r--r--arch/arm/mach-footbridge/common.c12
-rw-r--r--arch/arm/mach-footbridge/dc21285.c16
-rw-r--r--arch/arm/mach-footbridge/ebsa285-leds.c138
-rw-r--r--arch/arm/mach-footbridge/ebsa285.c81
-rw-r--r--arch/arm/mach-footbridge/include/mach/debug-macro.S3
-rw-r--r--arch/arm/mach-footbridge/include/mach/io.h12
-rw-r--r--arch/arm/mach-footbridge/include/mach/irqs.h2
-rw-r--r--arch/arm/mach-footbridge/netwinder-hw.c112
-rw-r--r--arch/arm/mach-footbridge/netwinder-leds.c138
-rw-r--r--arch/arm/mach-h720x/Kconfig2
-rw-r--r--arch/arm/mach-highbank/Kconfig15
-rw-r--r--arch/arm/mach-highbank/Makefile.boot1
-rw-r--r--arch/arm/mach-highbank/core.h9
-rw-r--r--arch/arm/mach-highbank/highbank.c54
-rw-r--r--arch/arm/mach-highbank/hotplug.c16
-rw-r--r--arch/arm/mach-highbank/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-highbank/include/mach/timex.h6
-rw-r--r--arch/arm/mach-highbank/include/mach/uncompress.h9
-rw-r--r--arch/arm/mach-highbank/platsmp.c18
-rw-r--r--arch/arm/mach-highbank/pm.c4
-rw-r--r--arch/arm/mach-imx/Kconfig225
-rw-r--r--arch/arm/mach-imx/Makefile11
-rw-r--r--arch/arm/mach-imx/Makefile.boot7
-rw-r--r--arch/arm/mach-imx/clk-imx21.c1
-rw-r--r--arch/arm/mach-imx/clk-imx25.c8
-rw-r--r--arch/arm/mach-imx/clk-imx27.c4
-rw-r--r--arch/arm/mach-imx/clk-imx35.c17
-rw-r--r--arch/arm/mach-imx/clk-imx51-imx53.c20
-rw-r--r--arch/arm/mach-imx/clk-imx6q.c51
-rw-r--r--arch/arm/mach-imx/clk-pllv1.c49
-rw-r--r--arch/arm/mach-imx/clk.c3
-rw-r--r--arch/arm/mach-imx/clk.h3
-rw-r--r--arch/arm/mach-imx/devices-imx27.h4
-rw-r--r--arch/arm/mach-imx/devices-imx53.h48
-rw-r--r--arch/arm/mach-imx/efika.h10
-rw-r--r--arch/arm/mach-imx/ehci-imx25.c2
-rw-r--r--arch/arm/mach-imx/ehci-imx27.c2
-rw-r--r--arch/arm/mach-imx/ehci-imx31.c2
-rw-r--r--arch/arm/mach-imx/ehci-imx35.c2
-rw-r--r--arch/arm/mach-imx/ehci-imx5.c2
-rw-r--r--arch/arm/mach-imx/eukrea_mbimx27-baseboard.c1
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c1
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c1
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c1
-rw-r--r--arch/arm/mach-imx/hotplug.c16
-rw-r--r--arch/arm/mach-imx/imx51-dt.c21
-rw-r--r--arch/arm/mach-imx/mach-armadillo5x0.c3
-rw-r--r--arch/arm/mach-imx/mach-imx27_visstrim_m10.c91
-rw-r--r--arch/arm/mach-imx/mach-imx53.c (renamed from arch/arm/mach-imx/imx53-dt.c)27
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c59
-rw-r--r--arch/arm/mach-imx/mach-kzm_arm11_01.c5
-rw-r--r--arch/arm/mach-imx/mach-mx27_3ds.c21
-rw-r--r--arch/arm/mach-imx/mach-mx31ads.c2
-rw-r--r--arch/arm/mach-imx/mach-mx31lite.c2
-rw-r--r--arch/arm/mach-imx/mach-mx31moboard.c2
-rw-r--r--arch/arm/mach-imx/mach-mx51_efikamx.c300
-rw-r--r--arch/arm/mach-imx/mach-mx51_efikasb.c296
-rw-r--r--arch/arm/mach-imx/mach-mx53_ard.c272
-rw-r--r--arch/arm/mach-imx/mach-mx53_evk.c179
-rw-r--r--arch/arm/mach-imx/mach-mx53_loco.c321
-rw-r--r--arch/arm/mach-imx/mach-mx53_smd.c168
-rw-r--r--arch/arm/mach-imx/mm-imx5.c47
-rw-r--r--arch/arm/mach-imx/mx1-camera-fiq-ksym.c2
-rw-r--r--arch/arm/mach-imx/mx51_efika.c633
-rw-r--r--arch/arm/mach-imx/platsmp.c18
-rw-r--r--arch/arm/mach-integrator/Makefile3
-rw-r--r--arch/arm/mach-integrator/common.h3
-rw-r--r--arch/arm/mach-integrator/core.c24
-rw-r--r--arch/arm/mach-integrator/cpu.c8
-rw-r--r--arch/arm/mach-integrator/include/mach/cm.h2
-rw-r--r--arch/arm/mach-integrator/include/mach/io.h33
-rw-r--r--arch/arm/mach-integrator/include/mach/platform.h4
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c299
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c331
-rw-r--r--arch/arm/mach-integrator/leds.c161
-rw-r--r--arch/arm/mach-integrator/pci_v3.c62
-rw-r--r--arch/arm/mach-iop13xx/include/mach/io.h28
-rw-r--r--arch/arm/mach-iop13xx/include/mach/iop13xx.h48
-rw-r--r--arch/arm/mach-iop13xx/include/mach/memory.h14
-rw-r--r--arch/arm/mach-iop13xx/io.c35
-rw-r--r--arch/arm/mach-iop13xx/iq81340sc.c2
-rw-r--r--arch/arm/mach-iop13xx/pci.c55
-rw-r--r--arch/arm/mach-iop13xx/pci.h4
-rw-r--r--arch/arm/mach-iop13xx/setup.c20
-rw-r--r--arch/arm/mach-iop32x/glantank.c2
-rw-r--r--arch/arm/mach-iop32x/include/mach/io.h19
-rw-r--r--arch/arm/mach-iop33x/include/mach/io.h19
-rw-r--r--arch/arm/mach-ixp4xx/Kconfig2
-rw-r--r--arch/arm/mach-ixp4xx/common.c8
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/cpu.h5
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/gpio.h2
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h10
-rw-r--r--arch/arm/mach-kirkwood/Kconfig21
-rw-r--r--arch/arm/mach-kirkwood/Makefile3
-rw-r--r--arch/arm/mach-kirkwood/Makefile.boot11
-rw-r--r--arch/arm/mach-kirkwood/addr-map.c3
-rw-r--r--arch/arm/mach-kirkwood/board-dnskw.c35
-rw-r--r--arch/arm/mach-kirkwood/board-dockstar.c61
-rw-r--r--arch/arm/mach-kirkwood/board-dreamplug.c2
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c14
-rw-r--r--arch/arm/mach-kirkwood/board-goflexnet.c2
-rw-r--r--arch/arm/mach-kirkwood/board-iconnect.c48
-rw-r--r--arch/arm/mach-kirkwood/board-iomega_ix2_200.c57
-rw-r--r--arch/arm/mach-kirkwood/board-km_kirkwood.c57
-rw-r--r--arch/arm/mach-kirkwood/common.c28
-rw-r--r--arch/arm/mach-kirkwood/common.h18
-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.c2
-rw-r--r--arch/arm/mach-kirkwood/guruplug-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/include/mach/bridge-regs.h20
-rw-r--r--arch/arm/mach-kirkwood/include/mach/gpio.h9
-rw-r--r--arch/arm/mach-kirkwood/include/mach/io.h24
-rw-r--r--arch/arm/mach-kirkwood/include/mach/kirkwood.h120
-rw-r--r--arch/arm/mach-kirkwood/include/mach/leds-netxbig.h55
-rw-r--r--arch/arm/mach-kirkwood/include/mach/leds-ns2.h26
-rw-r--r--arch/arm/mach-kirkwood/irq.c10
-rw-r--r--arch/arm/mach-kirkwood/netspace_v2-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/netxbig_v2-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/openrd-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/pcie.c56
-rw-r--r--arch/arm/mach-kirkwood/rd88f6192-nas-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/rd88f6281-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/sheevaplug-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/ts41x-setup.c3
-rw-r--r--arch/arm/mach-ks8695/Kconfig61
-rw-r--r--arch/arm/mach-ks8695/Makefile11
-rw-r--r--arch/arm/mach-ks8695/board-og.c199
-rw-r--r--arch/arm/mach-ks8695/board-sg.c121
-rw-r--r--arch/arm/mach-ks8695/cpu.c2
-rw-r--r--arch/arm/mach-ks8695/devices.c21
-rw-r--r--arch/arm/mach-ks8695/include/mach/devices.h5
-rw-r--r--arch/arm/mach-ks8695/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-ks8695/include/mach/memory.h3
-rw-r--r--arch/arm/mach-ks8695/include/mach/regs-timer.h40
-rw-r--r--arch/arm/mach-ks8695/include/mach/uncompress.h6
-rw-r--r--arch/arm/mach-ks8695/leds.c92
-rw-r--r--arch/arm/mach-ks8695/time.c133
-rw-r--r--arch/arm/mach-lpc32xx/Makefile.boot2
-rw-r--r--arch/arm/mach-lpc32xx/common.c8
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/gpio-lpc32xx.h2
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-lpc32xx/irq.c7
-rw-r--r--arch/arm/mach-lpc32xx/phy3250.c42
-rw-r--r--arch/arm/mach-mmp/Kconfig3
-rw-r--r--arch/arm/mach-mmp/Makefile8
-rw-r--r--arch/arm/mach-mmp/aspenite.c2
-rw-r--r--arch/arm/mach-mmp/clock-mmp2.c111
-rw-r--r--arch/arm/mach-mmp/clock-pxa168.c91
-rw-r--r--arch/arm/mach-mmp/clock-pxa910.c67
-rw-r--r--arch/arm/mach-mmp/common.h3
-rw-r--r--arch/arm/mach-mmp/include/mach/debug-macro.S12
-rw-r--r--arch/arm/mach-mmp/include/mach/mmp2.h2
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa168.h4
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa910.h2
-rw-r--r--arch/arm/mach-mmp/include/mach/regs-apbc.h95
-rw-r--r--arch/arm/mach-mmp/include/mach/regs-apmu.h15
-rw-r--r--arch/arm/mach-mmp/include/mach/sram.h35
-rw-r--r--arch/arm/mach-mmp/irq.c4
-rw-r--r--arch/arm/mach-mmp/mmp2.c73
-rw-r--r--arch/arm/mach-mmp/pxa168.c58
-rw-r--r--arch/arm/mach-mmp/pxa910.c44
-rw-r--r--arch/arm/mach-mmp/sram.c2
-rw-r--r--arch/arm/mach-mmp/teton_bga.c2
-rw-r--r--arch/arm/mach-mmp/ttc_dkb.c10
-rw-r--r--arch/arm/mach-msm/Kconfig77
-rw-r--r--arch/arm/mach-msm/Makefile8
-rw-r--r--arch/arm/mach-msm/acpuclock-arm11.c525
-rw-r--r--arch/arm/mach-msm/acpuclock.h32
-rw-r--r--arch/arm/mach-msm/board-dt-8660.c64
-rw-r--r--arch/arm/mach-msm/board-dt-8960.c50
-rw-r--r--arch/arm/mach-msm/board-halibut.c5
-rw-r--r--arch/arm/mach-msm/board-mahimahi.c1
-rw-r--r--arch/arm/mach-msm/board-msm7x27.c170
-rw-r--r--arch/arm/mach-msm/board-msm7x30.c9
-rw-r--r--arch/arm/mach-msm/board-msm8960.c122
-rw-r--r--arch/arm/mach-msm/board-msm8x60.c166
-rw-r--r--arch/arm/mach-msm/board-qsd8x50.c13
-rw-r--r--arch/arm/mach-msm/board-sapphire.c1
-rw-r--r--arch/arm/mach-msm/board-trout-mmc.c2
-rw-r--r--arch/arm/mach-msm/board-trout-panel.c2
-rw-r--r--arch/arm/mach-msm/board-trout.c5
-rw-r--r--arch/arm/mach-msm/clock-pcom.c18
-rw-r--r--arch/arm/mach-msm/common.h32
-rw-r--r--arch/arm/mach-msm/core.h2
-rw-r--r--arch/arm/mach-msm/devices-msm7x00.c2
-rw-r--r--arch/arm/mach-msm/devices-msm7x30.c2
-rw-r--r--arch/arm/mach-msm/devices-msm8960.c85
-rw-r--r--arch/arm/mach-msm/devices-qsd8x50.c2
-rw-r--r--arch/arm/mach-msm/dma.c3
-rw-r--r--arch/arm/mach-msm/hotplug.c18
-rw-r--r--arch/arm/mach-msm/idle.c49
-rw-r--r--arch/arm/mach-msm/include/mach/board.h15
-rw-r--r--arch/arm/mach-msm/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-msm/include/mach/mmc.h30
-rw-r--r--arch/arm/mach-msm/include/mach/msm_fb.h147
-rw-r--r--arch/arm/mach-msm/include/mach/msm_iomap-7x00.h7
-rw-r--r--arch/arm/mach-msm/include/mach/msm_iomap-7x30.h4
-rw-r--r--arch/arm/mach-msm/include/mach/msm_iomap-8960.h6
-rw-r--r--arch/arm/mach-msm/include/mach/msm_iomap-8x50.h4
-rw-r--r--arch/arm/mach-msm/include/mach/msm_iomap-8x60.h17
-rw-r--r--arch/arm/mach-msm/include/mach/msm_iomap.h3
-rw-r--r--arch/arm/mach-msm/include/mach/system.h19
-rw-r--r--arch/arm/mach-msm/io.c32
-rw-r--r--arch/arm/mach-msm/platsmp.c32
-rw-r--r--arch/arm/mach-msm/proc_comm.c1
-rw-r--r--arch/arm/mach-msm/smd.c26
-rw-r--r--arch/arm/mach-msm/timer.c188
-rw-r--r--arch/arm/mach-mv78xx0/addr-map.c11
-rw-r--r--arch/arm/mach-mv78xx0/common.c15
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/bridge-regs.h12
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/io.h24
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/mv78xx0.h105
-rw-r--r--arch/arm/mach-mv78xx0/irq.c10
-rw-r--r--arch/arm/mach-mv78xx0/pcie.c122
-rw-r--r--arch/arm/mach-mvebu/Kconfig30
-rw-r--r--arch/arm/mach-mvebu/Makefile5
-rw-r--r--arch/arm/mach-mvebu/Makefile.boot3
-rw-r--r--arch/arm/mach-mvebu/addr-map.c134
-rw-r--r--arch/arm/mach-mvebu/armada-370-xp.c4
-rw-r--r--arch/arm/mach-mvebu/armada-370-xp.h (renamed from arch/arm/mach-mvebu/include/mach/armada-370-xp.h)2
-rw-r--r--arch/arm/mach-mvebu/include/mach/gpio.h (renamed from arch/arm/mach-ep93xx/include/mach/gpio.h)0
-rw-r--r--arch/arm/mach-mvebu/include/mach/timex.h13
-rw-r--r--arch/arm/mach-mvebu/include/mach/uncompress.h43
-rw-r--r--arch/arm/mach-mxs/Kconfig89
-rw-r--r--arch/arm/mach-mxs/Makefile11
-rw-r--r--arch/arm/mach-mxs/Makefile.boot9
-rw-r--r--arch/arm/mach-mxs/devices-mx23.h43
-rw-r--r--arch/arm/mach-mxs/devices-mx28.h63
-rw-r--r--arch/arm/mach-mxs/devices.c87
-rw-r--r--arch/arm/mach-mxs/devices/Kconfig33
-rw-r--r--arch/arm/mach-mxs/devices/Makefile12
-rw-r--r--arch/arm/mach-mxs/devices/platform-auart.c65
-rw-r--r--arch/arm/mach-mxs/devices/platform-dma.c31
-rw-r--r--arch/arm/mach-mxs/devices/platform-fec.c52
-rw-r--r--arch/arm/mach-mxs/devices/platform-flexcan.c51
-rw-r--r--arch/arm/mach-mxs/devices/platform-gpio-mxs.c33
-rw-r--r--arch/arm/mach-mxs/devices/platform-gpmi-nand.c81
-rw-r--r--arch/arm/mach-mxs/devices/platform-mxs-i2c.c52
-rw-r--r--arch/arm/mach-mxs/devices/platform-mxs-mmc.c76
-rw-r--r--arch/arm/mach-mxs/devices/platform-mxs-pwm.c22
-rw-r--r--arch/arm/mach-mxs/devices/platform-mxs-saif.c61
-rw-r--r--arch/arm/mach-mxs/devices/platform-mxsfb.c47
-rw-r--r--arch/arm/mach-mxs/devices/platform-rtc-stmp3xxx.c51
-rw-r--r--arch/arm/mach-mxs/icoll.c63
-rw-r--r--arch/arm/mach-mxs/include/mach/common.h12
-rw-r--r--arch/arm/mach-mxs/include/mach/devices-common.h114
-rw-r--r--arch/arm/mach-mxs/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-mxs/include/mach/iomux-mx23.h355
-rw-r--r--arch/arm/mach-mxs/include/mach/iomux-mx28.h537
-rw-r--r--arch/arm/mach-mxs/include/mach/iomux.h168
-rw-r--r--arch/arm/mach-mxs/include/mach/irqs.h32
-rw-r--r--arch/arm/mach-mxs/iomux.c101
-rw-r--r--arch/arm/mach-mxs/mach-apx4devkit.c273
-rw-r--r--arch/arm/mach-mxs/mach-m28evk.c366
-rw-r--r--arch/arm/mach-mxs/mach-mx23evk.c190
-rw-r--r--arch/arm/mach-mxs/mach-mx28evk.c477
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c171
-rw-r--r--arch/arm/mach-mxs/mach-stmp378x_devb.c123
-rw-r--r--arch/arm/mach-mxs/mach-tx28.c184
-rw-r--r--arch/arm/mach-mxs/mm.c39
-rw-r--r--arch/arm/mach-mxs/module-tx28.c160
-rw-r--r--arch/arm/mach-mxs/module-tx28.h10
-rw-r--r--arch/arm/mach-mxs/timer.c13
-rw-r--r--arch/arm/mach-netx/include/mach/eth.h27
-rw-r--r--arch/arm/mach-netx/nxdb500.c2
-rw-r--r--arch/arm/mach-netx/nxdkn.c2
-rw-r--r--arch/arm/mach-netx/nxeb500hmi.c2
-rw-r--r--arch/arm/mach-nomadik/Kconfig4
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c41
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c13
-rw-r--r--arch/arm/mach-nomadik/include/mach/gpio.h4
-rw-r--r--arch/arm/mach-nomadik/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-nomadik/include/mach/nand.h16
-rw-r--r--arch/arm/mach-nomadik/include/mach/uncompress.h8
-rw-r--r--arch/arm/mach-omap1/Kconfig8
-rw-r--r--arch/arm/mach-omap1/Makefile8
-rw-r--r--arch/arm/mach-omap1/ams-delta-fiq-handler.S3
-rw-r--r--arch/arm/mach-omap1/ams-delta-fiq.c2
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c8
-rw-r--r--arch/arm/mach-omap1/board-fsample.c7
-rw-r--r--arch/arm/mach-omap1/board-generic.c8
-rw-r--r--arch/arm/mach-omap1/board-h2.c41
-rw-r--r--arch/arm/mach-omap1/board-h3.c39
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c8
-rw-r--r--arch/arm/mach-omap1/board-innovator.c6
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c8
-rw-r--r--arch/arm/mach-omap1/board-osk.c41
-rw-r--r--arch/arm/mach-omap1/board-palmte.c10
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c10
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c10
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c7
-rw-r--r--arch/arm/mach-omap1/board-sx1-mmc.c2
-rw-r--r--arch/arm/mach-omap1/board-sx1.c11
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c12
-rw-r--r--arch/arm/mach-omap1/clock.c4
-rw-r--r--arch/arm/mach-omap1/clock_data.c21
-rw-r--r--arch/arm/mach-omap1/devices.c35
-rw-r--r--arch/arm/mach-omap1/dma.c8
-rw-r--r--arch/arm/mach-omap1/flash.c2
-rw-r--r--arch/arm/mach-omap1/gpio15xx.c1
-rw-r--r--arch/arm/mach-omap1/gpio16xx.c1
-rw-r--r--arch/arm/mach-omap1/gpio7xx.c1
-rw-r--r--arch/arm/mach-omap1/i2c.c2
-rw-r--r--arch/arm/mach-omap1/include/mach/ams-delta-fiq.h2
-rw-r--r--arch/arm/mach-omap1/include/mach/board-ams-delta.h (renamed from arch/arm/plat-omap/include/plat/board-ams-delta.h)0
-rw-r--r--arch/arm/mach-omap1/include/mach/board-sx1.h (renamed from arch/arm/plat-omap/include/plat/board-sx1.h)0
-rw-r--r--arch/arm/mach-omap1/include/mach/board-voiceblue.h (renamed from arch/arm/plat-omap/include/plat/board-voiceblue.h)0
-rw-r--r--arch/arm/mach-omap1/include/mach/flash.h (renamed from arch/arm/plat-omap/include/plat/flash.h)0
-rw-r--r--arch/arm/mach-omap1/include/mach/gpio.h2
-rw-r--r--arch/arm/mach-omap1/include/mach/hardware.h285
-rw-r--r--arch/arm/mach-omap1/include/mach/irda.h (renamed from arch/arm/plat-omap/include/plat/irda.h)0
-rw-r--r--arch/arm/mach-omap1/include/mach/irqs.h267
-rw-r--r--arch/arm/mach-omap1/include/mach/mux.h (renamed from arch/arm/plat-omap/include/plat/mux.h)0
-rw-r--r--arch/arm/mach-omap1/include/mach/omap1510.h (renamed from arch/arm/plat-omap/include/plat/omap1510.h)3
-rw-r--r--arch/arm/mach-omap1/include/mach/omap16xx.h (renamed from arch/arm/plat-omap/include/plat/omap16xx.h)3
-rw-r--r--arch/arm/mach-omap1/include/mach/omap7xx.h (renamed from arch/arm/plat-omap/include/plat/omap7xx.h)3
-rw-r--r--arch/arm/mach-omap1/include/mach/smp.h5
-rw-r--r--arch/arm/mach-omap1/io.c2
-rw-r--r--arch/arm/mach-omap1/lcd_dma.c6
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c166
-rw-r--r--arch/arm/mach-omap1/leds-innovator.c98
-rw-r--r--arch/arm/mach-omap1/leds-osk.c113
-rw-r--r--arch/arm/mach-omap1/leds.c69
-rw-r--r--arch/arm/mach-omap1/leds.h3
-rw-r--r--arch/arm/mach-omap1/mcbsp.c4
-rw-r--r--arch/arm/mach-omap1/mux.c58
-rw-r--r--arch/arm/mach-omap1/pm.c2
-rw-r--r--arch/arm/mach-omap1/serial.c3
-rw-r--r--arch/arm/mach-omap1/time.c1
-rw-r--r--arch/arm/mach-omap1/timer.c2
-rw-r--r--arch/arm/mach-omap1/timer32k.c1
-rw-r--r--arch/arm/mach-omap1/usb.c2
-rw-r--r--arch/arm/mach-omap2/Kconfig71
-rw-r--r--arch/arm/mach-omap2/Makefile117
-rw-r--r--arch/arm/mach-omap2/am33xx.h (renamed from arch/arm/plat-omap/include/plat/am33xx.h)0
-rw-r--r--arch/arm/mach-omap2/am35xx-emac.c2
-rw-r--r--arch/arm/mach-omap2/am35xx.h (renamed from arch/arm/mach-omap2/include/mach/am35xx.h)0
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c8
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c14
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c8
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c118
-rw-r--r--arch/arm/mach-omap2/board-am3517crane.c10
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c26
-rw-r--r--arch/arm/mach-omap2/board-apollon.c6
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c17
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c13
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c14
-rw-r--r--arch/arm/mach-omap2/board-flash.c10
-rw-r--r--arch/arm/mach-omap2/board-generic.c4
-rw-r--r--arch/arm/mach-omap2/board-h4.c11
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c10
-rw-r--r--arch/arm/mach-omap2/board-ldp.c11
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c16
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c10
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c34
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c18
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c9
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c26
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c9
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c64
-rw-r--r--arch/arm/mach-omap2/board-overo.c20
-rw-r--r--arch/arm/mach-omap2/board-rm680.c8
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c47
-rw-r--r--arch/arm/mach-omap2/board-rx51-video.c4
-rw-r--r--arch/arm/mach-omap2/board-rx51.c4
-rw-r--r--arch/arm/mach-omap2/board-rx51.h (renamed from arch/arm/mach-omap2/include/mach/board-rx51.h)0
-rw-r--r--arch/arm/mach-omap2/board-ti8168evm.c8
-rw-r--r--arch/arm/mach-omap2/board-zoom-debugboard.c12
-rw-r--r--arch/arm/mach-omap2/board-zoom-display.c4
-rw-r--r--arch/arm/mach-omap2/board-zoom-peripherals.c18
-rw-r--r--arch/arm/mach-omap2/board-zoom.c1
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_apll.c2
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c12
-rw-r--r--arch/arm/mach-omap2/clkt34xx_dpll3m2.c30
-rw-r--r--arch/arm/mach-omap2/clkt_clksel.c96
-rw-r--r--arch/arm/mach-omap2/clkt_dpll.c40
-rw-r--r--arch/arm/mach-omap2/clock.c35
-rw-r--r--arch/arm/mach-omap2/clock2420_data.c26
-rw-r--r--arch/arm/mach-omap2/clock2430.c2
-rw-r--r--arch/arm/mach-omap2/clock2430_data.c26
-rw-r--r--arch/arm/mach-omap2/clock2xxx.c2
-rw-r--r--arch/arm/mach-omap2/clock33xx_data.c21
-rw-r--r--arch/arm/mach-omap2/clock3xxx.c13
-rw-r--r--arch/arm/mach-omap2/clock3xxx_data.c40
-rw-r--r--arch/arm/mach-omap2/clock44xx_data.c23
-rw-r--r--arch/arm/mach-omap2/clockdomain.c91
-rw-r--r--arch/arm/mach-omap2/clockdomain.h20
-rw-r--r--arch/arm/mach-omap2/clockdomain2xxx_3xxx.c97
-rw-r--r--arch/arm/mach-omap2/clockdomain44xx.c11
-rw-r--r--arch/arm/mach-omap2/clockdomains3xxx_data.c7
-rw-r--r--arch/arm/mach-omap2/clockdomains44xx_data.c3
-rw-r--r--arch/arm/mach-omap2/cm-regbits-33xx.h158
-rw-r--r--arch/arm/mach-omap2/cm-regbits-34xx.h3
-rw-r--r--arch/arm/mach-omap2/cm-regbits-44xx.h411
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.c5
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.h1
-rw-r--r--arch/arm/mach-omap2/common-board-devices.c8
-rw-r--r--arch/arm/mach-omap2/common.c4
-rw-r--r--arch/arm/mach-omap2/common.h14
-rw-r--r--arch/arm/mach-omap2/control.c2
-rw-r--r--arch/arm/mach-omap2/control.h11
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c1
-rw-r--r--arch/arm/mach-omap2/ctrl_module_core_44xx.h (renamed from arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h)0
-rw-r--r--arch/arm/mach-omap2/ctrl_module_pad_core_44xx.h (renamed from arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h)0
-rw-r--r--arch/arm/mach-omap2/ctrl_module_pad_wkup_44xx.h (renamed from arch/arm/mach-omap2/include/mach/ctrl_module_pad_wkup_44xx.h)0
-rw-r--r--arch/arm/mach-omap2/ctrl_module_wkup_44xx.h (renamed from arch/arm/mach-omap2/include/mach/ctrl_module_wkup_44xx.h)0
-rw-r--r--arch/arm/mach-omap2/debug-devices.h9
-rw-r--r--arch/arm/mach-omap2/devices.c64
-rw-r--r--arch/arm/mach-omap2/display.c13
-rw-r--r--arch/arm/mach-omap2/dpll3xxx.c61
-rw-r--r--arch/arm/mach-omap2/dpll44xx.c2
-rw-r--r--arch/arm/mach-omap2/dsp.c2
-rw-r--r--arch/arm/mach-omap2/emu.c3
-rw-r--r--arch/arm/mach-omap2/gpio.c3
-rw-r--r--arch/arm/mach-omap2/gpmc-nand.c34
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c29
-rw-r--r--arch/arm/mach-omap2/gpmc-smc91x.c5
-rw-r--r--arch/arm/mach-omap2/gpmc-smc91x.h (renamed from arch/arm/plat-omap/include/plat/gpmc-smc91x.h)0
-rw-r--r--arch/arm/mach-omap2/gpmc-smsc911x.c3
-rw-r--r--arch/arm/mach-omap2/gpmc-smsc911x.h (renamed from arch/arm/plat-omap/include/plat/gpmc-smsc911x.h)0
-rw-r--r--arch/arm/mach-omap2/gpmc.c349
-rw-r--r--arch/arm/mach-omap2/hdq1w.c2
-rw-r--r--arch/arm/mach-omap2/hdq1w.h (renamed from arch/arm/plat-omap/include/plat/hdq1w.h)0
-rw-r--r--arch/arm/mach-omap2/hsmmc.c5
-rw-r--r--arch/arm/mach-omap2/i2c.c1
-rw-r--r--arch/arm/mach-omap2/id.c9
-rw-r--r--arch/arm/mach-omap2/id.h (renamed from arch/arm/mach-omap2/include/mach/id.h)0
-rw-r--r--arch/arm/mach-omap2/include/mach/board-zoom.h2
-rw-r--r--arch/arm/mach-omap2/include/mach/gpio.h2
-rw-r--r--arch/arm/mach-omap2/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-omap2/include/mach/irqs.h2
-rw-r--r--arch/arm/mach-omap2/include/mach/smp.h5
-rw-r--r--arch/arm/mach-omap2/io.c3
-rw-r--r--arch/arm/mach-omap2/irq.c10
-rw-r--r--arch/arm/mach-omap2/l3_2xxx.h (renamed from arch/arm/plat-omap/include/plat/l3_2xxx.h)0
-rw-r--r--arch/arm/mach-omap2/l3_3xxx.h (renamed from arch/arm/plat-omap/include/plat/l3_3xxx.h)0
-rw-r--r--arch/arm/mach-omap2/l4_2xxx.h (renamed from arch/arm/plat-omap/include/plat/l4_2xxx.h)0
-rw-r--r--arch/arm/mach-omap2/l4_3xxx.h (renamed from arch/arm/plat-omap/include/plat/l4_3xxx.h)0
-rw-r--r--arch/arm/mach-omap2/mailbox.c4
-rw-r--r--arch/arm/mach-omap2/mcbsp.c130
-rw-r--r--arch/arm/mach-omap2/msdi.c1
-rw-r--r--arch/arm/mach-omap2/mux.c2
-rw-r--r--arch/arm/mach-omap2/omap-hotplug.c18
-rw-r--r--arch/arm/mach-omap2/omap-iommu.c12
-rw-r--r--arch/arm/mach-omap2/omap-mpuss-lowpower.c3
-rw-r--r--arch/arm/mach-omap2/omap-secure.c6
-rw-r--r--arch/arm/mach-omap2/omap-secure.h (renamed from arch/arm/mach-omap2/include/mach/omap-secure.h)0
-rw-r--r--arch/arm/mach-omap2/omap-smp.c24
-rw-r--r--arch/arm/mach-omap2/omap-wakeupgen.c15
-rw-r--r--arch/arm/mach-omap2/omap-wakeupgen.h (renamed from arch/arm/mach-omap2/include/mach/omap-wakeupgen.h)0
-rw-r--r--arch/arm/mach-omap2/omap24xx.h (renamed from arch/arm/plat-omap/include/plat/omap24xx.h)2
-rw-r--r--arch/arm/mach-omap2/omap34xx.h (renamed from arch/arm/plat-omap/include/plat/omap34xx.h)2
-rw-r--r--arch/arm/mach-omap2/omap4-common.c16
-rw-r--r--arch/arm/mach-omap2/omap4-keypad.h (renamed from arch/arm/plat-omap/include/plat/omap4-keypad.h)2
-rw-r--r--arch/arm/mach-omap2/omap44xx.h (renamed from arch/arm/plat-omap/include/plat/omap44xx.h)2
-rw-r--r--arch/arm/mach-omap2/omap54xx.h (renamed from arch/arm/plat-omap/include/plat/omap54xx.h)0
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c385
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c51
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c99
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c110
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c21
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c120
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_data.c3381
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c462
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c270
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_common_data.h7
-rw-r--r--arch/arm/mach-omap2/omap_l3_noc.c266
-rw-r--r--arch/arm/mach-omap2/omap_l3_noc.h176
-rw-r--r--arch/arm/mach-omap2/omap_l3_smx.c297
-rw-r--r--arch/arm/mach-omap2/omap_l3_smx.h338
-rw-r--r--arch/arm/mach-omap2/omap_phy_internal.c140
-rw-r--r--arch/arm/mach-omap2/opp.c34
-rw-r--r--arch/arm/mach-omap2/opp2420_data.c2
-rw-r--r--arch/arm/mach-omap2/opp2430_data.c2
-rw-r--r--arch/arm/mach-omap2/opp3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/opp4xxx_data.c3
-rw-r--r--arch/arm/mach-omap2/pm-debug.c3
-rw-r--r--arch/arm/mach-omap2/pm.c22
-rw-r--r--arch/arm/mach-omap2/pm24xx.c14
-rw-r--r--arch/arm/mach-omap2/pm34xx.c10
-rw-r--r--arch/arm/mach-omap2/pm44xx.c8
-rw-r--r--arch/arm/mach-omap2/pmu.c95
-rw-r--r--arch/arm/mach-omap2/powerdomain.c42
-rw-r--r--arch/arm/mach-omap2/powerdomain2xxx_3xxx.c4
-rw-r--r--arch/arm/mach-omap2/powerdomain44xx.c65
-rw-r--r--arch/arm/mach-omap2/powerdomains3xxx_data.c4
-rw-r--r--arch/arm/mach-omap2/prcm-common.h2
-rw-r--r--arch/arm/mach-omap2/prcm.c9
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c7
-rw-r--r--arch/arm/mach-omap2/prm44xx.c5
-rw-r--r--arch/arm/mach-omap2/prm_common.c1
-rw-r--r--arch/arm/mach-omap2/sdrc2xxx.c2
-rw-r--r--arch/arm/mach-omap2/serial.c32
-rw-r--r--arch/arm/mach-omap2/sleep24xx.S3
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S2
-rw-r--r--arch/arm/mach-omap2/sleep44xx.S4
-rw-r--r--arch/arm/mach-omap2/soc.h7
-rw-r--r--arch/arm/mach-omap2/sr_device.c15
-rw-r--r--arch/arm/mach-omap2/sram242x.S3
-rw-r--r--arch/arm/mach-omap2/sram243x.S3
-rw-r--r--arch/arm/mach-omap2/sram34xx.S3
-rw-r--r--arch/arm/mach-omap2/ti81xx.h (renamed from arch/arm/plat-omap/include/plat/ti81xx.h)0
-rw-r--r--arch/arm/mach-omap2/timer.c121
-rw-r--r--arch/arm/mach-omap2/twl-common.c78
-rw-r--r--arch/arm/mach-omap2/twl-common.h11
-rw-r--r--arch/arm/mach-omap2/usb-host.c33
-rw-r--r--arch/arm/mach-omap2/usb-musb.c10
-rw-r--r--arch/arm/mach-omap2/vc.c8
-rw-r--r--arch/arm/mach-omap2/voltage.c12
-rw-r--r--arch/arm/mach-omap2/voltage.h2
-rw-r--r--arch/arm/mach-omap2/voltagedomains3xxx_data.c3
-rw-r--r--arch/arm/mach-omap2/vp.c16
-rw-r--r--arch/arm/mach-orion5x/addr-map.c3
-rw-r--r--arch/arm/mach-orion5x/common.c25
-rw-r--r--arch/arm/mach-orion5x/d2net-setup.c1
-rw-r--r--arch/arm/mach-orion5x/db88f5281-setup.c2
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c3
-rw-r--r--arch/arm/mach-orion5x/include/mach/bridge-regs.h20
-rw-r--r--arch/arm/mach-orion5x/include/mach/gpio.h9
-rw-r--r--arch/arm/mach-orion5x/include/mach/io.h22
-rw-r--r--arch/arm/mach-orion5x/include/mach/orion5x.h72
-rw-r--r--arch/arm/mach-orion5x/irq.c6
-rw-r--r--arch/arm/mach-orion5x/kurobox_pro-setup.c2
-rw-r--r--arch/arm/mach-orion5x/net2big-setup.c1
-rw-r--r--arch/arm/mach-orion5x/pci.c62
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c1
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-ge-setup.c1
-rw-r--r--arch/arm/mach-orion5x/rd88f5182-setup.c72
-rw-r--r--arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c1
-rw-r--r--arch/arm/mach-orion5x/ts78xx-setup.c12
-rw-r--r--arch/arm/mach-picoxcell/Kconfig14
-rw-r--r--arch/arm/mach-picoxcell/Makefile.boot1
-rw-r--r--arch/arm/mach-picoxcell/common.c13
-rw-r--r--arch/arm/mach-picoxcell/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-picoxcell/include/mach/map.h25
-rw-r--r--arch/arm/mach-picoxcell/include/mach/picoxcell_soc.h25
-rw-r--r--arch/arm/mach-picoxcell/include/mach/timex.h25
-rw-r--r--arch/arm/mach-picoxcell/include/mach/uncompress.h21
-rw-r--r--arch/arm/mach-pnx4008/Makefile12
-rw-r--r--arch/arm/mach-pnx4008/Makefile.boot4
-rw-r--r--arch/arm/mach-pnx4008/clock.c1001
-rw-r--r--arch/arm/mach-pnx4008/clock.h43
-rw-r--r--arch/arm/mach-pnx4008/core.c290
-rw-r--r--arch/arm/mach-pnx4008/dma.c1105
-rw-r--r--arch/arm/mach-pnx4008/gpio.c328
-rw-r--r--arch/arm/mach-pnx4008/i2c.c86
-rw-r--r--arch/arm/mach-pnx4008/include/mach/clock.h62
-rw-r--r--arch/arm/mach-pnx4008/include/mach/debug-macro.S21
-rw-r--r--arch/arm/mach-pnx4008/include/mach/dma.h160
-rw-r--r--arch/arm/mach-pnx4008/include/mach/entry-macro.S116
-rw-r--r--arch/arm/mach-pnx4008/include/mach/gpio-pnx4008.h241
-rw-r--r--arch/arm/mach-pnx4008/include/mach/hardware.h32
-rw-r--r--arch/arm/mach-pnx4008/include/mach/irq.h42
-rw-r--r--arch/arm/mach-pnx4008/include/mach/irqs.h215
-rw-r--r--arch/arm/mach-pnx4008/include/mach/platform.h69
-rw-r--r--arch/arm/mach-pnx4008/include/mach/pm.h33
-rw-r--r--arch/arm/mach-pnx4008/include/mach/timex.h19
-rw-r--r--arch/arm/mach-pnx4008/include/mach/uncompress.h46
-rw-r--r--arch/arm/mach-pnx4008/irq.c121
-rw-r--r--arch/arm/mach-pnx4008/pm.c153
-rw-r--r--arch/arm/mach-pnx4008/serial.c67
-rw-r--r--arch/arm/mach-pnx4008/sleep.S195
-rw-r--r--arch/arm/mach-pnx4008/time.c134
-rw-r--r--arch/arm/mach-pnx4008/time.h70
-rw-r--r--arch/arm/mach-prima2/Kconfig19
-rw-r--r--arch/arm/mach-prima2/Makefile5
-rw-r--r--arch/arm/mach-prima2/clock.c510
-rw-r--r--arch/arm/mach-prima2/common.c (renamed from arch/arm/mach-prima2/prima2.c)12
-rw-r--r--arch/arm/mach-prima2/include/mach/uncompress.h4
-rw-r--r--arch/arm/mach-prima2/irq.c2
-rw-r--r--arch/arm/mach-prima2/timer.c8
-rw-r--r--arch/arm/mach-pxa/Kconfig128
-rw-r--r--arch/arm/mach-pxa/Makefile11
-rw-r--r--arch/arm/mach-pxa/am200epd.c2
-rw-r--r--arch/arm/mach-pxa/am300epd.c2
-rw-r--r--arch/arm/mach-pxa/balloon3.c8
-rw-r--r--arch/arm/mach-pxa/clock-pxa3xx.c8
-rw-r--r--arch/arm/mach-pxa/cm-x270.c4
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c3
-rw-r--r--arch/arm/mach-pxa/cm-x300.c10
-rw-r--r--arch/arm/mach-pxa/colibri-evalboard.c4
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270-income.c6
-rw-r--r--arch/arm/mach-pxa/colibri-pxa300.c4
-rw-r--r--arch/arm/mach-pxa/colibri-pxa320.c4
-rw-r--r--arch/arm/mach-pxa/colibri-pxa3xx.c6
-rw-r--r--arch/arm/mach-pxa/corgi.c4
-rw-r--r--arch/arm/mach-pxa/csb726.c4
-rw-r--r--arch/arm/mach-pxa/devices.c34
-rw-r--r--arch/arm/mach-pxa/em-x270.c10
-rw-r--r--arch/arm/mach-pxa/eseries.c4
-rw-r--r--arch/arm/mach-pxa/ezx.c8
-rw-r--r--arch/arm/mach-pxa/gumstix.c2
-rw-r--r--arch/arm/mach-pxa/hx4700.c2
-rw-r--r--arch/arm/mach-pxa/idp.c85
-rw-r--r--arch/arm/mach-pxa/include/mach/arcom-pcmcia.h11
-rw-r--r--arch/arm/mach-pxa/include/mach/camera.h44
-rw-r--r--arch/arm/mach-pxa/include/mach/irda.h25
-rw-r--r--arch/arm/mach-pxa/include/mach/mmc.h28
-rw-r--r--arch/arm/mach-pxa/include/mach/ohci.h36
-rw-r--r--arch/arm/mach-pxa/include/mach/palmasoc.h8
-rw-r--r--arch/arm/mach-pxa/include/mach/pata_pxa.h33
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa3xx-regs.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h35
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa930_rotary.h20
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa930_trkball.h10
-rw-r--r--arch/arm/mach-pxa/include/mach/pxafb.h175
-rw-r--r--arch/arm/mach-pxa/irq.c131
-rw-r--r--arch/arm/mach-pxa/leds-idp.c115
-rw-r--r--arch/arm/mach-pxa/leds-lubbock.c124
-rw-r--r--arch/arm/mach-pxa/leds-mainstone.c119
-rw-r--r--arch/arm/mach-pxa/leds.c32
-rw-r--r--arch/arm/mach-pxa/leds.h13
-rw-r--r--arch/arm/mach-pxa/littleton.c8
-rw-r--r--arch/arm/mach-pxa/lpd270.c8
-rw-r--r--arch/arm/mach-pxa/lubbock.c101
-rw-r--r--arch/arm/mach-pxa/magician.c8
-rw-r--r--arch/arm/mach-pxa/mainstone.c104
-rw-r--r--arch/arm/mach-pxa/mioa701.c8
-rw-r--r--arch/arm/mach-pxa/mxm8x10.c8
-rw-r--r--arch/arm/mach-pxa/palm27x.c8
-rw-r--r--arch/arm/mach-pxa/palmld.c10
-rw-r--r--arch/arm/mach-pxa/palmt5.c10
-rw-r--r--arch/arm/mach-pxa/palmtc.c6
-rw-r--r--arch/arm/mach-pxa/palmte2.c10
-rw-r--r--arch/arm/mach-pxa/palmtreo.c14
-rw-r--r--arch/arm/mach-pxa/palmtx.c10
-rw-r--r--arch/arm/mach-pxa/palmz72.c12
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c8
-rw-r--r--arch/arm/mach-pxa/poodle.c6
-rw-r--r--arch/arm/mach-pxa/pxa-dt.c63
-rw-r--r--arch/arm/mach-pxa/pxa27x.c2
-rw-r--r--arch/arm/mach-pxa/pxa2xx.c2
-rw-r--r--arch/arm/mach-pxa/pxa3xx-ulpi.c2
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c25
-rw-r--r--arch/arm/mach-pxa/raumfeld.c8
-rw-r--r--arch/arm/mach-pxa/saar.c2
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c82
-rw-r--r--arch/arm/mach-pxa/spitz.c8
-rw-r--r--arch/arm/mach-pxa/stargate2.c4
-rw-r--r--arch/arm/mach-pxa/tavorevb.c4
-rw-r--r--arch/arm/mach-pxa/tosa.c4
-rw-r--r--arch/arm/mach-pxa/trizeps4.c8
-rw-r--r--arch/arm/mach-pxa/viper.c7
-rw-r--r--arch/arm/mach-pxa/vpac270.c8
-rw-r--r--arch/arm/mach-pxa/z2.c6
-rw-r--r--arch/arm/mach-pxa/zeus.c8
-rw-r--r--arch/arm/mach-pxa/zylonite.c10
-rw-r--r--arch/arm/mach-realview/Kconfig12
-rw-r--r--arch/arm/mach-realview/core.c145
-rw-r--r--arch/arm/mach-realview/core.h5
-rw-r--r--arch/arm/mach-realview/hotplug.c18
-rw-r--r--arch/arm/mach-realview/include/mach/clkdev.h16
-rw-r--r--arch/arm/mach-realview/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-realview/platsmp.c18
-rw-r--r--arch/arm/mach-realview/realview_eb.c10
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c10
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c11
-rw-r--r--arch/arm/mach-realview/realview_pba8.c10
-rw-r--r--arch/arm/mach-realview/realview_pbx.c11
-rw-r--r--arch/arm/mach-rpc/ecard.c4
-rw-r--r--arch/arm/mach-s3c2412/Kconfig2
-rw-r--r--arch/arm/mach-s3c2440/Kconfig2
-rw-r--r--arch/arm/mach-s3c24xx/Kconfig82
-rw-r--r--arch/arm/mach-s3c24xx/clock-s3c2440.c14
-rw-r--r--arch/arm/mach-s3c24xx/common-smdk.c4
-rw-r--r--arch/arm/mach-s3c24xx/h1940-bluetooth.c14
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/leds-gpio.h28
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2416.c6
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2443.c4
-rw-r--r--arch/arm/mach-s3c24xx/mach-amlm5900.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-anubis.c9
-rw-r--r--arch/arm/mach-s3c24xx/mach-at2440evb.c6
-rw-r--r--arch/arm/mach-s3c24xx/mach-bast.c8
-rw-r--r--arch/arm/mach-s3c24xx/mach-gta02.c10
-rw-r--r--arch/arm/mach-s3c24xx/mach-h1940.c12
-rw-r--r--arch/arm/mach-s3c24xx/mach-jive.c18
-rw-r--r--arch/arm/mach-s3c24xx/mach-mini2440.c14
-rw-r--r--arch/arm/mach-s3c24xx/mach-n30.c8
-rw-r--r--arch/arm/mach-s3c24xx/mach-nexcoder.c24
-rw-r--r--arch/arm/mach-s3c24xx/mach-osiris-dvs.c13
-rw-r--r--arch/arm/mach-s3c24xx/mach-osiris.c11
-rw-r--r--arch/arm/mach-s3c24xx/mach-otom.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-qt2410.c8
-rw-r--r--arch/arm/mach-s3c24xx/mach-rx1950.c10
-rw-r--r--arch/arm/mach-s3c24xx/mach-rx3715.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2410.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2413.c4
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2416.c10
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2440.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2443.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-tct_hammer.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-vr1000.c6
-rw-r--r--arch/arm/mach-s3c24xx/mach-vstms.c4
-rw-r--r--arch/arm/mach-s3c24xx/setup-i2c.c2
-rw-r--r--arch/arm/mach-s3c24xx/simtec-audio.c2
-rw-r--r--arch/arm/mach-s3c24xx/simtec-usb.c4
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig96
-rw-r--r--arch/arm/mach-s3c64xx/dev-audio.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-anw6410.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410-module.c38
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c18
-rw-r--r--arch/arm/mach-s3c64xx/mach-hmt.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-mini6410.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-ncp.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-real6410.c6
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq.c8
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq5.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq7.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6400.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c8
-rw-r--r--arch/arm/mach-s3c64xx/setup-i2c0.c2
-rw-r--r--arch/arm/mach-s3c64xx/setup-i2c1.c2
-rw-r--r--arch/arm/mach-s3c64xx/setup-ide.c2
-rw-r--r--arch/arm/mach-s5p64x0/Kconfig28
-rw-r--r--arch/arm/mach-s5p64x0/dev-audio.c2
-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/setup-i2c0.c2
-rw-r--r--arch/arm/mach-s5p64x0/setup-i2c1.c2
-rw-r--r--arch/arm/mach-s5pc100/Kconfig12
-rw-r--r--arch/arm/mach-s5pc100/dev-audio.c2
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c10
-rw-r--r--arch/arm/mach-s5pc100/setup-i2c0.c2
-rw-r--r--arch/arm/mach-s5pc100/setup-i2c1.c2
-rw-r--r--arch/arm/mach-s5pv210/Kconfig50
-rw-r--r--arch/arm/mach-s5pv210/dev-audio.c2
-rw-r--r--arch/arm/mach-s5pv210/mach-aquila.c2
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c4
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c4
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c8
-rw-r--r--arch/arm/mach-s5pv210/mach-torbreck.c2
-rw-r--r--arch/arm/mach-s5pv210/setup-i2c0.c2
-rw-r--r--arch/arm/mach-s5pv210/setup-i2c1.c2
-rw-r--r--arch/arm/mach-s5pv210/setup-i2c2.c2
-rw-r--r--arch/arm/mach-sa1100/Kconfig12
-rw-r--r--arch/arm/mach-sa1100/Makefile9
-rw-r--r--arch/arm/mach-sa1100/assabet.c89
-rw-r--r--arch/arm/mach-sa1100/badge4.c30
-rw-r--r--arch/arm/mach-sa1100/cerf.c44
-rw-r--r--arch/arm/mach-sa1100/collie.c2
-rw-r--r--arch/arm/mach-sa1100/hackkit.c32
-rw-r--r--arch/arm/mach-sa1100/include/mach/SA-1111.h5
-rw-r--r--arch/arm/mach-sa1100/include/mach/lart.h13
-rw-r--r--arch/arm/mach-sa1100/include/mach/mcp.h22
-rw-r--r--arch/arm/mach-sa1100/include/mach/simpad.h2
-rw-r--r--arch/arm/mach-sa1100/lart.c28
-rw-r--r--arch/arm/mach-sa1100/leds-assabet.c113
-rw-r--r--arch/arm/mach-sa1100/leds-badge4.c110
-rw-r--r--arch/arm/mach-sa1100/leds-cerf.c110
-rw-r--r--arch/arm/mach-sa1100/leds-hackkit.c112
-rw-r--r--arch/arm/mach-sa1100/leds-lart.c101
-rw-r--r--arch/arm/mach-sa1100/leds.c50
-rw-r--r--arch/arm/mach-sa1100/leds.h13
-rw-r--r--arch/arm/mach-sa1100/shannon.c2
-rw-r--r--arch/arm/mach-sa1100/simpad.c4
-rw-r--r--arch/arm/mach-shark/Makefile4
-rw-r--r--arch/arm/mach-shark/core.c19
-rw-r--r--arch/arm/mach-shark/include/mach/debug-macro.S7
-rw-r--r--arch/arm/mach-shark/include/mach/entry-macro.S3
-rw-r--r--arch/arm/mach-shark/include/mach/io.h18
-rw-r--r--arch/arm/mach-shark/leds.c220
-rw-r--r--arch/arm/mach-shark/pci.c7
-rw-r--r--arch/arm/mach-shmobile/Kconfig42
-rw-r--r--arch/arm/mach-shmobile/Makefile2
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c2
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c35
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c39
-rw-r--r--arch/arm/mach-shmobile/board-bonito.c8
-rw-r--r--arch/arm/mach-shmobile/board-g3evm.c12
-rw-r--r--arch/arm/mach-shmobile/board-g4evm.c32
-rw-r--r--arch/arm/mach-shmobile/board-kota2.c1
-rw-r--r--arch/arm/mach-shmobile/board-kzm9d.c1
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c26
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c58
-rw-r--r--arch/arm/mach-shmobile/board-marzen.c69
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7740.c46
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7779.c11
-rw-r--r--arch/arm/mach-shmobile/clock-sh7367.c44
-rw-r--r--arch/arm/mach-shmobile/clock-sh7372.c60
-rw-r--r--arch/arm/mach-shmobile/clock-sh7377.c50
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c70
-rw-r--r--arch/arm/mach-shmobile/common.c24
-rw-r--r--arch/arm/mach-shmobile/cpuidle.c39
-rw-r--r--arch/arm/mach-shmobile/hotplug.c31
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h38
-rw-r--r--arch/arm/mach-shmobile/include/mach/emev2.h7
-rw-r--r--arch/arm/mach-shmobile/include/mach/pm-rmobile.h35
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7740.h6
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7779.h14
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh7372.h20
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh73a0.h2
-rw-r--r--arch/arm/mach-shmobile/intc-r8a7779.c14
-rw-r--r--arch/arm/mach-shmobile/intc-sh7372.c27
-rw-r--r--arch/arm/mach-shmobile/intc-sh73a0.c20
-rw-r--r--arch/arm/mach-shmobile/pfc-r8a7740.c2
-rw-r--r--arch/arm/mach-shmobile/pfc-r8a7779.c2
-rw-r--r--arch/arm/mach-shmobile/pfc-sh7367.c2
-rw-r--r--arch/arm/mach-shmobile/pfc-sh7372.c2
-rw-r--r--arch/arm/mach-shmobile/pfc-sh7377.c2
-rw-r--r--arch/arm/mach-shmobile/pfc-sh73a0.c2
-rw-r--r--arch/arm/mach-shmobile/platsmp.c96
-rw-r--r--arch/arm/mach-shmobile/pm-r8a7740.c42
-rw-r--r--arch/arm/mach-shmobile/pm-r8a7779.c71
-rw-r--r--arch/arm/mach-shmobile/pm-rmobile.c39
-rw-r--r--arch/arm/mach-shmobile/pm-sh7372.c340
-rw-r--r--arch/arm/mach-shmobile/setup-emev2.c22
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7740.c27
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c5
-rw-r--r--arch/arm/mach-shmobile/setup-sh7367.c2
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c69
-rw-r--r--arch/arm/mach-shmobile/setup-sh7377.c2
-rw-r--r--arch/arm/mach-shmobile/setup-sh73a0.c23
-rw-r--r--arch/arm/mach-shmobile/sh-gpio.h (renamed from arch/arm/mach-shmobile/include/mach/gpio.h)20
-rw-r--r--arch/arm/mach-shmobile/smp-emev2.c49
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7779.c48
-rw-r--r--arch/arm/mach-shmobile/smp-sh73a0.c48
-rw-r--r--arch/arm/mach-socfpga/Kconfig16
-rw-r--r--arch/arm/mach-socfpga/Makefile.boot1
-rw-r--r--arch/arm/mach-socfpga/include/mach/timex.h19
-rw-r--r--arch/arm/mach-socfpga/include/mach/uncompress.h9
-rw-r--r--arch/arm/mach-spear13xx/Makefile.boot3
-rw-r--r--arch/arm/mach-spear13xx/hotplug.c22
-rw-r--r--arch/arm/mach-spear13xx/include/mach/generic.h3
-rw-r--r--arch/arm/mach-spear13xx/include/mach/gpio.h19
-rw-r--r--arch/arm/mach-spear13xx/include/mach/spear.h14
-rw-r--r--arch/arm/mach-spear13xx/platsmp.c25
-rw-r--r--arch/arm/mach-spear13xx/spear1310.c1
-rw-r--r--arch/arm/mach-spear13xx/spear1340.c1
-rw-r--r--arch/arm/mach-spear13xx/spear13xx.c9
-rw-r--r--arch/arm/mach-spear3xx/Makefile.boot4
-rw-r--r--arch/arm/mach-spear3xx/include/mach/gpio.h19
-rw-r--r--arch/arm/mach-spear6xx/Makefile.boot2
-rw-r--r--arch/arm/mach-spear6xx/include/mach/gpio.h19
-rw-r--r--arch/arm/mach-tegra/Kconfig63
-rw-r--r--arch/arm/mach-tegra/Makefile21
-rw-r--r--arch/arm/mach-tegra/Makefile.boot8
-rw-r--r--arch/arm/mach-tegra/apbio.c122
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra20.c53
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra30.c2
-rw-r--r--arch/arm/mach-tegra/board-harmony-pcie.c49
-rw-r--r--arch/arm/mach-tegra/board-harmony-pinmux.c156
-rw-r--r--arch/arm/mach-tegra/board-harmony-power.c148
-rw-r--r--arch/arm/mach-tegra/board-harmony.c197
-rw-r--r--arch/arm/mach-tegra/board-harmony.h41
-rw-r--r--arch/arm/mach-tegra/board-paz00-pinmux.c156
-rw-r--r--arch/arm/mach-tegra/board-paz00.c192
-rw-r--r--arch/arm/mach-tegra/board-paz00.h17
-rw-r--r--arch/arm/mach-tegra/board-pinmux.c87
-rw-r--r--arch/arm/mach-tegra/board-pinmux.h54
-rw-r--r--arch/arm/mach-tegra/board-trimslice-pinmux.c155
-rw-r--r--arch/arm/mach-tegra/board-trimslice.c183
-rw-r--r--arch/arm/mach-tegra/board-trimslice.h30
-rw-r--r--arch/arm/mach-tegra/clock.c574
-rw-r--r--arch/arm/mach-tegra/clock.h40
-rw-r--r--arch/arm/mach-tegra/common.c5
-rw-r--r--arch/arm/mach-tegra/common.h4
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.c48
-rw-r--r--arch/arm/mach-tegra/devices.c702
-rw-r--r--arch/arm/mach-tegra/devices.h60
-rw-r--r--arch/arm/mach-tegra/dma.c823
-rw-r--r--arch/arm/mach-tegra/fuse.c4
-rw-r--r--arch/arm/mach-tegra/headsmp.S6
-rw-r--r--arch/arm/mach-tegra/hotplug.c127
-rw-r--r--arch/arm/mach-tegra/include/mach/clk.h3
-rw-r--r--arch/arm/mach-tegra/include/mach/dma.h97
-rw-r--r--arch/arm/mach-tegra/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-tegra/include/mach/io.h46
-rw-r--r--arch/arm/mach-tegra/include/mach/iomap.h3
-rw-r--r--arch/arm/mach-tegra/include/mach/kbc.h62
-rw-r--r--arch/arm/mach-tegra/include/mach/pinconf-tegra.h63
-rw-r--r--arch/arm/mach-tegra/include/mach/sdhci.h30
-rw-r--r--arch/arm/mach-tegra/include/mach/smmu.h63
-rw-r--r--arch/arm/mach-tegra/include/mach/suspend.h38
-rw-r--r--arch/arm/mach-tegra/include/mach/tegra_wm8903_pdata.h23
-rw-r--r--arch/arm/mach-tegra/include/mach/usb_phy.h86
-rw-r--r--arch/arm/mach-tegra/pcie.c107
-rw-r--r--arch/arm/mach-tegra/platsmp.c52
-rw-r--r--arch/arm/mach-tegra/powergate.c43
-rw-r--r--arch/arm/mach-tegra/sleep-t20.S82
-rw-r--r--arch/arm/mach-tegra/sleep-t30.S107
-rw-r--r--arch/arm/mach-tegra/sleep.S33
-rw-r--r--arch/arm/mach-tegra/sleep.h85
-rw-r--r--arch/arm/mach-tegra/tegra20_clocks.c1624
-rw-r--r--arch/arm/mach-tegra/tegra20_clocks.h42
-rw-r--r--arch/arm/mach-tegra/tegra20_clocks_data.c1139
-rw-r--r--arch/arm/mach-tegra/tegra2_clocks.c2484
-rw-r--r--arch/arm/mach-tegra/tegra30_clocks.c2511
-rw-r--r--arch/arm/mach-tegra/tegra30_clocks.h53
-rw-r--r--arch/arm/mach-tegra/tegra30_clocks_data.c1377
-rw-r--r--arch/arm/mach-tegra/tegra_cpu_car.h87
-rw-r--r--arch/arm/mach-tegra/timer.c1
-rw-r--r--arch/arm/mach-tegra/usb_phy.c817
-rw-r--r--arch/arm/mach-u300/Kconfig45
-rw-r--r--arch/arm/mach-u300/Makefile1
-rw-r--r--arch/arm/mach-u300/core.c103
-rw-r--r--arch/arm/mach-u300/dma_channels.h (renamed from arch/arm/mach-u300/include/mach/dma_channels.h)11
-rw-r--r--arch/arm/mach-u300/i2c.c8
-rw-r--r--arch/arm/mach-u300/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-u300/include/mach/gpio-u300.h37
-rw-r--r--arch/arm/mach-u300/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-u300/include/mach/irqs.h36
-rw-r--r--arch/arm/mach-u300/include/mach/platform.h20
-rw-r--r--arch/arm/mach-u300/include/mach/syscon.h32
-rw-r--r--arch/arm/mach-u300/include/mach/u300-regs.h19
-rw-r--r--arch/arm/mach-u300/spi.c2
-rw-r--r--arch/arm/mach-u300/timer.c5
-rw-r--r--arch/arm/mach-u300/timer.h1
-rw-r--r--arch/arm/mach-u300/u300-gpio.h46
-rw-r--r--arch/arm/mach-u300/u300.c57
-rw-r--r--arch/arm/mach-ux500/Kconfig16
-rw-r--r--arch/arm/mach-ux500/Makefile4
-rw-r--r--arch/arm/mach-ux500/Makefile.boot2
-rw-r--r--arch/arm/mach-ux500/board-mop500-audio.c (renamed from arch/arm/mach-ux500/board-mop500-msp.c)102
-rw-r--r--arch/arm/mach-ux500/board-mop500-msp.h14
-rw-r--r--arch/arm/mach-ux500/board-mop500-pins.c83
-rw-r--r--arch/arm/mach-ux500/board-mop500-regulators.c15
-rw-r--r--arch/arm/mach-ux500/board-mop500-regulators.h1
-rw-r--r--arch/arm/mach-ux500/board-mop500-sdi.c4
-rw-r--r--arch/arm/mach-ux500/board-mop500.c85
-rw-r--r--arch/arm/mach-ux500/board-mop500.h11
-rw-r--r--arch/arm/mach-ux500/cache-l2x0.c2
-rw-r--r--arch/arm/mach-ux500/clock.c715
-rw-r--r--arch/arm/mach-ux500/clock.h164
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c18
-rw-r--r--arch/arm/mach-ux500/cpu.c18
-rw-r--r--arch/arm/mach-ux500/devices-common.h2
-rw-r--r--arch/arm/mach-ux500/hotplug.c36
-rw-r--r--arch/arm/mach-ux500/include/mach/crypto-ux500.h22
-rw-r--r--arch/arm/mach-ux500/include/mach/gpio.h5
-rw-r--r--arch/arm/mach-ux500/include/mach/id.h44
-rw-r--r--arch/arm/mach-ux500/include/mach/msp.h2
-rw-r--r--arch/arm/mach-ux500/include/mach/setup.h3
-rw-r--r--arch/arm/mach-ux500/include/mach/uncompress.h4
-rw-r--r--arch/arm/mach-ux500/include/mach/usb.h25
-rw-r--r--arch/arm/mach-ux500/platsmp.c28
-rw-r--r--arch/arm/mach-ux500/timer.c2
-rw-r--r--arch/arm/mach-ux500/usb.c2
-rw-r--r--arch/arm/mach-versatile/Kconfig4
-rw-r--r--arch/arm/mach-versatile/core.c10
-rw-r--r--arch/arm/mach-versatile/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-versatile/include/mach/hardware.h1
-rw-r--r--arch/arm/mach-versatile/include/mach/io.h27
-rw-r--r--arch/arm/mach-versatile/pci.c22
-rw-r--r--arch/arm/mach-vexpress/Kconfig64
-rw-r--r--arch/arm/mach-vexpress/Makefile2
-rw-r--r--arch/arm/mach-vexpress/Makefile.boot11
-rw-r--r--arch/arm/mach-vexpress/core.h4
-rw-r--r--arch/arm/mach-vexpress/ct-ca9x4.c4
-rw-r--r--arch/arm/mach-vexpress/hotplug.c18
-rw-r--r--arch/arm/mach-vexpress/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-vexpress/include/mach/irqs.h2
-rw-r--r--arch/arm/mach-vexpress/include/mach/timex.h23
-rw-r--r--arch/arm/mach-vexpress/include/mach/uncompress.h86
-rw-r--r--arch/arm/mach-vexpress/platsmp.c18
-rw-r--r--arch/arm/mach-vexpress/v2m.c8
-rw-r--r--arch/arm/mach-vt8500/Kconfig73
-rw-r--r--arch/arm/mach-vt8500/Makefile8
-rw-r--r--arch/arm/mach-vt8500/bv07.c80
-rw-r--r--arch/arm/mach-vt8500/common.h (renamed from arch/arm/mach-tegra/include/mach/gpio-tegra.h)22
-rw-r--r--arch/arm/mach-vt8500/devices-vt8500.c91
-rw-r--r--arch/arm/mach-vt8500/devices-wm8505.c99
-rw-r--r--arch/arm/mach-vt8500/devices.c270
-rw-r--r--arch/arm/mach-vt8500/devices.h88
-rw-r--r--arch/arm/mach-vt8500/gpio.c240
-rw-r--r--arch/arm/mach-vt8500/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-vt8500/include/mach/restart.h4
-rw-r--r--arch/arm/mach-vt8500/include/mach/uncompress.h8
-rw-r--r--arch/arm/mach-vt8500/include/mach/vt8500_irqs.h88
-rw-r--r--arch/arm/mach-vt8500/include/mach/vt8500_regs.h79
-rw-r--r--arch/arm/mach-vt8500/include/mach/vt8500fb.h31
-rw-r--r--arch/arm/mach-vt8500/include/mach/wm8505_irqs.h115
-rw-r--r--arch/arm/mach-vt8500/include/mach/wm8505_regs.h78
-rw-r--r--arch/arm/mach-vt8500/irq.c209
-rw-r--r--arch/arm/mach-vt8500/restart.c54
-rw-r--r--arch/arm/mach-vt8500/timer.c67
-rw-r--r--arch/arm/mach-vt8500/vt8500.c198
-rw-r--r--arch/arm/mach-vt8500/wm8505_7in.c79
-rw-r--r--arch/arm/mach-w90x900/dev.c6
-rw-r--r--arch/arm/mach-w90x900/include/mach/fb.h83
-rw-r--r--arch/arm/mach-w90x900/include/mach/i2c.h9
-rw-r--r--arch/arm/mach-w90x900/include/mach/nuc900_spi.h35
-rw-r--r--arch/arm/mach-w90x900/include/mach/w90p910_keypad.h15
-rw-r--r--arch/arm/mach-w90x900/mach-nuc950evb.c2
-rw-r--r--arch/arm/mm/Kconfig123
-rw-r--r--arch/arm/mm/alignment.c6
-rw-r--r--arch/arm/mm/cache-fa.S3
-rw-r--r--arch/arm/mm/cache-l2x0.c10
-rw-r--r--arch/arm/mm/cache-tauros2.c83
-rw-r--r--arch/arm/mm/cache-v3.S3
-rw-r--r--arch/arm/mm/cache-v4.S3
-rw-r--r--arch/arm/mm/cache-v4wb.S3
-rw-r--r--arch/arm/mm/cache-v4wt.S3
-rw-r--r--arch/arm/mm/cache-v6.S3
-rw-r--r--arch/arm/mm/cache-v7.S51
-rw-r--r--arch/arm/mm/context.c7
-rw-r--r--arch/arm/mm/dma-mapping.c268
-rw-r--r--arch/arm/mm/fault-armv.c3
-rw-r--r--arch/arm/mm/fault.c1
-rw-r--r--arch/arm/mm/flush.c3
-rw-r--r--arch/arm/mm/init.c2
-rw-r--r--arch/arm/mm/ioremap.c15
-rw-r--r--arch/arm/mm/mm.h3
-rw-r--r--arch/arm/mm/mmu.c71
-rw-r--r--arch/arm/mm/proc-arm1020.S3
-rw-r--r--arch/arm/mm/proc-arm1020e.S3
-rw-r--r--arch/arm/mm/proc-arm1022.S3
-rw-r--r--arch/arm/mm/proc-arm1026.S3
-rw-r--r--arch/arm/mm/proc-arm920.S3
-rw-r--r--arch/arm/mm/proc-arm922.S3
-rw-r--r--arch/arm/mm/proc-arm925.S3
-rw-r--r--arch/arm/mm/proc-arm926.S3
-rw-r--r--arch/arm/mm/proc-arm940.S3
-rw-r--r--arch/arm/mm/proc-arm946.S3
-rw-r--r--arch/arm/mm/proc-feroceon.S4
-rw-r--r--arch/arm/mm/proc-macros.S1
-rw-r--r--arch/arm/mm/proc-mohawk.S3
-rw-r--r--arch/arm/mm/proc-v7.S2
-rw-r--r--arch/arm/mm/proc-xsc3.S3
-rw-r--r--arch/arm/mm/proc-xscale.S4
-rw-r--r--arch/arm/plat-iop/pci.c25
-rw-r--r--arch/arm/plat-iop/pmu.c3
-rw-r--r--arch/arm/plat-iop/setup.c5
-rw-r--r--arch/arm/plat-mxc/Kconfig4
-rw-r--r--arch/arm/plat-mxc/Makefile2
-rw-r--r--arch/arm/plat-mxc/clock.c257
-rw-r--r--arch/arm/plat-mxc/cpufreq.c1
-rw-r--r--arch/arm/plat-mxc/devices/Kconfig8
-rw-r--r--arch/arm/plat-mxc/devices/Makefile1
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-uart.c2
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx27-coda.c37
-rw-r--r--arch/arm/plat-mxc/devices/platform-mxc_nand.c11
-rw-r--r--arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c2
-rw-r--r--arch/arm/plat-mxc/include/mach/clock.h70
-rw-r--r--arch/arm/plat-mxc/include/mach/common.h10
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h40
-rw-r--r--arch/arm/plat-mxc/include/mach/dma.h67
-rw-r--r--arch/arm/plat-mxc/include/mach/esdhc.h43
-rw-r--r--arch/arm/plat-mxc/include/mach/gpio.h1
-rw-r--r--arch/arm/plat-mxc/include/mach/i2c.h21
-rw-r--r--arch/arm/plat-mxc/include/mach/imx-uart.h35
-rw-r--r--arch/arm/plat-mxc/include/mach/imxfb.h84
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx53.h1219
-rw-r--r--arch/arm/plat-mxc/include/mach/mmc.h39
-rw-r--r--arch/arm/plat-mxc/include/mach/mx1_camera.h35
-rw-r--r--arch/arm/plat-mxc/include/mach/mx21-usbhost.h38
-rw-r--r--arch/arm/plat-mxc/include/mach/mx25.h1
-rw-r--r--arch/arm/plat-mxc/include/mach/mx2_cam.h46
-rw-r--r--arch/arm/plat-mxc/include/mach/mx31.h6
-rw-r--r--arch/arm/plat-mxc/include/mach/mx3_camera.h48
-rw-r--r--arch/arm/plat-mxc/include/mach/mx3fb.h53
-rw-r--r--arch/arm/plat-mxc/include/mach/mxc_ehci.h59
-rw-r--r--arch/arm/plat-mxc/include/mach/mxc_nand.h32
-rw-r--r--arch/arm/plat-mxc/include/mach/sdma.h59
-rw-r--r--arch/arm/plat-mxc/include/mach/spi.h27
-rw-r--r--arch/arm/plat-mxc/include/mach/ssi.h21
-rw-r--r--arch/arm/plat-mxc/include/mach/usb.h23
-rw-r--r--arch/arm/plat-mxc/ssi-fiq-ksym.c2
-rw-r--r--arch/arm/plat-mxc/ssi-fiq.S89
-rw-r--r--arch/arm/plat-mxc/system.c4
-rw-r--r--arch/arm/plat-nomadik/Kconfig2
-rw-r--r--arch/arm/plat-nomadik/include/plat/gpio-nomadik.h6
-rw-r--r--arch/arm/plat-nomadik/include/plat/pincfg.h2
-rw-r--r--arch/arm/plat-nomadik/include/plat/ske.h50
-rw-r--r--arch/arm/plat-omap/Kconfig12
-rw-r--r--arch/arm/plat-omap/Makefile3
-rw-r--r--arch/arm/plat-omap/clock.c27
-rw-r--r--arch/arm/plat-omap/common.c42
-rw-r--r--arch/arm/plat-omap/counter_32k.c24
-rw-r--r--arch/arm/plat-omap/debug-devices.c3
-rw-r--r--arch/arm/plat-omap/debug-leds.c294
-rw-r--r--arch/arm/plat-omap/devices.c92
-rw-r--r--arch/arm/plat-omap/dma.c54
-rw-r--r--arch/arm/plat-omap/fb.c2
-rw-r--r--arch/arm/plat-omap/i2c.c25
-rw-r--r--arch/arm/plat-omap/include/plat/board.h138
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h5
-rw-r--r--arch/arm/plat-omap/include/plat/cpu.h3
-rw-r--r--arch/arm/plat-omap/include/plat/dma.h2
-rw-r--r--arch/arm/plat-omap/include/plat/dmtimer.h1
-rw-r--r--arch/arm/plat-omap/include/plat/dsp.h34
-rw-r--r--arch/arm/plat-omap/include/plat/gpio-switch.h54
-rw-r--r--arch/arm/plat-omap/include/plat/gpio.h228
-rw-r--r--arch/arm/plat-omap/include/plat/gpmc.h19
-rw-r--r--arch/arm/plat-omap/include/plat/hardware.h293
-rw-r--r--arch/arm/plat-omap/include/plat/iommu.h15
-rw-r--r--arch/arm/plat-omap/include/plat/irqs-44xx.h144
-rw-r--r--arch/arm/plat-omap/include/plat/irqs.h453
-rw-r--r--arch/arm/plat-omap/include/plat/keypad.h52
-rw-r--r--arch/arm/plat-omap/include/plat/lcd_mipid.h29
-rw-r--r--arch/arm/plat-omap/include/plat/mcbsp.h62
-rw-r--r--arch/arm/plat-omap/include/plat/mcspi.h23
-rw-r--r--arch/arm/plat-omap/include/plat/mmc.h1
-rw-r--r--arch/arm/plat-omap/include/plat/nand.h44
-rw-r--r--arch/arm/plat-omap/include/plat/omap-serial.h54
-rw-r--r--arch/arm/plat-omap/include/plat/omap_device.h6
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h28
-rw-r--r--arch/arm/plat-omap/include/plat/onenand.h53
-rw-r--r--arch/arm/plat-omap/include/plat/param.h8
-rw-r--r--arch/arm/plat-omap/include/plat/remoteproc.h57
-rw-r--r--arch/arm/plat-omap/include/plat/usb.h8
-rw-r--r--arch/arm/plat-omap/include/plat/voltage.h39
-rw-r--r--arch/arm/plat-omap/mailbox.c2
-rw-r--r--arch/arm/plat-omap/mux.c90
-rw-r--r--arch/arm/plat-omap/omap-pm-noop.c47
-rw-r--r--arch/arm/plat-omap/omap_device.c221
-rw-r--r--arch/arm/plat-omap/sram.c12
-rw-r--r--arch/arm/plat-orion/Makefile10
-rw-r--r--arch/arm/plat-orion/addr-map.c11
-rw-r--r--arch/arm/plat-orion/common.c16
-rw-r--r--arch/arm/plat-orion/gpio.c2
-rw-r--r--arch/arm/plat-orion/include/plat/addr-map.h4
-rw-r--r--arch/arm/plat-orion/include/plat/audio.h7
-rw-r--r--arch/arm/plat-orion/include/plat/common.h8
-rw-r--r--arch/arm/plat-orion/include/plat/ehci-orion.h26
-rw-r--r--arch/arm/plat-orion/include/plat/mpp.h2
-rw-r--r--arch/arm/plat-orion/include/plat/mv_xor.h24
-rw-r--r--arch/arm/plat-orion/include/plat/mvsdio.h20
-rw-r--r--arch/arm/plat-orion/include/plat/orion-gpio.h (renamed from arch/arm/plat-orion/include/plat/gpio.h)2
-rw-r--r--arch/arm/plat-orion/include/plat/orion_nand.h26
-rw-r--r--arch/arm/plat-orion/include/plat/time.h4
-rw-r--r--arch/arm/plat-orion/irq.c2
-rw-r--r--arch/arm/plat-orion/mpp.c7
-rw-r--r--arch/arm/plat-orion/time.c8
-rw-r--r--arch/arm/plat-pxa/include/plat/pxa27x_keypad.h73
-rw-r--r--arch/arm/plat-pxa/include/plat/pxa3xx_nand.h79
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig2
-rw-r--r--arch/arm/plat-samsung/Kconfig14
-rw-r--r--arch/arm/plat-samsung/clock.c18
-rw-r--r--arch/arm/plat-samsung/devs.c28
-rw-r--r--arch/arm/plat-samsung/dma-ops.c3
-rw-r--r--arch/arm/plat-samsung/include/plat/ata.h36
-rw-r--r--arch/arm/plat-samsung/include/plat/audio-simtec.h34
-rw-r--r--arch/arm/plat-samsung/include/plat/audio.h59
-rw-r--r--arch/arm/plat-samsung/include/plat/ehci.h21
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-fns.h97
-rw-r--r--arch/arm/plat-samsung/include/plat/hwmon.h51
-rw-r--r--arch/arm/plat-samsung/include/plat/iic.h77
-rw-r--r--arch/arm/plat-samsung/include/plat/mci.h52
-rw-r--r--arch/arm/plat-samsung/include/plat/mipi_csis.h43
-rw-r--r--arch/arm/plat-samsung/include/plat/nand.h67
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-fb-v4.h159
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-fb.h403
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c64xx-spi.h68
-rw-r--r--arch/arm/plat-samsung/include/plat/ts.h25
-rw-r--r--arch/arm/plat-samsung/include/plat/udc.h44
-rw-r--r--arch/arm/plat-samsung/include/plat/usb-control.h43
-rw-r--r--arch/arm/plat-samsung/s5p-irq-gpioint.c4
-rw-r--r--arch/arm/plat-samsung/setup-mipiphy.c20
-rw-r--r--arch/arm/plat-samsung/time.c1
-rw-r--r--arch/arm/plat-spear/Kconfig4
-rw-r--r--arch/arm/plat-spear/include/plat/gpio.h1
-rw-r--r--arch/arm/plat-spear/include/plat/keyboard.h164
-rw-r--r--arch/arm/plat-versatile/Kconfig4
-rw-r--r--arch/arm/plat-versatile/Makefile2
-rw-r--r--arch/arm/plat-versatile/fpga-irq.c72
-rw-r--r--arch/arm/plat-versatile/include/plat/fpga-irq.h2
-rw-r--r--arch/arm/plat-versatile/include/plat/platsmp.h14
-rw-r--r--arch/arm/plat-versatile/leds.c8
-rw-r--r--arch/arm/plat-versatile/platsmp.c10
-rw-r--r--arch/arm/tools/mach-types2
1695 files changed, 39518 insertions, 66126 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 33614669a9a..73067efd484 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1,54 +1,60 @@
1config ARM 1config ARM
2 bool 2 bool
3 default y 3 default y
4 select ARCH_BINFMT_ELF_RANDOMIZE_PIE
5 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
4 select ARCH_HAVE_CUSTOM_GPIO_H 6 select ARCH_HAVE_CUSTOM_GPIO_H
5 select HAVE_AOUT 7 select ARCH_WANT_IPC_PARSE_VERSION
6 select HAVE_DMA_API_DEBUG 8 select CPU_PM if (SUSPEND || CPU_IDLE)
7 select HAVE_IDE if PCI || ISA || PCMCIA 9 select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
8 select HAVE_DMA_ATTRS
9 select HAVE_DMA_CONTIGUOUS if MMU
10 select HAVE_MEMBLOCK
11 select RTC_LIB
12 select SYS_SUPPORTS_APM_EMULATION
13 select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI) 10 select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
14 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 11 select GENERIC_CLOCKEVENTS_BROADCAST if SMP
15 select HAVE_OPROFILE if (HAVE_PERF_EVENTS) 12 select GENERIC_IRQ_PROBE
13 select GENERIC_IRQ_SHOW
14 select GENERIC_KERNEL_THREAD
15 select GENERIC_KERNEL_EXECVE
16 select GENERIC_PCI_IOMAP
17 select GENERIC_SMP_IDLE_THREAD
18 select GENERIC_STRNCPY_FROM_USER
19 select GENERIC_STRNLEN_USER
20 select HARDIRQS_SW_RESEND
21 select HAVE_AOUT
16 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL 22 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
17 select HAVE_ARCH_KGDB 23 select HAVE_ARCH_KGDB
18 select HAVE_ARCH_TRACEHOOK 24 select HAVE_ARCH_TRACEHOOK
19 select HAVE_KPROBES if !XIP_KERNEL 25 select HAVE_BPF_JIT
20 select HAVE_KRETPROBES if (HAVE_KPROBES) 26 select HAVE_C_RECORDMCOUNT
21 select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) 27 select HAVE_DEBUG_KMEMLEAK
22 select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL) 28 select HAVE_DMA_API_DEBUG
29 select HAVE_DMA_ATTRS
30 select HAVE_DMA_CONTIGUOUS if MMU
23 select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) 31 select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
32 select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
24 select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL) 33 select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
25 select ARCH_BINFMT_ELF_RANDOMIZE_PIE 34 select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
26 select HAVE_GENERIC_DMA_COHERENT 35 select HAVE_GENERIC_DMA_COHERENT
36 select HAVE_GENERIC_HARDIRQS
37 select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
38 select HAVE_IDE if PCI || ISA || PCMCIA
39 select HAVE_IRQ_WORK
27 select HAVE_KERNEL_GZIP 40 select HAVE_KERNEL_GZIP
28 select HAVE_KERNEL_LZO
29 select HAVE_KERNEL_LZMA 41 select HAVE_KERNEL_LZMA
42 select HAVE_KERNEL_LZO
30 select HAVE_KERNEL_XZ 43 select HAVE_KERNEL_XZ
31 select HAVE_IRQ_WORK 44 select HAVE_KPROBES if !XIP_KERNEL
45 select HAVE_KRETPROBES if (HAVE_KPROBES)
46 select HAVE_MEMBLOCK
47 select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
32 select HAVE_PERF_EVENTS 48 select HAVE_PERF_EVENTS
33 select PERF_USE_VMALLOC
34 select HAVE_REGS_AND_STACK_ACCESS_API 49 select HAVE_REGS_AND_STACK_ACCESS_API
35 select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)) 50 select HAVE_SYSCALL_TRACEPOINTS
36 select HAVE_C_RECORDMCOUNT 51 select HAVE_UID16
37 select HAVE_GENERIC_HARDIRQS
38 select HARDIRQS_SW_RESEND
39 select GENERIC_IRQ_PROBE
40 select GENERIC_IRQ_SHOW
41 select ARCH_WANT_IPC_PARSE_VERSION
42 select HARDIRQS_SW_RESEND
43 select CPU_PM if (SUSPEND || CPU_IDLE)
44 select GENERIC_PCI_IOMAP
45 select HAVE_BPF_JIT
46 select GENERIC_SMP_IDLE_THREAD
47 select KTIME_SCALAR 52 select KTIME_SCALAR
48 select GENERIC_CLOCKEVENTS_BROADCAST if SMP 53 select PERF_USE_VMALLOC
49 select GENERIC_STRNCPY_FROM_USER 54 select RTC_LIB
50 select GENERIC_STRNLEN_USER 55 select SYS_SUPPORTS_APM_EMULATION
51 select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN 56 select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
57 select MODULES_USE_ELF_REL
52 help 58 help
53 The ARM series is a line of low-power-consumption RISC chip designs 59 The ARM series is a line of low-power-consumption RISC chip designs
54 licensed by ARM Ltd and targeted at embedded applications and 60 licensed by ARM Ltd and targeted at embedded applications and
@@ -64,9 +70,9 @@ config NEED_SG_DMA_LENGTH
64 bool 70 bool
65 71
66config ARM_DMA_USE_IOMMU 72config ARM_DMA_USE_IOMMU
67 select NEED_SG_DMA_LENGTH
68 select ARM_HAS_SG_CHAIN
69 bool 73 bool
74 select ARM_HAS_SG_CHAIN
75 select NEED_SG_DMA_LENGTH
70 76
71config HAVE_PWM 77config HAVE_PWM
72 bool 78 bool
@@ -202,6 +208,13 @@ config ARM_PATCH_PHYS_VIRT
202 this feature (eg, building a kernel for a single machine) and 208 this feature (eg, building a kernel for a single machine) and
203 you need to shrink the kernel to the minimal size. 209 you need to shrink the kernel to the minimal size.
204 210
211config NEED_MACH_GPIO_H
212 bool
213 help
214 Select this when mach/gpio.h is required to provide special
215 definitions for this platform. The need for mach/gpio.h should
216 be avoided when possible.
217
205config NEED_MACH_IO_H 218config NEED_MACH_IO_H
206 bool 219 bool
207 help 220 help
@@ -247,190 +260,148 @@ config MMU
247# 260#
248choice 261choice
249 prompt "ARM system type" 262 prompt "ARM system type"
250 default ARCH_VERSATILE 263 default ARCH_MULTIPLATFORM
251 264
252config ARCH_SOCFPGA 265config ARCH_MULTIPLATFORM
253 bool "Altera SOCFPGA family" 266 bool "Allow multiple platforms to be selected"
254 select ARCH_WANT_OPTIONAL_GPIOLIB 267 depends on MMU
255 select ARM_AMBA 268 select ARM_PATCH_PHYS_VIRT
256 select ARM_GIC 269 select AUTO_ZRELADDR
257 select CACHE_L2X0
258 select CLKDEV_LOOKUP
259 select COMMON_CLK 270 select COMMON_CLK
260 select CPU_V7 271 select MULTI_IRQ_HANDLER
261 select DW_APB_TIMER
262 select DW_APB_TIMER_OF
263 select GENERIC_CLOCKEVENTS
264 select GPIO_PL061 if GPIOLIB
265 select HAVE_ARM_SCU
266 select SPARSE_IRQ 272 select SPARSE_IRQ
267 select USE_OF 273 select USE_OF
268 help
269 This enables support for Altera SOCFPGA Cyclone V platform
270 274
271config ARCH_INTEGRATOR 275config ARCH_INTEGRATOR
272 bool "ARM Ltd. Integrator family" 276 bool "ARM Ltd. Integrator family"
273 select ARM_AMBA
274 select ARCH_HAS_CPUFREQ 277 select ARCH_HAS_CPUFREQ
278 select ARM_AMBA
275 select COMMON_CLK 279 select COMMON_CLK
276 select CLK_VERSATILE 280 select COMMON_CLK_VERSATILE
281 select GENERIC_CLOCKEVENTS
277 select HAVE_TCM 282 select HAVE_TCM
278 select ICST 283 select ICST
279 select GENERIC_CLOCKEVENTS 284 select MULTI_IRQ_HANDLER
285 select NEED_MACH_MEMORY_H
280 select PLAT_VERSATILE 286 select PLAT_VERSATILE
281 select PLAT_VERSATILE_FPGA_IRQ 287 select PLAT_VERSATILE_FPGA_IRQ
282 select NEED_MACH_IO_H
283 select NEED_MACH_MEMORY_H
284 select SPARSE_IRQ 288 select SPARSE_IRQ
285 select MULTI_IRQ_HANDLER
286 help 289 help
287 Support for ARM's Integrator platform. 290 Support for ARM's Integrator platform.
288 291
289config ARCH_REALVIEW 292config ARCH_REALVIEW
290 bool "ARM Ltd. RealView family" 293 bool "ARM Ltd. RealView family"
291 select ARM_AMBA
292 select CLKDEV_LOOKUP
293 select HAVE_MACH_CLKDEV
294 select ICST
295 select GENERIC_CLOCKEVENTS
296 select ARCH_WANT_OPTIONAL_GPIOLIB 294 select ARCH_WANT_OPTIONAL_GPIOLIB
297 select PLAT_VERSATILE 295 select ARM_AMBA
298 select PLAT_VERSATILE_CLOCK
299 select PLAT_VERSATILE_CLCD
300 select ARM_TIMER_SP804 296 select ARM_TIMER_SP804
297 select COMMON_CLK
298 select COMMON_CLK_VERSATILE
299 select GENERIC_CLOCKEVENTS
301 select GPIO_PL061 if GPIOLIB 300 select GPIO_PL061 if GPIOLIB
301 select ICST
302 select NEED_MACH_MEMORY_H 302 select NEED_MACH_MEMORY_H
303 select PLAT_VERSATILE
304 select PLAT_VERSATILE_CLCD
303 help 305 help
304 This enables support for ARM Ltd RealView boards. 306 This enables support for ARM Ltd RealView boards.
305 307
306config ARCH_VERSATILE 308config ARCH_VERSATILE
307 bool "ARM Ltd. Versatile family" 309 bool "ARM Ltd. Versatile family"
310 select ARCH_WANT_OPTIONAL_GPIOLIB
308 select ARM_AMBA 311 select ARM_AMBA
312 select ARM_TIMER_SP804
309 select ARM_VIC 313 select ARM_VIC
310 select CLKDEV_LOOKUP 314 select CLKDEV_LOOKUP
315 select GENERIC_CLOCKEVENTS
311 select HAVE_MACH_CLKDEV 316 select HAVE_MACH_CLKDEV
312 select ICST 317 select ICST
313 select GENERIC_CLOCKEVENTS
314 select ARCH_WANT_OPTIONAL_GPIOLIB
315 select NEED_MACH_IO_H if PCI
316 select PLAT_VERSATILE 318 select PLAT_VERSATILE
317 select PLAT_VERSATILE_CLOCK
318 select PLAT_VERSATILE_CLCD 319 select PLAT_VERSATILE_CLCD
320 select PLAT_VERSATILE_CLOCK
319 select PLAT_VERSATILE_FPGA_IRQ 321 select PLAT_VERSATILE_FPGA_IRQ
320 select ARM_TIMER_SP804
321 help 322 help
322 This enables support for ARM Ltd Versatile board. 323 This enables support for ARM Ltd Versatile board.
323 324
324config ARCH_VEXPRESS
325 bool "ARM Ltd. Versatile Express family"
326 select ARCH_WANT_OPTIONAL_GPIOLIB
327 select ARM_AMBA
328 select ARM_TIMER_SP804
329 select CLKDEV_LOOKUP
330 select COMMON_CLK
331 select GENERIC_CLOCKEVENTS
332 select HAVE_CLK
333 select HAVE_PATA_PLATFORM
334 select ICST
335 select NO_IOPORT
336 select PLAT_VERSATILE
337 select PLAT_VERSATILE_CLCD
338 select REGULATOR_FIXED_VOLTAGE if REGULATOR
339 help
340 This enables support for the ARM Ltd Versatile Express boards.
341
342config ARCH_AT91 325config ARCH_AT91
343 bool "Atmel AT91" 326 bool "Atmel AT91"
344 select ARCH_REQUIRE_GPIOLIB 327 select ARCH_REQUIRE_GPIOLIB
345 select HAVE_CLK
346 select CLKDEV_LOOKUP 328 select CLKDEV_LOOKUP
329 select HAVE_CLK
347 select IRQ_DOMAIN 330 select IRQ_DOMAIN
331 select NEED_MACH_GPIO_H
348 select NEED_MACH_IO_H if PCCARD 332 select NEED_MACH_IO_H if PCCARD
349 help 333 help
350 This enables support for systems based on Atmel 334 This enables support for systems based on Atmel
351 AT91RM9200 and AT91SAM9* processors. 335 AT91RM9200 and AT91SAM9* processors.
352 336
353config ARCH_BCMRING 337config ARCH_BCM2835
354 bool "Broadcom BCMRING" 338 bool "Broadcom BCM2835 family"
355 depends on MMU
356 select CPU_V6
357 select ARM_AMBA
358 select ARM_TIMER_SP804
359 select CLKDEV_LOOKUP
360 select GENERIC_CLOCKEVENTS
361 select ARCH_WANT_OPTIONAL_GPIOLIB
362 help
363 Support for Broadcom's BCMRing platform.
364
365config ARCH_HIGHBANK
366 bool "Calxeda Highbank-based"
367 select ARCH_WANT_OPTIONAL_GPIOLIB 339 select ARCH_WANT_OPTIONAL_GPIOLIB
368 select ARM_AMBA 340 select ARM_AMBA
369 select ARM_GIC 341 select ARM_ERRATA_411920
370 select ARM_TIMER_SP804 342 select ARM_TIMER_SP804
371 select CACHE_L2X0
372 select CLKDEV_LOOKUP 343 select CLKDEV_LOOKUP
373 select COMMON_CLK 344 select COMMON_CLK
374 select CPU_V7 345 select CPU_V6
375 select GENERIC_CLOCKEVENTS 346 select GENERIC_CLOCKEVENTS
376 select HAVE_ARM_SCU 347 select MULTI_IRQ_HANDLER
377 select HAVE_SMP
378 select SPARSE_IRQ 348 select SPARSE_IRQ
379 select USE_OF 349 select USE_OF
380 help 350 help
381 Support for the Calxeda Highbank SoC based boards. 351 This enables support for the Broadcom BCM2835 SoC. This SoC is
382 352 use in the Raspberry Pi, and Roku 2 devices.
383config ARCH_CLPS711X
384 bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
385 select CPU_ARM720T
386 select ARCH_USES_GETTIMEOFFSET
387 select NEED_MACH_MEMORY_H
388 help
389 Support for Cirrus Logic 711x/721x/731x based boards.
390 353
391config ARCH_CNS3XXX 354config ARCH_CNS3XXX
392 bool "Cavium Networks CNS3XXX family" 355 bool "Cavium Networks CNS3XXX family"
356 select ARM_GIC
393 select CPU_V6K 357 select CPU_V6K
394 select GENERIC_CLOCKEVENTS 358 select GENERIC_CLOCKEVENTS
395 select ARM_GIC
396 select MIGHT_HAVE_CACHE_L2X0 359 select MIGHT_HAVE_CACHE_L2X0
397 select MIGHT_HAVE_PCI 360 select MIGHT_HAVE_PCI
398 select PCI_DOMAINS if PCI 361 select PCI_DOMAINS if PCI
399 help 362 help
400 Support for Cavium Networks CNS3XXX platform. 363 Support for Cavium Networks CNS3XXX platform.
401 364
365config ARCH_CLPS711X
366 bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
367 select ARCH_USES_GETTIMEOFFSET
368 select CLKDEV_LOOKUP
369 select COMMON_CLK
370 select CPU_ARM720T
371 select NEED_MACH_MEMORY_H
372 help
373 Support for Cirrus Logic 711x/721x/731x based boards.
374
402config ARCH_GEMINI 375config ARCH_GEMINI
403 bool "Cortina Systems Gemini" 376 bool "Cortina Systems Gemini"
404 select CPU_FA526
405 select ARCH_REQUIRE_GPIOLIB 377 select ARCH_REQUIRE_GPIOLIB
406 select ARCH_USES_GETTIMEOFFSET 378 select ARCH_USES_GETTIMEOFFSET
379 select CPU_FA526
407 help 380 help
408 Support for the Cortina Systems Gemini family SoCs 381 Support for the Cortina Systems Gemini family SoCs
409 382
410config ARCH_PRIMA2 383config ARCH_SIRF
411 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" 384 bool "CSR SiRF"
412 select CPU_V7
413 select NO_IOPORT
414 select ARCH_REQUIRE_GPIOLIB 385 select ARCH_REQUIRE_GPIOLIB
386 select COMMON_CLK
415 select GENERIC_CLOCKEVENTS 387 select GENERIC_CLOCKEVENTS
416 select CLKDEV_LOOKUP
417 select GENERIC_IRQ_CHIP 388 select GENERIC_IRQ_CHIP
418 select MIGHT_HAVE_CACHE_L2X0 389 select MIGHT_HAVE_CACHE_L2X0
390 select NO_IOPORT
419 select PINCTRL 391 select PINCTRL
420 select PINCTRL_SIRF 392 select PINCTRL_SIRF
421 select USE_OF 393 select USE_OF
422 select ZONE_DMA
423 help 394 help
424 Support for CSR SiRFSoC ARM Cortex A9 Platform 395 Support for CSR SiRFprimaII/Marco/Polo platforms
425 396
426config ARCH_EBSA110 397config ARCH_EBSA110
427 bool "EBSA-110" 398 bool "EBSA-110"
399 select ARCH_USES_GETTIMEOFFSET
428 select CPU_SA110 400 select CPU_SA110
429 select ISA 401 select ISA
430 select NO_IOPORT
431 select ARCH_USES_GETTIMEOFFSET
432 select NEED_MACH_IO_H 402 select NEED_MACH_IO_H
433 select NEED_MACH_MEMORY_H 403 select NEED_MACH_MEMORY_H
404 select NO_IOPORT
434 help 405 help
435 This is an evaluation board for the StrongARM processor available 406 This is an evaluation board for the StrongARM processor available
436 from Digital. It has limited hardware on-board, including an 407 from Digital. It has limited hardware on-board, including an
@@ -439,13 +410,13 @@ config ARCH_EBSA110
439 410
440config ARCH_EP93XX 411config ARCH_EP93XX
441 bool "EP93xx-based" 412 bool "EP93xx-based"
442 select CPU_ARM920T 413 select ARCH_HAS_HOLES_MEMORYMODEL
414 select ARCH_REQUIRE_GPIOLIB
415 select ARCH_USES_GETTIMEOFFSET
443 select ARM_AMBA 416 select ARM_AMBA
444 select ARM_VIC 417 select ARM_VIC
445 select CLKDEV_LOOKUP 418 select CLKDEV_LOOKUP
446 select ARCH_REQUIRE_GPIOLIB 419 select CPU_ARM920T
447 select ARCH_HAS_HOLES_MEMORYMODEL
448 select ARCH_USES_GETTIMEOFFSET
449 select NEED_MACH_MEMORY_H 420 select NEED_MACH_MEMORY_H
450 help 421 help
451 This enables support for the Cirrus EP93xx series of CPUs. 422 This enables support for the Cirrus EP93xx series of CPUs.
@@ -456,7 +427,7 @@ config ARCH_FOOTBRIDGE
456 select FOOTBRIDGE 427 select FOOTBRIDGE
457 select GENERIC_CLOCKEVENTS 428 select GENERIC_CLOCKEVENTS
458 select HAVE_IDE 429 select HAVE_IDE
459 select NEED_MACH_IO_H 430 select NEED_MACH_IO_H if !MMU
460 select NEED_MACH_MEMORY_H 431 select NEED_MACH_MEMORY_H
461 help 432 help
462 Support for systems based on the DC21285 companion chip 433 Support for systems based on the DC21285 companion chip
@@ -464,10 +435,10 @@ config ARCH_FOOTBRIDGE
464 435
465config ARCH_MXC 436config ARCH_MXC
466 bool "Freescale MXC/iMX-based" 437 bool "Freescale MXC/iMX-based"
467 select GENERIC_CLOCKEVENTS
468 select ARCH_REQUIRE_GPIOLIB 438 select ARCH_REQUIRE_GPIOLIB
469 select CLKDEV_LOOKUP 439 select CLKDEV_LOOKUP
470 select CLKSRC_MMIO 440 select CLKSRC_MMIO
441 select GENERIC_CLOCKEVENTS
471 select GENERIC_IRQ_CHIP 442 select GENERIC_IRQ_CHIP
472 select MULTI_IRQ_HANDLER 443 select MULTI_IRQ_HANDLER
473 select SPARSE_IRQ 444 select SPARSE_IRQ
@@ -477,57 +448,58 @@ config ARCH_MXC
477 448
478config ARCH_MXS 449config ARCH_MXS
479 bool "Freescale MXS-based" 450 bool "Freescale MXS-based"
480 select GENERIC_CLOCKEVENTS
481 select ARCH_REQUIRE_GPIOLIB 451 select ARCH_REQUIRE_GPIOLIB
482 select CLKDEV_LOOKUP 452 select CLKDEV_LOOKUP
483 select CLKSRC_MMIO 453 select CLKSRC_MMIO
484 select COMMON_CLK 454 select COMMON_CLK
455 select GENERIC_CLOCKEVENTS
485 select HAVE_CLK_PREPARE 456 select HAVE_CLK_PREPARE
457 select MULTI_IRQ_HANDLER
486 select PINCTRL 458 select PINCTRL
459 select SPARSE_IRQ
487 select USE_OF 460 select USE_OF
488 help 461 help
489 Support for Freescale MXS-based family of processors 462 Support for Freescale MXS-based family of processors
490 463
491config ARCH_NETX 464config ARCH_NETX
492 bool "Hilscher NetX based" 465 bool "Hilscher NetX based"
466 select ARM_VIC
493 select CLKSRC_MMIO 467 select CLKSRC_MMIO
494 select CPU_ARM926T 468 select CPU_ARM926T
495 select ARM_VIC
496 select GENERIC_CLOCKEVENTS 469 select GENERIC_CLOCKEVENTS
497 help 470 help
498 This enables support for systems based on the Hilscher NetX Soc 471 This enables support for systems based on the Hilscher NetX Soc
499 472
500config ARCH_H720X 473config ARCH_H720X
501 bool "Hynix HMS720x-based" 474 bool "Hynix HMS720x-based"
475 select ARCH_USES_GETTIMEOFFSET
502 select CPU_ARM720T 476 select CPU_ARM720T
503 select ISA_DMA_API 477 select ISA_DMA_API
504 select ARCH_USES_GETTIMEOFFSET
505 help 478 help
506 This enables support for systems based on the Hynix HMS720x 479 This enables support for systems based on the Hynix HMS720x
507 480
508config ARCH_IOP13XX 481config ARCH_IOP13XX
509 bool "IOP13xx-based" 482 bool "IOP13xx-based"
510 depends on MMU 483 depends on MMU
511 select CPU_XSC3
512 select PLAT_IOP
513 select PCI
514 select ARCH_SUPPORTS_MSI 484 select ARCH_SUPPORTS_MSI
515 select VMSPLIT_1G 485 select CPU_XSC3
516 select NEED_MACH_IO_H
517 select NEED_MACH_MEMORY_H 486 select NEED_MACH_MEMORY_H
518 select NEED_RET_TO_USER 487 select NEED_RET_TO_USER
488 select PCI
489 select PLAT_IOP
490 select VMSPLIT_1G
519 help 491 help
520 Support for Intel's IOP13XX (XScale) family of processors. 492 Support for Intel's IOP13XX (XScale) family of processors.
521 493
522config ARCH_IOP32X 494config ARCH_IOP32X
523 bool "IOP32x-based" 495 bool "IOP32x-based"
524 depends on MMU 496 depends on MMU
497 select ARCH_REQUIRE_GPIOLIB
525 select CPU_XSCALE 498 select CPU_XSCALE
526 select NEED_MACH_IO_H 499 select NEED_MACH_GPIO_H
527 select NEED_RET_TO_USER 500 select NEED_RET_TO_USER
528 select PLAT_IOP
529 select PCI 501 select PCI
530 select ARCH_REQUIRE_GPIOLIB 502 select PLAT_IOP
531 help 503 help
532 Support for Intel's 80219 and IOP32X (XScale) family of 504 Support for Intel's 80219 and IOP32X (XScale) family of
533 processors. 505 processors.
@@ -535,12 +507,12 @@ config ARCH_IOP32X
535config ARCH_IOP33X 507config ARCH_IOP33X
536 bool "IOP33x-based" 508 bool "IOP33x-based"
537 depends on MMU 509 depends on MMU
510 select ARCH_REQUIRE_GPIOLIB
538 select CPU_XSCALE 511 select CPU_XSCALE
539 select NEED_MACH_IO_H 512 select NEED_MACH_GPIO_H
540 select NEED_RET_TO_USER 513 select NEED_RET_TO_USER
541 select PLAT_IOP
542 select PCI 514 select PCI
543 select ARCH_REQUIRE_GPIOLIB 515 select PLAT_IOP
544 help 516 help
545 Support for Intel's IOP33X (XScale) family of processors. 517 Support for Intel's IOP33X (XScale) family of processors.
546 518
@@ -548,74 +520,45 @@ config ARCH_IXP4XX
548 bool "IXP4xx-based" 520 bool "IXP4xx-based"
549 depends on MMU 521 depends on MMU
550 select ARCH_HAS_DMA_SET_COHERENT_MASK 522 select ARCH_HAS_DMA_SET_COHERENT_MASK
523 select ARCH_REQUIRE_GPIOLIB
551 select CLKSRC_MMIO 524 select CLKSRC_MMIO
552 select CPU_XSCALE 525 select CPU_XSCALE
553 select ARCH_REQUIRE_GPIOLIB 526 select DMABOUNCE if PCI
554 select GENERIC_CLOCKEVENTS 527 select GENERIC_CLOCKEVENTS
555 select MIGHT_HAVE_PCI 528 select MIGHT_HAVE_PCI
556 select NEED_MACH_IO_H 529 select NEED_MACH_IO_H
557 select DMABOUNCE if PCI
558 help 530 help
559 Support for Intel's IXP4XX (XScale) family of processors. 531 Support for Intel's IXP4XX (XScale) family of processors.
560 532
561config ARCH_MVEBU
562 bool "Marvell SOCs with Device Tree support"
563 select GENERIC_CLOCKEVENTS
564 select MULTI_IRQ_HANDLER
565 select SPARSE_IRQ
566 select CLKSRC_MMIO
567 select GENERIC_IRQ_CHIP
568 select IRQ_DOMAIN
569 select COMMON_CLK
570 help
571 Support for the Marvell SoC Family with device tree support
572
573config ARCH_DOVE 533config ARCH_DOVE
574 bool "Marvell Dove" 534 bool "Marvell Dove"
575 select CPU_V7
576 select PCI
577 select ARCH_REQUIRE_GPIOLIB 535 select ARCH_REQUIRE_GPIOLIB
536 select CPU_V7
578 select GENERIC_CLOCKEVENTS 537 select GENERIC_CLOCKEVENTS
579 select NEED_MACH_IO_H 538 select MIGHT_HAVE_PCI
580 select PLAT_ORION 539 select PLAT_ORION_LEGACY
540 select USB_ARCH_HAS_EHCI
581 help 541 help
582 Support for the Marvell Dove SoC 88AP510 542 Support for the Marvell Dove SoC 88AP510
583 543
584config ARCH_KIRKWOOD 544config ARCH_KIRKWOOD
585 bool "Marvell Kirkwood" 545 bool "Marvell Kirkwood"
586 select CPU_FEROCEON
587 select PCI
588 select ARCH_REQUIRE_GPIOLIB 546 select ARCH_REQUIRE_GPIOLIB
547 select CPU_FEROCEON
589 select GENERIC_CLOCKEVENTS 548 select GENERIC_CLOCKEVENTS
590 select NEED_MACH_IO_H 549 select PCI
591 select PLAT_ORION 550 select PLAT_ORION_LEGACY
592 help 551 help
593 Support for the following Marvell Kirkwood series SoCs: 552 Support for the following Marvell Kirkwood series SoCs:
594 88F6180, 88F6192 and 88F6281. 553 88F6180, 88F6192 and 88F6281.
595 554
596config ARCH_LPC32XX
597 bool "NXP LPC32XX"
598 select CLKSRC_MMIO
599 select CPU_ARM926T
600 select ARCH_REQUIRE_GPIOLIB
601 select HAVE_IDE
602 select ARM_AMBA
603 select USB_ARCH_HAS_OHCI
604 select CLKDEV_LOOKUP
605 select GENERIC_CLOCKEVENTS
606 select USE_OF
607 select HAVE_PWM
608 help
609 Support for the NXP LPC32XX family of processors
610
611config ARCH_MV78XX0 555config ARCH_MV78XX0
612 bool "Marvell MV78xx0" 556 bool "Marvell MV78xx0"
613 select CPU_FEROCEON
614 select PCI
615 select ARCH_REQUIRE_GPIOLIB 557 select ARCH_REQUIRE_GPIOLIB
558 select CPU_FEROCEON
616 select GENERIC_CLOCKEVENTS 559 select GENERIC_CLOCKEVENTS
617 select NEED_MACH_IO_H 560 select PCI
618 select PLAT_ORION 561 select PLAT_ORION_LEGACY
619 help 562 help
620 Support for the following Marvell MV78xx0 series SoCs: 563 Support for the following Marvell MV78xx0 series SoCs:
621 MV781x0, MV782x0. 564 MV781x0, MV782x0.
@@ -623,12 +566,11 @@ config ARCH_MV78XX0
623config ARCH_ORION5X 566config ARCH_ORION5X
624 bool "Marvell Orion" 567 bool "Marvell Orion"
625 depends on MMU 568 depends on MMU
626 select CPU_FEROCEON
627 select PCI
628 select ARCH_REQUIRE_GPIOLIB 569 select ARCH_REQUIRE_GPIOLIB
570 select CPU_FEROCEON
629 select GENERIC_CLOCKEVENTS 571 select GENERIC_CLOCKEVENTS
630 select NEED_MACH_IO_H 572 select PCI
631 select PLAT_ORION 573 select PLAT_ORION_LEGACY
632 help 574 help
633 Support for the following Marvell Orion 5x series SoCs: 575 Support for the following Marvell Orion 5x series SoCs:
634 Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182), 576 Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182),
@@ -639,20 +581,22 @@ config ARCH_MMP
639 depends on MMU 581 depends on MMU
640 select ARCH_REQUIRE_GPIOLIB 582 select ARCH_REQUIRE_GPIOLIB
641 select CLKDEV_LOOKUP 583 select CLKDEV_LOOKUP
584 select GENERIC_ALLOCATOR
642 select GENERIC_CLOCKEVENTS 585 select GENERIC_CLOCKEVENTS
643 select GPIO_PXA 586 select GPIO_PXA
644 select IRQ_DOMAIN 587 select IRQ_DOMAIN
588 select NEED_MACH_GPIO_H
645 select PLAT_PXA 589 select PLAT_PXA
646 select SPARSE_IRQ 590 select SPARSE_IRQ
647 select GENERIC_ALLOCATOR
648 help 591 help
649 Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line. 592 Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
650 593
651config ARCH_KS8695 594config ARCH_KS8695
652 bool "Micrel/Kendin KS8695" 595 bool "Micrel/Kendin KS8695"
653 select CPU_ARM922T
654 select ARCH_REQUIRE_GPIOLIB 596 select ARCH_REQUIRE_GPIOLIB
655 select ARCH_USES_GETTIMEOFFSET 597 select CLKSRC_MMIO
598 select CPU_ARM922T
599 select GENERIC_CLOCKEVENTS
656 select NEED_MACH_MEMORY_H 600 select NEED_MACH_MEMORY_H
657 help 601 help
658 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based 602 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
@@ -660,10 +604,10 @@ config ARCH_KS8695
660 604
661config ARCH_W90X900 605config ARCH_W90X900
662 bool "Nuvoton W90X900 CPU" 606 bool "Nuvoton W90X900 CPU"
663 select CPU_ARM926T
664 select ARCH_REQUIRE_GPIOLIB 607 select ARCH_REQUIRE_GPIOLIB
665 select CLKDEV_LOOKUP 608 select CLKDEV_LOOKUP
666 select CLKSRC_MMIO 609 select CLKSRC_MMIO
610 select CPU_ARM926T
667 select GENERIC_CLOCKEVENTS 611 select GENERIC_CLOCKEVENTS
668 help 612 help
669 Support for Nuvoton (Winbond logic dept.) ARM9 processor, 613 Support for Nuvoton (Winbond logic dept.) ARM9 processor,
@@ -674,74 +618,63 @@ config ARCH_W90X900
674 <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ 618 <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/
675 ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller> 619 ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller>
676 620
621config ARCH_LPC32XX
622 bool "NXP LPC32XX"
623 select ARCH_REQUIRE_GPIOLIB
624 select ARM_AMBA
625 select CLKDEV_LOOKUP
626 select CLKSRC_MMIO
627 select CPU_ARM926T
628 select GENERIC_CLOCKEVENTS
629 select HAVE_IDE
630 select HAVE_PWM
631 select USB_ARCH_HAS_OHCI
632 select USE_OF
633 help
634 Support for the NXP LPC32XX family of processors
635
677config ARCH_TEGRA 636config ARCH_TEGRA
678 bool "NVIDIA Tegra" 637 bool "NVIDIA Tegra"
638 select ARCH_HAS_CPUFREQ
679 select CLKDEV_LOOKUP 639 select CLKDEV_LOOKUP
680 select CLKSRC_MMIO 640 select CLKSRC_MMIO
641 select COMMON_CLK
681 select GENERIC_CLOCKEVENTS 642 select GENERIC_CLOCKEVENTS
682 select GENERIC_GPIO 643 select GENERIC_GPIO
683 select HAVE_CLK 644 select HAVE_CLK
684 select HAVE_SMP 645 select HAVE_SMP
685 select MIGHT_HAVE_CACHE_L2X0 646 select MIGHT_HAVE_CACHE_L2X0
686 select NEED_MACH_IO_H if PCI
687 select ARCH_HAS_CPUFREQ
688 select USE_OF 647 select USE_OF
689 help 648 help
690 This enables support for NVIDIA Tegra based systems (Tegra APX, 649 This enables support for NVIDIA Tegra based systems (Tegra APX,
691 Tegra 6xx and Tegra 2 series). 650 Tegra 6xx and Tegra 2 series).
692 651
693config ARCH_PICOXCELL
694 bool "Picochip picoXcell"
695 select ARCH_REQUIRE_GPIOLIB
696 select ARM_PATCH_PHYS_VIRT
697 select ARM_VIC
698 select CPU_V6K
699 select DW_APB_TIMER
700 select DW_APB_TIMER_OF
701 select GENERIC_CLOCKEVENTS
702 select GENERIC_GPIO
703 select HAVE_TCM
704 select NO_IOPORT
705 select SPARSE_IRQ
706 select USE_OF
707 help
708 This enables support for systems based on the Picochip picoXcell
709 family of Femtocell devices. The picoxcell support requires device tree
710 for all boards.
711
712config ARCH_PNX4008
713 bool "Philips Nexperia PNX4008 Mobile"
714 select CPU_ARM926T
715 select CLKDEV_LOOKUP
716 select ARCH_USES_GETTIMEOFFSET
717 help
718 This enables support for Philips PNX4008 mobile platform.
719
720config ARCH_PXA 652config ARCH_PXA
721 bool "PXA2xx/PXA3xx-based" 653 bool "PXA2xx/PXA3xx-based"
722 depends on MMU 654 depends on MMU
723 select ARCH_MTD_XIP
724 select ARCH_HAS_CPUFREQ 655 select ARCH_HAS_CPUFREQ
656 select ARCH_MTD_XIP
657 select ARCH_REQUIRE_GPIOLIB
658 select ARM_CPU_SUSPEND if PM
659 select AUTO_ZRELADDR
725 select CLKDEV_LOOKUP 660 select CLKDEV_LOOKUP
726 select CLKSRC_MMIO 661 select CLKSRC_MMIO
727 select ARCH_REQUIRE_GPIOLIB
728 select GENERIC_CLOCKEVENTS 662 select GENERIC_CLOCKEVENTS
729 select GPIO_PXA 663 select GPIO_PXA
664 select HAVE_IDE
665 select MULTI_IRQ_HANDLER
666 select NEED_MACH_GPIO_H
730 select PLAT_PXA 667 select PLAT_PXA
731 select SPARSE_IRQ 668 select SPARSE_IRQ
732 select AUTO_ZRELADDR
733 select MULTI_IRQ_HANDLER
734 select ARM_CPU_SUSPEND if PM
735 select HAVE_IDE
736 help 669 help
737 Support for Intel/Marvell's PXA2xx/PXA3xx processor line. 670 Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
738 671
739config ARCH_MSM 672config ARCH_MSM
740 bool "Qualcomm MSM" 673 bool "Qualcomm MSM"
741 select HAVE_CLK
742 select GENERIC_CLOCKEVENTS
743 select ARCH_REQUIRE_GPIOLIB 674 select ARCH_REQUIRE_GPIOLIB
744 select CLKDEV_LOOKUP 675 select CLKDEV_LOOKUP
676 select GENERIC_CLOCKEVENTS
677 select HAVE_CLK
745 help 678 help
746 Support for Qualcomm MSM/QSD based systems. This runs on the 679 Support for Qualcomm MSM/QSD based systems. This runs on the
747 apps processor of the MSM/QSD and depends on a shared memory 680 apps processor of the MSM/QSD and depends on a shared memory
@@ -751,50 +684,51 @@ config ARCH_MSM
751 684
752config ARCH_SHMOBILE 685config ARCH_SHMOBILE
753 bool "Renesas SH-Mobile / R-Mobile" 686 bool "Renesas SH-Mobile / R-Mobile"
754 select HAVE_CLK
755 select CLKDEV_LOOKUP 687 select CLKDEV_LOOKUP
688 select GENERIC_CLOCKEVENTS
689 select HAVE_CLK
756 select HAVE_MACH_CLKDEV 690 select HAVE_MACH_CLKDEV
757 select HAVE_SMP 691 select HAVE_SMP
758 select GENERIC_CLOCKEVENTS
759 select MIGHT_HAVE_CACHE_L2X0 692 select MIGHT_HAVE_CACHE_L2X0
760 select NO_IOPORT
761 select SPARSE_IRQ
762 select MULTI_IRQ_HANDLER 693 select MULTI_IRQ_HANDLER
763 select PM_GENERIC_DOMAINS if PM
764 select NEED_MACH_MEMORY_H 694 select NEED_MACH_MEMORY_H
695 select NO_IOPORT
696 select PM_GENERIC_DOMAINS if PM
697 select SPARSE_IRQ
765 help 698 help
766 Support for Renesas's SH-Mobile and R-Mobile ARM platforms. 699 Support for Renesas's SH-Mobile and R-Mobile ARM platforms.
767 700
768config ARCH_RPC 701config ARCH_RPC
769 bool "RiscPC" 702 bool "RiscPC"
770 select ARCH_ACORN 703 select ARCH_ACORN
771 select FIQ
772 select ARCH_MAY_HAVE_PC_FDC 704 select ARCH_MAY_HAVE_PC_FDC
773 select HAVE_PATA_PLATFORM
774 select ISA_DMA_API
775 select NO_IOPORT
776 select ARCH_SPARSEMEM_ENABLE 705 select ARCH_SPARSEMEM_ENABLE
777 select ARCH_USES_GETTIMEOFFSET 706 select ARCH_USES_GETTIMEOFFSET
707 select FIQ
778 select HAVE_IDE 708 select HAVE_IDE
709 select HAVE_PATA_PLATFORM
710 select ISA_DMA_API
779 select NEED_MACH_IO_H 711 select NEED_MACH_IO_H
780 select NEED_MACH_MEMORY_H 712 select NEED_MACH_MEMORY_H
713 select NO_IOPORT
781 help 714 help
782 On the Acorn Risc-PC, Linux can support the internal IDE disk and 715 On the Acorn Risc-PC, Linux can support the internal IDE disk and
783 CD-ROM interface, serial and parallel port, and the floppy drive. 716 CD-ROM interface, serial and parallel port, and the floppy drive.
784 717
785config ARCH_SA1100 718config ARCH_SA1100
786 bool "SA1100-based" 719 bool "SA1100-based"
787 select CLKSRC_MMIO
788 select CPU_SA1100
789 select ISA
790 select ARCH_SPARSEMEM_ENABLE
791 select ARCH_MTD_XIP
792 select ARCH_HAS_CPUFREQ 720 select ARCH_HAS_CPUFREQ
721 select ARCH_MTD_XIP
722 select ARCH_REQUIRE_GPIOLIB
723 select ARCH_SPARSEMEM_ENABLE
724 select CLKDEV_LOOKUP
725 select CLKSRC_MMIO
793 select CPU_FREQ 726 select CPU_FREQ
727 select CPU_SA1100
794 select GENERIC_CLOCKEVENTS 728 select GENERIC_CLOCKEVENTS
795 select CLKDEV_LOOKUP
796 select ARCH_REQUIRE_GPIOLIB
797 select HAVE_IDE 729 select HAVE_IDE
730 select ISA
731 select NEED_MACH_GPIO_H
798 select NEED_MACH_MEMORY_H 732 select NEED_MACH_MEMORY_H
799 select SPARSE_IRQ 733 select SPARSE_IRQ
800 help 734 help
@@ -802,14 +736,15 @@ config ARCH_SA1100
802 736
803config ARCH_S3C24XX 737config ARCH_S3C24XX
804 bool "Samsung S3C24XX SoCs" 738 bool "Samsung S3C24XX SoCs"
805 select GENERIC_GPIO
806 select ARCH_HAS_CPUFREQ 739 select ARCH_HAS_CPUFREQ
807 select HAVE_CLK
808 select CLKDEV_LOOKUP
809 select ARCH_USES_GETTIMEOFFSET 740 select ARCH_USES_GETTIMEOFFSET
741 select CLKDEV_LOOKUP
742 select GENERIC_GPIO
743 select HAVE_CLK
810 select HAVE_S3C2410_I2C if I2C 744 select HAVE_S3C2410_I2C if I2C
811 select HAVE_S3C_RTC if RTC_CLASS
812 select HAVE_S3C2410_WATCHDOG if WATCHDOG 745 select HAVE_S3C2410_WATCHDOG if WATCHDOG
746 select HAVE_S3C_RTC if RTC_CLASS
747 select NEED_MACH_GPIO_H
813 select NEED_MACH_IO_H 748 select NEED_MACH_IO_H
814 help 749 help
815 Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443 750 Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443
@@ -819,100 +754,104 @@ config ARCH_S3C24XX
819 754
820config ARCH_S3C64XX 755config ARCH_S3C64XX
821 bool "Samsung S3C64XX" 756 bool "Samsung S3C64XX"
822 select PLAT_SAMSUNG 757 select ARCH_HAS_CPUFREQ
823 select CPU_V6 758 select ARCH_REQUIRE_GPIOLIB
759 select ARCH_USES_GETTIMEOFFSET
824 select ARM_VIC 760 select ARM_VIC
761 select CLKDEV_LOOKUP
762 select CPU_V6
825 select HAVE_CLK 763 select HAVE_CLK
764 select HAVE_S3C2410_I2C if I2C
765 select HAVE_S3C2410_WATCHDOG if WATCHDOG
826 select HAVE_TCM 766 select HAVE_TCM
827 select CLKDEV_LOOKUP 767 select NEED_MACH_GPIO_H
828 select NO_IOPORT 768 select NO_IOPORT
829 select ARCH_USES_GETTIMEOFFSET 769 select PLAT_SAMSUNG
830 select ARCH_HAS_CPUFREQ 770 select S3C_DEV_NAND
831 select ARCH_REQUIRE_GPIOLIB 771 select S3C_GPIO_TRACK
832 select SAMSUNG_CLKSRC 772 select SAMSUNG_CLKSRC
773 select SAMSUNG_GPIOLIB_4BIT
833 select SAMSUNG_IRQ_VIC_TIMER 774 select SAMSUNG_IRQ_VIC_TIMER
834 select S3C_GPIO_TRACK
835 select S3C_DEV_NAND
836 select USB_ARCH_HAS_OHCI 775 select USB_ARCH_HAS_OHCI
837 select SAMSUNG_GPIOLIB_4BIT
838 select HAVE_S3C2410_I2C if I2C
839 select HAVE_S3C2410_WATCHDOG if WATCHDOG
840 help 776 help
841 Samsung S3C64XX series based systems 777 Samsung S3C64XX series based systems
842 778
843config ARCH_S5P64X0 779config ARCH_S5P64X0
844 bool "Samsung S5P6440 S5P6450" 780 bool "Samsung S5P6440 S5P6450"
845 select CPU_V6
846 select GENERIC_GPIO
847 select HAVE_CLK
848 select CLKDEV_LOOKUP 781 select CLKDEV_LOOKUP
849 select CLKSRC_MMIO 782 select CLKSRC_MMIO
850 select HAVE_S3C2410_WATCHDOG if WATCHDOG 783 select CPU_V6
851 select GENERIC_CLOCKEVENTS 784 select GENERIC_CLOCKEVENTS
785 select GENERIC_GPIO
786 select HAVE_CLK
852 select HAVE_S3C2410_I2C if I2C 787 select HAVE_S3C2410_I2C if I2C
788 select HAVE_S3C2410_WATCHDOG if WATCHDOG
853 select HAVE_S3C_RTC if RTC_CLASS 789 select HAVE_S3C_RTC if RTC_CLASS
790 select NEED_MACH_GPIO_H
854 help 791 help
855 Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440, 792 Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440,
856 SMDK6450. 793 SMDK6450.
857 794
858config ARCH_S5PC100 795config ARCH_S5PC100
859 bool "Samsung S5PC100" 796 bool "Samsung S5PC100"
860 select GENERIC_GPIO 797 select ARCH_USES_GETTIMEOFFSET
861 select HAVE_CLK
862 select CLKDEV_LOOKUP 798 select CLKDEV_LOOKUP
863 select CPU_V7 799 select CPU_V7
864 select ARCH_USES_GETTIMEOFFSET 800 select GENERIC_GPIO
801 select HAVE_CLK
865 select HAVE_S3C2410_I2C if I2C 802 select HAVE_S3C2410_I2C if I2C
866 select HAVE_S3C_RTC if RTC_CLASS
867 select HAVE_S3C2410_WATCHDOG if WATCHDOG 803 select HAVE_S3C2410_WATCHDOG if WATCHDOG
804 select HAVE_S3C_RTC if RTC_CLASS
805 select NEED_MACH_GPIO_H
868 help 806 help
869 Samsung S5PC100 series based systems 807 Samsung S5PC100 series based systems
870 808
871config ARCH_S5PV210 809config ARCH_S5PV210
872 bool "Samsung S5PV210/S5PC110" 810 bool "Samsung S5PV210/S5PC110"
873 select CPU_V7 811 select ARCH_HAS_CPUFREQ
874 select ARCH_SPARSEMEM_ENABLE
875 select ARCH_HAS_HOLES_MEMORYMODEL 812 select ARCH_HAS_HOLES_MEMORYMODEL
876 select GENERIC_GPIO 813 select ARCH_SPARSEMEM_ENABLE
877 select HAVE_CLK
878 select CLKDEV_LOOKUP 814 select CLKDEV_LOOKUP
879 select CLKSRC_MMIO 815 select CLKSRC_MMIO
880 select ARCH_HAS_CPUFREQ 816 select CPU_V7
881 select GENERIC_CLOCKEVENTS 817 select GENERIC_CLOCKEVENTS
818 select GENERIC_GPIO
819 select HAVE_CLK
882 select HAVE_S3C2410_I2C if I2C 820 select HAVE_S3C2410_I2C if I2C
883 select HAVE_S3C_RTC if RTC_CLASS
884 select HAVE_S3C2410_WATCHDOG if WATCHDOG 821 select HAVE_S3C2410_WATCHDOG if WATCHDOG
822 select HAVE_S3C_RTC if RTC_CLASS
823 select NEED_MACH_GPIO_H
885 select NEED_MACH_MEMORY_H 824 select NEED_MACH_MEMORY_H
886 help 825 help
887 Samsung S5PV210/S5PC110 series based systems 826 Samsung S5PV210/S5PC110 series based systems
888 827
889config ARCH_EXYNOS 828config ARCH_EXYNOS
890 bool "SAMSUNG EXYNOS" 829 bool "Samsung EXYNOS"
891 select CPU_V7 830 select ARCH_HAS_CPUFREQ
892 select ARCH_SPARSEMEM_ENABLE
893 select ARCH_HAS_HOLES_MEMORYMODEL 831 select ARCH_HAS_HOLES_MEMORYMODEL
894 select GENERIC_GPIO 832 select ARCH_SPARSEMEM_ENABLE
895 select HAVE_CLK
896 select CLKDEV_LOOKUP 833 select CLKDEV_LOOKUP
897 select ARCH_HAS_CPUFREQ 834 select CPU_V7
898 select GENERIC_CLOCKEVENTS 835 select GENERIC_CLOCKEVENTS
899 select HAVE_S3C_RTC if RTC_CLASS 836 select GENERIC_GPIO
837 select HAVE_CLK
900 select HAVE_S3C2410_I2C if I2C 838 select HAVE_S3C2410_I2C if I2C
901 select HAVE_S3C2410_WATCHDOG if WATCHDOG 839 select HAVE_S3C2410_WATCHDOG if WATCHDOG
840 select HAVE_S3C_RTC if RTC_CLASS
841 select NEED_MACH_GPIO_H
902 select NEED_MACH_MEMORY_H 842 select NEED_MACH_MEMORY_H
903 help 843 help
904 Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5) 844 Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
905 845
906config ARCH_SHARK 846config ARCH_SHARK
907 bool "Shark" 847 bool "Shark"
848 select ARCH_USES_GETTIMEOFFSET
908 select CPU_SA110 849 select CPU_SA110
909 select ISA 850 select ISA
910 select ISA_DMA 851 select ISA_DMA
911 select ZONE_DMA
912 select PCI
913 select ARCH_USES_GETTIMEOFFSET
914 select NEED_MACH_MEMORY_H 852 select NEED_MACH_MEMORY_H
915 select NEED_MACH_IO_H 853 select PCI
854 select ZONE_DMA
916 help 855 help
917 Support for the StrongARM based Digital DNARD machine, also known 856 Support for the StrongARM based Digital DNARD machine, also known
918 as "Shark" (<http://www.shark-linux.de/shark.html>). 857 as "Shark" (<http://www.shark-linux.de/shark.html>).
@@ -920,29 +859,30 @@ config ARCH_SHARK
920config ARCH_U300 859config ARCH_U300
921 bool "ST-Ericsson U300 Series" 860 bool "ST-Ericsson U300 Series"
922 depends on MMU 861 depends on MMU
923 select CLKSRC_MMIO 862 select ARCH_REQUIRE_GPIOLIB
924 select CPU_ARM926T
925 select HAVE_TCM
926 select ARM_AMBA 863 select ARM_AMBA
927 select ARM_PATCH_PHYS_VIRT 864 select ARM_PATCH_PHYS_VIRT
928 select ARM_VIC 865 select ARM_VIC
929 select GENERIC_CLOCKEVENTS
930 select CLKDEV_LOOKUP 866 select CLKDEV_LOOKUP
867 select CLKSRC_MMIO
931 select COMMON_CLK 868 select COMMON_CLK
869 select CPU_ARM926T
870 select GENERIC_CLOCKEVENTS
932 select GENERIC_GPIO 871 select GENERIC_GPIO
933 select ARCH_REQUIRE_GPIOLIB 872 select HAVE_TCM
873 select SPARSE_IRQ
934 help 874 help
935 Support for ST-Ericsson U300 series mobile platforms. 875 Support for ST-Ericsson U300 series mobile platforms.
936 876
937config ARCH_U8500 877config ARCH_U8500
938 bool "ST-Ericsson U8500 Series" 878 bool "ST-Ericsson U8500 Series"
939 depends on MMU 879 depends on MMU
940 select CPU_V7 880 select ARCH_HAS_CPUFREQ
881 select ARCH_REQUIRE_GPIOLIB
941 select ARM_AMBA 882 select ARM_AMBA
942 select GENERIC_CLOCKEVENTS
943 select CLKDEV_LOOKUP 883 select CLKDEV_LOOKUP
944 select ARCH_REQUIRE_GPIOLIB 884 select CPU_V7
945 select ARCH_HAS_CPUFREQ 885 select GENERIC_CLOCKEVENTS
946 select HAVE_SMP 886 select HAVE_SMP
947 select MIGHT_HAVE_CACHE_L2X0 887 select MIGHT_HAVE_CACHE_L2X0
948 help 888 help
@@ -950,71 +890,78 @@ config ARCH_U8500
950 890
951config ARCH_NOMADIK 891config ARCH_NOMADIK
952 bool "STMicroelectronics Nomadik" 892 bool "STMicroelectronics Nomadik"
893 select ARCH_REQUIRE_GPIOLIB
953 select ARM_AMBA 894 select ARM_AMBA
954 select ARM_VIC 895 select ARM_VIC
955 select CPU_ARM926T
956 select COMMON_CLK 896 select COMMON_CLK
897 select CPU_ARM926T
957 select GENERIC_CLOCKEVENTS 898 select GENERIC_CLOCKEVENTS
958 select PINCTRL
959 select MIGHT_HAVE_CACHE_L2X0 899 select MIGHT_HAVE_CACHE_L2X0
960 select ARCH_REQUIRE_GPIOLIB 900 select PINCTRL
901 select PINCTRL_STN8815
961 help 902 help
962 Support for the Nomadik platform by ST-Ericsson 903 Support for the Nomadik platform by ST-Ericsson
963 904
905config PLAT_SPEAR
906 bool "ST SPEAr"
907 select ARCH_REQUIRE_GPIOLIB
908 select ARM_AMBA
909 select CLKDEV_LOOKUP
910 select CLKSRC_MMIO
911 select COMMON_CLK
912 select GENERIC_CLOCKEVENTS
913 select HAVE_CLK
914 help
915 Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
916
964config ARCH_DAVINCI 917config ARCH_DAVINCI
965 bool "TI DaVinci" 918 bool "TI DaVinci"
966 select GENERIC_CLOCKEVENTS 919 select ARCH_HAS_HOLES_MEMORYMODEL
967 select ARCH_REQUIRE_GPIOLIB 920 select ARCH_REQUIRE_GPIOLIB
968 select ZONE_DMA
969 select HAVE_IDE
970 select CLKDEV_LOOKUP 921 select CLKDEV_LOOKUP
971 select GENERIC_ALLOCATOR 922 select GENERIC_ALLOCATOR
923 select GENERIC_CLOCKEVENTS
972 select GENERIC_IRQ_CHIP 924 select GENERIC_IRQ_CHIP
973 select ARCH_HAS_HOLES_MEMORYMODEL 925 select HAVE_IDE
926 select NEED_MACH_GPIO_H
927 select ZONE_DMA
974 help 928 help
975 Support for TI's DaVinci platform. 929 Support for TI's DaVinci platform.
976 930
977config ARCH_OMAP 931config ARCH_OMAP
978 bool "TI OMAP" 932 bool "TI OMAP"
979 depends on MMU 933 depends on MMU
980 select HAVE_CLK
981 select ARCH_REQUIRE_GPIOLIB
982 select ARCH_HAS_CPUFREQ 934 select ARCH_HAS_CPUFREQ
983 select CLKSRC_MMIO
984 select GENERIC_CLOCKEVENTS
985 select ARCH_HAS_HOLES_MEMORYMODEL 935 select ARCH_HAS_HOLES_MEMORYMODEL
986 help
987 Support for TI's OMAP platform (OMAP1/2/3/4).
988
989config PLAT_SPEAR
990 bool "ST SPEAr"
991 select ARM_AMBA
992 select ARCH_REQUIRE_GPIOLIB 936 select ARCH_REQUIRE_GPIOLIB
993 select CLKDEV_LOOKUP
994 select COMMON_CLK
995 select CLKSRC_MMIO 937 select CLKSRC_MMIO
996 select GENERIC_CLOCKEVENTS 938 select GENERIC_CLOCKEVENTS
997 select HAVE_CLK 939 select HAVE_CLK
940 select NEED_MACH_GPIO_H
998 help 941 help
999 Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx). 942 Support for TI's OMAP platform (OMAP1/2/3/4).
1000 943
1001config ARCH_VT8500 944config ARCH_VT8500
1002 bool "VIA/WonderMedia 85xx" 945 bool "VIA/WonderMedia 85xx"
1003 select CPU_ARM926T
1004 select GENERIC_GPIO
1005 select ARCH_HAS_CPUFREQ 946 select ARCH_HAS_CPUFREQ
1006 select GENERIC_CLOCKEVENTS
1007 select ARCH_REQUIRE_GPIOLIB 947 select ARCH_REQUIRE_GPIOLIB
948 select CLKDEV_LOOKUP
949 select COMMON_CLK
950 select CPU_ARM926T
951 select GENERIC_CLOCKEVENTS
952 select GENERIC_GPIO
953 select HAVE_CLK
954 select USE_OF
1008 help 955 help
1009 Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip. 956 Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
1010 957
1011config ARCH_ZYNQ 958config ARCH_ZYNQ
1012 bool "Xilinx Zynq ARM Cortex A9 Platform" 959 bool "Xilinx Zynq ARM Cortex A9 Platform"
960 select ARM_AMBA
961 select ARM_GIC
962 select CLKDEV_LOOKUP
1013 select CPU_V7 963 select CPU_V7
1014 select GENERIC_CLOCKEVENTS 964 select GENERIC_CLOCKEVENTS
1015 select CLKDEV_LOOKUP
1016 select ARM_GIC
1017 select ARM_AMBA
1018 select ICST 965 select ICST
1019 select MIGHT_HAVE_CACHE_L2X0 966 select MIGHT_HAVE_CACHE_L2X0
1020 select USE_OF 967 select USE_OF
@@ -1022,6 +969,50 @@ config ARCH_ZYNQ
1022 Support for Xilinx Zynq ARM Cortex A9 Platform 969 Support for Xilinx Zynq ARM Cortex A9 Platform
1023endchoice 970endchoice
1024 971
972menu "Multiple platform selection"
973 depends on ARCH_MULTIPLATFORM
974
975comment "CPU Core family selection"
976
977config ARCH_MULTI_V4
978 bool "ARMv4 based platforms (FA526, StrongARM)"
979 depends on !ARCH_MULTI_V6_V7
980 select ARCH_MULTI_V4_V5
981
982config ARCH_MULTI_V4T
983 bool "ARMv4T based platforms (ARM720T, ARM920T, ...)"
984 depends on !ARCH_MULTI_V6_V7
985 select ARCH_MULTI_V4_V5
986
987config ARCH_MULTI_V5
988 bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)"
989 depends on !ARCH_MULTI_V6_V7
990 select ARCH_MULTI_V4_V5
991
992config ARCH_MULTI_V4_V5
993 bool
994
995config ARCH_MULTI_V6
996 bool "ARMv6 based platforms (ARM11, Scorpion, ...)"
997 select ARCH_MULTI_V6_V7
998 select CPU_V6
999
1000config ARCH_MULTI_V7
1001 bool "ARMv7 based platforms (Cortex-A, PJ4, Krait)"
1002 default y
1003 select ARCH_MULTI_V6_V7
1004 select ARCH_VEXPRESS
1005 select CPU_V7
1006
1007config ARCH_MULTI_V6_V7
1008 bool
1009
1010config ARCH_MULTI_CPU_AUTO
1011 def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7)
1012 select ARCH_MULTI_V5
1013
1014endmenu
1015
1025# 1016#
1026# This is sorted alphabetically by mach-* pathname. However, plat-* 1017# This is sorted alphabetically by mach-* pathname. However, plat-*
1027# Kconfigs may be included either alphabetically (according to the 1018# Kconfigs may be included either alphabetically (according to the
@@ -1031,8 +1022,6 @@ source "arch/arm/mach-mvebu/Kconfig"
1031 1022
1032source "arch/arm/mach-at91/Kconfig" 1023source "arch/arm/mach-at91/Kconfig"
1033 1024
1034source "arch/arm/mach-bcmring/Kconfig"
1035
1036source "arch/arm/mach-clps711x/Kconfig" 1025source "arch/arm/mach-clps711x/Kconfig"
1037 1026
1038source "arch/arm/mach-cns3xxx/Kconfig" 1027source "arch/arm/mach-cns3xxx/Kconfig"
@@ -1049,6 +1038,8 @@ source "arch/arm/mach-gemini/Kconfig"
1049 1038
1050source "arch/arm/mach-h720x/Kconfig" 1039source "arch/arm/mach-h720x/Kconfig"
1051 1040
1041source "arch/arm/mach-highbank/Kconfig"
1042
1052source "arch/arm/mach-integrator/Kconfig" 1043source "arch/arm/mach-integrator/Kconfig"
1053 1044
1054source "arch/arm/mach-iop32x/Kconfig" 1045source "arch/arm/mach-iop32x/Kconfig"
@@ -1084,6 +1075,8 @@ source "arch/arm/mach-omap2/Kconfig"
1084 1075
1085source "arch/arm/mach-orion5x/Kconfig" 1076source "arch/arm/mach-orion5x/Kconfig"
1086 1077
1078source "arch/arm/mach-picoxcell/Kconfig"
1079
1087source "arch/arm/mach-pxa/Kconfig" 1080source "arch/arm/mach-pxa/Kconfig"
1088source "arch/arm/plat-pxa/Kconfig" 1081source "arch/arm/plat-pxa/Kconfig"
1089 1082
@@ -1096,6 +1089,8 @@ source "arch/arm/mach-sa1100/Kconfig"
1096source "arch/arm/plat-samsung/Kconfig" 1089source "arch/arm/plat-samsung/Kconfig"
1097source "arch/arm/plat-s3c24xx/Kconfig" 1090source "arch/arm/plat-s3c24xx/Kconfig"
1098 1091
1092source "arch/arm/mach-socfpga/Kconfig"
1093
1099source "arch/arm/plat-spear/Kconfig" 1094source "arch/arm/plat-spear/Kconfig"
1100 1095
1101source "arch/arm/mach-s3c24xx/Kconfig" 1096source "arch/arm/mach-s3c24xx/Kconfig"
@@ -1118,6 +1113,8 @@ source "arch/arm/mach-exynos/Kconfig"
1118 1113
1119source "arch/arm/mach-shmobile/Kconfig" 1114source "arch/arm/mach-shmobile/Kconfig"
1120 1115
1116source "arch/arm/mach-prima2/Kconfig"
1117
1121source "arch/arm/mach-tegra/Kconfig" 1118source "arch/arm/mach-tegra/Kconfig"
1122 1119
1123source "arch/arm/mach-u300/Kconfig" 1120source "arch/arm/mach-u300/Kconfig"
@@ -1129,8 +1126,6 @@ source "arch/arm/mach-versatile/Kconfig"
1129source "arch/arm/mach-vexpress/Kconfig" 1126source "arch/arm/mach-vexpress/Kconfig"
1130source "arch/arm/plat-versatile/Kconfig" 1127source "arch/arm/plat-versatile/Kconfig"
1131 1128
1132source "arch/arm/mach-vt8500/Kconfig"
1133
1134source "arch/arm/mach-w90x900/Kconfig" 1129source "arch/arm/mach-w90x900/Kconfig"
1135 1130
1136# Definitions to make life easier 1131# Definitions to make life easier
@@ -1144,9 +1139,13 @@ config PLAT_IOP
1144config PLAT_ORION 1139config PLAT_ORION
1145 bool 1140 bool
1146 select CLKSRC_MMIO 1141 select CLKSRC_MMIO
1142 select COMMON_CLK
1147 select GENERIC_IRQ_CHIP 1143 select GENERIC_IRQ_CHIP
1148 select IRQ_DOMAIN 1144 select IRQ_DOMAIN
1149 select COMMON_CLK 1145
1146config PLAT_ORION_LEGACY
1147 bool
1148 select PLAT_ORION
1150 1149
1151config PLAT_PXA 1150config PLAT_PXA
1152 bool 1151 bool
@@ -1179,12 +1178,6 @@ config XSCALE_PMU
1179 depends on CPU_XSCALE 1178 depends on CPU_XSCALE
1180 default y 1179 default y
1181 1180
1182config CPU_HAS_PMU
1183 depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
1184 (!ARCH_OMAP3 || OMAP3_EMU)
1185 default y
1186 bool
1187
1188config MULTI_IRQ_HANDLER 1181config MULTI_IRQ_HANDLER
1189 bool 1182 bool
1190 help 1183 help
@@ -1413,6 +1406,16 @@ config PL310_ERRATA_769419
1413 on systems with an outer cache, the store buffer is drained 1406 on systems with an outer cache, the store buffer is drained
1414 explicitly. 1407 explicitly.
1415 1408
1409config ARM_ERRATA_775420
1410 bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock"
1411 depends on CPU_V7
1412 help
1413 This option enables the workaround for the 775420 Cortex-A9 (r2p2,
1414 r2p6,r2p8,r2p10,r3p0) erratum. In case a date cache maintenance
1415 operation aborts with MMU exception, it might cause the processor
1416 to deadlock. This workaround puts DSB before executing ISB if
1417 an abort may occur on cache maintenance.
1418
1416endmenu 1419endmenu
1417 1420
1418source "arch/arm/common/Kconfig" 1421source "arch/arm/common/Kconfig"
@@ -1496,8 +1499,8 @@ config SMP
1496 depends on GENERIC_CLOCKEVENTS 1499 depends on GENERIC_CLOCKEVENTS
1497 depends on HAVE_SMP 1500 depends on HAVE_SMP
1498 depends on MMU 1501 depends on MMU
1499 select USE_GENERIC_SMP_HELPERS
1500 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP 1502 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
1503 select USE_GENERIC_SMP_HELPERS
1501 help 1504 help
1502 This enables support for systems with more than one CPU. If you have 1505 This enables support for systems with more than one CPU. If you have
1503 a system with only one CPU, like most personal computers, say N. If 1506 a system with only one CPU, like most personal computers, say N. If
@@ -1623,6 +1626,7 @@ config ARCH_NR_GPIO
1623 default 355 if ARCH_U8500 1626 default 355 if ARCH_U8500
1624 default 264 if MACH_H4700 1627 default 264 if MACH_H4700
1625 default 512 if SOC_OMAP5 1628 default 512 if SOC_OMAP5
1629 default 288 if ARCH_VT8500
1626 default 0 1630 default 0
1627 help 1631 help
1628 Maximum number of GPIOs in the system. 1632 Maximum number of GPIOs in the system.
@@ -1757,7 +1761,7 @@ config HIGHPTE
1757 1761
1758config HW_PERF_EVENTS 1762config HW_PERF_EVENTS
1759 bool "Enable hardware performance counter support for perf events" 1763 bool "Enable hardware performance counter support for perf events"
1760 depends on PERF_EVENTS && CPU_HAS_PMU 1764 depends on PERF_EVENTS
1761 default y 1765 default y
1762 help 1766 help
1763 Enable hardware performance counter support for perf events. If 1767 Enable hardware performance counter support for perf events. If
@@ -1768,6 +1772,7 @@ source "mm/Kconfig"
1768config FORCE_MAX_ZONEORDER 1772config FORCE_MAX_ZONEORDER
1769 int "Maximum zone order" if ARCH_SHMOBILE 1773 int "Maximum zone order" if ARCH_SHMOBILE
1770 range 11 64 if ARCH_SHMOBILE 1774 range 11 64 if ARCH_SHMOBILE
1775 default "12" if SOC_AM33XX
1771 default "9" if SA1111 1776 default "9" if SA1111
1772 default "11" 1777 default "11"
1773 help 1778 help
@@ -1781,59 +1786,6 @@ config FORCE_MAX_ZONEORDER
1781 This config option is actually maximum order plus one. For example, 1786 This config option is actually maximum order plus one. For example,
1782 a value of 11 means that the largest free memory block is 2^10 pages. 1787 a value of 11 means that the largest free memory block is 2^10 pages.
1783 1788
1784config LEDS
1785 bool "Timer and CPU usage LEDs"
1786 depends on ARCH_CDB89712 || ARCH_EBSA110 || \
1787 ARCH_EBSA285 || ARCH_INTEGRATOR || \
1788 ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \
1789 ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \
1790 ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \
1791 ARCH_AT91 || ARCH_DAVINCI || \
1792 ARCH_KS8695 || MACH_RD88F5182 || ARCH_REALVIEW
1793 help
1794 If you say Y here, the LEDs on your machine will be used
1795 to provide useful information about your current system status.
1796
1797 If you are compiling a kernel for a NetWinder or EBSA-285, you will
1798 be able to select which LEDs are active using the options below. If
1799 you are compiling a kernel for the EBSA-110 or the LART however, the
1800 red LED will simply flash regularly to indicate that the system is
1801 still functional. It is safe to say Y here if you have a CATS
1802 system, but the driver will do nothing.
1803
1804config LEDS_TIMER
1805 bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \
1806 OMAP_OSK_MISTRAL || MACH_OMAP_H2 \
1807 || MACH_OMAP_PERSEUS2
1808 depends on LEDS
1809 depends on !GENERIC_CLOCKEVENTS
1810 default y if ARCH_EBSA110
1811 help
1812 If you say Y here, one of the system LEDs (the green one on the
1813 NetWinder, the amber one on the EBSA285, or the red one on the LART)
1814 will flash regularly to indicate that the system is still
1815 operational. This is mainly useful to kernel hackers who are
1816 debugging unstable kernels.
1817
1818 The LART uses the same LED for both Timer LED and CPU usage LED
1819 functions. You may choose to use both, but the Timer LED function
1820 will overrule the CPU usage LED.
1821
1822config LEDS_CPU
1823 bool "CPU usage LED" if (!ARCH_CDB89712 && !ARCH_EBSA110 && \
1824 !ARCH_OMAP) \
1825 || OMAP_OSK_MISTRAL || MACH_OMAP_H2 \
1826 || MACH_OMAP_PERSEUS2
1827 depends on LEDS
1828 help
1829 If you say Y here, the red LED will be used to give a good real
1830 time indication of CPU usage, by lighting whenever the idle task
1831 is not currently executing.
1832
1833 The LART uses the same LED for both Timer LED and CPU usage LED
1834 functions. You may choose to use both, but the Timer LED function
1835 will overrule the CPU usage LED.
1836
1837config ALIGNMENT_TRAP 1789config ALIGNMENT_TRAP
1838 bool 1790 bool
1839 depends on CPU_CP15_MMU 1791 depends on CPU_CP15_MMU
@@ -1849,8 +1801,8 @@ config ALIGNMENT_TRAP
1849 configuration it is safe to say N, otherwise say Y. 1801 configuration it is safe to say N, otherwise say Y.
1850 1802
1851config UACCESS_WITH_MEMCPY 1803config UACCESS_WITH_MEMCPY
1852 bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user() (EXPERIMENTAL)" 1804 bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user()"
1853 depends on MMU && EXPERIMENTAL 1805 depends on MMU
1854 default y if CPU_FEROCEON 1806 default y if CPU_FEROCEON
1855 help 1807 help
1856 Implement faster copy_to_user and clear_user methods for CPU 1808 Implement faster copy_to_user and clear_user methods for CPU
@@ -1891,12 +1843,6 @@ config CC_STACKPROTECTOR
1891 neutralized via a kernel panic. 1843 neutralized via a kernel panic.
1892 This feature requires gcc version 4.2 or above. 1844 This feature requires gcc version 4.2 or above.
1893 1845
1894config DEPRECATED_PARAM_STRUCT
1895 bool "Provide old way to pass kernel parameters"
1896 help
1897 This was deprecated in 2001 and announced to live on for 5 years.
1898 Some old boot loaders still use this way.
1899
1900config XEN_DOM0 1846config XEN_DOM0
1901 def_bool y 1847 def_bool y
1902 depends on XEN 1848 depends on XEN
@@ -1913,12 +1859,29 @@ menu "Boot options"
1913 1859
1914config USE_OF 1860config USE_OF
1915 bool "Flattened Device Tree support" 1861 bool "Flattened Device Tree support"
1862 select IRQ_DOMAIN
1916 select OF 1863 select OF
1917 select OF_EARLY_FLATTREE 1864 select OF_EARLY_FLATTREE
1918 select IRQ_DOMAIN
1919 help 1865 help
1920 Include support for flattened device tree machine descriptions. 1866 Include support for flattened device tree machine descriptions.
1921 1867
1868config ATAGS
1869 bool "Support for the traditional ATAGS boot data passing" if USE_OF
1870 default y
1871 help
1872 This is the traditional way of passing data to the kernel at boot
1873 time. If you are solely relying on the flattened device tree (or
1874 the ARM_ATAG_DTB_COMPAT option) then you may unselect this option
1875 to remove ATAGS support from your kernel binary. If unsure,
1876 leave this to y.
1877
1878config DEPRECATED_PARAM_STRUCT
1879 bool "Provide old way to pass kernel parameters"
1880 depends on ATAGS
1881 help
1882 This was deprecated in 2001 and announced to live on for 5 years.
1883 Some old boot loaders still use this way.
1884
1922# Compressed boot loader in ROM. Yes, we really want to ask about 1885# Compressed boot loader in ROM. Yes, we really want to ask about
1923# TEXT and BSS so we preserve their values in the config files. 1886# TEXT and BSS so we preserve their values in the config files.
1924config ZBOOT_ROM_TEXT 1887config ZBOOT_ROM_TEXT
@@ -2045,6 +2008,7 @@ config CMDLINE
2045choice 2008choice
2046 prompt "Kernel command line type" if CMDLINE != "" 2009 prompt "Kernel command line type" if CMDLINE != ""
2047 default CMDLINE_FROM_BOOTLOADER 2010 default CMDLINE_FROM_BOOTLOADER
2011 depends on ATAGS
2048 2012
2049config CMDLINE_FROM_BOOTLOADER 2013config CMDLINE_FROM_BOOTLOADER
2050 bool "Use bootloader kernel arguments if available" 2014 bool "Use bootloader kernel arguments if available"
@@ -2070,7 +2034,7 @@ endchoice
2070 2034
2071config XIP_KERNEL 2035config XIP_KERNEL
2072 bool "Kernel Execute-In-Place from ROM" 2036 bool "Kernel Execute-In-Place from ROM"
2073 depends on !ZBOOT_ROM && !ARM_LPAE 2037 depends on !ZBOOT_ROM && !ARM_LPAE && !ARCH_MULTIPLATFORM
2074 help 2038 help
2075 Execute-In-Place allows the kernel to run from non-volatile storage 2039 Execute-In-Place allows the kernel to run from non-volatile storage
2076 directly addressable by the CPU, such as NOR flash. This saves RAM 2040 directly addressable by the CPU, such as NOR flash. This saves RAM
@@ -2114,7 +2078,7 @@ config KEXEC
2114 2078
2115config ATAGS_PROC 2079config ATAGS_PROC
2116 bool "Export atags in procfs" 2080 bool "Export atags in procfs"
2117 depends on KEXEC 2081 depends on ATAGS && KEXEC
2118 default y 2082 default y
2119 help 2083 help
2120 Should the atags used to boot the kernel be exported in an "atags" 2084 Should the atags used to boot the kernel be exported in an "atags"
@@ -2179,8 +2143,8 @@ config CPU_FREQ_PXA
2179 bool 2143 bool
2180 depends on CPU_FREQ && ARCH_PXA && PXA25x 2144 depends on CPU_FREQ && ARCH_PXA && PXA25x
2181 default y 2145 default y
2182 select CPU_FREQ_TABLE
2183 select CPU_FREQ_DEFAULT_GOV_USERSPACE 2146 select CPU_FREQ_DEFAULT_GOV_USERSPACE
2147 select CPU_FREQ_TABLE
2184 2148
2185config CPU_FREQ_S3C 2149config CPU_FREQ_S3C
2186 bool 2150 bool
@@ -2323,7 +2287,7 @@ menu "Power management options"
2323source "kernel/power/Kconfig" 2287source "kernel/power/Kconfig"
2324 2288
2325config ARCH_SUSPEND_POSSIBLE 2289config ARCH_SUSPEND_POSSIBLE
2326 depends on !ARCH_S5PC100 && !ARCH_TEGRA 2290 depends on !ARCH_S5PC100
2327 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \ 2291 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \
2328 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK 2292 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK
2329 def_bool y 2293 def_bool y
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index f15f82bf3a5..b0f3857b3a4 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -224,6 +224,20 @@ choice
224 Say Y here if you want kernel low-level debugging support 224 Say Y here if you want kernel low-level debugging support
225 on i.MX6Q UART4. 225 on i.MX6Q UART4.
226 226
227 config DEBUG_MMP_UART2
228 bool "Kernel low-level debugging message via MMP UART2"
229 depends on ARCH_MMP
230 help
231 Say Y here if you want kernel low-level debugging support
232 on MMP UART2.
233
234 config DEBUG_MMP_UART3
235 bool "Kernel low-level debugging message via MMP UART3"
236 depends on ARCH_MMP
237 help
238 Say Y here if you want kernel low-level debugging support
239 on MMP UART3.
240
227 config DEBUG_MSM_UART1 241 config DEBUG_MSM_UART1
228 bool "Kernel low-level debugging messages via MSM UART1" 242 bool "Kernel low-level debugging messages via MSM UART1"
229 depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50 243 depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
@@ -261,6 +275,20 @@ choice
261 Say Y here if you want the debug print routines to direct 275 Say Y here if you want the debug print routines to direct
262 their output to the serial port on MSM 8960 devices. 276 their output to the serial port on MSM 8960 devices.
263 277
278 config DEBUG_MVEBU_UART
279 bool "Kernel low-level debugging messages via MVEBU UART"
280 depends on ARCH_MVEBU
281 help
282 Say Y here if you want kernel low-level debugging support
283 on MVEBU based platforms.
284
285 config DEBUG_PICOXCELL_UART
286 depends on ARCH_PICOXCELL
287 bool "Use PicoXcell UART for low-level debug"
288 help
289 Say Y here if you want kernel low-level debugging support
290 on PicoXcell based platforms.
291
264 config DEBUG_REALVIEW_STD_PORT 292 config DEBUG_REALVIEW_STD_PORT
265 bool "RealView Default UART" 293 bool "RealView Default UART"
266 depends on ARCH_REALVIEW 294 depends on ARCH_REALVIEW
@@ -310,6 +338,13 @@ choice
310 The uncompressor code port configuration is now handled 338 The uncompressor code port configuration is now handled
311 by CONFIG_S3C_LOWLEVEL_UART_PORT. 339 by CONFIG_S3C_LOWLEVEL_UART_PORT.
312 340
341 config DEBUG_SOCFPGA_UART
342 depends on ARCH_SOCFPGA
343 bool "Use SOCFPGA UART for low-level debug"
344 help
345 Say Y here if you want kernel low-level debugging support
346 on SOCFPGA based platforms.
347
313 config DEBUG_VEXPRESS_UART0_DETECT 348 config DEBUG_VEXPRESS_UART0_DETECT
314 bool "Autodetect UART0 on Versatile Express Cortex-A core tiles" 349 bool "Autodetect UART0 on Versatile Express Cortex-A core tiles"
315 depends on ARCH_VEXPRESS && CPU_CP15_MMU 350 depends on ARCH_VEXPRESS && CPU_CP15_MMU
@@ -338,6 +373,7 @@ choice
338 373
339 config DEBUG_LL_UART_NONE 374 config DEBUG_LL_UART_NONE
340 bool "No low-level debugging UART" 375 bool "No low-level debugging UART"
376 depends on !ARCH_MULTIPLATFORM
341 help 377 help
342 Say Y here if your platform doesn't provide a UART option 378 Say Y here if your platform doesn't provide a UART option
343 below. This relies on your platform choosing the right UART 379 below. This relies on your platform choosing the right UART
@@ -356,15 +392,15 @@ choice
356 is nothing connected to read from the DCC. 392 is nothing connected to read from the DCC.
357 393
358 config DEBUG_SEMIHOSTING 394 config DEBUG_SEMIHOSTING
359 bool "Kernel low-level debug output via semihosting I" 395 bool "Kernel low-level debug output via semihosting I/O"
360 help 396 help
361 Semihosting enables code running on an ARM target to use 397 Semihosting enables code running on an ARM target to use
362 the I/O facilities on a host debugger/emulator through a 398 the I/O facilities on a host debugger/emulator through a
363 simple SVC calls. The host debugger or emulator must have 399 simple SVC call. The host debugger or emulator must have
364 semihosting enabled for the special svc call to be trapped 400 semihosting enabled for the special svc call to be trapped
365 otherwise the kernel will crash. 401 otherwise the kernel will crash.
366 402
367 This is known to work with OpenOCD, as wellas 403 This is known to work with OpenOCD, as well as
368 ARM's Fast Models, or any other controlling environment 404 ARM's Fast Models, or any other controlling environment
369 that implements semihosting. 405 that implements semihosting.
370 406
@@ -373,6 +409,17 @@ choice
373 409
374endchoice 410endchoice
375 411
412config DEBUG_LL_INCLUDE
413 string
414 default "debug/icedcc.S" if DEBUG_ICEDCC
415 default "debug/highbank.S" if DEBUG_HIGHBANK_UART
416 default "debug/mvebu.S" if DEBUG_MVEBU_UART
417 default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
418 default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
419 default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
420 DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1
421 default "mach/debug-macro.S"
422
376config EARLY_PRINTK 423config EARLY_PRINTK
377 bool "Early printk" 424 bool "Early printk"
378 depends on DEBUG_LL 425 depends on DEBUG_LL
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index f42968a9fca..f023e3acdfb 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -135,84 +135,78 @@ textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000
135 135
136# Machine directory name. This list is sorted alphanumerically 136# Machine directory name. This list is sorted alphanumerically
137# by CONFIG_* macro name. 137# by CONFIG_* macro name.
138machine-$(CONFIG_ARCH_AT91) := at91 138machine-$(CONFIG_ARCH_AT91) += at91
139machine-$(CONFIG_ARCH_BCMRING) := bcmring 139machine-$(CONFIG_ARCH_BCM2835) += bcm2835
140machine-$(CONFIG_ARCH_CLPS711X) := clps711x 140machine-$(CONFIG_ARCH_CLPS711X) += clps711x
141machine-$(CONFIG_ARCH_CNS3XXX) := cns3xxx 141machine-$(CONFIG_ARCH_CNS3XXX) += cns3xxx
142machine-$(CONFIG_ARCH_DAVINCI) := davinci 142machine-$(CONFIG_ARCH_DAVINCI) += davinci
143machine-$(CONFIG_ARCH_DOVE) := dove 143machine-$(CONFIG_ARCH_DOVE) += dove
144machine-$(CONFIG_ARCH_EBSA110) := ebsa110 144machine-$(CONFIG_ARCH_EBSA110) += ebsa110
145machine-$(CONFIG_ARCH_EP93XX) := ep93xx 145machine-$(CONFIG_ARCH_EP93XX) += ep93xx
146machine-$(CONFIG_ARCH_GEMINI) := gemini 146machine-$(CONFIG_ARCH_GEMINI) += gemini
147machine-$(CONFIG_ARCH_H720X) := h720x 147machine-$(CONFIG_ARCH_H720X) += h720x
148machine-$(CONFIG_ARCH_HIGHBANK) := highbank 148machine-$(CONFIG_ARCH_HIGHBANK) += highbank
149machine-$(CONFIG_ARCH_INTEGRATOR) := integrator 149machine-$(CONFIG_ARCH_INTEGRATOR) += integrator
150machine-$(CONFIG_ARCH_IOP13XX) := iop13xx 150machine-$(CONFIG_ARCH_IOP13XX) += iop13xx
151machine-$(CONFIG_ARCH_IOP32X) := iop32x 151machine-$(CONFIG_ARCH_IOP32X) += iop32x
152machine-$(CONFIG_ARCH_IOP33X) := iop33x 152machine-$(CONFIG_ARCH_IOP33X) += iop33x
153machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx 153machine-$(CONFIG_ARCH_IXP4XX) += ixp4xx
154machine-$(CONFIG_ARCH_KIRKWOOD) := kirkwood 154machine-$(CONFIG_ARCH_KIRKWOOD) += kirkwood
155machine-$(CONFIG_ARCH_KS8695) := ks8695 155machine-$(CONFIG_ARCH_KS8695) += ks8695
156machine-$(CONFIG_ARCH_LPC32XX) := lpc32xx 156machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx
157machine-$(CONFIG_ARCH_MMP) := mmp 157machine-$(CONFIG_ARCH_MMP) += mmp
158machine-$(CONFIG_ARCH_MSM) := msm 158machine-$(CONFIG_ARCH_MSM) += msm
159machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0 159machine-$(CONFIG_ARCH_MV78XX0) += mv78xx0
160machine-$(CONFIG_ARCH_IMX_V4_V5) := imx 160machine-$(CONFIG_ARCH_MXC) += imx
161machine-$(CONFIG_ARCH_IMX_V6_V7) := imx 161machine-$(CONFIG_ARCH_MXS) += mxs
162machine-$(CONFIG_ARCH_MXS) := mxs 162machine-$(CONFIG_ARCH_MVEBU) += mvebu
163machine-$(CONFIG_ARCH_MVEBU) := mvebu 163machine-$(CONFIG_ARCH_NETX) += netx
164machine-$(CONFIG_ARCH_NETX) := netx 164machine-$(CONFIG_ARCH_NOMADIK) += nomadik
165machine-$(CONFIG_ARCH_NOMADIK) := nomadik 165machine-$(CONFIG_ARCH_OMAP1) += omap1
166machine-$(CONFIG_ARCH_OMAP1) := omap1 166machine-$(CONFIG_ARCH_OMAP2PLUS) += omap2
167machine-$(CONFIG_ARCH_OMAP2PLUS) := omap2 167machine-$(CONFIG_ARCH_ORION5X) += orion5x
168machine-$(CONFIG_ARCH_ORION5X) := orion5x 168machine-$(CONFIG_ARCH_PICOXCELL) += picoxcell
169machine-$(CONFIG_ARCH_PICOXCELL) := picoxcell 169machine-$(CONFIG_ARCH_PRIMA2) += prima2
170machine-$(CONFIG_ARCH_PNX4008) := pnx4008 170machine-$(CONFIG_ARCH_PXA) += pxa
171machine-$(CONFIG_ARCH_PRIMA2) := prima2 171machine-$(CONFIG_ARCH_REALVIEW) += realview
172machine-$(CONFIG_ARCH_PXA) := pxa 172machine-$(CONFIG_ARCH_RPC) += rpc
173machine-$(CONFIG_ARCH_REALVIEW) := realview 173machine-$(CONFIG_ARCH_S3C24XX) += s3c24xx s3c2412 s3c2440
174machine-$(CONFIG_ARCH_RPC) := rpc 174machine-$(CONFIG_ARCH_S3C64XX) += s3c64xx
175machine-$(CONFIG_ARCH_S3C24XX) := s3c24xx s3c2412 s3c2440 175machine-$(CONFIG_ARCH_S5P64X0) += s5p64x0
176machine-$(CONFIG_ARCH_S3C64XX) := s3c64xx 176machine-$(CONFIG_ARCH_S5PC100) += s5pc100
177machine-$(CONFIG_ARCH_S5P64X0) := s5p64x0 177machine-$(CONFIG_ARCH_S5PV210) += s5pv210
178machine-$(CONFIG_ARCH_S5PC100) := s5pc100 178machine-$(CONFIG_ARCH_EXYNOS) += exynos
179machine-$(CONFIG_ARCH_S5PV210) := s5pv210 179machine-$(CONFIG_ARCH_SA1100) += sa1100
180machine-$(CONFIG_ARCH_EXYNOS4) := exynos 180machine-$(CONFIG_ARCH_SHARK) += shark
181machine-$(CONFIG_ARCH_EXYNOS5) := exynos 181machine-$(CONFIG_ARCH_SHMOBILE) += shmobile
182machine-$(CONFIG_ARCH_SA1100) := sa1100 182machine-$(CONFIG_ARCH_TEGRA) += tegra
183machine-$(CONFIG_ARCH_SHARK) := shark 183machine-$(CONFIG_ARCH_U300) += u300
184machine-$(CONFIG_ARCH_SHMOBILE) := shmobile 184machine-$(CONFIG_ARCH_U8500) += ux500
185machine-$(CONFIG_ARCH_TEGRA) := tegra 185machine-$(CONFIG_ARCH_VERSATILE) += versatile
186machine-$(CONFIG_ARCH_U300) := u300 186machine-$(CONFIG_ARCH_VEXPRESS) += vexpress
187machine-$(CONFIG_ARCH_U8500) := ux500 187machine-$(CONFIG_ARCH_VT8500) += vt8500
188machine-$(CONFIG_ARCH_VERSATILE) := versatile 188machine-$(CONFIG_ARCH_W90X900) += w90x900
189machine-$(CONFIG_ARCH_VEXPRESS) := vexpress 189machine-$(CONFIG_FOOTBRIDGE) += footbridge
190machine-$(CONFIG_ARCH_VT8500) := vt8500 190machine-$(CONFIG_ARCH_SOCFPGA) += socfpga
191machine-$(CONFIG_ARCH_W90X900) := w90x900 191machine-$(CONFIG_ARCH_SPEAR13XX) += spear13xx
192machine-$(CONFIG_FOOTBRIDGE) := footbridge 192machine-$(CONFIG_ARCH_SPEAR3XX) += spear3xx
193machine-$(CONFIG_ARCH_SOCFPGA) := socfpga 193machine-$(CONFIG_MACH_SPEAR600) += spear6xx
194machine-$(CONFIG_MACH_SPEAR1310) := spear13xx 194machine-$(CONFIG_ARCH_ZYNQ) += zynq
195machine-$(CONFIG_MACH_SPEAR1340) := spear13xx
196machine-$(CONFIG_MACH_SPEAR300) := spear3xx
197machine-$(CONFIG_MACH_SPEAR310) := spear3xx
198machine-$(CONFIG_MACH_SPEAR320) := spear3xx
199machine-$(CONFIG_MACH_SPEAR600) := spear6xx
200machine-$(CONFIG_ARCH_ZYNQ) := zynq
201 195
202# Platform directory name. This list is sorted alphanumerically 196# Platform directory name. This list is sorted alphanumerically
203# by CONFIG_* macro name. 197# by CONFIG_* macro name.
204plat-$(CONFIG_ARCH_MXC) := mxc 198plat-$(CONFIG_ARCH_MXC) += mxc
205plat-$(CONFIG_ARCH_OMAP) := omap 199plat-$(CONFIG_ARCH_OMAP) += omap
206plat-$(CONFIG_ARCH_S3C64XX) := samsung 200plat-$(CONFIG_ARCH_S3C64XX) += samsung
207plat-$(CONFIG_ARCH_ZYNQ) := versatile 201plat-$(CONFIG_ARCH_ZYNQ) += versatile
208plat-$(CONFIG_PLAT_IOP) := iop 202plat-$(CONFIG_PLAT_IOP) += iop
209plat-$(CONFIG_PLAT_NOMADIK) := nomadik 203plat-$(CONFIG_PLAT_NOMADIK) += nomadik
210plat-$(CONFIG_PLAT_ORION) := orion 204plat-$(CONFIG_PLAT_ORION) += orion
211plat-$(CONFIG_PLAT_PXA) := pxa 205plat-$(CONFIG_PLAT_PXA) += pxa
212plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung 206plat-$(CONFIG_PLAT_S3C24XX) += s3c24xx samsung
213plat-$(CONFIG_PLAT_S5P) := samsung 207plat-$(CONFIG_PLAT_S5P) += samsung
214plat-$(CONFIG_PLAT_SPEAR) := spear 208plat-$(CONFIG_PLAT_SPEAR) += spear
215plat-$(CONFIG_PLAT_VERSATILE) := versatile 209plat-$(CONFIG_PLAT_VERSATILE) += versatile
216 210
217ifeq ($(CONFIG_ARCH_EBSA110),y) 211ifeq ($(CONFIG_ARCH_EBSA110),y)
218# This is what happens if you forget the IOCS16 line. 212# This is what happens if you forget the IOCS16 line.
@@ -230,15 +224,20 @@ MACHINE := arch/arm/mach-$(word 1,$(machine-y))/
230else 224else
231MACHINE := 225MACHINE :=
232endif 226endif
227ifeq ($(CONFIG_ARCH_MULTIPLATFORM),y)
228MACHINE :=
229endif
233 230
234machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y)) 231machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
235platdirs := $(patsubst %,arch/arm/plat-%/,$(plat-y)) 232platdirs := $(patsubst %,arch/arm/plat-%/,$(plat-y))
236 233
234ifneq ($(CONFIG_ARCH_MULTIPLATFORM),y)
237ifeq ($(KBUILD_SRC),) 235ifeq ($(KBUILD_SRC),)
238KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs)) 236KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs))
239else 237else
240KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs)) 238KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs))
241endif 239endif
240endif
242 241
243export TEXT_OFFSET GZFLAGS MMUEXT 242export TEXT_OFFSET GZFLAGS MMUEXT
244 243
@@ -256,6 +255,7 @@ core-$(CONFIG_XEN) += arch/arm/xen/
256# If we have a machine-specific directory, then include it in the build. 255# If we have a machine-specific directory, then include it in the build.
257core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/ 256core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
258core-y += arch/arm/net/ 257core-y += arch/arm/net/
258core-y += arch/arm/crypto/
259core-y += $(machdirs) $(platdirs) 259core-y += $(machdirs) $(platdirs)
260 260
261drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/ 261drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
@@ -269,7 +269,12 @@ else
269KBUILD_IMAGE := zImage 269KBUILD_IMAGE := zImage
270endif 270endif
271 271
272all: $(KBUILD_IMAGE) 272# Build the DT binary blobs if we have OF configured
273ifeq ($(CONFIG_USE_OF),y)
274KBUILD_DTBS := dtbs
275endif
276
277all: $(KBUILD_IMAGE) $(KBUILD_DTBS)
273 278
274boot := arch/arm/boot 279boot := arch/arm/boot
275 280
@@ -285,10 +290,10 @@ zImage Image xipImage bootpImage uImage: vmlinux
285zinstall uinstall install: vmlinux 290zinstall uinstall install: vmlinux
286 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ 291 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
287 292
288%.dtb: 293%.dtb: scripts
289 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ 294 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
290 295
291dtbs: 296dtbs: scripts
292 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ 297 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
293 298
294# We use MRPROPER_FILES and CLEAN_FILES now 299# We use MRPROPER_FILES and CLEAN_FILES now
@@ -307,7 +312,7 @@ define archhelp
307 echo ' uImage - U-Boot wrapped zImage' 312 echo ' uImage - U-Boot wrapped zImage'
308 echo ' bootpImage - Combined zImage and initial RAM disk' 313 echo ' bootpImage - Combined zImage and initial RAM disk'
309 echo ' (supply initrd image via make variable INITRD=<path>)' 314 echo ' (supply initrd image via make variable INITRD=<path>)'
310 echo ' dtbs - Build device tree blobs for enabled boards' 315 echo '* dtbs - Build device tree blobs for enabled boards'
311 echo ' install - Install uncompressed kernel' 316 echo ' install - Install uncompressed kernel'
312 echo ' zinstall - Install compressed kernel' 317 echo ' zinstall - Install compressed kernel'
313 echo ' uinstall - Install U-Boot wrapped compressed kernel' 318 echo ' uinstall - Install U-Boot wrapped compressed kernel'
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index c877087d200..3fdab016aa5 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -15,6 +15,8 @@ ifneq ($(MACHINE),)
15include $(srctree)/$(MACHINE)/Makefile.boot 15include $(srctree)/$(MACHINE)/Makefile.boot
16endif 16endif
17 17
18include $(srctree)/arch/arm/boot/dts/Makefile
19
18# Note: the following conditions must always be true: 20# Note: the following conditions must always be true:
19# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET) 21# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
20# PARAMS_PHYS must be within 4MB of ZRELADDR 22# PARAMS_PHYS must be within 4MB of ZRELADDR
diff --git a/arch/arm/boot/compressed/.gitignore b/arch/arm/boot/compressed/.gitignore
index d0d441c429a..f79a08efe00 100644
--- a/arch/arm/boot/compressed/.gitignore
+++ b/arch/arm/boot/compressed/.gitignore
@@ -1,6 +1,7 @@
1ashldi3.S 1ashldi3.S
2font.c 2font.c
3lib1funcs.S 3lib1funcs.S
4hyp-stub.S
4piggy.gzip 5piggy.gzip
5piggy.lzo 6piggy.lzo
6piggy.lzma 7piggy.lzma
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index bb267562e7e..a517153a13e 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -30,6 +30,10 @@ FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c
30OBJS += string.o 30OBJS += string.o
31CFLAGS_string.o := -Os 31CFLAGS_string.o := -Os
32 32
33ifeq ($(CONFIG_ARM_VIRT_EXT),y)
34OBJS += hyp-stub.o
35endif
36
33# 37#
34# Architecture dependencies 38# Architecture dependencies
35# 39#
@@ -126,7 +130,7 @@ KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
126endif 130endif
127 131
128ccflags-y := -fpic -fno-builtin -I$(obj) 132ccflags-y := -fpic -fno-builtin -I$(obj)
129asflags-y := -Wa,-march=all 133asflags-y := -Wa,-march=all -DZIMAGE
130 134
131# Supply kernel BSS size to the decompressor via a linker symbol. 135# Supply kernel BSS size to the decompressor via a linker symbol.
132KBSS_SZ = $(shell $(CROSS_COMPILE)size $(obj)/../../../../vmlinux | \ 136KBSS_SZ = $(shell $(CROSS_COMPILE)size $(obj)/../../../../vmlinux | \
@@ -198,3 +202,6 @@ $(obj)/font.c: $(FONTC)
198 202
199$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile $(KCONFIG_CONFIG) 203$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile $(KCONFIG_CONFIG)
200 @sed "$(SEDFLAGS)" < $< > $@ 204 @sed "$(SEDFLAGS)" < $< > $@
205
206$(obj)/hyp-stub.S: $(srctree)/arch/$(SRCARCH)/kernel/hyp-stub.S
207 $(call cmd,shipped)
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
index f41b38cafce..9deb56a702c 100644
--- a/arch/arm/boot/compressed/decompress.c
+++ b/arch/arm/boot/compressed/decompress.c
@@ -32,6 +32,9 @@ extern void error(char *);
32# define Tracecv(c,x) 32# define Tracecv(c,x)
33#endif 33#endif
34 34
35/* Not needed, but used in some headers pulled in by decompressors */
36extern char * strstr(const char * s1, const char *s2);
37
35#ifdef CONFIG_KERNEL_GZIP 38#ifdef CONFIG_KERNEL_GZIP
36#include "../../../../lib/decompress_inflate.c" 39#include "../../../../lib/decompress_inflate.c"
37#endif 40#endif
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index b8c64b80baf..90275f036cd 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -9,6 +9,7 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11#include <linux/linkage.h> 11#include <linux/linkage.h>
12#include <asm/assembler.h>
12 13
13/* 14/*
14 * Debugging stuff 15 * Debugging stuff
@@ -132,7 +133,12 @@ start:
132 .word start @ absolute load/run zImage address 133 .word start @ absolute load/run zImage address
133 .word _edata @ zImage end address 134 .word _edata @ zImage end address
134 THUMB( .thumb ) 135 THUMB( .thumb )
1351: mov r7, r1 @ save architecture ID 1361:
137 mrs r9, cpsr
138#ifdef CONFIG_ARM_VIRT_EXT
139 bl __hyp_stub_install @ get into SVC mode, reversibly
140#endif
141 mov r7, r1 @ save architecture ID
136 mov r8, r2 @ save atags pointer 142 mov r8, r2 @ save atags pointer
137 143
138#ifndef __ARM_ARCH_2__ 144#ifndef __ARM_ARCH_2__
@@ -148,9 +154,9 @@ start:
148 ARM( swi 0x123456 ) @ angel_SWI_ARM 154 ARM( swi 0x123456 ) @ angel_SWI_ARM
149 THUMB( svc 0xab ) @ angel_SWI_THUMB 155 THUMB( svc 0xab ) @ angel_SWI_THUMB
150not_angel: 156not_angel:
151 mrs r2, cpsr @ turn off interrupts to 157 safe_svcmode_maskall r0
152 orr r2, r2, #0xc0 @ prevent angel from running 158 msr spsr_cxsf, r9 @ Save the CPU boot mode in
153 msr cpsr_c, r2 159 @ SPSR
154#else 160#else
155 teqp pc, #0x0c000003 @ turn off interrupts 161 teqp pc, #0x0c000003 @ turn off interrupts
156#endif 162#endif
@@ -350,6 +356,20 @@ dtb_check_done:
350 adr r5, restart 356 adr r5, restart
351 bic r5, r5, #31 357 bic r5, r5, #31
352 358
359/* Relocate the hyp vector base if necessary */
360#ifdef CONFIG_ARM_VIRT_EXT
361 mrs r0, spsr
362 and r0, r0, #MODE_MASK
363 cmp r0, #HYP_MODE
364 bne 1f
365
366 bl __hyp_get_vectors
367 sub r0, r0, r5
368 add r0, r0, r10
369 bl __hyp_set_vectors
3701:
371#endif
372
353 sub r9, r6, r5 @ size to copy 373 sub r9, r6, r5 @ size to copy
354 add r9, r9, #31 @ rounded up to a multiple 374 add r9, r9, #31 @ rounded up to a multiple
355 bic r9, r9, #31 @ ... of 32 bytes 375 bic r9, r9, #31 @ ... of 32 bytes
@@ -458,11 +478,29 @@ not_relocated: mov r0, #0
458 bl decompress_kernel 478 bl decompress_kernel
459 bl cache_clean_flush 479 bl cache_clean_flush
460 bl cache_off 480 bl cache_off
461 mov r0, #0 @ must be zero
462 mov r1, r7 @ restore architecture number 481 mov r1, r7 @ restore architecture number
463 mov r2, r8 @ restore atags pointer 482 mov r2, r8 @ restore atags pointer
464 ARM( mov pc, r4 ) @ call kernel 483
465 THUMB( bx r4 ) @ entry point is always ARM 484#ifdef CONFIG_ARM_VIRT_EXT
485 mrs r0, spsr @ Get saved CPU boot mode
486 and r0, r0, #MODE_MASK
487 cmp r0, #HYP_MODE @ if not booted in HYP mode...
488 bne __enter_kernel @ boot kernel directly
489
490 adr r12, .L__hyp_reentry_vectors_offset
491 ldr r0, [r12]
492 add r0, r0, r12
493
494 bl __hyp_set_vectors
495 __HVC(0) @ otherwise bounce to hyp mode
496
497 b . @ should never be reached
498
499 .align 2
500.L__hyp_reentry_vectors_offset: .long __hyp_reentry_vectors - .
501#else
502 b __enter_kernel
503#endif
466 504
467 .align 2 505 .align 2
468 .type LC0, #object 506 .type LC0, #object
@@ -653,16 +691,21 @@ __armv7_mmu_cache_on:
653 mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs 691 mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
654#endif 692#endif
655 mrc p15, 0, r0, c1, c0, 0 @ read control reg 693 mrc p15, 0, r0, c1, c0, 0 @ read control reg
694 bic r0, r0, #1 << 28 @ clear SCTLR.TRE
656 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement 695 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
657 orr r0, r0, #0x003c @ write buffer 696 orr r0, r0, #0x003c @ write buffer
658#ifdef CONFIG_MMU 697#ifdef CONFIG_MMU
659#ifdef CONFIG_CPU_ENDIAN_BE8 698#ifdef CONFIG_CPU_ENDIAN_BE8
660 orr r0, r0, #1 << 25 @ big-endian page tables 699 orr r0, r0, #1 << 25 @ big-endian page tables
661#endif 700#endif
701 mrcne p15, 0, r6, c2, c0, 2 @ read ttb control reg
662 orrne r0, r0, #1 @ MMU enabled 702 orrne r0, r0, #1 @ MMU enabled
663 movne r1, #0xfffffffd @ domain 0 = client 703 movne r1, #0xfffffffd @ domain 0 = client
704 bic r6, r6, #1 << 31 @ 32-bit translation system
705 bic r6, r6, #3 << 0 @ use only ttbr0
664 mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer 706 mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer
665 mcrne p15, 0, r1, c3, c0, 0 @ load domain access control 707 mcrne p15, 0, r1, c3, c0, 0 @ load domain access control
708 mcrne p15, 0, r6, c2, c0, 2 @ load ttb control
666#endif 709#endif
667 mcr p15, 0, r0, c7, c5, 4 @ ISB 710 mcr p15, 0, r0, c7, c5, 4 @ ISB
668 mcr p15, 0, r0, c1, c0, 0 @ load control register 711 mcr p15, 0, r0, c1, c0, 0 @ load control register
@@ -1191,6 +1234,25 @@ memdump: mov r12, r0
1191#endif 1234#endif
1192 1235
1193 .ltorg 1236 .ltorg
1237
1238#ifdef CONFIG_ARM_VIRT_EXT
1239.align 5
1240__hyp_reentry_vectors:
1241 W(b) . @ reset
1242 W(b) . @ undef
1243 W(b) . @ svc
1244 W(b) . @ pabort
1245 W(b) . @ dabort
1246 W(b) __enter_kernel @ hyp
1247 W(b) . @ irq
1248 W(b) . @ fiq
1249#endif /* CONFIG_ARM_VIRT_EXT */
1250
1251__enter_kernel:
1252 mov r0, #0 @ must be 0
1253 ARM( mov pc, r4 ) @ call kernel
1254 THUMB( bx r4 ) @ entry point is always ARM
1255
1194reloc_code_end: 1256reloc_code_end:
1195 1257
1196 .align 1258 .align
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 8e2a8fca5ed..df899834d84 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -25,7 +25,13 @@ unsigned int __machine_arch_type;
25static void putstr(const char *ptr); 25static void putstr(const char *ptr);
26extern void error(char *x); 26extern void error(char *x);
27 27
28#ifdef CONFIG_ARCH_MULTIPLATFORM
29static inline void putc(int c) {}
30static inline void flush(void) {}
31static inline void arch_decomp_setup(void) {}
32#else
28#include <mach/uncompress.h> 33#include <mach/uncompress.h>
34#endif
29 35
30#ifdef CONFIG_DEBUG_ICEDCC 36#ifdef CONFIG_DEBUG_ICEDCC
31 37
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
new file mode 100644
index 00000000000..c1ce813fcc4
--- /dev/null
+++ b/arch/arm/boot/dts/Makefile
@@ -0,0 +1,105 @@
1ifeq ($(CONFIG_OF),y)
2
3dtb-$(CONFIG_ARCH_AT91) += aks-cdu.dtb \
4 at91sam9263ek.dtb \
5 at91sam9g20ek_2mmc.dtb \
6 at91sam9g20ek.dtb \
7 at91sam9g25ek.dtb \
8 at91sam9m10g45ek.dtb \
9 at91sam9n12ek.dtb \
10 ethernut5.dtb \
11 evk-pro3.dtb \
12 kizbox.dtb \
13 tny_a9260.dtb \
14 tny_a9263.dtb \
15 tny_a9g20.dtb \
16 usb_a9260.dtb \
17 usb_a9263.dtb \
18 usb_a9g20.dtb
19dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
20dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510.dtb \
21 dove-cubox.dtb \
22 dove-dove-db.dtb
23dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \
24 exynos4210-smdkv310.dtb \
25 exynos4210-trats.dtb \
26 exynos5250-smdk5250.dtb
27dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb
28dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
29dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
30 kirkwood-dns325.dtb \
31 kirkwood-dockstar.dtb \
32 kirkwood-dreamplug.dtb \
33 kirkwood-goflexnet.dtb \
34 kirkwood-ib62x0.dtb \
35 kirkwood-iconnect.dtb \
36 kirkwood-iomega_ix2_200.dtb \
37 kirkwood-km_kirkwood.dtb \
38 kirkwood-lschlv2.dtb \
39 kirkwood-lsxhl.dtb \
40 kirkwood-ts219-6281.dtb \
41 kirkwood-ts219-6282.dtb
42dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
43 msm8960-cdp.dtb
44dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
45 armada-xp-db.dtb
46dtb-$(CONFIG_ARCH_MXC) += imx51-babbage.dtb \
47 imx53-ard.dtb \
48 imx53-evk.dtb \
49 imx53-qsb.dtb \
50 imx53-smd.dtb \
51 imx6q-arm2.dtb \
52 imx6q-sabrelite.dtb \
53 imx6q-sabresd.dtb
54dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
55 imx23-olinuxino.dtb \
56 imx23-stmp378x_devb.dtb \
57 imx28-apx4devkit.dtb \
58 imx28-cfa10036.dtb \
59 imx28-cfa10049.dtb \
60 imx28-evk.dtb \
61 imx28-m28evk.dtb \
62 imx28-tx28.dtb
63dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
64 omap3-beagle-xm.dtb \
65 omap3-evm.dtb \
66 omap3-tobi.dtb \
67 omap4-panda.dtb \
68 omap4-pandaES.dtb \
69 omap4-var_som.dtb \
70 omap4-sdp.dtb \
71 omap5-evm.dtb \
72 am335x-evm.dtb \
73 am335x-bone.dtb
74dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
75dtb-$(CONFIG_ARCH_U8500) += snowball.dtb
76dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
77 r8a7740-armadillo800eva.dtb \
78 sh73a0-kzm9g.dtb
79dtb-$(CONFIG_ARCH_SPEAR13XX) += spear1310-evb.dtb \
80 spear1340-evb.dtb
81dtb-$(CONFIG_ARCH_SPEAR3XX)+= spear300-evb.dtb \
82 spear310-evb.dtb \
83 spear320-evb.dtb
84dtb-$(CONFIG_ARCH_SPEAR6XX)+= spear600-evb.dtb
85dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
86 tegra20-medcom-wide.dtb \
87 tegra20-paz00.dtb \
88 tegra20-plutux.dtb \
89 tegra20-seaboard.dtb \
90 tegra20-tec.dtb \
91 tegra20-trimslice.dtb \
92 tegra20-ventana.dtb \
93 tegra20-whistler.dtb \
94 tegra30-cardhu-a02.dtb \
95 tegra30-cardhu-a04.dtb
96dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \
97 vexpress-v2p-ca9.dtb \
98 vexpress-v2p-ca15-tc1.dtb \
99 vexpress-v2p-ca15_a7.dtb \
100 xenvm-4.2.dtb
101dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
102 wm8505-ref.dtb \
103 wm8650-mid.dtb
104
105endif
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index a9af4db7234..c634f87e230 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -17,4 +17,64 @@
17 device_type = "memory"; 17 device_type = "memory";
18 reg = <0x80000000 0x10000000>; /* 256 MB */ 18 reg = <0x80000000 0x10000000>; /* 256 MB */
19 }; 19 };
20
21 ocp {
22 uart1: serial@44e09000 {
23 status = "okay";
24 };
25
26 i2c1: i2c@44e0b000 {
27 status = "okay";
28 clock-frequency = <400000>;
29
30 tps: tps@24 {
31 reg = <0x24>;
32 };
33
34 };
35 };
36};
37
38/include/ "tps65217.dtsi"
39
40&tps {
41 regulators {
42 dcdc1_reg: regulator@0 {
43 regulator-always-on;
44 };
45
46 dcdc2_reg: regulator@1 {
47 /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
48 regulator-name = "vdd_mpu";
49 regulator-min-microvolt = <925000>;
50 regulator-max-microvolt = <1325000>;
51 regulator-boot-on;
52 regulator-always-on;
53 };
54
55 dcdc3_reg: regulator@2 {
56 /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
57 regulator-name = "vdd_core";
58 regulator-min-microvolt = <925000>;
59 regulator-max-microvolt = <1150000>;
60 regulator-boot-on;
61 regulator-always-on;
62 };
63
64 ldo1_reg: regulator@3 {
65 regulator-always-on;
66 };
67
68 ldo2_reg: regulator@4 {
69 regulator-always-on;
70 };
71
72 ldo3_reg: regulator@5 {
73 regulator-always-on;
74 };
75
76 ldo4_reg: regulator@6 {
77 regulator-always-on;
78 };
79 };
20}; 80};
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index d6a97d9eff7..185d6325a45 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -17,4 +17,104 @@
17 device_type = "memory"; 17 device_type = "memory";
18 reg = <0x80000000 0x10000000>; /* 256 MB */ 18 reg = <0x80000000 0x10000000>; /* 256 MB */
19 }; 19 };
20
21 ocp {
22 uart1: serial@44e09000 {
23 status = "okay";
24 };
25
26 i2c1: i2c@44e0b000 {
27 status = "okay";
28 clock-frequency = <400000>;
29
30 tps: tps@2d {
31 reg = <0x2d>;
32 };
33 };
34 };
35
36 vbat: fixedregulator@0 {
37 compatible = "regulator-fixed";
38 regulator-name = "vbat";
39 regulator-min-microvolt = <5000000>;
40 regulator-max-microvolt = <5000000>;
41 regulator-boot-on;
42 };
43};
44
45/include/ "tps65910.dtsi"
46
47&tps {
48 vcc1-supply = <&vbat>;
49 vcc2-supply = <&vbat>;
50 vcc3-supply = <&vbat>;
51 vcc4-supply = <&vbat>;
52 vcc5-supply = <&vbat>;
53 vcc6-supply = <&vbat>;
54 vcc7-supply = <&vbat>;
55 vccio-supply = <&vbat>;
56
57 regulators {
58 vrtc_reg: regulator@0 {
59 regulator-always-on;
60 };
61
62 vio_reg: regulator@1 {
63 regulator-always-on;
64 };
65
66 vdd1_reg: regulator@2 {
67 /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
68 regulator-name = "vdd_mpu";
69 regulator-min-microvolt = <912500>;
70 regulator-max-microvolt = <1312500>;
71 regulator-boot-on;
72 regulator-always-on;
73 };
74
75 vdd2_reg: regulator@3 {
76 /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
77 regulator-name = "vdd_core";
78 regulator-min-microvolt = <912500>;
79 regulator-max-microvolt = <1150000>;
80 regulator-boot-on;
81 regulator-always-on;
82 };
83
84 vdd3_reg: regulator@4 {
85 regulator-always-on;
86 };
87
88 vdig1_reg: regulator@5 {
89 regulator-always-on;
90 };
91
92 vdig2_reg: regulator@6 {
93 regulator-always-on;
94 };
95
96 vpll_reg: regulator@7 {
97 regulator-always-on;
98 };
99
100 vdac_reg: regulator@8 {
101 regulator-always-on;
102 };
103
104 vaux1_reg: regulator@9 {
105 regulator-always-on;
106 };
107
108 vaux2_reg: regulator@10 {
109 regulator-always-on;
110 };
111
112 vaux33_reg: regulator@11 {
113 regulator-always-on;
114 };
115
116 vmmc_reg: regulator@12 {
117 regulator-always-on;
118 };
119 };
20}; 120};
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index bd0cff3f808..bb31bff0199 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -69,95 +69,146 @@
69 #gpio-cells = <2>; 69 #gpio-cells = <2>;
70 interrupt-controller; 70 interrupt-controller;
71 #interrupt-cells = <1>; 71 #interrupt-cells = <1>;
72 reg = <0x44e07000 0x1000>;
73 interrupt-parent = <&intc>;
74 interrupts = <96>;
72 }; 75 };
73 76
74 gpio2: gpio@4804C000 { 77 gpio2: gpio@4804c000 {
75 compatible = "ti,omap4-gpio"; 78 compatible = "ti,omap4-gpio";
76 ti,hwmods = "gpio2"; 79 ti,hwmods = "gpio2";
77 gpio-controller; 80 gpio-controller;
78 #gpio-cells = <2>; 81 #gpio-cells = <2>;
79 interrupt-controller; 82 interrupt-controller;
80 #interrupt-cells = <1>; 83 #interrupt-cells = <1>;
84 reg = <0x4804c000 0x1000>;
85 interrupt-parent = <&intc>;
86 interrupts = <98>;
81 }; 87 };
82 88
83 gpio3: gpio@481AC000 { 89 gpio3: gpio@481ac000 {
84 compatible = "ti,omap4-gpio"; 90 compatible = "ti,omap4-gpio";
85 ti,hwmods = "gpio3"; 91 ti,hwmods = "gpio3";
86 gpio-controller; 92 gpio-controller;
87 #gpio-cells = <2>; 93 #gpio-cells = <2>;
88 interrupt-controller; 94 interrupt-controller;
89 #interrupt-cells = <1>; 95 #interrupt-cells = <1>;
96 reg = <0x481ac000 0x1000>;
97 interrupt-parent = <&intc>;
98 interrupts = <32>;
90 }; 99 };
91 100
92 gpio4: gpio@481AE000 { 101 gpio4: gpio@481ae000 {
93 compatible = "ti,omap4-gpio"; 102 compatible = "ti,omap4-gpio";
94 ti,hwmods = "gpio4"; 103 ti,hwmods = "gpio4";
95 gpio-controller; 104 gpio-controller;
96 #gpio-cells = <2>; 105 #gpio-cells = <2>;
97 interrupt-controller; 106 interrupt-controller;
98 #interrupt-cells = <1>; 107 #interrupt-cells = <1>;
108 reg = <0x481ae000 0x1000>;
109 interrupt-parent = <&intc>;
110 interrupts = <62>;
99 }; 111 };
100 112
101 uart1: serial@44E09000 { 113 uart1: serial@44e09000 {
102 compatible = "ti,omap3-uart"; 114 compatible = "ti,omap3-uart";
103 ti,hwmods = "uart1"; 115 ti,hwmods = "uart1";
104 clock-frequency = <48000000>; 116 clock-frequency = <48000000>;
117 reg = <0x44e09000 0x2000>;
118 interrupt-parent = <&intc>;
119 interrupts = <72>;
120 status = "disabled";
105 }; 121 };
106 122
107 uart2: serial@48022000 { 123 uart2: serial@48022000 {
108 compatible = "ti,omap3-uart"; 124 compatible = "ti,omap3-uart";
109 ti,hwmods = "uart2"; 125 ti,hwmods = "uart2";
110 clock-frequency = <48000000>; 126 clock-frequency = <48000000>;
127 reg = <0x48022000 0x2000>;
128 interrupt-parent = <&intc>;
129 interrupts = <73>;
130 status = "disabled";
111 }; 131 };
112 132
113 uart3: serial@48024000 { 133 uart3: serial@48024000 {
114 compatible = "ti,omap3-uart"; 134 compatible = "ti,omap3-uart";
115 ti,hwmods = "uart3"; 135 ti,hwmods = "uart3";
116 clock-frequency = <48000000>; 136 clock-frequency = <48000000>;
137 reg = <0x48024000 0x2000>;
138 interrupt-parent = <&intc>;
139 interrupts = <74>;
140 status = "disabled";
117 }; 141 };
118 142
119 uart4: serial@481A6000 { 143 uart4: serial@481a6000 {
120 compatible = "ti,omap3-uart"; 144 compatible = "ti,omap3-uart";
121 ti,hwmods = "uart4"; 145 ti,hwmods = "uart4";
122 clock-frequency = <48000000>; 146 clock-frequency = <48000000>;
147 reg = <0x481a6000 0x2000>;
148 interrupt-parent = <&intc>;
149 interrupts = <44>;
150 status = "disabled";
123 }; 151 };
124 152
125 uart5: serial@481A8000 { 153 uart5: serial@481a8000 {
126 compatible = "ti,omap3-uart"; 154 compatible = "ti,omap3-uart";
127 ti,hwmods = "uart5"; 155 ti,hwmods = "uart5";
128 clock-frequency = <48000000>; 156 clock-frequency = <48000000>;
157 reg = <0x481a8000 0x2000>;
158 interrupt-parent = <&intc>;
159 interrupts = <45>;
160 status = "disabled";
129 }; 161 };
130 162
131 uart6: serial@481AA000 { 163 uart6: serial@481aa000 {
132 compatible = "ti,omap3-uart"; 164 compatible = "ti,omap3-uart";
133 ti,hwmods = "uart6"; 165 ti,hwmods = "uart6";
134 clock-frequency = <48000000>; 166 clock-frequency = <48000000>;
167 reg = <0x481aa000 0x2000>;
168 interrupt-parent = <&intc>;
169 interrupts = <46>;
170 status = "disabled";
135 }; 171 };
136 172
137 i2c1: i2c@44E0B000 { 173 i2c1: i2c@44e0b000 {
138 compatible = "ti,omap4-i2c"; 174 compatible = "ti,omap4-i2c";
139 #address-cells = <1>; 175 #address-cells = <1>;
140 #size-cells = <0>; 176 #size-cells = <0>;
141 ti,hwmods = "i2c1"; 177 ti,hwmods = "i2c1";
178 reg = <0x44e0b000 0x1000>;
179 interrupt-parent = <&intc>;
180 interrupts = <70>;
181 status = "disabled";
142 }; 182 };
143 183
144 i2c2: i2c@4802A000 { 184 i2c2: i2c@4802a000 {
145 compatible = "ti,omap4-i2c"; 185 compatible = "ti,omap4-i2c";
146 #address-cells = <1>; 186 #address-cells = <1>;
147 #size-cells = <0>; 187 #size-cells = <0>;
148 ti,hwmods = "i2c2"; 188 ti,hwmods = "i2c2";
189 reg = <0x4802a000 0x1000>;
190 interrupt-parent = <&intc>;
191 interrupts = <71>;
192 status = "disabled";
149 }; 193 };
150 194
151 i2c3: i2c@4819C000 { 195 i2c3: i2c@4819c000 {
152 compatible = "ti,omap4-i2c"; 196 compatible = "ti,omap4-i2c";
153 #address-cells = <1>; 197 #address-cells = <1>;
154 #size-cells = <0>; 198 #size-cells = <0>;
155 ti,hwmods = "i2c3"; 199 ti,hwmods = "i2c3";
200 reg = <0x4819c000 0x1000>;
201 interrupt-parent = <&intc>;
202 interrupts = <30>;
203 status = "disabled";
156 }; 204 };
157 205
158 wdt2: wdt@44e35000 { 206 wdt2: wdt@44e35000 {
159 compatible = "ti,omap3-wdt"; 207 compatible = "ti,omap3-wdt";
160 ti,hwmods = "wd_timer2"; 208 ti,hwmods = "wd_timer2";
209 reg = <0x44e35000 0x1000>;
210 interrupt-parent = <&intc>;
211 interrupts = <91>;
161 }; 212 };
162 }; 213 };
163}; 214};
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi
index 6b6b932a5a7..16cc82cdaa8 100644
--- a/arch/arm/boot/dts/armada-370-xp.dtsi
+++ b/arch/arm/boot/dts/armada-370-xp.dtsi
@@ -63,6 +63,11 @@
63 reg = <0xd0020300 0x30>; 63 reg = <0xd0020300 0x30>;
64 interrupts = <37>, <38>, <39>, <40>; 64 interrupts = <37>, <38>, <39>, <40>;
65 }; 65 };
66
67 addr-decoding@d0020000 {
68 compatible = "marvell,armada-addr-decoding-controller";
69 reg = <0xd0020000 0x258>;
70 };
66 }; 71 };
67}; 72};
68 73
diff --git a/arch/arm/boot/dts/armada-370.dtsi b/arch/arm/boot/dts/armada-370.dtsi
index 3228ccc8333..2069151afe0 100644
--- a/arch/arm/boot/dts/armada-370.dtsi
+++ b/arch/arm/boot/dts/armada-370.dtsi
@@ -21,6 +21,12 @@
21 model = "Marvell Armada 370 family SoC"; 21 model = "Marvell Armada 370 family SoC";
22 compatible = "marvell,armada370", "marvell,armada-370-xp"; 22 compatible = "marvell,armada370", "marvell,armada-370-xp";
23 23
24 aliases {
25 gpio0 = &gpio0;
26 gpio1 = &gpio1;
27 gpio2 = &gpio2;
28 };
29
24 mpic: interrupt-controller@d0020000 { 30 mpic: interrupt-controller@d0020000 {
25 reg = <0xd0020a00 0x1d0>, 31 reg = <0xd0020a00 0x1d0>,
26 <0xd0021870 0x58>; 32 <0xd0021870 0x58>;
@@ -31,5 +37,43 @@
31 compatible = "marvell,armada-370-xp-system-controller"; 37 compatible = "marvell,armada-370-xp-system-controller";
32 reg = <0xd0018200 0x100>; 38 reg = <0xd0018200 0x100>;
33 }; 39 };
40
41 pinctrl {
42 compatible = "marvell,mv88f6710-pinctrl";
43 reg = <0xd0018000 0x38>;
44 };
45
46 gpio0: gpio@d0018100 {
47 compatible = "marvell,orion-gpio";
48 reg = <0xd0018100 0x40>;
49 ngpios = <32>;
50 gpio-controller;
51 #gpio-cells = <2>;
52 interrupt-controller;
53 #interrupts-cells = <2>;
54 interrupts = <82>, <83>, <84>, <85>;
55 };
56
57 gpio1: gpio@d0018140 {
58 compatible = "marvell,orion-gpio";
59 reg = <0xd0018140 0x40>;
60 ngpios = <32>;
61 gpio-controller;
62 #gpio-cells = <2>;
63 interrupt-controller;
64 #interrupts-cells = <2>;
65 interrupts = <87>, <88>, <89>, <90>;
66 };
67
68 gpio2: gpio@d0018180 {
69 compatible = "marvell,orion-gpio";
70 reg = <0xd0018180 0x40>;
71 ngpios = <2>;
72 gpio-controller;
73 #gpio-cells = <2>;
74 interrupt-controller;
75 #interrupts-cells = <2>;
76 interrupts = <91>;
77 };
34 }; 78 };
35}; 79};
diff --git a/arch/arm/boot/dts/armada-xp-db.dts b/arch/arm/boot/dts/armada-xp-db.dts
index f97040d4258..b1fc728515e 100644
--- a/arch/arm/boot/dts/armada-xp-db.dts
+++ b/arch/arm/boot/dts/armada-xp-db.dts
@@ -14,11 +14,11 @@
14 */ 14 */
15 15
16/dts-v1/; 16/dts-v1/;
17/include/ "armada-xp.dtsi" 17/include/ "armada-xp-mv78460.dtsi"
18 18
19/ { 19/ {
20 model = "Marvell Armada XP Evaluation Board"; 20 model = "Marvell Armada XP Evaluation Board";
21 compatible = "marvell,axp-db", "marvell,armadaxp", "marvell,armada-370-xp"; 21 compatible = "marvell,axp-db", "marvell,armadaxp-mv78460", "marvell,armadaxp", "marvell,armada-370-xp";
22 22
23 chosen { 23 chosen {
24 bootargs = "console=ttyS0,115200 earlyprintk"; 24 bootargs = "console=ttyS0,115200 earlyprintk";
diff --git a/arch/arm/boot/dts/armada-xp-mv78230.dtsi b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
new file mode 100644
index 00000000000..ea355192be6
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
@@ -0,0 +1,57 @@
1/*
2 * Device Tree Include file for Marvell Armada XP family SoC
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 *
12 * Contains definitions specific to the Armada XP MV78230 SoC that are not
13 * common to all Armada XP SoCs.
14 */
15
16/include/ "armada-xp.dtsi"
17
18/ {
19 model = "Marvell Armada XP MV78230 SoC";
20 compatible = "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
21
22 aliases {
23 gpio0 = &gpio0;
24 gpio1 = &gpio1;
25 };
26
27 soc {
28 pinctrl {
29 compatible = "marvell,mv78230-pinctrl";
30 reg = <0xd0018000 0x38>;
31 };
32
33 gpio0: gpio@d0018100 {
34 compatible = "marvell,armadaxp-gpio";
35 reg = <0xd0018100 0x40>,
36 <0xd0018800 0x30>;
37 ngpios = <32>;
38 gpio-controller;
39 #gpio-cells = <2>;
40 interrupt-controller;
41 #interrupts-cells = <2>;
42 interrupts = <16>, <17>, <18>, <19>;
43 };
44
45 gpio1: gpio@d0018140 {
46 compatible = "marvell,armadaxp-gpio";
47 reg = <0xd0018140 0x40>,
48 <0xd0018840 0x30>;
49 ngpios = <17>;
50 gpio-controller;
51 #gpio-cells = <2>;
52 interrupt-controller;
53 #interrupts-cells = <2>;
54 interrupts = <20>, <21>, <22>;
55 };
56 };
57};
diff --git a/arch/arm/boot/dts/armada-xp-mv78260.dtsi b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
new file mode 100644
index 00000000000..2057863f3df
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
@@ -0,0 +1,70 @@
1/*
2 * Device Tree Include file for Marvell Armada XP family SoC
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 *
12 * Contains definitions specific to the Armada XP MV78260 SoC that are not
13 * common to all Armada XP SoCs.
14 */
15
16/include/ "armada-xp.dtsi"
17
18/ {
19 model = "Marvell Armada XP MV78260 SoC";
20 compatible = "marvell,armadaxp-mv78260", "marvell,armadaxp", "marvell,armada-370-xp";
21
22 aliases {
23 gpio0 = &gpio0;
24 gpio1 = &gpio1;
25 gpio2 = &gpio2;
26 };
27
28 soc {
29 pinctrl {
30 compatible = "marvell,mv78260-pinctrl";
31 reg = <0xd0018000 0x38>;
32 };
33
34 gpio0: gpio@d0018100 {
35 compatible = "marvell,armadaxp-gpio";
36 reg = <0xd0018100 0x40>,
37 <0xd0018800 0x30>;
38 ngpios = <32>;
39 gpio-controller;
40 #gpio-cells = <2>;
41 interrupt-controller;
42 #interrupts-cells = <2>;
43 interrupts = <16>, <17>, <18>, <19>;
44 };
45
46 gpio1: gpio@d0018140 {
47 compatible = "marvell,armadaxp-gpio";
48 reg = <0xd0018140 0x40>,
49 <0xd0018840 0x30>;
50 ngpios = <32>;
51 gpio-controller;
52 #gpio-cells = <2>;
53 interrupt-controller;
54 #interrupts-cells = <2>;
55 interrupts = <20>, <21>, <22>, <23>;
56 };
57
58 gpio2: gpio@d0018180 {
59 compatible = "marvell,armadaxp-gpio";
60 reg = <0xd0018180 0x40>,
61 <0xd0018870 0x30>;
62 ngpios = <3>;
63 gpio-controller;
64 #gpio-cells = <2>;
65 interrupt-controller;
66 #interrupts-cells = <2>;
67 interrupts = <24>;
68 };
69 };
70};
diff --git a/arch/arm/boot/dts/armada-xp-mv78460.dtsi b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
new file mode 100644
index 00000000000..ffac9837379
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
@@ -0,0 +1,70 @@
1/*
2 * Device Tree Include file for Marvell Armada XP family SoC
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 *
12 * Contains definitions specific to the Armada XP MV78460 SoC that are not
13 * common to all Armada XP SoCs.
14 */
15
16/include/ "armada-xp.dtsi"
17
18/ {
19 model = "Marvell Armada XP MV78460 SoC";
20 compatible = "marvell,armadaxp-mv78460", "marvell,armadaxp", "marvell,armada-370-xp";
21
22 aliases {
23 gpio0 = &gpio0;
24 gpio1 = &gpio1;
25 gpio2 = &gpio2;
26 };
27
28 soc {
29 pinctrl {
30 compatible = "marvell,mv78460-pinctrl";
31 reg = <0xd0018000 0x38>;
32 };
33
34 gpio0: gpio@d0018100 {
35 compatible = "marvell,armadaxp-gpio";
36 reg = <0xd0018100 0x40>,
37 <0xd0018800 0x30>;
38 ngpios = <32>;
39 gpio-controller;
40 #gpio-cells = <2>;
41 interrupt-controller;
42 #interrupts-cells = <2>;
43 interrupts = <16>, <17>, <18>, <19>;
44 };
45
46 gpio1: gpio@d0018140 {
47 compatible = "marvell,armadaxp-gpio";
48 reg = <0xd0018140 0x40>,
49 <0xd0018840 0x30>;
50 ngpios = <32>;
51 gpio-controller;
52 #gpio-cells = <2>;
53 interrupt-controller;
54 #interrupts-cells = <2>;
55 interrupts = <20>, <21>, <22>, <23>;
56 };
57
58 gpio2: gpio@d0018180 {
59 compatible = "marvell,armadaxp-gpio";
60 reg = <0xd0018180 0x40>,
61 <0xd0018870 0x30>;
62 ngpios = <3>;
63 gpio-controller;
64 #gpio-cells = <2>;
65 interrupt-controller;
66 #interrupts-cells = <2>;
67 interrupts = <24>;
68 };
69 };
70 };
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
index 66389c1c6f6..d410581a5a8 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -28,6 +28,7 @@
28 gpio2 = &pioC; 28 gpio2 = &pioC;
29 tcb0 = &tcb0; 29 tcb0 = &tcb0;
30 tcb1 = &tcb1; 30 tcb1 = &tcb1;
31 i2c0 = &i2c0;
31 }; 32 };
32 cpus { 33 cpus {
33 cpu@0 { 34 cpu@0 {
@@ -104,6 +105,7 @@
104 #gpio-cells = <2>; 105 #gpio-cells = <2>;
105 gpio-controller; 106 gpio-controller;
106 interrupt-controller; 107 interrupt-controller;
108 #interrupt-cells = <2>;
107 }; 109 };
108 110
109 pioB: gpio@fffff600 { 111 pioB: gpio@fffff600 {
@@ -113,6 +115,7 @@
113 #gpio-cells = <2>; 115 #gpio-cells = <2>;
114 gpio-controller; 116 gpio-controller;
115 interrupt-controller; 117 interrupt-controller;
118 #interrupt-cells = <2>;
116 }; 119 };
117 120
118 pioC: gpio@fffff800 { 121 pioC: gpio@fffff800 {
@@ -122,6 +125,7 @@
122 #gpio-cells = <2>; 125 #gpio-cells = <2>;
123 gpio-controller; 126 gpio-controller;
124 interrupt-controller; 127 interrupt-controller;
128 #interrupt-cells = <2>;
125 }; 129 };
126 130
127 dbgu: serial@fffff200 { 131 dbgu: serial@fffff200 {
@@ -199,6 +203,15 @@
199 status = "disabled"; 203 status = "disabled";
200 }; 204 };
201 205
206 i2c0: i2c@fffac000 {
207 compatible = "atmel,at91sam9260-i2c";
208 reg = <0xfffac000 0x100>;
209 interrupts = <11 4 6>;
210 #address-cells = <1>;
211 #size-cells = <0>;
212 status = "disabled";
213 };
214
202 adc0: adc@fffe0000 { 215 adc0: adc@fffe0000 {
203 compatible = "atmel,at91sam9260-adc"; 216 compatible = "atmel,at91sam9260-adc";
204 reg = <0xfffe0000 0x100>; 217 reg = <0xfffe0000 0x100>;
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi
index b460d6ce9eb..3e6e5c1abbf 100644
--- a/arch/arm/boot/dts/at91sam9263.dtsi
+++ b/arch/arm/boot/dts/at91sam9263.dtsi
@@ -24,6 +24,7 @@
24 gpio3 = &pioD; 24 gpio3 = &pioD;
25 gpio4 = &pioE; 25 gpio4 = &pioE;
26 tcb0 = &tcb0; 26 tcb0 = &tcb0;
27 i2c0 = &i2c0;
27 }; 28 };
28 cpus { 29 cpus {
29 cpu@0 { 30 cpu@0 {
@@ -95,6 +96,7 @@
95 #gpio-cells = <2>; 96 #gpio-cells = <2>;
96 gpio-controller; 97 gpio-controller;
97 interrupt-controller; 98 interrupt-controller;
99 #interrupt-cells = <2>;
98 }; 100 };
99 101
100 pioB: gpio@fffff400 { 102 pioB: gpio@fffff400 {
@@ -104,6 +106,7 @@
104 #gpio-cells = <2>; 106 #gpio-cells = <2>;
105 gpio-controller; 107 gpio-controller;
106 interrupt-controller; 108 interrupt-controller;
109 #interrupt-cells = <2>;
107 }; 110 };
108 111
109 pioC: gpio@fffff600 { 112 pioC: gpio@fffff600 {
@@ -113,6 +116,7 @@
113 #gpio-cells = <2>; 116 #gpio-cells = <2>;
114 gpio-controller; 117 gpio-controller;
115 interrupt-controller; 118 interrupt-controller;
119 #interrupt-cells = <2>;
116 }; 120 };
117 121
118 pioD: gpio@fffff800 { 122 pioD: gpio@fffff800 {
@@ -122,6 +126,7 @@
122 #gpio-cells = <2>; 126 #gpio-cells = <2>;
123 gpio-controller; 127 gpio-controller;
124 interrupt-controller; 128 interrupt-controller;
129 #interrupt-cells = <2>;
125 }; 130 };
126 131
127 pioE: gpio@fffffa00 { 132 pioE: gpio@fffffa00 {
@@ -131,6 +136,7 @@
131 #gpio-cells = <2>; 136 #gpio-cells = <2>;
132 gpio-controller; 137 gpio-controller;
133 interrupt-controller; 138 interrupt-controller;
139 #interrupt-cells = <2>;
134 }; 140 };
135 141
136 dbgu: serial@ffffee00 { 142 dbgu: serial@ffffee00 {
@@ -180,6 +186,15 @@
180 interrupts = <24 4 2>; 186 interrupts = <24 4 2>;
181 status = "disabled"; 187 status = "disabled";
182 }; 188 };
189
190 i2c0: i2c@fff88000 {
191 compatible = "atmel,at91sam9263-i2c";
192 reg = <0xfff88000 0x100>;
193 interrupts = <13 4 6>;
194 #address-cells = <1>;
195 #size-cells = <0>;
196 status = "disabled";
197 };
183 }; 198 };
184 199
185 nand0: nand@40000000 { 200 nand0: nand@40000000 {
diff --git a/arch/arm/boot/dts/at91sam9g20.dtsi b/arch/arm/boot/dts/at91sam9g20.dtsi
index 2a1d1ca8bd8..75ce6e76001 100644
--- a/arch/arm/boot/dts/at91sam9g20.dtsi
+++ b/arch/arm/boot/dts/at91sam9g20.dtsi
@@ -18,6 +18,10 @@
18 18
19 ahb { 19 ahb {
20 apb { 20 apb {
21 i2c0: i2c@fffac000 {
22 compatible = "atmel,at91sam9g20-i2c";
23 };
24
21 adc0: adc@fffe0000 { 25 adc0: adc@fffe0000 {
22 atmel,adc-startup-time = <40>; 26 atmel,adc-startup-time = <40>;
23 }; 27 };
diff --git a/arch/arm/boot/dts/at91sam9g25ek.dts b/arch/arm/boot/dts/at91sam9g25ek.dts
index 96514c134e5..877c08f0676 100644
--- a/arch/arm/boot/dts/at91sam9g25ek.dts
+++ b/arch/arm/boot/dts/at91sam9g25ek.dts
@@ -32,6 +32,18 @@
32 phy-mode = "rmii"; 32 phy-mode = "rmii";
33 status = "okay"; 33 status = "okay";
34 }; 34 };
35
36 i2c0: i2c@f8010000 {
37 status = "okay";
38 };
39
40 i2c1: i2c@f8014000 {
41 status = "okay";
42 };
43
44 i2c2: i2c@f8018000 {
45 status = "okay";
46 };
35 }; 47 };
36 48
37 usb0: ohci@00600000 { 49 usb0: ohci@00600000 {
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index bafa8806fc1..3add030d61f 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -29,6 +29,8 @@
29 gpio4 = &pioE; 29 gpio4 = &pioE;
30 tcb0 = &tcb0; 30 tcb0 = &tcb0;
31 tcb1 = &tcb1; 31 tcb1 = &tcb1;
32 i2c0 = &i2c0;
33 i2c1 = &i2c1;
32 }; 34 };
33 cpus { 35 cpus {
34 cpu@0 { 36 cpu@0 {
@@ -113,6 +115,7 @@
113 #gpio-cells = <2>; 115 #gpio-cells = <2>;
114 gpio-controller; 116 gpio-controller;
115 interrupt-controller; 117 interrupt-controller;
118 #interrupt-cells = <2>;
116 }; 119 };
117 120
118 pioB: gpio@fffff400 { 121 pioB: gpio@fffff400 {
@@ -122,6 +125,7 @@
122 #gpio-cells = <2>; 125 #gpio-cells = <2>;
123 gpio-controller; 126 gpio-controller;
124 interrupt-controller; 127 interrupt-controller;
128 #interrupt-cells = <2>;
125 }; 129 };
126 130
127 pioC: gpio@fffff600 { 131 pioC: gpio@fffff600 {
@@ -131,6 +135,7 @@
131 #gpio-cells = <2>; 135 #gpio-cells = <2>;
132 gpio-controller; 136 gpio-controller;
133 interrupt-controller; 137 interrupt-controller;
138 #interrupt-cells = <2>;
134 }; 139 };
135 140
136 pioD: gpio@fffff800 { 141 pioD: gpio@fffff800 {
@@ -140,6 +145,7 @@
140 #gpio-cells = <2>; 145 #gpio-cells = <2>;
141 gpio-controller; 146 gpio-controller;
142 interrupt-controller; 147 interrupt-controller;
148 #interrupt-cells = <2>;
143 }; 149 };
144 150
145 pioE: gpio@fffffa00 { 151 pioE: gpio@fffffa00 {
@@ -149,6 +155,7 @@
149 #gpio-cells = <2>; 155 #gpio-cells = <2>;
150 gpio-controller; 156 gpio-controller;
151 interrupt-controller; 157 interrupt-controller;
158 #interrupt-cells = <2>;
152 }; 159 };
153 160
154 dbgu: serial@ffffee00 { 161 dbgu: serial@ffffee00 {
@@ -201,6 +208,24 @@
201 status = "disabled"; 208 status = "disabled";
202 }; 209 };
203 210
211 i2c0: i2c@fff84000 {
212 compatible = "atmel,at91sam9g10-i2c";
213 reg = <0xfff84000 0x100>;
214 interrupts = <12 4 6>;
215 #address-cells = <1>;
216 #size-cells = <0>;
217 status = "disabled";
218 };
219
220 i2c1: i2c@fff88000 {
221 compatible = "atmel,at91sam9g10-i2c";
222 reg = <0xfff88000 0x100>;
223 interrupts = <13 4 6>;
224 #address-cells = <1>;
225 #size-cells = <0>;
226 status = "disabled";
227 };
228
204 adc0: adc@fffb0000 { 229 adc0: adc@fffb0000 {
205 compatible = "atmel,at91sam9260-adc"; 230 compatible = "atmel,at91sam9260-adc";
206 reg = <0xfffb0000 0x100>; 231 reg = <0xfffb0000 0x100>;
diff --git a/arch/arm/boot/dts/at91sam9m10g45ek.dts b/arch/arm/boot/dts/at91sam9m10g45ek.dts
index a3633bd1311..15e1dd43f62 100644
--- a/arch/arm/boot/dts/at91sam9m10g45ek.dts
+++ b/arch/arm/boot/dts/at91sam9m10g45ek.dts
@@ -46,6 +46,14 @@
46 phy-mode = "rmii"; 46 phy-mode = "rmii";
47 status = "okay"; 47 status = "okay";
48 }; 48 };
49
50 i2c0: i2c@fff84000 {
51 status = "okay";
52 };
53
54 i2c1: i2c@fff88000 {
55 status = "okay";
56 };
49 }; 57 };
50 58
51 nand0: nand@40000000 { 59 nand0: nand@40000000 {
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index bfac0dfc332..82508d68aa7 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -26,6 +26,8 @@
26 gpio3 = &pioD; 26 gpio3 = &pioD;
27 tcb0 = &tcb0; 27 tcb0 = &tcb0;
28 tcb1 = &tcb1; 28 tcb1 = &tcb1;
29 i2c0 = &i2c0;
30 i2c1 = &i2c1;
29 }; 31 };
30 cpus { 32 cpus {
31 cpu@0 { 33 cpu@0 {
@@ -107,6 +109,7 @@
107 #gpio-cells = <2>; 109 #gpio-cells = <2>;
108 gpio-controller; 110 gpio-controller;
109 interrupt-controller; 111 interrupt-controller;
112 #interrupt-cells = <2>;
110 }; 113 };
111 114
112 pioB: gpio@fffff600 { 115 pioB: gpio@fffff600 {
@@ -116,6 +119,7 @@
116 #gpio-cells = <2>; 119 #gpio-cells = <2>;
117 gpio-controller; 120 gpio-controller;
118 interrupt-controller; 121 interrupt-controller;
122 #interrupt-cells = <2>;
119 }; 123 };
120 124
121 pioC: gpio@fffff800 { 125 pioC: gpio@fffff800 {
@@ -125,6 +129,7 @@
125 #gpio-cells = <2>; 129 #gpio-cells = <2>;
126 gpio-controller; 130 gpio-controller;
127 interrupt-controller; 131 interrupt-controller;
132 #interrupt-cells = <2>;
128 }; 133 };
129 134
130 pioD: gpio@fffffa00 { 135 pioD: gpio@fffffa00 {
@@ -134,6 +139,7 @@
134 #gpio-cells = <2>; 139 #gpio-cells = <2>;
135 gpio-controller; 140 gpio-controller;
136 interrupt-controller; 141 interrupt-controller;
142 #interrupt-cells = <2>;
137 }; 143 };
138 144
139 dbgu: serial@fffff200 { 145 dbgu: serial@fffff200 {
@@ -178,6 +184,24 @@
178 atmel,use-dma-tx; 184 atmel,use-dma-tx;
179 status = "disabled"; 185 status = "disabled";
180 }; 186 };
187
188 i2c0: i2c@f8010000 {
189 compatible = "atmel,at91sam9x5-i2c";
190 reg = <0xf8010000 0x100>;
191 interrupts = <9 4 6>;
192 #address-cells = <1>;
193 #size-cells = <0>;
194 status = "disabled";
195 };
196
197 i2c1: i2c@f8014000 {
198 compatible = "atmel,at91sam9x5-i2c";
199 reg = <0xf8014000 0x100>;
200 interrupts = <10 4 6>;
201 #address-cells = <1>;
202 #size-cells = <0>;
203 status = "disabled";
204 };
181 }; 205 };
182 206
183 nand0: nand@40000000 { 207 nand0: nand@40000000 {
diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts
index f4e43e38f3a..912b2c283d6 100644
--- a/arch/arm/boot/dts/at91sam9n12ek.dts
+++ b/arch/arm/boot/dts/at91sam9n12ek.dts
@@ -37,6 +37,14 @@
37 dbgu: serial@fffff200 { 37 dbgu: serial@fffff200 {
38 status = "okay"; 38 status = "okay";
39 }; 39 };
40
41 i2c0: i2c@f8010000 {
42 status = "okay";
43 };
44
45 i2c1: i2c@f8014000 {
46 status = "okay";
47 };
40 }; 48 };
41 49
42 nand0: nand@40000000 { 50 nand0: nand@40000000 {
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 4a18c393b13..03fc136421c 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -27,6 +27,9 @@
27 gpio3 = &pioD; 27 gpio3 = &pioD;
28 tcb0 = &tcb0; 28 tcb0 = &tcb0;
29 tcb1 = &tcb1; 29 tcb1 = &tcb1;
30 i2c0 = &i2c0;
31 i2c1 = &i2c1;
32 i2c2 = &i2c2;
30 }; 33 };
31 cpus { 34 cpus {
32 cpu@0 { 35 cpu@0 {
@@ -115,6 +118,7 @@
115 #gpio-cells = <2>; 118 #gpio-cells = <2>;
116 gpio-controller; 119 gpio-controller;
117 interrupt-controller; 120 interrupt-controller;
121 #interrupt-cells = <2>;
118 }; 122 };
119 123
120 pioB: gpio@fffff600 { 124 pioB: gpio@fffff600 {
@@ -124,6 +128,7 @@
124 #gpio-cells = <2>; 128 #gpio-cells = <2>;
125 gpio-controller; 129 gpio-controller;
126 interrupt-controller; 130 interrupt-controller;
131 #interrupt-cells = <2>;
127 }; 132 };
128 133
129 pioC: gpio@fffff800 { 134 pioC: gpio@fffff800 {
@@ -133,6 +138,7 @@
133 #gpio-cells = <2>; 138 #gpio-cells = <2>;
134 gpio-controller; 139 gpio-controller;
135 interrupt-controller; 140 interrupt-controller;
141 #interrupt-cells = <2>;
136 }; 142 };
137 143
138 pioD: gpio@fffffa00 { 144 pioD: gpio@fffffa00 {
@@ -142,6 +148,7 @@
142 #gpio-cells = <2>; 148 #gpio-cells = <2>;
143 gpio-controller; 149 gpio-controller;
144 interrupt-controller; 150 interrupt-controller;
151 #interrupt-cells = <2>;
145 }; 152 };
146 153
147 dbgu: serial@fffff200 { 154 dbgu: serial@fffff200 {
@@ -192,6 +199,33 @@
192 status = "disabled"; 199 status = "disabled";
193 }; 200 };
194 201
202 i2c0: i2c@f8010000 {
203 compatible = "atmel,at91sam9x5-i2c";
204 reg = <0xf8010000 0x100>;
205 interrupts = <9 4 6>;
206 #address-cells = <1>;
207 #size-cells = <0>;
208 status = "disabled";
209 };
210
211 i2c1: i2c@f8014000 {
212 compatible = "atmel,at91sam9x5-i2c";
213 reg = <0xf8014000 0x100>;
214 interrupts = <10 4 6>;
215 #address-cells = <1>;
216 #size-cells = <0>;
217 status = "disabled";
218 };
219
220 i2c2: i2c@f8018000 {
221 compatible = "atmel,at91sam9x5-i2c";
222 reg = <0xf8018000 0x100>;
223 interrupts = <11 4 6>;
224 #address-cells = <1>;
225 #size-cells = <0>;
226 status = "disabled";
227 };
228
195 adc0: adc@f804c000 { 229 adc0: adc@f804c000 {
196 compatible = "atmel,at91sam9260-adc"; 230 compatible = "atmel,at91sam9260-adc";
197 reg = <0xf804c000 0x100>; 231 reg = <0xf804c000 0x100>;
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts
new file mode 100644
index 00000000000..7dd860f83f9
--- /dev/null
+++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
@@ -0,0 +1,12 @@
1/dts-v1/;
2/memreserve/ 0x0c000000 0x04000000;
3/include/ "bcm2835.dtsi"
4
5/ {
6 compatible = "raspberrypi,model-b", "brcm,bcm2835";
7 model = "Raspberry Pi Model B";
8
9 memory {
10 reg = <0 0x10000000>;
11 };
12};
diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi
new file mode 100644
index 00000000000..0b619398532
--- /dev/null
+++ b/arch/arm/boot/dts/bcm2835.dtsi
@@ -0,0 +1,39 @@
1/include/ "skeleton.dtsi"
2
3/ {
4 compatible = "brcm,bcm2835";
5 model = "BCM2835";
6 interrupt-parent = <&intc>;
7
8 chosen {
9 bootargs = "earlyprintk console=ttyAMA0";
10 };
11
12 soc {
13 compatible = "simple-bus";
14 #address-cells = <1>;
15 #size-cells = <1>;
16 ranges = <0x7e000000 0x20000000 0x02000000>;
17
18 timer {
19 compatible = "brcm,bcm2835-system-timer";
20 reg = <0x7e003000 0x1000>;
21 interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
22 clock-frequency = <1000000>;
23 };
24
25 intc: interrupt-controller {
26 compatible = "brcm,bcm2835-armctrl-ic";
27 reg = <0x7e00b200 0x200>;
28 interrupt-controller;
29 #interrupt-cells = <2>;
30 };
31
32 uart@20201000 {
33 compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
34 reg = <0x7e201000 0x1000>;
35 interrupts = <2 25>;
36 clock-frequency = <3000000>;
37 };
38 };
39};
diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 3180a9c588b..748ba7aa746 100644
--- a/arch/arm/boot/dts/db8500.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -194,6 +194,8 @@
194 interrupts = <0 47 0x4>; 194 interrupts = <0 47 0x4>;
195 #address-cells = <1>; 195 #address-cells = <1>;
196 #size-cells = <1>; 196 #size-cells = <1>;
197 interrupt-controller;
198 #interrupt-cells = <2>;
197 ranges; 199 ranges;
198 200
199 prcmu-timer-4@80157450 { 201 prcmu-timer-4@80157450 {
@@ -330,6 +332,7 @@
330 ab8500@5 { 332 ab8500@5 {
331 compatible = "stericsson,ab8500"; 333 compatible = "stericsson,ab8500";
332 reg = <5>; /* mailbox 5 is i2c */ 334 reg = <5>; /* mailbox 5 is i2c */
335 interrupt-parent = <&intc>;
333 interrupts = <0 40 0x4>; 336 interrupts = <0 40 0x4>;
334 interrupt-controller; 337 interrupt-controller;
335 #interrupt-cells = <2>; 338 #interrupt-cells = <2>;
@@ -371,7 +374,7 @@
371 }; 374 };
372 375
373 ab8500-ponkey { 376 ab8500-ponkey {
374 compatible = "stericsson,ab8500-ponkey"; 377 compatible = "stericsson,ab8500-poweron-key";
375 interrupts = <6 0x4 378 interrupts = <6 0x4
376 7 0x4>; 379 7 0x4>;
377 interrupt-names = "ONKEY_DBF", "ONKEY_DBR"; 380 interrupt-names = "ONKEY_DBF", "ONKEY_DBR";
@@ -389,6 +392,12 @@
389 compatible = "stericsson,ab8500-debug"; 392 compatible = "stericsson,ab8500-debug";
390 }; 393 };
391 394
395 codec: ab8500-codec {
396 compatible = "stericsson,ab8500-codec";
397
398 stericsson,earpeice-cmv = <950>; /* Units in mV. */
399 };
400
392 ab8500-regulators { 401 ab8500-regulators {
393 compatible = "stericsson,ab8500-regulator"; 402 compatible = "stericsson,ab8500-regulator";
394 403
@@ -471,48 +480,63 @@
471 }; 480 };
472 481
473 i2c@80004000 { 482 i2c@80004000 {
474 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; 483 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
475 reg = <0x80004000 0x1000>; 484 reg = <0x80004000 0x1000>;
476 interrupts = <0 21 0x4>; 485 interrupts = <0 21 0x4>;
477 #address-cells = <1>; 486 #address-cells = <1>;
478 #size-cells = <0>; 487 #size-cells = <0>;
488 v-i2c-supply = <&db8500_vape_reg>;
489
490 clock-frequency = <400000>;
479 }; 491 };
480 492
481 i2c@80122000 { 493 i2c@80122000 {
482 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; 494 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
483 reg = <0x80122000 0x1000>; 495 reg = <0x80122000 0x1000>;
484 interrupts = <0 22 0x4>; 496 interrupts = <0 22 0x4>;
485 #address-cells = <1>; 497 #address-cells = <1>;
486 #size-cells = <0>; 498 #size-cells = <0>;
499 v-i2c-supply = <&db8500_vape_reg>;
500
501 clock-frequency = <400000>;
487 }; 502 };
488 503
489 i2c@80128000 { 504 i2c@80128000 {
490 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; 505 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
491 reg = <0x80128000 0x1000>; 506 reg = <0x80128000 0x1000>;
492 interrupts = <0 55 0x4>; 507 interrupts = <0 55 0x4>;
493 #address-cells = <1>; 508 #address-cells = <1>;
494 #size-cells = <0>; 509 #size-cells = <0>;
510 v-i2c-supply = <&db8500_vape_reg>;
511
512 clock-frequency = <400000>;
495 }; 513 };
496 514
497 i2c@80110000 { 515 i2c@80110000 {
498 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; 516 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
499 reg = <0x80110000 0x1000>; 517 reg = <0x80110000 0x1000>;
500 interrupts = <0 12 0x4>; 518 interrupts = <0 12 0x4>;
501 #address-cells = <1>; 519 #address-cells = <1>;
502 #size-cells = <0>; 520 #size-cells = <0>;
521 v-i2c-supply = <&db8500_vape_reg>;
522
523 clock-frequency = <400000>;
503 }; 524 };
504 525
505 i2c@8012a000 { 526 i2c@8012a000 {
506 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; 527 compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell";
507 reg = <0x8012a000 0x1000>; 528 reg = <0x8012a000 0x1000>;
508 interrupts = <0 51 0x4>; 529 interrupts = <0 51 0x4>;
509 #address-cells = <1>; 530 #address-cells = <1>;
510 #size-cells = <0>; 531 #size-cells = <0>;
532 v-i2c-supply = <&db8500_vape_reg>;
533
534 clock-frequency = <400000>;
511 }; 535 };
512 536
513 ssp@80002000 { 537 ssp@80002000 {
514 compatible = "arm,pl022", "arm,primecell"; 538 compatible = "arm,pl022", "arm,primecell";
515 reg = <80002000 0x1000>; 539 reg = <0x80002000 0x1000>;
516 interrupts = <0 14 0x4>; 540 interrupts = <0 14 0x4>;
517 #address-cells = <1>; 541 #address-cells = <1>;
518 #size-cells = <0>; 542 #size-cells = <0>;
@@ -580,6 +604,39 @@
580 status = "disabled"; 604 status = "disabled";
581 }; 605 };
582 606
607 msp0: msp@80123000 {
608 compatible = "stericsson,ux500-msp-i2s";
609 reg = <0x80123000 0x1000>;
610 interrupts = <0 31 0x4>;
611 v-ape-supply = <&db8500_vape_reg>;
612 status = "disabled";
613 };
614
615 msp1: msp@80124000 {
616 compatible = "stericsson,ux500-msp-i2s";
617 reg = <0x80124000 0x1000>;
618 interrupts = <0 62 0x4>;
619 v-ape-supply = <&db8500_vape_reg>;
620 status = "disabled";
621 };
622
623 // HDMI sound
624 msp2: msp@80117000 {
625 compatible = "stericsson,ux500-msp-i2s";
626 reg = <0x80117000 0x1000>;
627 interrupts = <0 98 0x4>;
628 v-ape-supply = <&db8500_vape_reg>;
629 status = "disabled";
630 };
631
632 msp3: msp@80125000 {
633 compatible = "stericsson,ux500-msp-i2s";
634 reg = <0x80125000 0x1000>;
635 interrupts = <0 62 0x4>;
636 v-ape-supply = <&db8500_vape_reg>;
637 status = "disabled";
638 };
639
583 external-bus@50000000 { 640 external-bus@50000000 {
584 compatible = "simple-bus"; 641 compatible = "simple-bus";
585 reg = <0x50000000 0x4000000>; 642 reg = <0x50000000 0x4000000>;
diff --git a/arch/arm/boot/dts/dove-cm-a510.dts b/arch/arm/boot/dts/dove-cm-a510.dts
new file mode 100644
index 00000000000..61a8062e56d
--- /dev/null
+++ b/arch/arm/boot/dts/dove-cm-a510.dts
@@ -0,0 +1,38 @@
1/dts-v1/;
2
3/include/ "dove.dtsi"
4
5/ {
6 model = "Compulab CM-A510";
7 compatible = "compulab,cm-a510", "marvell,dove";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x40000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17};
18
19&uart0 { status = "okay"; };
20&uart1 { status = "okay"; };
21&sdio0 { status = "okay"; };
22&sdio1 { status = "okay"; };
23&sata0 { status = "okay"; };
24
25&spi0 {
26 status = "okay";
27
28 /* spi0.0: 4M Flash Winbond W25Q32BV */
29 spi-flash@0 {
30 compatible = "st,w25q32";
31 spi-max-frequency = <20000000>;
32 reg = <0>;
33 };
34};
35
36&i2c0 {
37 status = "okay";
38};
diff --git a/arch/arm/boot/dts/dove-cubox.dts b/arch/arm/boot/dts/dove-cubox.dts
new file mode 100644
index 00000000000..0adbd5a3809
--- /dev/null
+++ b/arch/arm/boot/dts/dove-cubox.dts
@@ -0,0 +1,42 @@
1/dts-v1/;
2
3/include/ "dove.dtsi"
4
5/ {
6 model = "SolidRun CuBox";
7 compatible = "solidrun,cubox", "marvell,dove";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x40000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 leds {
19 compatible = "gpio-leds";
20 power {
21 label = "Power";
22 gpios = <&gpio0 18 1>;
23 linux,default-trigger = "default-on";
24 };
25 };
26};
27
28&uart0 { status = "okay"; };
29&sdio0 { status = "okay"; };
30&sata0 { status = "okay"; };
31&i2c0 { status = "okay"; };
32
33&spi0 {
34 status = "okay";
35
36 /* spi0.0: 4M Flash Winbond W25Q32BV */
37 spi-flash@0 {
38 compatible = "st,w25q32";
39 spi-max-frequency = <20000000>;
40 reg = <0>;
41 };
42};
diff --git a/arch/arm/boot/dts/dove-dove-db.dts b/arch/arm/boot/dts/dove-dove-db.dts
new file mode 100644
index 00000000000..e5a920beab4
--- /dev/null
+++ b/arch/arm/boot/dts/dove-dove-db.dts
@@ -0,0 +1,38 @@
1/dts-v1/;
2
3/include/ "dove.dtsi"
4
5/ {
6 model = "Marvell DB-MV88AP510-BP Development Board";
7 compatible = "marvell,dove-db", "marvell,dove";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x40000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17};
18
19&uart0 { status = "okay"; };
20&uart1 { status = "okay"; };
21&sdio0 { status = "okay"; };
22&sdio1 { status = "okay"; };
23&sata0 { status = "okay"; };
24
25&spi0 {
26 status = "okay";
27
28 /* spi0.0: 4M Flash ST-M25P32-VMF6P */
29 spi-flash@0 {
30 compatible = "st,m25p32";
31 spi-max-frequency = <20000000>;
32 reg = <0>;
33 };
34};
35
36&i2c0 {
37 status = "okay";
38};
diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi
new file mode 100644
index 00000000000..96fb824b5e6
--- /dev/null
+++ b/arch/arm/boot/dts/dove.dtsi
@@ -0,0 +1,143 @@
1/include/ "skeleton.dtsi"
2
3/ {
4 compatible = "marvell,dove";
5 model = "Marvell Armada 88AP510 SoC";
6
7 interrupt-parent = <&intc>;
8
9 intc: interrupt-controller {
10 compatible = "marvell,orion-intc";
11 interrupt-controller;
12 #interrupt-cells = <1>;
13 reg = <0xf1020204 0x04>,
14 <0xf1020214 0x04>;
15 };
16
17 mbus@f1000000 {
18 compatible = "simple-bus";
19 ranges = <0 0xf1000000 0x4000000>;
20 #address-cells = <1>;
21 #size-cells = <1>;
22
23 uart0: serial@12000 {
24 compatible = "ns16550a";
25 reg = <0x12000 0x100>;
26 reg-shift = <2>;
27 interrupts = <7>;
28 clock-frequency = <166666667>;
29 status = "disabled";
30 };
31
32 uart1: serial@12100 {
33 compatible = "ns16550a";
34 reg = <0x12100 0x100>;
35 reg-shift = <2>;
36 interrupts = <8>;
37 clock-frequency = <166666667>;
38 status = "disabled";
39 };
40
41 uart2: serial@12200 {
42 compatible = "ns16550a";
43 reg = <0x12000 0x100>;
44 reg-shift = <2>;
45 interrupts = <9>;
46 clock-frequency = <166666667>;
47 status = "disabled";
48 };
49
50 uart3: serial@12300 {
51 compatible = "ns16550a";
52 reg = <0x12100 0x100>;
53 reg-shift = <2>;
54 interrupts = <10>;
55 clock-frequency = <166666667>;
56 status = "disabled";
57 };
58
59 wdt: wdt@20300 {
60 compatible = "marvell,orion-wdt";
61 reg = <0x20300 0x28>;
62 };
63
64 gpio0: gpio@d0400 {
65 compatible = "marvell,orion-gpio";
66 #gpio-cells = <2>;
67 gpio-controller;
68 reg = <0xd0400 0x20>;
69 ngpio = <32>;
70 interrupts = <12>, <13>, <14>, <60>;
71 };
72
73 gpio1: gpio@d0420 {
74 compatible = "marvell,orion-gpio";
75 #gpio-cells = <2>;
76 gpio-controller;
77 reg = <0xd0420 0x20>;
78 ngpio = <32>;
79 interrupts = <61>;
80 };
81
82 gpio2: gpio@e8400 {
83 compatible = "marvell,orion-gpio";
84 #gpio-cells = <2>;
85 gpio-controller;
86 reg = <0xe8400 0x0c>;
87 ngpio = <8>;
88 };
89
90 spi0: spi@10600 {
91 compatible = "marvell,orion-spi";
92 #address-cells = <1>;
93 #size-cells = <0>;
94 cell-index = <0>;
95 interrupts = <6>;
96 reg = <0x10600 0x28>;
97 status = "disabled";
98 };
99
100 spi1: spi@14600 {
101 compatible = "marvell,orion-spi";
102 #address-cells = <1>;
103 #size-cells = <0>;
104 cell-index = <1>;
105 interrupts = <5>;
106 reg = <0x14600 0x28>;
107 status = "disabled";
108 };
109
110 i2c0: i2c@11000 {
111 compatible = "marvell,mv64xxx-i2c";
112 reg = <0x11000 0x20>;
113 #address-cells = <1>;
114 #size-cells = <0>;
115 interrupts = <11>;
116 clock-frequency = <400000>;
117 timeout-ms = <1000>;
118 status = "disabled";
119 };
120
121 sdio0: sdio@92000 {
122 compatible = "marvell,dove-sdhci";
123 reg = <0x92000 0x100>;
124 interrupts = <35>, <37>;
125 status = "disabled";
126 };
127
128 sdio1: sdio@90000 {
129 compatible = "marvell,dove-sdhci";
130 reg = <0x90000 0x100>;
131 interrupts = <36>, <38>;
132 status = "disabled";
133 };
134
135 sata0: sata@a0000 {
136 compatible = "marvell,orion-sata";
137 reg = <0xa0000 0x2400>;
138 interrupts = <62>;
139 nr-ports = <1>;
140 status = "disabled";
141 };
142 };
143};
diff --git a/arch/arm/boot/dts/ea3250.dts b/arch/arm/boot/dts/ea3250.dts
index d79b28d9c96..a4ba31b23c8 100644
--- a/arch/arm/boot/dts/ea3250.dts
+++ b/arch/arm/boot/dts/ea3250.dts
@@ -166,9 +166,116 @@
166 #size-cells = <0>; 166 #size-cells = <0>;
167 autorepeat; 167 autorepeat;
168 button@21 { 168 button@21 {
169 label = "GPIO Key UP"; 169 label = "Interrupt Key";
170 linux,code = <103>; 170 linux,code = <103>;
171 gpios = <&gpio 4 1 0>; /* GPI_P3 1 */ 171 gpios = <&gpio 4 1 0>; /* GPI_P3 1 */
172 }; 172 };
173 key1 {
174 label = "KEY1";
175 linux,code = <1>;
176 gpios = <&pca9532 0 0>;
177 };
178 key2 {
179 label = "KEY2";
180 linux,code = <2>;
181 gpios = <&pca9532 1 0>;
182 };
183 key3 {
184 label = "KEY3";
185 linux,code = <3>;
186 gpios = <&pca9532 2 0>;
187 };
188 key4 {
189 label = "KEY4";
190 linux,code = <4>;
191 gpios = <&pca9532 3 0>;
192 };
193 joy0 {
194 label = "Joystick Key 0";
195 linux,code = <10>;
196 gpios = <&gpio 2 0 0>; /* P2.0 */
197 };
198 joy1 {
199 label = "Joystick Key 1";
200 linux,code = <11>;
201 gpios = <&gpio 2 1 0>; /* P2.1 */
202 };
203 joy2 {
204 label = "Joystick Key 2";
205 linux,code = <12>;
206 gpios = <&gpio 2 2 0>; /* P2.2 */
207 };
208 joy3 {
209 label = "Joystick Key 3";
210 linux,code = <13>;
211 gpios = <&gpio 2 3 0>; /* P2.3 */
212 };
213 joy4 {
214 label = "Joystick Key 4";
215 linux,code = <14>;
216 gpios = <&gpio 2 4 0>; /* P2.4 */
217 };
218 };
219
220 leds {
221 compatible = "gpio-leds";
222
223 /* LEDs on OEM Board */
224
225 led1 {
226 gpios = <&gpio 5 14 1>; /* GPO_P3 14, GPIO 93, active low */
227 linux,default-trigger = "timer";
228 default-state = "off";
229 };
230
231 led2 {
232 gpios = <&gpio 2 10 1>; /* P2.10, active low */
233 default-state = "off";
234 };
235
236 led3 {
237 gpios = <&gpio 2 11 1>; /* P2.11, active low */
238 default-state = "off";
239 };
240
241 led4 {
242 gpios = <&gpio 2 12 1>; /* P2.12, active low */
243 default-state = "off";
244 };
245
246 /* LEDs on Base Board */
247
248 lede1 {
249 gpios = <&pca9532 8 0>;
250 default-state = "off";
251 };
252 lede2 {
253 gpios = <&pca9532 9 0>;
254 default-state = "off";
255 };
256 lede3 {
257 gpios = <&pca9532 10 0>;
258 default-state = "off";
259 };
260 lede4 {
261 gpios = <&pca9532 11 0>;
262 default-state = "off";
263 };
264 lede5 {
265 gpios = <&pca9532 12 0>;
266 default-state = "off";
267 };
268 lede6 {
269 gpios = <&pca9532 13 0>;
270 default-state = "off";
271 };
272 lede7 {
273 gpios = <&pca9532 14 0>;
274 default-state = "off";
275 };
276 lede8 {
277 gpios = <&pca9532 15 0>;
278 default-state = "off";
279 };
173 }; 280 };
174}; 281};
diff --git a/arch/arm/boot/dts/elpida_ecb240abacn.dtsi b/arch/arm/boot/dts/elpida_ecb240abacn.dtsi
new file mode 100644
index 00000000000..f97f70f8337
--- /dev/null
+++ b/arch/arm/boot/dts/elpida_ecb240abacn.dtsi
@@ -0,0 +1,67 @@
1/*
2 * Common devices used in different OMAP boards
3 */
4
5/ {
6 elpida_ECB240ABACN: lpddr2 {
7 compatible = "Elpida,ECB240ABACN","jedec,lpddr2-s4";
8 density = <2048>;
9 io-width = <32>;
10
11 tRPab-min-tck = <3>;
12 tRCD-min-tck = <3>;
13 tWR-min-tck = <3>;
14 tRASmin-min-tck = <3>;
15 tRRD-min-tck = <2>;
16 tWTR-min-tck = <2>;
17 tXP-min-tck = <2>;
18 tRTP-min-tck = <2>;
19 tCKE-min-tck = <3>;
20 tCKESR-min-tck = <3>;
21 tFAW-min-tck = <8>;
22
23 timings_elpida_ECB240ABACN_400mhz: lpddr2-timings@0 {
24 compatible = "jedec,lpddr2-timings";
25 min-freq = <10000000>;
26 max-freq = <400000000>;
27 tRPab = <21000>;
28 tRCD = <18000>;
29 tWR = <15000>;
30 tRAS-min = <42000>;
31 tRRD = <10000>;
32 tWTR = <7500>;
33 tXP = <7500>;
34 tRTP = <7500>;
35 tCKESR = <15000>;
36 tDQSCK-max = <5500>;
37 tFAW = <50000>;
38 tZQCS = <90000>;
39 tZQCL = <360000>;
40 tZQinit = <1000000>;
41 tRAS-max-ns = <70000>;
42 tDQSCK-max-derated = <6000>;
43 };
44
45 timings_elpida_ECB240ABACN_200mhz: lpddr2-timings@1 {
46 compatible = "jedec,lpddr2-timings";
47 min-freq = <10000000>;
48 max-freq = <200000000>;
49 tRPab = <21000>;
50 tRCD = <18000>;
51 tWR = <15000>;
52 tRAS-min = <42000>;
53 tRRD = <10000>;
54 tWTR = <10000>;
55 tXP = <7500>;
56 tRTP = <7500>;
57 tCKESR = <15000>;
58 tDQSCK-max = <5500>;
59 tFAW = <50000>;
60 tZQCS = <90000>;
61 tZQCL = <360000>;
62 tZQinit = <1000000>;
63 tRAS-max-ns = <70000>;
64 tDQSCK-max-derated = <6000>;
65 };
66 };
67};
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
new file mode 100644
index 00000000000..a26c3dd5826
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -0,0 +1,248 @@
1/*
2 * Samsung's Exynos4 SoC series common device tree source
3 *
4 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 * Copyright (c) 2010-2011 Linaro Ltd.
7 * www.linaro.org
8 *
9 * Samsung's Exynos4 SoC series device nodes are listed in this file. Particular
10 * SoCs from Exynos4 series can include this file and provide values for SoCs
11 * specfic bindings.
12 *
13 * Note: This file does not include device nodes for all the controllers in
14 * Exynos4 SoCs. As device tree coverage for Exynos4 increases, additional
15 * nodes can be added to this file.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 */
21
22/include/ "skeleton.dtsi"
23
24/ {
25 interrupt-parent = <&gic>;
26
27 aliases {
28 spi0 = &spi_0;
29 spi1 = &spi_1;
30 spi2 = &spi_2;
31 };
32
33 gic:interrupt-controller@10490000 {
34 compatible = "arm,cortex-a9-gic";
35 #interrupt-cells = <3>;
36 interrupt-controller;
37 reg = <0x10490000 0x1000>, <0x10480000 0x100>;
38 };
39
40 combiner:interrupt-controller@10440000 {
41 compatible = "samsung,exynos4210-combiner";
42 #interrupt-cells = <2>;
43 interrupt-controller;
44 reg = <0x10440000 0x1000>;
45 };
46
47 watchdog@10060000 {
48 compatible = "samsung,s3c2410-wdt";
49 reg = <0x10060000 0x100>;
50 interrupts = <0 43 0>;
51 status = "disabled";
52 };
53
54 rtc@10070000 {
55 compatible = "samsung,s3c6410-rtc";
56 reg = <0x10070000 0x100>;
57 interrupts = <0 44 0>, <0 45 0>;
58 status = "disabled";
59 };
60
61 keypad@100A0000 {
62 compatible = "samsung,s5pv210-keypad";
63 reg = <0x100A0000 0x100>;
64 interrupts = <0 109 0>;
65 status = "disabled";
66 };
67
68 sdhci@12510000 {
69 compatible = "samsung,exynos4210-sdhci";
70 reg = <0x12510000 0x100>;
71 interrupts = <0 73 0>;
72 status = "disabled";
73 };
74
75 sdhci@12520000 {
76 compatible = "samsung,exynos4210-sdhci";
77 reg = <0x12520000 0x100>;
78 interrupts = <0 74 0>;
79 status = "disabled";
80 };
81
82 sdhci@12530000 {
83 compatible = "samsung,exynos4210-sdhci";
84 reg = <0x12530000 0x100>;
85 interrupts = <0 75 0>;
86 status = "disabled";
87 };
88
89 sdhci@12540000 {
90 compatible = "samsung,exynos4210-sdhci";
91 reg = <0x12540000 0x100>;
92 interrupts = <0 76 0>;
93 status = "disabled";
94 };
95
96 serial@13800000 {
97 compatible = "samsung,exynos4210-uart";
98 reg = <0x13800000 0x100>;
99 interrupts = <0 52 0>;
100 status = "disabled";
101 };
102
103 serial@13810000 {
104 compatible = "samsung,exynos4210-uart";
105 reg = <0x13810000 0x100>;
106 interrupts = <0 53 0>;
107 status = "disabled";
108 };
109
110 serial@13820000 {
111 compatible = "samsung,exynos4210-uart";
112 reg = <0x13820000 0x100>;
113 interrupts = <0 54 0>;
114 status = "disabled";
115 };
116
117 serial@13830000 {
118 compatible = "samsung,exynos4210-uart";
119 reg = <0x13830000 0x100>;
120 interrupts = <0 55 0>;
121 status = "disabled";
122 };
123
124 i2c@13860000 {
125 #address-cells = <1>;
126 #size-cells = <0>;
127 compatible = "samsung,s3c2440-i2c";
128 reg = <0x13860000 0x100>;
129 interrupts = <0 58 0>;
130 status = "disabled";
131 };
132
133 i2c@13870000 {
134 #address-cells = <1>;
135 #size-cells = <0>;
136 compatible = "samsung,s3c2440-i2c";
137 reg = <0x13870000 0x100>;
138 interrupts = <0 59 0>;
139 status = "disabled";
140 };
141
142 i2c@13880000 {
143 #address-cells = <1>;
144 #size-cells = <0>;
145 compatible = "samsung,s3c2440-i2c";
146 reg = <0x13880000 0x100>;
147 interrupts = <0 60 0>;
148 status = "disabled";
149 };
150
151 i2c@13890000 {
152 #address-cells = <1>;
153 #size-cells = <0>;
154 compatible = "samsung,s3c2440-i2c";
155 reg = <0x13890000 0x100>;
156 interrupts = <0 61 0>;
157 status = "disabled";
158 };
159
160 i2c@138A0000 {
161 #address-cells = <1>;
162 #size-cells = <0>;
163 compatible = "samsung,s3c2440-i2c";
164 reg = <0x138A0000 0x100>;
165 interrupts = <0 62 0>;
166 status = "disabled";
167 };
168
169 i2c@138B0000 {
170 #address-cells = <1>;
171 #size-cells = <0>;
172 compatible = "samsung,s3c2440-i2c";
173 reg = <0x138B0000 0x100>;
174 interrupts = <0 63 0>;
175 status = "disabled";
176 };
177
178 i2c@138C0000 {
179 #address-cells = <1>;
180 #size-cells = <0>;
181 compatible = "samsung,s3c2440-i2c";
182 reg = <0x138C0000 0x100>;
183 interrupts = <0 64 0>;
184 status = "disabled";
185 };
186
187 i2c@138D0000 {
188 #address-cells = <1>;
189 #size-cells = <0>;
190 compatible = "samsung,s3c2440-i2c";
191 reg = <0x138D0000 0x100>;
192 interrupts = <0 65 0>;
193 status = "disabled";
194 };
195
196 spi_0: spi@13920000 {
197 compatible = "samsung,exynos4210-spi";
198 reg = <0x13920000 0x100>;
199 interrupts = <0 66 0>;
200 tx-dma-channel = <&pdma0 7>; /* preliminary */
201 rx-dma-channel = <&pdma0 6>; /* preliminary */
202 #address-cells = <1>;
203 #size-cells = <0>;
204 status = "disabled";
205 };
206
207 spi_1: spi@13930000 {
208 compatible = "samsung,exynos4210-spi";
209 reg = <0x13930000 0x100>;
210 interrupts = <0 67 0>;
211 tx-dma-channel = <&pdma1 7>; /* preliminary */
212 rx-dma-channel = <&pdma1 6>; /* preliminary */
213 #address-cells = <1>;
214 #size-cells = <0>;
215 status = "disabled";
216 };
217
218 spi_2: spi@13940000 {
219 compatible = "samsung,exynos4210-spi";
220 reg = <0x13940000 0x100>;
221 interrupts = <0 68 0>;
222 tx-dma-channel = <&pdma0 9>; /* preliminary */
223 rx-dma-channel = <&pdma0 8>; /* preliminary */
224 #address-cells = <1>;
225 #size-cells = <0>;
226 status = "disabled";
227 };
228
229 amba {
230 #address-cells = <1>;
231 #size-cells = <1>;
232 compatible = "arm,amba-bus";
233 interrupt-parent = <&gic>;
234 ranges;
235
236 pdma0: pdma@12680000 {
237 compatible = "arm,pl330", "arm,primecell";
238 reg = <0x12680000 0x1000>;
239 interrupts = <0 35 0>;
240 };
241
242 pdma1: pdma@12690000 {
243 compatible = "arm,pl330", "arm,primecell";
244 reg = <0x12690000 0x1000>;
245 interrupts = <0 36 0>;
246 };
247 };
248};
diff --git a/arch/arm/boot/dts/exynos4210-origen.dts b/arch/arm/boot/dts/exynos4210-origen.dts
index 0c49caa0997..3e68f52e845 100644
--- a/arch/arm/boot/dts/exynos4210-origen.dts
+++ b/arch/arm/boot/dts/exynos4210-origen.dts
@@ -40,6 +40,7 @@
40 <&gpk2 4 2 3 3>, 40 <&gpk2 4 2 3 3>,
41 <&gpk2 5 2 3 3>, 41 <&gpk2 5 2 3 3>,
42 <&gpk2 6 2 3 3>; 42 <&gpk2 6 2 3 3>;
43 status = "okay";
43 }; 44 };
44 45
45 sdhci@12510000 { 46 sdhci@12510000 {
@@ -53,6 +54,7 @@
53 <&gpk0 4 2 3 3>, 54 <&gpk0 4 2 3 3>,
54 <&gpk0 5 2 3 3>, 55 <&gpk0 5 2 3 3>,
55 <&gpk0 6 2 3 3>; 56 <&gpk0 6 2 3 3>;
57 status = "okay";
56 }; 58 };
57 59
58 gpio_keys { 60 gpio_keys {
@@ -62,88 +64,45 @@
62 64
63 up { 65 up {
64 label = "Up"; 66 label = "Up";
65 gpios = <&gpx2 0 0 0 2>; 67 gpios = <&gpx2 0 0 0x10000 2>;
66 linux,code = <103>; 68 linux,code = <103>;
69 gpio-key,wakeup;
67 }; 70 };
68 71
69 down { 72 down {
70 label = "Down"; 73 label = "Down";
71 gpios = <&gpx2 1 0 0 2>; 74 gpios = <&gpx2 1 0 0x10000 2>;
72 linux,code = <108>; 75 linux,code = <108>;
76 gpio-key,wakeup;
73 }; 77 };
74 78
75 back { 79 back {
76 label = "Back"; 80 label = "Back";
77 gpios = <&gpx1 7 0 0 2>; 81 gpios = <&gpx1 7 0 0x10000 2>;
78 linux,code = <158>; 82 linux,code = <158>;
83 gpio-key,wakeup;
79 }; 84 };
80 85
81 home { 86 home {
82 label = "Home"; 87 label = "Home";
83 gpios = <&gpx1 6 0 0 2>; 88 gpios = <&gpx1 6 0 0x10000 2>;
84 linux,code = <102>; 89 linux,code = <102>;
90 gpio-key,wakeup;
85 }; 91 };
86 92
87 menu { 93 menu {
88 label = "Menu"; 94 label = "Menu";
89 gpios = <&gpx1 5 0 0 2>; 95 gpios = <&gpx1 5 0 0x10000 2>;
90 linux,code = <139>; 96 linux,code = <139>;
97 gpio-key,wakeup;
91 }; 98 };
92 }; 99 };
93 100
94 keypad@100A0000 { 101 leds {
95 status = "disabled"; 102 compatible = "gpio-leds";
96 }; 103 status {
97 104 gpios = <&gpx1 3 0 0x10000 2>;
98 sdhci@12520000 { 105 linux,default-trigger = "heartbeat";
99 status = "disabled"; 106 };
100 };
101
102 sdhci@12540000 {
103 status = "disabled";
104 };
105
106 i2c@13860000 {
107 status = "disabled";
108 };
109
110 i2c@13870000 {
111 status = "disabled";
112 };
113
114 i2c@13880000 {
115 status = "disabled";
116 };
117
118 i2c@13890000 {
119 status = "disabled";
120 };
121
122 i2c@138A0000 {
123 status = "disabled";
124 };
125
126 i2c@138B0000 {
127 status = "disabled";
128 };
129
130 i2c@138C0000 {
131 status = "disabled";
132 };
133
134 i2c@138D0000 {
135 status = "disabled";
136 };
137
138 spi_0: spi@13920000 {
139 status = "disabled";
140 };
141
142 spi_1: spi@13930000 {
143 status = "disabled";
144 };
145
146 spi_2: spi@13940000 {
147 status = "disabled";
148 }; 107 };
149}; 108};
diff --git a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
new file mode 100644
index 00000000000..b12cf272ad0
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
@@ -0,0 +1,457 @@
1/*
2 * Samsung's Exynos4210 SoC pin-mux and pin-config device tree source
3 *
4 * Copyright (c) 2011-2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 * Copyright (c) 2011-2012 Linaro Ltd.
7 * www.linaro.org
8 *
9 * Samsung's Exynos4210 SoC pin-mux and pin-config optiosn are listed as device
10 * tree nodes are listed in this file.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15*/
16
17/ {
18 pinctrl@11400000 {
19 uart0_data: uart0-data {
20 samsung,pins = "gpa0-0", "gpa0-1";
21 samsung,pin-function = <0x2>;
22 samsung,pin-pud = <0>;
23 samsung,pin-drv = <0>;
24 };
25
26 uart0_fctl: uart0-fctl {
27 samsung,pins = "gpa0-2", "gpa0-3";
28 samsung,pin-function = <2>;
29 samsung,pin-pud = <0>;
30 samsung,pin-drv = <0>;
31 };
32
33 uart1_data: uart1-data {
34 samsung,pins = "gpa0-4", "gpa0-5";
35 samsung,pin-function = <2>;
36 samsung,pin-pud = <0>;
37 samsung,pin-drv = <0>;
38 };
39
40 uart1_fctl: uart1-fctl {
41 samsung,pins = "gpa0-6", "gpa0-7";
42 samsung,pin-function = <2>;
43 samsung,pin-pud = <0>;
44 samsung,pin-drv = <0>;
45 };
46
47 i2c2_bus: i2c2-bus {
48 samsung,pins = "gpa0-6", "gpa0-7";
49 samsung,pin-function = <3>;
50 samsung,pin-pud = <3>;
51 samsung,pin-drv = <0>;
52 };
53
54 uart2_data: uart2-data {
55 samsung,pins = "gpa1-0", "gpa1-1";
56 samsung,pin-function = <2>;
57 samsung,pin-pud = <0>;
58 samsung,pin-drv = <0>;
59 };
60
61 uart2_fctl: uart2-fctl {
62 samsung,pins = "gpa1-2", "gpa1-3";
63 samsung,pin-function = <2>;
64 samsung,pin-pud = <0>;
65 samsung,pin-drv = <0>;
66 };
67
68 uart_audio_a: uart-audio-a {
69 samsung,pins = "gpa1-0", "gpa1-1";
70 samsung,pin-function = <4>;
71 samsung,pin-pud = <0>;
72 samsung,pin-drv = <0>;
73 };
74
75 i2c3_bus: i2c3-bus {
76 samsung,pins = "gpa1-2", "gpa1-3";
77 samsung,pin-function = <3>;
78 samsung,pin-pud = <3>;
79 samsung,pin-drv = <0>;
80 };
81
82 uart3_data: uart3-data {
83 samsung,pins = "gpa1-4", "gpa1-5";
84 samsung,pin-function = <2>;
85 samsung,pin-pud = <0>;
86 samsung,pin-drv = <0>;
87 };
88
89 uart_audio_b: uart-audio-b {
90 samsung,pins = "gpa1-4", "gpa1-5";
91 samsung,pin-function = <4>;
92 samsung,pin-pud = <0>;
93 samsung,pin-drv = <0>;
94 };
95
96 spi0_bus: spi0-bus {
97 samsung,pins = "gpb-0", "gpb-2", "gpb-3";
98 samsung,pin-function = <2>;
99 samsung,pin-pud = <3>;
100 samsung,pin-drv = <0>;
101 };
102
103 i2c4_bus: i2c4-bus {
104 samsung,pins = "gpb-2", "gpb-3";
105 samsung,pin-function = <3>;
106 samsung,pin-pud = <3>;
107 samsung,pin-drv = <0>;
108 };
109
110 spi1_bus: spi1-bus {
111 samsung,pins = "gpb-4", "gpb-6", "gpb-7";
112 samsung,pin-function = <2>;
113 samsung,pin-pud = <3>;
114 samsung,pin-drv = <0>;
115 };
116
117 i2c5_bus: i2c5-bus {
118 samsung,pins = "gpb-6", "gpb-7";
119 samsung,pin-function = <3>;
120 samsung,pin-pud = <3>;
121 samsung,pin-drv = <0>;
122 };
123
124 i2s1_bus: i2s1-bus {
125 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
126 "gpc0-4";
127 samsung,pin-function = <2>;
128 samsung,pin-pud = <0>;
129 samsung,pin-drv = <0>;
130 };
131
132 pcm1_bus: pcm1-bus {
133 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
134 "gpc0-4";
135 samsung,pin-function = <3>;
136 samsung,pin-pud = <0>;
137 samsung,pin-drv = <0>;
138 };
139
140 ac97_bus: ac97-bus {
141 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
142 "gpc0-4";
143 samsung,pin-function = <4>;
144 samsung,pin-pud = <0>;
145 samsung,pin-drv = <0>;
146 };
147
148 i2s2_bus: i2s2-bus {
149 samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
150 "gpc1-4";
151 samsung,pin-function = <2>;
152 samsung,pin-pud = <0>;
153 samsung,pin-drv = <0>;
154 };
155
156 pcm2_bus: pcm2-bus {
157 samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
158 "gpc1-4";
159 samsung,pin-function = <3>;
160 samsung,pin-pud = <0>;
161 samsung,pin-drv = <0>;
162 };
163
164 spdif_bus: spdif-bus {
165 samsung,pins = "gpc1-0", "gpc1-1";
166 samsung,pin-function = <4>;
167 samsung,pin-pud = <0>;
168 samsung,pin-drv = <0>;
169 };
170
171 i2c6_bus: i2c6-bus {
172 samsung,pins = "gpc1-3", "gpc1-4";
173 samsung,pin-function = <4>;
174 samsung,pin-pud = <3>;
175 samsung,pin-drv = <0>;
176 };
177
178 spi2_bus: spi2-bus {
179 samsung,pins = "gpc1-1", "gpc1-2", "gpc1-3", "gpc1-4";
180 samsung,pin-function = <5>;
181 samsung,pin-pud = <3>;
182 samsung,pin-drv = <0>;
183 };
184
185 i2c7_bus: i2c7-bus {
186 samsung,pins = "gpd0-2", "gpd0-3";
187 samsung,pin-function = <3>;
188 samsung,pin-pud = <3>;
189 samsung,pin-drv = <0>;
190 };
191
192 i2c0_bus: i2c0-bus {
193 samsung,pins = "gpd1-0", "gpd1-1";
194 samsung,pin-function = <2>;
195 samsung,pin-pud = <3>;
196 samsung,pin-drv = <0>;
197 };
198
199 i2c1_bus: i2c1-bus {
200 samsung,pins = "gpd1-2", "gpd1-3";
201 samsung,pin-function = <2>;
202 samsung,pin-pud = <3>;
203 samsung,pin-drv = <0>;
204 };
205 };
206
207 pinctrl@11000000 {
208 sd0_clk: sd0-clk {
209 samsung,pins = "gpk0-0";
210 samsung,pin-function = <2>;
211 samsung,pin-pud = <0>;
212 samsung,pin-drv = <0>;
213 };
214
215 sd0_cmd: sd0-cmd {
216 samsung,pins = "gpk0-1";
217 samsung,pin-function = <2>;
218 samsung,pin-pud = <0>;
219 samsung,pin-drv = <0>;
220 };
221
222 sd0_cd: sd0-cd {
223 samsung,pins = "gpk0-2";
224 samsung,pin-function = <2>;
225 samsung,pin-pud = <3>;
226 samsung,pin-drv = <0>;
227 };
228
229 sd0_bus1: sd0-bus-width1 {
230 samsung,pins = "gpk0-3";
231 samsung,pin-function = <2>;
232 samsung,pin-pud = <3>;
233 samsung,pin-drv = <0>;
234 };
235
236 sd0_bus4: sd0-bus-width4 {
237 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
238 samsung,pin-function = <2>;
239 samsung,pin-pud = <3>;
240 samsung,pin-drv = <0>;
241 };
242
243 sd0_bus8: sd0-bus-width8 {
244 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
245 samsung,pin-function = <3>;
246 samsung,pin-pud = <3>;
247 samsung,pin-drv = <0>;
248 };
249
250 sd4_clk: sd4-clk {
251 samsung,pins = "gpk0-0";
252 samsung,pin-function = <3>;
253 samsung,pin-pud = <0>;
254 samsung,pin-drv = <0>;
255 };
256
257 sd4_cmd: sd4-cmd {
258 samsung,pins = "gpk0-1";
259 samsung,pin-function = <3>;
260 samsung,pin-pud = <0>;
261 samsung,pin-drv = <0>;
262 };
263
264 sd4_cd: sd4-cd {
265 samsung,pins = "gpk0-2";
266 samsung,pin-function = <3>;
267 samsung,pin-pud = <3>;
268 samsung,pin-drv = <0>;
269 };
270
271 sd4_bus1: sd4-bus-width1 {
272 samsung,pins = "gpk0-3";
273 samsung,pin-function = <3>;
274 samsung,pin-pud = <3>;
275 samsung,pin-drv = <0>;
276 };
277
278 sd4_bus4: sd4-bus-width4 {
279 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
280 samsung,pin-function = <3>;
281 samsung,pin-pud = <3>;
282 samsung,pin-drv = <0>;
283 };
284
285 sd4_bus8: sd4-bus-width8 {
286 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
287 samsung,pin-function = <3>;
288 samsung,pin-pud = <4>;
289 samsung,pin-drv = <0>;
290 };
291
292 sd1_clk: sd1-clk {
293 samsung,pins = "gpk1-0";
294 samsung,pin-function = <2>;
295 samsung,pin-pud = <0>;
296 samsung,pin-drv = <0>;
297 };
298
299 sd1_cmd: sd1-cmd {
300 samsung,pins = "gpk1-1";
301 samsung,pin-function = <2>;
302 samsung,pin-pud = <0>;
303 samsung,pin-drv = <0>;
304 };
305
306 sd1_cd: sd1-cd {
307 samsung,pins = "gpk1-2";
308 samsung,pin-function = <2>;
309 samsung,pin-pud = <3>;
310 samsung,pin-drv = <0>;
311 };
312
313 sd1_bus1: sd1-bus-width1 {
314 samsung,pins = "gpk1-3";
315 samsung,pin-function = <2>;
316 samsung,pin-pud = <3>;
317 samsung,pin-drv = <0>;
318 };
319
320 sd1_bus4: sd1-bus-width4 {
321 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
322 samsung,pin-function = <2>;
323 samsung,pin-pud = <3>;
324 samsung,pin-drv = <0>;
325 };
326
327 sd2_clk: sd2-clk {
328 samsung,pins = "gpk2-0";
329 samsung,pin-function = <2>;
330 samsung,pin-pud = <0>;
331 samsung,pin-drv = <0>;
332 };
333
334 sd2_cmd: sd2-cmd {
335 samsung,pins = "gpk2-1";
336 samsung,pin-function = <2>;
337 samsung,pin-pud = <0>;
338 samsung,pin-drv = <0>;
339 };
340
341 sd2_cd: sd2-cd {
342 samsung,pins = "gpk2-2";
343 samsung,pin-function = <2>;
344 samsung,pin-pud = <3>;
345 samsung,pin-drv = <0>;
346 };
347
348 sd2_bus1: sd2-bus-width1 {
349 samsung,pins = "gpk2-3";
350 samsung,pin-function = <2>;
351 samsung,pin-pud = <3>;
352 samsung,pin-drv = <0>;
353 };
354
355 sd2_bus4: sd2-bus-width4 {
356 samsung,pins = "gpk2-3", "gpk2-4", "gpk2-5", "gpk2-6";
357 samsung,pin-function = <2>;
358 samsung,pin-pud = <3>;
359 samsung,pin-drv = <0>;
360 };
361
362 sd2_bus8: sd2-bus-width8 {
363 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
364 samsung,pin-function = <3>;
365 samsung,pin-pud = <3>;
366 samsung,pin-drv = <0>;
367 };
368
369 sd3_clk: sd3-clk {
370 samsung,pins = "gpk3-0";
371 samsung,pin-function = <2>;
372 samsung,pin-pud = <0>;
373 samsung,pin-drv = <0>;
374 };
375
376 sd3_cmd: sd3-cmd {
377 samsung,pins = "gpk3-1";
378 samsung,pin-function = <2>;
379 samsung,pin-pud = <0>;
380 samsung,pin-drv = <0>;
381 };
382
383 sd3_cd: sd3-cd {
384 samsung,pins = "gpk3-2";
385 samsung,pin-function = <2>;
386 samsung,pin-pud = <3>;
387 samsung,pin-drv = <0>;
388 };
389
390 sd3_bus1: sd3-bus-width1 {
391 samsung,pins = "gpk3-3";
392 samsung,pin-function = <2>;
393 samsung,pin-pud = <3>;
394 samsung,pin-drv = <0>;
395 };
396
397 sd3_bus4: sd3-bus-width4 {
398 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
399 samsung,pin-function = <2>;
400 samsung,pin-pud = <3>;
401 samsung,pin-drv = <0>;
402 };
403
404 eint0: ext-int0 {
405 samsung,pins = "gpx0-0";
406 samsung,pin-function = <0xf>;
407 samsung,pin-pud = <0>;
408 samsung,pin-drv = <0>;
409 };
410
411 eint8: ext-int8 {
412 samsung,pins = "gpx1-0";
413 samsung,pin-function = <0xf>;
414 samsung,pin-pud = <0>;
415 samsung,pin-drv = <0>;
416 };
417
418 eint15: ext-int15 {
419 samsung,pins = "gpx1-7";
420 samsung,pin-function = <0xf>;
421 samsung,pin-pud = <0>;
422 samsung,pin-drv = <0>;
423 };
424
425 eint16: ext-int16 {
426 samsung,pins = "gpx2-0";
427 samsung,pin-function = <0xf>;
428 samsung,pin-pud = <0>;
429 samsung,pin-drv = <0>;
430 };
431
432 eint31: ext-int31 {
433 samsung,pins = "gpx3-7";
434 samsung,pin-function = <0xf>;
435 samsung,pin-pud = <0>;
436 samsung,pin-drv = <0>;
437 };
438 };
439
440 pinctrl@03860000 {
441 i2s0_bus: i2s0-bus {
442 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
443 "gpz-4", "gpz-5", "gpz-6";
444 samsung,pin-function = <0x2>;
445 samsung,pin-pud = <0>;
446 samsung,pin-drv = <0>;
447 };
448
449 pcm0_bus: pcm0-bus {
450 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
451 "gpz-4";
452 samsung,pin-function = <0x3>;
453 samsung,pin-pud = <0>;
454 samsung,pin-drv = <0>;
455 };
456 };
457};
diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts b/arch/arm/boot/dts/exynos4210-smdkv310.dts
index 1beccc8f14f..63610c3ba3a 100644
--- a/arch/arm/boot/dts/exynos4210-smdkv310.dts
+++ b/arch/arm/boot/dts/exynos4210-smdkv310.dts
@@ -26,7 +26,7 @@
26 }; 26 };
27 27
28 chosen { 28 chosen {
29 bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc"; 29 bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc";
30 }; 30 };
31 31
32 sdhci@12530000 { 32 sdhci@12530000 {
@@ -40,6 +40,7 @@
40 <&gpk2 4 2 3 3>, 40 <&gpk2 4 2 3 3>,
41 <&gpk2 5 2 3 3>, 41 <&gpk2 5 2 3 3>,
42 <&gpk2 6 2 3 3>; 42 <&gpk2 6 2 3 3>;
43 status = "okay";
43 }; 44 };
44 45
45 keypad@100A0000 { 46 keypad@100A0000 {
@@ -47,6 +48,7 @@
47 samsung,keypad-num-columns = <8>; 48 samsung,keypad-num-columns = <8>;
48 linux,keypad-no-autorepeat; 49 linux,keypad-no-autorepeat;
49 linux,keypad-wakeup; 50 linux,keypad-wakeup;
51 status = "okay";
50 52
51 row-gpios = <&gpx2 0 3 3 0>, 53 row-gpios = <&gpx2 0 3 3 0>,
52 <&gpx2 1 3 3 0>; 54 <&gpx2 1 3 3 0>;
@@ -128,6 +130,7 @@
128 samsung,i2c-max-bus-freq = <20000>; 130 samsung,i2c-max-bus-freq = <20000>;
129 gpios = <&gpd1 0 2 3 0>, 131 gpios = <&gpd1 0 2 3 0>,
130 <&gpd1 1 2 3 0>; 132 <&gpd1 1 2 3 0>;
133 status = "okay";
131 134
132 eeprom@50 { 135 eeprom@50 {
133 compatible = "samsung,24ad0xd1"; 136 compatible = "samsung,24ad0xd1";
@@ -140,58 +143,11 @@
140 }; 143 };
141 }; 144 };
142 145
143 sdhci@12510000 {
144 status = "disabled";
145 };
146
147 sdhci@12520000 {
148 status = "disabled";
149 };
150
151 sdhci@12540000 {
152 status = "disabled";
153 };
154
155 i2c@13870000 {
156 status = "disabled";
157 };
158
159 i2c@13880000 {
160 status = "disabled";
161 };
162
163 i2c@13890000 {
164 status = "disabled";
165 };
166
167 i2c@138A0000 {
168 status = "disabled";
169 };
170
171 i2c@138B0000 {
172 status = "disabled";
173 };
174
175 i2c@138C0000 {
176 status = "disabled";
177 };
178
179 i2c@138D0000 {
180 status = "disabled";
181 };
182
183 spi_0: spi@13920000 {
184 status = "disabled";
185 };
186
187 spi_1: spi@13930000 {
188 status = "disabled";
189 };
190
191 spi_2: spi@13940000 { 146 spi_2: spi@13940000 {
192 gpios = <&gpc1 1 5 3 0>, 147 gpios = <&gpc1 1 5 3 0>,
193 <&gpc1 3 5 3 0>, 148 <&gpc1 3 5 3 0>,
194 <&gpc1 4 5 3 0>; 149 <&gpc1 4 5 3 0>;
150 status = "okay";
195 151
196 w25x80@0 { 152 w25x80@0 {
197 #address-cells = <1>; 153 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/exynos4210-trats.dts b/arch/arm/boot/dts/exynos4210-trats.dts
new file mode 100644
index 00000000000..73567b843e7
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4210-trats.dts
@@ -0,0 +1,237 @@
1/*
2 * Samsung's Exynos4210 based Trats board device tree source
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 *
7 * Device tree source file for Samsung's Trats board which is based on
8 * Samsung's Exynos4210 SoC.
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/dts-v1/;
16/include/ "exynos4210.dtsi"
17
18/ {
19 model = "Samsung Trats based on Exynos4210";
20 compatible = "samsung,trats", "samsung,exynos4210";
21
22 memory {
23 reg = <0x40000000 0x20000000
24 0x60000000 0x20000000>;
25 };
26
27 chosen {
28 bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rootwait earlyprintk panic=5";
29 };
30
31 vemmc_reg: voltage-regulator@0 {
32 compatible = "regulator-fixed";
33 regulator-name = "VMEM_VDD_2.8V";
34 regulator-min-microvolt = <2800000>;
35 regulator-max-microvolt = <2800000>;
36 gpio = <&gpk0 2 1 0 0>;
37 enable-active-high;
38 };
39
40 sdhci_emmc: sdhci@12510000 {
41 bus-width = <8>;
42 non-removable;
43 broken-voltage;
44 gpios = <&gpk0 0 2 0 3>,
45 <&gpk0 1 2 0 3>,
46 <&gpk0 3 2 2 3>,
47 <&gpk0 4 2 2 3>,
48 <&gpk0 5 2 2 3>,
49 <&gpk0 6 2 2 3>,
50 <&gpk1 3 3 3 3>,
51 <&gpk1 4 3 3 3>,
52 <&gpk1 5 3 3 3>,
53 <&gpk1 6 3 3 3>;
54 vmmc-supply = <&vemmc_reg>;
55 status = "okay";
56 };
57
58 serial@13800000 {
59 status = "okay";
60 };
61
62 serial@13810000 {
63 status = "okay";
64 };
65
66 serial@13820000 {
67 status = "okay";
68 };
69
70 serial@13830000 {
71 status = "okay";
72 };
73
74 i2c@138B0000 {
75 samsung,i2c-sda-delay = <100>;
76 samsung,i2c-slave-addr = <0x10>;
77 samsung,i2c-max-bus-freq = <100000>;
78 gpios = <&gpb 6 3 3 0>,
79 <&gpb 7 3 3 0>;
80 status = "okay";
81
82 max8997_pmic@66 {
83 compatible = "maxim,max8997-pmic";
84
85 reg = <0x66>;
86
87 max8997,pmic-buck1-uses-gpio-dvs;
88 max8997,pmic-buck2-uses-gpio-dvs;
89 max8997,pmic-buck5-uses-gpio-dvs;
90
91 max8997,pmic-ignore-gpiodvs-side-effect;
92 max8997,pmic-buck125-default-dvs-idx = <0>;
93
94 max8997,pmic-buck125-dvs-gpios = <&gpx0 5 1 0 0>,
95 <&gpx0 6 1 0 0>,
96 <&gpl0 0 1 0 0>;
97
98 max8997,pmic-buck1-dvs-voltage = <1350000>, <1300000>,
99 <1250000>, <1200000>,
100 <1150000>, <1100000>,
101 <1000000>, <950000>;
102
103 max8997,pmic-buck2-dvs-voltage = <1100000>, <1000000>,
104 <950000>, <900000>,
105 <1100000>, <1000000>,
106 <950000>, <900000>;
107
108 max8997,pmic-buck5-dvs-voltage = <1200000>, <1200000>,
109 <1200000>, <1200000>,
110 <1200000>, <1200000>,
111 <1200000>, <1200000>;
112
113 regulators {
114 valive_reg: LDO2 {
115 regulator-name = "VALIVE_1.1V_C210";
116 regulator-min-microvolt = <1100000>;
117 regulator-max-microvolt = <1100000>;
118 regulator-always-on;
119 };
120
121 vusb_reg: LDO3 {
122 regulator-name = "VUSB_1.1V_C210";
123 regulator-min-microvolt = <1100000>;
124 regulator-max-microvolt = <1100000>;
125 };
126
127 vmipi_reg: LDO4 {
128 regulator-name = "VMIPI_1.8V";
129 regulator-min-microvolt = <1800000>;
130 regulator-max-microvolt = <1800000>;
131 };
132
133 vpda_reg: LDO6 {
134 regulator-name = "VCC_1.8V_PDA";
135 regulator-min-microvolt = <1800000>;
136 regulator-max-microvolt = <1800000>;
137 regulator-always-on;
138 };
139
140 vcam_reg: LDO7 {
141 regulator-name = "CAM_ISP_1.8V";
142 regulator-min-microvolt = <1800000>;
143 regulator-max-microvolt = <1800000>;
144 };
145
146 vusbdac_reg: LDO8 {
147 regulator-name = "VUSB/VDAC_3.3V_C210";
148 regulator-min-microvolt = <3300000>;
149 regulator-max-microvolt = <3300000>;
150 };
151
152 vccpda_reg: LDO9 {
153 regulator-name = "VCC_2.8V_PDA";
154 regulator-min-microvolt = <2800000>;
155 regulator-max-microvolt = <2800000>;
156 regulator-always-on;
157 };
158
159 vpll_reg: LDO10 {
160 regulator-name = "VPLL_1.1V_C210";
161 regulator-min-microvolt = <1100000>;
162 regulator-max-microvolt = <1100000>;
163 regulator-always-on;
164 };
165
166 vcclcd_reg: LDO13 {
167 regulator-name = "VCC_3.3V_LCD";
168 regulator-min-microvolt = <3300000>;
169 regulator-max-microvolt = <3300000>;
170 };
171
172 vlcd_reg: LDO15 {
173 regulator-name = "VLCD_2.2V";
174 regulator-min-microvolt = <2200000>;
175 regulator-max-microvolt = <2200000>;
176 };
177
178 camsensor_reg: LDO16 {
179 regulator-name = "CAM_SENSOR_IO_1.8V";
180 regulator-min-microvolt = <1800000>;
181 regulator-max-microvolt = <1800000>;
182 };
183
184 vddq_reg: LDO21 {
185 regulator-name = "VDDQ_M1M2_1.2V";
186 regulator-min-microvolt = <1200000>;
187 regulator-max-microvolt = <1200000>;
188 regulator-always-on;
189 };
190
191 varm_breg: BUCK1 {
192 regulator-name = "VARM_1.2V_C210";
193 regulator-min-microvolt = <900000>;
194 regulator-max-microvolt = <1350000>;
195 regulator-always-on;
196 };
197
198 vint_breg: BUCK2 {
199 regulator-name = "VINT_1.1V_C210";
200 regulator-min-microvolt = <900000>;
201 regulator-max-microvolt = <1100000>;
202 regulator-always-on;
203 };
204
205 camisp_breg: BUCK4 {
206 regulator-name = "CAM_ISP_CORE_1.2V";
207 regulator-min-microvolt = <1200000>;
208 regulator-max-microvolt = <1200000>;
209 };
210
211 vmem_breg: BUCK5 {
212 regulator-name = "VMEM_1.2V_C210";
213 regulator-min-microvolt = <1200000>;
214 regulator-max-microvolt = <1200000>;
215 regulator-always-on;
216 };
217
218 vccsub_breg: BUCK7 {
219 regulator-name = "VCC_SUB_2.0V";
220 regulator-min-microvolt = <2000000>;
221 regulator-max-microvolt = <2000000>;
222 regulator-always-on;
223 };
224
225 safe1_sreg: ESAFEOUT1 {
226 regulator-name = "SAFEOUT1";
227 regulator-always-on;
228 };
229
230 safe2_sreg: ESAFEOUT2 {
231 regulator-name = "SAFEOUT2";
232 regulator-boot-on;
233 };
234 };
235 };
236 };
237};
diff --git a/arch/arm/boot/dts/exynos4210.dtsi b/arch/arm/boot/dts/exynos4210.dtsi
index 02891fe876e..214c557eda7 100644
--- a/arch/arm/boot/dts/exynos4210.dtsi
+++ b/arch/arm/boot/dts/exynos4210.dtsi
@@ -19,199 +19,60 @@
19 * published by the Free Software Foundation. 19 * published by the Free Software Foundation.
20*/ 20*/
21 21
22/include/ "skeleton.dtsi" 22/include/ "exynos4.dtsi"
23/include/ "exynos4210-pinctrl.dtsi"
23 24
24/ { 25/ {
25 compatible = "samsung,exynos4210"; 26 compatible = "samsung,exynos4210";
26 interrupt-parent = <&gic>;
27 27
28 aliases { 28 aliases {
29 spi0 = &spi_0; 29 pinctrl0 = &pinctrl_0;
30 spi1 = &spi_1; 30 pinctrl1 = &pinctrl_1;
31 spi2 = &spi_2; 31 pinctrl2 = &pinctrl_2;
32 }; 32 };
33 33
34 gic:interrupt-controller@10490000 { 34 gic:interrupt-controller@10490000 {
35 compatible = "arm,cortex-a9-gic";
36 #interrupt-cells = <3>;
37 interrupt-controller;
38 cpu-offset = <0x8000>; 35 cpu-offset = <0x8000>;
39 reg = <0x10490000 0x1000>, <0x10480000 0x100>;
40 }; 36 };
41 37
42 combiner:interrupt-controller@10440000 { 38 combiner:interrupt-controller@10440000 {
43 compatible = "samsung,exynos4210-combiner";
44 #interrupt-cells = <2>;
45 interrupt-controller;
46 reg = <0x10440000 0x1000>;
47 interrupts = <0 0 0>, <0 1 0>, <0 2 0>, <0 3 0>, 39 interrupts = <0 0 0>, <0 1 0>, <0 2 0>, <0 3 0>,
48 <0 4 0>, <0 5 0>, <0 6 0>, <0 7 0>, 40 <0 4 0>, <0 5 0>, <0 6 0>, <0 7 0>,
49 <0 8 0>, <0 9 0>, <0 10 0>, <0 11 0>, 41 <0 8 0>, <0 9 0>, <0 10 0>, <0 11 0>,
50 <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>; 42 <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>;
51 }; 43 };
52 44
53 watchdog@10060000 { 45 pinctrl_0: pinctrl@11400000 {
54 compatible = "samsung,s3c2410-wdt"; 46 compatible = "samsung,pinctrl-exynos4210";
55 reg = <0x10060000 0x100>; 47 reg = <0x11400000 0x1000>;
56 interrupts = <0 43 0>; 48 interrupts = <0 47 0>;
57 }; 49 interrupt-controller;
58 50 #interrupt-cells = <2>;
59 rtc@10070000 {
60 compatible = "samsung,s3c6410-rtc";
61 reg = <0x10070000 0x100>;
62 interrupts = <0 44 0>, <0 45 0>;
63 };
64
65 keypad@100A0000 {
66 compatible = "samsung,s5pv210-keypad";
67 reg = <0x100A0000 0x100>;
68 interrupts = <0 109 0>;
69 };
70
71 sdhci@12510000 {
72 compatible = "samsung,exynos4210-sdhci";
73 reg = <0x12510000 0x100>;
74 interrupts = <0 73 0>;
75 };
76
77 sdhci@12520000 {
78 compatible = "samsung,exynos4210-sdhci";
79 reg = <0x12520000 0x100>;
80 interrupts = <0 74 0>;
81 };
82
83 sdhci@12530000 {
84 compatible = "samsung,exynos4210-sdhci";
85 reg = <0x12530000 0x100>;
86 interrupts = <0 75 0>;
87 };
88
89 sdhci@12540000 {
90 compatible = "samsung,exynos4210-sdhci";
91 reg = <0x12540000 0x100>;
92 interrupts = <0 76 0>;
93 };
94
95 serial@13800000 {
96 compatible = "samsung,exynos4210-uart";
97 reg = <0x13800000 0x100>;
98 interrupts = <0 52 0>;
99 };
100
101 serial@13810000 {
102 compatible = "samsung,exynos4210-uart";
103 reg = <0x13810000 0x100>;
104 interrupts = <0 53 0>;
105 };
106
107 serial@13820000 {
108 compatible = "samsung,exynos4210-uart";
109 reg = <0x13820000 0x100>;
110 interrupts = <0 54 0>;
111 };
112
113 serial@13830000 {
114 compatible = "samsung,exynos4210-uart";
115 reg = <0x13830000 0x100>;
116 interrupts = <0 55 0>;
117 };
118
119 i2c@13860000 {
120 compatible = "samsung,s3c2440-i2c";
121 reg = <0x13860000 0x100>;
122 interrupts = <0 58 0>;
123 };
124
125 i2c@13870000 {
126 compatible = "samsung,s3c2440-i2c";
127 reg = <0x13870000 0x100>;
128 interrupts = <0 59 0>;
129 };
130
131 i2c@13880000 {
132 compatible = "samsung,s3c2440-i2c";
133 reg = <0x13880000 0x100>;
134 interrupts = <0 60 0>;
135 };
136
137 i2c@13890000 {
138 compatible = "samsung,s3c2440-i2c";
139 reg = <0x13890000 0x100>;
140 interrupts = <0 61 0>;
141 };
142
143 i2c@138A0000 {
144 compatible = "samsung,s3c2440-i2c";
145 reg = <0x138A0000 0x100>;
146 interrupts = <0 62 0>;
147 };
148
149 i2c@138B0000 {
150 compatible = "samsung,s3c2440-i2c";
151 reg = <0x138B0000 0x100>;
152 interrupts = <0 63 0>;
153 };
154
155 i2c@138C0000 {
156 compatible = "samsung,s3c2440-i2c";
157 reg = <0x138C0000 0x100>;
158 interrupts = <0 64 0>;
159 };
160
161 i2c@138D0000 {
162 compatible = "samsung,s3c2440-i2c";
163 reg = <0x138D0000 0x100>;
164 interrupts = <0 65 0>;
165 };
166
167 spi_0: spi@13920000 {
168 compatible = "samsung,exynos4210-spi";
169 reg = <0x13920000 0x100>;
170 interrupts = <0 66 0>;
171 tx-dma-channel = <&pdma0 7>; /* preliminary */
172 rx-dma-channel = <&pdma0 6>; /* preliminary */
173 #address-cells = <1>;
174 #size-cells = <0>;
175 };
176
177 spi_1: spi@13930000 {
178 compatible = "samsung,exynos4210-spi";
179 reg = <0x13930000 0x100>;
180 interrupts = <0 67 0>;
181 tx-dma-channel = <&pdma1 7>; /* preliminary */
182 rx-dma-channel = <&pdma1 6>; /* preliminary */
183 #address-cells = <1>;
184 #size-cells = <0>;
185 };
186
187 spi_2: spi@13940000 {
188 compatible = "samsung,exynos4210-spi";
189 reg = <0x13940000 0x100>;
190 interrupts = <0 68 0>;
191 tx-dma-channel = <&pdma0 9>; /* preliminary */
192 rx-dma-channel = <&pdma0 8>; /* preliminary */
193 #address-cells = <1>;
194 #size-cells = <0>;
195 }; 51 };
196 52
197 amba { 53 pinctrl_1: pinctrl@11000000 {
198 #address-cells = <1>; 54 compatible = "samsung,pinctrl-exynos4210";
199 #size-cells = <1>; 55 reg = <0x11000000 0x1000>;
200 compatible = "arm,amba-bus"; 56 interrupts = <0 46 0>;
201 interrupt-parent = <&gic>; 57 interrupt-controller;
202 ranges; 58 #interrupt-cells = <2>;
203 59
204 pdma0: pdma@12680000 { 60 wakup_eint: wakeup-interrupt-controller {
205 compatible = "arm,pl330", "arm,primecell"; 61 compatible = "samsung,exynos4210-wakeup-eint";
206 reg = <0x12680000 0x1000>; 62 interrupt-parent = <&gic>;
207 interrupts = <0 35 0>; 63 interrupt-controller;
64 #interrupt-cells = <2>;
65 interrupts = <0 16 0>, <0 17 0>, <0 18 0>, <0 19 0>,
66 <0 20 0>, <0 21 0>, <0 22 0>, <0 23 0>,
67 <0 24 0>, <0 25 0>, <0 26 0>, <0 27 0>,
68 <0 28 0>, <0 29 0>, <0 30 0>, <0 31 0>,
69 <0 32 0>;
208 }; 70 };
71 };
209 72
210 pdma1: pdma@12690000 { 73 pinctrl_2: pinctrl@03860000 {
211 compatible = "arm,pl330", "arm,primecell"; 74 compatible = "samsung,pinctrl-exynos4210";
212 reg = <0x12690000 0x1000>; 75 reg = <0x03860000 0x1000>;
213 interrupts = <0 36 0>;
214 };
215 }; 76 };
216 77
217 gpio-controllers { 78 gpio-controllers {
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index 8a5e348793c..a352df403b7 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -16,12 +16,19 @@
16 model = "SAMSUNG SMDK5250 board based on EXYNOS5250"; 16 model = "SAMSUNG SMDK5250 board based on EXYNOS5250";
17 compatible = "samsung,smdk5250", "samsung,exynos5250"; 17 compatible = "samsung,smdk5250", "samsung,exynos5250";
18 18
19 aliases {
20 mshc0 = &dwmmc_0;
21 mshc1 = &dwmmc_1;
22 mshc2 = &dwmmc_2;
23 mshc3 = &dwmmc_3;
24 };
25
19 memory { 26 memory {
20 reg = <0x40000000 0x80000000>; 27 reg = <0x40000000 0x80000000>;
21 }; 28 };
22 29
23 chosen { 30 chosen {
24 bootargs = "root=/dev/ram0 rw ramdisk=8192 console=ttySAC1,115200"; 31 bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc";
25 }; 32 };
26 33
27 i2c@12C60000 { 34 i2c@12C60000 {
@@ -72,6 +79,56 @@
72 status = "disabled"; 79 status = "disabled";
73 }; 80 };
74 81
82 dwmmc_0: dwmmc0@12200000 {
83 num-slots = <1>;
84 supports-highspeed;
85 broken-cd;
86 fifo-depth = <0x80>;
87 card-detect-delay = <200>;
88 samsung,dw-mshc-ciu-div = <3>;
89 samsung,dw-mshc-sdr-timing = <2 3 3>;
90 samsung,dw-mshc-ddr-timing = <1 2 3>;
91
92 slot@0 {
93 reg = <0>;
94 bus-width = <8>;
95 gpios = <&gpc0 0 2 0 3>, <&gpc0 1 2 0 3>,
96 <&gpc1 0 2 3 3>, <&gpc1 1 2 3 3>,
97 <&gpc1 2 2 3 3>, <&gpc1 3 2 3 3>,
98 <&gpc0 3 2 3 3>, <&gpc0 4 2 3 3>,
99 <&gpc0 5 2 3 3>, <&gpc0 6 2 3 3>;
100 };
101 };
102
103 dwmmc_1: dwmmc1@12210000 {
104 status = "disabled";
105 };
106
107 dwmmc_2: dwmmc2@12220000 {
108 num-slots = <1>;
109 supports-highspeed;
110 fifo-depth = <0x80>;
111 card-detect-delay = <200>;
112 samsung,dw-mshc-ciu-div = <3>;
113 samsung,dw-mshc-sdr-timing = <2 3 3>;
114 samsung,dw-mshc-ddr-timing = <1 2 3>;
115
116 slot@0 {
117 reg = <0>;
118 bus-width = <4>;
119 samsung,cd-pinmux-gpio = <&gpc3 2 2 3 3>;
120 gpios = <&gpc3 0 2 0 3>, <&gpc3 1 2 0 3>,
121 <&gpc3 3 2 3 3>, <&gpc3 4 2 3 3>,
122 <&gpc3 5 2 3 3>, <&gpc3 6 2 3 3>,
123 <&gpc4 3 3 3 3>, <&gpc4 3 3 3 3>,
124 <&gpc4 5 3 3 3>, <&gpc4 6 3 3 3>;
125 };
126 };
127
128 dwmmc_3: dwmmc3@12230000 {
129 status = "disabled";
130 };
131
75 spi_0: spi@12d20000 { 132 spi_0: spi@12d20000 {
76 status = "disabled"; 133 status = "disabled";
77 }; 134 };
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 004aaa8d123..dddfd6e444d 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -27,6 +27,10 @@
27 spi0 = &spi_0; 27 spi0 = &spi_0;
28 spi1 = &spi_1; 28 spi1 = &spi_1;
29 spi2 = &spi_2; 29 spi2 = &spi_2;
30 gsc0 = &gsc_0;
31 gsc1 = &gsc_1;
32 gsc2 = &gsc_2;
33 gsc3 = &gsc_3;
30 }; 34 };
31 35
32 gic:interrupt-controller@10481000 { 36 gic:interrupt-controller@10481000 {
@@ -182,6 +186,38 @@
182 #size-cells = <0>; 186 #size-cells = <0>;
183 }; 187 };
184 188
189 dwmmc0@12200000 {
190 compatible = "samsung,exynos5250-dw-mshc";
191 reg = <0x12200000 0x1000>;
192 interrupts = <0 75 0>;
193 #address-cells = <1>;
194 #size-cells = <0>;
195 };
196
197 dwmmc1@12210000 {
198 compatible = "samsung,exynos5250-dw-mshc";
199 reg = <0x12210000 0x1000>;
200 interrupts = <0 76 0>;
201 #address-cells = <1>;
202 #size-cells = <0>;
203 };
204
205 dwmmc2@12220000 {
206 compatible = "samsung,exynos5250-dw-mshc";
207 reg = <0x12220000 0x1000>;
208 interrupts = <0 77 0>;
209 #address-cells = <1>;
210 #size-cells = <0>;
211 };
212
213 dwmmc3@12230000 {
214 compatible = "samsung,exynos5250-dw-mshc";
215 reg = <0x12230000 0x1000>;
216 interrupts = <0 78 0>;
217 #address-cells = <1>;
218 #size-cells = <0>;
219 };
220
185 amba { 221 amba {
186 #address-cells = <1>; 222 #address-cells = <1>;
187 #size-cells = <1>; 223 #size-cells = <1>;
@@ -460,4 +496,28 @@
460 #gpio-cells = <4>; 496 #gpio-cells = <4>;
461 }; 497 };
462 }; 498 };
499
500 gsc_0: gsc@0x13e00000 {
501 compatible = "samsung,exynos5-gsc";
502 reg = <0x13e00000 0x1000>;
503 interrupts = <0 85 0>;
504 };
505
506 gsc_1: gsc@0x13e10000 {
507 compatible = "samsung,exynos5-gsc";
508 reg = <0x13e10000 0x1000>;
509 interrupts = <0 86 0>;
510 };
511
512 gsc_2: gsc@0x13e20000 {
513 compatible = "samsung,exynos5-gsc";
514 reg = <0x13e20000 0x1000>;
515 interrupts = <0 87 0>;
516 };
517
518 gsc_3: gsc@0x13e30000 {
519 compatible = "samsung,exynos5-gsc";
520 reg = <0x13e30000 0x1000>;
521 interrupts = <0 88 0>;
522 };
463}; 523};
diff --git a/arch/arm/boot/dts/highbank.dts b/arch/arm/boot/dts/highbank.dts
index 9fecf1ae777..0c6fc34821f 100644
--- a/arch/arm/boot/dts/highbank.dts
+++ b/arch/arm/boot/dts/highbank.dts
@@ -121,6 +121,10 @@
121 compatible = "calxeda,hb-ahci"; 121 compatible = "calxeda,hb-ahci";
122 reg = <0xffe08000 0x10000>; 122 reg = <0xffe08000 0x10000>;
123 interrupts = <0 83 4>; 123 interrupts = <0 83 4>;
124 calxeda,port-phys = <&combophy5 0 &combophy0 0
125 &combophy0 1 &combophy0 2
126 &combophy0 3>;
127 dma-coherent;
124 }; 128 };
125 129
126 sdhci@ffe0e000 { 130 sdhci@ffe0e000 {
@@ -306,5 +310,19 @@
306 reg = <0xfff51000 0x1000>; 310 reg = <0xfff51000 0x1000>;
307 interrupts = <0 80 4 0 81 4 0 82 4>; 311 interrupts = <0 80 4 0 81 4 0 82 4>;
308 }; 312 };
313
314 combophy0: combo-phy@fff58000 {
315 compatible = "calxeda,hb-combophy";
316 #phy-cells = <1>;
317 reg = <0xfff58000 0x1000>;
318 phydev = <5>;
319 };
320
321 combophy5: combo-phy@fff5d000 {
322 compatible = "calxeda,hb-combophy";
323 #phy-cells = <1>;
324 reg = <0xfff5d000 0x1000>;
325 phydev = <31>;
326 };
309 }; 327 };
310}; 328};
diff --git a/arch/arm/boot/dts/hrefv60plus.dts b/arch/arm/boot/dts/hrefv60plus.dts
new file mode 100644
index 00000000000..2131d77dc9c
--- /dev/null
+++ b/arch/arm/boot/dts/hrefv60plus.dts
@@ -0,0 +1,95 @@
1/*
2 * Copyright 2012 ST-Ericsson AB
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/ "dbx5x0.dtsi"
14
15/ {
16 model = "ST-Ericsson HREF platform with Device Tree";
17 compatible = "st-ericsson,hrefv60+";
18
19 memory {
20 reg = <0x00000000 0x20000000>;
21 };
22
23 soc-u9500 {
24 uart@80120000 {
25 status = "okay";
26 };
27
28 uart@80121000 {
29 status = "okay";
30 };
31
32 uart@80007000 {
33 status = "okay";
34 };
35
36 i2c@80004000 {
37 tc3589x@42 {
38 compatible = "tc3589x";
39 reg = <0x42>;
40 interrupt-parent = <&gpio6>;
41 interrupts = <25 0x1>;
42
43 interrupt-controller;
44 #interrupt-cells = <2>;
45
46 tc3589x_gpio: tc3589x_gpio {
47 compatible = "tc3589x-gpio";
48 interrupts = <0 0x1>;
49
50 interrupt-controller;
51 #interrupt-cells = <2>;
52 gpio-controller;
53 #gpio-cells = <2>;
54 };
55 };
56
57 tps61052@33 {
58 compatible = "tps61052";
59 reg = <0x33>;
60 };
61 };
62
63 i2c@80128000 {
64 lp5521@0x33 {
65 compatible = "lp5521";
66 reg = <0x33>;
67 };
68
69 lp5521@0x34 {
70 compatible = "lp5521";
71 reg = <0x34>;
72 };
73
74 bh1780@0x29 {
75 compatible = "rohm,bh1780gli";
76 reg = <0x33>;
77 };
78 };
79
80 sound {
81 compatible = "stericsson,snd-soc-mop500";
82
83 stericsson,cpu-dai = <&msp1 &msp3>;
84 stericsson,audio-codec = <&codec>;
85 };
86
87 msp1: msp@80124000 {
88 status = "okay";
89 };
90
91 msp3: msp@80125000 {
92 status = "okay";
93 };
94 };
95};
diff --git a/arch/arm/boot/dts/imx23-evk.dts b/arch/arm/boot/dts/imx23-evk.dts
index e3486f486b4..035c13f9d3c 100644
--- a/arch/arm/boot/dts/imx23-evk.dts
+++ b/arch/arm/boot/dts/imx23-evk.dts
@@ -42,12 +42,13 @@
42 pinctrl-names = "default"; 42 pinctrl-names = "default";
43 pinctrl-0 = <&hog_pins_a>; 43 pinctrl-0 = <&hog_pins_a>;
44 44
45 hog_pins_a: hog-gpios@0 { 45 hog_pins_a: hog@0 {
46 reg = <0>; 46 reg = <0>;
47 fsl,pinmux-ids = < 47 fsl,pinmux-ids = <
48 0x1123 /* MX23_PAD_LCD_RESET__GPIO_1_18 */ 48 0x1123 /* MX23_PAD_LCD_RESET__GPIO_1_18 */
49 0x11d3 /* MX23_PAD_PWM3__GPIO_1_29 */ 49 0x11d3 /* MX23_PAD_PWM3__GPIO_1_29 */
50 0x11e3 /* MX23_PAD_PWM4__GPIO_1_30 */ 50 0x11e3 /* MX23_PAD_PWM4__GPIO_1_30 */
51 0x2010 /* MX23_PAD_SSP1_DETECT__SSP1_DETECT */
51 >; 52 >;
52 fsl,drive-strength = <0>; 53 fsl,drive-strength = <0>;
53 fsl,voltage = <1>; 54 fsl,voltage = <1>;
diff --git a/arch/arm/boot/dts/imx23-olinuxino.dts b/arch/arm/boot/dts/imx23-olinuxino.dts
index 20912b1d889..384d8b66f33 100644
--- a/arch/arm/boot/dts/imx23-olinuxino.dts
+++ b/arch/arm/boot/dts/imx23-olinuxino.dts
@@ -31,6 +31,22 @@
31 bus-width = <4>; 31 bus-width = <4>;
32 status = "okay"; 32 status = "okay";
33 }; 33 };
34
35 pinctrl@80018000 {
36 pinctrl-names = "default";
37 pinctrl-0 = <&hog_pins_a>;
38
39 hog_pins_a: hog@0 {
40 reg = <0>;
41 fsl,pinmux-ids = <
42 0x2013 /* MX23_PAD_SSP1_DETECT__GPIO_2_1 */
43 0x0113 /* MX23_PAD_GPMI_ALE__GPIO_0_17 */
44 >;
45 fsl,drive-strength = <0>;
46 fsl,voltage = <1>;
47 fsl,pull-up = <0>;
48 };
49 };
34 }; 50 };
35 51
36 apbx@80040000 { 52 apbx@80040000 {
@@ -39,6 +55,47 @@
39 pinctrl-0 = <&duart_pins_a>; 55 pinctrl-0 = <&duart_pins_a>;
40 status = "okay"; 56 status = "okay";
41 }; 57 };
58
59 auart0: serial@8006c000 {
60 pinctrl-names = "default";
61 pinctrl-0 = <&auart0_2pins_a>;
62 status = "okay";
63 };
64
65 usbphy0: usbphy@8007c000 {
66 status = "okay";
67 };
68 };
69 };
70
71 ahb@80080000 {
72 usb0: usb@80080000 {
73 vbus-supply = <&reg_usb0_vbus>;
74 status = "okay";
75 };
76 };
77
78 regulators {
79 compatible = "simple-bus";
80
81 reg_usb0_vbus: usb0_vbus {
82 compatible = "regulator-fixed";
83 regulator-name = "usb0_vbus";
84 regulator-min-microvolt = <5000000>;
85 regulator-max-microvolt = <5000000>;
86 enable-active-high;
87 startup-delay-us = <300>; /* LAN9215 requires a POR of 200us minimum */
88 gpio = <&gpio0 17 0>;
89 };
90 };
91
92 leds {
93 compatible = "gpio-leds";
94
95 user {
96 label = "green";
97 gpios = <&gpio2 1 0>;
98 linux,default-trigger = "default-on";
42 }; 99 };
43 }; 100 };
44}; 101};
diff --git a/arch/arm/boot/dts/imx23-stmp378x_devb.dts b/arch/arm/boot/dts/imx23-stmp378x_devb.dts
index 757a327ff3e..85c3864b6a5 100644
--- a/arch/arm/boot/dts/imx23-stmp378x_devb.dts
+++ b/arch/arm/boot/dts/imx23-stmp378x_devb.dts
@@ -36,7 +36,7 @@
36 pinctrl-names = "default"; 36 pinctrl-names = "default";
37 pinctrl-0 = <&hog_pins_a>; 37 pinctrl-0 = <&hog_pins_a>;
38 38
39 hog_pins_a: hog-gpios@0 { 39 hog_pins_a: hog@0 {
40 reg = <0>; 40 reg = <0>;
41 fsl,pinmux-ids = < 41 fsl,pinmux-ids = <
42 0x11d3 /* MX23_PAD_PWM3__GPIO_1_29 */ 42 0x11d3 /* MX23_PAD_PWM3__GPIO_1_29 */
diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
index e6138310e5c..9ca4ca70c1b 100644
--- a/arch/arm/boot/dts/imx23.dtsi
+++ b/arch/arm/boot/dts/imx23.dtsi
@@ -43,7 +43,7 @@
43 ranges; 43 ranges;
44 44
45 icoll: interrupt-controller@80000000 { 45 icoll: interrupt-controller@80000000 {
46 compatible = "fsl,imx23-icoll", "fsl,mxs-icoll"; 46 compatible = "fsl,imx23-icoll", "fsl,icoll";
47 interrupt-controller; 47 interrupt-controller;
48 #interrupt-cells = <1>; 48 #interrupt-cells = <1>;
49 reg = <0x80000000 0x2000>; 49 reg = <0x80000000 0x2000>;
@@ -52,6 +52,7 @@
52 dma-apbh@80004000 { 52 dma-apbh@80004000 {
53 compatible = "fsl,imx23-dma-apbh"; 53 compatible = "fsl,imx23-dma-apbh";
54 reg = <0x80004000 0x2000>; 54 reg = <0x80004000 0x2000>;
55 clocks = <&clks 15>;
55 }; 56 };
56 57
57 ecc@80008000 { 58 ecc@80008000 {
@@ -67,6 +68,7 @@
67 reg-names = "gpmi-nand", "bch"; 68 reg-names = "gpmi-nand", "bch";
68 interrupts = <13>, <56>; 69 interrupts = <13>, <56>;
69 interrupt-names = "gpmi-dma", "bch"; 70 interrupt-names = "gpmi-dma", "bch";
71 clocks = <&clks 34>;
70 fsl,gpmi-dma-channel = <4>; 72 fsl,gpmi-dma-channel = <4>;
71 status = "disabled"; 73 status = "disabled";
72 }; 74 };
@@ -74,6 +76,7 @@
74 ssp0: ssp@80010000 { 76 ssp0: ssp@80010000 {
75 reg = <0x80010000 0x2000>; 77 reg = <0x80010000 0x2000>;
76 interrupts = <15 14>; 78 interrupts = <15 14>;
79 clocks = <&clks 33>;
77 fsl,ssp-dma-channel = <1>; 80 fsl,ssp-dma-channel = <1>;
78 status = "disabled"; 81 status = "disabled";
79 }; 82 };
@@ -140,6 +143,17 @@
140 fsl,pull-up = <0>; 143 fsl,pull-up = <0>;
141 }; 144 };
142 145
146 auart0_2pins_a: auart0-2pins@0 {
147 reg = <0>;
148 fsl,pinmux-ids = <
149 0x01e2 /* MX23_PAD_I2C_SCL__AUART1_TX */
150 0x01f2 /* MX23_PAD_I2C_SDA__AUART1_RX */
151 >;
152 fsl,drive-strength = <0>;
153 fsl,voltage = <1>;
154 fsl,pull-up = <0>;
155 };
156
143 gpmi_pins_a: gpmi-nand@0 { 157 gpmi_pins_a: gpmi-nand@0 {
144 reg = <0>; 158 reg = <0>;
145 fsl,pinmux-ids = < 159 fsl,pinmux-ids = <
@@ -183,7 +197,6 @@
183 0x2040 /* MX23_PAD_SSP1_DATA2__SSP1_DATA2 */ 197 0x2040 /* MX23_PAD_SSP1_DATA2__SSP1_DATA2 */
184 0x2050 /* MX23_PAD_SSP1_DATA3__SSP1_DATA3 */ 198 0x2050 /* MX23_PAD_SSP1_DATA3__SSP1_DATA3 */
185 0x2000 /* MX23_PAD_SSP1_CMD__SSP1_CMD */ 199 0x2000 /* MX23_PAD_SSP1_CMD__SSP1_CMD */
186 0x2010 /* MX23_PAD_SSP1_DETECT__SSP1_DETECT */
187 0x2060 /* MX23_PAD_SSP1_SCK__SSP1_SCK */ 200 0x2060 /* MX23_PAD_SSP1_SCK__SSP1_SCK */
188 >; 201 >;
189 fsl,drive-strength = <1>; 202 fsl,drive-strength = <1>;
@@ -280,6 +293,7 @@
280 dma-apbx@80024000 { 293 dma-apbx@80024000 {
281 compatible = "fsl,imx23-dma-apbx"; 294 compatible = "fsl,imx23-dma-apbx";
282 reg = <0x80024000 0x2000>; 295 reg = <0x80024000 0x2000>;
296 clocks = <&clks 16>;
283 }; 297 };
284 298
285 dcp@80028000 { 299 dcp@80028000 {
@@ -306,12 +320,14 @@
306 compatible = "fsl,imx23-lcdif"; 320 compatible = "fsl,imx23-lcdif";
307 reg = <0x80030000 2000>; 321 reg = <0x80030000 2000>;
308 interrupts = <46 45>; 322 interrupts = <46 45>;
323 clocks = <&clks 38>;
309 status = "disabled"; 324 status = "disabled";
310 }; 325 };
311 326
312 ssp1: ssp@80034000 { 327 ssp1: ssp@80034000 {
313 reg = <0x80034000 0x2000>; 328 reg = <0x80034000 0x2000>;
314 interrupts = <2 20>; 329 interrupts = <2 20>;
330 clocks = <&clks 33>;
315 fsl,ssp-dma-channel = <2>; 331 fsl,ssp-dma-channel = <2>;
316 status = "disabled"; 332 status = "disabled";
317 }; 333 };
@@ -329,9 +345,10 @@
329 reg = <0x80040000 0x40000>; 345 reg = <0x80040000 0x40000>;
330 ranges; 346 ranges;
331 347
332 clkctl@80040000 { 348 clks: clkctrl@80040000 {
349 compatible = "fsl,imx23-clkctrl";
333 reg = <0x80040000 0x2000>; 350 reg = <0x80040000 0x2000>;
334 status = "disabled"; 351 #clock-cells = <1>;
335 }; 352 };
336 353
337 saif0: saif@80042000 { 354 saif0: saif@80042000 {
@@ -383,20 +400,23 @@
383 pwm: pwm@80064000 { 400 pwm: pwm@80064000 {
384 compatible = "fsl,imx23-pwm"; 401 compatible = "fsl,imx23-pwm";
385 reg = <0x80064000 0x2000>; 402 reg = <0x80064000 0x2000>;
403 clocks = <&clks 30>;
386 #pwm-cells = <2>; 404 #pwm-cells = <2>;
387 fsl,pwm-number = <5>; 405 fsl,pwm-number = <5>;
388 status = "disabled"; 406 status = "disabled";
389 }; 407 };
390 408
391 timrot@80068000 { 409 timrot@80068000 {
410 compatible = "fsl,imx23-timrot", "fsl,timrot";
392 reg = <0x80068000 0x2000>; 411 reg = <0x80068000 0x2000>;
393 status = "disabled"; 412 interrupts = <28 29 30 31>;
394 }; 413 };
395 414
396 auart0: serial@8006c000 { 415 auart0: serial@8006c000 {
397 compatible = "fsl,imx23-auart"; 416 compatible = "fsl,imx23-auart";
398 reg = <0x8006c000 0x2000>; 417 reg = <0x8006c000 0x2000>;
399 interrupts = <24 25 23>; 418 interrupts = <24 25 23>;
419 clocks = <&clks 32>;
400 status = "disabled"; 420 status = "disabled";
401 }; 421 };
402 422
@@ -404,6 +424,7 @@
404 compatible = "fsl,imx23-auart"; 424 compatible = "fsl,imx23-auart";
405 reg = <0x8006e000 0x2000>; 425 reg = <0x8006e000 0x2000>;
406 interrupts = <59 60 58>; 426 interrupts = <59 60 58>;
427 clocks = <&clks 32>;
407 status = "disabled"; 428 status = "disabled";
408 }; 429 };
409 430
@@ -411,11 +432,15 @@
411 compatible = "arm,pl011", "arm,primecell"; 432 compatible = "arm,pl011", "arm,primecell";
412 reg = <0x80070000 0x2000>; 433 reg = <0x80070000 0x2000>;
413 interrupts = <0>; 434 interrupts = <0>;
435 clocks = <&clks 32>, <&clks 16>;
436 clock-names = "uart", "apb_pclk";
414 status = "disabled"; 437 status = "disabled";
415 }; 438 };
416 439
417 usbphy@8007c000 { 440 usbphy0: usbphy@8007c000 {
441 compatible = "fsl,imx23-usbphy";
418 reg = <0x8007c000 0x2000>; 442 reg = <0x8007c000 0x2000>;
443 clocks = <&clks 41>;
419 status = "disabled"; 444 status = "disabled";
420 }; 445 };
421 }; 446 };
@@ -428,8 +453,12 @@
428 reg = <0x80080000 0x80000>; 453 reg = <0x80080000 0x80000>;
429 ranges; 454 ranges;
430 455
431 usbctrl@80080000 { 456 usb0: usb@80080000 {
457 compatible = "fsl,imx23-usb", "fsl,imx27-usb";
432 reg = <0x80080000 0x40000>; 458 reg = <0x80080000 0x40000>;
459 interrupts = <11>;
460 fsl,usbphy = <&usbphy0>;
461 clocks = <&clks 40>;
433 status = "disabled"; 462 status = "disabled";
434 }; 463 };
435 }; 464 };
diff --git a/arch/arm/boot/dts/imx27-phytec-phycore.dts b/arch/arm/boot/dts/imx27-phytec-phycore.dts
index 2b0ff60247a..af50469e34b 100644
--- a/arch/arm/boot/dts/imx27-phytec-phycore.dts
+++ b/arch/arm/boot/dts/imx27-phytec-phycore.dts
@@ -23,10 +23,6 @@
23 soc { 23 soc {
24 aipi@10000000 { /* aipi */ 24 aipi@10000000 { /* aipi */
25 25
26 wdog@10002000 {
27 status = "okay";
28 };
29
30 serial@1000a000 { 26 serial@1000a000 {
31 fsl,uart-has-rtscts; 27 fsl,uart-has-rtscts;
32 status = "okay"; 28 status = "okay";
@@ -49,7 +45,7 @@
49 i2c@1001d000 { 45 i2c@1001d000 {
50 clock-frequency = <400000>; 46 clock-frequency = <400000>;
51 status = "okay"; 47 status = "okay";
52 at24@4c { 48 at24@52 {
53 compatible = "at,24c32"; 49 compatible = "at,24c32";
54 pagesize = <32>; 50 pagesize = <32>;
55 reg = <0x52>; 51 reg = <0x52>;
diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index 5303ab680a3..3e54f149884 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -62,7 +62,6 @@
62 compatible = "fsl,imx27-wdt", "fsl,imx21-wdt"; 62 compatible = "fsl,imx27-wdt", "fsl,imx21-wdt";
63 reg = <0x10002000 0x4000>; 63 reg = <0x10002000 0x4000>;
64 interrupts = <27>; 64 interrupts = <27>;
65 status = "disabled";
66 }; 65 };
67 66
68 uart1: serial@1000a000 { 67 uart1: serial@1000a000 {
diff --git a/arch/arm/boot/dts/imx28-apx4devkit.dts b/arch/arm/boot/dts/imx28-apx4devkit.dts
index b383417a558..5171667a776 100644
--- a/arch/arm/boot/dts/imx28-apx4devkit.dts
+++ b/arch/arm/boot/dts/imx28-apx4devkit.dts
@@ -37,7 +37,7 @@
37 pinctrl-names = "default"; 37 pinctrl-names = "default";
38 pinctrl-0 = <&hog_pins_a>; 38 pinctrl-0 = <&hog_pins_a>;
39 39
40 hog_pins_a: hog-gpios@0 { 40 hog_pins_a: hog@0 {
41 reg = <0>; 41 reg = <0>;
42 fsl,pinmux-ids = < 42 fsl,pinmux-ids = <
43 0x0113 /* MX28_PAD_GPMI_CE1N__GPIO_0_17 */ 43 0x0113 /* MX28_PAD_GPMI_CE1N__GPIO_0_17 */
diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts
new file mode 100644
index 00000000000..05c892e931e
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-cfa10049.dts
@@ -0,0 +1,99 @@
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-10049 Board";
20 compatible = "crystalfontz,cfa10049", "crystalfontz,cfa10036", "fsl,imx28";
21
22 apb@80000000 {
23 apbh@80000000 {
24 pinctrl@80018000 {
25 spi3_pins_cfa10049: spi3-cfa10049@0 {
26 reg = <0>;
27 fsl,pinmux-ids = <
28 0x0181 /* MX28_PAD_GPMI_RDN__SSP3_SCK */
29 0x01c1 /* MX28_PAD_GPMI_RESETN__SSP3_CMD */
30 0x0111 /* MX28_PAD_GPMI_CE1N__SSP3_D3 */
31 0x01a2 /* MX28_PAD_GPMI_ALE__SSP3_D4 */
32 >;
33 fsl,drive-strength = <1>;
34 fsl,voltage = <1>;
35 fsl,pull-up = <1>;
36 };
37 };
38
39 ssp3: ssp@80016000 {
40 compatible = "fsl,imx28-spi";
41 pinctrl-names = "default";
42 pinctrl-0 = <&spi3_pins_cfa10049>;
43 status = "okay";
44
45 gpio5: gpio5@0 {
46 compatible = "fairchild,74hc595";
47 gpio-controller;
48 #gpio-cells = <2>;
49 reg = <0>;
50 registers-number = <2>;
51 spi-max-frequency = <100000>;
52 };
53
54 gpio6: gpio6@1 {
55 compatible = "fairchild,74hc595";
56 gpio-controller;
57 #gpio-cells = <2>;
58 reg = <1>;
59 registers-number = <4>;
60 spi-max-frequency = <100000>;
61 };
62
63 };
64 };
65
66 apbx@80040000 {
67 i2c1: i2c@8005a000 {
68 pinctrl-names = "default";
69 pinctrl-0 = <&i2c1_pins_a>;
70 status = "okay";
71 };
72
73 usbphy1: usbphy@8007e000 {
74 status = "okay";
75 };
76 };
77 };
78
79 ahb@80080000 {
80 usb1: usb@80090000 {
81 vbus-supply = <&reg_usb1_vbus>;
82 pinctrl-0 = <&usbphy1_pins_a>;
83 pinctrl-names = "default";
84 status = "okay";
85 };
86 };
87
88 regulators {
89 compatible = "simple-bus";
90
91 reg_usb1_vbus: usb1_vbus {
92 compatible = "regulator-fixed";
93 regulator-name = "usb1_vbus";
94 regulator-min-microvolt = <5000000>;
95 regulator-max-microvolt = <5000000>;
96 gpio = <&gpio0 7 1>;
97 };
98 };
99};
diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
index 773c0e84d1f..a0ad71ca3a4 100644
--- a/arch/arm/boot/dts/imx28-evk.dts
+++ b/arch/arm/boot/dts/imx28-evk.dts
@@ -46,11 +46,28 @@
46 wp-gpios = <&gpio0 28 0>; 46 wp-gpios = <&gpio0 28 0>;
47 }; 47 };
48 48
49 ssp2: ssp@80014000 {
50 #address-cells = <1>;
51 #size-cells = <0>;
52 compatible = "fsl,imx28-spi";
53 pinctrl-names = "default";
54 pinctrl-0 = <&spi2_pins_a>;
55 status = "okay";
56
57 flash: m25p80@0 {
58 #address-cells = <1>;
59 #size-cells = <1>;
60 compatible = "sst,sst25vf016b";
61 spi-max-frequency = <40000000>;
62 reg = <0>;
63 };
64 };
65
49 pinctrl@80018000 { 66 pinctrl@80018000 {
50 pinctrl-names = "default"; 67 pinctrl-names = "default";
51 pinctrl-0 = <&hog_pins_a>; 68 pinctrl-0 = <&hog_pins_a>;
52 69
53 hog_pins_a: hog-gpios@0 { 70 hog_pins_a: hog@0 {
54 reg = <0>; 71 reg = <0>;
55 fsl,pinmux-ids = < 72 fsl,pinmux-ids = <
56 0x20d3 /* MX28_PAD_SSP1_CMD__GPIO_2_13 */ 73 0x20d3 /* MX28_PAD_SSP1_CMD__GPIO_2_13 */
@@ -128,6 +145,10 @@
128 status = "okay"; 145 status = "okay";
129 }; 146 };
130 147
148 lradc@80050000 {
149 status = "okay";
150 };
151
131 i2c0: i2c@80058000 { 152 i2c0: i2c@80058000 {
132 pinctrl-names = "default"; 153 pinctrl-names = "default";
133 pinctrl-0 = <&i2c0_pins_a>; 154 pinctrl-0 = <&i2c0_pins_a>;
@@ -140,6 +161,12 @@
140 VDDIO-supply = <&reg_3p3v>; 161 VDDIO-supply = <&reg_3p3v>;
141 162
142 }; 163 };
164
165 at24@51 {
166 compatible = "at24,24c32";
167 pagesize = <32>;
168 reg = <0x51>;
169 };
143 }; 170 };
144 171
145 pwm: pwm@80064000 { 172 pwm: pwm@80064000 {
diff --git a/arch/arm/boot/dts/imx28-m28evk.dts b/arch/arm/boot/dts/imx28-m28evk.dts
index 183a3fd2d85..3bab6b00c52 100644
--- a/arch/arm/boot/dts/imx28-m28evk.dts
+++ b/arch/arm/boot/dts/imx28-m28evk.dts
@@ -23,6 +23,8 @@
23 apb@80000000 { 23 apb@80000000 {
24 apbh@80000000 { 24 apbh@80000000 {
25 gpmi-nand@8000c000 { 25 gpmi-nand@8000c000 {
26 #address-cells = <1>;
27 #size-cells = <1>;
26 pinctrl-names = "default"; 28 pinctrl-names = "default";
27 pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>; 29 pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
28 status = "okay"; 30 status = "okay";
@@ -61,19 +63,40 @@
61 &mmc0_cd_cfg 63 &mmc0_cd_cfg
62 &mmc0_sck_cfg>; 64 &mmc0_sck_cfg>;
63 bus-width = <8>; 65 bus-width = <8>;
64 wp-gpios = <&gpio3 10 1>; 66 wp-gpios = <&gpio3 10 0>;
67 vmmc-supply = <&reg_vddio_sd0>;
65 status = "okay"; 68 status = "okay";
66 }; 69 };
67 70
71 ssp2: ssp@80014000 {
72 #address-cells = <1>;
73 #size-cells = <0>;
74 compatible = "fsl,imx28-spi";
75 pinctrl-names = "default";
76 pinctrl-0 = <&spi2_pins_a>;
77 status = "okay";
78
79 flash: m25p80@0 {
80 #address-cells = <1>;
81 #size-cells = <1>;
82 compatible = "m25p80";
83 spi-max-frequency = <40000000>;
84 reg = <0>;
85 };
86 };
87
68 pinctrl@80018000 { 88 pinctrl@80018000 {
69 pinctrl-names = "default"; 89 pinctrl-names = "default";
70 pinctrl-0 = <&hog_pins_a>; 90 pinctrl-0 = <&hog_pins_a>;
71 91
72 hog_pins_a: hog-gpios@0 { 92 hog_pins_a: hog@0 {
73 reg = <0>; 93 reg = <0>;
74 fsl,pinmux-ids = < 94 fsl,pinmux-ids = <
95 0x31c3 /* MX28_PAD_PWM3__GPIO_3_28 */
75 0x30a3 /* MX28_PAD_AUART2_CTS__GPIO_3_10 */ 96 0x30a3 /* MX28_PAD_AUART2_CTS__GPIO_3_10 */
76 0x30b3 /* MX28_PAD_AUART2_RTS__GPIO_3_11 */ 97 0x30b3 /* MX28_PAD_AUART2_RTS__GPIO_3_11 */
98 0x30c3 /* MX28_PAD_AUART3_RX__GPIO_3_12 */
99 0x30d3 /* MX28_PAD_AUART3_TX__GPIO_3_13 */
77 >; 100 >;
78 fsl,drive-strength = <0>; 101 fsl,drive-strength = <0>;
79 fsl,voltage = <1>; 102 fsl,voltage = <1>;
@@ -129,6 +152,7 @@
129 i2c0: i2c@80058000 { 152 i2c0: i2c@80058000 {
130 pinctrl-names = "default"; 153 pinctrl-names = "default";
131 pinctrl-0 = <&i2c0_pins_a>; 154 pinctrl-0 = <&i2c0_pins_a>;
155 clock-frequency = <400000>;
132 status = "okay"; 156 status = "okay";
133 157
134 sgtl5000: codec@0a { 158 sgtl5000: codec@0a {
@@ -151,32 +175,51 @@
151 }; 175 };
152 }; 176 };
153 177
178 lradc@80050000 {
179 status = "okay";
180 };
181
154 duart: serial@80074000 { 182 duart: serial@80074000 {
155 pinctrl-names = "default"; 183 pinctrl-names = "default";
156 pinctrl-0 = <&duart_pins_a>; 184 pinctrl-0 = <&duart_pins_a>;
157 status = "okay"; 185 status = "okay";
158 }; 186 };
159 187
160 auart0: serial@8006a000 { 188 usbphy0: usbphy@8007c000 {
161 pinctrl-names = "default";
162 pinctrl-0 = <&auart0_2pins_a>;
163 status = "okay"; 189 status = "okay";
164 }; 190 };
165 191
166 auart3: serial@80070000 { 192 usbphy1: usbphy@8007e000 {
193 status = "okay";
194 };
195
196 auart0: serial@8006a000 {
167 pinctrl-names = "default"; 197 pinctrl-names = "default";
168 pinctrl-0 = <&auart3_pins_a>; 198 pinctrl-0 = <&auart0_2pins_a>;
169 status = "okay"; 199 status = "okay";
170 }; 200 };
171 }; 201 };
172 }; 202 };
173 203
174 ahb@80080000 { 204 ahb@80080000 {
205 usb0: usb@80080000 {
206 vbus-supply = <&reg_usb0_vbus>;
207 pinctrl-names = "default";
208 pinctrl-0 = <&usbphy0_pins_a>;
209 status = "okay";
210 };
211
212 usb1: usb@80090000 {
213 vbus-supply = <&reg_usb1_vbus>;
214 pinctrl-names = "default";
215 pinctrl-0 = <&usbphy1_pins_a>;
216 status = "okay";
217 };
218
175 mac0: ethernet@800f0000 { 219 mac0: ethernet@800f0000 {
176 phy-mode = "rmii"; 220 phy-mode = "rmii";
177 pinctrl-names = "default"; 221 pinctrl-names = "default";
178 pinctrl-0 = <&mac0_pins_a>; 222 pinctrl-0 = <&mac0_pins_a>;
179 phy-reset-gpios = <&gpio3 11 0>;
180 status = "okay"; 223 status = "okay";
181 }; 224 };
182 225
@@ -198,6 +241,30 @@
198 regulator-max-microvolt = <3300000>; 241 regulator-max-microvolt = <3300000>;
199 regulator-always-on; 242 regulator-always-on;
200 }; 243 };
244
245 reg_vddio_sd0: vddio-sd0 {
246 compatible = "regulator-fixed";
247 regulator-name = "vddio-sd0";
248 regulator-min-microvolt = <3300000>;
249 regulator-max-microvolt = <3300000>;
250 gpio = <&gpio3 28 0>;
251 };
252
253 reg_usb0_vbus: usb0_vbus {
254 compatible = "regulator-fixed";
255 regulator-name = "usb0_vbus";
256 regulator-min-microvolt = <5000000>;
257 regulator-max-microvolt = <5000000>;
258 gpio = <&gpio3 12 0>;
259 };
260
261 reg_usb1_vbus: usb1_vbus {
262 compatible = "regulator-fixed";
263 regulator-name = "usb1_vbus";
264 regulator-min-microvolt = <5000000>;
265 regulator-max-microvolt = <5000000>;
266 gpio = <&gpio3 13 0>;
267 };
201 }; 268 };
202 269
203 sound { 270 sound {
diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index 62bf767409a..37be532f005 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -25,7 +25,7 @@
25 pinctrl-names = "default"; 25 pinctrl-names = "default";
26 pinctrl-0 = <&hog_pins_a>; 26 pinctrl-0 = <&hog_pins_a>;
27 27
28 hog_pins_a: hog-gpios@0 { 28 hog_pins_a: hog@0 {
29 reg = <0>; 29 reg = <0>;
30 fsl,pinmux-ids = < 30 fsl,pinmux-ids = <
31 0x40a3 /* MX28_PAD_ENET0_RXD3__GPIO_4_10 */ 31 0x40a3 /* MX28_PAD_ENET0_RXD3__GPIO_4_10 */
@@ -34,6 +34,24 @@
34 fsl,voltage = <1>; 34 fsl,voltage = <1>;
35 fsl,pull-up = <0>; 35 fsl,pull-up = <0>;
36 }; 36 };
37
38 mac0_pins_gpio: mac0-gpio-mode@0 {
39 reg = <0>;
40 fsl,pinmux-ids = <
41 0x4003 /* MX28_PAD_ENET0_MDC__GPIO_4_0 */
42 0x4013 /* MX28_PAD_ENET0_MDIO__GPIO_4_1 */
43 0x4023 /* MX28_PAD_ENET0_RX_EN__GPIO_4_2 */
44 0x4033 /* MX28_PAD_ENET0_RXD0__GPIO_4_3 */
45 0x4043 /* MX28_PAD_ENET0_RXD1__GPIO_4_4 */
46 0x4063 /* MX28_PAD_ENET0_TX_EN__GPIO_4_6 */
47 0x4073 /* MX28_PAD_ENET0_TXD0__GPIO_4_7 */
48 0x4083 /* MX28_PAD_ENET0_TXD1__GPIO_4_8 */
49 0x4103 /* MX28_PAD_ENET_CLK__GPIO_4_16 */
50 >;
51 fsl,drive-strength = <0>;
52 fsl,voltage = <1>;
53 fsl,pull-up = <0>;
54 };
37 }; 55 };
38 }; 56 };
39 57
@@ -72,8 +90,9 @@
72 ahb@80080000 { 90 ahb@80080000 {
73 mac0: ethernet@800f0000 { 91 mac0: ethernet@800f0000 {
74 phy-mode = "rmii"; 92 phy-mode = "rmii";
75 pinctrl-names = "default"; 93 pinctrl-names = "default", "gpio_mode";
76 pinctrl-0 = <&mac0_pins_a>; 94 pinctrl-0 = <&mac0_pins_a>;
95 pinctrl-1 = <&mac0_pins_gpio>;
77 status = "okay"; 96 status = "okay";
78 }; 97 };
79 }; 98 };
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 3fa6d190fab..e16d6315548 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -27,6 +27,8 @@
27 serial2 = &auart2; 27 serial2 = &auart2;
28 serial3 = &auart3; 28 serial3 = &auart3;
29 serial4 = &auart4; 29 serial4 = &auart4;
30 ethernet0 = &mac0;
31 ethernet1 = &mac1;
30 }; 32 };
31 33
32 cpus { 34 cpus {
@@ -50,7 +52,7 @@
50 ranges; 52 ranges;
51 53
52 icoll: interrupt-controller@80000000 { 54 icoll: interrupt-controller@80000000 {
53 compatible = "fsl,imx28-icoll", "fsl,mxs-icoll"; 55 compatible = "fsl,imx28-icoll", "fsl,icoll";
54 interrupt-controller; 56 interrupt-controller;
55 #interrupt-cells = <1>; 57 #interrupt-cells = <1>;
56 reg = <0x80000000 0x2000>; 58 reg = <0x80000000 0x2000>;
@@ -65,6 +67,7 @@
65 dma-apbh@80004000 { 67 dma-apbh@80004000 {
66 compatible = "fsl,imx28-dma-apbh"; 68 compatible = "fsl,imx28-dma-apbh";
67 reg = <0x80004000 0x2000>; 69 reg = <0x80004000 0x2000>;
70 clocks = <&clks 25>;
68 }; 71 };
69 72
70 perfmon@80006000 { 73 perfmon@80006000 {
@@ -81,34 +84,47 @@
81 reg-names = "gpmi-nand", "bch"; 84 reg-names = "gpmi-nand", "bch";
82 interrupts = <88>, <41>; 85 interrupts = <88>, <41>;
83 interrupt-names = "gpmi-dma", "bch"; 86 interrupt-names = "gpmi-dma", "bch";
87 clocks = <&clks 50>;
84 fsl,gpmi-dma-channel = <4>; 88 fsl,gpmi-dma-channel = <4>;
85 status = "disabled"; 89 status = "disabled";
86 }; 90 };
87 91
88 ssp0: ssp@80010000 { 92 ssp0: ssp@80010000 {
93 #address-cells = <1>;
94 #size-cells = <0>;
89 reg = <0x80010000 0x2000>; 95 reg = <0x80010000 0x2000>;
90 interrupts = <96 82>; 96 interrupts = <96 82>;
97 clocks = <&clks 46>;
91 fsl,ssp-dma-channel = <0>; 98 fsl,ssp-dma-channel = <0>;
92 status = "disabled"; 99 status = "disabled";
93 }; 100 };
94 101
95 ssp1: ssp@80012000 { 102 ssp1: ssp@80012000 {
103 #address-cells = <1>;
104 #size-cells = <0>;
96 reg = <0x80012000 0x2000>; 105 reg = <0x80012000 0x2000>;
97 interrupts = <97 83>; 106 interrupts = <97 83>;
107 clocks = <&clks 47>;
98 fsl,ssp-dma-channel = <1>; 108 fsl,ssp-dma-channel = <1>;
99 status = "disabled"; 109 status = "disabled";
100 }; 110 };
101 111
102 ssp2: ssp@80014000 { 112 ssp2: ssp@80014000 {
113 #address-cells = <1>;
114 #size-cells = <0>;
103 reg = <0x80014000 0x2000>; 115 reg = <0x80014000 0x2000>;
104 interrupts = <98 84>; 116 interrupts = <98 84>;
117 clocks = <&clks 48>;
105 fsl,ssp-dma-channel = <2>; 118 fsl,ssp-dma-channel = <2>;
106 status = "disabled"; 119 status = "disabled";
107 }; 120 };
108 121
109 ssp3: ssp@80016000 { 122 ssp3: ssp@80016000 {
123 #address-cells = <1>;
124 #size-cells = <0>;
110 reg = <0x80016000 0x2000>; 125 reg = <0x80016000 0x2000>;
111 interrupts = <99 85>; 126 interrupts = <99 85>;
127 clocks = <&clks 49>;
112 fsl,ssp-dma-channel = <3>; 128 fsl,ssp-dma-channel = <3>;
113 status = "disabled"; 129 status = "disabled";
114 }; 130 };
@@ -410,6 +426,28 @@
410 fsl,pull-up = <1>; 426 fsl,pull-up = <1>;
411 }; 427 };
412 428
429 i2c0_pins_b: i2c0@1 {
430 reg = <1>;
431 fsl,pinmux-ids = <
432 0x3001 /* MX28_PAD_AUART0_RX__I2C0_SCL */
433 0x3011 /* MX28_PAD_AUART0_TX__I2C0_SDA */
434 >;
435 fsl,drive-strength = <1>;
436 fsl,voltage = <1>;
437 fsl,pull-up = <1>;
438 };
439
440 i2c1_pins_a: i2c1@0 {
441 reg = <0>;
442 fsl,pinmux-ids = <
443 0x3101 /* MX28_PAD_PWM0__I2C1_SCL */
444 0x3111 /* MX28_PAD_PWM1__I2C1_SDA */
445 >;
446 fsl,drive-strength = <1>;
447 fsl,voltage = <1>;
448 fsl,pull-up = <1>;
449 };
450
413 saif0_pins_a: saif0@0 { 451 saif0_pins_a: saif0@0 {
414 reg = <0>; 452 reg = <0>;
415 fsl,pinmux-ids = < 453 fsl,pinmux-ids = <
@@ -453,6 +491,16 @@
453 fsl,pull-up = <0>; 491 fsl,pull-up = <0>;
454 }; 492 };
455 493
494 pwm4_pins_a: pwm4@0 {
495 reg = <0>;
496 fsl,pinmux-ids = <
497 0x31d0 /* MX28_PAD_PWM4__PWM_4 */
498 >;
499 fsl,drive-strength = <0>;
500 fsl,voltage = <1>;
501 fsl,pull-up = <0>;
502 };
503
456 lcdif_24bit_pins_a: lcdif-24bit@0 { 504 lcdif_24bit_pins_a: lcdif-24bit@0 {
457 reg = <0>; 505 reg = <0>;
458 fsl,pinmux-ids = < 506 fsl,pinmux-ids = <
@@ -507,6 +555,49 @@
507 fsl,voltage = <1>; 555 fsl,voltage = <1>;
508 fsl,pull-up = <0>; 556 fsl,pull-up = <0>;
509 }; 557 };
558
559 spi2_pins_a: spi2@0 {
560 reg = <0>;
561 fsl,pinmux-ids = <
562 0x2100 /* MX28_PAD_SSP2_SCK__SSP2_SCK */
563 0x2110 /* MX28_PAD_SSP2_MOSI__SSP2_CMD */
564 0x2120 /* MX28_PAD_SSP2_MISO__SSP2_D0 */
565 0x2130 /* MX28_PAD_SSP2_SS0__SSP2_D3 */
566 >;
567 fsl,drive-strength = <1>;
568 fsl,voltage = <1>;
569 fsl,pull-up = <1>;
570 };
571
572 usbphy0_pins_a: usbphy0@0 {
573 reg = <0>;
574 fsl,pinmux-ids = <
575 0x2152 /* MX28_PAD_SSP2_SS2__USB0_OVERCURRENT */
576 >;
577 fsl,drive-strength = <2>;
578 fsl,voltage = <1>;
579 fsl,pull-up = <0>;
580 };
581
582 usbphy0_pins_b: usbphy0@1 {
583 reg = <1>;
584 fsl,pinmux-ids = <
585 0x3061 /* MX28_PAD_AUART1_CTS__USB0_OVERCURRENT */
586 >;
587 fsl,drive-strength = <2>;
588 fsl,voltage = <1>;
589 fsl,pull-up = <0>;
590 };
591
592 usbphy1_pins_a: usbphy1@0 {
593 reg = <0>;
594 fsl,pinmux-ids = <
595 0x2142 /* MX28_PAD_SSP2_SS1__USB1_OVERCURRENT */
596 >;
597 fsl,drive-strength = <2>;
598 fsl,voltage = <1>;
599 fsl,pull-up = <0>;
600 };
510 }; 601 };
511 602
512 digctl@8001c000 { 603 digctl@8001c000 {
@@ -523,6 +614,7 @@
523 dma-apbx@80024000 { 614 dma-apbx@80024000 {
524 compatible = "fsl,imx28-dma-apbx"; 615 compatible = "fsl,imx28-dma-apbx";
525 reg = <0x80024000 0x2000>; 616 reg = <0x80024000 0x2000>;
617 clocks = <&clks 26>;
526 }; 618 };
527 619
528 dcp@80028000 { 620 dcp@80028000 {
@@ -551,6 +643,7 @@
551 compatible = "fsl,imx28-lcdif"; 643 compatible = "fsl,imx28-lcdif";
552 reg = <0x80030000 0x2000>; 644 reg = <0x80030000 0x2000>;
553 interrupts = <38 86>; 645 interrupts = <38 86>;
646 clocks = <&clks 55>;
554 status = "disabled"; 647 status = "disabled";
555 }; 648 };
556 649
@@ -558,6 +651,8 @@
558 compatible = "fsl,imx28-flexcan", "fsl,p1010-flexcan"; 651 compatible = "fsl,imx28-flexcan", "fsl,p1010-flexcan";
559 reg = <0x80032000 0x2000>; 652 reg = <0x80032000 0x2000>;
560 interrupts = <8>; 653 interrupts = <8>;
654 clocks = <&clks 58>, <&clks 58>;
655 clock-names = "ipg", "per";
561 status = "disabled"; 656 status = "disabled";
562 }; 657 };
563 658
@@ -565,6 +660,8 @@
565 compatible = "fsl,imx28-flexcan", "fsl,p1010-flexcan"; 660 compatible = "fsl,imx28-flexcan", "fsl,p1010-flexcan";
566 reg = <0x80034000 0x2000>; 661 reg = <0x80034000 0x2000>;
567 interrupts = <9>; 662 interrupts = <9>;
663 clocks = <&clks 59>, <&clks 59>;
664 clock-names = "ipg", "per";
568 status = "disabled"; 665 status = "disabled";
569 }; 666 };
570 667
@@ -611,15 +708,17 @@
611 reg = <0x80040000 0x40000>; 708 reg = <0x80040000 0x40000>;
612 ranges; 709 ranges;
613 710
614 clkctl@80040000 { 711 clks: clkctrl@80040000 {
712 compatible = "fsl,imx28-clkctrl";
615 reg = <0x80040000 0x2000>; 713 reg = <0x80040000 0x2000>;
616 status = "disabled"; 714 #clock-cells = <1>;
617 }; 715 };
618 716
619 saif0: saif@80042000 { 717 saif0: saif@80042000 {
620 compatible = "fsl,imx28-saif"; 718 compatible = "fsl,imx28-saif";
621 reg = <0x80042000 0x2000>; 719 reg = <0x80042000 0x2000>;
622 interrupts = <59 80>; 720 interrupts = <59 80>;
721 clocks = <&clks 53>;
623 fsl,saif-dma-channel = <4>; 722 fsl,saif-dma-channel = <4>;
624 status = "disabled"; 723 status = "disabled";
625 }; 724 };
@@ -633,12 +732,16 @@
633 compatible = "fsl,imx28-saif"; 732 compatible = "fsl,imx28-saif";
634 reg = <0x80046000 0x2000>; 733 reg = <0x80046000 0x2000>;
635 interrupts = <58 81>; 734 interrupts = <58 81>;
735 clocks = <&clks 54>;
636 fsl,saif-dma-channel = <5>; 736 fsl,saif-dma-channel = <5>;
637 status = "disabled"; 737 status = "disabled";
638 }; 738 };
639 739
640 lradc@80050000 { 740 lradc@80050000 {
741 compatible = "fsl,imx28-lradc";
641 reg = <0x80050000 0x2000>; 742 reg = <0x80050000 0x2000>;
743 interrupts = <10 14 15 16 17 18 19
744 20 21 22 23 24 25>;
642 status = "disabled"; 745 status = "disabled";
643 }; 746 };
644 747
@@ -661,6 +764,7 @@
661 reg = <0x80058000 0x2000>; 764 reg = <0x80058000 0x2000>;
662 interrupts = <111 68>; 765 interrupts = <111 68>;
663 clock-frequency = <100000>; 766 clock-frequency = <100000>;
767 fsl,i2c-dma-channel = <6>;
664 status = "disabled"; 768 status = "disabled";
665 }; 769 };
666 770
@@ -671,26 +775,30 @@
671 reg = <0x8005a000 0x2000>; 775 reg = <0x8005a000 0x2000>;
672 interrupts = <110 69>; 776 interrupts = <110 69>;
673 clock-frequency = <100000>; 777 clock-frequency = <100000>;
778 fsl,i2c-dma-channel = <7>;
674 status = "disabled"; 779 status = "disabled";
675 }; 780 };
676 781
677 pwm: pwm@80064000 { 782 pwm: pwm@80064000 {
678 compatible = "fsl,imx28-pwm", "fsl,imx23-pwm"; 783 compatible = "fsl,imx28-pwm", "fsl,imx23-pwm";
679 reg = <0x80064000 0x2000>; 784 reg = <0x80064000 0x2000>;
785 clocks = <&clks 44>;
680 #pwm-cells = <2>; 786 #pwm-cells = <2>;
681 fsl,pwm-number = <8>; 787 fsl,pwm-number = <8>;
682 status = "disabled"; 788 status = "disabled";
683 }; 789 };
684 790
685 timrot@80068000 { 791 timrot@80068000 {
792 compatible = "fsl,imx28-timrot", "fsl,timrot";
686 reg = <0x80068000 0x2000>; 793 reg = <0x80068000 0x2000>;
687 status = "disabled"; 794 interrupts = <48 49 50 51>;
688 }; 795 };
689 796
690 auart0: serial@8006a000 { 797 auart0: serial@8006a000 {
691 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 798 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
692 reg = <0x8006a000 0x2000>; 799 reg = <0x8006a000 0x2000>;
693 interrupts = <112 70 71>; 800 interrupts = <112 70 71>;
801 clocks = <&clks 45>;
694 status = "disabled"; 802 status = "disabled";
695 }; 803 };
696 804
@@ -698,6 +806,7 @@
698 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 806 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
699 reg = <0x8006c000 0x2000>; 807 reg = <0x8006c000 0x2000>;
700 interrupts = <113 72 73>; 808 interrupts = <113 72 73>;
809 clocks = <&clks 45>;
701 status = "disabled"; 810 status = "disabled";
702 }; 811 };
703 812
@@ -705,6 +814,7 @@
705 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 814 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
706 reg = <0x8006e000 0x2000>; 815 reg = <0x8006e000 0x2000>;
707 interrupts = <114 74 75>; 816 interrupts = <114 74 75>;
817 clocks = <&clks 45>;
708 status = "disabled"; 818 status = "disabled";
709 }; 819 };
710 820
@@ -712,6 +822,7 @@
712 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 822 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
713 reg = <0x80070000 0x2000>; 823 reg = <0x80070000 0x2000>;
714 interrupts = <115 76 77>; 824 interrupts = <115 76 77>;
825 clocks = <&clks 45>;
715 status = "disabled"; 826 status = "disabled";
716 }; 827 };
717 828
@@ -719,6 +830,7 @@
719 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 830 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
720 reg = <0x80072000 0x2000>; 831 reg = <0x80072000 0x2000>;
721 interrupts = <116 78 79>; 832 interrupts = <116 78 79>;
833 clocks = <&clks 45>;
722 status = "disabled"; 834 status = "disabled";
723 }; 835 };
724 836
@@ -726,18 +838,22 @@
726 compatible = "arm,pl011", "arm,primecell"; 838 compatible = "arm,pl011", "arm,primecell";
727 reg = <0x80074000 0x1000>; 839 reg = <0x80074000 0x1000>;
728 interrupts = <47>; 840 interrupts = <47>;
841 clocks = <&clks 45>, <&clks 26>;
842 clock-names = "uart", "apb_pclk";
729 status = "disabled"; 843 status = "disabled";
730 }; 844 };
731 845
732 usbphy0: usbphy@8007c000 { 846 usbphy0: usbphy@8007c000 {
733 compatible = "fsl,imx28-usbphy", "fsl,imx23-usbphy"; 847 compatible = "fsl,imx28-usbphy", "fsl,imx23-usbphy";
734 reg = <0x8007c000 0x2000>; 848 reg = <0x8007c000 0x2000>;
849 clocks = <&clks 62>;
735 status = "disabled"; 850 status = "disabled";
736 }; 851 };
737 852
738 usbphy1: usbphy@8007e000 { 853 usbphy1: usbphy@8007e000 {
739 compatible = "fsl,imx28-usbphy", "fsl,imx23-usbphy"; 854 compatible = "fsl,imx28-usbphy", "fsl,imx23-usbphy";
740 reg = <0x8007e000 0x2000>; 855 reg = <0x8007e000 0x2000>;
856 clocks = <&clks 63>;
741 status = "disabled"; 857 status = "disabled";
742 }; 858 };
743 }; 859 };
@@ -754,6 +870,7 @@
754 compatible = "fsl,imx28-usb", "fsl,imx27-usb"; 870 compatible = "fsl,imx28-usb", "fsl,imx27-usb";
755 reg = <0x80080000 0x10000>; 871 reg = <0x80080000 0x10000>;
756 interrupts = <93>; 872 interrupts = <93>;
873 clocks = <&clks 60>;
757 fsl,usbphy = <&usbphy0>; 874 fsl,usbphy = <&usbphy0>;
758 status = "disabled"; 875 status = "disabled";
759 }; 876 };
@@ -762,6 +879,7 @@
762 compatible = "fsl,imx28-usb", "fsl,imx27-usb"; 879 compatible = "fsl,imx28-usb", "fsl,imx27-usb";
763 reg = <0x80090000 0x10000>; 880 reg = <0x80090000 0x10000>;
764 interrupts = <92>; 881 interrupts = <92>;
882 clocks = <&clks 61>;
765 fsl,usbphy = <&usbphy1>; 883 fsl,usbphy = <&usbphy1>;
766 status = "disabled"; 884 status = "disabled";
767 }; 885 };
@@ -775,6 +893,8 @@
775 compatible = "fsl,imx28-fec"; 893 compatible = "fsl,imx28-fec";
776 reg = <0x800f0000 0x4000>; 894 reg = <0x800f0000 0x4000>;
777 interrupts = <101>; 895 interrupts = <101>;
896 clocks = <&clks 57>, <&clks 57>;
897 clock-names = "ipg", "ahb";
778 status = "disabled"; 898 status = "disabled";
779 }; 899 };
780 900
@@ -782,6 +902,8 @@
782 compatible = "fsl,imx28-fec"; 902 compatible = "fsl,imx28-fec";
783 reg = <0x800f4000 0x4000>; 903 reg = <0x800f4000 0x4000>;
784 interrupts = <102>; 904 interrupts = <102>;
905 clocks = <&clks 57>, <&clks 57>;
906 clock-names = "ipg", "ahb";
785 status = "disabled"; 907 status = "disabled";
786 }; 908 };
787 909
diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts
index 59d9789e550..cbd2b1c7487 100644
--- a/arch/arm/boot/dts/imx51-babbage.dts
+++ b/arch/arm/boot/dts/imx51-babbage.dts
@@ -25,23 +25,31 @@
25 aips@70000000 { /* aips-1 */ 25 aips@70000000 { /* aips-1 */
26 spba@70000000 { 26 spba@70000000 {
27 esdhc@70004000 { /* ESDHC1 */ 27 esdhc@70004000 { /* ESDHC1 */
28 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_esdhc1_1>;
28 fsl,cd-controller; 30 fsl,cd-controller;
29 fsl,wp-controller; 31 fsl,wp-controller;
30 status = "okay"; 32 status = "okay";
31 }; 33 };
32 34
33 esdhc@70008000 { /* ESDHC2 */ 35 esdhc@70008000 { /* ESDHC2 */
36 pinctrl-names = "default";
37 pinctrl-0 = <&pinctrl_esdhc2_1>;
34 cd-gpios = <&gpio1 6 0>; 38 cd-gpios = <&gpio1 6 0>;
35 wp-gpios = <&gpio1 5 0>; 39 wp-gpios = <&gpio1 5 0>;
36 status = "okay"; 40 status = "okay";
37 }; 41 };
38 42
39 uart3: serial@7000c000 { 43 uart3: serial@7000c000 {
44 pinctrl-names = "default";
45 pinctrl-0 = <&pinctrl_uart3_1>;
40 fsl,uart-has-rtscts; 46 fsl,uart-has-rtscts;
41 status = "okay"; 47 status = "okay";
42 }; 48 };
43 49
44 ecspi@70010000 { /* ECSPI1 */ 50 ecspi@70010000 { /* ECSPI1 */
51 pinctrl-names = "default";
52 pinctrl-0 = <&pinctrl_ecspi1_1>;
45 fsl,spi-num-chipselects = <2>; 53 fsl,spi-num-chipselects = <2>;
46 cs-gpios = <&gpio4 24 0>, <&gpio4 25 0>; 54 cs-gpios = <&gpio4 24 0>, <&gpio4 25 0>;
47 status = "okay"; 55 status = "okay";
@@ -169,31 +177,43 @@
169 }; 177 };
170 }; 178 };
171 179
172 wdog@73f98000 { /* WDOG1 */
173 status = "okay";
174 };
175
176 iomuxc@73fa8000 { 180 iomuxc@73fa8000 {
177 compatible = "fsl,imx51-iomuxc-babbage"; 181 pinctrl-names = "default";
178 reg = <0x73fa8000 0x4000>; 182 pinctrl-0 = <&pinctrl_hog>;
183
184 hog {
185 pinctrl_hog: hoggrp {
186 fsl,pins = <
187 694 0x20d5 /* MX51_PAD_GPIO1_0__SD1_CD */
188 697 0x20d5 /* MX51_PAD_GPIO1_1__SD1_WP */
189 737 0x100 /* MX51_PAD_GPIO1_5__GPIO1_5 */
190 740 0x100 /* MX51_PAD_GPIO1_6__GPIO1_6 */
191 121 0x5 /* MX51_PAD_EIM_A27__GPIO2_21 */
192 402 0x85 /* MX51_PAD_CSPI1_SS0__GPIO4_24 */
193 405 0x85 /* MX51_PAD_CSPI1_SS1__GPIO4_25 */
194 >;
195 };
196 };
179 }; 197 };
180 198
181 uart1: serial@73fbc000 { 199 uart1: serial@73fbc000 {
200 pinctrl-names = "default";
201 pinctrl-0 = <&pinctrl_uart1_1>;
182 fsl,uart-has-rtscts; 202 fsl,uart-has-rtscts;
183 status = "okay"; 203 status = "okay";
184 }; 204 };
185 205
186 uart2: serial@73fc0000 { 206 uart2: serial@73fc0000 {
207 pinctrl-names = "default";
208 pinctrl-0 = <&pinctrl_uart2_1>;
187 status = "okay"; 209 status = "okay";
188 }; 210 };
189 }; 211 };
190 212
191 aips@80000000 { /* aips-2 */ 213 aips@80000000 { /* aips-2 */
192 sdma@83fb0000 {
193 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx51.bin";
194 };
195
196 i2c@83fc4000 { /* I2C2 */ 214 i2c@83fc4000 { /* I2C2 */
215 pinctrl-names = "default";
216 pinctrl-0 = <&pinctrl_i2c2_1>;
197 status = "okay"; 217 status = "okay";
198 218
199 sgtl5000: codec@0a { 219 sgtl5000: codec@0a {
@@ -206,10 +226,14 @@
206 }; 226 };
207 227
208 audmux@83fd0000 { 228 audmux@83fd0000 {
229 pinctrl-names = "default";
230 pinctrl-0 = <&pinctrl_audmux_1>;
209 status = "okay"; 231 status = "okay";
210 }; 232 };
211 233
212 ethernet@83fec000 { 234 ethernet@83fec000 {
235 pinctrl-names = "default";
236 pinctrl-0 = <&pinctrl_fec_1>;
213 phy-mode = "mii"; 237 phy-mode = "mii";
214 status = "okay"; 238 status = "okay";
215 }; 239 };
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index aba28dc87fc..75d069fcf89 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -130,6 +130,34 @@
130 }; 130 };
131 }; 131 };
132 132
133 usb@73f80000 {
134 compatible = "fsl,imx51-usb", "fsl,imx27-usb";
135 reg = <0x73f80000 0x0200>;
136 interrupts = <18>;
137 status = "disabled";
138 };
139
140 usb@73f80200 {
141 compatible = "fsl,imx51-usb", "fsl,imx27-usb";
142 reg = <0x73f80200 0x0200>;
143 interrupts = <14>;
144 status = "disabled";
145 };
146
147 usb@73f80400 {
148 compatible = "fsl,imx51-usb", "fsl,imx27-usb";
149 reg = <0x73f80400 0x0200>;
150 interrupts = <16>;
151 status = "disabled";
152 };
153
154 usb@73f80600 {
155 compatible = "fsl,imx51-usb", "fsl,imx27-usb";
156 reg = <0x73f80600 0x0200>;
157 interrupts = <17>;
158 status = "disabled";
159 };
160
133 gpio1: gpio@73f84000 { 161 gpio1: gpio@73f84000 {
134 compatible = "fsl,imx51-gpio", "fsl,imx35-gpio"; 162 compatible = "fsl,imx51-gpio", "fsl,imx35-gpio";
135 reg = <0x73f84000 0x4000>; 163 reg = <0x73f84000 0x4000>;
@@ -174,7 +202,6 @@
174 compatible = "fsl,imx51-wdt", "fsl,imx21-wdt"; 202 compatible = "fsl,imx51-wdt", "fsl,imx21-wdt";
175 reg = <0x73f98000 0x4000>; 203 reg = <0x73f98000 0x4000>;
176 interrupts = <58>; 204 interrupts = <58>;
177 status = "disabled";
178 }; 205 };
179 206
180 wdog@73f9c000 { /* WDOG2 */ 207 wdog@73f9c000 { /* WDOG2 */
@@ -184,6 +211,122 @@
184 status = "disabled"; 211 status = "disabled";
185 }; 212 };
186 213
214 iomuxc@73fa8000 {
215 compatible = "fsl,imx51-iomuxc";
216 reg = <0x73fa8000 0x4000>;
217
218 audmux {
219 pinctrl_audmux_1: audmuxgrp-1 {
220 fsl,pins = <
221 384 0x80000000 /* MX51_PAD_AUD3_BB_TXD__AUD3_TXD */
222 386 0x80000000 /* MX51_PAD_AUD3_BB_RXD__AUD3_RXD */
223 389 0x80000000 /* MX51_PAD_AUD3_BB_CK__AUD3_TXC */
224 391 0x80000000 /* MX51_PAD_AUD3_BB_FS__AUD3_TXFS */
225 >;
226 };
227 };
228
229 fec {
230 pinctrl_fec_1: fecgrp-1 {
231 fsl,pins = <
232 128 0x80000000 /* MX51_PAD_EIM_EB2__FEC_MDIO */
233 134 0x80000000 /* MX51_PAD_EIM_EB3__FEC_RDATA1 */
234 146 0x80000000 /* MX51_PAD_EIM_CS2__FEC_RDATA2 */
235 152 0x80000000 /* MX51_PAD_EIM_CS3__FEC_RDATA3 */
236 158 0x80000000 /* MX51_PAD_EIM_CS4__FEC_RX_ER */
237 165 0x80000000 /* MX51_PAD_EIM_CS5__FEC_CRS */
238 206 0x80000000 /* MX51_PAD_NANDF_RB2__FEC_COL */
239 213 0x80000000 /* MX51_PAD_NANDF_RB3__FEC_RX_CLK */
240 293 0x80000000 /* MX51_PAD_NANDF_D9__FEC_RDATA0 */
241 298 0x80000000 /* MX51_PAD_NANDF_D8__FEC_TDATA0 */
242 225 0x80000000 /* MX51_PAD_NANDF_CS2__FEC_TX_ER */
243 231 0x80000000 /* MX51_PAD_NANDF_CS3__FEC_MDC */
244 237 0x80000000 /* MX51_PAD_NANDF_CS4__FEC_TDATA1 */
245 243 0x80000000 /* MX51_PAD_NANDF_CS5__FEC_TDATA2 */
246 250 0x80000000 /* MX51_PAD_NANDF_CS6__FEC_TDATA3 */
247 255 0x80000000 /* MX51_PAD_NANDF_CS7__FEC_TX_EN */
248 260 0x80000000 /* MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK */
249 >;
250 };
251 };
252
253 ecspi1 {
254 pinctrl_ecspi1_1: ecspi1grp-1 {
255 fsl,pins = <
256 398 0x185 /* MX51_PAD_CSPI1_MISO__ECSPI1_MISO */
257 394 0x185 /* MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI */
258 409 0x185 /* MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK */
259 >;
260 };
261 };
262
263 esdhc1 {
264 pinctrl_esdhc1_1: esdhc1grp-1 {
265 fsl,pins = <
266 666 0x400020d5 /* MX51_PAD_SD1_CMD__SD1_CMD */
267 669 0x20d5 /* MX51_PAD_SD1_CLK__SD1_CLK */
268 672 0x20d5 /* MX51_PAD_SD1_DATA0__SD1_DATA0 */
269 678 0x20d5 /* MX51_PAD_SD1_DATA1__SD1_DATA1 */
270 684 0x20d5 /* MX51_PAD_SD1_DATA2__SD1_DATA2 */
271 691 0x20d5 /* MX51_PAD_SD1_DATA3__SD1_DATA3 */
272 >;
273 };
274 };
275
276 esdhc2 {
277 pinctrl_esdhc2_1: esdhc2grp-1 {
278 fsl,pins = <
279 704 0x400020d5 /* MX51_PAD_SD2_CMD__SD2_CMD */
280 707 0x20d5 /* MX51_PAD_SD2_CLK__SD2_CLK */
281 710 0x20d5 /* MX51_PAD_SD2_DATA0__SD2_DATA0 */
282 712 0x20d5 /* MX51_PAD_SD2_DATA1__SD2_DATA1 */
283 715 0x20d5 /* MX51_PAD_SD2_DATA2__SD2_DATA2 */
284 719 0x20d5 /* MX51_PAD_SD2_DATA3__SD2_DATA3 */
285 >;
286 };
287 };
288
289 i2c2 {
290 pinctrl_i2c2_1: i2c2grp-1 {
291 fsl,pins = <
292 449 0x400001ed /* MX51_PAD_KEY_COL4__I2C2_SCL */
293 454 0x400001ed /* MX51_PAD_KEY_COL5__I2C2_SDA */
294 >;
295 };
296 };
297
298 uart1 {
299 pinctrl_uart1_1: uart1grp-1 {
300 fsl,pins = <
301 413 0x1c5 /* MX51_PAD_UART1_RXD__UART1_RXD */
302 416 0x1c5 /* MX51_PAD_UART1_TXD__UART1_TXD */
303 418 0x1c5 /* MX51_PAD_UART1_RTS__UART1_RTS */
304 420 0x1c5 /* MX51_PAD_UART1_CTS__UART1_CTS */
305 >;
306 };
307 };
308
309 uart2 {
310 pinctrl_uart2_1: uart2grp-1 {
311 fsl,pins = <
312 423 0x1c5 /* MX51_PAD_UART2_RXD__UART2_RXD */
313 426 0x1c5 /* MX51_PAD_UART2_TXD__UART2_TXD */
314 >;
315 };
316 };
317
318 uart3 {
319 pinctrl_uart3_1: uart3grp-1 {
320 fsl,pins = <
321 54 0x1c5 /* MX51_PAD_EIM_D25__UART3_RXD */
322 59 0x1c5 /* MX51_PAD_EIM_D26__UART3_TXD */
323 65 0x1c5 /* MX51_PAD_EIM_D27__UART3_RTS */
324 49 0x1c5 /* MX51_PAD_EIM_D24__UART3_CTS */
325 >;
326 };
327 };
328 };
329
187 uart1: serial@73fbc000 { 330 uart1: serial@73fbc000 {
188 compatible = "fsl,imx51-uart", "fsl,imx21-uart"; 331 compatible = "fsl,imx51-uart", "fsl,imx21-uart";
189 reg = <0x73fbc000 0x4000>; 332 reg = <0x73fbc000 0x4000>;
@@ -219,6 +362,7 @@
219 compatible = "fsl,imx51-sdma", "fsl,imx35-sdma"; 362 compatible = "fsl,imx51-sdma", "fsl,imx35-sdma";
220 reg = <0x83fb0000 0x4000>; 363 reg = <0x83fb0000 0x4000>;
221 interrupts = <6>; 364 interrupts = <6>;
365 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx51.bin";
222 }; 366 };
223 367
224 cspi@83fc0000 { 368 cspi@83fc0000 {
@@ -263,6 +407,13 @@
263 status = "disabled"; 407 status = "disabled";
264 }; 408 };
265 409
410 nand@83fdb000 {
411 compatible = "fsl,imx51-nand";
412 reg = <0x83fdb000 0x1000 0xcfff0000 0x10000>;
413 interrupts = <8>;
414 status = "disabled";
415 };
416
266 ssi3: ssi@83fe8000 { 417 ssi3: ssi@83fe8000 {
267 compatible = "fsl,imx51-ssi", "fsl,imx21-ssi"; 418 compatible = "fsl,imx51-ssi", "fsl,imx21-ssi";
268 reg = <0x83fe8000 0x4000>; 419 reg = <0x83fe8000 0x4000>;
diff --git a/arch/arm/boot/dts/imx53-ard.dts b/arch/arm/boot/dts/imx53-ard.dts
index da895e93a99..4be76f22352 100644
--- a/arch/arm/boot/dts/imx53-ard.dts
+++ b/arch/arm/boot/dts/imx53-ard.dts
@@ -25,31 +25,66 @@
25 aips@50000000 { /* AIPS1 */ 25 aips@50000000 { /* AIPS1 */
26 spba@50000000 { 26 spba@50000000 {
27 esdhc@50004000 { /* ESDHC1 */ 27 esdhc@50004000 { /* ESDHC1 */
28 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_esdhc1_2>;
28 cd-gpios = <&gpio1 1 0>; 30 cd-gpios = <&gpio1 1 0>;
29 wp-gpios = <&gpio1 9 0>; 31 wp-gpios = <&gpio1 9 0>;
30 status = "okay"; 32 status = "okay";
31 }; 33 };
32 }; 34 };
33 35
34 wdog@53f98000 { /* WDOG1 */
35 status = "okay";
36 };
37
38 iomuxc@53fa8000 { 36 iomuxc@53fa8000 {
39 compatible = "fsl,imx53-iomuxc-ard"; 37 pinctrl-names = "default";
40 reg = <0x53fa8000 0x4000>; 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 };
41 }; 80 };
42 81
43 uart1: serial@53fbc000 { 82 uart1: serial@53fbc000 {
83 pinctrl-names = "default";
84 pinctrl-0 = <&pinctrl_uart1_2>;
44 status = "okay"; 85 status = "okay";
45 }; 86 };
46 }; 87 };
47
48 aips@60000000 { /* AIPS2 */
49 sdma@63fb0000 {
50 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx53.bin";
51 };
52 };
53 }; 88 };
54 89
55 eim-cs1@f4000000 { 90 eim-cs1@f4000000 {
diff --git a/arch/arm/boot/dts/imx53-evk.dts b/arch/arm/boot/dts/imx53-evk.dts
index 9c798034675..a124d1e2525 100644
--- a/arch/arm/boot/dts/imx53-evk.dts
+++ b/arch/arm/boot/dts/imx53-evk.dts
@@ -25,12 +25,16 @@
25 aips@50000000 { /* AIPS1 */ 25 aips@50000000 { /* AIPS1 */
26 spba@50000000 { 26 spba@50000000 {
27 esdhc@50004000 { /* ESDHC1 */ 27 esdhc@50004000 { /* ESDHC1 */
28 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_esdhc1_1>;
28 cd-gpios = <&gpio3 13 0>; 30 cd-gpios = <&gpio3 13 0>;
29 wp-gpios = <&gpio3 14 0>; 31 wp-gpios = <&gpio3 14 0>;
30 status = "okay"; 32 status = "okay";
31 }; 33 };
32 34
33 ecspi@50010000 { /* ECSPI1 */ 35 ecspi@50010000 { /* ECSPI1 */
36 pinctrl-names = "default";
37 pinctrl-0 = <&pinctrl_ecspi1_1>;
34 fsl,spi-num-chipselects = <2>; 38 fsl,spi-num-chipselects = <2>;
35 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>; 39 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>;
36 status = "okay"; 40 status = "okay";
@@ -56,32 +60,45 @@
56 }; 60 };
57 61
58 esdhc@50020000 { /* ESDHC3 */ 62 esdhc@50020000 { /* ESDHC3 */
63 pinctrl-names = "default";
64 pinctrl-0 = <&pinctrl_esdhc3_1>;
59 cd-gpios = <&gpio3 11 0>; 65 cd-gpios = <&gpio3 11 0>;
60 wp-gpios = <&gpio3 12 0>; 66 wp-gpios = <&gpio3 12 0>;
61 status = "okay"; 67 status = "okay";
62 }; 68 };
63 }; 69 };
64 70
65 wdog@53f98000 { /* WDOG1 */
66 status = "okay";
67 };
68
69 iomuxc@53fa8000 { 71 iomuxc@53fa8000 {
70 compatible = "fsl,imx53-iomuxc-evk"; 72 pinctrl-names = "default";
71 reg = <0x53fa8000 0x4000>; 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 };
72 }; 89 };
73 90
74 uart1: serial@53fbc000 { 91 uart1: serial@53fbc000 {
92 pinctrl-names = "default";
93 pinctrl-0 = <&pinctrl_uart1_1>;
75 status = "okay"; 94 status = "okay";
76 }; 95 };
77 }; 96 };
78 97
79 aips@60000000 { /* AIPS2 */ 98 aips@60000000 { /* AIPS2 */
80 sdma@63fb0000 {
81 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx53.bin";
82 };
83
84 i2c@63fc4000 { /* I2C2 */ 99 i2c@63fc4000 { /* I2C2 */
100 pinctrl-names = "default";
101 pinctrl-0 = <&pinctrl_i2c2_1>;
85 status = "okay"; 102 status = "okay";
86 103
87 pmic: mc13892@08 { 104 pmic: mc13892@08 {
@@ -96,6 +113,8 @@
96 }; 113 };
97 114
98 ethernet@63fec000 { 115 ethernet@63fec000 {
116 pinctrl-names = "default";
117 pinctrl-0 = <&pinctrl_fec_1>;
99 phy-mode = "rmii"; 118 phy-mode = "rmii";
100 phy-reset-gpios = <&gpio7 6 0>; 119 phy-reset-gpios = <&gpio7 6 0>;
101 status = "okay"; 120 status = "okay";
diff --git a/arch/arm/boot/dts/imx53-qsb.dts b/arch/arm/boot/dts/imx53-qsb.dts
index 2d803a9a694..08948af86d1 100644
--- a/arch/arm/boot/dts/imx53-qsb.dts
+++ b/arch/arm/boot/dts/imx53-qsb.dts
@@ -25,6 +25,8 @@
25 aips@50000000 { /* AIPS1 */ 25 aips@50000000 { /* AIPS1 */
26 spba@50000000 { 26 spba@50000000 {
27 esdhc@50004000 { /* ESDHC1 */ 27 esdhc@50004000 { /* ESDHC1 */
28 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_esdhc1_1>;
28 cd-gpios = <&gpio3 13 0>; 30 cd-gpios = <&gpio3 13 0>;
29 status = "okay"; 31 status = "okay";
30 }; 32 };
@@ -35,32 +37,46 @@
35 }; 37 };
36 38
37 esdhc@50020000 { /* ESDHC3 */ 39 esdhc@50020000 { /* ESDHC3 */
40 pinctrl-names = "default";
41 pinctrl-0 = <&pinctrl_esdhc3_1>;
38 cd-gpios = <&gpio3 11 0>; 42 cd-gpios = <&gpio3 11 0>;
39 wp-gpios = <&gpio3 12 0>; 43 wp-gpios = <&gpio3 12 0>;
40 status = "okay"; 44 status = "okay";
41 }; 45 };
42 }; 46 };
43 47
44 wdog@53f98000 { /* WDOG1 */
45 status = "okay";
46 };
47
48 iomuxc@53fa8000 { 48 iomuxc@53fa8000 {
49 compatible = "fsl,imx53-iomuxc-qsb"; 49 pinctrl-names = "default";
50 reg = <0x53fa8000 0x4000>; 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 873 0x80000000 /* MX53_PAD_PATA_DA_1__GPIO7_7 */
64 >;
65 };
66 };
51 }; 67 };
52 68
53 uart1: serial@53fbc000 { 69 uart1: serial@53fbc000 {
70 pinctrl-names = "default";
71 pinctrl-0 = <&pinctrl_uart1_1>;
54 status = "okay"; 72 status = "okay";
55 }; 73 };
56 }; 74 };
57 75
58 aips@60000000 { /* AIPS2 */ 76 aips@60000000 { /* AIPS2 */
59 sdma@63fb0000 {
60 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx53.bin";
61 };
62
63 i2c@63fc4000 { /* I2C2 */ 77 i2c@63fc4000 { /* I2C2 */
78 pinctrl-names = "default";
79 pinctrl-0 = <&pinctrl_i2c2_1>;
64 status = "okay"; 80 status = "okay";
65 81
66 sgtl5000: codec@0a { 82 sgtl5000: codec@0a {
@@ -72,6 +88,8 @@
72 }; 88 };
73 89
74 i2c@63fc8000 { /* I2C1 */ 90 i2c@63fc8000 { /* I2C1 */
91 pinctrl-names = "default";
92 pinctrl-0 = <&pinctrl_i2c1_1>;
75 status = "okay"; 93 status = "okay";
76 94
77 accelerometer: mma8450@1c { 95 accelerometer: mma8450@1c {
@@ -158,10 +176,14 @@
158 }; 176 };
159 177
160 audmux@63fd0000 { 178 audmux@63fd0000 {
179 pinctrl-names = "default";
180 pinctrl-0 = <&pinctrl_audmux_1>;
161 status = "okay"; 181 status = "okay";
162 }; 182 };
163 183
164 ethernet@63fec000 { 184 ethernet@63fec000 {
185 pinctrl-names = "default";
186 pinctrl-0 = <&pinctrl_fec_1>;
165 phy-mode = "rmii"; 187 phy-mode = "rmii";
166 phy-reset-gpios = <&gpio7 6 0>; 188 phy-reset-gpios = <&gpio7 6 0>;
167 status = "okay"; 189 status = "okay";
diff --git a/arch/arm/boot/dts/imx53-smd.dts b/arch/arm/boot/dts/imx53-smd.dts
index 08091029168..06c68580c84 100644
--- a/arch/arm/boot/dts/imx53-smd.dts
+++ b/arch/arm/boot/dts/imx53-smd.dts
@@ -25,22 +25,30 @@
25 aips@50000000 { /* AIPS1 */ 25 aips@50000000 { /* AIPS1 */
26 spba@50000000 { 26 spba@50000000 {
27 esdhc@50004000 { /* ESDHC1 */ 27 esdhc@50004000 { /* ESDHC1 */
28 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_esdhc1_1>;
28 cd-gpios = <&gpio3 13 0>; 30 cd-gpios = <&gpio3 13 0>;
29 wp-gpios = <&gpio4 11 0>; 31 wp-gpios = <&gpio4 11 0>;
30 status = "okay"; 32 status = "okay";
31 }; 33 };
32 34
33 esdhc@50008000 { /* ESDHC2 */ 35 esdhc@50008000 { /* ESDHC2 */
36 pinctrl-names = "default";
37 pinctrl-0 = <&pinctrl_esdhc2_1>;
34 non-removable; 38 non-removable;
35 status = "okay"; 39 status = "okay";
36 }; 40 };
37 41
38 uart3: serial@5000c000 { 42 uart3: serial@5000c000 {
43 pinctrl-names = "default";
44 pinctrl-0 = <&pinctrl_uart3_1>;
39 fsl,uart-has-rtscts; 45 fsl,uart-has-rtscts;
40 status = "okay"; 46 status = "okay";
41 }; 47 };
42 48
43 ecspi@50010000 { /* ECSPI1 */ 49 ecspi@50010000 { /* ECSPI1 */
50 pinctrl-names = "default";
51 pinctrl-0 = <&pinctrl_ecspi1_1>;
44 fsl,spi-num-chipselects = <2>; 52 fsl,spi-num-chipselects = <2>;
45 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>; 53 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>;
46 status = "okay"; 54 status = "okay";
@@ -72,35 +80,49 @@
72 }; 80 };
73 81
74 esdhc@50020000 { /* ESDHC3 */ 82 esdhc@50020000 { /* ESDHC3 */
83 pinctrl-names = "default";
84 pinctrl-0 = <&pinctrl_esdhc3_1>;
75 non-removable; 85 non-removable;
76 status = "okay"; 86 status = "okay";
77 }; 87 };
78 }; 88 };
79 89
80 wdog@53f98000 { /* WDOG1 */
81 status = "okay";
82 };
83
84 iomuxc@53fa8000 { 90 iomuxc@53fa8000 {
85 compatible = "fsl,imx53-iomuxc-smd"; 91 pinctrl-names = "default";
86 reg = <0x53fa8000 0x4000>; 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 };
87 }; 107 };
88 108
89 uart1: serial@53fbc000 { 109 uart1: serial@53fbc000 {
110 pinctrl-names = "default";
111 pinctrl-0 = <&pinctrl_uart1_1>;
90 status = "okay"; 112 status = "okay";
91 }; 113 };
92 114
93 uart2: serial@53fc0000 { 115 uart2: serial@53fc0000 {
116 pinctrl-names = "default";
117 pinctrl-0 = <&pinctrl_uart2_1>;
94 status = "okay"; 118 status = "okay";
95 }; 119 };
96 }; 120 };
97 121
98 aips@60000000 { /* AIPS2 */ 122 aips@60000000 { /* AIPS2 */
99 sdma@63fb0000 {
100 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx53.bin";
101 };
102
103 i2c@63fc4000 { /* I2C2 */ 123 i2c@63fc4000 { /* I2C2 */
124 pinctrl-names = "default";
125 pinctrl-0 = <&pinctrl_i2c2_1>;
104 status = "okay"; 126 status = "okay";
105 127
106 codec: sgtl5000@0a { 128 codec: sgtl5000@0a {
@@ -120,6 +142,8 @@
120 }; 142 };
121 143
122 i2c@63fc8000 { /* I2C1 */ 144 i2c@63fc8000 { /* I2C1 */
145 pinctrl-names = "default";
146 pinctrl-0 = <&pinctrl_i2c1_1>;
123 status = "okay"; 147 status = "okay";
124 148
125 accelerometer: mma8450@1c { 149 accelerometer: mma8450@1c {
@@ -139,6 +163,8 @@
139 }; 163 };
140 164
141 ethernet@63fec000 { 165 ethernet@63fec000 {
166 pinctrl-names = "default";
167 pinctrl-0 = <&pinctrl_fec_1>;
142 phy-mode = "rmii"; 168 phy-mode = "rmii";
143 phy-reset-gpios = <&gpio7 6 0>; 169 phy-reset-gpios = <&gpio7 6 0>;
144 status = "okay"; 170 status = "okay";
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
index cd37165edce..76ebb1ad267 100644
--- a/arch/arm/boot/dts/imx53.dtsi
+++ b/arch/arm/boot/dts/imx53.dtsi
@@ -135,6 +135,34 @@
135 }; 135 };
136 }; 136 };
137 137
138 usb@53f80000 {
139 compatible = "fsl,imx53-usb", "fsl,imx27-usb";
140 reg = <0x53f80000 0x0200>;
141 interrupts = <18>;
142 status = "disabled";
143 };
144
145 usb@53f80200 {
146 compatible = "fsl,imx53-usb", "fsl,imx27-usb";
147 reg = <0x53f80200 0x0200>;
148 interrupts = <14>;
149 status = "disabled";
150 };
151
152 usb@53f80400 {
153 compatible = "fsl,imx53-usb", "fsl,imx27-usb";
154 reg = <0x53f80400 0x0200>;
155 interrupts = <16>;
156 status = "disabled";
157 };
158
159 usb@53f80600 {
160 compatible = "fsl,imx53-usb", "fsl,imx27-usb";
161 reg = <0x53f80600 0x0200>;
162 interrupts = <17>;
163 status = "disabled";
164 };
165
138 gpio1: gpio@53f84000 { 166 gpio1: gpio@53f84000 {
139 compatible = "fsl,imx53-gpio", "fsl,imx35-gpio"; 167 compatible = "fsl,imx53-gpio", "fsl,imx35-gpio";
140 reg = <0x53f84000 0x4000>; 168 reg = <0x53f84000 0x4000>;
@@ -179,7 +207,6 @@
179 compatible = "fsl,imx53-wdt", "fsl,imx21-wdt"; 207 compatible = "fsl,imx53-wdt", "fsl,imx21-wdt";
180 reg = <0x53f98000 0x4000>; 208 reg = <0x53f98000 0x4000>;
181 interrupts = <58>; 209 interrupts = <58>;
182 status = "disabled";
183 }; 210 };
184 211
185 wdog@53f9c000 { /* WDOG2 */ 212 wdog@53f9c000 { /* WDOG2 */
@@ -189,6 +216,161 @@
189 status = "disabled"; 216 status = "disabled";
190 }; 217 };
191 218
219 iomuxc@53fa8000 {
220 compatible = "fsl,imx53-iomuxc";
221 reg = <0x53fa8000 0x4000>;
222
223 audmux {
224 pinctrl_audmux_1: audmuxgrp-1 {
225 fsl,pins = <
226 10 0x80000000 /* MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC */
227 17 0x80000000 /* MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD */
228 23 0x80000000 /* MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS */
229 30 0x80000000 /* MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD */
230 >;
231 };
232 };
233
234 fec {
235 pinctrl_fec_1: fecgrp-1 {
236 fsl,pins = <
237 820 0x80000000 /* MX53_PAD_FEC_MDC__FEC_MDC */
238 779 0x80000000 /* MX53_PAD_FEC_MDIO__FEC_MDIO */
239 786 0x80000000 /* MX53_PAD_FEC_REF_CLK__FEC_TX_CLK */
240 791 0x80000000 /* MX53_PAD_FEC_RX_ER__FEC_RX_ER */
241 796 0x80000000 /* MX53_PAD_FEC_CRS_DV__FEC_RX_DV */
242 799 0x80000000 /* MX53_PAD_FEC_RXD1__FEC_RDATA_1 */
243 804 0x80000000 /* MX53_PAD_FEC_RXD0__FEC_RDATA_0 */
244 808 0x80000000 /* MX53_PAD_FEC_TX_EN__FEC_TX_EN */
245 811 0x80000000 /* MX53_PAD_FEC_TXD1__FEC_TDATA_1 */
246 816 0x80000000 /* MX53_PAD_FEC_TXD0__FEC_TDATA_0 */
247 >;
248 };
249 };
250
251 ecspi1 {
252 pinctrl_ecspi1_1: ecspi1grp-1 {
253 fsl,pins = <
254 433 0x80000000 /* MX53_PAD_EIM_D16__ECSPI1_SCLK */
255 439 0x80000000 /* MX53_PAD_EIM_D17__ECSPI1_MISO */
256 445 0x80000000 /* MX53_PAD_EIM_D18__ECSPI1_MOSI */
257 >;
258 };
259 };
260
261 esdhc1 {
262 pinctrl_esdhc1_1: esdhc1grp-1 {
263 fsl,pins = <
264 995 0x1d5 /* MX53_PAD_SD1_DATA0__ESDHC1_DAT0 */
265 1000 0x1d5 /* MX53_PAD_SD1_DATA1__ESDHC1_DAT1 */
266 1010 0x1d5 /* MX53_PAD_SD1_DATA2__ESDHC1_DAT2 */
267 1024 0x1d5 /* MX53_PAD_SD1_DATA3__ESDHC1_DAT3 */
268 1005 0x1d5 /* MX53_PAD_SD1_CMD__ESDHC1_CMD */
269 1018 0x1d5 /* MX53_PAD_SD1_CLK__ESDHC1_CLK */
270 >;
271 };
272
273 pinctrl_esdhc1_2: esdhc1grp-2 {
274 fsl,pins = <
275 995 0x1d5 /* MX53_PAD_SD1_DATA0__ESDHC1_DAT0 */
276 1000 0x1d5 /* MX53_PAD_SD1_DATA1__ESDHC1_DAT1 */
277 1010 0x1d5 /* MX53_PAD_SD1_DATA2__ESDHC1_DAT2 */
278 1024 0x1d5 /* MX53_PAD_SD1_DATA3__ESDHC1_DAT3 */
279 941 0x1d5 /* MX53_PAD_PATA_DATA8__ESDHC1_DAT4 */
280 948 0x1d5 /* MX53_PAD_PATA_DATA9__ESDHC1_DAT5 */
281 955 0x1d5 /* MX53_PAD_PATA_DATA10__ESDHC1_DAT6 */
282 962 0x1d5 /* MX53_PAD_PATA_DATA11__ESDHC1_DAT7 */
283 1005 0x1d5 /* MX53_PAD_SD1_CMD__ESDHC1_CMD */
284 1018 0x1d5 /* MX53_PAD_SD1_CLK__ESDHC1_CLK */
285 >;
286 };
287 };
288
289 esdhc2 {
290 pinctrl_esdhc2_1: esdhc2grp-1 {
291 fsl,pins = <
292 1038 0x1d5 /* MX53_PAD_SD2_CMD__ESDHC2_CMD */
293 1032 0x1d5 /* MX53_PAD_SD2_CLK__ESDHC2_CLK */
294 1062 0x1d5 /* MX53_PAD_SD2_DATA0__ESDHC2_DAT0 */
295 1056 0x1d5 /* MX53_PAD_SD2_DATA1__ESDHC2_DAT1 */
296 1050 0x1d5 /* MX53_PAD_SD2_DATA2__ESDHC2_DAT2 */
297 1044 0x1d5 /* MX53_PAD_SD2_DATA3__ESDHC2_DAT3 */
298 >;
299 };
300 };
301
302 esdhc3 {
303 pinctrl_esdhc3_1: esdhc3grp-1 {
304 fsl,pins = <
305 943 0x1d5 /* MX53_PAD_PATA_DATA8__ESDHC3_DAT0 */
306 950 0x1d5 /* MX53_PAD_PATA_DATA9__ESDHC3_DAT1 */
307 957 0x1d5 /* MX53_PAD_PATA_DATA10__ESDHC3_DAT2 */
308 964 0x1d5 /* MX53_PAD_PATA_DATA11__ESDHC3_DAT3 */
309 893 0x1d5 /* MX53_PAD_PATA_DATA0__ESDHC3_DAT4 */
310 900 0x1d5 /* MX53_PAD_PATA_DATA1__ESDHC3_DAT5 */
311 906 0x1d5 /* MX53_PAD_PATA_DATA2__ESDHC3_DAT6 */
312 912 0x1d5 /* MX53_PAD_PATA_DATA3__ESDHC3_DAT7 */
313 857 0x1d5 /* MX53_PAD_PATA_RESET_B__ESDHC3_CMD */
314 863 0x1d5 /* MX53_PAD_PATA_IORDY__ESDHC3_CLK */
315 >;
316 };
317 };
318
319 i2c1 {
320 pinctrl_i2c1_1: i2c1grp-1 {
321 fsl,pins = <
322 333 0xc0000000 /* MX53_PAD_CSI0_DAT8__I2C1_SDA */
323 341 0xc0000000 /* MX53_PAD_CSI0_DAT9__I2C1_SCL */
324 >;
325 };
326 };
327
328 i2c2 {
329 pinctrl_i2c2_1: i2c2grp-1 {
330 fsl,pins = <
331 61 0xc0000000 /* MX53_PAD_KEY_ROW3__I2C2_SDA */
332 53 0xc0000000 /* MX53_PAD_KEY_COL3__I2C2_SCL */
333 >;
334 };
335 };
336
337 uart1 {
338 pinctrl_uart1_1: uart1grp-1 {
339 fsl,pins = <
340 346 0x1c5 /* MX53_PAD_CSI0_DAT10__UART1_TXD_MUX */
341 354 0x1c5 /* MX53_PAD_CSI0_DAT11__UART1_RXD_MUX */
342 >;
343 };
344
345 pinctrl_uart1_2: uart1grp-2 {
346 fsl,pins = <
347 828 0x1c5 /* MX53_PAD_PATA_DIOW__UART1_TXD_MUX */
348 832 0x1c5 /* MX53_PAD_PATA_DMACK__UART1_RXD_MUX */
349 >;
350 };
351 };
352
353 uart2 {
354 pinctrl_uart2_1: uart2grp-1 {
355 fsl,pins = <
356 841 0x1c5 /* MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX */
357 836 0x1c5 /* MX53_PAD_PATA_DMARQ__UART2_TXD_MUX */
358 >;
359 };
360 };
361
362 uart3 {
363 pinctrl_uart3_1: uart3grp-1 {
364 fsl,pins = <
365 884 0x1c5 /* MX53_PAD_PATA_CS_0__UART3_TXD_MUX */
366 888 0x1c5 /* MX53_PAD_PATA_CS_1__UART3_RXD_MUX */
367 875 0x1c5 /* MX53_PAD_PATA_DA_1__UART3_CTS */
368 880 0x1c5 /* MX53_PAD_PATA_DA_2__UART3_RTS */
369 >;
370 };
371 };
372 };
373
192 uart1: serial@53fbc000 { 374 uart1: serial@53fbc000 {
193 compatible = "fsl,imx53-uart", "fsl,imx21-uart"; 375 compatible = "fsl,imx53-uart", "fsl,imx21-uart";
194 reg = <0x53fbc000 0x4000>; 376 reg = <0x53fbc000 0x4000>;
@@ -203,6 +385,20 @@
203 status = "disabled"; 385 status = "disabled";
204 }; 386 };
205 387
388 can1: can@53fc8000 {
389 compatible = "fsl,imx53-flexcan", "fsl,p1010-flexcan";
390 reg = <0x53fc8000 0x4000>;
391 interrupts = <82>;
392 status = "disabled";
393 };
394
395 can2: can@53fcc000 {
396 compatible = "fsl,imx53-flexcan", "fsl,p1010-flexcan";
397 reg = <0x53fcc000 0x4000>;
398 interrupts = <83>;
399 status = "disabled";
400 };
401
206 gpio5: gpio@53fdc000 { 402 gpio5: gpio@53fdc000 {
207 compatible = "fsl,imx53-gpio", "fsl,imx35-gpio"; 403 compatible = "fsl,imx53-gpio", "fsl,imx35-gpio";
208 reg = <0x53fdc000 0x4000>; 404 reg = <0x53fdc000 0x4000>;
@@ -277,6 +473,7 @@
277 compatible = "fsl,imx53-sdma", "fsl,imx35-sdma"; 473 compatible = "fsl,imx53-sdma", "fsl,imx35-sdma";
278 reg = <0x63fb0000 0x4000>; 474 reg = <0x63fb0000 0x4000>;
279 interrupts = <6>; 475 interrupts = <6>;
476 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx53.bin";
280 }; 477 };
281 478
282 cspi@63fc0000 { 479 cspi@63fc0000 {
@@ -321,6 +518,13 @@
321 status = "disabled"; 518 status = "disabled";
322 }; 519 };
323 520
521 nand@63fdb000 {
522 compatible = "fsl,imx53-nand";
523 reg = <0x63fdb000 0x1000 0xf7ff0000 0x10000>;
524 interrupts = <8>;
525 status = "disabled";
526 };
527
324 ssi3: ssi@63fe8000 { 528 ssi3: ssi@63fe8000 {
325 compatible = "fsl,imx53-ssi", "fsl,imx21-ssi"; 529 compatible = "fsl,imx53-ssi", "fsl,imx21-ssi";
326 reg = <0x63fe8000 0x4000>; 530 reg = <0x63fe8000 0x4000>;
diff --git a/arch/arm/boot/dts/imx6q-arm2.dts b/arch/arm/boot/dts/imx6q-arm2.dts
index d792581672c..15df4c105e8 100644
--- a/arch/arm/boot/dts/imx6q-arm2.dts
+++ b/arch/arm/boot/dts/imx6q-arm2.dts
@@ -28,8 +28,27 @@
28 status = "disabled"; /* gpmi nand conflicts with SD */ 28 status = "disabled"; /* gpmi nand conflicts with SD */
29 }; 29 };
30 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 1363 0x80000000 /* MX6Q_PAD_NANDF_CS0__GPIO_6_11 */
41 1369 0x80000000 /* MX6Q_PAD_NANDF_CS1__GPIO_6_14 */
42 >;
43 };
44 };
45 };
46 };
47
31 aips-bus@02100000 { /* AIPS2 */ 48 aips-bus@02100000 { /* AIPS2 */
32 ethernet@02188000 { 49 ethernet@02188000 {
50 pinctrl-names = "default";
51 pinctrl-0 = <&pinctrl_enet_2>;
33 phy-mode = "rgmii"; 52 phy-mode = "rgmii";
34 status = "okay"; 53 status = "okay";
35 }; 54 };
@@ -52,6 +71,8 @@
52 }; 71 };
53 72
54 uart4: serial@021f0000 { 73 uart4: serial@021f0000 {
74 pinctrl-names = "default";
75 pinctrl-0 = <&pinctrl_uart4_1>;
55 status = "okay"; 76 status = "okay";
56 }; 77 };
57 }; 78 };
diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
index 72f30f3e617..d152328285a 100644
--- a/arch/arm/boot/dts/imx6q-sabrelite.dts
+++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
@@ -46,15 +46,20 @@
46 46
47 iomuxc@020e0000 { 47 iomuxc@020e0000 {
48 pinctrl-names = "default"; 48 pinctrl-names = "default";
49 pinctrl-0 = <&pinctrl_gpio_hog>; 49 pinctrl-0 = <&pinctrl_hog>;
50 50
51 gpios { 51 hog {
52 pinctrl_gpio_hog: gpiohog { 52 pinctrl_hog: hoggrp {
53 fsl,pins = < 53 fsl,pins = <
54 144 0x80000000 /* MX6Q_PAD_EIM_D22__GPIO_3_22 */ 54 1450 0x80000000 /* MX6Q_PAD_NANDF_D6__GPIO_2_6 */
55 121 0x80000000 /* MX6Q_PAD_EIM_D19__GPIO_3_19 */ 55 1458 0x80000000 /* MX6Q_PAD_NANDF_D7__GPIO_2_7 */
56 953 0x80000000 /* MX6Q_PAD_GPIO_0__CCM_CLKO */ 56 121 0x80000000 /* MX6Q_PAD_EIM_D19__GPIO_3_19 */
57 >; 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 >;
58 }; 63 };
59 }; 64 };
60 }; 65 };
@@ -63,6 +68,9 @@
63 aips-bus@02100000 { /* AIPS2 */ 68 aips-bus@02100000 { /* AIPS2 */
64 usb@02184000 { /* USB OTG */ 69 usb@02184000 { /* USB OTG */
65 vbus-supply = <&reg_usb_otg_vbus>; 70 vbus-supply = <&reg_usb_otg_vbus>;
71 pinctrl-names = "default";
72 pinctrl-0 = <&pinctrl_usbotg_1>;
73 disable-over-current;
66 status = "okay"; 74 status = "okay";
67 }; 75 };
68 76
@@ -71,12 +79,16 @@
71 }; 79 };
72 80
73 ethernet@02188000 { 81 ethernet@02188000 {
82 pinctrl-names = "default";
83 pinctrl-0 = <&pinctrl_enet_1>;
74 phy-mode = "rgmii"; 84 phy-mode = "rgmii";
75 phy-reset-gpios = <&gpio3 23 0>; 85 phy-reset-gpios = <&gpio3 23 0>;
76 status = "okay"; 86 status = "okay";
77 }; 87 };
78 88
79 usdhc@02198000 { /* uSDHC3 */ 89 usdhc@02198000 { /* uSDHC3 */
90 pinctrl-names = "default";
91 pinctrl-0 = <&pinctrl_usdhc3_2>;
80 cd-gpios = <&gpio7 0 0>; 92 cd-gpios = <&gpio7 0 0>;
81 wp-gpios = <&gpio7 1 0>; 93 wp-gpios = <&gpio7 1 0>;
82 vmmc-supply = <&reg_3p3v>; 94 vmmc-supply = <&reg_3p3v>;
@@ -84,6 +96,8 @@
84 }; 96 };
85 97
86 usdhc@0219c000 { /* uSDHC4 */ 98 usdhc@0219c000 { /* uSDHC4 */
99 pinctrl-names = "default";
100 pinctrl-0 = <&pinctrl_usdhc4_2>;
87 cd-gpios = <&gpio2 6 0>; 101 cd-gpios = <&gpio2 6 0>;
88 wp-gpios = <&gpio2 7 0>; 102 wp-gpios = <&gpio2 7 0>;
89 vmmc-supply = <&reg_3p3v>; 103 vmmc-supply = <&reg_3p3v>;
@@ -99,7 +113,7 @@
99 uart2: serial@021e8000 { 113 uart2: serial@021e8000 {
100 status = "okay"; 114 status = "okay";
101 pinctrl-names = "default"; 115 pinctrl-names = "default";
102 pinctrl-0 = <&pinctrl_serial2_1>; 116 pinctrl-0 = <&pinctrl_uart2_1>;
103 }; 117 };
104 118
105 i2c@021a0000 { /* I2C1 */ 119 i2c@021a0000 { /* I2C1 */
@@ -111,6 +125,7 @@
111 codec: sgtl5000@0a { 125 codec: sgtl5000@0a {
112 compatible = "fsl,sgtl5000"; 126 compatible = "fsl,sgtl5000";
113 reg = <0x0a>; 127 reg = <0x0a>;
128 clocks = <&clks 169>;
114 VDDA-supply = <&reg_2p5v>; 129 VDDA-supply = <&reg_2p5v>;
115 VDDIO-supply = <&reg_3p3v>; 130 VDDIO-supply = <&reg_3p3v>;
116 }; 131 };
diff --git a/arch/arm/boot/dts/imx6q-sabresd.dts b/arch/arm/boot/dts/imx6q-sabresd.dts
index 07509a18117..e596c28c214 100644
--- a/arch/arm/boot/dts/imx6q-sabresd.dts
+++ b/arch/arm/boot/dts/imx6q-sabresd.dts
@@ -22,28 +22,51 @@
22 }; 22 };
23 23
24 soc { 24 soc {
25
26 aips-bus@02000000 { /* AIPS1 */ 25 aips-bus@02000000 { /* AIPS1 */
27 spba-bus@02000000 { 26 spba-bus@02000000 {
28 uart1: serial@02020000 { 27 uart1: serial@02020000 {
28 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_uart1_1>;
29 status = "okay"; 30 status = "okay";
30 }; 31 };
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 1402 0x80000000 /* MX6Q_PAD_NANDF_D0__GPIO_2_0 */
42 1410 0x80000000 /* MX6Q_PAD_NANDF_D1__GPIO_2_1 */
43 1418 0x80000000 /* MX6Q_PAD_NANDF_D2__GPIO_2_2 */
44 1426 0x80000000 /* MX6Q_PAD_NANDF_D3__GPIO_2_3 */
45 >;
46 };
47 };
48 };
32 }; 49 };
33 50
34 aips-bus@02100000 { /* AIPS2 */ 51 aips-bus@02100000 { /* AIPS2 */
35 ethernet@02188000 { 52 ethernet@02188000 {
53 pinctrl-names = "default";
54 pinctrl-0 = <&pinctrl_enet_1>;
36 phy-mode = "rgmii"; 55 phy-mode = "rgmii";
37 status = "okay"; 56 status = "okay";
38 }; 57 };
39 58
40 usdhc@02194000 { /* uSDHC2 */ 59 usdhc@02194000 { /* uSDHC2 */
60 pinctrl-names = "default";
61 pinctrl-0 = <&pinctrl_usdhc2_1>;
41 cd-gpios = <&gpio2 2 0>; 62 cd-gpios = <&gpio2 2 0>;
42 wp-gpios = <&gpio2 3 0>; 63 wp-gpios = <&gpio2 3 0>;
43 status = "okay"; 64 status = "okay";
44 }; 65 };
45 66
46 usdhc@02198000 { /* uSDHC3 */ 67 usdhc@02198000 { /* uSDHC3 */
68 pinctrl-names = "default";
69 pinctrl-0 = <&pinctrl_usdhc3_1>;
47 cd-gpios = <&gpio2 0 0>; 70 cd-gpios = <&gpio2 0 0>;
48 wp-gpios = <&gpio2 1 0>; 71 wp-gpios = <&gpio2 1 0>;
49 status = "okay"; 72 status = "okay";
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index fd57079f71a..f3990b04fec 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -97,18 +97,23 @@
97 dma-apbh@00110000 { 97 dma-apbh@00110000 {
98 compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh"; 98 compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh";
99 reg = <0x00110000 0x2000>; 99 reg = <0x00110000 0x2000>;
100 clocks = <&clks 106>;
100 }; 101 };
101 102
102 gpmi-nand@00112000 { 103 gpmi-nand@00112000 {
103 compatible = "fsl,imx6q-gpmi-nand"; 104 compatible = "fsl,imx6q-gpmi-nand";
104 #address-cells = <1>; 105 #address-cells = <1>;
105 #size-cells = <1>; 106 #size-cells = <1>;
106 reg = <0x00112000 0x2000>, <0x00114000 0x2000>; 107 reg = <0x00112000 0x2000>, <0x00114000 0x2000>;
107 reg-names = "gpmi-nand", "bch"; 108 reg-names = "gpmi-nand", "bch";
108 interrupts = <0 13 0x04>, <0 15 0x04>; 109 interrupts = <0 13 0x04>, <0 15 0x04>;
109 interrupt-names = "gpmi-dma", "bch"; 110 interrupt-names = "gpmi-dma", "bch";
110 fsl,gpmi-dma-channel = <0>; 111 clocks = <&clks 152>, <&clks 153>, <&clks 151>,
111 status = "disabled"; 112 <&clks 150>, <&clks 149>;
113 clock-names = "gpmi_io", "gpmi_apb", "gpmi_bch",
114 "gpmi_bch_apb", "per1_bch";
115 fsl,gpmi-dma-channel = <0>;
116 status = "disabled";
112 }; 117 };
113 118
114 timer@00a00600 { 119 timer@00a00600 {
@@ -150,6 +155,8 @@
150 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 155 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
151 reg = <0x02008000 0x4000>; 156 reg = <0x02008000 0x4000>;
152 interrupts = <0 31 0x04>; 157 interrupts = <0 31 0x04>;
158 clocks = <&clks 112>, <&clks 112>;
159 clock-names = "ipg", "per";
153 status = "disabled"; 160 status = "disabled";
154 }; 161 };
155 162
@@ -159,6 +166,8 @@
159 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 166 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
160 reg = <0x0200c000 0x4000>; 167 reg = <0x0200c000 0x4000>;
161 interrupts = <0 32 0x04>; 168 interrupts = <0 32 0x04>;
169 clocks = <&clks 113>, <&clks 113>;
170 clock-names = "ipg", "per";
162 status = "disabled"; 171 status = "disabled";
163 }; 172 };
164 173
@@ -168,6 +177,8 @@
168 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 177 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
169 reg = <0x02010000 0x4000>; 178 reg = <0x02010000 0x4000>;
170 interrupts = <0 33 0x04>; 179 interrupts = <0 33 0x04>;
180 clocks = <&clks 114>, <&clks 114>;
181 clock-names = "ipg", "per";
171 status = "disabled"; 182 status = "disabled";
172 }; 183 };
173 184
@@ -177,6 +188,8 @@
177 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 188 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
178 reg = <0x02014000 0x4000>; 189 reg = <0x02014000 0x4000>;
179 interrupts = <0 34 0x04>; 190 interrupts = <0 34 0x04>;
191 clocks = <&clks 115>, <&clks 115>;
192 clock-names = "ipg", "per";
180 status = "disabled"; 193 status = "disabled";
181 }; 194 };
182 195
@@ -186,6 +199,8 @@
186 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 199 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
187 reg = <0x02018000 0x4000>; 200 reg = <0x02018000 0x4000>;
188 interrupts = <0 35 0x04>; 201 interrupts = <0 35 0x04>;
202 clocks = <&clks 116>, <&clks 116>;
203 clock-names = "ipg", "per";
189 status = "disabled"; 204 status = "disabled";
190 }; 205 };
191 206
@@ -193,6 +208,8 @@
193 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 208 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
194 reg = <0x02020000 0x4000>; 209 reg = <0x02020000 0x4000>;
195 interrupts = <0 26 0x04>; 210 interrupts = <0 26 0x04>;
211 clocks = <&clks 160>, <&clks 161>;
212 clock-names = "ipg", "per";
196 status = "disabled"; 213 status = "disabled";
197 }; 214 };
198 215
@@ -205,6 +222,7 @@
205 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi"; 222 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi";
206 reg = <0x02028000 0x4000>; 223 reg = <0x02028000 0x4000>;
207 interrupts = <0 46 0x04>; 224 interrupts = <0 46 0x04>;
225 clocks = <&clks 178>;
208 fsl,fifo-depth = <15>; 226 fsl,fifo-depth = <15>;
209 fsl,ssi-dma-events = <38 37>; 227 fsl,ssi-dma-events = <38 37>;
210 status = "disabled"; 228 status = "disabled";
@@ -214,6 +232,7 @@
214 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi"; 232 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi";
215 reg = <0x0202c000 0x4000>; 233 reg = <0x0202c000 0x4000>;
216 interrupts = <0 47 0x04>; 234 interrupts = <0 47 0x04>;
235 clocks = <&clks 179>;
217 fsl,fifo-depth = <15>; 236 fsl,fifo-depth = <15>;
218 fsl,ssi-dma-events = <42 41>; 237 fsl,ssi-dma-events = <42 41>;
219 status = "disabled"; 238 status = "disabled";
@@ -223,6 +242,7 @@
223 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi"; 242 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi";
224 reg = <0x02030000 0x4000>; 243 reg = <0x02030000 0x4000>;
225 interrupts = <0 48 0x04>; 244 interrupts = <0 48 0x04>;
245 clocks = <&clks 180>;
226 fsl,fifo-depth = <15>; 246 fsl,fifo-depth = <15>;
227 fsl,ssi-dma-events = <46 45>; 247 fsl,ssi-dma-events = <46 45>;
228 status = "disabled"; 248 status = "disabled";
@@ -362,24 +382,26 @@
362 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt"; 382 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
363 reg = <0x020bc000 0x4000>; 383 reg = <0x020bc000 0x4000>;
364 interrupts = <0 80 0x04>; 384 interrupts = <0 80 0x04>;
365 status = "disabled"; 385 clocks = <&clks 0>;
366 }; 386 };
367 387
368 wdog@020c0000 { /* WDOG2 */ 388 wdog@020c0000 { /* WDOG2 */
369 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt"; 389 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
370 reg = <0x020c0000 0x4000>; 390 reg = <0x020c0000 0x4000>;
371 interrupts = <0 81 0x04>; 391 interrupts = <0 81 0x04>;
392 clocks = <&clks 0>;
372 status = "disabled"; 393 status = "disabled";
373 }; 394 };
374 395
375 ccm@020c4000 { 396 clks: ccm@020c4000 {
376 compatible = "fsl,imx6q-ccm"; 397 compatible = "fsl,imx6q-ccm";
377 reg = <0x020c4000 0x4000>; 398 reg = <0x020c4000 0x4000>;
378 interrupts = <0 87 0x04 0 88 0x04>; 399 interrupts = <0 87 0x04 0 88 0x04>;
400 #clock-cells = <1>;
379 }; 401 };
380 402
381 anatop@020c8000 { 403 anatop: anatop@020c8000 {
382 compatible = "fsl,imx6q-anatop"; 404 compatible = "fsl,imx6q-anatop", "syscon", "simple-bus";
383 reg = <0x020c8000 0x1000>; 405 reg = <0x020c8000 0x1000>;
384 interrupts = <0 49 0x04 0 54 0x04 0 127 0x04>; 406 interrupts = <0 49 0x04 0 54 0x04 0 127 0x04>;
385 407
@@ -472,12 +494,14 @@
472 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; 494 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
473 reg = <0x020c9000 0x1000>; 495 reg = <0x020c9000 0x1000>;
474 interrupts = <0 44 0x04>; 496 interrupts = <0 44 0x04>;
497 clocks = <&clks 182>;
475 }; 498 };
476 499
477 usbphy2: usbphy@020ca000 { 500 usbphy2: usbphy@020ca000 {
478 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; 501 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
479 reg = <0x020ca000 0x1000>; 502 reg = <0x020ca000 0x1000>;
480 interrupts = <0 45 0x04>; 503 interrupts = <0 45 0x04>;
504 clocks = <&clks 183>;
481 }; 505 };
482 506
483 snvs@020cc000 { 507 snvs@020cc000 {
@@ -507,6 +531,11 @@
507 interrupts = <0 89 0x04 0 90 0x04>; 531 interrupts = <0 89 0x04 0 90 0x04>;
508 }; 532 };
509 533
534 gpr: iomuxc-gpr@020e0000 {
535 compatible = "fsl,imx6q-iomuxc-gpr", "syscon";
536 reg = <0x020e0000 0x38>;
537 };
538
510 iomuxc@020e0000 { 539 iomuxc@020e0000 {
511 compatible = "fsl,imx6q-iomuxc"; 540 compatible = "fsl,imx6q-iomuxc";
512 reg = <0x020e0000 0x4000>; 541 reg = <0x020e0000 0x4000>;
@@ -514,86 +543,207 @@
514 /* shared pinctrl settings */ 543 /* shared pinctrl settings */
515 audmux { 544 audmux {
516 pinctrl_audmux_1: audmux-1 { 545 pinctrl_audmux_1: audmux-1 {
517 fsl,pins = <18 0x80000000 /* MX6Q_PAD_SD2_DAT0__AUDMUX_AUD4_RXD */ 546 fsl,pins = <
518 1586 0x80000000 /* MX6Q_PAD_SD2_DAT3__AUDMUX_AUD4_TXC */ 547 18 0x80000000 /* MX6Q_PAD_SD2_DAT0__AUDMUX_AUD4_RXD */
519 11 0x80000000 /* MX6Q_PAD_SD2_DAT2__AUDMUX_AUD4_TXD */ 548 1586 0x80000000 /* MX6Q_PAD_SD2_DAT3__AUDMUX_AUD4_TXC */
520 3 0x80000000>; /* MX6Q_PAD_SD2_DAT1__AUDMUX_AUD4_TXFS */ 549 11 0x80000000 /* MX6Q_PAD_SD2_DAT2__AUDMUX_AUD4_TXD */
550 3 0x80000000 /* MX6Q_PAD_SD2_DAT1__AUDMUX_AUD4_TXFS */
551 >;
552 };
553 };
554
555 ecspi1 {
556 pinctrl_ecspi1_1: ecspi1grp-1 {
557 fsl,pins = <
558 101 0x100b1 /* MX6Q_PAD_EIM_D17__ECSPI1_MISO */
559 109 0x100b1 /* MX6Q_PAD_EIM_D18__ECSPI1_MOSI */
560 94 0x100b1 /* MX6Q_PAD_EIM_D16__ECSPI1_SCLK */
561 >;
562 };
563 };
564
565 enet {
566 pinctrl_enet_1: enetgrp-1 {
567 fsl,pins = <
568 695 0x1b0b0 /* MX6Q_PAD_ENET_MDIO__ENET_MDIO */
569 756 0x1b0b0 /* MX6Q_PAD_ENET_MDC__ENET_MDC */
570 24 0x1b0b0 /* MX6Q_PAD_RGMII_TXC__ENET_RGMII_TXC */
571 30 0x1b0b0 /* MX6Q_PAD_RGMII_TD0__ENET_RGMII_TD0 */
572 34 0x1b0b0 /* MX6Q_PAD_RGMII_TD1__ENET_RGMII_TD1 */
573 39 0x1b0b0 /* MX6Q_PAD_RGMII_TD2__ENET_RGMII_TD2 */
574 44 0x1b0b0 /* MX6Q_PAD_RGMII_TD3__ENET_RGMII_TD3 */
575 56 0x1b0b0 /* MX6Q_PAD_RGMII_TX_CTL__RGMII_TX_CTL */
576 702 0x1b0b0 /* MX6Q_PAD_ENET_REF_CLK__ENET_TX_CLK */
577 74 0x1b0b0 /* MX6Q_PAD_RGMII_RXC__ENET_RGMII_RXC */
578 52 0x1b0b0 /* MX6Q_PAD_RGMII_RD0__ENET_RGMII_RD0 */
579 61 0x1b0b0 /* MX6Q_PAD_RGMII_RD1__ENET_RGMII_RD1 */
580 66 0x1b0b0 /* MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2 */
581 70 0x1b0b0 /* MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3 */
582 48 0x1b0b0 /* MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL */
583 >;
584 };
585
586 pinctrl_enet_2: enetgrp-2 {
587 fsl,pins = <
588 890 0x1b0b0 /* MX6Q_PAD_KEY_COL1__ENET_MDIO */
589 909 0x1b0b0 /* MX6Q_PAD_KEY_COL2__ENET_MDC */
590 24 0x1b0b0 /* MX6Q_PAD_RGMII_TXC__ENET_RGMII_TXC */
591 30 0x1b0b0 /* MX6Q_PAD_RGMII_TD0__ENET_RGMII_TD0 */
592 34 0x1b0b0 /* MX6Q_PAD_RGMII_TD1__ENET_RGMII_TD1 */
593 39 0x1b0b0 /* MX6Q_PAD_RGMII_TD2__ENET_RGMII_TD2 */
594 44 0x1b0b0 /* MX6Q_PAD_RGMII_TD3__ENET_RGMII_TD3 */
595 56 0x1b0b0 /* MX6Q_PAD_RGMII_TX_CTL__RGMII_TX_CTL */
596 702 0x1b0b0 /* MX6Q_PAD_ENET_REF_CLK__ENET_TX_CLK */
597 74 0x1b0b0 /* MX6Q_PAD_RGMII_RXC__ENET_RGMII_RXC */
598 52 0x1b0b0 /* MX6Q_PAD_RGMII_RD0__ENET_RGMII_RD0 */
599 61 0x1b0b0 /* MX6Q_PAD_RGMII_RD1__ENET_RGMII_RD1 */
600 66 0x1b0b0 /* MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2 */
601 70 0x1b0b0 /* MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3 */
602 48 0x1b0b0 /* MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL */
603 >;
521 }; 604 };
522 }; 605 };
523 606
524 gpmi-nand { 607 gpmi-nand {
525 pinctrl_gpmi_nand_1: gpmi-nand-1 { 608 pinctrl_gpmi_nand_1: gpmi-nand-1 {
526 fsl,pins = <1328 0xb0b1 /* MX6Q_PAD_NANDF_CLE__RAWNAND_CLE */ 609 fsl,pins = <
527 1336 0xb0b1 /* MX6Q_PAD_NANDF_ALE__RAWNAND_ALE */ 610 1328 0xb0b1 /* MX6Q_PAD_NANDF_CLE__RAWNAND_CLE */
528 1344 0xb0b1 /* MX6Q_PAD_NANDF_WP_B__RAWNAND_RESETN */ 611 1336 0xb0b1 /* MX6Q_PAD_NANDF_ALE__RAWNAND_ALE */
529 1352 0xb000 /* MX6Q_PAD_NANDF_RB0__RAWNAND_READY0 */ 612 1344 0xb0b1 /* MX6Q_PAD_NANDF_WP_B__RAWNAND_RESETN */
530 1360 0xb0b1 /* MX6Q_PAD_NANDF_CS0__RAWNAND_CE0N */ 613 1352 0xb000 /* MX6Q_PAD_NANDF_RB0__RAWNAND_READY0 */
531 1365 0xb0b1 /* MX6Q_PAD_NANDF_CS1__RAWNAND_CE1N */ 614 1360 0xb0b1 /* MX6Q_PAD_NANDF_CS0__RAWNAND_CE0N */
532 1371 0xb0b1 /* MX6Q_PAD_NANDF_CS2__RAWNAND_CE2N */ 615 1365 0xb0b1 /* MX6Q_PAD_NANDF_CS1__RAWNAND_CE1N */
533 1378 0xb0b1 /* MX6Q_PAD_NANDF_CS3__RAWNAND_CE3N */ 616 1371 0xb0b1 /* MX6Q_PAD_NANDF_CS2__RAWNAND_CE2N */
534 1387 0xb0b1 /* MX6Q_PAD_SD4_CMD__RAWNAND_RDN */ 617 1378 0xb0b1 /* MX6Q_PAD_NANDF_CS3__RAWNAND_CE3N */
535 1393 0xb0b1 /* MX6Q_PAD_SD4_CLK__RAWNAND_WRN */ 618 1387 0xb0b1 /* MX6Q_PAD_SD4_CMD__RAWNAND_RDN */
536 1397 0xb0b1 /* MX6Q_PAD_NANDF_D0__RAWNAND_D0 */ 619 1393 0xb0b1 /* MX6Q_PAD_SD4_CLK__RAWNAND_WRN */
537 1405 0xb0b1 /* MX6Q_PAD_NANDF_D1__RAWNAND_D1 */ 620 1397 0xb0b1 /* MX6Q_PAD_NANDF_D0__RAWNAND_D0 */
538 1413 0xb0b1 /* MX6Q_PAD_NANDF_D2__RAWNAND_D2 */ 621 1405 0xb0b1 /* MX6Q_PAD_NANDF_D1__RAWNAND_D1 */
539 1421 0xb0b1 /* MX6Q_PAD_NANDF_D3__RAWNAND_D3 */ 622 1413 0xb0b1 /* MX6Q_PAD_NANDF_D2__RAWNAND_D2 */
540 1429 0xb0b1 /* MX6Q_PAD_NANDF_D4__RAWNAND_D4 */ 623 1421 0xb0b1 /* MX6Q_PAD_NANDF_D3__RAWNAND_D3 */
541 1437 0xb0b1 /* MX6Q_PAD_NANDF_D5__RAWNAND_D5 */ 624 1429 0xb0b1 /* MX6Q_PAD_NANDF_D4__RAWNAND_D4 */
542 1445 0xb0b1 /* MX6Q_PAD_NANDF_D6__RAWNAND_D6 */ 625 1437 0xb0b1 /* MX6Q_PAD_NANDF_D5__RAWNAND_D5 */
543 1453 0xb0b1 /* MX6Q_PAD_NANDF_D7__RAWNAND_D7 */ 626 1445 0xb0b1 /* MX6Q_PAD_NANDF_D6__RAWNAND_D6 */
544 1463 0x00b1>; /* MX6Q_PAD_SD4_DAT0__RAWNAND_DQS */ 627 1453 0xb0b1 /* MX6Q_PAD_NANDF_D7__RAWNAND_D7 */
628 1463 0x00b1 /* MX6Q_PAD_SD4_DAT0__RAWNAND_DQS */
629 >;
545 }; 630 };
546 }; 631 };
547 632
548 i2c1 { 633 i2c1 {
549 pinctrl_i2c1_1: i2c1grp-1 { 634 pinctrl_i2c1_1: i2c1grp-1 {
550 fsl,pins = <137 0x4001b8b1 /* MX6Q_PAD_EIM_D21__I2C1_SCL */ 635 fsl,pins = <
551 196 0x4001b8b1>; /* MX6Q_PAD_EIM_D28__I2C1_SDA */ 636 137 0x4001b8b1 /* MX6Q_PAD_EIM_D21__I2C1_SCL */
637 196 0x4001b8b1 /* MX6Q_PAD_EIM_D28__I2C1_SDA */
638 >;
639 };
640 };
641
642 uart1 {
643 pinctrl_uart1_1: uart1grp-1 {
644 fsl,pins = <
645 1140 0x1b0b1 /* MX6Q_PAD_CSI0_DAT10__UART1_TXD */
646 1148 0x1b0b1 /* MX6Q_PAD_CSI0_DAT11__UART1_RXD */
647 >;
552 }; 648 };
553 }; 649 };
554 650
555 serial2 { 651 uart2 {
556 pinctrl_serial2_1: serial2grp-1 { 652 pinctrl_uart2_1: uart2grp-1 {
557 fsl,pins = <183 0x1b0b1 /* MX6Q_PAD_EIM_D26__UART2_TXD */ 653 fsl,pins = <
558 191 0x1b0b1>; /* MX6Q_PAD_EIM_D27__UART2_RXD */ 654 183 0x1b0b1 /* MX6Q_PAD_EIM_D26__UART2_TXD */
655 191 0x1b0b1 /* MX6Q_PAD_EIM_D27__UART2_RXD */
656 >;
657 };
658 };
659
660 uart4 {
661 pinctrl_uart4_1: uart4grp-1 {
662 fsl,pins = <
663 877 0x1b0b1 /* MX6Q_PAD_KEY_COL0__UART4_TXD */
664 885 0x1b0b1 /* MX6Q_PAD_KEY_ROW0__UART4_RXD */
665 >;
666 };
667 };
668
669 usbotg {
670 pinctrl_usbotg_1: usbotggrp-1 {
671 fsl,pins = <
672 1592 0x17059 /* MX6Q_PAD_GPIO_1__ANATOP_USBOTG_ID */
673 >;
674 };
675 };
676
677 usdhc2 {
678 pinctrl_usdhc2_1: usdhc2grp-1 {
679 fsl,pins = <
680 1577 0x17059 /* MX6Q_PAD_SD2_CMD__USDHC2_CMD */
681 1569 0x10059 /* MX6Q_PAD_SD2_CLK__USDHC2_CLK */
682 16 0x17059 /* MX6Q_PAD_SD2_DAT0__USDHC2_DAT0 */
683 0 0x17059 /* MX6Q_PAD_SD2_DAT1__USDHC2_DAT1 */
684 8 0x17059 /* MX6Q_PAD_SD2_DAT2__USDHC2_DAT2 */
685 1583 0x17059 /* MX6Q_PAD_SD2_DAT3__USDHC2_DAT3 */
686 1430 0x17059 /* MX6Q_PAD_NANDF_D4__USDHC2_DAT4 */
687 1438 0x17059 /* MX6Q_PAD_NANDF_D5__USDHC2_DAT5 */
688 1446 0x17059 /* MX6Q_PAD_NANDF_D6__USDHC2_DAT6 */
689 1454 0x17059 /* MX6Q_PAD_NANDF_D7__USDHC2_DAT7 */
690 >;
559 }; 691 };
560 }; 692 };
561 693
562 usdhc3 { 694 usdhc3 {
563 pinctrl_usdhc3_1: usdhc3grp-1 { 695 pinctrl_usdhc3_1: usdhc3grp-1 {
564 fsl,pins = <1273 0x17059 /* MX6Q_PAD_SD3_CMD__USDHC3_CMD */ 696 fsl,pins = <
565 1281 0x10059 /* MX6Q_PAD_SD3_CLK__USDHC3_CLK */ 697 1273 0x17059 /* MX6Q_PAD_SD3_CMD__USDHC3_CMD */
566 1289 0x17059 /* MX6Q_PAD_SD3_DAT0__USDHC3_DAT0 */ 698 1281 0x10059 /* MX6Q_PAD_SD3_CLK__USDHC3_CLK */
567 1297 0x17059 /* MX6Q_PAD_SD3_DAT1__USDHC3_DAT1 */ 699 1289 0x17059 /* MX6Q_PAD_SD3_DAT0__USDHC3_DAT0 */
568 1305 0x17059 /* MX6Q_PAD_SD3_DAT2__USDHC3_DAT2 */ 700 1297 0x17059 /* MX6Q_PAD_SD3_DAT1__USDHC3_DAT1 */
569 1312 0x17059 /* MX6Q_PAD_SD3_DAT3__USDHC3_DAT3 */ 701 1305 0x17059 /* MX6Q_PAD_SD3_DAT2__USDHC3_DAT2 */
570 1265 0x17059 /* MX6Q_PAD_SD3_DAT4__USDHC3_DAT4 */ 702 1312 0x17059 /* MX6Q_PAD_SD3_DAT3__USDHC3_DAT3 */
571 1257 0x17059 /* MX6Q_PAD_SD3_DAT5__USDHC3_DAT5 */ 703 1265 0x17059 /* MX6Q_PAD_SD3_DAT4__USDHC3_DAT4 */
572 1249 0x17059 /* MX6Q_PAD_SD3_DAT6__USDHC3_DAT6 */ 704 1257 0x17059 /* MX6Q_PAD_SD3_DAT5__USDHC3_DAT5 */
573 1241 0x17059>; /* MX6Q_PAD_SD3_DAT7__USDHC3_DAT7 */ 705 1249 0x17059 /* MX6Q_PAD_SD3_DAT6__USDHC3_DAT6 */
706 1241 0x17059 /* MX6Q_PAD_SD3_DAT7__USDHC3_DAT7 */
707 >;
708 };
709
710 pinctrl_usdhc3_2: usdhc3grp-2 {
711 fsl,pins = <
712 1273 0x17059 /* MX6Q_PAD_SD3_CMD__USDHC3_CMD */
713 1281 0x10059 /* MX6Q_PAD_SD3_CLK__USDHC3_CLK */
714 1289 0x17059 /* MX6Q_PAD_SD3_DAT0__USDHC3_DAT0 */
715 1297 0x17059 /* MX6Q_PAD_SD3_DAT1__USDHC3_DAT1 */
716 1305 0x17059 /* MX6Q_PAD_SD3_DAT2__USDHC3_DAT2 */
717 1312 0x17059 /* MX6Q_PAD_SD3_DAT3__USDHC3_DAT3 */
718 >;
574 }; 719 };
575 }; 720 };
576 721
577 usdhc4 { 722 usdhc4 {
578 pinctrl_usdhc4_1: usdhc4grp-1 { 723 pinctrl_usdhc4_1: usdhc4grp-1 {
579 fsl,pins = <1386 0x17059 /* MX6Q_PAD_SD4_CMD__USDHC4_CMD */ 724 fsl,pins = <
580 1392 0x10059 /* MX6Q_PAD_SD4_CLK__USDHC4_CLK */ 725 1386 0x17059 /* MX6Q_PAD_SD4_CMD__USDHC4_CMD */
581 1462 0x17059 /* MX6Q_PAD_SD4_DAT0__USDHC4_DAT0 */ 726 1392 0x10059 /* MX6Q_PAD_SD4_CLK__USDHC4_CLK */
582 1470 0x17059 /* MX6Q_PAD_SD4_DAT1__USDHC4_DAT1 */ 727 1462 0x17059 /* MX6Q_PAD_SD4_DAT0__USDHC4_DAT0 */
583 1478 0x17059 /* MX6Q_PAD_SD4_DAT2__USDHC4_DAT2 */ 728 1470 0x17059 /* MX6Q_PAD_SD4_DAT1__USDHC4_DAT1 */
584 1486 0x17059 /* MX6Q_PAD_SD4_DAT3__USDHC4_DAT3 */ 729 1478 0x17059 /* MX6Q_PAD_SD4_DAT2__USDHC4_DAT2 */
585 1493 0x17059 /* MX6Q_PAD_SD4_DAT4__USDHC4_DAT4 */ 730 1486 0x17059 /* MX6Q_PAD_SD4_DAT3__USDHC4_DAT3 */
586 1501 0x17059 /* MX6Q_PAD_SD4_DAT5__USDHC4_DAT5 */ 731 1493 0x17059 /* MX6Q_PAD_SD4_DAT4__USDHC4_DAT4 */
587 1509 0x17059 /* MX6Q_PAD_SD4_DAT6__USDHC4_DAT6 */ 732 1501 0x17059 /* MX6Q_PAD_SD4_DAT5__USDHC4_DAT5 */
588 1517 0x17059>; /* MX6Q_PAD_SD4_DAT7__USDHC4_DAT7 */ 733 1509 0x17059 /* MX6Q_PAD_SD4_DAT6__USDHC4_DAT6 */
734 1517 0x17059 /* MX6Q_PAD_SD4_DAT7__USDHC4_DAT7 */
735 >;
589 }; 736 };
590 };
591 737
592 ecspi1 { 738 pinctrl_usdhc4_2: usdhc4grp-2 {
593 pinctrl_ecspi1_1: ecspi1grp-1 { 739 fsl,pins = <
594 fsl,pins = <101 0x100b1 /* MX6Q_PAD_EIM_D17__ECSPI1_MISO */ 740 1386 0x17059 /* MX6Q_PAD_SD4_CMD__USDHC4_CMD */
595 109 0x100b1 /* MX6Q_PAD_EIM_D18__ECSPI1_MOSI */ 741 1392 0x10059 /* MX6Q_PAD_SD4_CLK__USDHC4_CLK */
596 94 0x100b1>; /* MX6Q_PAD_EIM_D16__ECSPI1_SCLK */ 742 1462 0x17059 /* MX6Q_PAD_SD4_DAT0__USDHC4_DAT0 */
743 1470 0x17059 /* MX6Q_PAD_SD4_DAT1__USDHC4_DAT1 */
744 1478 0x17059 /* MX6Q_PAD_SD4_DAT2__USDHC4_DAT2 */
745 1486 0x17059 /* MX6Q_PAD_SD4_DAT3__USDHC4_DAT3 */
746 >;
597 }; 747 };
598 }; 748 };
599 }; 749 };
@@ -612,6 +762,9 @@
612 compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma"; 762 compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma";
613 reg = <0x020ec000 0x4000>; 763 reg = <0x020ec000 0x4000>;
614 interrupts = <0 2 0x04>; 764 interrupts = <0 2 0x04>;
765 clocks = <&clks 155>, <&clks 155>;
766 clock-names = "ipg", "ahb";
767 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx6q-to1.bin";
615 }; 768 };
616 }; 769 };
617 770
@@ -635,7 +788,9 @@
635 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 788 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
636 reg = <0x02184000 0x200>; 789 reg = <0x02184000 0x200>;
637 interrupts = <0 43 0x04>; 790 interrupts = <0 43 0x04>;
791 clocks = <&clks 162>;
638 fsl,usbphy = <&usbphy1>; 792 fsl,usbphy = <&usbphy1>;
793 fsl,usbmisc = <&usbmisc 0>;
639 status = "disabled"; 794 status = "disabled";
640 }; 795 };
641 796
@@ -643,7 +798,9 @@
643 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 798 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
644 reg = <0x02184200 0x200>; 799 reg = <0x02184200 0x200>;
645 interrupts = <0 40 0x04>; 800 interrupts = <0 40 0x04>;
801 clocks = <&clks 162>;
646 fsl,usbphy = <&usbphy2>; 802 fsl,usbphy = <&usbphy2>;
803 fsl,usbmisc = <&usbmisc 1>;
647 status = "disabled"; 804 status = "disabled";
648 }; 805 };
649 806
@@ -651,6 +808,8 @@
651 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 808 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
652 reg = <0x02184400 0x200>; 809 reg = <0x02184400 0x200>;
653 interrupts = <0 41 0x04>; 810 interrupts = <0 41 0x04>;
811 clocks = <&clks 162>;
812 fsl,usbmisc = <&usbmisc 2>;
654 status = "disabled"; 813 status = "disabled";
655 }; 814 };
656 815
@@ -658,13 +817,24 @@
658 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 817 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
659 reg = <0x02184600 0x200>; 818 reg = <0x02184600 0x200>;
660 interrupts = <0 42 0x04>; 819 interrupts = <0 42 0x04>;
820 clocks = <&clks 162>;
821 fsl,usbmisc = <&usbmisc 3>;
661 status = "disabled"; 822 status = "disabled";
662 }; 823 };
663 824
825 usbmisc: usbmisc@02184800 {
826 #index-cells = <1>;
827 compatible = "fsl,imx6q-usbmisc";
828 reg = <0x02184800 0x200>;
829 clocks = <&clks 162>;
830 };
831
664 ethernet@02188000 { 832 ethernet@02188000 {
665 compatible = "fsl,imx6q-fec"; 833 compatible = "fsl,imx6q-fec";
666 reg = <0x02188000 0x4000>; 834 reg = <0x02188000 0x4000>;
667 interrupts = <0 118 0x04 0 119 0x04>; 835 interrupts = <0 118 0x04 0 119 0x04>;
836 clocks = <&clks 117>, <&clks 117>;
837 clock-names = "ipg", "ahb";
668 status = "disabled"; 838 status = "disabled";
669 }; 839 };
670 840
@@ -677,6 +847,8 @@
677 compatible = "fsl,imx6q-usdhc"; 847 compatible = "fsl,imx6q-usdhc";
678 reg = <0x02190000 0x4000>; 848 reg = <0x02190000 0x4000>;
679 interrupts = <0 22 0x04>; 849 interrupts = <0 22 0x04>;
850 clocks = <&clks 163>, <&clks 163>, <&clks 163>;
851 clock-names = "ipg", "ahb", "per";
680 status = "disabled"; 852 status = "disabled";
681 }; 853 };
682 854
@@ -684,6 +856,8 @@
684 compatible = "fsl,imx6q-usdhc"; 856 compatible = "fsl,imx6q-usdhc";
685 reg = <0x02194000 0x4000>; 857 reg = <0x02194000 0x4000>;
686 interrupts = <0 23 0x04>; 858 interrupts = <0 23 0x04>;
859 clocks = <&clks 164>, <&clks 164>, <&clks 164>;
860 clock-names = "ipg", "ahb", "per";
687 status = "disabled"; 861 status = "disabled";
688 }; 862 };
689 863
@@ -691,6 +865,8 @@
691 compatible = "fsl,imx6q-usdhc"; 865 compatible = "fsl,imx6q-usdhc";
692 reg = <0x02198000 0x4000>; 866 reg = <0x02198000 0x4000>;
693 interrupts = <0 24 0x04>; 867 interrupts = <0 24 0x04>;
868 clocks = <&clks 165>, <&clks 165>, <&clks 165>;
869 clock-names = "ipg", "ahb", "per";
694 status = "disabled"; 870 status = "disabled";
695 }; 871 };
696 872
@@ -698,6 +874,8 @@
698 compatible = "fsl,imx6q-usdhc"; 874 compatible = "fsl,imx6q-usdhc";
699 reg = <0x0219c000 0x4000>; 875 reg = <0x0219c000 0x4000>;
700 interrupts = <0 25 0x04>; 876 interrupts = <0 25 0x04>;
877 clocks = <&clks 166>, <&clks 166>, <&clks 166>;
878 clock-names = "ipg", "ahb", "per";
701 status = "disabled"; 879 status = "disabled";
702 }; 880 };
703 881
@@ -707,6 +885,7 @@
707 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c"; 885 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c";
708 reg = <0x021a0000 0x4000>; 886 reg = <0x021a0000 0x4000>;
709 interrupts = <0 36 0x04>; 887 interrupts = <0 36 0x04>;
888 clocks = <&clks 125>;
710 status = "disabled"; 889 status = "disabled";
711 }; 890 };
712 891
@@ -716,6 +895,7 @@
716 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c"; 895 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c";
717 reg = <0x021a4000 0x4000>; 896 reg = <0x021a4000 0x4000>;
718 interrupts = <0 37 0x04>; 897 interrupts = <0 37 0x04>;
898 clocks = <&clks 126>;
719 status = "disabled"; 899 status = "disabled";
720 }; 900 };
721 901
@@ -725,6 +905,7 @@
725 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c"; 905 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c";
726 reg = <0x021a8000 0x4000>; 906 reg = <0x021a8000 0x4000>;
727 interrupts = <0 38 0x04>; 907 interrupts = <0 38 0x04>;
908 clocks = <&clks 127>;
728 status = "disabled"; 909 status = "disabled";
729 }; 910 };
730 911
@@ -788,6 +969,8 @@
788 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 969 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
789 reg = <0x021e8000 0x4000>; 970 reg = <0x021e8000 0x4000>;
790 interrupts = <0 27 0x04>; 971 interrupts = <0 27 0x04>;
972 clocks = <&clks 160>, <&clks 161>;
973 clock-names = "ipg", "per";
791 status = "disabled"; 974 status = "disabled";
792 }; 975 };
793 976
@@ -795,6 +978,8 @@
795 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 978 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
796 reg = <0x021ec000 0x4000>; 979 reg = <0x021ec000 0x4000>;
797 interrupts = <0 28 0x04>; 980 interrupts = <0 28 0x04>;
981 clocks = <&clks 160>, <&clks 161>;
982 clock-names = "ipg", "per";
798 status = "disabled"; 983 status = "disabled";
799 }; 984 };
800 985
@@ -802,6 +987,8 @@
802 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 987 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
803 reg = <0x021f0000 0x4000>; 988 reg = <0x021f0000 0x4000>;
804 interrupts = <0 29 0x04>; 989 interrupts = <0 29 0x04>;
990 clocks = <&clks 160>, <&clks 161>;
991 clock-names = "ipg", "per";
805 status = "disabled"; 992 status = "disabled";
806 }; 993 };
807 994
@@ -809,6 +996,8 @@
809 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 996 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
810 reg = <0x021f4000 0x4000>; 997 reg = <0x021f4000 0x4000>;
811 interrupts = <0 30 0x04>; 998 interrupts = <0 30 0x04>;
999 clocks = <&clks 160>, <&clks 161>;
1000 clock-names = "ipg", "per";
812 status = "disabled"; 1001 status = "disabled";
813 }; 1002 };
814 }; 1003 };
diff --git a/arch/arm/boot/dts/integrator.dtsi b/arch/arm/boot/dts/integrator.dtsi
new file mode 100644
index 00000000000..813b91d7bea
--- /dev/null
+++ b/arch/arm/boot/dts/integrator.dtsi
@@ -0,0 +1,76 @@
1/*
2 * SoC core Device Tree for the ARM Integrator platforms
3 */
4
5/include/ "skeleton.dtsi"
6
7/ {
8 timer@13000000 {
9 reg = <0x13000000 0x100>;
10 interrupt-parent = <&pic>;
11 interrupts = <5>;
12 };
13
14 timer@13000100 {
15 reg = <0x13000100 0x100>;
16 interrupt-parent = <&pic>;
17 interrupts = <6>;
18 };
19
20 timer@13000200 {
21 reg = <0x13000200 0x100>;
22 interrupt-parent = <&pic>;
23 interrupts = <7>;
24 };
25
26 pic@14000000 {
27 compatible = "arm,versatile-fpga-irq";
28 #interrupt-cells = <1>;
29 interrupt-controller;
30 reg = <0x14000000 0x100>;
31 clear-mask = <0xffffffff>;
32 };
33
34 flash@24000000 {
35 compatible = "cfi-flash";
36 reg = <0x24000000 0x02000000>;
37 };
38
39 fpga {
40 compatible = "arm,amba-bus", "simple-bus";
41 #address-cells = <1>;
42 #size-cells = <1>;
43 ranges;
44 interrupt-parent = <&pic>;
45
46 /*
47 * These PrimeCells are in the same locations and using the
48 * same interrupts in all Integrators, however the silicon
49 * version deployed is different.
50 */
51 rtc@15000000 {
52 reg = <0x15000000 0x1000>;
53 interrupts = <8>;
54 };
55
56 uart@16000000 {
57 reg = <0x16000000 0x1000>;
58 interrupts = <1>;
59 };
60
61 uart@17000000 {
62 reg = <0x17000000 0x1000>;
63 interrupts = <2>;
64 };
65
66 kmi@18000000 {
67 reg = <0x18000000 0x1000>;
68 interrupts = <3>;
69 };
70
71 kmi@19000000 {
72 reg = <0x19000000 0x1000>;
73 interrupts = <4>;
74 };
75 };
76};
diff --git a/arch/arm/boot/dts/integratorap.dts b/arch/arm/boot/dts/integratorap.dts
new file mode 100644
index 00000000000..61767757b50
--- /dev/null
+++ b/arch/arm/boot/dts/integratorap.dts
@@ -0,0 +1,68 @@
1/*
2 * Device Tree for the ARM Integrator/AP platform
3 */
4
5/dts-v1/;
6/include/ "integrator.dtsi"
7
8/ {
9 model = "ARM Integrator/AP";
10 compatible = "arm,integrator-ap";
11
12 aliases {
13 arm,timer-primary = &timer2;
14 arm,timer-secondary = &timer1;
15 };
16
17 chosen {
18 bootargs = "root=/dev/ram0 console=ttyAM0,38400n8 earlyprintk";
19 };
20
21 timer0: timer@13000000 {
22 compatible = "arm,integrator-timer";
23 };
24
25 timer1: timer@13000100 {
26 compatible = "arm,integrator-timer";
27 };
28
29 timer2: timer@13000200 {
30 compatible = "arm,integrator-timer";
31 };
32
33 pic: pic@14000000 {
34 valid-mask = <0x003fffff>;
35 };
36
37 fpga {
38 /*
39 * The Integator/AP predates the idea to have magic numbers
40 * identifying the PrimeCell in hardware, thus we have to
41 * supply these from the device tree.
42 */
43 rtc: rtc@15000000 {
44 compatible = "arm,pl030", "arm,primecell";
45 arm,primecell-periphid = <0x00041030>;
46 };
47
48 uart0: uart@16000000 {
49 compatible = "arm,pl010", "arm,primecell";
50 arm,primecell-periphid = <0x00041010>;
51 };
52
53 uart1: uart@17000000 {
54 compatible = "arm,pl010", "arm,primecell";
55 arm,primecell-periphid = <0x00041010>;
56 };
57
58 kmi0: kmi@18000000 {
59 compatible = "arm,pl050", "arm,primecell";
60 arm,primecell-periphid = <0x00041050>;
61 };
62
63 kmi1: kmi@19000000 {
64 compatible = "arm,pl050", "arm,primecell";
65 arm,primecell-periphid = <0x00041050>;
66 };
67 };
68};
diff --git a/arch/arm/boot/dts/integratorcp.dts b/arch/arm/boot/dts/integratorcp.dts
new file mode 100644
index 00000000000..2dd5e4e4848
--- /dev/null
+++ b/arch/arm/boot/dts/integratorcp.dts
@@ -0,0 +1,110 @@
1/*
2 * Device Tree for the ARM Integrator/CP platform
3 */
4
5/dts-v1/;
6/include/ "integrator.dtsi"
7
8/ {
9 model = "ARM Integrator/CP";
10 compatible = "arm,integrator-cp";
11
12 aliases {
13 arm,timer-primary = &timer2;
14 arm,timer-secondary = &timer1;
15 };
16
17 chosen {
18 bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk";
19 };
20
21 timer0: timer@13000000 {
22 compatible = "arm,sp804", "arm,primecell";
23 };
24
25 timer1: timer@13000100 {
26 compatible = "arm,sp804", "arm,primecell";
27 };
28
29 timer2: timer@13000200 {
30 compatible = "arm,sp804", "arm,primecell";
31 };
32
33 pic: pic@14000000 {
34 valid-mask = <0x1fc003ff>;
35 };
36
37 cic: cic@10000040 {
38 compatible = "arm,versatile-fpga-irq";
39 #interrupt-cells = <1>;
40 interrupt-controller;
41 reg = <0x10000040 0x100>;
42 clear-mask = <0xffffffff>;
43 valid-mask = <0x00000007>;
44 };
45
46 sic: sic@ca000000 {
47 compatible = "arm,versatile-fpga-irq";
48 #interrupt-cells = <1>;
49 interrupt-controller;
50 reg = <0xca000000 0x100>;
51 clear-mask = <0x00000fff>;
52 valid-mask = <0x00000fff>;
53 };
54
55 ethernet@c8000000 {
56 compatible = "smsc,lan91c111";
57 reg = <0xc8000000 0x10>;
58 interrupt-parent = <&pic>;
59 interrupts = <27>;
60 };
61
62 fpga {
63 /*
64 * These PrimeCells are at the same location and using
65 * the same interrupts in all Integrators, but in the CP
66 * slightly newer versions are deployed.
67 */
68 rtc@15000000 {
69 compatible = "arm,pl031", "arm,primecell";
70 };
71
72 uart@16000000 {
73 compatible = "arm,pl011", "arm,primecell";
74 };
75
76 uart@17000000 {
77 compatible = "arm,pl011", "arm,primecell";
78 };
79
80 kmi@18000000 {
81 compatible = "arm,pl050", "arm,primecell";
82 };
83
84 kmi@19000000 {
85 compatible = "arm,pl050", "arm,primecell";
86 };
87
88 /*
89 * These PrimeCells are only available on the Integrator/CP
90 */
91 mmc@1c000000 {
92 compatible = "arm,pl180", "arm,primecell";
93 reg = <0x1c000000 0x1000>;
94 interrupts = <23 24>;
95 max-frequency = <515633>;
96 };
97
98 aaci@1d000000 {
99 compatible = "arm,pl041", "arm,primecell";
100 reg = <0x1d000000 0x1000>;
101 interrupts = <25>;
102 };
103
104 clcd@c0000000 {
105 compatible = "arm,pl110", "arm,primecell";
106 reg = <0xC0000000 0x1000>;
107 interrupts = <22>;
108 };
109 };
110};
diff --git a/arch/arm/boot/dts/kirkwood-dnskw.dtsi b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
index 7408655f91b..9b32d027282 100644
--- a/arch/arm/boot/dts/kirkwood-dnskw.dtsi
+++ b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
@@ -25,6 +25,16 @@
25 }; 25 };
26 }; 26 };
27 27
28 gpio_fan {
29 /* Fan: ADDA AD045HB-G73 40mm 6000rpm@5v */
30 compatible = "gpio-fan";
31 gpios = <&gpio1 14 1
32 &gpio1 13 1>;
33 gpio-fan,speed-map = <0 0
34 3000 1
35 6000 2>;
36 };
37
28 ocp@f1000000 { 38 ocp@f1000000 {
29 sata@80000 { 39 sata@80000 {
30 status = "okay"; 40 status = "okay";
diff --git a/arch/arm/boot/dts/kirkwood-dockstar.dts b/arch/arm/boot/dts/kirkwood-dockstar.dts
new file mode 100644
index 00000000000..08a582414b8
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dockstar.dts
@@ -0,0 +1,57 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "Seagate FreeAgent Dockstar";
7 compatible = "seagate,dockstar", "marvell,kirkwood-88f6281", "marvell,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x8000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk root=/dev/sda1 rootdelay=10";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <200000000>;
21 status = "ok";
22 };
23
24 nand@3000000 {
25 status = "okay";
26
27 partition@0 {
28 label = "u-boot";
29 reg = <0x0000000 0x100000>;
30 read-only;
31 };
32
33 partition@100000 {
34 label = "uImage";
35 reg = <0x0100000 0x400000>;
36 };
37
38 partition@500000 {
39 label = "data";
40 reg = <0x0500000 0xfb00000>;
41 };
42 };
43 };
44 gpio-leds {
45 compatible = "gpio-leds";
46
47 health {
48 label = "status:green:health";
49 gpios = <&gpio1 14 1>;
50 linux,default-trigger = "default-on";
51 };
52 fault {
53 label = "status:orange:fault";
54 gpios = <&gpio1 15 1>;
55 };
56 };
57};
diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
index f8ca6fa8819..d97cd9d4753 100644
--- a/arch/arm/boot/dts/kirkwood-iconnect.dts
+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
@@ -12,7 +12,7 @@
12 }; 12 };
13 13
14 chosen { 14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk mtdparts=orion_nand:0xc0000@0x0(uboot),0x20000@0xa0000(env),0x300000@0x100000(zImage),0x300000@0x540000(initrd),0x1f400000@0x980000(boot)"; 15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 linux,initrd-start = <0x4500040>; 16 linux,initrd-start = <0x4500040>;
17 linux,initrd-end = <0x4800000>; 17 linux,initrd-end = <0x4800000>;
18 }; 18 };
@@ -30,7 +30,37 @@
30 clock-frequency = <200000000>; 30 clock-frequency = <200000000>;
31 status = "ok"; 31 status = "ok";
32 }; 32 };
33
34 nand@3000000 {
35 status = "okay";
36
37 partition@0 {
38 label = "uboot";
39 reg = <0x0000000 0xc0000>;
40 };
41
42 partition@a0000 {
43 label = "env";
44 reg = <0xa0000 0x20000>;
45 };
46
47 partition@100000 {
48 label = "zImage";
49 reg = <0x100000 0x300000>;
50 };
51
52 partition@540000 {
53 label = "initrd";
54 reg = <0x540000 0x300000>;
55 };
56
57 partition@980000 {
58 label = "boot";
59 reg = <0x980000 0x1f400000>;
60 };
61 };
33 }; 62 };
63
34 gpio-leds { 64 gpio-leds {
35 compatible = "gpio-leds"; 65 compatible = "gpio-leds";
36 66
@@ -69,4 +99,22 @@
69 gpios = <&gpio1 16 0>; 99 gpios = <&gpio1 16 0>;
70 }; 100 };
71 }; 101 };
102
103 gpio_keys {
104 compatible = "gpio-keys";
105 #address-cells = <1>;
106 #size-cells = <0>;
107 button@1 {
108 label = "OTB Button";
109 linux,code = <133>;
110 gpios = <&gpio1 3 1>;
111 debounce-interval = <100>;
112 };
113 button@2 {
114 label = "Reset";
115 linux,code = <0x198>;
116 gpios = <&gpio0 12 1>;
117 debounce-interval = <100>;
118 };
119 };
72}; 120};
diff --git a/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
new file mode 100644
index 00000000000..865aeec40a2
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
@@ -0,0 +1,105 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "Iomega StorCenter ix2-200";
7 compatible = "iom,ix2-200", "marvell,kirkwood-88f6281", "marvell,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x10000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 ocp@f1000000 {
19 i2c@11000 {
20 status = "okay";
21
22 lm63: lm63@4c {
23 compatible = "national,lm63";
24 reg = <0x4c>;
25 };
26 };
27
28 serial@12000 {
29 clock-frequency = <200000000>;
30 status = "ok";
31 };
32
33 nand@3000000 {
34 status = "okay";
35
36 partition@0 {
37 label = "u-boot";
38 reg = <0x0000000 0x100000>;
39 read-only;
40 };
41
42 partition@a0000 {
43 label = "env";
44 reg = <0xa0000 0x20000>;
45 read-only;
46 };
47
48 partition@100000 {
49 label = "uImage";
50 reg = <0x100000 0x300000>;
51 };
52
53 partition@400000 {
54 label = "uInitrd";
55 reg = <0x540000 0x1000000>;
56 };
57 };
58 sata@80000 {
59 status = "okay";
60 nr-ports = <2>;
61 };
62
63 };
64 gpio-leds {
65 compatible = "gpio-leds";
66
67 power_led {
68 label = "status:white:power_led";
69 gpios = <&gpio0 16 0>;
70 linux,default-trigger = "default-on";
71 };
72 health_led1 {
73 label = "status:red:health_led";
74 gpios = <&gpio1 5 0>;
75 };
76 health_led2 {
77 label = "status:white:health_led";
78 gpios = <&gpio1 4 0>;
79 };
80 backup_led {
81 label = "status:blue:backup_led";
82 gpios = <&gpio0 15 0>;
83 };
84 };
85 gpio-keys {
86 compatible = "gpio-keys";
87 #address-cells = <1>;
88 #size-cells = <0>;
89 Power {
90 label = "Power Button";
91 linux,code = <116>;
92 gpios = <&gpio0 14 1>;
93 };
94 Reset {
95 label = "Reset Button";
96 linux,code = <0x198>;
97 gpios = <&gpio0 12 1>;
98 };
99 OTB {
100 label = "OTB Button";
101 linux,code = <133>;
102 gpios = <&gpio1 3 1>;
103 };
104 };
105};
diff --git a/arch/arm/boot/dts/kirkwood-km_kirkwood.dts b/arch/arm/boot/dts/kirkwood-km_kirkwood.dts
new file mode 100644
index 00000000000..75bdb93fed2
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-km_kirkwood.dts
@@ -0,0 +1,29 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "Keymile Kirkwood Reference Design";
7 compatible = "keymile,km_kirkwood", "marvell,kirkwood-98DX4122", "marvell,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x08000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <200000000>;
21 status = "ok";
22 };
23
24 nand@3000000 {
25 status = "ok";
26 chip-delay = <25>;
27 };
28 };
29};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index cef9616f330..4e5b8154a5b 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -14,7 +14,8 @@
14 14
15 ocp@f1000000 { 15 ocp@f1000000 {
16 compatible = "simple-bus"; 16 compatible = "simple-bus";
17 ranges = <0 0xf1000000 0x4000000>; 17 ranges = <0x00000000 0xf1000000 0x4000000
18 0xf5000000 0xf5000000 0x0000400>;
18 #address-cells = <1>; 19 #address-cells = <1>;
19 #size-cells = <1>; 20 #size-cells = <1>;
20 21
@@ -105,5 +106,14 @@
105 clock-frequency = <100000>; 106 clock-frequency = <100000>;
106 status = "disabled"; 107 status = "disabled";
107 }; 108 };
109
110 crypto@30000 {
111 compatible = "marvell,orion-crypto";
112 reg = <0x30000 0x10000>,
113 <0xf5000000 0x800>;
114 reg-names = "regs", "sram";
115 interrupts = <22>;
116 status = "okay";
117 };
108 }; 118 };
109}; 119};
diff --git a/arch/arm/boot/dts/mmp2.dtsi b/arch/arm/boot/dts/mmp2.dtsi
index 80f74e25640..0514fb41627 100644
--- a/arch/arm/boot/dts/mmp2.dtsi
+++ b/arch/arm/boot/dts/mmp2.dtsi
@@ -26,6 +26,11 @@
26 interrupt-parent = <&intc>; 26 interrupt-parent = <&intc>;
27 ranges; 27 ranges;
28 28
29 L2: l2-cache {
30 compatible = "marvell,tauros2-cache";
31 marvell,tauros2-cache-features = <0x3>;
32 };
33
29 axi@d4200000 { /* AXI */ 34 axi@d4200000 { /* AXI */
30 compatible = "mrvl,axi-bus", "simple-bus"; 35 compatible = "mrvl,axi-bus", "simple-bus";
31 #address-cells = <1>; 36 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/msm8660-surf.dts b/arch/arm/boot/dts/msm8660-surf.dts
index 45bc4bb04e5..31f2157cd7d 100644
--- a/arch/arm/boot/dts/msm8660-surf.dts
+++ b/arch/arm/boot/dts/msm8660-surf.dts
@@ -7,7 +7,7 @@
7 compatible = "qcom,msm8660-surf", "qcom,msm8660"; 7 compatible = "qcom,msm8660-surf", "qcom,msm8660";
8 interrupt-parent = <&intc>; 8 interrupt-parent = <&intc>;
9 9
10 intc: interrupt-controller@02080000 { 10 intc: interrupt-controller@2080000 {
11 compatible = "qcom,msm-8660-qgic"; 11 compatible = "qcom,msm-8660-qgic";
12 interrupt-controller; 12 interrupt-controller;
13 #interrupt-cells = <3>; 13 #interrupt-cells = <3>;
@@ -15,6 +15,23 @@
15 < 0x02081000 0x1000 >; 15 < 0x02081000 0x1000 >;
16 }; 16 };
17 17
18 timer@2000004 {
19 compatible = "qcom,msm-gpt", "qcom,msm-timer";
20 interrupts = <1 1 0x301>;
21 reg = <0x02000004 0x10>;
22 clock-frequency = <32768>;
23 cpu-offset = <0x40000>;
24 };
25
26 timer@2000024 {
27 compatible = "qcom,msm-dgt", "qcom,msm-timer";
28 interrupts = <1 0 0x301>;
29 reg = <0x02000024 0x10>,
30 <0x02000034 0x4>;
31 clock-frequency = <6750000>;
32 cpu-offset = <0x40000>;
33 };
34
18 serial@19c400000 { 35 serial@19c400000 {
19 compatible = "qcom,msm-hsuart", "qcom,msm-uart"; 36 compatible = "qcom,msm-hsuart", "qcom,msm-uart";
20 reg = <0x19c40000 0x1000>, 37 reg = <0x19c40000 0x1000>,
diff --git a/arch/arm/boot/dts/msm8960-cdp.dts b/arch/arm/boot/dts/msm8960-cdp.dts
new file mode 100644
index 00000000000..9e621b5ad3d
--- /dev/null
+++ b/arch/arm/boot/dts/msm8960-cdp.dts
@@ -0,0 +1,41 @@
1/dts-v1/;
2
3/include/ "skeleton.dtsi"
4
5/ {
6 model = "Qualcomm MSM8960 CDP";
7 compatible = "qcom,msm8960-cdp", "qcom,msm8960";
8 interrupt-parent = <&intc>;
9
10 intc: interrupt-controller@2000000 {
11 compatible = "qcom,msm-qgic2";
12 interrupt-controller;
13 #interrupt-cells = <3>;
14 reg = < 0x02000000 0x1000 >,
15 < 0x02002000 0x1000 >;
16 };
17
18 timer@200a004 {
19 compatible = "qcom,msm-gpt", "qcom,msm-timer";
20 interrupts = <1 2 0x301>;
21 reg = <0x0200a004 0x10>;
22 clock-frequency = <32768>;
23 cpu-offset = <0x80000>;
24 };
25
26 timer@200a024 {
27 compatible = "qcom,msm-dgt", "qcom,msm-timer";
28 interrupts = <1 1 0x301>;
29 reg = <0x0200a024 0x10>,
30 <0x0200a034 0x4>;
31 clock-frequency = <6750000>;
32 cpu-offset = <0x80000>;
33 };
34
35 serial@19c400000 {
36 compatible = "qcom,msm-hsuart", "qcom,msm-uart";
37 reg = <0x16440000 0x1000>,
38 <0x16400000 0x1000>;
39 interrupts = <0 154 0x0>;
40 };
41};
diff --git a/arch/arm/boot/dts/omap2420-h4.dts b/arch/arm/boot/dts/omap2420-h4.dts
index 25b50b759de..77b84e17c47 100644
--- a/arch/arm/boot/dts/omap2420-h4.dts
+++ b/arch/arm/boot/dts/omap2420-h4.dts
@@ -7,7 +7,7 @@
7 */ 7 */
8/dts-v1/; 8/dts-v1/;
9 9
10/include/ "omap2.dtsi" 10/include/ "omap2420.dtsi"
11 11
12/ { 12/ {
13 model = "TI OMAP2420 H4 board"; 13 model = "TI OMAP2420 H4 board";
diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi
new file mode 100644
index 00000000000..bfd76b4a0dd
--- /dev/null
+++ b/arch/arm/boot/dts/omap2420.dtsi
@@ -0,0 +1,48 @@
1/*
2 * Device Tree Source for OMAP2420 SoC
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
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/ "omap2.dtsi"
12
13/ {
14 compatible = "ti,omap2420", "ti,omap2";
15
16 ocp {
17 omap2420_pmx: pinmux@48000030 {
18 compatible = "ti,omap2420-padconf", "pinctrl-single";
19 reg = <0x48000030 0x0113>;
20 #address-cells = <1>;
21 #size-cells = <0>;
22 pinctrl-single,register-width = <8>;
23 pinctrl-single,function-mask = <0x3f>;
24 };
25
26 mcbsp1: mcbsp@48074000 {
27 compatible = "ti,omap2420-mcbsp";
28 reg = <0x48074000 0xff>;
29 reg-names = "mpu";
30 interrupts = <59>, /* TX interrupt */
31 <60>; /* RX interrupt */
32 interrupt-names = "tx", "rx";
33 interrupt-parent = <&intc>;
34 ti,hwmods = "mcbsp1";
35 };
36
37 mcbsp2: mcbsp@48076000 {
38 compatible = "ti,omap2420-mcbsp";
39 reg = <0x48076000 0xff>;
40 reg-names = "mpu";
41 interrupts = <62>, /* TX interrupt */
42 <63>; /* RX interrupt */
43 interrupt-names = "tx", "rx";
44 interrupt-parent = <&intc>;
45 ti,hwmods = "mcbsp2";
46 };
47 };
48};
diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi
new file mode 100644
index 00000000000..4565d9750f4
--- /dev/null
+++ b/arch/arm/boot/dts/omap2430.dtsi
@@ -0,0 +1,92 @@
1/*
2 * Device Tree Source for OMAP243x SoC
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
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/ "omap2.dtsi"
12
13/ {
14 compatible = "ti,omap2430", "ti,omap2";
15
16 ocp {
17 omap2430_pmx: pinmux@49002030 {
18 compatible = "ti,omap2430-padconf", "pinctrl-single";
19 reg = <0x49002030 0x0154>;
20 #address-cells = <1>;
21 #size-cells = <0>;
22 pinctrl-single,register-width = <8>;
23 pinctrl-single,function-mask = <0x3f>;
24 };
25
26 mcbsp1: mcbsp@48074000 {
27 compatible = "ti,omap2430-mcbsp";
28 reg = <0x48074000 0xff>;
29 reg-names = "mpu";
30 interrupts = <64>, /* OCP compliant interrupt */
31 <59>, /* TX interrupt */
32 <60>, /* RX interrupt */
33 <61>; /* RX overflow interrupt */
34 interrupt-names = "common", "tx", "rx", "rx_overflow";
35 interrupt-parent = <&intc>;
36 ti,buffer-size = <128>;
37 ti,hwmods = "mcbsp1";
38 };
39
40 mcbsp2: mcbsp@48076000 {
41 compatible = "ti,omap2430-mcbsp";
42 reg = <0x48076000 0xff>;
43 reg-names = "mpu";
44 interrupts = <16>, /* OCP compliant interrupt */
45 <62>, /* TX interrupt */
46 <63>; /* RX interrupt */
47 interrupt-names = "common", "tx", "rx";
48 interrupt-parent = <&intc>;
49 ti,buffer-size = <128>;
50 ti,hwmods = "mcbsp2";
51 };
52
53 mcbsp3: mcbsp@4808c000 {
54 compatible = "ti,omap2430-mcbsp";
55 reg = <0x4808c000 0xff>;
56 reg-names = "mpu";
57 interrupts = <17>, /* OCP compliant interrupt */
58 <89>, /* TX interrupt */
59 <90>; /* RX interrupt */
60 interrupt-names = "common", "tx", "rx";
61 interrupt-parent = <&intc>;
62 ti,buffer-size = <128>;
63 ti,hwmods = "mcbsp3";
64 };
65
66 mcbsp4: mcbsp@4808e000 {
67 compatible = "ti,omap2430-mcbsp";
68 reg = <0x4808e000 0xff>;
69 reg-names = "mpu";
70 interrupts = <18>, /* OCP compliant interrupt */
71 <54>, /* TX interrupt */
72 <55>; /* RX interrupt */
73 interrupt-names = "common", "tx", "rx";
74 interrupt-parent = <&intc>;
75 ti,buffer-size = <128>;
76 ti,hwmods = "mcbsp4";
77 };
78
79 mcbsp5: mcbsp@48096000 {
80 compatible = "ti,omap2430-mcbsp";
81 reg = <0x48096000 0xff>;
82 reg-names = "mpu";
83 interrupts = <19>, /* OCP compliant interrupt */
84 <81>, /* TX interrupt */
85 <82>; /* RX interrupt */
86 interrupt-names = "common", "tx", "rx";
87 interrupt-parent = <&intc>;
88 ti,buffer-size = <128>;
89 ti,hwmods = "mcbsp5";
90 };
91 };
92};
diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
index cdcb98c7e07..c38cf76df81 100644
--- a/arch/arm/boot/dts/omap3-beagle.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -7,16 +7,44 @@
7 */ 7 */
8/dts-v1/; 8/dts-v1/;
9 9
10/include/ "omap3.dtsi" 10/include/ "omap36xx.dtsi"
11 11
12/ { 12/ {
13 model = "TI OMAP3 BeagleBoard"; 13 model = "TI OMAP3 BeagleBoard xM";
14 compatible = "ti,omap3-beagle", "ti,omap3"; 14 compatible = "ti,omap3-beagle-xm, ti,omap3-beagle", "ti,omap3";
15 15
16 memory { 16 memory {
17 device_type = "memory"; 17 device_type = "memory";
18 reg = <0x80000000 0x20000000>; /* 512 MB */ 18 reg = <0x80000000 0x20000000>; /* 512 MB */
19 }; 19 };
20
21 leds {
22 compatible = "gpio-leds";
23 pmu_stat {
24 label = "beagleboard::pmu_stat";
25 gpios = <&twl_gpio 19 0>; /* LEDB */
26 };
27
28 heartbeat {
29 label = "beagleboard::usr0";
30 gpios = <&gpio5 22 0>; /* 150 -> D6 LED */
31 linux,default-trigger = "heartbeat";
32 };
33
34 mmc {
35 label = "beagleboard::usr1";
36 gpios = <&gpio5 21 0>; /* 149 -> D7 LED */
37 linux,default-trigger = "mmc0";
38 };
39 };
40
41 sound {
42 compatible = "ti,omap-twl4030";
43 ti,model = "omap3beagle";
44
45 ti,mcbsp = <&mcbsp2>;
46 ti,codec = <&twl_audio>;
47 };
20}; 48};
21 49
22&i2c1 { 50&i2c1 {
@@ -27,11 +55,17 @@
27 interrupts = <7>; /* SYS_NIRQ cascaded to intc */ 55 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
28 interrupt-parent = <&intc>; 56 interrupt-parent = <&intc>;
29 57
30 vsim: regulator@10 { 58 vsim: regulator-vsim {
31 compatible = "ti,twl4030-vsim"; 59 compatible = "ti,twl4030-vsim";
32 regulator-min-microvolt = <1800000>; 60 regulator-min-microvolt = <1800000>;
33 regulator-max-microvolt = <3000000>; 61 regulator-max-microvolt = <3000000>;
34 }; 62 };
63
64 twl_audio: audio {
65 compatible = "ti,twl4030-audio";
66 codec {
67 };
68 };
35 }; 69 };
36}; 70};
37 71
@@ -67,3 +101,15 @@
67&mmc3 { 101&mmc3 {
68 status = "disabled"; 102 status = "disabled";
69}; 103};
104
105&twl_gpio {
106 ti,use-leds;
107 /* pullups: BIT(1) */
108 ti,pullups = <0x000002>;
109 /*
110 * pulldowns:
111 * BIT(2), BIT(6), BIT(7), BIT(8), BIT(13)
112 * BIT(15), BIT(16), BIT(17)
113 */
114 ti,pulldowns = <0x03a1c4>;
115};
diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts
index f349ee9182c..e8ba1c247a3 100644
--- a/arch/arm/boot/dts/omap3-evm.dts
+++ b/arch/arm/boot/dts/omap3-evm.dts
@@ -17,6 +17,15 @@
17 device_type = "memory"; 17 device_type = "memory";
18 reg = <0x80000000 0x10000000>; /* 256 MB */ 18 reg = <0x80000000 0x10000000>; /* 256 MB */
19 }; 19 };
20
21 leds {
22 compatible = "gpio-leds";
23 ledb {
24 label = "omap3evm::ledb";
25 gpios = <&twl_gpio 19 0>; /* LEDB */
26 linux,default-trigger = "default-on";
27 };
28 };
20}; 29};
21 30
22&i2c1 { 31&i2c1 {
@@ -46,3 +55,7 @@
46 reg = <0x5c>; 55 reg = <0x5c>;
47 }; 56 };
48}; 57};
58
59&twl_gpio {
60 ti,use-leds;
61};
diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi
new file mode 100644
index 00000000000..89808ce0167
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo.dtsi
@@ -0,0 +1,57 @@
1/*
2 * Copyright (C) 2012 Florian Vaussard, EPFL Mobots group
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 * The Gumstix Overo must be combined with an expansion board.
11 */
12/dts-v1/;
13
14/include/ "omap3.dtsi"
15
16/ {
17 leds {
18 compatible = "gpio-leds";
19 overo {
20 label = "overo:blue:COM";
21 gpios = <&twl_gpio 19 0>;
22 linux,default-trigger = "mmc0";
23 };
24 };
25};
26
27&i2c1 {
28 clock-frequency = <2600000>;
29
30 twl: twl@48 {
31 reg = <0x48>;
32 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
33 interrupt-parent = <&intc>;
34 };
35};
36
37/include/ "twl4030.dtsi"
38
39/* i2c2 pins are used for gpio */
40&i2c2 {
41 status = "disabled";
42};
43
44/* on board microSD slot */
45&mmc1 {
46 vmmc-supply = <&vmmc1>;
47 bus-width = <4>;
48};
49
50/* optional on board WiFi */
51&mmc2 {
52 bus-width = <4>;
53};
54
55&twl_gpio {
56 ti,use-leds;
57};
diff --git a/arch/arm/boot/dts/omap3-tobi.dts b/arch/arm/boot/dts/omap3-tobi.dts
new file mode 100644
index 00000000000..a13d12de77f
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-tobi.dts
@@ -0,0 +1,35 @@
1/*
2 * Copyright (C) 2012 Florian Vaussard, EPFL Mobots group
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 * Tobi expansion board is manufactured by Gumstix Inc.
11 */
12
13/include/ "omap3-overo.dtsi"
14
15/ {
16 model = "TI OMAP3 Gumstix Overo on Tobi";
17 compatible = "ti,omap3-tobi", "ti,omap3-overo", "ti,omap3";
18
19 leds {
20 compatible = "gpio-leds";
21 heartbeat {
22 label = "overo:red:gpio21";
23 gpios = <&gpio1 21 0>;
24 linux,default-trigger = "heartbeat";
25 };
26 };
27};
28
29&i2c3 {
30 clock-frequency = <100000>;
31};
32
33&mmc3 {
34 status = "disabled";
35};
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 81094719820..f38ea8771b4 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -17,7 +17,6 @@
17 serial0 = &uart1; 17 serial0 = &uart1;
18 serial1 = &uart2; 18 serial1 = &uart2;
19 serial2 = &uart3; 19 serial2 = &uart3;
20 serial3 = &uart4;
21 }; 20 };
22 21
23 cpus { 22 cpus {
@@ -69,6 +68,24 @@
69 reg = <0x48200000 0x1000>; 68 reg = <0x48200000 0x1000>;
70 }; 69 };
71 70
71 omap3_pmx_core: pinmux@48002030 {
72 compatible = "ti,omap3-padconf", "pinctrl-single";
73 reg = <0x48002030 0x05cc>;
74 #address-cells = <1>;
75 #size-cells = <0>;
76 pinctrl-single,register-width = <16>;
77 pinctrl-single,function-mask = <0x7fff>;
78 };
79
80 omap3_pmx_wkup: pinmux@0x48002a58 {
81 compatible = "ti,omap3-padconf", "pinctrl-single";
82 reg = <0x48002a58 0x5c>;
83 #address-cells = <1>;
84 #size-cells = <0>;
85 pinctrl-single,register-width = <16>;
86 pinctrl-single,function-mask = <0x7fff>;
87 };
88
72 gpio1: gpio@48310000 { 89 gpio1: gpio@48310000 {
73 compatible = "ti,omap3-gpio"; 90 compatible = "ti,omap3-gpio";
74 ti,hwmods = "gpio1"; 91 ti,hwmods = "gpio1";
@@ -141,12 +158,6 @@
141 clock-frequency = <48000000>; 158 clock-frequency = <48000000>;
142 }; 159 };
143 160
144 uart4: serial@49042000 {
145 compatible = "ti,omap3-uart";
146 ti,hwmods = "uart4";
147 clock-frequency = <48000000>;
148 };
149
150 i2c1: i2c@48070000 { 161 i2c1: i2c@48070000 {
151 compatible = "ti,omap3-i2c"; 162 compatible = "ti,omap3-i2c";
152 #address-cells = <1>; 163 #address-cells = <1>;
@@ -220,5 +231,74 @@
220 compatible = "ti,omap3-wdt"; 231 compatible = "ti,omap3-wdt";
221 ti,hwmods = "wd_timer2"; 232 ti,hwmods = "wd_timer2";
222 }; 233 };
234
235 mcbsp1: mcbsp@48074000 {
236 compatible = "ti,omap3-mcbsp";
237 reg = <0x48074000 0xff>;
238 reg-names = "mpu";
239 interrupts = <16>, /* OCP compliant interrupt */
240 <59>, /* TX interrupt */
241 <60>; /* RX interrupt */
242 interrupt-names = "common", "tx", "rx";
243 interrupt-parent = <&intc>;
244 ti,buffer-size = <128>;
245 ti,hwmods = "mcbsp1";
246 };
247
248 mcbsp2: mcbsp@49022000 {
249 compatible = "ti,omap3-mcbsp";
250 reg = <0x49022000 0xff>,
251 <0x49028000 0xff>;
252 reg-names = "mpu", "sidetone";
253 interrupts = <17>, /* OCP compliant interrupt */
254 <62>, /* TX interrupt */
255 <63>, /* RX interrupt */
256 <4>; /* Sidetone */
257 interrupt-names = "common", "tx", "rx", "sidetone";
258 interrupt-parent = <&intc>;
259 ti,buffer-size = <1280>;
260 ti,hwmods = "mcbsp2";
261 };
262
263 mcbsp3: mcbsp@49024000 {
264 compatible = "ti,omap3-mcbsp";
265 reg = <0x49024000 0xff>,
266 <0x4902a000 0xff>;
267 reg-names = "mpu", "sidetone";
268 interrupts = <22>, /* OCP compliant interrupt */
269 <89>, /* TX interrupt */
270 <90>, /* RX interrupt */
271 <5>; /* Sidetone */
272 interrupt-names = "common", "tx", "rx", "sidetone";
273 interrupt-parent = <&intc>;
274 ti,buffer-size = <128>;
275 ti,hwmods = "mcbsp3";
276 };
277
278 mcbsp4: mcbsp@49026000 {
279 compatible = "ti,omap3-mcbsp";
280 reg = <0x49026000 0xff>;
281 reg-names = "mpu";
282 interrupts = <23>, /* OCP compliant interrupt */
283 <54>, /* TX interrupt */
284 <55>; /* RX interrupt */
285 interrupt-names = "common", "tx", "rx";
286 interrupt-parent = <&intc>;
287 ti,buffer-size = <128>;
288 ti,hwmods = "mcbsp4";
289 };
290
291 mcbsp5: mcbsp@48096000 {
292 compatible = "ti,omap3-mcbsp";
293 reg = <0x48096000 0xff>;
294 reg-names = "mpu";
295 interrupts = <27>, /* OCP compliant interrupt */
296 <81>, /* TX interrupt */
297 <82>; /* RX interrupt */
298 interrupt-names = "common", "tx", "rx";
299 interrupt-parent = <&intc>;
300 ti,buffer-size = <128>;
301 ti,hwmods = "mcbsp5";
302 };
223 }; 303 };
224}; 304};
diff --git a/arch/arm/boot/dts/omap36xx.dtsi b/arch/arm/boot/dts/omap36xx.dtsi
new file mode 100644
index 00000000000..96bf0287cb9
--- /dev/null
+++ b/arch/arm/boot/dts/omap36xx.dtsi
@@ -0,0 +1,25 @@
1/*
2 * Device Tree Source for OMAP3 SoC
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
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/ "omap3.dtsi"
12
13/ {
14 aliases {
15 serial3 = &uart4;
16 };
17
18 ocp {
19 uart4: serial@49042000 {
20 compatible = "ti,omap3-uart";
21 ti,hwmods = "uart4";
22 clock-frequency = <48000000>;
23 };
24 };
25};
diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
index 9880c12877b..e8f927cbb37 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -8,6 +8,7 @@
8/dts-v1/; 8/dts-v1/;
9 9
10/include/ "omap4.dtsi" 10/include/ "omap4.dtsi"
11/include/ "elpida_ecb240abacn.dtsi"
11 12
12/ { 13/ {
13 model = "TI OMAP4 PandaBoard"; 14 model = "TI OMAP4 PandaBoard";
@@ -58,6 +59,41 @@
58 }; 59 };
59}; 60};
60 61
62&omap4_pmx_core {
63 pinctrl-names = "default";
64 pinctrl-0 = <
65 &twl6040_pins
66 &mcpdm_pins
67 &mcbsp1_pins
68 >;
69
70 twl6040_pins: pinmux_twl6040_pins {
71 pinctrl-single,pins = <
72 0xe0 0x3 /* hdq_sio.gpio_127 OUTPUT | MODE3 */
73 0x160 0x100 /* sys_nirq2.sys_nirq2 INPUT | MODE0 */
74 >;
75 };
76
77 mcpdm_pins: pinmux_mcpdm_pins {
78 pinctrl-single,pins = <
79 0xc6 0x108 /* abe_pdm_ul_data.abe_pdm_ul_data INPUT PULLDOWN | MODE0 */
80 0xc8 0x108 /* abe_pdm_dl_data.abe_pdm_dl_data INPUT PULLDOWN | MODE0 */
81 0xca 0x118 /* abe_pdm_frame.abe_pdm_frame INPUT PULLUP | MODE0 */
82 0xcc 0x108 /* abe_pdm_lb_clk.abe_pdm_lb_clk INPUT PULLDOWN | MODE0 */
83 0xce 0x108 /* abe_clks.abe_clks INPUT PULLDOWN | MODE0 */
84 >;
85 };
86
87 mcbsp1_pins: pinmux_mcbsp1_pins {
88 pinctrl-single,pins = <
89 0xbe 0x100 /* abe_mcbsp1_clkx.abe_mcbsp1_clkx INPUT | MODE0 */
90 0xc0 0x108 /* abe_mcbsp1_dr.abe_mcbsp1_dr INPUT PULLDOWN | MODE0 */
91 0xc2 0x8 /* abe_mcbsp1_dx.abe_mcbsp1_dx OUTPUT PULLDOWN | MODE0 */
92 0xc4 0x100 /* abe_mcbsp1_fsx.abe_mcbsp1_fsx INPUT | MODE0 */
93 >;
94 };
95};
96
61&i2c1 { 97&i2c1 {
62 clock-frequency = <400000>; 98 clock-frequency = <400000>;
63 99
@@ -126,3 +162,25 @@
126 ti,non-removable; 162 ti,non-removable;
127 bus-width = <4>; 163 bus-width = <4>;
128}; 164};
165
166&emif1 {
167 cs1-used;
168 device-handle = <&elpida_ECB240ABACN>;
169};
170
171&emif2 {
172 cs1-used;
173 device-handle = <&elpida_ECB240ABACN>;
174};
175
176&mcbsp2 {
177 status = "disabled";
178};
179
180&mcbsp3 {
181 status = "disabled";
182};
183
184&dmic {
185 status = "disabled";
186};
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 72216e932fc..5b7e04fbff5 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -8,6 +8,7 @@
8/dts-v1/; 8/dts-v1/;
9 9
10/include/ "omap4.dtsi" 10/include/ "omap4.dtsi"
11/include/ "elpida_ecb240abacn.dtsi"
11 12
12/ { 13/ {
13 model = "TI OMAP4 SDP board"; 14 model = "TI OMAP4 SDP board";
@@ -18,7 +19,7 @@
18 reg = <0x80000000 0x40000000>; /* 1 GB */ 19 reg = <0x80000000 0x40000000>; /* 1 GB */
19 }; 20 };
20 21
21 vdd_eth: fixedregulator@0 { 22 vdd_eth: fixedregulator-vdd-eth {
22 compatible = "regulator-fixed"; 23 compatible = "regulator-fixed";
23 regulator-name = "VDD_ETH"; 24 regulator-name = "VDD_ETH";
24 regulator-min-microvolt = <3300000>; 25 regulator-min-microvolt = <3300000>;
@@ -28,7 +29,7 @@
28 regulator-boot-on; 29 regulator-boot-on;
29 }; 30 };
30 31
31 vbat: fixedregulator@2 { 32 vbat: fixedregulator-vbat {
32 compatible = "regulator-fixed"; 33 compatible = "regulator-fixed";
33 regulator-name = "VBAT"; 34 regulator-name = "VBAT";
34 regulator-min-microvolt = <3750000>; 35 regulator-min-microvolt = <3750000>;
@@ -115,6 +116,86 @@
115 }; 116 };
116}; 117};
117 118
119&omap4_pmx_core {
120 pinctrl-names = "default";
121 pinctrl-0 = <
122 &twl6040_pins
123 &mcpdm_pins
124 &dmic_pins
125 &mcbsp1_pins
126 &mcbsp2_pins
127 >;
128
129 uart2_pins: pinmux_uart2_pins {
130 pinctrl-single,pins = <
131 0xd8 0x118 /* uart2_cts.uart2_cts INPUT_PULLUP | MODE0 */
132 0xda 0 /* uart2_rts.uart2_rts OUTPUT | MODE0 */
133 0xdc 0x118 /* uart2_rx.uart2_rx INPUT_PULLUP | MODE0 */
134 0xde 0 /* uart2_tx.uart2_tx OUTPUT | MODE0 */
135 >;
136 };
137
138 uart3_pins: pinmux_uart3_pins {
139 pinctrl-single,pins = <
140 0x100 0x118 /* uart3_cts_rctx.uart3_cts_rctx INPUT_PULLUP | MODE0 */
141 0x102 0 /* uart3_rts_sd.uart3_rts_sd OUTPUT | MODE0 */
142 0x104 0x100 /* uart3_rx_irrx.uart3_rx_irrx INPUT | MODE0 */
143 0x106 0 /* uart3_tx_irtx.uart3_tx_irtx OUTPUT | MODE0 */
144 >;
145 };
146
147 uart4_pins: pinmux_uart4_pins {
148 pinctrl-single,pins = <
149 0x11c 0x100 /* uart4_rx.uart4_rx INPUT | MODE0 */
150 0x11e 0 /* uart4_tx.uart4_tx OUTPUT | MODE0 */
151 >;
152 };
153
154 twl6040_pins: pinmux_twl6040_pins {
155 pinctrl-single,pins = <
156 0xe0 0x3 /* hdq_sio.gpio_127 OUTPUT | MODE3 */
157 0x160 0x100 /* sys_nirq2.sys_nirq2 INPUT | MODE0 */
158 >;
159 };
160
161 mcpdm_pins: pinmux_mcpdm_pins {
162 pinctrl-single,pins = <
163 0xc6 0x108 /* abe_pdm_ul_data.abe_pdm_ul_data INPUT PULLDOWN | MODE0 */
164 0xc8 0x108 /* abe_pdm_dl_data.abe_pdm_dl_data INPUT PULLDOWN | MODE0 */
165 0xca 0x118 /* abe_pdm_frame.abe_pdm_frame INPUT PULLUP | MODE0 */
166 0xcc 0x108 /* abe_pdm_lb_clk.abe_pdm_lb_clk INPUT PULLDOWN | MODE0 */
167 0xce 0x108 /* abe_clks.abe_clks INPUT PULLDOWN | MODE0 */
168 >;
169 };
170
171 dmic_pins: pinmux_dmic_pins {
172 pinctrl-single,pins = <
173 0xd0 0 /* abe_dmic_clk1.abe_dmic_clk1 OUTPUT | MODE0 */
174 0xd2 0x100 /* abe_dmic_din1.abe_dmic_din1 INPUT | MODE0 */
175 0xd4 0x100 /* abe_dmic_din2.abe_dmic_din2 INPUT | MODE0 */
176 0xd6 0x100 /* abe_dmic_din3.abe_dmic_din3 INPUT | MODE0 */
177 >;
178 };
179
180 mcbsp1_pins: pinmux_mcbsp1_pins {
181 pinctrl-single,pins = <
182 0xbe 0x100 /* abe_mcbsp1_clkx.abe_mcbsp1_clkx INPUT | MODE0 */
183 0xc0 0x108 /* abe_mcbsp1_dr.abe_mcbsp1_dr INPUT PULLDOWN | MODE0 */
184 0xc2 0x8 /* abe_mcbsp1_dx.abe_mcbsp1_dx OUTPUT PULLDOWN | MODE0 */
185 0xc4 0x100 /* abe_mcbsp1_fsx.abe_mcbsp1_fsx INPUT | MODE0 */
186 >;
187 };
188
189 mcbsp2_pins: pinmux_mcbsp2_pins {
190 pinctrl-single,pins = <
191 0xb6 0x100 /* abe_mcbsp2_clkx.abe_mcbsp2_clkx INPUT | MODE0 */
192 0xb8 0x108 /* abe_mcbsp2_dr.abe_mcbsp2_dr INPUT PULLDOWN | MODE0 */
193 0xba 0x8 /* abe_mcbsp2_dx.abe_mcbsp2_dx OUTPUT PULLDOWN | MODE0 */
194 0xbc 0x100 /* abe_mcbsp2_fsx.abe_mcbsp2_fsx INPUT | MODE0 */
195 >;
196 };
197};
198
118&i2c1 { 199&i2c1 {
119 clock-frequency = <400000>; 200 clock-frequency = <400000>;
120 201
@@ -226,3 +307,102 @@
226 bus-width = <4>; 307 bus-width = <4>;
227 ti,non-removable; 308 ti,non-removable;
228}; 309};
310
311&emif1 {
312 cs1-used;
313 device-handle = <&elpida_ECB240ABACN>;
314};
315
316&emif2 {
317 cs1-used;
318 device-handle = <&elpida_ECB240ABACN>;
319};
320
321&keypad {
322 keypad,num-rows = <8>;
323 keypad,num-columns = <8>;
324 linux,keymap = <0x00000012 /* KEY_E */
325 0x00010013 /* KEY_R */
326 0x00020014 /* KEY_T */
327 0x00030066 /* KEY_HOME */
328 0x0004003f /* KEY_F5 */
329 0x000500f0 /* KEY_UNKNOWN */
330 0x00060017 /* KEY_I */
331 0x0007002a /* KEY_LEFTSHIFT */
332 0x01000020 /* KEY_D*/
333 0x01010021 /* KEY_F */
334 0x01020022 /* KEY_G */
335 0x010300e7 /* KEY_SEND */
336 0x01040040 /* KEY_F6 */
337 0x010500f0 /* KEY_UNKNOWN */
338 0x01060025 /* KEY_K */
339 0x0107001c /* KEY_ENTER */
340 0x0200002d /* KEY_X */
341 0x0201002e /* KEY_C */
342 0x0202002f /* KEY_V */
343 0x0203006b /* KEY_END */
344 0x02040041 /* KEY_F7 */
345 0x020500f0 /* KEY_UNKNOWN */
346 0x02060034 /* KEY_DOT */
347 0x0207003a /* KEY_CAPSLOCK */
348 0x0300002c /* KEY_Z */
349 0x0301004e /* KEY_KPLUS */
350 0x03020030 /* KEY_B */
351 0x0303003b /* KEY_F1 */
352 0x03040042 /* KEY_F8 */
353 0x030500f0 /* KEY_UNKNOWN */
354 0x03060018 /* KEY_O */
355 0x03070039 /* KEY_SPACE */
356 0x04000011 /* KEY_W */
357 0x04010015 /* KEY_Y */
358 0x04020016 /* KEY_U */
359 0x0403003c /* KEY_F2 */
360 0x04040073 /* KEY_VOLUMEUP */
361 0x040500f0 /* KEY_UNKNOWN */
362 0x04060026 /* KEY_L */
363 0x04070069 /* KEY_LEFT */
364 0x0500001f /* KEY_S */
365 0x05010023 /* KEY_H */
366 0x05020024 /* KEY_J */
367 0x0503003d /* KEY_F3 */
368 0x05040043 /* KEY_F9 */
369 0x05050072 /* KEY_VOLUMEDOWN */
370 0x05060032 /* KEY_M */
371 0x0507006a /* KEY_RIGHT */
372 0x06000010 /* KEY_Q */
373 0x0601001e /* KEY_A */
374 0x06020031 /* KEY_N */
375 0x0603009e /* KEY_BACK */
376 0x0604000e /* KEY_BACKSPACE */
377 0x060500f0 /* KEY_UNKNOWN */
378 0x06060019 /* KEY_P */
379 0x06070067 /* KEY_UP */
380 0x07000094 /* KEY_PROG1 */
381 0x07010095 /* KEY_PROG2 */
382 0x070200ca /* KEY_PROG3 */
383 0x070300cb /* KEY_PROG4 */
384 0x0704003e /* KEY_F4 */
385 0x070500f0 /* KEY_UNKNOWN */
386 0x07060160 /* KEY_OK */
387 0x0707006c>; /* KEY_DOWN */
388 linux,input-no-autorepeat;
389};
390
391&uart2 {
392 pinctrl-names = "default";
393 pinctrl-0 = <&uart2_pins>;
394};
395
396&uart3 {
397 pinctrl-names = "default";
398 pinctrl-0 = <&uart3_pins>;
399};
400
401&uart4 {
402 pinctrl-names = "default";
403 pinctrl-0 = <&uart4_pins>;
404};
405
406&mcbsp3 {
407 status = "disabled";
408};
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 04cbbcb6ff9..3883f94fdbd 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -30,12 +30,35 @@
30 cpus { 30 cpus {
31 cpu@0 { 31 cpu@0 {
32 compatible = "arm,cortex-a9"; 32 compatible = "arm,cortex-a9";
33 next-level-cache = <&L2>;
33 }; 34 };
34 cpu@1 { 35 cpu@1 {
35 compatible = "arm,cortex-a9"; 36 compatible = "arm,cortex-a9";
37 next-level-cache = <&L2>;
36 }; 38 };
37 }; 39 };
38 40
41 gic: interrupt-controller@48241000 {
42 compatible = "arm,cortex-a9-gic";
43 interrupt-controller;
44 #interrupt-cells = <3>;
45 reg = <0x48241000 0x1000>,
46 <0x48240100 0x0100>;
47 };
48
49 L2: l2-cache-controller@48242000 {
50 compatible = "arm,pl310-cache";
51 reg = <0x48242000 0x1000>;
52 cache-unified;
53 cache-level = <2>;
54 };
55
56 local-timer@0x48240600 {
57 compatible = "arm,cortex-a9-twd-timer";
58 reg = <0x48240600 0x20>;
59 interrupts = <1 13 0x304>;
60 };
61
39 /* 62 /*
40 * The soc node represents the soc top level view. It is uses for IPs 63 * The soc node represents the soc top level view. It is uses for IPs
41 * that are not memory mapped in the MPU view or for the MPU itself. 64 * that are not memory mapped in the MPU view or for the MPU itself.
@@ -61,30 +84,6 @@
61 /* 84 /*
62 * XXX: Use a flat representation of the OMAP4 interconnect. 85 * XXX: Use a flat representation of the OMAP4 interconnect.
63 * The real OMAP interconnect network is quite complex. 86 * The real OMAP interconnect network is quite complex.
64 *
65 * MPU -+-- MPU_PRIVATE - GIC, L2
66 * |
67 * +----------------+----------+
68 * | | |
69 * + +- EMIF - DDR |
70 * | | |
71 * | + +--------+
72 * | | |
73 * | +- L4_ABE - AESS, MCBSP, TIMERs...
74 * | |
75 * +- L3_MAIN --+- L4_CORE - IPs...
76 * |
77 * +- L4_PER - IPs...
78 * |
79 * +- L4_CFG -+- L4_WKUP - IPs...
80 * | |
81 * | +- IPs...
82 * +- IPU ----+
83 * | |
84 * +- DSP ----+
85 * | |
86 * +- DSS ----+
87 *
88 * Since that will not bring real advantage to represent that in DT for 87 * Since that will not bring real advantage to represent that in DT for
89 * the moment, just use a fake OCP bus entry to represent the whole bus 88 * the moment, just use a fake OCP bus entry to represent the whole bus
90 * hierarchy. 89 * hierarchy.
@@ -96,16 +95,27 @@
96 ranges; 95 ranges;
97 ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3"; 96 ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3";
98 97
99 gic: interrupt-controller@48241000 { 98 omap4_pmx_core: pinmux@4a100040 {
100 compatible = "arm,cortex-a9-gic"; 99 compatible = "ti,omap4-padconf", "pinctrl-single";
101 interrupt-controller; 100 reg = <0x4a100040 0x0196>;
102 #interrupt-cells = <3>; 101 #address-cells = <1>;
103 reg = <0x48241000 0x1000>, 102 #size-cells = <0>;
104 <0x48240100 0x0100>; 103 pinctrl-single,register-width = <16>;
104 pinctrl-single,function-mask = <0x7fff>;
105 };
106 omap4_pmx_wkup: pinmux@4a31e040 {
107 compatible = "ti,omap4-padconf", "pinctrl-single";
108 reg = <0x4a31e040 0x0038>;
109 #address-cells = <1>;
110 #size-cells = <0>;
111 pinctrl-single,register-width = <16>;
112 pinctrl-single,function-mask = <0x7fff>;
105 }; 113 };
106 114
107 gpio1: gpio@4a310000 { 115 gpio1: gpio@4a310000 {
108 compatible = "ti,omap4-gpio"; 116 compatible = "ti,omap4-gpio";
117 reg = <0x4a310000 0x200>;
118 interrupts = <0 29 0x4>;
109 ti,hwmods = "gpio1"; 119 ti,hwmods = "gpio1";
110 gpio-controller; 120 gpio-controller;
111 #gpio-cells = <2>; 121 #gpio-cells = <2>;
@@ -115,6 +125,8 @@
115 125
116 gpio2: gpio@48055000 { 126 gpio2: gpio@48055000 {
117 compatible = "ti,omap4-gpio"; 127 compatible = "ti,omap4-gpio";
128 reg = <0x48055000 0x200>;
129 interrupts = <0 30 0x4>;
118 ti,hwmods = "gpio2"; 130 ti,hwmods = "gpio2";
119 gpio-controller; 131 gpio-controller;
120 #gpio-cells = <2>; 132 #gpio-cells = <2>;
@@ -124,6 +136,8 @@
124 136
125 gpio3: gpio@48057000 { 137 gpio3: gpio@48057000 {
126 compatible = "ti,omap4-gpio"; 138 compatible = "ti,omap4-gpio";
139 reg = <0x48057000 0x200>;
140 interrupts = <0 31 0x4>;
127 ti,hwmods = "gpio3"; 141 ti,hwmods = "gpio3";
128 gpio-controller; 142 gpio-controller;
129 #gpio-cells = <2>; 143 #gpio-cells = <2>;
@@ -133,6 +147,8 @@
133 147
134 gpio4: gpio@48059000 { 148 gpio4: gpio@48059000 {
135 compatible = "ti,omap4-gpio"; 149 compatible = "ti,omap4-gpio";
150 reg = <0x48059000 0x200>;
151 interrupts = <0 32 0x4>;
136 ti,hwmods = "gpio4"; 152 ti,hwmods = "gpio4";
137 gpio-controller; 153 gpio-controller;
138 #gpio-cells = <2>; 154 #gpio-cells = <2>;
@@ -142,6 +158,8 @@
142 158
143 gpio5: gpio@4805b000 { 159 gpio5: gpio@4805b000 {
144 compatible = "ti,omap4-gpio"; 160 compatible = "ti,omap4-gpio";
161 reg = <0x4805b000 0x200>;
162 interrupts = <0 33 0x4>;
145 ti,hwmods = "gpio5"; 163 ti,hwmods = "gpio5";
146 gpio-controller; 164 gpio-controller;
147 #gpio-cells = <2>; 165 #gpio-cells = <2>;
@@ -151,6 +169,8 @@
151 169
152 gpio6: gpio@4805d000 { 170 gpio6: gpio@4805d000 {
153 compatible = "ti,omap4-gpio"; 171 compatible = "ti,omap4-gpio";
172 reg = <0x4805d000 0x200>;
173 interrupts = <0 34 0x4>;
154 ti,hwmods = "gpio6"; 174 ti,hwmods = "gpio6";
155 gpio-controller; 175 gpio-controller;
156 #gpio-cells = <2>; 176 #gpio-cells = <2>;
@@ -160,30 +180,40 @@
160 180
161 uart1: serial@4806a000 { 181 uart1: serial@4806a000 {
162 compatible = "ti,omap4-uart"; 182 compatible = "ti,omap4-uart";
183 reg = <0x4806a000 0x100>;
184 interrupts = <0 72 0x4>;
163 ti,hwmods = "uart1"; 185 ti,hwmods = "uart1";
164 clock-frequency = <48000000>; 186 clock-frequency = <48000000>;
165 }; 187 };
166 188
167 uart2: serial@4806c000 { 189 uart2: serial@4806c000 {
168 compatible = "ti,omap4-uart"; 190 compatible = "ti,omap4-uart";
191 reg = <0x4806c000 0x100>;
192 interrupts = <0 73 0x4>;
169 ti,hwmods = "uart2"; 193 ti,hwmods = "uart2";
170 clock-frequency = <48000000>; 194 clock-frequency = <48000000>;
171 }; 195 };
172 196
173 uart3: serial@48020000 { 197 uart3: serial@48020000 {
174 compatible = "ti,omap4-uart"; 198 compatible = "ti,omap4-uart";
199 reg = <0x48020000 0x100>;
200 interrupts = <0 74 0x4>;
175 ti,hwmods = "uart3"; 201 ti,hwmods = "uart3";
176 clock-frequency = <48000000>; 202 clock-frequency = <48000000>;
177 }; 203 };
178 204
179 uart4: serial@4806e000 { 205 uart4: serial@4806e000 {
180 compatible = "ti,omap4-uart"; 206 compatible = "ti,omap4-uart";
207 reg = <0x4806e000 0x100>;
208 interrupts = <0 70 0x4>;
181 ti,hwmods = "uart4"; 209 ti,hwmods = "uart4";
182 clock-frequency = <48000000>; 210 clock-frequency = <48000000>;
183 }; 211 };
184 212
185 i2c1: i2c@48070000 { 213 i2c1: i2c@48070000 {
186 compatible = "ti,omap4-i2c"; 214 compatible = "ti,omap4-i2c";
215 reg = <0x48070000 0x100>;
216 interrupts = <0 56 0x4>;
187 #address-cells = <1>; 217 #address-cells = <1>;
188 #size-cells = <0>; 218 #size-cells = <0>;
189 ti,hwmods = "i2c1"; 219 ti,hwmods = "i2c1";
@@ -191,6 +221,8 @@
191 221
192 i2c2: i2c@48072000 { 222 i2c2: i2c@48072000 {
193 compatible = "ti,omap4-i2c"; 223 compatible = "ti,omap4-i2c";
224 reg = <0x48072000 0x100>;
225 interrupts = <0 57 0x4>;
194 #address-cells = <1>; 226 #address-cells = <1>;
195 #size-cells = <0>; 227 #size-cells = <0>;
196 ti,hwmods = "i2c2"; 228 ti,hwmods = "i2c2";
@@ -198,6 +230,8 @@
198 230
199 i2c3: i2c@48060000 { 231 i2c3: i2c@48060000 {
200 compatible = "ti,omap4-i2c"; 232 compatible = "ti,omap4-i2c";
233 reg = <0x48060000 0x100>;
234 interrupts = <0 61 0x4>;
201 #address-cells = <1>; 235 #address-cells = <1>;
202 #size-cells = <0>; 236 #size-cells = <0>;
203 ti,hwmods = "i2c3"; 237 ti,hwmods = "i2c3";
@@ -205,6 +239,8 @@
205 239
206 i2c4: i2c@48350000 { 240 i2c4: i2c@48350000 {
207 compatible = "ti,omap4-i2c"; 241 compatible = "ti,omap4-i2c";
242 reg = <0x48350000 0x100>;
243 interrupts = <0 62 0x4>;
208 #address-cells = <1>; 244 #address-cells = <1>;
209 #size-cells = <0>; 245 #size-cells = <0>;
210 ti,hwmods = "i2c4"; 246 ti,hwmods = "i2c4";
@@ -212,6 +248,8 @@
212 248
213 mcspi1: spi@48098000 { 249 mcspi1: spi@48098000 {
214 compatible = "ti,omap4-mcspi"; 250 compatible = "ti,omap4-mcspi";
251 reg = <0x48098000 0x200>;
252 interrupts = <0 65 0x4>;
215 #address-cells = <1>; 253 #address-cells = <1>;
216 #size-cells = <0>; 254 #size-cells = <0>;
217 ti,hwmods = "mcspi1"; 255 ti,hwmods = "mcspi1";
@@ -220,6 +258,8 @@
220 258
221 mcspi2: spi@4809a000 { 259 mcspi2: spi@4809a000 {
222 compatible = "ti,omap4-mcspi"; 260 compatible = "ti,omap4-mcspi";
261 reg = <0x4809a000 0x200>;
262 interrupts = <0 66 0x4>;
223 #address-cells = <1>; 263 #address-cells = <1>;
224 #size-cells = <0>; 264 #size-cells = <0>;
225 ti,hwmods = "mcspi2"; 265 ti,hwmods = "mcspi2";
@@ -228,6 +268,8 @@
228 268
229 mcspi3: spi@480b8000 { 269 mcspi3: spi@480b8000 {
230 compatible = "ti,omap4-mcspi"; 270 compatible = "ti,omap4-mcspi";
271 reg = <0x480b8000 0x200>;
272 interrupts = <0 91 0x4>;
231 #address-cells = <1>; 273 #address-cells = <1>;
232 #size-cells = <0>; 274 #size-cells = <0>;
233 ti,hwmods = "mcspi3"; 275 ti,hwmods = "mcspi3";
@@ -236,6 +278,8 @@
236 278
237 mcspi4: spi@480ba000 { 279 mcspi4: spi@480ba000 {
238 compatible = "ti,omap4-mcspi"; 280 compatible = "ti,omap4-mcspi";
281 reg = <0x480ba000 0x200>;
282 interrupts = <0 48 0x4>;
239 #address-cells = <1>; 283 #address-cells = <1>;
240 #size-cells = <0>; 284 #size-cells = <0>;
241 ti,hwmods = "mcspi4"; 285 ti,hwmods = "mcspi4";
@@ -244,6 +288,8 @@
244 288
245 mmc1: mmc@4809c000 { 289 mmc1: mmc@4809c000 {
246 compatible = "ti,omap4-hsmmc"; 290 compatible = "ti,omap4-hsmmc";
291 reg = <0x4809c000 0x400>;
292 interrupts = <0 83 0x4>;
247 ti,hwmods = "mmc1"; 293 ti,hwmods = "mmc1";
248 ti,dual-volt; 294 ti,dual-volt;
249 ti,needs-special-reset; 295 ti,needs-special-reset;
@@ -251,30 +297,40 @@
251 297
252 mmc2: mmc@480b4000 { 298 mmc2: mmc@480b4000 {
253 compatible = "ti,omap4-hsmmc"; 299 compatible = "ti,omap4-hsmmc";
300 reg = <0x480b4000 0x400>;
301 interrupts = <0 86 0x4>;
254 ti,hwmods = "mmc2"; 302 ti,hwmods = "mmc2";
255 ti,needs-special-reset; 303 ti,needs-special-reset;
256 }; 304 };
257 305
258 mmc3: mmc@480ad000 { 306 mmc3: mmc@480ad000 {
259 compatible = "ti,omap4-hsmmc"; 307 compatible = "ti,omap4-hsmmc";
308 reg = <0x480ad000 0x400>;
309 interrupts = <0 94 0x4>;
260 ti,hwmods = "mmc3"; 310 ti,hwmods = "mmc3";
261 ti,needs-special-reset; 311 ti,needs-special-reset;
262 }; 312 };
263 313
264 mmc4: mmc@480d1000 { 314 mmc4: mmc@480d1000 {
265 compatible = "ti,omap4-hsmmc"; 315 compatible = "ti,omap4-hsmmc";
316 reg = <0x480d1000 0x400>;
317 interrupts = <0 96 0x4>;
266 ti,hwmods = "mmc4"; 318 ti,hwmods = "mmc4";
267 ti,needs-special-reset; 319 ti,needs-special-reset;
268 }; 320 };
269 321
270 mmc5: mmc@480d5000 { 322 mmc5: mmc@480d5000 {
271 compatible = "ti,omap4-hsmmc"; 323 compatible = "ti,omap4-hsmmc";
324 reg = <0x480d5000 0x400>;
325 interrupts = <0 59 0x4>;
272 ti,hwmods = "mmc5"; 326 ti,hwmods = "mmc5";
273 ti,needs-special-reset; 327 ti,needs-special-reset;
274 }; 328 };
275 329
276 wdt2: wdt@4a314000 { 330 wdt2: wdt@4a314000 {
277 compatible = "ti,omap4-wdt", "ti,omap3-wdt"; 331 compatible = "ti,omap4-wdt", "ti,omap3-wdt";
332 reg = <0x4a314000 0x80>;
333 interrupts = <0 80 0x4>;
278 ti,hwmods = "wd_timer2"; 334 ti,hwmods = "wd_timer2";
279 }; 335 };
280 336
@@ -282,6 +338,7 @@
282 compatible = "ti,omap4-mcpdm"; 338 compatible = "ti,omap4-mcpdm";
283 reg = <0x40132000 0x7f>, /* MPU private access */ 339 reg = <0x40132000 0x7f>, /* MPU private access */
284 <0x49032000 0x7f>; /* L3 Interconnect */ 340 <0x49032000 0x7f>; /* L3 Interconnect */
341 reg-names = "mpu", "dma";
285 interrupts = <0 112 0x4>; 342 interrupts = <0 112 0x4>;
286 interrupt-parent = <&gic>; 343 interrupt-parent = <&gic>;
287 ti,hwmods = "mcpdm"; 344 ti,hwmods = "mcpdm";
@@ -291,9 +348,95 @@
291 compatible = "ti,omap4-dmic"; 348 compatible = "ti,omap4-dmic";
292 reg = <0x4012e000 0x7f>, /* MPU private access */ 349 reg = <0x4012e000 0x7f>, /* MPU private access */
293 <0x4902e000 0x7f>; /* L3 Interconnect */ 350 <0x4902e000 0x7f>; /* L3 Interconnect */
351 reg-names = "mpu", "dma";
294 interrupts = <0 114 0x4>; 352 interrupts = <0 114 0x4>;
295 interrupt-parent = <&gic>; 353 interrupt-parent = <&gic>;
296 ti,hwmods = "dmic"; 354 ti,hwmods = "dmic";
297 }; 355 };
356
357 mcbsp1: mcbsp@40122000 {
358 compatible = "ti,omap4-mcbsp";
359 reg = <0x40122000 0xff>, /* MPU private access */
360 <0x49022000 0xff>; /* L3 Interconnect */
361 reg-names = "mpu", "dma";
362 interrupts = <0 17 0x4>;
363 interrupt-names = "common";
364 interrupt-parent = <&gic>;
365 ti,buffer-size = <128>;
366 ti,hwmods = "mcbsp1";
367 };
368
369 mcbsp2: mcbsp@40124000 {
370 compatible = "ti,omap4-mcbsp";
371 reg = <0x40124000 0xff>, /* MPU private access */
372 <0x49024000 0xff>; /* L3 Interconnect */
373 reg-names = "mpu", "dma";
374 interrupts = <0 22 0x4>;
375 interrupt-names = "common";
376 interrupt-parent = <&gic>;
377 ti,buffer-size = <128>;
378 ti,hwmods = "mcbsp2";
379 };
380
381 mcbsp3: mcbsp@40126000 {
382 compatible = "ti,omap4-mcbsp";
383 reg = <0x40126000 0xff>, /* MPU private access */
384 <0x49026000 0xff>; /* L3 Interconnect */
385 reg-names = "mpu", "dma";
386 interrupts = <0 23 0x4>;
387 interrupt-names = "common";
388 interrupt-parent = <&gic>;
389 ti,buffer-size = <128>;
390 ti,hwmods = "mcbsp3";
391 };
392
393 mcbsp4: mcbsp@48096000 {
394 compatible = "ti,omap4-mcbsp";
395 reg = <0x48096000 0xff>; /* L4 Interconnect */
396 reg-names = "mpu";
397 interrupts = <0 16 0x4>;
398 interrupt-names = "common";
399 interrupt-parent = <&gic>;
400 ti,buffer-size = <128>;
401 ti,hwmods = "mcbsp4";
402 };
403
404 keypad: keypad@4a31c000 {
405 compatible = "ti,omap4-keypad";
406 reg = <0x4a31c000 0x80>;
407 interrupts = <0 120 0x4>;
408 reg-names = "mpu";
409 ti,hwmods = "kbd";
410 };
411
412 emif1: emif@4c000000 {
413 compatible = "ti,emif-4d";
414 reg = <0x4c000000 0x100>;
415 interrupts = <0 110 0x4>;
416 ti,hwmods = "emif1";
417 phy-type = <1>;
418 hw-caps-read-idle-ctrl;
419 hw-caps-ll-interface;
420 hw-caps-temp-alert;
421 };
422
423 emif2: emif@4d000000 {
424 compatible = "ti,emif-4d";
425 reg = <0x4d000000 0x100>;
426 interrupts = <0 111 0x4>;
427 ti,hwmods = "emif2";
428 phy-type = <1>;
429 hw-caps-read-idle-ctrl;
430 hw-caps-ll-interface;
431 hw-caps-temp-alert;
432 };
433
434 ocp2scp {
435 compatible = "ti,omap-ocp2scp";
436 #address-cells = <1>;
437 #size-cells = <1>;
438 ranges;
439 ti,hwmods = "ocp2scp_usb_phy";
440 };
298 }; 441 };
299}; 442};
diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
index 200c39ad1c8..c663eba7316 100644
--- a/arch/arm/boot/dts/omap5-evm.dts
+++ b/arch/arm/boot/dts/omap5-evm.dts
@@ -17,4 +17,126 @@
17 device_type = "memory"; 17 device_type = "memory";
18 reg = <0x80000000 0x40000000>; /* 1 GB */ 18 reg = <0x80000000 0x40000000>; /* 1 GB */
19 }; 19 };
20
21 vmmcsd_fixed: fixedregulator-mmcsd {
22 compatible = "regulator-fixed";
23 regulator-name = "vmmcsd_fixed";
24 regulator-min-microvolt = <3000000>;
25 regulator-max-microvolt = <3000000>;
26 };
27
28};
29
30&omap5_pmx_core {
31 pinctrl-names = "default";
32 pinctrl-0 = <
33 &twl6040_pins
34 &mcpdm_pins
35 &dmic_pins
36 &mcbsp1_pins
37 &mcbsp2_pins
38 >;
39
40 twl6040_pins: pinmux_twl6040_pins {
41 pinctrl-single,pins = <
42 0x18a 0x6 /* perslimbus2_clock.gpio5_145 OUTPUT | MODE6 */
43 >;
44 };
45
46 mcpdm_pins: pinmux_mcpdm_pins {
47 pinctrl-single,pins = <
48 0x142 0x108 /* abe_clks.abe_clks INPUT PULLDOWN | MODE0 */
49 0x15c 0x108 /* abemcpdm_ul_data.abemcpdm_ul_data INPUT PULLDOWN | MODE0 */
50 0x15e 0x108 /* abemcpdm_dl_data.abemcpdm_dl_data INPUT PULLDOWN | MODE0 */
51 0x160 0x118 /* abemcpdm_frame.abemcpdm_frame INPUT PULLUP | MODE0 */
52 0x162 0x108 /* abemcpdm_lb_clk.abemcpdm_lb_clk INPUT PULLDOWN | MODE0 */
53 >;
54 };
55
56 dmic_pins: pinmux_dmic_pins {
57 pinctrl-single,pins = <
58 0x144 0x100 /* abedmic_din1.abedmic_din1 INPUT | MODE0 */
59 0x146 0x100 /* abedmic_din2.abedmic_din2 INPUT | MODE0 */
60 0x148 0x100 /* abedmic_din3.abedmic_din3 INPUT | MODE0 */
61 0x14a 0 /* abedmic_clk1.abedmic_clk1 OUTPUT | MODE0 */
62 >;
63 };
64
65 mcbsp1_pins: pinmux_mcbsp1_pins {
66 pinctrl-single,pins = <
67 0x14c 0x101 /* abedmic_clk2.abemcbsp1_fsx INPUT | MODE1 */
68 0x14e 0x9 /* abedmic_clk3.abemcbsp1_dx OUTPUT PULLDOWN | MODE1 */
69 0x150 0x101 /* abeslimbus1_clock.abemcbsp1_clkx INPUT | MODE0 */
70 0x152 0x109 /* abeslimbus1_data.abemcbsp1_dr INPUT PULLDOWN | MODE1 */
71 >;
72 };
73
74 mcbsp2_pins: pinmux_mcbsp2_pins {
75 pinctrl-single,pins = <
76 0x154 0x108 /* abemcbsp2_dr.abemcbsp2_dr INPUT PULLDOWN | MODE0 */
77 0x156 0x8 /* abemcbsp2_dx.abemcbsp2_dx OUTPUT PULLDOWN | MODE0 */
78 0x158 0x100 /* abemcbsp2_fsx.abemcbsp2_fsx INPUT | MODE0 */
79 0x15a 0x100 /* abemcbsp2_clkx.abemcbsp2_clkx INPUT | MODE0 */
80 >;
81 };
82};
83
84&mmc1 {
85 vmmc-supply = <&vmmcsd_fixed>;
86 bus-width = <4>;
87};
88
89&mmc2 {
90 vmmc-supply = <&vmmcsd_fixed>;
91 bus-width = <8>;
92 ti,non-removable;
93};
94
95&mmc3 {
96 bus-width = <4>;
97 ti,non-removable;
98};
99
100&mmc4 {
101 status = "disabled";
102};
103
104&mmc5 {
105 status = "disabled";
106};
107
108&i2c2 {
109 clock-frequency = <400000>;
110
111 /* Pressure Sensor */
112 bmp085@77 {
113 compatible = "bosch,bmp085";
114 reg = <0x77>;
115 };
116};
117
118&i2c4 {
119 clock-frequency = <400000>;
120
121 /* Temperature Sensor */
122 tmp102@48{
123 compatible = "ti,tmp102";
124 reg = <0x48>;
125 };
126};
127
128&keypad {
129 keypad,num-rows = <8>;
130 keypad,num-columns = <8>;
131 linux,keymap = <0x02020073 /* VOLUP */
132 0x02030072 /* VOLDOWM */
133 0x020400e7 /* SEND */
134 0x02050066 /* HOME */
135 0x0206006b /* END */
136 0x020700d9>; /* SEARCH */
137 linux,input-no-autorepeat;
138};
139
140&mcbsp3 {
141 status = "disabled";
20}; 142};
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 57e52708374..42c78beb4fd 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -33,9 +33,21 @@
33 cpus { 33 cpus {
34 cpu@0 { 34 cpu@0 {
35 compatible = "arm,cortex-a15"; 35 compatible = "arm,cortex-a15";
36 timer {
37 compatible = "arm,armv7-timer";
38 /* 14th PPI IRQ, active low level-sensitive */
39 interrupts = <1 14 0x308>;
40 clock-frequency = <6144000>;
41 };
36 }; 42 };
37 cpu@1 { 43 cpu@1 {
38 compatible = "arm,cortex-a15"; 44 compatible = "arm,cortex-a15";
45 timer {
46 compatible = "arm,armv7-timer";
47 /* 14th PPI IRQ, active low level-sensitive */
48 interrupts = <1 14 0x308>;
49 clock-frequency = <6144000>;
50 };
39 }; 51 };
40 }; 52 };
41 53
@@ -65,6 +77,23 @@
65 ranges; 77 ranges;
66 ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3"; 78 ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3";
67 79
80 omap5_pmx_core: pinmux@4a002840 {
81 compatible = "ti,omap4-padconf", "pinctrl-single";
82 reg = <0x4a002840 0x01b6>;
83 #address-cells = <1>;
84 #size-cells = <0>;
85 pinctrl-single,register-width = <16>;
86 pinctrl-single,function-mask = <0x7fff>;
87 };
88 omap5_pmx_wkup: pinmux@4ae0c840 {
89 compatible = "ti,omap4-padconf", "pinctrl-single";
90 reg = <0x4ae0c840 0x0038>;
91 #address-cells = <1>;
92 #size-cells = <0>;
93 pinctrl-single,register-width = <16>;
94 pinctrl-single,function-mask = <0x7fff>;
95 };
96
68 gic: interrupt-controller@48211000 { 97 gic: interrupt-controller@48211000 {
69 compatible = "arm,cortex-a15-gic"; 98 compatible = "arm,cortex-a15-gic";
70 interrupt-controller; 99 interrupt-controller;
@@ -145,6 +174,41 @@
145 #interrupt-cells = <1>; 174 #interrupt-cells = <1>;
146 }; 175 };
147 176
177 i2c1: i2c@48070000 {
178 compatible = "ti,omap4-i2c";
179 #address-cells = <1>;
180 #size-cells = <0>;
181 ti,hwmods = "i2c1";
182 };
183
184 i2c2: i2c@48072000 {
185 compatible = "ti,omap4-i2c";
186 #address-cells = <1>;
187 #size-cells = <0>;
188 ti,hwmods = "i2c2";
189 };
190
191 i2c3: i2c@48060000 {
192 compatible = "ti,omap4-i2c";
193 #address-cells = <1>;
194 #size-cells = <0>;
195 ti,hwmods = "i2c3";
196 };
197
198 i2c4: i2c@4807A000 {
199 compatible = "ti,omap4-i2c";
200 #address-cells = <1>;
201 #size-cells = <0>;
202 ti,hwmods = "i2c4";
203 };
204
205 i2c5: i2c@4807C000 {
206 compatible = "ti,omap4-i2c";
207 #address-cells = <1>;
208 #size-cells = <0>;
209 ti,hwmods = "i2c5";
210 };
211
148 uart1: serial@4806a000 { 212 uart1: serial@4806a000 {
149 compatible = "ti,omap4-uart"; 213 compatible = "ti,omap4-uart";
150 ti,hwmods = "uart1"; 214 ti,hwmods = "uart1";
@@ -180,5 +244,97 @@
180 ti,hwmods = "uart6"; 244 ti,hwmods = "uart6";
181 clock-frequency = <48000000>; 245 clock-frequency = <48000000>;
182 }; 246 };
247
248 mmc1: mmc@4809c000 {
249 compatible = "ti,omap4-hsmmc";
250 ti,hwmods = "mmc1";
251 ti,dual-volt;
252 ti,needs-special-reset;
253 };
254
255 mmc2: mmc@480b4000 {
256 compatible = "ti,omap4-hsmmc";
257 ti,hwmods = "mmc2";
258 ti,needs-special-reset;
259 };
260
261 mmc3: mmc@480ad000 {
262 compatible = "ti,omap4-hsmmc";
263 ti,hwmods = "mmc3";
264 ti,needs-special-reset;
265 };
266
267 mmc4: mmc@480d1000 {
268 compatible = "ti,omap4-hsmmc";
269 ti,hwmods = "mmc4";
270 ti,needs-special-reset;
271 };
272
273 mmc5: mmc@480d5000 {
274 compatible = "ti,omap4-hsmmc";
275 ti,hwmods = "mmc5";
276 ti,needs-special-reset;
277 };
278
279 keypad: keypad@4ae1c000 {
280 compatible = "ti,omap4-keypad";
281 ti,hwmods = "kbd";
282 };
283
284 mcpdm: mcpdm@40132000 {
285 compatible = "ti,omap4-mcpdm";
286 reg = <0x40132000 0x7f>, /* MPU private access */
287 <0x49032000 0x7f>; /* L3 Interconnect */
288 reg-names = "mpu", "dma";
289 interrupts = <0 112 0x4>;
290 interrupt-parent = <&gic>;
291 ti,hwmods = "mcpdm";
292 };
293
294 dmic: dmic@4012e000 {
295 compatible = "ti,omap4-dmic";
296 reg = <0x4012e000 0x7f>, /* MPU private access */
297 <0x4902e000 0x7f>; /* L3 Interconnect */
298 reg-names = "mpu", "dma";
299 interrupts = <0 114 0x4>;
300 interrupt-parent = <&gic>;
301 ti,hwmods = "dmic";
302 };
303
304 mcbsp1: mcbsp@40122000 {
305 compatible = "ti,omap4-mcbsp";
306 reg = <0x40122000 0xff>, /* MPU private access */
307 <0x49022000 0xff>; /* L3 Interconnect */
308 reg-names = "mpu", "dma";
309 interrupts = <0 17 0x4>;
310 interrupt-names = "common";
311 interrupt-parent = <&gic>;
312 ti,buffer-size = <128>;
313 ti,hwmods = "mcbsp1";
314 };
315
316 mcbsp2: mcbsp@40124000 {
317 compatible = "ti,omap4-mcbsp";
318 reg = <0x40124000 0xff>, /* MPU private access */
319 <0x49024000 0xff>; /* L3 Interconnect */
320 reg-names = "mpu", "dma";
321 interrupts = <0 22 0x4>;
322 interrupt-names = "common";
323 interrupt-parent = <&gic>;
324 ti,buffer-size = <128>;
325 ti,hwmods = "mcbsp2";
326 };
327
328 mcbsp3: mcbsp@40126000 {
329 compatible = "ti,omap4-mcbsp";
330 reg = <0x40126000 0xff>, /* MPU private access */
331 <0x49026000 0xff>; /* L3 Interconnect */
332 reg-names = "mpu", "dma";
333 interrupts = <0 23 0x4>;
334 interrupt-names = "common";
335 interrupt-parent = <&gic>;
336 ti,buffer-size = <128>;
337 ti,hwmods = "mcbsp3";
338 };
183 }; 339 };
184}; 340};
diff --git a/arch/arm/boot/dts/phy3250.dts b/arch/arm/boot/dts/phy3250.dts
index 802ec5b2fd0..90fdbd77f27 100644
--- a/arch/arm/boot/dts/phy3250.dts
+++ b/arch/arm/boot/dts/phy3250.dts
@@ -135,13 +135,11 @@
135 ssp0: ssp@20084000 { 135 ssp0: ssp@20084000 {
136 #address-cells = <1>; 136 #address-cells = <1>;
137 #size-cells = <0>; 137 #size-cells = <0>;
138 pl022,num-chipselects = <1>; 138 num-cs = <1>;
139 cs-gpios = <&gpio 3 5 0>; 139 cs-gpios = <&gpio 3 5 0>;
140 140
141 eeprom: at25@0 { 141 eeprom: at25@0 {
142 pl022,hierarchy = <0>;
143 pl022,interface = <0>; 142 pl022,interface = <0>;
144 pl022,slave-tx-disable = <0>;
145 pl022,com-mode = <0>; 143 pl022,com-mode = <0>;
146 pl022,rx-level-trig = <1>; 144 pl022,rx-level-trig = <1>;
147 pl022,tx-level-trig = <1>; 145 pl022,tx-level-trig = <1>;
@@ -191,16 +189,14 @@
191 leds { 189 leds {
192 compatible = "gpio-leds"; 190 compatible = "gpio-leds";
193 191
194 led0 { 192 led0 { /* red */
195 gpios = <&gpio 5 1 1>; /* GPO_P3 1, GPIO 80, active low */ 193 gpios = <&gpio 5 1 0>; /* GPO_P3 1, GPIO 80, active high */
196 linux,default-trigger = "heartbeat";
197 default-state = "off"; 194 default-state = "off";
198 }; 195 };
199 196
200 led1 { 197 led1 { /* green */
201 gpios = <&gpio 5 14 1>; /* GPO_P3 14, GPIO 93, active low */ 198 gpios = <&gpio 5 14 0>; /* GPO_P3 14, GPIO 93, active high */
202 linux,default-trigger = "timer"; 199 linux,default-trigger = "heartbeat";
203 default-state = "off";
204 }; 200 };
205 }; 201 };
206}; 202};
diff --git a/arch/arm/boot/dts/prima2-cb.dts b/arch/arm/boot/dts/prima2-cb.dts
deleted file mode 100644
index 34ae3a64ba2..00000000000
--- a/arch/arm/boot/dts/prima2-cb.dts
+++ /dev/null
@@ -1,424 +0,0 @@
1/dts-v1/;
2/ {
3 model = "SiRF Prima2 eVB";
4 compatible = "sirf,prima2-cb", "sirf,prima2";
5 #address-cells = <1>;
6 #size-cells = <1>;
7 interrupt-parent = <&intc>;
8
9 memory {
10 reg = <0x00000000 0x20000000>;
11 };
12
13 chosen {
14 bootargs = "mem=512M real_root=/dev/mmcblk0p2 console=ttyS0 panel=1 bootsplash=true bpp=16 androidboot.console=ttyS1";
15 linux,stdout-path = &uart1;
16 };
17
18 cpus {
19 #address-cells = <1>;
20 #size-cells = <0>;
21
22 cpu@0 {
23 reg = <0x0>;
24 d-cache-line-size = <32>;
25 i-cache-line-size = <32>;
26 d-cache-size = <32768>;
27 i-cache-size = <32768>;
28 /* from bootloader */
29 timebase-frequency = <0>;
30 bus-frequency = <0>;
31 clock-frequency = <0>;
32 };
33 };
34
35 axi {
36 compatible = "simple-bus";
37 #address-cells = <1>;
38 #size-cells = <1>;
39 ranges = <0x40000000 0x40000000 0x80000000>;
40
41 l2-cache-controller@80040000 {
42 compatible = "arm,pl310-cache", "sirf,prima2-pl310-cache";
43 reg = <0x80040000 0x1000>;
44 interrupts = <59>;
45 arm,tag-latency = <1 1 1>;
46 arm,data-latency = <1 1 1>;
47 arm,filter-ranges = <0 0x40000000>;
48 };
49
50 intc: interrupt-controller@80020000 {
51 #interrupt-cells = <1>;
52 interrupt-controller;
53 compatible = "sirf,prima2-intc";
54 reg = <0x80020000 0x1000>;
55 };
56
57 sys-iobg {
58 compatible = "simple-bus";
59 #address-cells = <1>;
60 #size-cells = <1>;
61 ranges = <0x88000000 0x88000000 0x40000>;
62
63 clock-controller@88000000 {
64 compatible = "sirf,prima2-clkc";
65 reg = <0x88000000 0x1000>;
66 interrupts = <3>;
67 };
68
69 reset-controller@88010000 {
70 compatible = "sirf,prima2-rstc";
71 reg = <0x88010000 0x1000>;
72 };
73
74 rsc-controller@88020000 {
75 compatible = "sirf,prima2-rsc";
76 reg = <0x88020000 0x1000>;
77 };
78 };
79
80 mem-iobg {
81 compatible = "simple-bus";
82 #address-cells = <1>;
83 #size-cells = <1>;
84 ranges = <0x90000000 0x90000000 0x10000>;
85
86 memory-controller@90000000 {
87 compatible = "sirf,prima2-memc";
88 reg = <0x90000000 0x10000>;
89 interrupts = <27>;
90 };
91 };
92
93 disp-iobg {
94 compatible = "simple-bus";
95 #address-cells = <1>;
96 #size-cells = <1>;
97 ranges = <0x90010000 0x90010000 0x30000>;
98
99 display@90010000 {
100 compatible = "sirf,prima2-lcd";
101 reg = <0x90010000 0x20000>;
102 interrupts = <30>;
103 };
104
105 vpp@90020000 {
106 compatible = "sirf,prima2-vpp";
107 reg = <0x90020000 0x10000>;
108 interrupts = <31>;
109 };
110 };
111
112 graphics-iobg {
113 compatible = "simple-bus";
114 #address-cells = <1>;
115 #size-cells = <1>;
116 ranges = <0x98000000 0x98000000 0x8000000>;
117
118 graphics@98000000 {
119 compatible = "powervr,sgx531";
120 reg = <0x98000000 0x8000000>;
121 interrupts = <6>;
122 };
123 };
124
125 multimedia-iobg {
126 compatible = "simple-bus";
127 #address-cells = <1>;
128 #size-cells = <1>;
129 ranges = <0xa0000000 0xa0000000 0x8000000>;
130
131 multimedia@a0000000 {
132 compatible = "sirf,prima2-video-codec";
133 reg = <0xa0000000 0x8000000>;
134 interrupts = <5>;
135 };
136 };
137
138 dsp-iobg {
139 compatible = "simple-bus";
140 #address-cells = <1>;
141 #size-cells = <1>;
142 ranges = <0xa8000000 0xa8000000 0x2000000>;
143
144 dspif@a8000000 {
145 compatible = "sirf,prima2-dspif";
146 reg = <0xa8000000 0x10000>;
147 interrupts = <9>;
148 };
149
150 gps@a8010000 {
151 compatible = "sirf,prima2-gps";
152 reg = <0xa8010000 0x10000>;
153 interrupts = <7>;
154 };
155
156 dsp@a9000000 {
157 compatible = "sirf,prima2-dsp";
158 reg = <0xa9000000 0x1000000>;
159 interrupts = <8>;
160 };
161 };
162
163 peri-iobg {
164 compatible = "simple-bus";
165 #address-cells = <1>;
166 #size-cells = <1>;
167 ranges = <0xb0000000 0xb0000000 0x180000>;
168
169 timer@b0020000 {
170 compatible = "sirf,prima2-tick";
171 reg = <0xb0020000 0x1000>;
172 interrupts = <0>;
173 };
174
175 nand@b0030000 {
176 compatible = "sirf,prima2-nand";
177 reg = <0xb0030000 0x10000>;
178 interrupts = <41>;
179 };
180
181 audio@b0040000 {
182 compatible = "sirf,prima2-audio";
183 reg = <0xb0040000 0x10000>;
184 interrupts = <35>;
185 };
186
187 uart0: uart@b0050000 {
188 cell-index = <0>;
189 compatible = "sirf,prima2-uart";
190 reg = <0xb0050000 0x10000>;
191 interrupts = <17>;
192 };
193
194 uart1: uart@b0060000 {
195 cell-index = <1>;
196 compatible = "sirf,prima2-uart";
197 reg = <0xb0060000 0x10000>;
198 interrupts = <18>;
199 };
200
201 uart2: uart@b0070000 {
202 cell-index = <2>;
203 compatible = "sirf,prima2-uart";
204 reg = <0xb0070000 0x10000>;
205 interrupts = <19>;
206 };
207
208 usp0: usp@b0080000 {
209 cell-index = <0>;
210 compatible = "sirf,prima2-usp";
211 reg = <0xb0080000 0x10000>;
212 interrupts = <20>;
213 };
214
215 usp1: usp@b0090000 {
216 cell-index = <1>;
217 compatible = "sirf,prima2-usp";
218 reg = <0xb0090000 0x10000>;
219 interrupts = <21>;
220 };
221
222 usp2: usp@b00a0000 {
223 cell-index = <2>;
224 compatible = "sirf,prima2-usp";
225 reg = <0xb00a0000 0x10000>;
226 interrupts = <22>;
227 };
228
229 dmac0: dma-controller@b00b0000 {
230 cell-index = <0>;
231 compatible = "sirf,prima2-dmac";
232 reg = <0xb00b0000 0x10000>;
233 interrupts = <12>;
234 };
235
236 dmac1: dma-controller@b0160000 {
237 cell-index = <1>;
238 compatible = "sirf,prima2-dmac";
239 reg = <0xb0160000 0x10000>;
240 interrupts = <13>;
241 };
242
243 vip@b00C0000 {
244 compatible = "sirf,prima2-vip";
245 reg = <0xb00C0000 0x10000>;
246 };
247
248 spi0: spi@b00d0000 {
249 cell-index = <0>;
250 compatible = "sirf,prima2-spi";
251 reg = <0xb00d0000 0x10000>;
252 interrupts = <15>;
253 };
254
255 spi1: spi@b0170000 {
256 cell-index = <1>;
257 compatible = "sirf,prima2-spi";
258 reg = <0xb0170000 0x10000>;
259 interrupts = <16>;
260 };
261
262 i2c0: i2c@b00e0000 {
263 cell-index = <0>;
264 compatible = "sirf,prima2-i2c";
265 reg = <0xb00e0000 0x10000>;
266 interrupts = <24>;
267 };
268
269 i2c1: i2c@b00f0000 {
270 cell-index = <1>;
271 compatible = "sirf,prima2-i2c";
272 reg = <0xb00f0000 0x10000>;
273 interrupts = <25>;
274 };
275
276 tsc@b0110000 {
277 compatible = "sirf,prima2-tsc";
278 reg = <0xb0110000 0x10000>;
279 interrupts = <33>;
280 };
281
282 gpio: gpio-controller@b0120000 {
283 #gpio-cells = <2>;
284 #interrupt-cells = <2>;
285 compatible = "sirf,prima2-gpio-pinmux";
286 reg = <0xb0120000 0x10000>;
287 gpio-controller;
288 interrupt-controller;
289 };
290
291 pwm@b0130000 {
292 compatible = "sirf,prima2-pwm";
293 reg = <0xb0130000 0x10000>;
294 };
295
296 efusesys@b0140000 {
297 compatible = "sirf,prima2-efuse";
298 reg = <0xb0140000 0x10000>;
299 };
300
301 pulsec@b0150000 {
302 compatible = "sirf,prima2-pulsec";
303 reg = <0xb0150000 0x10000>;
304 interrupts = <48>;
305 };
306
307 pci-iobg {
308 compatible = "sirf,prima2-pciiobg", "simple-bus";
309 #address-cells = <1>;
310 #size-cells = <1>;
311 ranges = <0x56000000 0x56000000 0x1b00000>;
312
313 sd0: sdhci@56000000 {
314 cell-index = <0>;
315 compatible = "sirf,prima2-sdhc";
316 reg = <0x56000000 0x100000>;
317 interrupts = <38>;
318 };
319
320 sd1: sdhci@56100000 {
321 cell-index = <1>;
322 compatible = "sirf,prima2-sdhc";
323 reg = <0x56100000 0x100000>;
324 interrupts = <38>;
325 };
326
327 sd2: sdhci@56200000 {
328 cell-index = <2>;
329 compatible = "sirf,prima2-sdhc";
330 reg = <0x56200000 0x100000>;
331 interrupts = <23>;
332 };
333
334 sd3: sdhci@56300000 {
335 cell-index = <3>;
336 compatible = "sirf,prima2-sdhc";
337 reg = <0x56300000 0x100000>;
338 interrupts = <23>;
339 };
340
341 sd4: sdhci@56400000 {
342 cell-index = <4>;
343 compatible = "sirf,prima2-sdhc";
344 reg = <0x56400000 0x100000>;
345 interrupts = <39>;
346 };
347
348 sd5: sdhci@56500000 {
349 cell-index = <5>;
350 compatible = "sirf,prima2-sdhc";
351 reg = <0x56500000 0x100000>;
352 interrupts = <39>;
353 };
354
355 pci-copy@57900000 {
356 compatible = "sirf,prima2-pcicp";
357 reg = <0x57900000 0x100000>;
358 interrupts = <40>;
359 };
360
361 rom-interface@57a00000 {
362 compatible = "sirf,prima2-romif";
363 reg = <0x57a00000 0x100000>;
364 };
365 };
366 };
367
368 rtc-iobg {
369 compatible = "sirf,prima2-rtciobg", "sirf-prima2-rtciobg-bus";
370 #address-cells = <1>;
371 #size-cells = <1>;
372 reg = <0x80030000 0x10000>;
373
374 gpsrtc@1000 {
375 compatible = "sirf,prima2-gpsrtc";
376 reg = <0x1000 0x1000>;
377 interrupts = <55 56 57>;
378 };
379
380 sysrtc@2000 {
381 compatible = "sirf,prima2-sysrtc";
382 reg = <0x2000 0x1000>;
383 interrupts = <52 53 54>;
384 };
385
386 pwrc@3000 {
387 compatible = "sirf,prima2-pwrc";
388 reg = <0x3000 0x1000>;
389 interrupts = <32>;
390 };
391 };
392
393 uus-iobg {
394 compatible = "simple-bus";
395 #address-cells = <1>;
396 #size-cells = <1>;
397 ranges = <0xb8000000 0xb8000000 0x40000>;
398
399 usb0: usb@b00e0000 {
400 compatible = "chipidea,ci13611a-prima2";
401 reg = <0xb8000000 0x10000>;
402 interrupts = <10>;
403 };
404
405 usb1: usb@b00f0000 {
406 compatible = "chipidea,ci13611a-prima2";
407 reg = <0xb8010000 0x10000>;
408 interrupts = <11>;
409 };
410
411 sata@b00f0000 {
412 compatible = "synopsys,dwc-ahsata";
413 reg = <0xb8020000 0x10000>;
414 interrupts = <37>;
415 };
416
417 security@b00f0000 {
418 compatible = "sirf,prima2-security";
419 reg = <0xb8030000 0x10000>;
420 interrupts = <42>;
421 };
422 };
423 };
424};
diff --git a/arch/arm/boot/dts/prima2-evb.dts b/arch/arm/boot/dts/prima2-evb.dts
new file mode 100644
index 00000000000..57286b4e7b8
--- /dev/null
+++ b/arch/arm/boot/dts/prima2-evb.dts
@@ -0,0 +1,37 @@
1/*
2 * DTS file for CSR SiRFprimaII 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/ "prima2.dtsi"
12
13/ {
14 model = "CSR SiRFprimaII Evaluation Board";
15 compatible = "sirf,prima2", "sirf,prima2-cb";
16
17 memory {
18 reg = <0x00000000 0x20000000>;
19 };
20
21 axi {
22 peri-iobg {
23 uart@b0060000 {
24 pinctrl-names = "default";
25 pinctrl-0 = <&uart1_pins_a>;
26 };
27 spi@b00d0000 {
28 pinctrl-names = "default";
29 pinctrl-0 = <&spi0_pins_a>;
30 };
31 spi@b0170000 {
32 pinctrl-names = "default";
33 pinctrl-0 = <&spi1_pins_a>;
34 };
35 };
36 };
37};
diff --git a/arch/arm/boot/dts/prima2.dtsi b/arch/arm/boot/dts/prima2.dtsi
new file mode 100644
index 00000000000..055fca54212
--- /dev/null
+++ b/arch/arm/boot/dts/prima2.dtsi
@@ -0,0 +1,640 @@
1/*
2 * DTS file for CSR SiRFprimaII 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,prima2";
12 #address-cells = <1>;
13 #size-cells = <1>;
14 interrupt-parent = <&intc>;
15
16 cpus {
17 #address-cells = <1>;
18 #size-cells = <0>;
19
20 cpu@0 {
21 reg = <0x0>;
22 d-cache-line-size = <32>;
23 i-cache-line-size = <32>;
24 d-cache-size = <32768>;
25 i-cache-size = <32768>;
26 /* from bootloader */
27 timebase-frequency = <0>;
28 bus-frequency = <0>;
29 clock-frequency = <0>;
30 };
31 };
32
33 axi {
34 compatible = "simple-bus";
35 #address-cells = <1>;
36 #size-cells = <1>;
37 ranges = <0x40000000 0x40000000 0x80000000>;
38
39 l2-cache-controller@80040000 {
40 compatible = "arm,pl310-cache", "sirf,prima2-pl310-cache";
41 reg = <0x80040000 0x1000>;
42 interrupts = <59>;
43 arm,tag-latency = <1 1 1>;
44 arm,data-latency = <1 1 1>;
45 arm,filter-ranges = <0 0x40000000>;
46 };
47
48 intc: interrupt-controller@80020000 {
49 #interrupt-cells = <1>;
50 interrupt-controller;
51 compatible = "sirf,prima2-intc";
52 reg = <0x80020000 0x1000>;
53 };
54
55 sys-iobg {
56 compatible = "simple-bus";
57 #address-cells = <1>;
58 #size-cells = <1>;
59 ranges = <0x88000000 0x88000000 0x40000>;
60
61 clock-controller@88000000 {
62 compatible = "sirf,prima2-clkc";
63 reg = <0x88000000 0x1000>;
64 interrupts = <3>;
65 };
66
67 reset-controller@88010000 {
68 compatible = "sirf,prima2-rstc";
69 reg = <0x88010000 0x1000>;
70 };
71
72 rsc-controller@88020000 {
73 compatible = "sirf,prima2-rsc";
74 reg = <0x88020000 0x1000>;
75 };
76 };
77
78 mem-iobg {
79 compatible = "simple-bus";
80 #address-cells = <1>;
81 #size-cells = <1>;
82 ranges = <0x90000000 0x90000000 0x10000>;
83
84 memory-controller@90000000 {
85 compatible = "sirf,prima2-memc";
86 reg = <0x90000000 0x10000>;
87 interrupts = <27>;
88 };
89 };
90
91 disp-iobg {
92 compatible = "simple-bus";
93 #address-cells = <1>;
94 #size-cells = <1>;
95 ranges = <0x90010000 0x90010000 0x30000>;
96
97 display@90010000 {
98 compatible = "sirf,prima2-lcd";
99 reg = <0x90010000 0x20000>;
100 interrupts = <30>;
101 };
102
103 vpp@90020000 {
104 compatible = "sirf,prima2-vpp";
105 reg = <0x90020000 0x10000>;
106 interrupts = <31>;
107 };
108 };
109
110 graphics-iobg {
111 compatible = "simple-bus";
112 #address-cells = <1>;
113 #size-cells = <1>;
114 ranges = <0x98000000 0x98000000 0x8000000>;
115
116 graphics@98000000 {
117 compatible = "powervr,sgx531";
118 reg = <0x98000000 0x8000000>;
119 interrupts = <6>;
120 };
121 };
122
123 multimedia-iobg {
124 compatible = "simple-bus";
125 #address-cells = <1>;
126 #size-cells = <1>;
127 ranges = <0xa0000000 0xa0000000 0x8000000>;
128
129 multimedia@a0000000 {
130 compatible = "sirf,prima2-video-codec";
131 reg = <0xa0000000 0x8000000>;
132 interrupts = <5>;
133 };
134 };
135
136 dsp-iobg {
137 compatible = "simple-bus";
138 #address-cells = <1>;
139 #size-cells = <1>;
140 ranges = <0xa8000000 0xa8000000 0x2000000>;
141
142 dspif@a8000000 {
143 compatible = "sirf,prima2-dspif";
144 reg = <0xa8000000 0x10000>;
145 interrupts = <9>;
146 };
147
148 gps@a8010000 {
149 compatible = "sirf,prima2-gps";
150 reg = <0xa8010000 0x10000>;
151 interrupts = <7>;
152 };
153
154 dsp@a9000000 {
155 compatible = "sirf,prima2-dsp";
156 reg = <0xa9000000 0x1000000>;
157 interrupts = <8>;
158 };
159 };
160
161 peri-iobg {
162 compatible = "simple-bus";
163 #address-cells = <1>;
164 #size-cells = <1>;
165 ranges = <0xb0000000 0xb0000000 0x180000>;
166
167 timer@b0020000 {
168 compatible = "sirf,prima2-tick";
169 reg = <0xb0020000 0x1000>;
170 interrupts = <0>;
171 };
172
173 nand@b0030000 {
174 compatible = "sirf,prima2-nand";
175 reg = <0xb0030000 0x10000>;
176 interrupts = <41>;
177 };
178
179 audio@b0040000 {
180 compatible = "sirf,prima2-audio";
181 reg = <0xb0040000 0x10000>;
182 interrupts = <35>;
183 };
184
185 uart0: uart@b0050000 {
186 cell-index = <0>;
187 compatible = "sirf,prima2-uart";
188 reg = <0xb0050000 0x10000>;
189 interrupts = <17>;
190 };
191
192 uart1: uart@b0060000 {
193 cell-index = <1>;
194 compatible = "sirf,prima2-uart";
195 reg = <0xb0060000 0x10000>;
196 interrupts = <18>;
197 };
198
199 uart2: uart@b0070000 {
200 cell-index = <2>;
201 compatible = "sirf,prima2-uart";
202 reg = <0xb0070000 0x10000>;
203 interrupts = <19>;
204 };
205
206 usp0: usp@b0080000 {
207 cell-index = <0>;
208 compatible = "sirf,prima2-usp";
209 reg = <0xb0080000 0x10000>;
210 interrupts = <20>;
211 };
212
213 usp1: usp@b0090000 {
214 cell-index = <1>;
215 compatible = "sirf,prima2-usp";
216 reg = <0xb0090000 0x10000>;
217 interrupts = <21>;
218 };
219
220 usp2: usp@b00a0000 {
221 cell-index = <2>;
222 compatible = "sirf,prima2-usp";
223 reg = <0xb00a0000 0x10000>;
224 interrupts = <22>;
225 };
226
227 dmac0: dma-controller@b00b0000 {
228 cell-index = <0>;
229 compatible = "sirf,prima2-dmac";
230 reg = <0xb00b0000 0x10000>;
231 interrupts = <12>;
232 };
233
234 dmac1: dma-controller@b0160000 {
235 cell-index = <1>;
236 compatible = "sirf,prima2-dmac";
237 reg = <0xb0160000 0x10000>;
238 interrupts = <13>;
239 };
240
241 vip@b00C0000 {
242 compatible = "sirf,prima2-vip";
243 reg = <0xb00C0000 0x10000>;
244 };
245
246 spi0: spi@b00d0000 {
247 cell-index = <0>;
248 compatible = "sirf,prima2-spi";
249 reg = <0xb00d0000 0x10000>;
250 interrupts = <15>;
251 };
252
253 spi1: spi@b0170000 {
254 cell-index = <1>;
255 compatible = "sirf,prima2-spi";
256 reg = <0xb0170000 0x10000>;
257 interrupts = <16>;
258 };
259
260 i2c0: i2c@b00e0000 {
261 cell-index = <0>;
262 compatible = "sirf,prima2-i2c";
263 reg = <0xb00e0000 0x10000>;
264 interrupts = <24>;
265 };
266
267 i2c1: i2c@b00f0000 {
268 cell-index = <1>;
269 compatible = "sirf,prima2-i2c";
270 reg = <0xb00f0000 0x10000>;
271 interrupts = <25>;
272 };
273
274 tsc@b0110000 {
275 compatible = "sirf,prima2-tsc";
276 reg = <0xb0110000 0x10000>;
277 interrupts = <33>;
278 };
279
280 gpio: pinctrl@b0120000 {
281 #gpio-cells = <2>;
282 #interrupt-cells = <2>;
283 compatible = "sirf,prima2-pinctrl";
284 reg = <0xb0120000 0x10000>;
285 interrupts = <43 44 45 46 47>;
286 gpio-controller;
287 interrupt-controller;
288
289 lcd_16pins_a: lcd0@0 {
290 lcd {
291 sirf,pins = "lcd_16bitsgrp";
292 sirf,function = "lcd_16bits";
293 };
294 };
295 lcd_18pins_a: lcd0@1 {
296 lcd {
297 sirf,pins = "lcd_18bitsgrp";
298 sirf,function = "lcd_18bits";
299 };
300 };
301 lcd_24pins_a: lcd0@2 {
302 lcd {
303 sirf,pins = "lcd_24bitsgrp";
304 sirf,function = "lcd_24bits";
305 };
306 };
307 lcdrom_pins_a: lcdrom0@0 {
308 lcd {
309 sirf,pins = "lcdromgrp";
310 sirf,function = "lcdrom";
311 };
312 };
313 uart0_pins_a: uart0@0 {
314 uart {
315 sirf,pins = "uart0grp";
316 sirf,function = "uart0";
317 };
318 };
319 uart1_pins_a: uart1@0 {
320 uart {
321 sirf,pins = "uart1grp";
322 sirf,function = "uart1";
323 };
324 };
325 uart2_pins_a: uart2@0 {
326 uart {
327 sirf,pins = "uart2grp";
328 sirf,function = "uart2";
329 };
330 };
331 uart2_noflow_pins_a: uart2@1 {
332 uart {
333 sirf,pins = "uart2_nostreamctrlgrp";
334 sirf,function = "uart2_nostreamctrl";
335 };
336 };
337 spi0_pins_a: spi0@0 {
338 spi {
339 sirf,pins = "spi0grp";
340 sirf,function = "spi0";
341 };
342 };
343 spi1_pins_a: spi1@0 {
344 spi {
345 sirf,pins = "spi1grp";
346 sirf,function = "spi1";
347 };
348 };
349 i2c0_pins_a: i2c0@0 {
350 i2c {
351 sirf,pins = "i2c0grp";
352 sirf,function = "i2c0";
353 };
354 };
355 i2c1_pins_a: i2c1@0 {
356 i2c {
357 sirf,pins = "i2c1grp";
358 sirf,function = "i2c1";
359 };
360 };
361 pwm0_pins_a: pwm0@0 {
362 pwm {
363 sirf,pins = "pwm0grp";
364 sirf,function = "pwm0";
365 };
366 };
367 pwm1_pins_a: pwm1@0 {
368 pwm {
369 sirf,pins = "pwm1grp";
370 sirf,function = "pwm1";
371 };
372 };
373 pwm2_pins_a: pwm2@0 {
374 pwm {
375 sirf,pins = "pwm2grp";
376 sirf,function = "pwm2";
377 };
378 };
379 pwm3_pins_a: pwm3@0 {
380 pwm {
381 sirf,pins = "pwm3grp";
382 sirf,function = "pwm3";
383 };
384 };
385 gps_pins_a: gps@0 {
386 gps {
387 sirf,pins = "gpsgrp";
388 sirf,function = "gps";
389 };
390 };
391 vip_pins_a: vip@0 {
392 vip {
393 sirf,pins = "vipgrp";
394 sirf,function = "vip";
395 };
396 };
397 sdmmc0_pins_a: sdmmc0@0 {
398 sdmmc0 {
399 sirf,pins = "sdmmc0grp";
400 sirf,function = "sdmmc0";
401 };
402 };
403 sdmmc1_pins_a: sdmmc1@0 {
404 sdmmc1 {
405 sirf,pins = "sdmmc1grp";
406 sirf,function = "sdmmc1";
407 };
408 };
409 sdmmc2_pins_a: sdmmc2@0 {
410 sdmmc2 {
411 sirf,pins = "sdmmc2grp";
412 sirf,function = "sdmmc2";
413 };
414 };
415 sdmmc3_pins_a: sdmmc3@0 {
416 sdmmc3 {
417 sirf,pins = "sdmmc3grp";
418 sirf,function = "sdmmc3";
419 };
420 };
421 sdmmc4_pins_a: sdmmc4@0 {
422 sdmmc4 {
423 sirf,pins = "sdmmc4grp";
424 sirf,function = "sdmmc4";
425 };
426 };
427 sdmmc5_pins_a: sdmmc5@0 {
428 sdmmc5 {
429 sirf,pins = "sdmmc5grp";
430 sirf,function = "sdmmc5";
431 };
432 };
433 i2s_pins_a: i2s@0 {
434 i2s {
435 sirf,pins = "i2sgrp";
436 sirf,function = "i2s";
437 };
438 };
439 ac97_pins_a: ac97@0 {
440 ac97 {
441 sirf,pins = "ac97grp";
442 sirf,function = "ac97";
443 };
444 };
445 nand_pins_a: nand@0 {
446 nand {
447 sirf,pins = "nandgrp";
448 sirf,function = "nand";
449 };
450 };
451 usp0_pins_a: usp0@0 {
452 usp0 {
453 sirf,pins = "usp0grp";
454 sirf,function = "usp0";
455 };
456 };
457 usp1_pins_a: usp1@0 {
458 usp1 {
459 sirf,pins = "usp1grp";
460 sirf,function = "usp1";
461 };
462 };
463 usp2_pins_a: usp2@0 {
464 usp2 {
465 sirf,pins = "usp2grp";
466 sirf,function = "usp2";
467 };
468 };
469 usb0_utmi_drvbus_pins_a: usb0_utmi_drvbus@0 {
470 usb0_utmi_drvbus {
471 sirf,pins = "usb0_utmi_drvbusgrp";
472 sirf,function = "usb0_utmi_drvbus";
473 };
474 };
475 usb1_utmi_drvbus_pins_a: usb1_utmi_drvbus@0 {
476 usb1_utmi_drvbus {
477 sirf,pins = "usb1_utmi_drvbusgrp";
478 sirf,function = "usb1_utmi_drvbus";
479 };
480 };
481 warm_rst_pins_a: warm_rst@0 {
482 warm_rst {
483 sirf,pins = "warm_rstgrp";
484 sirf,function = "warm_rst";
485 };
486 };
487 pulse_count_pins_a: pulse_count@0 {
488 pulse_count {
489 sirf,pins = "pulse_countgrp";
490 sirf,function = "pulse_count";
491 };
492 };
493 cko0_rst_pins_a: cko0_rst@0 {
494 cko0_rst {
495 sirf,pins = "cko0_rstgrp";
496 sirf,function = "cko0_rst";
497 };
498 };
499 cko1_rst_pins_a: cko1_rst@0 {
500 cko1_rst {
501 sirf,pins = "cko1_rstgrp";
502 sirf,function = "cko1_rst";
503 };
504 };
505 };
506
507 pwm@b0130000 {
508 compatible = "sirf,prima2-pwm";
509 reg = <0xb0130000 0x10000>;
510 };
511
512 efusesys@b0140000 {
513 compatible = "sirf,prima2-efuse";
514 reg = <0xb0140000 0x10000>;
515 };
516
517 pulsec@b0150000 {
518 compatible = "sirf,prima2-pulsec";
519 reg = <0xb0150000 0x10000>;
520 interrupts = <48>;
521 };
522
523 pci-iobg {
524 compatible = "sirf,prima2-pciiobg", "simple-bus";
525 #address-cells = <1>;
526 #size-cells = <1>;
527 ranges = <0x56000000 0x56000000 0x1b00000>;
528
529 sd0: sdhci@56000000 {
530 cell-index = <0>;
531 compatible = "sirf,prima2-sdhc";
532 reg = <0x56000000 0x100000>;
533 interrupts = <38>;
534 };
535
536 sd1: sdhci@56100000 {
537 cell-index = <1>;
538 compatible = "sirf,prima2-sdhc";
539 reg = <0x56100000 0x100000>;
540 interrupts = <38>;
541 };
542
543 sd2: sdhci@56200000 {
544 cell-index = <2>;
545 compatible = "sirf,prima2-sdhc";
546 reg = <0x56200000 0x100000>;
547 interrupts = <23>;
548 };
549
550 sd3: sdhci@56300000 {
551 cell-index = <3>;
552 compatible = "sirf,prima2-sdhc";
553 reg = <0x56300000 0x100000>;
554 interrupts = <23>;
555 };
556
557 sd4: sdhci@56400000 {
558 cell-index = <4>;
559 compatible = "sirf,prima2-sdhc";
560 reg = <0x56400000 0x100000>;
561 interrupts = <39>;
562 };
563
564 sd5: sdhci@56500000 {
565 cell-index = <5>;
566 compatible = "sirf,prima2-sdhc";
567 reg = <0x56500000 0x100000>;
568 interrupts = <39>;
569 };
570
571 pci-copy@57900000 {
572 compatible = "sirf,prima2-pcicp";
573 reg = <0x57900000 0x100000>;
574 interrupts = <40>;
575 };
576
577 rom-interface@57a00000 {
578 compatible = "sirf,prima2-romif";
579 reg = <0x57a00000 0x100000>;
580 };
581 };
582 };
583
584 rtc-iobg {
585 compatible = "sirf,prima2-rtciobg", "sirf-prima2-rtciobg-bus";
586 #address-cells = <1>;
587 #size-cells = <1>;
588 reg = <0x80030000 0x10000>;
589
590 gpsrtc@1000 {
591 compatible = "sirf,prima2-gpsrtc";
592 reg = <0x1000 0x1000>;
593 interrupts = <55 56 57>;
594 };
595
596 sysrtc@2000 {
597 compatible = "sirf,prima2-sysrtc";
598 reg = <0x2000 0x1000>;
599 interrupts = <52 53 54>;
600 };
601
602 pwrc@3000 {
603 compatible = "sirf,prima2-pwrc";
604 reg = <0x3000 0x1000>;
605 interrupts = <32>;
606 };
607 };
608
609 uus-iobg {
610 compatible = "simple-bus";
611 #address-cells = <1>;
612 #size-cells = <1>;
613 ranges = <0xb8000000 0xb8000000 0x40000>;
614
615 usb0: usb@b00e0000 {
616 compatible = "chipidea,ci13611a-prima2";
617 reg = <0xb8000000 0x10000>;
618 interrupts = <10>;
619 };
620
621 usb1: usb@b00f0000 {
622 compatible = "chipidea,ci13611a-prima2";
623 reg = <0xb8010000 0x10000>;
624 interrupts = <11>;
625 };
626
627 sata@b00f0000 {
628 compatible = "synopsys,dwc-ahsata";
629 reg = <0xb8020000 0x10000>;
630 interrupts = <37>;
631 };
632
633 security@b00f0000 {
634 compatible = "sirf,prima2-security";
635 reg = <0xb8030000 0x10000>;
636 interrupts = <42>;
637 };
638 };
639 };
640};
diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi
new file mode 100644
index 00000000000..d7c5d721a5c
--- /dev/null
+++ b/arch/arm/boot/dts/pxa27x.dtsi
@@ -0,0 +1,14 @@
1/* The pxa3xx skeleton simply augments the 2xx version */
2/include/ "pxa2xx.dtsi"
3
4/ {
5 model = "Marvell PXA27x familiy SoC";
6 compatible = "marvell,pxa27x";
7
8 pxabus {
9 pxairq: interrupt-controller@40d00000 {
10 marvell,intc-priority;
11 marvell,intc-nr-irqs = <34>;
12 };
13 };
14};
diff --git a/arch/arm/boot/dts/pxa2xx.dtsi b/arch/arm/boot/dts/pxa2xx.dtsi
new file mode 100644
index 00000000000..f18aad35e8b
--- /dev/null
+++ b/arch/arm/boot/dts/pxa2xx.dtsi
@@ -0,0 +1,132 @@
1/*
2 * pxa2xx.dtsi - Device Tree Include file for Marvell PXA2xx family SoC
3 *
4 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9/include/ "skeleton.dtsi"
10
11/ {
12 model = "Marvell PXA2xx family SoC";
13 compatible = "marvell,pxa2xx";
14 interrupt-parent = <&pxairq>;
15
16 aliases {
17 serial0 = &ffuart;
18 serial1 = &btuart;
19 serial2 = &stuart;
20 serial3 = &hwuart;
21 i2c0 = &pwri2c;
22 i2c1 = &pxai2c1;
23 };
24
25 cpus {
26 cpu@0 {
27 compatible = "arm,xscale";
28 };
29 };
30
31 pxabus {
32 compatible = "simple-bus";
33 #address-cells = <1>;
34 #size-cells = <1>;
35 ranges;
36
37 pxairq: interrupt-controller@40d00000 {
38 #interrupt-cells = <1>;
39 compatible = "marvell,pxa-intc";
40 interrupt-controller;
41 interrupt-parent;
42 marvell,intc-nr-irqs = <32>;
43 reg = <0x40d00000 0xd0>;
44 };
45
46 gpio: gpio@40e00000 {
47 compatible = "mrvl,pxa-gpio";
48 #address-cells = <0x1>;
49 #size-cells = <0x1>;
50 reg = <0x40e00000 0x10000>;
51 gpio-controller;
52 #gpio-cells = <0x2>;
53 interrupts = <10>;
54 interrupt-names = "gpio_mux";
55 interrupt-controller;
56 #interrupt-cells = <0x2>;
57 ranges;
58
59 gcb0: gpio@40e00000 {
60 reg = <0x40e00000 0x4>;
61 };
62
63 gcb1: gpio@40e00004 {
64 reg = <0x40e00004 0x4>;
65 };
66
67 gcb2: gpio@40e00008 {
68 reg = <0x40e00008 0x4>;
69 };
70 gcb3: gpio@40e0000c {
71 reg = <0x40e0000c 0x4>;
72 };
73 };
74
75 ffuart: uart@40100000 {
76 compatible = "mrvl,pxa-uart";
77 reg = <0x40100000 0x30>;
78 interrupts = <22>;
79 status = "disabled";
80 };
81
82 btuart: uart@40200000 {
83 compatible = "mrvl,pxa-uart";
84 reg = <0x40200000 0x30>;
85 interrupts = <21>;
86 status = "disabled";
87 };
88
89 stuart: uart@40700000 {
90 compatible = "mrvl,pxa-uart";
91 reg = <0x40700000 0x30>;
92 interrupts = <20>;
93 status = "disabled";
94 };
95
96 hwuart: uart@41100000 {
97 compatible = "mrvl,pxa-uart";
98 reg = <0x41100000 0x30>;
99 interrupts = <7>;
100 status = "disabled";
101 };
102
103 pxai2c1: i2c@40301680 {
104 compatible = "mrvl,pxa-i2c";
105 reg = <0x40301680 0x30>;
106 interrupts = <18>;
107 #address-cells = <0x1>;
108 #size-cells = <0>;
109 status = "disabled";
110 };
111
112 usb0: ohci@4c000000 {
113 compatible = "mrvl,pxa-ohci";
114 reg = <0x4c000000 0x10000>;
115 interrupts = <3>;
116 status = "disabled";
117 };
118
119 mmc0: mmc@41100000 {
120 compatible = "mrvl,pxa-mmc";
121 reg = <0x41100000 0x1000>;
122 interrupts = <23>;
123 status = "disabled";
124 };
125
126 rtc@40900000 {
127 compatible = "marvell,pxa-rtc";
128 reg = <0x40900000 0x3c>;
129 interrupts = <30 31>;
130 };
131 };
132};
diff --git a/arch/arm/boot/dts/pxa3xx.dtsi b/arch/arm/boot/dts/pxa3xx.dtsi
new file mode 100644
index 00000000000..f9d92da8678
--- /dev/null
+++ b/arch/arm/boot/dts/pxa3xx.dtsi
@@ -0,0 +1,32 @@
1/* The pxa3xx skeleton simply augments the 2xx version */
2/include/ "pxa2xx.dtsi"
3
4/ {
5 model = "Marvell PXA3xx familiy SoC";
6 compatible = "marvell,pxa3xx";
7
8 pxabus {
9 pwri2c: i2c@40f500c0 {
10 compatible = "mrvl,pwri2c";
11 reg = <0x40f500c0 0x30>;
12 interrupts = <6>;
13 #address-cells = <0x1>;
14 #size-cells = <0>;
15 status = "disabled";
16 };
17
18 nand0: nand@43100000 {
19 compatible = "marvell,pxa3xx-nand";
20 reg = <0x43100000 90>;
21 interrupts = <45>;
22 #address-cells = <1>;
23 #size-cells = <1>;
24 status = "disabled";
25 };
26
27 pxairq: interrupt-controller@40d00000 {
28 marvell,intc-priority;
29 marvell,intc-nr-irqs = <56>;
30 };
31 };
32};
diff --git a/arch/arm/boot/dts/pxa910-dkb.dts b/arch/arm/boot/dts/pxa910-dkb.dts
index e92be5a474e..595492aa505 100644
--- a/arch/arm/boot/dts/pxa910-dkb.dts
+++ b/arch/arm/boot/dts/pxa910-dkb.dts
@@ -29,6 +29,143 @@
29 }; 29 };
30 twsi1: i2c@d4011000 { 30 twsi1: i2c@d4011000 {
31 status = "okay"; 31 status = "okay";
32
33 pmic: 88pm860x@34 {
34 compatible = "marvell,88pm860x";
35 reg = <0x34>;
36 interrupts = <4>;
37 interrupt-parent = <&intc>;
38 interrupt-controller;
39 #interrupt-cells = <1>;
40
41 marvell,88pm860x-irq-read-clr;
42 marvell,88pm860x-slave-addr = <0x11>;
43
44 regulators {
45 BUCK1 {
46 regulator-min-microvolt = <1000000>;
47 regulator-max-microvolt = <1500000>;
48 regulator-boot-on;
49 regulator-always-on;
50 };
51 BUCK2 {
52 regulator-min-microvolt = <1000000>;
53 regulator-max-microvolt = <1500000>;
54 regulator-boot-on;
55 regulator-always-on;
56 };
57 BUCK3 {
58 regulator-min-microvolt = <1000000>;
59 regulator-max-microvolt = <3000000>;
60 regulator-boot-on;
61 regulator-always-on;
62 };
63 LDO1 {
64 regulator-min-microvolt = <1200000>;
65 regulator-max-microvolt = <2800000>;
66 regulator-boot-on;
67 regulator-always-on;
68 };
69 LDO2 {
70 regulator-min-microvolt = <1800000>;
71 regulator-max-microvolt = <3300000>;
72 regulator-boot-on;
73 regulator-always-on;
74 };
75 LDO3 {
76 regulator-min-microvolt = <1800000>;
77 regulator-max-microvolt = <3300000>;
78 regulator-boot-on;
79 regulator-always-on;
80 };
81 LDO4 {
82 regulator-min-microvolt = <1800000>;
83 regulator-max-microvolt = <3300000>;
84 regulator-always-on;
85 };
86 LDO5 {
87 regulator-min-microvolt = <2900000>;
88 regulator-max-microvolt = <3300000>;
89 regulator-boot-on;
90 regulator-always-on;
91 };
92 LDO6 {
93 regulator-min-microvolt = <1800000>;
94 regulator-max-microvolt = <3300000>;
95 regulator-boot-on;
96 regulator-always-on;
97 };
98 LDO7 {
99 regulator-min-microvolt = <1800000>;
100 regulator-max-microvolt = <2900000>;
101 regulator-boot-on;
102 regulator-always-on;
103 };
104 LDO8 {
105 regulator-min-microvolt = <1800000>;
106 regulator-max-microvolt = <2900000>;
107 regulator-boot-on;
108 regulator-always-on;
109 };
110 LDO9 {
111 regulator-min-microvolt = <1800000>;
112 regulator-max-microvolt = <3300000>;
113 regulator-boot-on;
114 regulator-always-on;
115 };
116 LDO10 {
117 regulator-min-microvolt = <1200000>;
118 regulator-max-microvolt = <3300000>;
119 regulator-boot-on;
120 regulator-always-on;
121 };
122 LDO12 {
123 regulator-min-microvolt = <1200000>;
124 regulator-max-microvolt = <3300000>;
125 regulator-always-on;
126 };
127 LDO13 {
128 regulator-min-microvolt = <1200000>;
129 regulator-max-microvolt = <3300000>;
130 regulator-always-on;
131 };
132 LDO14 {
133 regulator-min-microvolt = <1800000>;
134 regulator-max-microvolt = <3300000>;
135 regulator-always-on;
136 };
137 };
138 rtc {
139 marvell,88pm860x-vrtc = <1>;
140 };
141 touch {
142 marvell,88pm860x-gpadc-prebias = <1>;
143 marvell,88pm860x-gpadc-slot-cycle = <1>;
144 marvell,88pm860x-tsi-prebias = <6>;
145 marvell,88pm860x-pen-prebias = <16>;
146 marvell,88pm860x-pen-prechg = <2>;
147 marvell,88pm860x-resistor-X = <300>;
148 };
149 backlights {
150 backlight-0 {
151 marvell,88pm860x-iset = <4>;
152 marvell,88pm860x-pwm = <3>;
153 };
154 backlight-2 {
155 };
156 };
157 leds {
158 led0-red {
159 marvell,88pm860x-iset = <12>;
160 };
161 led0-green {
162 marvell,88pm860x-iset = <12>;
163 };
164 led0-blue {
165 marvell,88pm860x-iset = <12>;
166 };
167 };
168 };
32 }; 169 };
33 rtc: rtc@d4010000 { 170 rtc: rtc@d4010000 {
34 status = "okay"; 171 status = "okay";
diff --git a/arch/arm/boot/dts/pxa910.dtsi b/arch/arm/boot/dts/pxa910.dtsi
index aebf32de73b..825aaca3303 100644
--- a/arch/arm/boot/dts/pxa910.dtsi
+++ b/arch/arm/boot/dts/pxa910.dtsi
@@ -25,6 +25,11 @@
25 interrupt-parent = <&intc>; 25 interrupt-parent = <&intc>;
26 ranges; 26 ranges;
27 27
28 L2: l2-cache {
29 compatible = "marvell,tauros2-cache";
30 marvell,tauros2-cache-features = <0x3>;
31 };
32
28 axi@d4200000 { /* AXI */ 33 axi@d4200000 { /* AXI */
29 compatible = "mrvl,axi-bus", "simple-bus"; 34 compatible = "mrvl,axi-bus", "simple-bus";
30 #address-cells = <1>; 35 #address-cells = <1>;
@@ -115,6 +120,8 @@
115 120
116 twsi1: i2c@d4011000 { 121 twsi1: i2c@d4011000 {
117 compatible = "mrvl,mmp-twsi"; 122 compatible = "mrvl,mmp-twsi";
123 #address-cells = <1>;
124 #size-cells = <0>;
118 reg = <0xd4011000 0x1000>; 125 reg = <0xd4011000 0x1000>;
119 interrupts = <7>; 126 interrupts = <7>;
120 mrvl,i2c-fast-mode; 127 mrvl,i2c-fast-mode;
@@ -123,6 +130,8 @@
123 130
124 twsi2: i2c@d4037000 { 131 twsi2: i2c@d4037000 {
125 compatible = "mrvl,mmp-twsi"; 132 compatible = "mrvl,mmp-twsi";
133 #address-cells = <1>;
134 #size-cells = <0>;
126 reg = <0xd4037000 0x1000>; 135 reg = <0xd4037000 0x1000>;
127 interrupts = <54>; 136 interrupts = <54>;
128 status = "disabled"; 137 status = "disabled";
diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
index 7e334d4cae2..702c0baa600 100644
--- a/arch/arm/boot/dts/snowball.dts
+++ b/arch/arm/boot/dts/snowball.dts
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12/dts-v1/; 12/dts-v1/;
13/include/ "db8500.dtsi" 13/include/ "dbx5x0.dtsi"
14 14
15/ { 15/ {
16 model = "Calao Systems Snowball platform with device tree"; 16 model = "Calao Systems Snowball platform with device tree";
@@ -83,6 +83,22 @@
83 }; 83 };
84 84
85 soc-u9500 { 85 soc-u9500 {
86
87 sound {
88 compatible = "stericsson,snd-soc-mop500";
89
90 stericsson,cpu-dai = <&msp1 &msp3>;
91 stericsson,audio-codec = <&codec>;
92 };
93
94 msp1: msp@80124000 {
95 status = "okay";
96 };
97
98 msp3: msp@80125000 {
99 status = "okay";
100 };
101
86 external-bus@50000000 { 102 external-bus@50000000 {
87 status = "okay"; 103 status = "okay";
88 104
@@ -111,7 +127,6 @@
111 mmc-cap-mmc-highspeed; 127 mmc-cap-mmc-highspeed;
112 vmmc-supply = <&ab8500_ldo_aux3_reg>; 128 vmmc-supply = <&ab8500_ldo_aux3_reg>;
113 129
114 #gpio-cells = <1>;
115 cd-gpios = <&gpio6 26 0x4>; // 218 130 cd-gpios = <&gpio6 26 0x4>; // 218
116 cd-inverted; 131 cd-inverted;
117 132
diff --git a/arch/arm/boot/dts/spear300-evb.dts b/arch/arm/boot/dts/spear300-evb.dts
index d71b8d581e3..1e7c7a8e212 100644
--- a/arch/arm/boot/dts/spear300-evb.dts
+++ b/arch/arm/boot/dts/spear300-evb.dts
@@ -80,8 +80,7 @@
80 }; 80 };
81 81
82 sdhci@70000000 { 82 sdhci@70000000 {
83 int-gpio = <&gpio1 0 0>; 83 cd-gpios = <&gpio1 0 0>;
84 power-gpio = <&gpio1 2 1>;
85 status = "okay"; 84 status = "okay";
86 }; 85 };
87 86
diff --git a/arch/arm/boot/dts/spear320-evb.dts b/arch/arm/boot/dts/spear320-evb.dts
index e4e912f9502..082328bd64a 100644
--- a/arch/arm/boot/dts/spear320-evb.dts
+++ b/arch/arm/boot/dts/spear320-evb.dts
@@ -103,8 +103,6 @@
103 }; 103 };
104 104
105 sdhci@70000000 { 105 sdhci@70000000 {
106 power-gpio = <&gpio0 2 1>;
107 power_always_enb;
108 status = "okay"; 106 status = "okay";
109 }; 107 };
110 108
diff --git a/arch/arm/boot/dts/tegra20-harmony.dts b/arch/arm/boot/dts/tegra20-harmony.dts
index f146dbf6f7f..c3ef1ad26b6 100644
--- a/arch/arm/boot/dts/tegra20-harmony.dts
+++ b/arch/arm/boot/dts/tegra20-harmony.dts
@@ -275,6 +275,160 @@
275 i2c@7000d000 { 275 i2c@7000d000 {
276 status = "okay"; 276 status = "okay";
277 clock-frequency = <400000>; 277 clock-frequency = <400000>;
278
279 pmic: tps6586x@34 {
280 compatible = "ti,tps6586x";
281 reg = <0x34>;
282 interrupts = <0 86 0x4>;
283
284 ti,system-power-controller;
285
286 #gpio-cells = <2>;
287 gpio-controller;
288
289 sys-supply = <&vdd_5v0_reg>;
290 vin-sm0-supply = <&sys_reg>;
291 vin-sm1-supply = <&sys_reg>;
292 vin-sm2-supply = <&sys_reg>;
293 vinldo01-supply = <&sm2_reg>;
294 vinldo23-supply = <&sm2_reg>;
295 vinldo4-supply = <&sm2_reg>;
296 vinldo678-supply = <&sm2_reg>;
297 vinldo9-supply = <&sm2_reg>;
298
299 regulators {
300 #address-cells = <1>;
301 #size-cells = <0>;
302
303 sys_reg: regulator@0 {
304 reg = <0>;
305 regulator-compatible = "sys";
306 regulator-name = "vdd_sys";
307 regulator-always-on;
308 };
309
310 regulator@1 {
311 reg = <1>;
312 regulator-compatible = "sm0";
313 regulator-name = "vdd_sm0,vdd_core";
314 regulator-min-microvolt = <1200000>;
315 regulator-max-microvolt = <1200000>;
316 regulator-always-on;
317 };
318
319 regulator@2 {
320 reg = <2>;
321 regulator-compatible = "sm1";
322 regulator-name = "vdd_sm1,vdd_cpu";
323 regulator-min-microvolt = <1000000>;
324 regulator-max-microvolt = <1000000>;
325 regulator-always-on;
326 };
327
328 sm2_reg: regulator@3 {
329 reg = <3>;
330 regulator-compatible = "sm2";
331 regulator-name = "vdd_sm2,vin_ldo*";
332 regulator-min-microvolt = <3700000>;
333 regulator-max-microvolt = <3700000>;
334 regulator-always-on;
335 };
336
337 regulator@4 {
338 reg = <4>;
339 regulator-compatible = "ldo0";
340 regulator-name = "vdd_ldo0,vddio_pex_clk";
341 regulator-min-microvolt = <3300000>;
342 regulator-max-microvolt = <3300000>;
343 };
344
345 regulator@5 {
346 reg = <5>;
347 regulator-compatible = "ldo1";
348 regulator-name = "vdd_ldo1,avdd_pll*";
349 regulator-min-microvolt = <1100000>;
350 regulator-max-microvolt = <1100000>;
351 regulator-always-on;
352 };
353
354 regulator@6 {
355 reg = <6>;
356 regulator-compatible = "ldo2";
357 regulator-name = "vdd_ldo2,vdd_rtc";
358 regulator-min-microvolt = <1200000>;
359 regulator-max-microvolt = <1200000>;
360 };
361
362 regulator@7 {
363 reg = <7>;
364 regulator-compatible = "ldo3";
365 regulator-name = "vdd_ldo3,avdd_usb*";
366 regulator-min-microvolt = <3300000>;
367 regulator-max-microvolt = <3300000>;
368 regulator-always-on;
369 };
370
371 regulator@8 {
372 reg = <8>;
373 regulator-compatible = "ldo4";
374 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys";
375 regulator-min-microvolt = <1800000>;
376 regulator-max-microvolt = <1800000>;
377 regulator-always-on;
378 };
379
380 regulator@9 {
381 reg = <9>;
382 regulator-compatible = "ldo5";
383 regulator-name = "vdd_ldo5,vcore_mmc";
384 regulator-min-microvolt = <2850000>;
385 regulator-max-microvolt = <2850000>;
386 regulator-always-on;
387 };
388
389 regulator@10 {
390 reg = <10>;
391 regulator-compatible = "ldo6";
392 regulator-name = "vdd_ldo6,avdd_vdac";
393 regulator-min-microvolt = <1800000>;
394 regulator-max-microvolt = <1800000>;
395 };
396
397 regulator@11 {
398 reg = <11>;
399 regulator-compatible = "ldo7";
400 regulator-name = "vdd_ldo7,avdd_hdmi";
401 regulator-min-microvolt = <3300000>;
402 regulator-max-microvolt = <3300000>;
403 };
404
405 regulator@12 {
406 reg = <12>;
407 regulator-compatible = "ldo8";
408 regulator-name = "vdd_ldo8,avdd_hdmi_pll";
409 regulator-min-microvolt = <1800000>;
410 regulator-max-microvolt = <1800000>;
411 };
412
413 regulator@13 {
414 reg = <13>;
415 regulator-compatible = "ldo9";
416 regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx";
417 regulator-min-microvolt = <2850000>;
418 regulator-max-microvolt = <2850000>;
419 regulator-always-on;
420 };
421
422 regulator@14 {
423 reg = <14>;
424 regulator-compatible = "ldo_rtc";
425 regulator-name = "vdd_rtc_out,vdd_cell";
426 regulator-min-microvolt = <3300000>;
427 regulator-max-microvolt = <3300000>;
428 regulator-always-on;
429 };
430 };
431 };
278 }; 432 };
279 433
280 pmc { 434 pmc {
@@ -310,6 +464,72 @@
310 bus-width = <8>; 464 bus-width = <8>;
311 }; 465 };
312 466
467 regulators {
468 compatible = "simple-bus";
469 #address-cells = <1>;
470 #size-cells = <0>;
471
472 vdd_5v0_reg: regulator@0 {
473 compatible = "regulator-fixed";
474 reg = <0>;
475 regulator-name = "vdd_5v0";
476 regulator-min-microvolt = <5000000>;
477 regulator-max-microvolt = <5000000>;
478 regulator-always-on;
479 };
480
481 regulator@1 {
482 compatible = "regulator-fixed";
483 reg = <1>;
484 regulator-name = "vdd_1v5";
485 regulator-min-microvolt = <1500000>;
486 regulator-max-microvolt = <1500000>;
487 gpio = <&pmic 0 0>;
488 };
489
490 regulator@2 {
491 compatible = "regulator-fixed";
492 reg = <2>;
493 regulator-name = "vdd_1v2";
494 regulator-min-microvolt = <1200000>;
495 regulator-max-microvolt = <1200000>;
496 gpio = <&pmic 1 0>;
497 enable-active-high;
498 };
499
500 regulator@3 {
501 compatible = "regulator-fixed";
502 reg = <3>;
503 regulator-name = "vdd_1v05";
504 regulator-min-microvolt = <1050000>;
505 regulator-max-microvolt = <1050000>;
506 gpio = <&pmic 2 0>;
507 enable-active-high;
508 /* Hack until board-harmony-pcie.c is removed */
509 status = "disabled";
510 };
511
512 regulator@4 {
513 compatible = "regulator-fixed";
514 reg = <4>;
515 regulator-name = "vdd_pnl";
516 regulator-min-microvolt = <2800000>;
517 regulator-max-microvolt = <2800000>;
518 gpio = <&gpio 22 0>; /* gpio PC6 */
519 enable-active-high;
520 };
521
522 regulator@5 {
523 compatible = "regulator-fixed";
524 reg = <5>;
525 regulator-name = "vdd_bl";
526 regulator-min-microvolt = <2800000>;
527 regulator-max-microvolt = <2800000>;
528 gpio = <&gpio 176 0>; /* gpio PW0 */
529 enable-active-high;
530 };
531 };
532
313 sound { 533 sound {
314 compatible = "nvidia,tegra-audio-wm8903-harmony", 534 compatible = "nvidia,tegra-audio-wm8903-harmony",
315 "nvidia,tegra-audio-wm8903"; 535 "nvidia,tegra-audio-wm8903";
diff --git a/arch/arm/boot/dts/tegra20-medcom-wide.dts b/arch/arm/boot/dts/tegra20-medcom-wide.dts
new file mode 100644
index 00000000000..a2d6d6541f8
--- /dev/null
+++ b/arch/arm/boot/dts/tegra20-medcom-wide.dts
@@ -0,0 +1,58 @@
1/dts-v1/;
2
3/include/ "tegra20-tamonten.dtsi"
4
5/ {
6 model = "Avionic Design Medcom-Wide board";
7 compatible = "ad,medcom-wide", "ad,tamonten", "nvidia,tegra20";
8
9 i2c@7000c000 {
10 wm8903: wm8903@1a {
11 compatible = "wlf,wm8903";
12 reg = <0x1a>;
13 interrupt-parent = <&gpio>;
14 interrupts = <187 0x04>;
15
16 gpio-controller;
17 #gpio-cells = <2>;
18
19 micdet-cfg = <0>;
20 micdet-delay = <100>;
21 gpio-cfg = <0xffffffff
22 0xffffffff
23 0
24 0xffffffff
25 0xffffffff>;
26 };
27 };
28
29 backlight {
30 compatible = "pwm-backlight";
31 pwms = <&pwm 0 5000000>;
32
33 brightness-levels = <0 4 8 16 32 64 128 255>;
34 default-brightness-level = <6>;
35 };
36
37 sound {
38 compatible = "ad,tegra-audio-wm8903-medcom-wide",
39 "nvidia,tegra-audio-wm8903";
40 nvidia,model = "Avionic Design Medcom-Wide";
41
42 nvidia,audio-routing =
43 "Headphone Jack", "HPOUTR",
44 "Headphone Jack", "HPOUTL",
45 "Int Spk", "ROP",
46 "Int Spk", "RON",
47 "Int Spk", "LOP",
48 "Int Spk", "LON",
49 "Mic Jack", "MICBIAS",
50 "IN1L", "Mic Jack";
51
52 nvidia,i2s-controller = <&tegra_i2s1>;
53 nvidia,audio-codec = <&wm8903>;
54
55 nvidia,spkr-en-gpios = <&wm8903 2 0>;
56 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
57 };
58};
diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts
index 684a9e1ff7e..ddf287f52d4 100644
--- a/arch/arm/boot/dts/tegra20-paz00.dts
+++ b/arch/arm/boot/dts/tegra20-paz00.dts
@@ -272,12 +272,170 @@
272 status = "okay"; 272 status = "okay";
273 clock-frequency = <400000>; 273 clock-frequency = <400000>;
274 274
275 pmic: tps6586x@34 {
276 compatible = "ti,tps6586x";
277 reg = <0x34>;
278 interrupts = <0 86 0x4>;
279
280 #gpio-cells = <2>;
281 gpio-controller;
282
283 sys-supply = <&p5valw_reg>;
284 vin-sm0-supply = <&sys_reg>;
285 vin-sm1-supply = <&sys_reg>;
286 vin-sm2-supply = <&sys_reg>;
287 vinldo01-supply = <&sm2_reg>;
288 vinldo23-supply = <&sm2_reg>;
289 vinldo4-supply = <&sm2_reg>;
290 vinldo678-supply = <&sm2_reg>;
291 vinldo9-supply = <&sm2_reg>;
292
293 regulators {
294 #address-cells = <1>;
295 #size-cells = <0>;
296
297 sys_reg: regulator@0 {
298 reg = <0>;
299 regulator-compatible = "sys";
300 regulator-name = "vdd_sys";
301 regulator-always-on;
302 };
303
304 regulator@1 {
305 reg = <1>;
306 regulator-compatible = "sm0";
307 regulator-name = "+1.2vs_sm0,vdd_core";
308 regulator-min-microvolt = <1200000>;
309 regulator-max-microvolt = <1200000>;
310 regulator-always-on;
311 };
312
313 regulator@2 {
314 reg = <2>;
315 regulator-compatible = "sm1";
316 regulator-name = "+1.0vs_sm1,vdd_cpu";
317 regulator-min-microvolt = <1000000>;
318 regulator-max-microvolt = <1000000>;
319 regulator-always-on;
320 };
321
322 sm2_reg: regulator@3 {
323 reg = <3>;
324 regulator-compatible = "sm2";
325 regulator-name = "+3.7vs_sm2,vin_ldo*";
326 regulator-min-microvolt = <3700000>;
327 regulator-max-microvolt = <3700000>;
328 regulator-always-on;
329 };
330
331 /* LDO0 is not connected to anything */
332
333 regulator@5 {
334 reg = <5>;
335 regulator-compatible = "ldo1";
336 regulator-name = "+1.1vs_ldo1,avdd_pll*";
337 regulator-min-microvolt = <1100000>;
338 regulator-max-microvolt = <1100000>;
339 regulator-always-on;
340 };
341
342 regulator@6 {
343 reg = <6>;
344 regulator-compatible = "ldo2";
345 regulator-name = "+1.2vs_ldo2,vdd_rtc";
346 regulator-min-microvolt = <1200000>;
347 regulator-max-microvolt = <1200000>;
348 };
349
350 regulator@7 {
351 reg = <7>;
352 regulator-compatible = "ldo3";
353 regulator-name = "+3.3vs_ldo3,avdd_usb*";
354 regulator-min-microvolt = <3300000>;
355 regulator-max-microvolt = <3300000>;
356 regulator-always-on;
357 };
358
359 regulator@8 {
360 reg = <8>;
361 regulator-compatible = "ldo4";
362 regulator-name = "+1.8vs_ldo4,avdd_osc,vddio_sys";
363 regulator-min-microvolt = <1800000>;
364 regulator-max-microvolt = <1800000>;
365 regulator-always-on;
366 };
367
368 regulator@9 {
369 reg = <9>;
370 regulator-compatible = "ldo5";
371 regulator-name = "+2.85vs_ldo5,vcore_mmc";
372 regulator-min-microvolt = <2850000>;
373 regulator-max-microvolt = <2850000>;
374 regulator-always-on;
375 };
376
377 regulator@10 {
378 reg = <10>;
379 regulator-compatible = "ldo6";
380 /*
381 * Research indicates this should be
382 * 1.8v; other boards that use this
383 * rail for the same purpose need it
384 * set to 1.8v. The schematic signal
385 * name is incorrect; perhaps copied
386 * from an incorrect NVIDIA reference.
387 */
388 regulator-name = "+2.85vs_ldo6,avdd_vdac";
389 regulator-min-microvolt = <1800000>;
390 regulator-max-microvolt = <1800000>;
391 };
392
393 regulator@11 {
394 reg = <11>;
395 regulator-compatible = "ldo7";
396 regulator-name = "+3.3vs_ldo7,avdd_hdmi";
397 regulator-min-microvolt = <3300000>;
398 regulator-max-microvolt = <3300000>;
399 };
400
401 regulator@12 {
402 reg = <12>;
403 regulator-compatible = "ldo8";
404 regulator-name = "+1.8vs_ldo8,avdd_hdmi_pll";
405 regulator-min-microvolt = <1800000>;
406 regulator-max-microvolt = <1800000>;
407 };
408
409 regulator@13 {
410 reg = <13>;
411 regulator-compatible = "ldo9";
412 regulator-name = "+2.85vs_ldo9,vdd_ddr_rx";
413 regulator-min-microvolt = <2850000>;
414 regulator-max-microvolt = <2850000>;
415 regulator-always-on;
416 };
417
418 regulator@14 {
419 reg = <14>;
420 regulator-compatible = "ldo_rtc";
421 regulator-name = "+3.3vs_rtc";
422 regulator-min-microvolt = <3300000>;
423 regulator-max-microvolt = <3300000>;
424 regulator-always-on;
425 };
426 };
427 };
428
275 adt7461@4c { 429 adt7461@4c {
276 compatible = "adi,adt7461"; 430 compatible = "adi,adt7461";
277 reg = <0x4c>; 431 reg = <0x4c>;
278 }; 432 };
279 }; 433 };
280 434
435 pmc {
436 nvidia,invert-interrupt;
437 };
438
281 usb@c5000000 { 439 usb@c5000000 {
282 status = "okay"; 440 status = "okay";
283 }; 441 };
@@ -325,6 +483,21 @@
325 }; 483 };
326 }; 484 };
327 485
486 regulators {
487 compatible = "simple-bus";
488 #address-cells = <1>;
489 #size-cells = <0>;
490
491 p5valw_reg: regulator@0 {
492 compatible = "regulator-fixed";
493 reg = <0>;
494 regulator-name = "+5valw";
495 regulator-min-microvolt = <5000000>;
496 regulator-max-microvolt = <5000000>;
497 regulator-always-on;
498 };
499 };
500
328 sound { 501 sound {
329 compatible = "nvidia,tegra-audio-alc5632-paz00", 502 compatible = "nvidia,tegra-audio-alc5632-paz00",
330 "nvidia,tegra-audio-alc5632"; 503 "nvidia,tegra-audio-alc5632";
diff --git a/arch/arm/boot/dts/tegra20-plutux.dts b/arch/arm/boot/dts/tegra20-plutux.dts
new file mode 100644
index 00000000000..331a3ef24d5
--- /dev/null
+++ b/arch/arm/boot/dts/tegra20-plutux.dts
@@ -0,0 +1,50 @@
1/dts-v1/;
2
3/include/ "tegra20-tamonten.dtsi"
4
5/ {
6 model = "Avionic Design Plutux board";
7 compatible = "ad,plutux", "ad,tamonten", "nvidia,tegra20";
8
9 i2c@7000c000 {
10 wm8903: wm8903@1a {
11 compatible = "wlf,wm8903";
12 reg = <0x1a>;
13 interrupt-parent = <&gpio>;
14 interrupts = <187 0x04>;
15
16 gpio-controller;
17 #gpio-cells = <2>;
18
19 micdet-cfg = <0>;
20 micdet-delay = <100>;
21 gpio-cfg = <0xffffffff
22 0xffffffff
23 0
24 0xffffffff
25 0xffffffff>;
26 };
27 };
28
29 sound {
30 compatible = "ad,tegra-audio-plutux",
31 "nvidia,tegra-audio-wm8903";
32 nvidia,model = "Avionic Design Plutux";
33
34 nvidia,audio-routing =
35 "Headphone Jack", "HPOUTR",
36 "Headphone Jack", "HPOUTL",
37 "Int Spk", "ROP",
38 "Int Spk", "RON",
39 "Int Spk", "LOP",
40 "Int Spk", "LON",
41 "Mic Jack", "MICBIAS",
42 "IN1L", "Mic Jack";
43
44 nvidia,i2s-controller = <&tegra_i2s1>;
45 nvidia,audio-codec = <&wm8903>;
46
47 nvidia,spkr-en-gpios = <&wm8903 2 0>;
48 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
49 };
50};
diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts b/arch/arm/boot/dts/tegra20-seaboard.dts
index 85e621ab296..f0ba901676a 100644
--- a/arch/arm/boot/dts/tegra20-seaboard.dts
+++ b/arch/arm/boot/dts/tegra20-seaboard.dts
@@ -374,6 +374,154 @@
374 status = "okay"; 374 status = "okay";
375 clock-frequency = <400000>; 375 clock-frequency = <400000>;
376 376
377 pmic: tps6586x@34 {
378 compatible = "ti,tps6586x";
379 reg = <0x34>;
380 interrupts = <0 86 0x4>;
381
382 ti,system-power-controller;
383
384 #gpio-cells = <2>;
385 gpio-controller;
386
387 sys-supply = <&vdd_5v0_reg>;
388 vin-sm0-supply = <&sys_reg>;
389 vin-sm1-supply = <&sys_reg>;
390 vin-sm2-supply = <&sys_reg>;
391 vinldo01-supply = <&sm2_reg>;
392 vinldo23-supply = <&sm2_reg>;
393 vinldo4-supply = <&sm2_reg>;
394 vinldo678-supply = <&sm2_reg>;
395 vinldo9-supply = <&sm2_reg>;
396
397 regulators {
398 #address-cells = <1>;
399 #size-cells = <0>;
400
401 sys_reg: regulator@0 {
402 reg = <0>;
403 regulator-compatible = "sys";
404 regulator-name = "vdd_sys";
405 regulator-always-on;
406 };
407
408 regulator@1 {
409 reg = <1>;
410 regulator-compatible = "sm0";
411 regulator-name = "vdd_sm0,vdd_core";
412 regulator-min-microvolt = <1300000>;
413 regulator-max-microvolt = <1300000>;
414 regulator-always-on;
415 };
416
417 regulator@2 {
418 reg = <2>;
419 regulator-compatible = "sm1";
420 regulator-name = "vdd_sm1,vdd_cpu";
421 regulator-min-microvolt = <1125000>;
422 regulator-max-microvolt = <1125000>;
423 regulator-always-on;
424 };
425
426 sm2_reg: regulator@3 {
427 reg = <3>;
428 regulator-compatible = "sm2";
429 regulator-name = "vdd_sm2,vin_ldo*";
430 regulator-min-microvolt = <3700000>;
431 regulator-max-microvolt = <3700000>;
432 regulator-always-on;
433 };
434
435 /* LDO0 is not connected to anything */
436
437 regulator@5 {
438 reg = <5>;
439 regulator-compatible = "ldo1";
440 regulator-name = "vdd_ldo1,avdd_pll*";
441 regulator-min-microvolt = <1100000>;
442 regulator-max-microvolt = <1100000>;
443 regulator-always-on;
444 };
445
446 regulator@6 {
447 reg = <6>;
448 regulator-compatible = "ldo2";
449 regulator-name = "vdd_ldo2,vdd_rtc";
450 regulator-min-microvolt = <1200000>;
451 regulator-max-microvolt = <1200000>;
452 };
453
454 regulator@7 {
455 reg = <7>;
456 regulator-compatible = "ldo3";
457 regulator-name = "vdd_ldo3,avdd_usb*";
458 regulator-min-microvolt = <3300000>;
459 regulator-max-microvolt = <3300000>;
460 regulator-always-on;
461 };
462
463 regulator@8 {
464 reg = <8>;
465 regulator-compatible = "ldo4";
466 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys";
467 regulator-min-microvolt = <1800000>;
468 regulator-max-microvolt = <1800000>;
469 regulator-always-on;
470 };
471
472 regulator@9 {
473 reg = <9>;
474 regulator-compatible = "ldo5";
475 regulator-name = "vdd_ldo5,vcore_mmc";
476 regulator-min-microvolt = <2850000>;
477 regulator-max-microvolt = <2850000>;
478 regulator-always-on;
479 };
480
481 regulator@10 {
482 reg = <10>;
483 regulator-compatible = "ldo6";
484 regulator-name = "vdd_ldo6,avdd_vdac,vddio_vi,vddio_cam";
485 regulator-min-microvolt = <1800000>;
486 regulator-max-microvolt = <1800000>;
487 };
488
489 regulator@11 {
490 reg = <11>;
491 regulator-compatible = "ldo7";
492 regulator-name = "vdd_ldo7,avdd_hdmi,vdd_fuse";
493 regulator-min-microvolt = <3300000>;
494 regulator-max-microvolt = <3300000>;
495 };
496
497 regulator@12 {
498 reg = <12>;
499 regulator-compatible = "ldo8";
500 regulator-name = "vdd_ldo8,avdd_hdmi_pll";
501 regulator-min-microvolt = <1800000>;
502 regulator-max-microvolt = <1800000>;
503 };
504
505 regulator@13 {
506 reg = <13>;
507 regulator-compatible = "ldo9";
508 regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx";
509 regulator-min-microvolt = <2850000>;
510 regulator-max-microvolt = <2850000>;
511 regulator-always-on;
512 };
513
514 regulator@14 {
515 reg = <14>;
516 regulator-compatible = "ldo_rtc";
517 regulator-name = "vdd_rtc_out,vdd_cell";
518 regulator-min-microvolt = <3300000>;
519 regulator-max-microvolt = <3300000>;
520 regulator-always-on;
521 };
522 };
523 };
524
377 temperature-sensor@4c { 525 temperature-sensor@4c {
378 compatible = "nct1008"; 526 compatible = "nct1008";
379 reg = <0x4c>; 527 reg = <0x4c>;
@@ -387,7 +535,11 @@
387 }; 535 };
388 }; 536 };
389 537
390 memory-controller@0x7000f400 { 538 pmc {
539 nvidia,invert-interrupt;
540 };
541
542 memory-controller@7000f400 {
391 emc-table@190000 { 543 emc-table@190000 {
392 reg = <190000>; 544 reg = <190000>;
393 compatible = "nvidia,tegra20-emc-table"; 545 compatible = "nvidia,tegra20-emc-table";
@@ -473,6 +625,40 @@
473 }; 625 };
474 }; 626 };
475 627
628 regulators {
629 compatible = "simple-bus";
630 #address-cells = <1>;
631 #size-cells = <0>;
632
633 vdd_5v0_reg: regulator@0 {
634 compatible = "regulator-fixed";
635 reg = <0>;
636 regulator-name = "vdd_5v0";
637 regulator-min-microvolt = <5000000>;
638 regulator-max-microvolt = <5000000>;
639 regulator-always-on;
640 };
641
642 regulator@1 {
643 compatible = "regulator-fixed";
644 reg = <1>;
645 regulator-name = "vdd_1v5";
646 regulator-min-microvolt = <1500000>;
647 regulator-max-microvolt = <1500000>;
648 gpio = <&pmic 0 0>;
649 };
650
651 regulator@2 {
652 compatible = "regulator-fixed";
653 reg = <2>;
654 regulator-name = "vdd_1v2";
655 regulator-min-microvolt = <1200000>;
656 regulator-max-microvolt = <1200000>;
657 gpio = <&pmic 1 0>;
658 enable-active-high;
659 };
660 };
661
476 sound { 662 sound {
477 compatible = "nvidia,tegra-audio-wm8903-seaboard", 663 compatible = "nvidia,tegra-audio-wm8903-seaboard",
478 "nvidia,tegra-audio-wm8903"; 664 "nvidia,tegra-audio-wm8903";
diff --git a/arch/arm/boot/dts/tegra20-tamonten.dtsi b/arch/arm/boot/dts/tegra20-tamonten.dtsi
new file mode 100644
index 00000000000..f18cec9f6a7
--- /dev/null
+++ b/arch/arm/boot/dts/tegra20-tamonten.dtsi
@@ -0,0 +1,449 @@
1/include/ "tegra20.dtsi"
2
3/ {
4 model = "Avionic Design Tamonten SOM";
5 compatible = "ad,tamonten", "nvidia,tegra20";
6
7 memory {
8 reg = <0x00000000 0x20000000>;
9 };
10
11 pinmux {
12 pinctrl-names = "default";
13 pinctrl-0 = <&state_default>;
14
15 state_default: pinmux {
16 ata {
17 nvidia,pins = "ata";
18 nvidia,function = "ide";
19 };
20 atb {
21 nvidia,pins = "atb", "gma", "gme";
22 nvidia,function = "sdio4";
23 };
24 atc {
25 nvidia,pins = "atc";
26 nvidia,function = "nand";
27 };
28 atd {
29 nvidia,pins = "atd", "ate", "gmb", "gmd", "gpu",
30 "spia", "spib", "spic";
31 nvidia,function = "gmi";
32 };
33 cdev1 {
34 nvidia,pins = "cdev1";
35 nvidia,function = "plla_out";
36 };
37 cdev2 {
38 nvidia,pins = "cdev2";
39 nvidia,function = "pllp_out4";
40 };
41 crtp {
42 nvidia,pins = "crtp";
43 nvidia,function = "crt";
44 };
45 csus {
46 nvidia,pins = "csus";
47 nvidia,function = "vi_sensor_clk";
48 };
49 dap1 {
50 nvidia,pins = "dap1";
51 nvidia,function = "dap1";
52 };
53 dap2 {
54 nvidia,pins = "dap2";
55 nvidia,function = "dap2";
56 };
57 dap3 {
58 nvidia,pins = "dap3";
59 nvidia,function = "dap3";
60 };
61 dap4 {
62 nvidia,pins = "dap4";
63 nvidia,function = "dap4";
64 };
65 ddc {
66 nvidia,pins = "ddc";
67 nvidia,function = "i2c2";
68 };
69 dta {
70 nvidia,pins = "dta", "dtd";
71 nvidia,function = "sdio2";
72 };
73 dtb {
74 nvidia,pins = "dtb", "dtc", "dte";
75 nvidia,function = "rsvd1";
76 };
77 dtf {
78 nvidia,pins = "dtf";
79 nvidia,function = "i2c3";
80 };
81 gmc {
82 nvidia,pins = "gmc";
83 nvidia,function = "uartd";
84 };
85 gpu7 {
86 nvidia,pins = "gpu7";
87 nvidia,function = "rtck";
88 };
89 gpv {
90 nvidia,pins = "gpv", "slxa", "slxk";
91 nvidia,function = "pcie";
92 };
93 hdint {
94 nvidia,pins = "hdint", "pta";
95 nvidia,function = "hdmi";
96 };
97 i2cp {
98 nvidia,pins = "i2cp";
99 nvidia,function = "i2cp";
100 };
101 irrx {
102 nvidia,pins = "irrx", "irtx";
103 nvidia,function = "uarta";
104 };
105 kbca {
106 nvidia,pins = "kbca", "kbcb", "kbcc", "kbcd",
107 "kbce", "kbcf";
108 nvidia,function = "kbc";
109 };
110 lcsn {
111 nvidia,pins = "lcsn", "ld0", "ld1", "ld2",
112 "ld3", "ld4", "ld5", "ld6", "ld7",
113 "ld8", "ld9", "ld10", "ld11", "ld12",
114 "ld13", "ld14", "ld15", "ld16", "ld17",
115 "ldc", "ldi", "lhp0", "lhp1", "lhp2",
116 "lhs", "lm0", "lm1", "lpp", "lpw0",
117 "lpw1", "lpw2", "lsc0", "lsc1", "lsck",
118 "lsda", "lsdi", "lspi", "lvp0", "lvp1",
119 "lvs";
120 nvidia,function = "displaya";
121 };
122 owc {
123 nvidia,pins = "owc", "spdi", "spdo", "uac";
124 nvidia,function = "rsvd2";
125 };
126 pmc {
127 nvidia,pins = "pmc";
128 nvidia,function = "pwr_on";
129 };
130 rm {
131 nvidia,pins = "rm";
132 nvidia,function = "i2c1";
133 };
134 sdb {
135 nvidia,pins = "sdb", "sdc", "sdd";
136 nvidia,function = "pwm";
137 };
138 sdio1 {
139 nvidia,pins = "sdio1";
140 nvidia,function = "sdio1";
141 };
142 slxc {
143 nvidia,pins = "slxc", "slxd";
144 nvidia,function = "spdif";
145 };
146 spid {
147 nvidia,pins = "spid", "spie", "spif";
148 nvidia,function = "spi1";
149 };
150 spig {
151 nvidia,pins = "spig", "spih";
152 nvidia,function = "spi2_alt";
153 };
154 uaa {
155 nvidia,pins = "uaa", "uab", "uda";
156 nvidia,function = "ulpi";
157 };
158 uad {
159 nvidia,pins = "uad";
160 nvidia,function = "irda";
161 };
162 uca {
163 nvidia,pins = "uca", "ucb";
164 nvidia,function = "uartc";
165 };
166 conf_ata {
167 nvidia,pins = "ata", "atb", "atc", "atd", "ate",
168 "cdev1", "cdev2", "dap1", "dtb", "gma",
169 "gmb", "gmc", "gmd", "gme", "gpu7",
170 "gpv", "i2cp", "pta", "rm", "slxa",
171 "slxk", "spia", "spib", "uac";
172 nvidia,pull = <0>;
173 nvidia,tristate = <0>;
174 };
175 conf_ck32 {
176 nvidia,pins = "ck32", "ddrc", "pmca", "pmcb",
177 "pmcc", "pmcd", "pmce", "xm2c", "xm2d";
178 nvidia,pull = <0>;
179 };
180 conf_csus {
181 nvidia,pins = "csus", "spid", "spif";
182 nvidia,pull = <1>;
183 nvidia,tristate = <1>;
184 };
185 conf_crtp {
186 nvidia,pins = "crtp", "dap2", "dap3", "dap4",
187 "dtc", "dte", "dtf", "gpu", "sdio1",
188 "slxc", "slxd", "spdi", "spdo", "spig",
189 "uda";
190 nvidia,pull = <0>;
191 nvidia,tristate = <1>;
192 };
193 conf_ddc {
194 nvidia,pins = "ddc", "dta", "dtd", "kbca",
195 "kbcb", "kbcc", "kbcd", "kbce", "kbcf",
196 "sdc";
197 nvidia,pull = <2>;
198 nvidia,tristate = <0>;
199 };
200 conf_hdint {
201 nvidia,pins = "hdint", "lcsn", "ldc", "lm1",
202 "lpw1", "lsc1", "lsck", "lsda", "lsdi",
203 "lvp0", "owc", "sdb";
204 nvidia,tristate = <1>;
205 };
206 conf_irrx {
207 nvidia,pins = "irrx", "irtx", "sdd", "spic",
208 "spie", "spih", "uaa", "uab", "uad",
209 "uca", "ucb";
210 nvidia,pull = <2>;
211 nvidia,tristate = <1>;
212 };
213 conf_lc {
214 nvidia,pins = "lc", "ls";
215 nvidia,pull = <2>;
216 };
217 conf_ld0 {
218 nvidia,pins = "ld0", "ld1", "ld2", "ld3", "ld4",
219 "ld5", "ld6", "ld7", "ld8", "ld9",
220 "ld10", "ld11", "ld12", "ld13", "ld14",
221 "ld15", "ld16", "ld17", "ldi", "lhp0",
222 "lhp1", "lhp2", "lhs", "lm0", "lpp",
223 "lpw0", "lpw2", "lsc0", "lspi", "lvp1",
224 "lvs", "pmc";
225 nvidia,tristate = <0>;
226 };
227 conf_ld17_0 {
228 nvidia,pins = "ld17_0", "ld19_18", "ld21_20",
229 "ld23_22";
230 nvidia,pull = <1>;
231 };
232 };
233 };
234
235 i2s@70002800 {
236 status = "okay";
237 };
238
239 serial@70006300 {
240 clock-frequency = <216000000>;
241 status = "okay";
242 };
243
244 i2c@7000c000 {
245 clock-frequency = <400000>;
246 status = "okay";
247 };
248
249 i2c@7000d000 {
250 clock-frequency = <400000>;
251 status = "okay";
252
253 pmic: tps6586x@34 {
254 compatible = "ti,tps6586x";
255 reg = <0x34>;
256 interrupts = <0 86 0x4>;
257
258 ti,system-power-controller;
259
260 #gpio-cells = <2>;
261 gpio-controller;
262
263 sys-supply = <&vdd_5v0_reg>;
264 vin-sm0-supply = <&sys_reg>;
265 vin-sm1-supply = <&sys_reg>;
266 vin-sm2-supply = <&sys_reg>;
267 vinldo01-supply = <&sm2_reg>;
268 vinldo23-supply = <&sm2_reg>;
269 vinldo4-supply = <&sm2_reg>;
270 vinldo678-supply = <&sm2_reg>;
271 vinldo9-supply = <&sm2_reg>;
272
273 regulators {
274 #address-cells = <1>;
275 #size-cells = <0>;
276
277 sys_reg: regulator@0 {
278 reg = <0>;
279 regulator-compatible = "sys";
280 regulator-name = "vdd_sys";
281 regulator-always-on;
282 };
283
284 regulator@1 {
285 reg = <1>;
286 regulator-compatible = "sm0";
287 regulator-name = "vdd_sys_sm0,vdd_core";
288 regulator-min-microvolt = <1200000>;
289 regulator-max-microvolt = <1200000>;
290 regulator-always-on;
291 };
292
293 regulator@2 {
294 reg = <2>;
295 regulator-compatible = "sm1";
296 regulator-name = "vdd_sys_sm1,vdd_cpu";
297 regulator-min-microvolt = <1000000>;
298 regulator-max-microvolt = <1000000>;
299 regulator-always-on;
300 };
301
302 sm2_reg: regulator@3 {
303 reg = <3>;
304 regulator-compatible = "sm2";
305 regulator-name = "vdd_sys_sm2,vin_ldo*";
306 regulator-min-microvolt = <3700000>;
307 regulator-max-microvolt = <3700000>;
308 regulator-always-on;
309 };
310
311 regulator@4 {
312 reg = <4>;
313 regulator-compatible = "ldo0";
314 regulator-name = "vdd_ldo0,vddio_pex_clk";
315 regulator-min-microvolt = <3300000>;
316 regulator-max-microvolt = <3300000>;
317 };
318
319 regulator@5 {
320 reg = <5>;
321 regulator-compatible = "ldo1";
322 regulator-name = "vdd_ldo1,avdd_pll*";
323 regulator-min-microvolt = <1100000>;
324 regulator-max-microvolt = <1100000>;
325 regulator-always-on;
326 };
327
328 regulator@6 {
329 reg = <6>;
330 regulator-compatible = "ldo2";
331 regulator-name = "vdd_ldo2,vdd_rtc";
332 regulator-min-microvolt = <1200000>;
333 regulator-max-microvolt = <1200000>;
334 };
335
336 regulator@7 {
337 reg = <7>;
338 regulator-compatible = "ldo3";
339 regulator-name = "vdd_ldo3,avdd_usb*";
340 regulator-min-microvolt = <3300000>;
341 regulator-max-microvolt = <3300000>;
342 regulator-always-on;
343 };
344
345 regulator@8 {
346 reg = <8>;
347 regulator-compatible = "ldo4";
348 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys";
349 regulator-min-microvolt = <1800000>;
350 regulator-max-microvolt = <1800000>;
351 regulator-always-on;
352 };
353
354 regulator@9 {
355 reg = <9>;
356 regulator-compatible = "ldo5";
357 regulator-name = "vdd_ldo5,vcore_mmc";
358 regulator-min-microvolt = <2850000>;
359 regulator-max-microvolt = <2850000>;
360 };
361
362 regulator@10 {
363 reg = <10>;
364 regulator-compatible = "ldo6";
365 regulator-name = "vdd_ldo6,avdd_vdac";
366 /*
367 * According to the Tegra 2 Automotive
368 * DataSheet, a typical value for this
369 * would be 2.8V, but the PMIC only
370 * supports 2.85V.
371 */
372 regulator-min-microvolt = <2850000>;
373 regulator-max-microvolt = <2850000>;
374 };
375
376 regulator@11 {
377 reg = <11>;
378 regulator-compatible = "ldo7";
379 regulator-name = "vdd_ldo7,avdd_hdmi";
380 regulator-min-microvolt = <3300000>;
381 regulator-max-microvolt = <3300000>;
382 };
383
384 regulator@12 {
385 reg = <12>;
386 regulator-compatible = "ldo8";
387 regulator-name = "vdd_ldo8,avdd_hdmi_pll";
388 regulator-min-microvolt = <1800000>;
389 regulator-max-microvolt = <1800000>;
390 };
391
392 regulator@13 {
393 reg = <13>;
394 regulator-compatible = "ldo9";
395 regulator-name = "vdd_ldo9,vdd_ddr_rx,avdd_cam";
396 /*
397 * According to the Tegra 2 Automotive
398 * DataSheet, a typical value for this
399 * would be 2.8V, but the PMIC only
400 * supports 2.85V.
401 */
402 regulator-min-microvolt = <2850000>;
403 regulator-max-microvolt = <2850000>;
404 regulator-always-on;
405 };
406
407 regulator@14 {
408 reg = <14>;
409 regulator-compatible = "ldo_rtc";
410 regulator-name = "vdd_rtc_out";
411 regulator-min-microvolt = <3300000>;
412 regulator-max-microvolt = <3300000>;
413 regulator-always-on;
414 };
415 };
416 };
417 };
418
419 pmc {
420 nvidia,invert-interrupt;
421 };
422
423 usb@c5008000 {
424 status = "okay";
425 };
426
427 sdhci@c8000600 {
428 cd-gpios = <&gpio 58 0>; /* gpio PH2 */
429 wp-gpios = <&gpio 59 0>; /* gpio PH3 */
430 bus-width = <4>;
431 status = "okay";
432 };
433
434 regulators {
435 compatible = "simple-bus";
436
437 #address-cells = <1>;
438 #size-cells = <0>;
439
440 vdd_5v0_reg: regulator@0 {
441 compatible = "regulator-fixed";
442 reg = <0>;
443 regulator-name = "vdd_5v0";
444 regulator-min-microvolt = <5000000>;
445 regulator-max-microvolt = <5000000>;
446 regulator-always-on;
447 };
448 };
449};
diff --git a/arch/arm/boot/dts/tegra20-tec.dts b/arch/arm/boot/dts/tegra20-tec.dts
new file mode 100644
index 00000000000..9aff31b0fe4
--- /dev/null
+++ b/arch/arm/boot/dts/tegra20-tec.dts
@@ -0,0 +1,53 @@
1/dts-v1/;
2
3/include/ "tegra20-tamonten.dtsi"
4
5/ {
6 model = "Avionic Design Tamonten Evaluation Carrier";
7 compatible = "ad,tec", "ad,tamonten", "nvidia,tegra20";
8
9 i2c@7000c000 {
10 clock-frequency = <400000>;
11 status = "okay";
12
13 wm8903: wm8903@1a {
14 compatible = "wlf,wm8903";
15 reg = <0x1a>;
16 interrupt-parent = <&gpio>;
17 interrupts = <187 0x04>;
18
19 gpio-controller;
20 #gpio-cells = <2>;
21
22 micdet-cfg = <0>;
23 micdet-delay = <100>;
24 gpio-cfg = <0xffffffff
25 0xffffffff
26 0
27 0xffffffff
28 0xffffffff>;
29 };
30 };
31
32 sound {
33 compatible = "ad,tegra-audio-wm8903-tec",
34 "nvidia,tegra-audio-wm8903";
35 nvidia,model = "Avionic Design TEC";
36
37 nvidia,audio-routing =
38 "Headphone Jack", "HPOUTR",
39 "Headphone Jack", "HPOUTL",
40 "Int Spk", "ROP",
41 "Int Spk", "RON",
42 "Int Spk", "LOP",
43 "Int Spk", "LON",
44 "Mic Jack", "MICBIAS",
45 "IN1L", "Mic Jack";
46
47 nvidia,i2s-controller = <&tegra_i2s1>;
48 nvidia,audio-codec = <&wm8903>;
49
50 nvidia,spkr-en-gpios = <&wm8903 2 0>;
51 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
52 };
53};
diff --git a/arch/arm/boot/dts/tegra20-ventana.dts b/arch/arm/boot/dts/tegra20-ventana.dts
index be90544e6b5..3e5952fcfbc 100644
--- a/arch/arm/boot/dts/tegra20-ventana.dts
+++ b/arch/arm/boot/dts/tegra20-ventana.dts
@@ -289,6 +289,158 @@
289 i2c@7000d000 { 289 i2c@7000d000 {
290 status = "okay"; 290 status = "okay";
291 clock-frequency = <400000>; 291 clock-frequency = <400000>;
292
293 pmic: tps6586x@34 {
294 compatible = "ti,tps6586x";
295 reg = <0x34>;
296 interrupts = <0 86 0x4>;
297
298 ti,system-power-controller;
299
300 #gpio-cells = <2>;
301 gpio-controller;
302
303 sys-supply = <&vdd_5v0_reg>;
304 vin-sm0-supply = <&sys_reg>;
305 vin-sm1-supply = <&sys_reg>;
306 vin-sm2-supply = <&sys_reg>;
307 vinldo01-supply = <&sm2_reg>;
308 vinldo23-supply = <&sm2_reg>;
309 vinldo4-supply = <&sm2_reg>;
310 vinldo678-supply = <&sm2_reg>;
311 vinldo9-supply = <&sm2_reg>;
312
313 regulators {
314 #address-cells = <1>;
315 #size-cells = <0>;
316
317 sys_reg: regulator@0 {
318 reg = <0>;
319 regulator-compatible = "sys";
320 regulator-name = "vdd_sys";
321 regulator-always-on;
322 };
323
324 regulator@1 {
325 reg = <1>;
326 regulator-compatible = "sm0";
327 regulator-name = "vdd_sm0,vdd_core";
328 regulator-min-microvolt = <1200000>;
329 regulator-max-microvolt = <1200000>;
330 regulator-always-on;
331 };
332
333 regulator@2 {
334 reg = <2>;
335 regulator-compatible = "sm1";
336 regulator-name = "vdd_sm1,vdd_cpu";
337 regulator-min-microvolt = <1000000>;
338 regulator-max-microvolt = <1000000>;
339 regulator-always-on;
340 };
341
342 sm2_reg: regulator@3 {
343 reg = <3>;
344 regulator-compatible = "sm2";
345 regulator-name = "vdd_sm2,vin_ldo*";
346 regulator-min-microvolt = <3700000>;
347 regulator-max-microvolt = <3700000>;
348 regulator-always-on;
349 };
350
351 /* LDO0 is not connected to anything */
352
353 regulator@5 {
354 reg = <5>;
355 regulator-compatible = "ldo1";
356 regulator-name = "vdd_ldo1,avdd_pll*";
357 regulator-min-microvolt = <1100000>;
358 regulator-max-microvolt = <1100000>;
359 regulator-always-on;
360 };
361
362 regulator@6 {
363 reg = <6>;
364 regulator-compatible = "ldo2";
365 regulator-name = "vdd_ldo2,vdd_rtc";
366 regulator-min-microvolt = <1200000>;
367 regulator-max-microvolt = <1200000>;
368 };
369
370 regulator@7 {
371 reg = <7>;
372 regulator-compatible = "ldo3";
373 regulator-name = "vdd_ldo3,avdd_usb*";
374 regulator-min-microvolt = <3300000>;
375 regulator-max-microvolt = <3300000>;
376 regulator-always-on;
377 };
378
379 regulator@8 {
380 reg = <8>;
381 regulator-compatible = "ldo4";
382 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys";
383 regulator-min-microvolt = <1800000>;
384 regulator-max-microvolt = <1800000>;
385 regulator-always-on;
386 };
387
388 regulator@9 {
389 reg = <9>;
390 regulator-compatible = "ldo5";
391 regulator-name = "vdd_ldo5,vcore_mmc";
392 regulator-min-microvolt = <2850000>;
393 regulator-max-microvolt = <2850000>;
394 regulator-always-on;
395 };
396
397 regulator@10 {
398 reg = <10>;
399 regulator-compatible = "ldo6";
400 regulator-name = "vdd_ldo6,avdd_vdac";
401 regulator-min-microvolt = <1800000>;
402 regulator-max-microvolt = <1800000>;
403 };
404
405 regulator@11 {
406 reg = <11>;
407 regulator-compatible = "ldo7";
408 regulator-name = "vdd_ldo7,avdd_hdmi,vdd_fuse";
409 regulator-min-microvolt = <3300000>;
410 regulator-max-microvolt = <3300000>;
411 };
412
413 regulator@12 {
414 reg = <12>;
415 regulator-compatible = "ldo8";
416 regulator-name = "vdd_ldo8,avdd_hdmi_pll";
417 regulator-min-microvolt = <1800000>;
418 regulator-max-microvolt = <1800000>;
419 };
420
421 regulator@13 {
422 reg = <13>;
423 regulator-compatible = "ldo9";
424 regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx";
425 regulator-min-microvolt = <2850000>;
426 regulator-max-microvolt = <2850000>;
427 regulator-always-on;
428 };
429
430 regulator@14 {
431 reg = <14>;
432 regulator-compatible = "ldo_rtc";
433 regulator-name = "vdd_rtc_out,vdd_cell";
434 regulator-min-microvolt = <3300000>;
435 regulator-max-microvolt = <3300000>;
436 regulator-always-on;
437 };
438 };
439 };
440 };
441
442 pmc {
443 nvidia,invert-interrupt;
292 }; 444 };
293 445
294 usb@c5000000 { 446 usb@c5000000 {
@@ -317,6 +469,60 @@
317 bus-width = <8>; 469 bus-width = <8>;
318 }; 470 };
319 471
472 regulators {
473 compatible = "simple-bus";
474 #address-cells = <1>;
475 #size-cells = <0>;
476
477 vdd_5v0_reg: regulator@0 {
478 compatible = "regulator-fixed";
479 reg = <0>;
480 regulator-name = "vdd_5v0";
481 regulator-min-microvolt = <5000000>;
482 regulator-max-microvolt = <5000000>;
483 regulator-always-on;
484 };
485
486 regulator@1 {
487 compatible = "regulator-fixed";
488 reg = <1>;
489 regulator-name = "vdd_1v5";
490 regulator-min-microvolt = <1500000>;
491 regulator-max-microvolt = <1500000>;
492 gpio = <&pmic 0 0>;
493 };
494
495 regulator@2 {
496 compatible = "regulator-fixed";
497 reg = <2>;
498 regulator-name = "vdd_1v2";
499 regulator-min-microvolt = <1200000>;
500 regulator-max-microvolt = <1200000>;
501 gpio = <&pmic 1 0>;
502 enable-active-high;
503 };
504
505 regulator@3 {
506 compatible = "regulator-fixed";
507 reg = <3>;
508 regulator-name = "vdd_pnl";
509 regulator-min-microvolt = <2800000>;
510 regulator-max-microvolt = <2800000>;
511 gpio = <&gpio 22 0>; /* gpio PC6 */
512 enable-active-high;
513 };
514
515 regulator@4 {
516 compatible = "regulator-fixed";
517 reg = <4>;
518 regulator-name = "vdd_bl";
519 regulator-min-microvolt = <2800000>;
520 regulator-max-microvolt = <2800000>;
521 gpio = <&gpio 176 0>; /* gpio PW0 */
522 enable-active-high;
523 };
524 };
525
320 sound { 526 sound {
321 compatible = "nvidia,tegra-audio-wm8903-ventana", 527 compatible = "nvidia,tegra-audio-wm8903-ventana",
322 "nvidia,tegra-audio-wm8903"; 528 "nvidia,tegra-audio-wm8903";
diff --git a/arch/arm/boot/dts/tegra20-whistler.dts b/arch/arm/boot/dts/tegra20-whistler.dts
index 6916310bf58..c636d002d6d 100644
--- a/arch/arm/boot/dts/tegra20-whistler.dts
+++ b/arch/arm/boot/dts/tegra20-whistler.dts
@@ -261,6 +261,286 @@
261 gpio-controller; 261 gpio-controller;
262 #gpio-cells = <2>; 262 #gpio-cells = <2>;
263 }; 263 };
264
265 max8907@3c {
266 compatible = "maxim,max8907";
267 reg = <0x3c>;
268 interrupts = <0 86 0x4>;
269
270 maxim,system-power-controller;
271
272 mbatt-supply = <&usb0_vbus_reg>;
273 in-v1-supply = <&mbatt_reg>;
274 in-v2-supply = <&mbatt_reg>;
275 in-v3-supply = <&mbatt_reg>;
276 in1-supply = <&mbatt_reg>;
277 in2-supply = <&nvvdd_sv3_reg>;
278 in3-supply = <&mbatt_reg>;
279 in4-supply = <&mbatt_reg>;
280 in5-supply = <&mbatt_reg>;
281 in6-supply = <&mbatt_reg>;
282 in7-supply = <&mbatt_reg>;
283 in8-supply = <&mbatt_reg>;
284 in9-supply = <&mbatt_reg>;
285 in10-supply = <&mbatt_reg>;
286 in11-supply = <&mbatt_reg>;
287 in12-supply = <&mbatt_reg>;
288 in13-supply = <&mbatt_reg>;
289 in14-supply = <&mbatt_reg>;
290 in15-supply = <&mbatt_reg>;
291 in16-supply = <&mbatt_reg>;
292 in17-supply = <&nvvdd_sv3_reg>;
293 in18-supply = <&nvvdd_sv3_reg>;
294 in19-supply = <&mbatt_reg>;
295 in20-supply = <&mbatt_reg>;
296
297 regulators {
298 #address-cells = <1>;
299 #size-cells = <0>;
300
301 mbatt_reg: regulator@0 {
302 reg = <0>;
303 regulator-compatible = "mbatt";
304 regulator-name = "vbat_pmu";
305 regulator-always-on;
306 };
307
308 regulator@1 {
309 reg = <1>;
310 regulator-compatible = "sd1";
311 regulator-name = "nvvdd_sv1,vdd_cpu_pmu";
312 regulator-min-microvolt = <1000000>;
313 regulator-max-microvolt = <1000000>;
314 regulator-always-on;
315 };
316
317 regulator@2 {
318 reg = <2>;
319 regulator-compatible = "sd2";
320 regulator-name = "nvvdd_sv2,vdd_core";
321 regulator-min-microvolt = <1200000>;
322 regulator-max-microvolt = <1200000>;
323 regulator-always-on;
324 };
325
326 nvvdd_sv3_reg: regulator@3 {
327 reg = <3>;
328 regulator-compatible = "sd3";
329 regulator-name = "nvvdd_sv3";
330 regulator-min-microvolt = <1800000>;
331 regulator-max-microvolt = <1800000>;
332 regulator-always-on;
333 };
334
335 regulator@4 {
336 reg = <4>;
337 regulator-compatible = "ldo1";
338 regulator-name = "nvvdd_ldo1,vddio_rx_ddr,vcore_acc";
339 regulator-min-microvolt = <3300000>;
340 regulator-max-microvolt = <3300000>;
341 regulator-always-on;
342 };
343
344 regulator@5 {
345 reg = <5>;
346 regulator-compatible = "ldo2";
347 regulator-name = "nvvdd_ldo2,avdd_pll*";
348 regulator-min-microvolt = <1100000>;
349 regulator-max-microvolt = <1100000>;
350 regulator-always-on;
351 };
352
353 regulator@6 {
354 reg = <6>;
355 regulator-compatible = "ldo3";
356 regulator-name = "nvvdd_ldo3,vcom_1v8b";
357 regulator-min-microvolt = <1800000>;
358 regulator-max-microvolt = <1800000>;
359 regulator-always-on;
360 };
361
362 regulator@7 {
363 reg = <7>;
364 regulator-compatible = "ldo4";
365 regulator-name = "nvvdd_ldo4,avdd_usb*";
366 regulator-min-microvolt = <3300000>;
367 regulator-max-microvolt = <3300000>;
368 regulator-always-on;
369 };
370
371 regulator@8 {
372 reg = <8>;
373 regulator-compatible = "ldo5";
374 regulator-name = "nvvdd_ldo5,vcore_mmc,avdd_lcd1,vddio_1wire";
375 regulator-min-microvolt = <2800000>;
376 regulator-max-microvolt = <2800000>;
377 regulator-always-on;
378 };
379
380 regulator@9 {
381 reg = <9>;
382 regulator-compatible = "ldo6";
383 regulator-name = "nvvdd_ldo6,avdd_hdmi_pll";
384 regulator-min-microvolt = <1800000>;
385 regulator-max-microvolt = <1800000>;
386 };
387
388 regulator@10 {
389 reg = <10>;
390 regulator-compatible = "ldo7";
391 regulator-name = "nvvdd_ldo7,avddio_audio";
392 regulator-min-microvolt = <2800000>;
393 regulator-max-microvolt = <2800000>;
394 regulator-always-on;
395 };
396
397 regulator@11 {
398 reg = <11>;
399 regulator-compatible = "ldo8";
400 regulator-name = "nvvdd_ldo8,vcom_3v0,vcore_cmps";
401 regulator-min-microvolt = <3000000>;
402 regulator-max-microvolt = <3000000>;
403 };
404
405 regulator@12 {
406 reg = <12>;
407 regulator-compatible = "ldo9";
408 regulator-name = "nvvdd_ldo9,avdd_cam*";
409 regulator-min-microvolt = <2800000>;
410 regulator-max-microvolt = <2800000>;
411 };
412
413 regulator@13 {
414 reg = <13>;
415 regulator-compatible = "ldo10";
416 regulator-name = "nvvdd_ldo10,avdd_usb_ic_3v0";
417 regulator-min-microvolt = <3000000>;
418 regulator-max-microvolt = <3000000>;
419 regulator-always-on;
420 };
421
422 regulator@14 {
423 reg = <14>;
424 regulator-compatible = "ldo11";
425 regulator-name = "nvvdd_ldo11,vddio_pex_clk,vcom_33,avdd_hdmi";
426 regulator-min-microvolt = <3300000>;
427 regulator-max-microvolt = <3300000>;
428 };
429
430 regulator@15 {
431 reg = <15>;
432 regulator-compatible = "ldo12";
433 regulator-name = "nvvdd_ldo12,vddio_sdio";
434 regulator-min-microvolt = <2800000>;
435 regulator-max-microvolt = <2800000>;
436 regulator-always-on;
437 };
438
439 regulator@16 {
440 reg = <16>;
441 regulator-compatible = "ldo13";
442 regulator-name = "nvvdd_ldo13,vcore_phtn,vdd_af";
443 regulator-min-microvolt = <2800000>;
444 regulator-max-microvolt = <2800000>;
445 };
446
447 regulator@17 {
448 reg = <17>;
449 regulator-compatible = "ldo14";
450 regulator-name = "nvvdd_ldo14,avdd_vdac";
451 regulator-min-microvolt = <2800000>;
452 regulator-max-microvolt = <2800000>;
453 };
454
455 regulator@18 {
456 reg = <18>;
457 regulator-compatible = "ldo15";
458 regulator-name = "nvvdd_ldo15,vcore_temp,vddio_hdcp";
459 regulator-min-microvolt = <3300000>;
460 regulator-max-microvolt = <3300000>;
461 };
462
463 regulator@19 {
464 reg = <19>;
465 regulator-compatible = "ldo16";
466 regulator-name = "nvvdd_ldo16,vdd_dbrtr";
467 regulator-min-microvolt = <1300000>;
468 regulator-max-microvolt = <1300000>;
469 };
470
471 regulator@20 {
472 reg = <20>;
473 regulator-compatible = "ldo17";
474 regulator-name = "nvvdd_ldo17,vddio_mipi";
475 regulator-min-microvolt = <1200000>;
476 regulator-max-microvolt = <1200000>;
477 };
478
479 regulator@21 {
480 reg = <21>;
481 regulator-compatible = "ldo18";
482 regulator-name = "nvvdd_ldo18,vddio_vi,vcore_cam*";
483 regulator-min-microvolt = <1800000>;
484 regulator-max-microvolt = <1800000>;
485 };
486
487 regulator@22 {
488 reg = <22>;
489 regulator-compatible = "ldo19";
490 regulator-name = "nvvdd_ldo19,avdd_lcd2,vddio_lx";
491 regulator-min-microvolt = <2800000>;
492 regulator-max-microvolt = <2800000>;
493 };
494
495 regulator@23 {
496 reg = <23>;
497 regulator-compatible = "ldo20";
498 regulator-name = "nvvdd_ldo20,vddio_ddr_1v2,vddio_hsic,vcom_1v2";
499 regulator-min-microvolt = <1200000>;
500 regulator-max-microvolt = <1200000>;
501 regulator-always-on;
502 };
503
504 regulator@24 {
505 reg = <24>;
506 regulator-compatible = "out5v";
507 regulator-name = "usb0_vbus_reg";
508 };
509
510 regulator@25 {
511 reg = <25>;
512 regulator-compatible = "out33v";
513 regulator-name = "pmu_out3v3";
514 };
515
516 regulator@26 {
517 reg = <26>;
518 regulator-compatible = "bbat";
519 regulator-name = "pmu_bbat";
520 regulator-min-microvolt = <2400000>;
521 regulator-max-microvolt = <2400000>;
522 regulator-always-on;
523 };
524
525 regulator@27 {
526 reg = <27>;
527 regulator-compatible = "sdby";
528 regulator-name = "vdd_aon";
529 regulator-always-on;
530 };
531
532 regulator@28 {
533 reg = <28>;
534 regulator-compatible = "vrtc";
535 regulator-name = "vrtc,pmu_vccadc";
536 regulator-always-on;
537 };
538 };
539 };
540 };
541
542 pmc {
543 nvidia,invert-interrupt;
264 }; 544 };
265 545
266 usb@c5000000 { 546 usb@c5000000 {
@@ -284,6 +564,21 @@
284 bus-width = <8>; 564 bus-width = <8>;
285 }; 565 };
286 566
567 regulators {
568 compatible = "simple-bus";
569 #address-cells = <1>;
570 #size-cells = <0>;
571
572 usb0_vbus_reg: regulator {
573 compatible = "regulator-fixed";
574 reg = <0>;
575 regulator-name = "usb0_vbus";
576 regulator-min-microvolt = <5000000>;
577 regulator-max-microvolt = <5000000>;
578 regulator-always-on;
579 };
580 };
581
287 sound { 582 sound {
288 compatible = "nvidia,tegra-audio-wm8753-whistler", 583 compatible = "nvidia,tegra-audio-wm8753-whistler",
289 "nvidia,tegra-audio-wm8753"; 584 "nvidia,tegra-audio-wm8753";
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 405d1673904..f3a09d0d45b 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -123,7 +123,7 @@
123 status = "disabled"; 123 status = "disabled";
124 }; 124 };
125 125
126 pwm { 126 pwm: pwm {
127 compatible = "nvidia,tegra20-pwm"; 127 compatible = "nvidia,tegra20-pwm";
128 reg = <0x7000a000 0x100>; 128 reg = <0x7000a000 0x100>;
129 #pwm-cells = <2>; 129 #pwm-cells = <2>;
@@ -170,7 +170,7 @@
170 reg = <0x7000e400 0x400>; 170 reg = <0x7000e400 0x400>;
171 }; 171 };
172 172
173 memory-controller@0x7000f000 { 173 memory-controller@7000f000 {
174 compatible = "nvidia,tegra20-mc"; 174 compatible = "nvidia,tegra20-mc";
175 reg = <0x7000f000 0x024 175 reg = <0x7000f000 0x024
176 0x7000f03c 0x3c4>; 176 0x7000f03c 0x3c4>;
@@ -183,7 +183,7 @@
183 0x58000000 0x02000000>; /* GART aperture */ 183 0x58000000 0x02000000>; /* GART aperture */
184 }; 184 };
185 185
186 memory-controller@0x7000f400 { 186 memory-controller@7000f400 {
187 compatible = "nvidia,tegra20-emc"; 187 compatible = "nvidia,tegra20-emc";
188 reg = <0x7000f400 0x200>; 188 reg = <0x7000f400 0x200>;
189 #address-cells = <1>; 189 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/tegra30-cardhu-a02.dts b/arch/arm/boot/dts/tegra30-cardhu-a02.dts
new file mode 100644
index 00000000000..dd4222f00ec
--- /dev/null
+++ b/arch/arm/boot/dts/tegra30-cardhu-a02.dts
@@ -0,0 +1,87 @@
1/dts-v1/;
2
3/include/ "tegra30-cardhu.dtsi"
4
5/* This dts file support the cardhu A02 version of board */
6
7/ {
8 model = "NVIDIA Tegra30 Cardhu A02 evaluation board";
9 compatible = "nvidia,cardhu-a02", "nvidia,cardhu", "nvidia,tegra30";
10
11 regulators {
12 compatible = "simple-bus";
13 #address-cells = <1>;
14 #size-cells = <0>;
15
16 ddr_reg: regulator@100 {
17 compatible = "regulator-fixed";
18 reg = <100>;
19 regulator-name = "vdd_ddr";
20 regulator-min-microvolt = <1500000>;
21 regulator-max-microvolt = <1500000>;
22 regulator-always-on;
23 regulator-boot-on;
24 enable-active-high;
25 gpio = <&pmic 6 0>;
26 };
27
28 sys_3v3_reg: regulator@101 {
29 compatible = "regulator-fixed";
30 reg = <101>;
31 regulator-name = "sys_3v3";
32 regulator-min-microvolt = <3300000>;
33 regulator-max-microvolt = <3300000>;
34 regulator-always-on;
35 regulator-boot-on;
36 enable-active-high;
37 gpio = <&pmic 7 0>;
38 };
39
40 usb1_vbus_reg: regulator@102 {
41 compatible = "regulator-fixed";
42 reg = <102>;
43 regulator-name = "usb1_vbus";
44 regulator-min-microvolt = <5000000>;
45 regulator-max-microvolt = <5000000>;
46 enable-active-high;
47 gpio = <&gpio 68 0>; /* GPIO PI4 */
48 gpio-open-drain;
49 vin-supply = <&vdd_5v0_reg>;
50 };
51
52 usb3_vbus_reg: regulator@103 {
53 compatible = "regulator-fixed";
54 reg = <103>;
55 regulator-name = "usb3_vbus";
56 regulator-min-microvolt = <5000000>;
57 regulator-max-microvolt = <5000000>;
58 enable-active-high;
59 gpio = <&gpio 63 0>; /* GPIO PH7 */
60 gpio-open-drain;
61 vin-supply = <&vdd_5v0_reg>;
62 };
63
64 vdd_5v0_reg: regulator@104 {
65 compatible = "regulator-fixed";
66 reg = <104>;
67 regulator-name = "5v0";
68 regulator-min-microvolt = <5000000>;
69 regulator-max-microvolt = <5000000>;
70 enable-active-high;
71 gpio = <&pmic 2 0>;
72 };
73
74 vdd_bl_reg: regulator@105 {
75 compatible = "regulator-fixed";
76 reg = <105>;
77 regulator-name = "vdd_bl";
78 regulator-min-microvolt = <5000000>;
79 regulator-max-microvolt = <5000000>;
80 regulator-always-on;
81 regulator-boot-on;
82 enable-active-high;
83 gpio = <&gpio 83 0>; /* GPIO PK3 */
84 };
85 };
86};
87
diff --git a/arch/arm/boot/dts/tegra30-cardhu-a04.dts b/arch/arm/boot/dts/tegra30-cardhu-a04.dts
new file mode 100644
index 00000000000..0828f097ca8
--- /dev/null
+++ b/arch/arm/boot/dts/tegra30-cardhu-a04.dts
@@ -0,0 +1,98 @@
1/dts-v1/;
2
3/include/ "tegra30-cardhu.dtsi"
4
5/* This dts file support the cardhu A04 and later versions of board */
6
7/ {
8 model = "NVIDIA Tegra30 Cardhu A04 (A05, A06, A07) evaluation board";
9 compatible = "nvidia,cardhu-a04", "nvidia,cardhu", "nvidia,tegra30";
10
11 regulators {
12 compatible = "simple-bus";
13 #address-cells = <1>;
14 #size-cells = <0>;
15
16 ddr_reg: regulator@100 {
17 compatible = "regulator-fixed";
18 regulator-name = "ddr";
19 reg = <100>;
20 regulator-min-microvolt = <1500000>;
21 regulator-max-microvolt = <1500000>;
22 regulator-always-on;
23 regulator-boot-on;
24 enable-active-high;
25 gpio = <&pmic 7 0>;
26 };
27
28 sys_3v3_reg: regulator@101 {
29 compatible = "regulator-fixed";
30 reg = <101>;
31 regulator-name = "sys_3v3";
32 regulator-min-microvolt = <3300000>;
33 regulator-max-microvolt = <3300000>;
34 regulator-always-on;
35 regulator-boot-on;
36 enable-active-high;
37 gpio = <&pmic 6 0>;
38 };
39
40 usb1_vbus_reg: regulator@102 {
41 compatible = "regulator-fixed";
42 reg = <102>;
43 regulator-name = "usb1_vbus";
44 regulator-min-microvolt = <5000000>;
45 regulator-max-microvolt = <5000000>;
46 enable-active-high;
47 gpio = <&gpio 238 0>; /* GPIO PDD6 */
48 gpio-open-drain;
49 vin-supply = <&vdd_5v0_reg>;
50 };
51
52 usb3_vbus_reg: regulator@103 {
53 compatible = "regulator-fixed";
54 reg = <103>;
55 regulator-name = "usb3_vbus";
56 regulator-min-microvolt = <5000000>;
57 regulator-max-microvolt = <5000000>;
58 enable-active-high;
59 gpio = <&gpio 236 0>; /* GPIO PDD4 */
60 gpio-open-drain;
61 vin-supply = <&vdd_5v0_reg>;
62 };
63
64 vdd_5v0_reg: regulator@104 {
65 compatible = "regulator-fixed";
66 reg = <104>;
67 regulator-name = "5v0";
68 regulator-min-microvolt = <5000000>;
69 regulator-max-microvolt = <5000000>;
70 enable-active-high;
71 gpio = <&pmic 8 0>;
72 };
73
74 vdd_bl_reg: regulator@105 {
75 compatible = "regulator-fixed";
76 reg = <105>;
77 regulator-name = "vdd_bl";
78 regulator-min-microvolt = <5000000>;
79 regulator-max-microvolt = <5000000>;
80 regulator-always-on;
81 regulator-boot-on;
82 enable-active-high;
83 gpio = <&gpio 234 0>; /* GPIO PDD2 */
84 };
85
86 vdd_bl2_reg: regulator@106 {
87 compatible = "regulator-fixed";
88 reg = <106>;
89 regulator-name = "vdd_bl2";
90 regulator-min-microvolt = <5000000>;
91 regulator-max-microvolt = <5000000>;
92 regulator-always-on;
93 regulator-boot-on;
94 enable-active-high;
95 gpio = <&gpio 232 0>; /* GPIO PDD0 */
96 };
97 };
98};
diff --git a/arch/arm/boot/dts/tegra30-cardhu.dts b/arch/arm/boot/dts/tegra30-cardhu.dts
deleted file mode 100644
index c169bced131..00000000000
--- a/arch/arm/boot/dts/tegra30-cardhu.dts
+++ /dev/null
@@ -1,171 +0,0 @@
1/dts-v1/;
2
3/include/ "tegra30.dtsi"
4
5/ {
6 model = "NVIDIA Tegra30 Cardhu evaluation board";
7 compatible = "nvidia,cardhu", "nvidia,tegra30";
8
9 memory {
10 reg = <0x80000000 0x40000000>;
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 sdmmc4_clk_pcc4 {
35 nvidia,pins = "sdmmc4_clk_pcc4",
36 "sdmmc4_rst_n_pcc3";
37 nvidia,function = "sdmmc4";
38 nvidia,pull = <0>;
39 nvidia,tristate = <0>;
40 };
41 sdmmc4_dat0_paa0 {
42 nvidia,pins = "sdmmc4_dat0_paa0",
43 "sdmmc4_dat1_paa1",
44 "sdmmc4_dat2_paa2",
45 "sdmmc4_dat3_paa3",
46 "sdmmc4_dat4_paa4",
47 "sdmmc4_dat5_paa5",
48 "sdmmc4_dat6_paa6",
49 "sdmmc4_dat7_paa7";
50 nvidia,function = "sdmmc4";
51 nvidia,pull = <2>;
52 nvidia,tristate = <0>;
53 };
54 dap2_fs_pa2 {
55 nvidia,pins = "dap2_fs_pa2",
56 "dap2_sclk_pa3",
57 "dap2_din_pa4",
58 "dap2_dout_pa5";
59 nvidia,function = "i2s1";
60 nvidia,pull = <0>;
61 nvidia,tristate = <0>;
62 };
63 };
64 };
65
66 serial@70006000 {
67 status = "okay";
68 clock-frequency = <408000000>;
69 };
70
71 i2c@7000c000 {
72 status = "okay";
73 clock-frequency = <100000>;
74 };
75
76 i2c@7000c400 {
77 status = "okay";
78 clock-frequency = <100000>;
79 };
80
81 i2c@7000c500 {
82 status = "okay";
83 clock-frequency = <100000>;
84
85 /* ALS and Proximity sensor */
86 isl29028@44 {
87 compatible = "isil,isl29028";
88 reg = <0x44>;
89 interrupt-parent = <&gpio>;
90 interrupts = <88 0x04>; /*gpio PL0 */
91 };
92 };
93
94 i2c@7000c700 {
95 status = "okay";
96 clock-frequency = <100000>;
97 };
98
99 i2c@7000d000 {
100 status = "okay";
101 clock-frequency = <100000>;
102
103 wm8903: wm8903@1a {
104 compatible = "wlf,wm8903";
105 reg = <0x1a>;
106 interrupt-parent = <&gpio>;
107 interrupts = <179 0x04>; /* gpio PW3 */
108
109 gpio-controller;
110 #gpio-cells = <2>;
111
112 micdet-cfg = <0>;
113 micdet-delay = <100>;
114 gpio-cfg = <0xffffffff 0xffffffff 0 0xffffffff 0xffffffff>;
115 };
116
117 tps62361 {
118 compatible = "ti,tps62361";
119 reg = <0x60>;
120
121 regulator-name = "tps62361-vout";
122 regulator-min-microvolt = <500000>;
123 regulator-max-microvolt = <1500000>;
124 regulator-boot-on;
125 regulator-always-on;
126 ti,vsel0-state-high;
127 ti,vsel1-state-high;
128 };
129 };
130
131 ahub {
132 i2s@70080400 {
133 status = "okay";
134 };
135 };
136
137 sdhci@78000000 {
138 status = "okay";
139 cd-gpios = <&gpio 69 0>; /* gpio PI5 */
140 wp-gpios = <&gpio 155 0>; /* gpio PT3 */
141 power-gpios = <&gpio 31 0>; /* gpio PD7 */
142 bus-width = <4>;
143 };
144
145 sdhci@78000600 {
146 status = "okay";
147 bus-width = <8>;
148 };
149
150 sound {
151 compatible = "nvidia,tegra-audio-wm8903-cardhu",
152 "nvidia,tegra-audio-wm8903";
153 nvidia,model = "NVIDIA Tegra Cardhu";
154
155 nvidia,audio-routing =
156 "Headphone Jack", "HPOUTR",
157 "Headphone Jack", "HPOUTL",
158 "Int Spk", "ROP",
159 "Int Spk", "RON",
160 "Int Spk", "LOP",
161 "Int Spk", "LON",
162 "Mic Jack", "MICBIAS",
163 "IN1L", "Mic Jack";
164
165 nvidia,i2s-controller = <&tegra_i2s1>;
166 nvidia,audio-codec = <&wm8903>;
167
168 nvidia,spkr-en-gpios = <&wm8903 2 0>;
169 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
170 };
171};
diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi b/arch/arm/boot/dts/tegra30-cardhu.dtsi
new file mode 100644
index 00000000000..d10c9c5a360
--- /dev/null
+++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi
@@ -0,0 +1,475 @@
1/include/ "tegra30.dtsi"
2
3/**
4 * This file contains common DT entry for all fab version of Cardhu.
5 * There is multiple fab version of Cardhu starting from A01 to A07.
6 * Cardhu fab version A01 and A03 are not supported. Cardhu fab version
7 * A02 will have different sets of GPIOs for fixed regulator compare to
8 * Cardhu fab version A04. The Cardhu fab version A05, A06, A07 are
9 * compatible with fab version A04. Based on Cardhu fab version, the
10 * related dts file need to be chosen like for Cardhu fab version A02,
11 * use tegra30-cardhu-a02.dts, Cardhu fab version A04 and later, use
12 * tegra30-cardhu-a04.dts.
13 * The identification of board is done in two ways, by looking the sticker
14 * on PCB and by reading board id eeprom.
15 * The stciker will have number like 600-81291-1000-002 C.3. In this 4th
16 * number is the fab version like here it is 002 and hence fab version A02.
17 * The (downstream internal) U-Boot of Cardhu display the board-id as
18 * follows:
19 * BoardID: 0C5B, SKU: 0A01, Fab: 02, Rev: 45.00
20 * In this Fab version is 02 i.e. A02.
21 * The BoardID I2C eeprom is interfaced through i2c5 (pwr_i2c address 0x56).
22 * The location 0x8 of this eeprom contains the Fab version. It is 1 byte
23 * wide.
24 */
25
26/ {
27 model = "NVIDIA Tegra30 Cardhu evaluation board";
28 compatible = "nvidia,cardhu", "nvidia,tegra30";
29
30 memory {
31 reg = <0x80000000 0x40000000>;
32 };
33
34 pinmux {
35 pinctrl-names = "default";
36 pinctrl-0 = <&state_default>;
37
38 state_default: pinmux {
39 sdmmc1_clk_pz0 {
40 nvidia,pins = "sdmmc1_clk_pz0";
41 nvidia,function = "sdmmc1";
42 nvidia,pull = <0>;
43 nvidia,tristate = <0>;
44 };
45 sdmmc1_cmd_pz1 {
46 nvidia,pins = "sdmmc1_cmd_pz1",
47 "sdmmc1_dat0_py7",
48 "sdmmc1_dat1_py6",
49 "sdmmc1_dat2_py5",
50 "sdmmc1_dat3_py4";
51 nvidia,function = "sdmmc1";
52 nvidia,pull = <2>;
53 nvidia,tristate = <0>;
54 };
55 sdmmc4_clk_pcc4 {
56 nvidia,pins = "sdmmc4_clk_pcc4",
57 "sdmmc4_rst_n_pcc3";
58 nvidia,function = "sdmmc4";
59 nvidia,pull = <0>;
60 nvidia,tristate = <0>;
61 };
62 sdmmc4_dat0_paa0 {
63 nvidia,pins = "sdmmc4_dat0_paa0",
64 "sdmmc4_dat1_paa1",
65 "sdmmc4_dat2_paa2",
66 "sdmmc4_dat3_paa3",
67 "sdmmc4_dat4_paa4",
68 "sdmmc4_dat5_paa5",
69 "sdmmc4_dat6_paa6",
70 "sdmmc4_dat7_paa7";
71 nvidia,function = "sdmmc4";
72 nvidia,pull = <2>;
73 nvidia,tristate = <0>;
74 };
75 dap2_fs_pa2 {
76 nvidia,pins = "dap2_fs_pa2",
77 "dap2_sclk_pa3",
78 "dap2_din_pa4",
79 "dap2_dout_pa5";
80 nvidia,function = "i2s1";
81 nvidia,pull = <0>;
82 nvidia,tristate = <0>;
83 };
84 };
85 };
86
87 serial@70006000 {
88 status = "okay";
89 clock-frequency = <408000000>;
90 };
91
92 i2c@7000c000 {
93 status = "okay";
94 clock-frequency = <100000>;
95 };
96
97 i2c@7000c400 {
98 status = "okay";
99 clock-frequency = <100000>;
100 };
101
102 i2c@7000c500 {
103 status = "okay";
104 clock-frequency = <100000>;
105
106 /* ALS and Proximity sensor */
107 isl29028@44 {
108 compatible = "isil,isl29028";
109 reg = <0x44>;
110 interrupt-parent = <&gpio>;
111 interrupts = <88 0x04>; /*gpio PL0 */
112 };
113 };
114
115 i2c@7000c700 {
116 status = "okay";
117 clock-frequency = <100000>;
118 };
119
120 i2c@7000d000 {
121 status = "okay";
122 clock-frequency = <100000>;
123
124 wm8903: wm8903@1a {
125 compatible = "wlf,wm8903";
126 reg = <0x1a>;
127 interrupt-parent = <&gpio>;
128 interrupts = <179 0x04>; /* gpio PW3 */
129
130 gpio-controller;
131 #gpio-cells = <2>;
132
133 micdet-cfg = <0>;
134 micdet-delay = <100>;
135 gpio-cfg = <0xffffffff 0xffffffff 0 0xffffffff 0xffffffff>;
136 };
137
138 tps62361 {
139 compatible = "ti,tps62361";
140 reg = <0x60>;
141
142 regulator-name = "tps62361-vout";
143 regulator-min-microvolt = <500000>;
144 regulator-max-microvolt = <1500000>;
145 regulator-boot-on;
146 regulator-always-on;
147 ti,vsel0-state-high;
148 ti,vsel1-state-high;
149 };
150
151 pmic: tps65911@2d {
152 compatible = "ti,tps65911";
153 reg = <0x2d>;
154
155 interrupts = <0 86 0x4>;
156 #interrupt-cells = <2>;
157 interrupt-controller;
158
159 ti,system-power-controller;
160
161 #gpio-cells = <2>;
162 gpio-controller;
163
164 vcc1-supply = <&vdd_ac_bat_reg>;
165 vcc2-supply = <&vdd_ac_bat_reg>;
166 vcc3-supply = <&vio_reg>;
167 vcc4-supply = <&vdd_5v0_reg>;
168 vcc5-supply = <&vdd_ac_bat_reg>;
169 vcc6-supply = <&vdd2_reg>;
170 vcc7-supply = <&vdd_ac_bat_reg>;
171 vccio-supply = <&vdd_ac_bat_reg>;
172
173 regulators {
174 #address-cells = <1>;
175 #size-cells = <0>;
176
177 vdd1_reg: regulator@0 {
178 reg = <0>;
179 regulator-compatible = "vdd1";
180 regulator-name = "vddio_ddr_1v2";
181 regulator-min-microvolt = <1200000>;
182 regulator-max-microvolt = <1200000>;
183 regulator-always-on;
184 };
185
186 vdd2_reg: regulator@1 {
187 reg = <1>;
188 regulator-compatible = "vdd2";
189 regulator-name = "vdd_1v5_gen";
190 regulator-min-microvolt = <1500000>;
191 regulator-max-microvolt = <1500000>;
192 regulator-always-on;
193 };
194
195 vddctrl_reg: regulator@2 {
196 reg = <2>;
197 regulator-compatible = "vddctrl";
198 regulator-name = "vdd_cpu,vdd_sys";
199 regulator-min-microvolt = <1000000>;
200 regulator-max-microvolt = <1000000>;
201 regulator-always-on;
202 };
203
204 vio_reg: regulator@3 {
205 reg = <3>;
206 regulator-compatible = "vio";
207 regulator-name = "vdd_1v8_gen";
208 regulator-min-microvolt = <1800000>;
209 regulator-max-microvolt = <1800000>;
210 regulator-always-on;
211 };
212
213 ldo1_reg: regulator@4 {
214 reg = <4>;
215 regulator-compatible = "ldo1";
216 regulator-name = "vdd_pexa,vdd_pexb";
217 regulator-min-microvolt = <1050000>;
218 regulator-max-microvolt = <1050000>;
219 };
220
221 ldo2_reg: regulator@5 {
222 reg = <5>;
223 regulator-compatible = "ldo2";
224 regulator-name = "vdd_sata,avdd_plle";
225 regulator-min-microvolt = <1050000>;
226 regulator-max-microvolt = <1050000>;
227 };
228
229 /* LDO3 is not connected to anything */
230
231 ldo4_reg: regulator@7 {
232 reg = <7>;
233 regulator-compatible = "ldo4";
234 regulator-name = "vdd_rtc";
235 regulator-min-microvolt = <1200000>;
236 regulator-max-microvolt = <1200000>;
237 regulator-always-on;
238 };
239
240 ldo5_reg: regulator@8 {
241 reg = <8>;
242 regulator-compatible = "ldo5";
243 regulator-name = "vddio_sdmmc,avdd_vdac";
244 regulator-min-microvolt = <3300000>;
245 regulator-max-microvolt = <3300000>;
246 regulator-always-on;
247 };
248
249 ldo6_reg: regulator@9 {
250 reg = <9>;
251 regulator-compatible = "ldo6";
252 regulator-name = "avdd_dsi_csi,pwrdet_mipi";
253 regulator-min-microvolt = <1200000>;
254 regulator-max-microvolt = <1200000>;
255 };
256
257 ldo7_reg: regulator@10 {
258 reg = <10>;
259 regulator-compatible = "ldo7";
260 regulator-name = "vdd_pllm,x,u,a_p_c_s";
261 regulator-min-microvolt = <1200000>;
262 regulator-max-microvolt = <1200000>;
263 regulator-always-on;
264 };
265
266 ldo8_reg: regulator@11 {
267 reg = <11>;
268 regulator-compatible = "ldo8";
269 regulator-name = "vdd_ddr_hs";
270 regulator-min-microvolt = <1000000>;
271 regulator-max-microvolt = <1000000>;
272 regulator-always-on;
273 };
274 };
275 };
276 };
277
278 ahub {
279 i2s@70080400 {
280 status = "okay";
281 };
282 };
283
284 pmc {
285 status = "okay";
286 nvidia,invert-interrupt;
287 };
288
289 sdhci@78000000 {
290 status = "okay";
291 cd-gpios = <&gpio 69 0>; /* gpio PI5 */
292 wp-gpios = <&gpio 155 0>; /* gpio PT3 */
293 power-gpios = <&gpio 31 0>; /* gpio PD7 */
294 bus-width = <4>;
295 };
296
297 sdhci@78000600 {
298 status = "okay";
299 bus-width = <8>;
300 };
301
302 regulators {
303 compatible = "simple-bus";
304 #address-cells = <1>;
305 #size-cells = <0>;
306
307 vdd_ac_bat_reg: regulator@0 {
308 compatible = "regulator-fixed";
309 reg = <0>;
310 regulator-name = "vdd_ac_bat";
311 regulator-min-microvolt = <5000000>;
312 regulator-max-microvolt = <5000000>;
313 regulator-always-on;
314 };
315
316 cam_1v8_reg: regulator@1 {
317 compatible = "regulator-fixed";
318 reg = <1>;
319 regulator-name = "cam_1v8";
320 regulator-min-microvolt = <1800000>;
321 regulator-max-microvolt = <1800000>;
322 enable-active-high;
323 gpio = <&gpio 220 0>; /* gpio PBB4 */
324 vin-supply = <&vio_reg>;
325 };
326
327 cp_5v_reg: regulator@2 {
328 compatible = "regulator-fixed";
329 reg = <2>;
330 regulator-name = "cp_5v";
331 regulator-min-microvolt = <5000000>;
332 regulator-max-microvolt = <5000000>;
333 regulator-boot-on;
334 regulator-always-on;
335 enable-active-high;
336 gpio = <&pmic 0 0>; /* PMIC TPS65911 GPIO0 */
337 };
338
339 emmc_3v3_reg: regulator@3 {
340 compatible = "regulator-fixed";
341 reg = <3>;
342 regulator-name = "emmc_3v3";
343 regulator-min-microvolt = <3300000>;
344 regulator-max-microvolt = <3300000>;
345 regulator-always-on;
346 regulator-boot-on;
347 enable-active-high;
348 gpio = <&gpio 25 0>; /* gpio PD1 */
349 vin-supply = <&sys_3v3_reg>;
350 };
351
352 modem_3v3_reg: regulator@4 {
353 compatible = "regulator-fixed";
354 reg = <4>;
355 regulator-name = "modem_3v3";
356 regulator-min-microvolt = <3300000>;
357 regulator-max-microvolt = <3300000>;
358 enable-active-high;
359 gpio = <&gpio 30 0>; /* gpio PD6 */
360 };
361
362 pex_hvdd_3v3_reg: regulator@5 {
363 compatible = "regulator-fixed";
364 reg = <5>;
365 regulator-name = "pex_hvdd_3v3";
366 regulator-min-microvolt = <3300000>;
367 regulator-max-microvolt = <3300000>;
368 enable-active-high;
369 gpio = <&gpio 95 0>; /* gpio PL7 */
370 vin-supply = <&sys_3v3_reg>;
371 };
372
373 vdd_cam1_ldo_reg: regulator@6 {
374 compatible = "regulator-fixed";
375 reg = <6>;
376 regulator-name = "vdd_cam1_ldo";
377 regulator-min-microvolt = <2800000>;
378 regulator-max-microvolt = <2800000>;
379 enable-active-high;
380 gpio = <&gpio 142 0>; /* gpio PR6 */
381 vin-supply = <&sys_3v3_reg>;
382 };
383
384 vdd_cam2_ldo_reg: regulator@7 {
385 compatible = "regulator-fixed";
386 reg = <7>;
387 regulator-name = "vdd_cam2_ldo";
388 regulator-min-microvolt = <2800000>;
389 regulator-max-microvolt = <2800000>;
390 enable-active-high;
391 gpio = <&gpio 143 0>; /* gpio PR7 */
392 vin-supply = <&sys_3v3_reg>;
393 };
394
395 vdd_cam3_ldo_reg: regulator@8 {
396 compatible = "regulator-fixed";
397 reg = <8>;
398 regulator-name = "vdd_cam3_ldo";
399 regulator-min-microvolt = <3300000>;
400 regulator-max-microvolt = <3300000>;
401 enable-active-high;
402 gpio = <&gpio 144 0>; /* gpio PS0 */
403 vin-supply = <&sys_3v3_reg>;
404 };
405
406 vdd_com_reg: regulator@9 {
407 compatible = "regulator-fixed";
408 reg = <9>;
409 regulator-name = "vdd_com";
410 regulator-min-microvolt = <3300000>;
411 regulator-max-microvolt = <3300000>;
412 enable-active-high;
413 gpio = <&gpio 24 0>; /* gpio PD0 */
414 vin-supply = <&sys_3v3_reg>;
415 };
416
417 vdd_fuse_3v3_reg: regulator@10 {
418 compatible = "regulator-fixed";
419 reg = <10>;
420 regulator-name = "vdd_fuse_3v3";
421 regulator-min-microvolt = <3300000>;
422 regulator-max-microvolt = <3300000>;
423 enable-active-high;
424 gpio = <&gpio 94 0>; /* gpio PL6 */
425 vin-supply = <&sys_3v3_reg>;
426 };
427
428 vdd_pnl1_reg: regulator@11 {
429 compatible = "regulator-fixed";
430 reg = <11>;
431 regulator-name = "vdd_pnl1";
432 regulator-min-microvolt = <3300000>;
433 regulator-max-microvolt = <3300000>;
434 regulator-always-on;
435 regulator-boot-on;
436 enable-active-high;
437 gpio = <&gpio 92 0>; /* gpio PL4 */
438 vin-supply = <&sys_3v3_reg>;
439 };
440
441 vdd_vid_reg: regulator@12 {
442 compatible = "regulator-fixed";
443 reg = <12>;
444 regulator-name = "vddio_vid";
445 regulator-min-microvolt = <5000000>;
446 regulator-max-microvolt = <5000000>;
447 enable-active-high;
448 gpio = <&gpio 152 0>; /* GPIO PT0 */
449 gpio-open-drain;
450 vin-supply = <&vdd_5v0_reg>;
451 };
452 };
453
454 sound {
455 compatible = "nvidia,tegra-audio-wm8903-cardhu",
456 "nvidia,tegra-audio-wm8903";
457 nvidia,model = "NVIDIA Tegra Cardhu";
458
459 nvidia,audio-routing =
460 "Headphone Jack", "HPOUTR",
461 "Headphone Jack", "HPOUTL",
462 "Int Spk", "ROP",
463 "Int Spk", "RON",
464 "Int Spk", "LOP",
465 "Int Spk", "LON",
466 "Mic Jack", "MICBIAS",
467 "IN1L", "Mic Jack";
468
469 nvidia,i2s-controller = <&tegra_i2s1>;
470 nvidia,audio-codec = <&wm8903>;
471
472 nvidia,spkr-en-gpios = <&wm8903 2 0>;
473 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
474 };
475};
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index 3e4334d14ef..b1497c7d7d6 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -117,7 +117,7 @@
117 status = "disabled"; 117 status = "disabled";
118 }; 118 };
119 119
120 pwm { 120 pwm: pwm {
121 compatible = "nvidia,tegra30-pwm", "nvidia,tegra20-pwm"; 121 compatible = "nvidia,tegra30-pwm", "nvidia,tegra20-pwm";
122 reg = <0x7000a000 0x100>; 122 reg = <0x7000a000 0x100>;
123 #pwm-cells = <2>; 123 #pwm-cells = <2>;
diff --git a/arch/arm/boot/dts/tps65217.dtsi b/arch/arm/boot/dts/tps65217.dtsi
new file mode 100644
index 00000000000..a63272422d7
--- /dev/null
+++ b/arch/arm/boot/dts/tps65217.dtsi
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Integrated Power Management Chip
11 * http://www.ti.com/lit/ds/symlink/tps65217.pdf
12 */
13
14&tps {
15 compatible = "ti,tps65217";
16
17 regulators {
18 #address-cells = <1>;
19 #size-cells = <0>;
20
21 dcdc1_reg: regulator@0 {
22 reg = <0>;
23 regulator-compatible = "dcdc1";
24 };
25
26 dcdc2_reg: regulator@1 {
27 reg = <1>;
28 regulator-compatible = "dcdc2";
29 };
30
31 dcdc3_reg: regulator@2 {
32 reg = <2>;
33 regulator-compatible = "dcdc3";
34 };
35
36 ldo1_reg: regulator@3 {
37 reg = <3>;
38 regulator-compatible = "ldo1";
39 };
40
41 ldo2_reg: regulator@4 {
42 reg = <4>;
43 regulator-compatible = "ldo2";
44 };
45
46 ldo3_reg: regulator@5 {
47 reg = <5>;
48 regulator-compatible = "ldo3";
49 };
50
51 ldo4_reg: regulator@6 {
52 reg = <6>;
53 regulator-compatible = "ldo4";
54 };
55 };
56};
diff --git a/arch/arm/boot/dts/tps65910.dtsi b/arch/arm/boot/dts/tps65910.dtsi
new file mode 100644
index 00000000000..92693a89160
--- /dev/null
+++ b/arch/arm/boot/dts/tps65910.dtsi
@@ -0,0 +1,86 @@
1/*
2 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Integrated Power Management Chip
11 * http://www.ti.com/lit/ds/symlink/tps65910.pdf
12 */
13
14&tps {
15 compatible = "ti,tps65910";
16
17 regulators {
18 #address-cells = <1>;
19 #size-cells = <0>;
20
21 vrtc_reg: regulator@0 {
22 reg = <0>;
23 regulator-compatible = "vrtc";
24 };
25
26 vio_reg: regulator@1 {
27 reg = <1>;
28 regulator-compatible = "vio";
29 };
30
31 vdd1_reg: regulator@2 {
32 reg = <2>;
33 regulator-compatible = "vdd1";
34 };
35
36 vdd2_reg: regulator@3 {
37 reg = <3>;
38 regulator-compatible = "vdd2";
39 };
40
41 vdd3_reg: regulator@4 {
42 reg = <4>;
43 regulator-compatible = "vdd3";
44 };
45
46 vdig1_reg: regulator@5 {
47 reg = <5>;
48 regulator-compatible = "vdig1";
49 };
50
51 vdig2_reg: regulator@6 {
52 reg = <6>;
53 regulator-compatible = "vdig2";
54 };
55
56 vpll_reg: regulator@7 {
57 reg = <7>;
58 regulator-compatible = "vpll";
59 };
60
61 vdac_reg: regulator@8 {
62 reg = <8>;
63 regulator-compatible = "vdac";
64 };
65
66 vaux1_reg: regulator@9 {
67 reg = <9>;
68 regulator-compatible = "vaux1";
69 };
70
71 vaux2_reg: regulator@10 {
72 reg = <10>;
73 regulator-compatible = "vaux2";
74 };
75
76 vaux33_reg: regulator@11 {
77 reg = <11>;
78 regulator-compatible = "vaux33";
79 };
80
81 vmmc_reg: regulator@12 {
82 reg = <12>;
83 regulator-compatible = "vmmc";
84 };
85 };
86};
diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
index 22f4d1394ed..ff000172c93 100644
--- a/arch/arm/boot/dts/twl4030.dtsi
+++ b/arch/arm/boot/dts/twl4030.dtsi
@@ -19,19 +19,19 @@
19 interrupts = <11>; 19 interrupts = <11>;
20 }; 20 };
21 21
22 vdac: regulator@0 { 22 vdac: regulator-vdac {
23 compatible = "ti,twl4030-vdac"; 23 compatible = "ti,twl4030-vdac";
24 regulator-min-microvolt = <1800000>; 24 regulator-min-microvolt = <1800000>;
25 regulator-max-microvolt = <1800000>; 25 regulator-max-microvolt = <1800000>;
26 }; 26 };
27 27
28 vpll2: regulator@1 { 28 vpll2: regulator-vpll2 {
29 compatible = "ti,twl4030-vpll2"; 29 compatible = "ti,twl4030-vpll2";
30 regulator-min-microvolt = <1800000>; 30 regulator-min-microvolt = <1800000>;
31 regulator-max-microvolt = <1800000>; 31 regulator-max-microvolt = <1800000>;
32 }; 32 };
33 33
34 vmmc1: regulator@2 { 34 vmmc1: regulator-vmmc1 {
35 compatible = "ti,twl4030-vmmc1"; 35 compatible = "ti,twl4030-vmmc1";
36 regulator-min-microvolt = <1850000>; 36 regulator-min-microvolt = <1850000>;
37 regulator-max-microvolt = <3150000>; 37 regulator-max-microvolt = <3150000>;
diff --git a/arch/arm/boot/dts/twl6030.dtsi b/arch/arm/boot/dts/twl6030.dtsi
index d351b27d721..123e2c40218 100644
--- a/arch/arm/boot/dts/twl6030.dtsi
+++ b/arch/arm/boot/dts/twl6030.dtsi
@@ -20,70 +20,70 @@
20 interrupts = <11>; 20 interrupts = <11>;
21 }; 21 };
22 22
23 vaux1: regulator@0 { 23 vaux1: regulator-vaux1 {
24 compatible = "ti,twl6030-vaux1"; 24 compatible = "ti,twl6030-vaux1";
25 regulator-min-microvolt = <1000000>; 25 regulator-min-microvolt = <1000000>;
26 regulator-max-microvolt = <3000000>; 26 regulator-max-microvolt = <3000000>;
27 }; 27 };
28 28
29 vaux2: regulator@1 { 29 vaux2: regulator-vaux2 {
30 compatible = "ti,twl6030-vaux2"; 30 compatible = "ti,twl6030-vaux2";
31 regulator-min-microvolt = <1200000>; 31 regulator-min-microvolt = <1200000>;
32 regulator-max-microvolt = <2800000>; 32 regulator-max-microvolt = <2800000>;
33 }; 33 };
34 34
35 vaux3: regulator@2 { 35 vaux3: regulator-vaux3 {
36 compatible = "ti,twl6030-vaux3"; 36 compatible = "ti,twl6030-vaux3";
37 regulator-min-microvolt = <1000000>; 37 regulator-min-microvolt = <1000000>;
38 regulator-max-microvolt = <3000000>; 38 regulator-max-microvolt = <3000000>;
39 }; 39 };
40 40
41 vmmc: regulator@3 { 41 vmmc: regulator-vmmc {
42 compatible = "ti,twl6030-vmmc"; 42 compatible = "ti,twl6030-vmmc";
43 regulator-min-microvolt = <1200000>; 43 regulator-min-microvolt = <1200000>;
44 regulator-max-microvolt = <3000000>; 44 regulator-max-microvolt = <3000000>;
45 }; 45 };
46 46
47 vpp: regulator@4 { 47 vpp: regulator-vpp {
48 compatible = "ti,twl6030-vpp"; 48 compatible = "ti,twl6030-vpp";
49 regulator-min-microvolt = <1800000>; 49 regulator-min-microvolt = <1800000>;
50 regulator-max-microvolt = <2500000>; 50 regulator-max-microvolt = <2500000>;
51 }; 51 };
52 52
53 vusim: regulator@5 { 53 vusim: regulator-vusim {
54 compatible = "ti,twl6030-vusim"; 54 compatible = "ti,twl6030-vusim";
55 regulator-min-microvolt = <1200000>; 55 regulator-min-microvolt = <1200000>;
56 regulator-max-microvolt = <2900000>; 56 regulator-max-microvolt = <2900000>;
57 }; 57 };
58 58
59 vdac: regulator@6 { 59 vdac: regulator-vdac {
60 compatible = "ti,twl6030-vdac"; 60 compatible = "ti,twl6030-vdac";
61 }; 61 };
62 62
63 vana: regulator@7 { 63 vana: regulator-vana {
64 compatible = "ti,twl6030-vana"; 64 compatible = "ti,twl6030-vana";
65 }; 65 };
66 66
67 vcxio: regulator@8 { 67 vcxio: regulator-vcxio {
68 compatible = "ti,twl6030-vcxio"; 68 compatible = "ti,twl6030-vcxio";
69 regulator-always-on; 69 regulator-always-on;
70 }; 70 };
71 71
72 vusb: regulator@9 { 72 vusb: regulator-vusb {
73 compatible = "ti,twl6030-vusb"; 73 compatible = "ti,twl6030-vusb";
74 }; 74 };
75 75
76 v1v8: regulator@10 { 76 v1v8: regulator-v1v8 {
77 compatible = "ti,twl6030-v1v8"; 77 compatible = "ti,twl6030-v1v8";
78 regulator-always-on; 78 regulator-always-on;
79 }; 79 };
80 80
81 v2v1: regulator@11 { 81 v2v1: regulator-v2v1 {
82 compatible = "ti,twl6030-v2v1"; 82 compatible = "ti,twl6030-v2v1";
83 regulator-always-on; 83 regulator-always-on;
84 }; 84 };
85 85
86 clk32kg: regulator@12 { 86 clk32kg: regulator-clk32kg {
87 compatible = "ti,twl6030-clk32kg"; 87 compatible = "ti,twl6030-clk32kg";
88 }; 88 };
89}; 89};
diff --git a/arch/arm/boot/dts/vt8500-bv07.dts b/arch/arm/boot/dts/vt8500-bv07.dts
new file mode 100644
index 00000000000..567cf4e8ab8
--- /dev/null
+++ b/arch/arm/boot/dts/vt8500-bv07.dts
@@ -0,0 +1,36 @@
1/*
2 * vt8500-bv07.dts - Device tree file for Benign BV07 Netbook
3 *
4 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
5 *
6 * Licensed under GPLv2 or later
7 */
8
9/dts-v1/;
10/include/ "vt8500.dtsi"
11
12/ {
13 model = "Benign BV07 Netbook";
14
15 /*
16 * Display node is based on Sascha Hauer's patch on dri-devel.
17 * Added a bpp property to calculate the size of the framebuffer
18 * until the binding is formalized.
19 */
20 display: display@0 {
21 modes {
22 mode0: mode@0 {
23 hactive = <800>;
24 vactive = <480>;
25 hback-porch = <88>;
26 hfront-porch = <40>;
27 hsync-len = <0>;
28 vback-porch = <32>;
29 vfront-porch = <11>;
30 vsync-len = <1>;
31 clock = <0>; /* unused but required */
32 bpp = <16>; /* non-standard but required */
33 };
34 };
35 };
36};
diff --git a/arch/arm/boot/dts/vt8500.dtsi b/arch/arm/boot/dts/vt8500.dtsi
new file mode 100644
index 00000000000..d8645e990b2
--- /dev/null
+++ b/arch/arm/boot/dts/vt8500.dtsi
@@ -0,0 +1,116 @@
1/*
2 * vt8500.dtsi - Device tree file for VIA VT8500 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 = "via,vt8500";
13
14 soc {
15 #address-cells = <1>;
16 #size-cells = <1>;
17 compatible = "simple-bus";
18 ranges;
19 interrupt-parent = <&intc>;
20
21 intc: interrupt-controller@d8140000 {
22 compatible = "via,vt8500-intc";
23 interrupt-controller;
24 reg = <0xd8140000 0x10000>;
25 #interrupt-cells = <1>;
26 };
27
28 gpio: gpio-controller@d8110000 {
29 compatible = "via,vt8500-gpio";
30 gpio-controller;
31 reg = <0xd8110000 0x10000>;
32 #gpio-cells = <3>;
33 };
34
35 pmc@d8130000 {
36 compatible = "via,vt8500-pmc";
37 reg = <0xd8130000 0x1000>;
38
39 clocks {
40 #address-cells = <1>;
41 #size-cells = <0>;
42
43 ref24: ref24M {
44 #clock-cells = <0>;
45 compatible = "fixed-clock";
46 clock-frequency = <24000000>;
47 };
48 };
49 };
50
51 timer@d8130100 {
52 compatible = "via,vt8500-timer";
53 reg = <0xd8130100 0x28>;
54 interrupts = <36>;
55 };
56
57 ehci@d8007900 {
58 compatible = "via,vt8500-ehci";
59 reg = <0xd8007900 0x200>;
60 interrupts = <43>;
61 };
62
63 uhci@d8007b00 {
64 compatible = "platform-uhci";
65 reg = <0xd8007b00 0x200>;
66 interrupts = <43>;
67 };
68
69 fb@d800e400 {
70 compatible = "via,vt8500-fb";
71 reg = <0xd800e400 0x400>;
72 interrupts = <12>;
73 display = <&display>;
74 default-mode = <&mode0>;
75 };
76
77 ge_rops@d8050400 {
78 compatible = "wm,prizm-ge-rops";
79 reg = <0xd8050400 0x100>;
80 };
81
82 uart@d8200000 {
83 compatible = "via,vt8500-uart";
84 reg = <0xd8200000 0x1040>;
85 interrupts = <32>;
86 clocks = <&ref24>;
87 };
88
89 uart@d82b0000 {
90 compatible = "via,vt8500-uart";
91 reg = <0xd82b0000 0x1040>;
92 interrupts = <33>;
93 clocks = <&ref24>;
94 };
95
96 uart@d8210000 {
97 compatible = "via,vt8500-uart";
98 reg = <0xd8210000 0x1040>;
99 interrupts = <47>;
100 clocks = <&ref24>;
101 };
102
103 uart@d82c0000 {
104 compatible = "via,vt8500-uart";
105 reg = <0xd82c0000 0x1040>;
106 interrupts = <50>;
107 clocks = <&ref24>;
108 };
109
110 rtc@d8100000 {
111 compatible = "via,vt8500-rtc";
112 reg = <0xd8100000 0x10000>;
113 interrupts = <48>;
114 };
115 };
116};
diff --git a/arch/arm/boot/dts/wm8505-ref.dts b/arch/arm/boot/dts/wm8505-ref.dts
new file mode 100644
index 00000000000..fd4e248074c
--- /dev/null
+++ b/arch/arm/boot/dts/wm8505-ref.dts
@@ -0,0 +1,36 @@
1/*
2 * wm8505-ref.dts - Device tree file for Wondermedia WM8505 reference netbook
3 *
4 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
5 *
6 * Licensed under GPLv2 or later
7 */
8
9/dts-v1/;
10/include/ "wm8505.dtsi"
11
12/ {
13 model = "Wondermedia WM8505 Netbook";
14
15 /*
16 * Display node is based on Sascha Hauer's patch on dri-devel.
17 * Added a bpp property to calculate the size of the framebuffer
18 * until the binding is formalized.
19 */
20 display: display@0 {
21 modes {
22 mode0: mode@0 {
23 hactive = <800>;
24 vactive = <480>;
25 hback-porch = <88>;
26 hfront-porch = <40>;
27 hsync-len = <0>;
28 vback-porch = <32>;
29 vfront-porch = <11>;
30 vsync-len = <1>;
31 clock = <0>; /* unused but required */
32 bpp = <32>; /* non-standard but required */
33 };
34 };
35 };
36};
diff --git a/arch/arm/boot/dts/wm8505.dtsi b/arch/arm/boot/dts/wm8505.dtsi
new file mode 100644
index 00000000000..b459691655a
--- /dev/null
+++ b/arch/arm/boot/dts/wm8505.dtsi
@@ -0,0 +1,143 @@
1/*
2 * wm8505.dtsi - Device tree file for Wondermedia WM8505 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,wm8505";
13
14 cpus {
15 cpu@0 {
16 compatible = "arm,arm926ejs";
17 };
18 };
19
20 soc {
21 #address-cells = <1>;
22 #size-cells = <1>;
23 compatible = "simple-bus";
24 ranges;
25 interrupt-parent = <&intc0>;
26
27 intc0: interrupt-controller@d8140000 {
28 compatible = "via,vt8500-intc";
29 interrupt-controller;
30 reg = <0xd8140000 0x10000>;
31 #interrupt-cells = <1>;
32 };
33
34 /* Secondary IC cascaded to intc0 */
35 intc1: interrupt-controller@d8150000 {
36 compatible = "via,vt8500-intc";
37 interrupt-controller;
38 #interrupt-cells = <1>;
39 reg = <0xD8150000 0x10000>;
40 interrupts = <56 57 58 59 60 61 62 63>;
41 };
42
43 gpio: gpio-controller@d8110000 {
44 compatible = "wm,wm8505-gpio";
45 gpio-controller;
46 reg = <0xd8110000 0x10000>;
47 #gpio-cells = <3>;
48 };
49
50 pmc@d8130000 {
51 compatible = "via,vt8500-pmc";
52 reg = <0xd8130000 0x1000>;
53 clocks {
54 #address-cells = <1>;
55 #size-cells = <0>;
56
57 ref24: ref24M {
58 #clock-cells = <0>;
59 compatible = "fixed-clock";
60 clock-frequency = <24000000>;
61 };
62 };
63 };
64
65 timer@d8130100 {
66 compatible = "via,vt8500-timer";
67 reg = <0xd8130100 0x28>;
68 interrupts = <36>;
69 };
70
71 ehci@d8007100 {
72 compatible = "via,vt8500-ehci";
73 reg = <0xd8007100 0x200>;
74 interrupts = <43>;
75 };
76
77 uhci@d8007300 {
78 compatible = "platform-uhci";
79 reg = <0xd8007300 0x200>;
80 interrupts = <43>;
81 };
82
83 fb@d8050800 {
84 compatible = "wm,wm8505-fb";
85 reg = <0xd8050800 0x200>;
86 display = <&display>;
87 default-mode = <&mode0>;
88 };
89
90 ge_rops@d8050400 {
91 compatible = "wm,prizm-ge-rops";
92 reg = <0xd8050400 0x100>;
93 };
94
95 uart@d8200000 {
96 compatible = "via,vt8500-uart";
97 reg = <0xd8200000 0x1040>;
98 interrupts = <32>;
99 clocks = <&ref24>;
100 };
101
102 uart@d82b0000 {
103 compatible = "via,vt8500-uart";
104 reg = <0xd82b0000 0x1040>;
105 interrupts = <33>;
106 clocks = <&ref24>;
107 };
108
109 uart@d8210000 {
110 compatible = "via,vt8500-uart";
111 reg = <0xd8210000 0x1040>;
112 interrupts = <47>;
113 clocks = <&ref24>;
114 };
115
116 uart@d82c0000 {
117 compatible = "via,vt8500-uart";
118 reg = <0xd82c0000 0x1040>;
119 interrupts = <50>;
120 clocks = <&ref24>;
121 };
122
123 uart@d8370000 {
124 compatible = "via,vt8500-uart";
125 reg = <0xd8370000 0x1040>;
126 interrupts = <31>;
127 clocks = <&ref24>;
128 };
129
130 uart@d8380000 {
131 compatible = "via,vt8500-uart";
132 reg = <0xd8380000 0x1040>;
133 interrupts = <30>;
134 clocks = <&ref24>;
135 };
136
137 rtc@d8100000 {
138 compatible = "via,vt8500-rtc";
139 reg = <0xd8100000 0x10000>;
140 interrupts = <48>;
141 };
142 };
143};
diff --git a/arch/arm/boot/dts/wm8650-mid.dts b/arch/arm/boot/dts/wm8650-mid.dts
new file mode 100644
index 00000000000..cefd938f842
--- /dev/null
+++ b/arch/arm/boot/dts/wm8650-mid.dts
@@ -0,0 +1,36 @@
1/*
2 * wm8650-mid.dts - Device tree file for Wondermedia WM8650-MID Tablet
3 *
4 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
5 *
6 * Licensed under GPLv2 or later
7 */
8
9/dts-v1/;
10/include/ "wm8650.dtsi"
11
12/ {
13 model = "Wondermedia WM8650-MID Tablet";
14
15 /*
16 * Display node is based on Sascha Hauer's patch on dri-devel.
17 * Added a bpp property to calculate the size of the framebuffer
18 * until the binding is formalized.
19 */
20 display: display@0 {
21 modes {
22 mode0: mode@0 {
23 hactive = <800>;
24 vactive = <480>;
25 hback-porch = <88>;
26 hfront-porch = <40>;
27 hsync-len = <0>;
28 vback-porch = <32>;
29 vfront-porch = <11>;
30 vsync-len = <1>;
31 clock = <0>; /* unused but required */
32 bpp = <16>; /* non-standard but required */
33 };
34 };
35 };
36};
diff --git a/arch/arm/boot/dts/wm8650.dtsi b/arch/arm/boot/dts/wm8650.dtsi
new file mode 100644
index 00000000000..83b9467559b
--- /dev/null
+++ b/arch/arm/boot/dts/wm8650.dtsi
@@ -0,0 +1,147 @@
1/*
2 * wm8650.dtsi - Device tree file for Wondermedia WM8650 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,wm8650";
13
14 soc {
15 #address-cells = <1>;
16 #size-cells = <1>;
17 compatible = "simple-bus";
18 ranges;
19 interrupt-parent = <&intc0>;
20
21 intc0: interrupt-controller@d8140000 {
22 compatible = "via,vt8500-intc";
23 interrupt-controller;
24 reg = <0xd8140000 0x10000>;
25 #interrupt-cells = <1>;
26 };
27
28 /* Secondary IC cascaded to intc0 */
29 intc1: interrupt-controller@d8150000 {
30 compatible = "via,vt8500-intc";
31 interrupt-controller;
32 #interrupt-cells = <1>;
33 reg = <0xD8150000 0x10000>;
34 interrupts = <56 57 58 59 60 61 62 63>;
35 };
36
37 gpio: gpio-controller@d8110000 {
38 compatible = "wm,wm8650-gpio";
39 gpio-controller;
40 reg = <0xd8110000 0x10000>;
41 #gpio-cells = <3>;
42 };
43
44 pmc@d8130000 {
45 compatible = "via,vt8500-pmc";
46 reg = <0xd8130000 0x1000>;
47
48 clocks {
49 #address-cells = <1>;
50 #size-cells = <0>;
51
52 ref25: ref25M {
53 #clock-cells = <0>;
54 compatible = "fixed-clock";
55 clock-frequency = <25000000>;
56 };
57
58 ref24: ref24M {
59 #clock-cells = <0>;
60 compatible = "fixed-clock";
61 clock-frequency = <24000000>;
62 };
63
64 plla: plla {
65 #clock-cells = <0>;
66 compatible = "wm,wm8650-pll-clock";
67 clocks = <&ref25>;
68 reg = <0x200>;
69 };
70
71 pllb: pllb {
72 #clock-cells = <0>;
73 compatible = "wm,wm8650-pll-clock";
74 clocks = <&ref25>;
75 reg = <0x204>;
76 };
77
78 arm: arm {
79 #clock-cells = <0>;
80 compatible = "via,vt8500-device-clock";
81 clocks = <&plla>;
82 divisor-reg = <0x300>;
83 };
84
85 sdhc: sdhc {
86 #clock-cells = <0>;
87 compatible = "via,vt8500-device-clock";
88 clocks = <&pllb>;
89 divisor-reg = <0x328>;
90 divisor-mask = <0x3f>;
91 enable-reg = <0x254>;
92 enable-bit = <18>;
93 };
94 };
95 };
96
97 timer@d8130100 {
98 compatible = "via,vt8500-timer";
99 reg = <0xd8130100 0x28>;
100 interrupts = <36>;
101 };
102
103 ehci@d8007900 {
104 compatible = "via,vt8500-ehci";
105 reg = <0xd8007900 0x200>;
106 interrupts = <43>;
107 };
108
109 uhci@d8007b00 {
110 compatible = "platform-uhci";
111 reg = <0xd8007b00 0x200>;
112 interrupts = <43>;
113 };
114
115 fb@d8050800 {
116 compatible = "wm,wm8505-fb";
117 reg = <0xd8050800 0x200>;
118 display = <&display>;
119 default-mode = <&mode0>;
120 };
121
122 ge_rops@d8050400 {
123 compatible = "wm,prizm-ge-rops";
124 reg = <0xd8050400 0x100>;
125 };
126
127 uart@d8200000 {
128 compatible = "via,vt8500-uart";
129 reg = <0xd8200000 0x1040>;
130 interrupts = <32>;
131 clocks = <&ref24>;
132 };
133
134 uart@d82b0000 {
135 compatible = "via,vt8500-uart";
136 reg = <0xd82b0000 0x1040>;
137 interrupts = <33>;
138 clocks = <&ref24>;
139 };
140
141 rtc@d8100000 {
142 compatible = "via,vt8500-rtc";
143 reg = <0xd8100000 0x10000>;
144 interrupts = <48>;
145 };
146 };
147};
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
index 283fa1d804f..45ceeb0e93e 100644
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
@@ -1,15 +1,15 @@
1config ARM_GIC 1config ARM_GIC
2 bool
2 select IRQ_DOMAIN 3 select IRQ_DOMAIN
3 select MULTI_IRQ_HANDLER 4 select MULTI_IRQ_HANDLER
4 bool
5 5
6config GIC_NON_BANKED 6config GIC_NON_BANKED
7 bool 7 bool
8 8
9config ARM_VIC 9config ARM_VIC
10 bool
10 select IRQ_DOMAIN 11 select IRQ_DOMAIN
11 select MULTI_IRQ_HANDLER 12 select MULTI_IRQ_HANDLER
12 bool
13 13
14config ARM_VIC_NR 14config ARM_VIC_NR
15 int 15 int
diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c
index c4110d1b1f2..001f4913799 100644
--- a/arch/arm/common/it8152.c
+++ b/arch/arm/common/it8152.c
@@ -284,11 +284,17 @@ int dma_set_coherent_mask(struct device *dev, u64 mask)
284 284
285int __init it8152_pci_setup(int nr, struct pci_sys_data *sys) 285int __init it8152_pci_setup(int nr, struct pci_sys_data *sys)
286{ 286{
287 it8152_io.start = IT8152_IO_BASE + 0x12000; 287 /*
288 it8152_io.end = IT8152_IO_BASE + 0x12000 + 0x100000; 288 * FIXME: use pci_ioremap_io to remap the IO space here and
289 * move over to the generic io.h implementation.
290 * This requires solving the same problem for PXA PCMCIA
291 * support.
292 */
293 it8152_io.start = (unsigned long)IT8152_IO_BASE + 0x12000;
294 it8152_io.end = (unsigned long)IT8152_IO_BASE + 0x12000 + 0x100000;
289 295
290 sys->mem_offset = 0x10000000; 296 sys->mem_offset = 0x10000000;
291 sys->io_offset = IT8152_IO_BASE; 297 sys->io_offset = (unsigned long)IT8152_IO_BASE;
292 298
293 if (request_resource(&ioport_resource, &it8152_io)) { 299 if (request_resource(&ioport_resource, &it8152_io)) {
294 printk(KERN_ERR "PCI: unable to allocate IO region\n"); 300 printk(KERN_ERR "PCI: unable to allocate IO region\n");
diff --git a/arch/arm/configs/afeb9260_defconfig b/arch/arm/configs/afeb9260_defconfig
index 2afdf67c212..c285a9d777d 100644
--- a/arch/arm/configs/afeb9260_defconfig
+++ b/arch/arm/configs/afeb9260_defconfig
@@ -39,7 +39,6 @@ CONFIG_MTD_BLOCK=y
39CONFIG_MTD_DATAFLASH=y 39CONFIG_MTD_DATAFLASH=y
40CONFIG_MTD_NAND=y 40CONFIG_MTD_NAND=y
41CONFIG_MTD_NAND_ATMEL=y 41CONFIG_MTD_NAND_ATMEL=y
42CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
43CONFIG_BLK_DEV_RAM=y 42CONFIG_BLK_DEV_RAM=y
44CONFIG_BLK_DEV_RAM_SIZE=8192 43CONFIG_BLK_DEV_RAM_SIZE=8192
45CONFIG_ATMEL_SSC=y 44CONFIG_ATMEL_SSC=y
diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig
index 90610c7030f..f78d259f8d2 100644
--- a/arch/arm/configs/armadillo800eva_defconfig
+++ b/arch/arm/configs/armadillo800eva_defconfig
@@ -85,6 +85,7 @@ CONFIG_SERIAL_SH_SCI_NR_UARTS=8
85CONFIG_SERIAL_SH_SCI_CONSOLE=y 85CONFIG_SERIAL_SH_SCI_CONSOLE=y
86# CONFIG_HW_RANDOM is not set 86# CONFIG_HW_RANDOM is not set
87CONFIG_I2C=y 87CONFIG_I2C=y
88CONFIG_I2C_GPIO=y
88CONFIG_I2C_SH_MOBILE=y 89CONFIG_I2C_SH_MOBILE=y
89# CONFIG_HWMON is not set 90# CONFIG_HWMON is not set
90CONFIG_MEDIA_SUPPORT=y 91CONFIG_MEDIA_SUPPORT=y
@@ -120,6 +121,8 @@ CONFIG_USB_ETH=m
120CONFIG_MMC=y 121CONFIG_MMC=y
121CONFIG_MMC_SDHI=y 122CONFIG_MMC_SDHI=y
122CONFIG_MMC_SH_MMCIF=y 123CONFIG_MMC_SH_MMCIF=y
124CONFIG_RTC_CLASS=y
125CONFIG_RTC_DRV_S35390A=y
123CONFIG_DMADEVICES=y 126CONFIG_DMADEVICES=y
124CONFIG_SH_DMAE=y 127CONFIG_SH_DMAE=y
125CONFIG_UIO=y 128CONFIG_UIO=y
diff --git a/arch/arm/configs/at91rm9200_defconfig b/arch/arm/configs/at91rm9200_defconfig
index d54e2acd3ab..4ae57a34a58 100644
--- a/arch/arm/configs/at91rm9200_defconfig
+++ b/arch/arm/configs/at91rm9200_defconfig
@@ -232,7 +232,7 @@ CONFIG_USB_GADGET=y
232CONFIG_USB_ETH=m 232CONFIG_USB_ETH=m
233CONFIG_USB_MASS_STORAGE=m 233CONFIG_USB_MASS_STORAGE=m
234CONFIG_MMC=y 234CONFIG_MMC=y
235CONFIG_MMC_AT91=y 235CONFIG_MMC_ATMELMCI=y
236CONFIG_NEW_LEDS=y 236CONFIG_NEW_LEDS=y
237CONFIG_LEDS_CLASS=y 237CONFIG_LEDS_CLASS=y
238CONFIG_LEDS_GPIO=y 238CONFIG_LEDS_GPIO=y
diff --git a/arch/arm/configs/at91sam9261_defconfig b/arch/arm/configs/at91sam9261_defconfig
index ade6b2f2311..1e8712ef062 100644
--- a/arch/arm/configs/at91sam9261_defconfig
+++ b/arch/arm/configs/at91sam9261_defconfig
@@ -128,7 +128,7 @@ CONFIG_USB_GADGETFS=m
128CONFIG_USB_FILE_STORAGE=m 128CONFIG_USB_FILE_STORAGE=m
129CONFIG_USB_G_SERIAL=m 129CONFIG_USB_G_SERIAL=m
130CONFIG_MMC=y 130CONFIG_MMC=y
131CONFIG_MMC_AT91=m 131CONFIG_MMC_ATMELMCI=m
132CONFIG_NEW_LEDS=y 132CONFIG_NEW_LEDS=y
133CONFIG_LEDS_CLASS=y 133CONFIG_LEDS_CLASS=y
134CONFIG_LEDS_GPIO=y 134CONFIG_LEDS_GPIO=y
diff --git a/arch/arm/configs/at91sam9263_defconfig b/arch/arm/configs/at91sam9263_defconfig
index 1cf96264cba..d2050cada82 100644
--- a/arch/arm/configs/at91sam9263_defconfig
+++ b/arch/arm/configs/at91sam9263_defconfig
@@ -61,7 +61,6 @@ CONFIG_MTD_DATAFLASH=y
61CONFIG_MTD_BLOCK2MTD=y 61CONFIG_MTD_BLOCK2MTD=y
62CONFIG_MTD_NAND=y 62CONFIG_MTD_NAND=y
63CONFIG_MTD_NAND_ATMEL=y 63CONFIG_MTD_NAND_ATMEL=y
64CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
65CONFIG_MTD_UBI=y 64CONFIG_MTD_UBI=y
66CONFIG_MTD_UBI_GLUEBI=y 65CONFIG_MTD_UBI_GLUEBI=y
67CONFIG_BLK_DEV_LOOP=y 66CONFIG_BLK_DEV_LOOP=y
@@ -138,7 +137,7 @@ CONFIG_USB_FILE_STORAGE=m
138CONFIG_USB_G_SERIAL=m 137CONFIG_USB_G_SERIAL=m
139CONFIG_MMC=y 138CONFIG_MMC=y
140CONFIG_SDIO_UART=m 139CONFIG_SDIO_UART=m
141CONFIG_MMC_AT91=m 140CONFIG_MMC_ATMELMCI=m
142CONFIG_NEW_LEDS=y 141CONFIG_NEW_LEDS=y
143CONFIG_LEDS_CLASS=y 142CONFIG_LEDS_CLASS=y
144CONFIG_LEDS_ATMEL_PWM=y 143CONFIG_LEDS_ATMEL_PWM=y
diff --git a/arch/arm/configs/at91sam9g20_defconfig b/arch/arm/configs/at91sam9g20_defconfig
index 994d331b231..e1b0e80b54a 100644
--- a/arch/arm/configs/at91sam9g20_defconfig
+++ b/arch/arm/configs/at91sam9g20_defconfig
@@ -99,7 +99,7 @@ CONFIG_USB_GADGETFS=m
99CONFIG_USB_FILE_STORAGE=m 99CONFIG_USB_FILE_STORAGE=m
100CONFIG_USB_G_SERIAL=m 100CONFIG_USB_G_SERIAL=m
101CONFIG_MMC=y 101CONFIG_MMC=y
102CONFIG_MMC_AT91=m 102CONFIG_MMC_ATMELMCI=m
103CONFIG_NEW_LEDS=y 103CONFIG_NEW_LEDS=y
104CONFIG_LEDS_CLASS=y 104CONFIG_LEDS_CLASS=y
105CONFIG_LEDS_GPIO=y 105CONFIG_LEDS_GPIO=y
diff --git a/arch/arm/configs/at91sam9rl_defconfig b/arch/arm/configs/at91sam9rl_defconfig
index ad562ee6420..7cf87856d63 100644
--- a/arch/arm/configs/at91sam9rl_defconfig
+++ b/arch/arm/configs/at91sam9rl_defconfig
@@ -60,7 +60,7 @@ CONFIG_AT91SAM9X_WATCHDOG=y
60CONFIG_FB=y 60CONFIG_FB=y
61CONFIG_FB_ATMEL=y 61CONFIG_FB_ATMEL=y
62CONFIG_MMC=y 62CONFIG_MMC=y
63CONFIG_MMC_AT91=m 63CONFIG_MMC_ATMELMCI=m
64CONFIG_RTC_CLASS=y 64CONFIG_RTC_CLASS=y
65CONFIG_RTC_DRV_AT91SAM9=y 65CONFIG_RTC_DRV_AT91SAM9=y
66CONFIG_EXT2_FS=y 66CONFIG_EXT2_FS=y
diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig
new file mode 100644
index 00000000000..7aea70253c6
--- /dev/null
+++ b/arch/arm/configs/bcm2835_defconfig
@@ -0,0 +1,95 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y
4CONFIG_BSD_PROCESS_ACCT=y
5CONFIG_BSD_PROCESS_ACCT_V3=y
6CONFIG_FHANDLE=y
7CONFIG_NO_HZ=y
8CONFIG_HIGH_RES_TIMERS=y
9CONFIG_LOG_BUF_SHIFT=18
10CONFIG_CGROUP_FREEZER=y
11CONFIG_CGROUP_DEVICE=y
12CONFIG_CPUSETS=y
13CONFIG_CGROUP_CPUACCT=y
14CONFIG_RESOURCE_COUNTERS=y
15CONFIG_CGROUP_PERF=y
16CONFIG_CFS_BANDWIDTH=y
17CONFIG_RT_GROUP_SCHED=y
18CONFIG_NAMESPACES=y
19CONFIG_SCHED_AUTOGROUP=y
20CONFIG_RELAY=y
21CONFIG_BLK_DEV_INITRD=y
22CONFIG_RD_BZIP2=y
23CONFIG_RD_LZMA=y
24CONFIG_RD_XZ=y
25CONFIG_RD_LZO=y
26CONFIG_CC_OPTIMIZE_FOR_SIZE=y
27CONFIG_KALLSYMS_ALL=y
28CONFIG_EMBEDDED=y
29# CONFIG_COMPAT_BRK is not set
30CONFIG_PROFILING=y
31CONFIG_OPROFILE=y
32CONFIG_JUMP_LABEL=y
33# CONFIG_BLOCK is not set
34CONFIG_ARCH_BCM2835=y
35CONFIG_PREEMPT_VOLUNTARY=y
36CONFIG_AEABI=y
37CONFIG_COMPACTION=y
38CONFIG_KSM=y
39CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
40CONFIG_CLEANCACHE=y
41CONFIG_SECCOMP=y
42CONFIG_CC_STACKPROTECTOR=y
43CONFIG_KEXEC=y
44CONFIG_CRASH_DUMP=y
45CONFIG_VFP=y
46# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
47# CONFIG_SUSPEND is not set
48CONFIG_DEVTMPFS=y
49CONFIG_DEVTMPFS_MOUNT=y
50# CONFIG_STANDALONE is not set
51# CONFIG_INPUT_MOUSEDEV is not set
52# CONFIG_INPUT_KEYBOARD is not set
53# CONFIG_INPUT_MOUSE is not set
54# CONFIG_SERIO is not set
55# CONFIG_VT is not set
56# CONFIG_UNIX98_PTYS is not set
57# CONFIG_LEGACY_PTYS is not set
58# CONFIG_DEVKMEM is not set
59CONFIG_SERIAL_AMBA_PL011=y
60CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
61CONFIG_TTY_PRINTK=y
62# CONFIG_HW_RANDOM is not set
63# CONFIG_HWMON is not set
64# CONFIG_USB_SUPPORT is not set
65# CONFIG_IOMMU_SUPPORT is not set
66# CONFIG_FILE_LOCKING is not set
67# CONFIG_DNOTIFY is not set
68# CONFIG_INOTIFY_USER is not set
69# CONFIG_PROC_FS is not set
70# CONFIG_SYSFS is not set
71# CONFIG_MISC_FILESYSTEMS is not set
72CONFIG_PRINTK_TIME=y
73# CONFIG_ENABLE_WARN_DEPRECATED is not set
74# CONFIG_ENABLE_MUST_CHECK is not set
75CONFIG_UNUSED_SYMBOLS=y
76CONFIG_LOCKUP_DETECTOR=y
77CONFIG_DEBUG_INFO=y
78CONFIG_DEBUG_MEMORY_INIT=y
79CONFIG_BOOT_PRINTK_DELAY=y
80CONFIG_SCHED_TRACER=y
81CONFIG_STACK_TRACER=y
82CONFIG_FUNCTION_PROFILER=y
83CONFIG_DYNAMIC_DEBUG=y
84CONFIG_KGDB=y
85CONFIG_KGDB_KDB=y
86CONFIG_TEST_KSTRTOX=y
87CONFIG_STRICT_DEVMEM=y
88CONFIG_DEBUG_LL=y
89CONFIG_EARLY_PRINTK=y
90# CONFIG_XZ_DEC_X86 is not set
91# CONFIG_XZ_DEC_POWERPC is not set
92# CONFIG_XZ_DEC_IA64 is not set
93# CONFIG_XZ_DEC_ARM is not set
94# CONFIG_XZ_DEC_ARMTHUMB is not set
95# CONFIG_XZ_DEC_SPARC is not set
diff --git a/arch/arm/configs/bcmring_defconfig b/arch/arm/configs/bcmring_defconfig
deleted file mode 100644
index 9e6a8fe1316..00000000000
--- a/arch/arm/configs/bcmring_defconfig
+++ /dev/null
@@ -1,79 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set
3# CONFIG_SWAP is not set
4CONFIG_SYSVIPC=y
5CONFIG_EXPERT=y
6CONFIG_KALLSYMS_EXTRA_PASS=y
7# CONFIG_HOTPLUG is not set
8# CONFIG_ELF_CORE is not set
9# CONFIG_EPOLL is not set
10# CONFIG_SIGNALFD is not set
11# CONFIG_TIMERFD is not set
12# CONFIG_EVENTFD is not set
13# CONFIG_AIO is not set
14CONFIG_PERF_EVENTS=y
15# CONFIG_VM_EVENT_COUNTERS is not set
16# CONFIG_SLUB_DEBUG is not set
17# CONFIG_COMPAT_BRK is not set
18CONFIG_MODULES=y
19CONFIG_MODULE_UNLOAD=y
20# CONFIG_BLK_DEV_BSG is not set
21# CONFIG_IOSCHED_DEADLINE is not set
22# CONFIG_IOSCHED_CFQ is not set
23CONFIG_ARCH_BCMRING=y
24CONFIG_BCM_ZRELADDR=0x8000
25CONFIG_CPU_32v6K=y
26CONFIG_NO_HZ=y
27CONFIG_PREEMPT=y
28CONFIG_AEABI=y
29# CONFIG_OABI_COMPAT is not set
30CONFIG_UACCESS_WITH_MEMCPY=y
31CONFIG_ZBOOT_ROM_TEXT=0x0e000000
32CONFIG_ZBOOT_ROM_BSS=0x0ea00000
33CONFIG_ZBOOT_ROM=y
34CONFIG_NET=y
35# CONFIG_WIRELESS is not set
36CONFIG_MTD=y
37CONFIG_MTD_CONCAT=y
38CONFIG_MTD_PARTITIONS=y
39CONFIG_MTD_CMDLINE_PARTS=y
40CONFIG_MTD_CHAR=y
41CONFIG_MTD_BLOCK=y
42CONFIG_MTD_CFI=y
43CONFIG_MTD_CFI_ADV_OPTIONS=y
44CONFIG_MTD_CFI_GEOMETRY=y
45# CONFIG_MTD_CFI_I2 is not set
46CONFIG_MTD_NAND=y
47CONFIG_MTD_NAND_VERIFY_WRITE=y
48CONFIG_MTD_NAND_BCM_UMI=y
49CONFIG_MTD_NAND_BCM_UMI_HWCS=y
50# CONFIG_MISC_DEVICES is not set
51# CONFIG_INPUT_MOUSEDEV is not set
52# CONFIG_INPUT_KEYBOARD is not set
53# CONFIG_INPUT_MOUSE is not set
54# CONFIG_SERIO is not set
55# CONFIG_CONSOLE_TRANSLATIONS is not set
56# CONFIG_DEVKMEM is not set
57CONFIG_SERIAL_AMBA_PL011=y
58CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
59CONFIG_LEGACY_PTY_COUNT=64
60# CONFIG_HW_RANDOM is not set
61# CONFIG_HWMON is not set
62# CONFIG_VGA_CONSOLE is not set
63# CONFIG_HID_SUPPORT is not set
64# CONFIG_USB_SUPPORT is not set
65# CONFIG_FILE_LOCKING is not set
66# CONFIG_DNOTIFY is not set
67# CONFIG_INOTIFY_USER is not set
68# CONFIG_PROC_PAGE_MONITOR is not set
69CONFIG_TMPFS=y
70CONFIG_JFFS2_FS=y
71CONFIG_JFFS2_SUMMARY=y
72CONFIG_JFFS2_FS_XATTR=y
73# CONFIG_JFFS2_FS_SECURITY is not set
74# CONFIG_NETWORK_FILESYSTEMS is not set
75# CONFIG_ENABLE_WARN_DEPRECATED is not set
76CONFIG_MAGIC_SYSRQ=y
77CONFIG_HEADERS_CHECK=y
78# CONFIG_RCU_CPU_STALL_DETECTOR is not set
79# CONFIG_ARM_UNWIND is not set
diff --git a/arch/arm/configs/cam60_defconfig b/arch/arm/configs/cam60_defconfig
index cedc92ef88a..14579711d8f 100644
--- a/arch/arm/configs/cam60_defconfig
+++ b/arch/arm/configs/cam60_defconfig
@@ -49,7 +49,6 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
49CONFIG_MTD_PLATRAM=m 49CONFIG_MTD_PLATRAM=m
50CONFIG_MTD_DATAFLASH=y 50CONFIG_MTD_DATAFLASH=y
51CONFIG_MTD_NAND=y 51CONFIG_MTD_NAND=y
52CONFIG_MTD_NAND_VERIFY_WRITE=y
53CONFIG_MTD_NAND_ATMEL=y 52CONFIG_MTD_NAND_ATMEL=y
54CONFIG_BLK_DEV_LOOP=y 53CONFIG_BLK_DEV_LOOP=y
55CONFIG_BLK_DEV_RAM=y 54CONFIG_BLK_DEV_RAM=y
diff --git a/arch/arm/configs/corgi_defconfig b/arch/arm/configs/corgi_defconfig
index e53c4756384..4b8a25d9e68 100644
--- a/arch/arm/configs/corgi_defconfig
+++ b/arch/arm/configs/corgi_defconfig
@@ -97,7 +97,6 @@ CONFIG_MTD_BLOCK=y
97CONFIG_MTD_ROM=y 97CONFIG_MTD_ROM=y
98CONFIG_MTD_COMPLEX_MAPPINGS=y 98CONFIG_MTD_COMPLEX_MAPPINGS=y
99CONFIG_MTD_NAND=y 99CONFIG_MTD_NAND=y
100CONFIG_MTD_NAND_VERIFY_WRITE=y
101CONFIG_MTD_NAND_SHARPSL=y 100CONFIG_MTD_NAND_SHARPSL=y
102CONFIG_BLK_DEV_LOOP=y 101CONFIG_BLK_DEV_LOOP=y
103CONFIG_IDE=y 102CONFIG_IDE=y
diff --git a/arch/arm/configs/cpu9260_defconfig b/arch/arm/configs/cpu9260_defconfig
index bbf729e2fb6..921480c23b9 100644
--- a/arch/arm/configs/cpu9260_defconfig
+++ b/arch/arm/configs/cpu9260_defconfig
@@ -82,7 +82,7 @@ CONFIG_USB_STORAGE=y
82CONFIG_USB_GADGET=y 82CONFIG_USB_GADGET=y
83CONFIG_USB_ETH=m 83CONFIG_USB_ETH=m
84CONFIG_MMC=y 84CONFIG_MMC=y
85CONFIG_MMC_AT91=m 85CONFIG_MMC_ATMELMCI=m
86CONFIG_NEW_LEDS=y 86CONFIG_NEW_LEDS=y
87CONFIG_LEDS_CLASS=y 87CONFIG_LEDS_CLASS=y
88CONFIG_LEDS_GPIO=y 88CONFIG_LEDS_GPIO=y
diff --git a/arch/arm/configs/cpu9g20_defconfig b/arch/arm/configs/cpu9g20_defconfig
index e7d7942927f..ea116cbdffa 100644
--- a/arch/arm/configs/cpu9g20_defconfig
+++ b/arch/arm/configs/cpu9g20_defconfig
@@ -82,7 +82,7 @@ CONFIG_USB_STORAGE=y
82CONFIG_USB_GADGET=y 82CONFIG_USB_GADGET=y
83CONFIG_USB_ETH=m 83CONFIG_USB_ETH=m
84CONFIG_MMC=y 84CONFIG_MMC=y
85CONFIG_MMC_AT91=m 85CONFIG_MMC_ATMELMCI=m
86CONFIG_NEW_LEDS=y 86CONFIG_NEW_LEDS=y
87CONFIG_LEDS_CLASS=y 87CONFIG_LEDS_CLASS=y
88CONFIG_LEDS_GPIO=y 88CONFIG_LEDS_GPIO=y
diff --git a/arch/arm/configs/ep93xx_defconfig b/arch/arm/configs/ep93xx_defconfig
index 8e97b2f7cee..806005a4c4c 100644
--- a/arch/arm/configs/ep93xx_defconfig
+++ b/arch/arm/configs/ep93xx_defconfig
@@ -61,7 +61,6 @@ CONFIG_MTD_CFI_STAA=y
61CONFIG_MTD_ROM=y 61CONFIG_MTD_ROM=y
62CONFIG_MTD_PHYSMAP=y 62CONFIG_MTD_PHYSMAP=y
63CONFIG_MTD_NAND=y 63CONFIG_MTD_NAND=y
64CONFIG_MTD_NAND_VERIFY_WRITE=y
65CONFIG_BLK_DEV_NBD=y 64CONFIG_BLK_DEV_NBD=y
66CONFIG_EEPROM_LEGACY=y 65CONFIG_EEPROM_LEGACY=y
67CONFIG_SCSI=y 66CONFIG_SCSI=y
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 3c9f32f9b6b..66aa7a6db88 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -32,9 +32,7 @@ CONFIG_MACH_VPR200=y
32CONFIG_MACH_IMX51_DT=y 32CONFIG_MACH_IMX51_DT=y
33CONFIG_MACH_MX51_3DS=y 33CONFIG_MACH_MX51_3DS=y
34CONFIG_MACH_EUKREA_CPUIMX51SD=y 34CONFIG_MACH_EUKREA_CPUIMX51SD=y
35CONFIG_MACH_MX51_EFIKAMX=y 35CONFIG_SOC_IMX53=y
36CONFIG_MACH_MX51_EFIKASB=y
37CONFIG_MACH_IMX53_DT=y
38CONFIG_SOC_IMX6Q=y 36CONFIG_SOC_IMX6Q=y
39CONFIG_MXC_PWM=y 37CONFIG_MXC_PWM=y
40CONFIG_SMP=y 38CONFIG_SMP=y
@@ -42,7 +40,6 @@ CONFIG_VMSPLIT_2G=y
42CONFIG_PREEMPT_VOLUNTARY=y 40CONFIG_PREEMPT_VOLUNTARY=y
43CONFIG_AEABI=y 41CONFIG_AEABI=y
44# CONFIG_OABI_COMPAT is not set 42# CONFIG_OABI_COMPAT is not set
45CONFIG_DEFAULT_MMAP_MIN_ADDR=32768
46CONFIG_CMDLINE="noinitrd console=ttymxc0,115200" 43CONFIG_CMDLINE="noinitrd console=ttymxc0,115200"
47CONFIG_VFP=y 44CONFIG_VFP=y
48CONFIG_NEON=y 45CONFIG_NEON=y
@@ -179,6 +176,9 @@ CONFIG_SND_SOC_IMX_MC13783=y
179CONFIG_USB=y 176CONFIG_USB=y
180CONFIG_USB_EHCI_HCD=y 177CONFIG_USB_EHCI_HCD=y
181CONFIG_USB_EHCI_MXC=y 178CONFIG_USB_EHCI_MXC=y
179CONFIG_USB_CHIPIDEA=y
180CONFIG_USB_CHIPIDEA_HOST=y
181CONFIG_USB_MXS_PHY=y
182CONFIG_USB_STORAGE=y 182CONFIG_USB_STORAGE=y
183CONFIG_MMC=y 183CONFIG_MMC=y
184CONFIG_MMC_SDHCI=y 184CONFIG_MMC_SDHCI=y
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index aeb3af541fe..74eee0c78f2 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_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_LOG_BUF_SHIFT=19 5CONFIG_LOG_BUF_SHIFT=19
4CONFIG_PROFILING=y 6CONFIG_PROFILING=y
5CONFIG_OPROFILE=y 7CONFIG_OPROFILE=y
@@ -15,9 +17,19 @@ CONFIG_MACH_MV88F6281GTW_GE=y
15CONFIG_MACH_SHEEVAPLUG=y 17CONFIG_MACH_SHEEVAPLUG=y
16CONFIG_MACH_ESATA_SHEEVAPLUG=y 18CONFIG_MACH_ESATA_SHEEVAPLUG=y
17CONFIG_MACH_GURUPLUG=y 19CONFIG_MACH_GURUPLUG=y
18CONFIG_MACH_DOCKSTAR=y 20CONFIG_MACH_DREAMPLUG_DT=y
21CONFIG_MACH_ICONNECT_DT=y
22CONFIG_MACH_DLINK_KIRKWOOD_DT=y
23CONFIG_MACH_IB62X0_DT=y
24CONFIG_MACH_TS219_DT=y
25CONFIG_MACH_DOCKSTAR_DT=y
26CONFIG_MACH_GOFLEXNET_DT=y
27CONFIG_MACH_LSXL_DT=y
28CONFIG_MACH_IOMEGA_IX2_200_DT=y
29CONFIG_MACH_KM_KIRKWOOD_DT=y
19CONFIG_MACH_TS219=y 30CONFIG_MACH_TS219=y
20CONFIG_MACH_TS41X=y 31CONFIG_MACH_TS41X=y
32CONFIG_MACH_DOCKSTAR=y
21CONFIG_MACH_OPENRD_BASE=y 33CONFIG_MACH_OPENRD_BASE=y
22CONFIG_MACH_OPENRD_CLIENT=y 34CONFIG_MACH_OPENRD_CLIENT=y
23CONFIG_MACH_OPENRD_ULTIMATE=y 35CONFIG_MACH_OPENRD_ULTIMATE=y
@@ -29,8 +41,6 @@ CONFIG_MACH_NET2BIG_V2=y
29CONFIG_MACH_NET5BIG_V2=y 41CONFIG_MACH_NET5BIG_V2=y
30CONFIG_MACH_T5325=y 42CONFIG_MACH_T5325=y
31# CONFIG_CPU_FEROCEON_OLD_ID is not set 43# CONFIG_CPU_FEROCEON_OLD_ID is not set
32CONFIG_NO_HZ=y
33CONFIG_HIGH_RES_TIMERS=y
34CONFIG_PREEMPT=y 44CONFIG_PREEMPT=y
35CONFIG_AEABI=y 45CONFIG_AEABI=y
36# CONFIG_OABI_COMPAT is not set 46# CONFIG_OABI_COMPAT is not set
@@ -47,13 +57,11 @@ CONFIG_IP_PNP_DHCP=y
47CONFIG_IP_PNP_BOOTP=y 57CONFIG_IP_PNP_BOOTP=y
48# CONFIG_IPV6 is not set 58# CONFIG_IPV6 is not set
49CONFIG_NET_DSA=y 59CONFIG_NET_DSA=y
50CONFIG_NET_DSA_MV88E6123_61_65=y
51CONFIG_NET_PKTGEN=m 60CONFIG_NET_PKTGEN=m
52CONFIG_CFG80211=y 61CONFIG_CFG80211=y
53CONFIG_MAC80211=y 62CONFIG_MAC80211=y
54CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 63CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
55CONFIG_MTD=y 64CONFIG_MTD=y
56CONFIG_MTD_PARTITIONS=y
57CONFIG_MTD_CMDLINE_PARTS=y 65CONFIG_MTD_CMDLINE_PARTS=y
58CONFIG_MTD_CHAR=y 66CONFIG_MTD_CHAR=y
59CONFIG_MTD_BLOCK=y 67CONFIG_MTD_BLOCK=y
@@ -69,7 +77,6 @@ CONFIG_MTD_M25P80=y
69CONFIG_MTD_NAND=y 77CONFIG_MTD_NAND=y
70CONFIG_MTD_NAND_ORION=y 78CONFIG_MTD_NAND_ORION=y
71CONFIG_BLK_DEV_LOOP=y 79CONFIG_BLK_DEV_LOOP=y
72# CONFIG_MISC_DEVICES is not set
73# CONFIG_SCSI_PROC_FS is not set 80# CONFIG_SCSI_PROC_FS is not set
74CONFIG_BLK_DEV_SD=y 81CONFIG_BLK_DEV_SD=y
75CONFIG_BLK_DEV_SR=m 82CONFIG_BLK_DEV_SR=m
@@ -78,22 +85,21 @@ CONFIG_ATA=y
78CONFIG_SATA_AHCI=y 85CONFIG_SATA_AHCI=y
79CONFIG_SATA_MV=y 86CONFIG_SATA_MV=y
80CONFIG_NETDEVICES=y 87CONFIG_NETDEVICES=y
81CONFIG_MARVELL_PHY=y
82CONFIG_NET_ETHERNET=y
83CONFIG_MII=y 88CONFIG_MII=y
84CONFIG_NET_PCI=y 89CONFIG_NET_DSA_MV88E6123_61_65=y
85CONFIG_MV643XX_ETH=y 90CONFIG_MV643XX_ETH=y
86# CONFIG_NETDEV_10000 is not set 91CONFIG_MARVELL_PHY=y
87CONFIG_LIBERTAS=y 92CONFIG_LIBERTAS=y
88CONFIG_LIBERTAS_SDIO=y 93CONFIG_LIBERTAS_SDIO=y
89CONFIG_INPUT_EVDEV=y 94CONFIG_INPUT_EVDEV=y
90CONFIG_KEYBOARD_GPIO=y 95CONFIG_KEYBOARD_GPIO=y
91# CONFIG_INPUT_MOUSE is not set 96# CONFIG_INPUT_MOUSE is not set
97CONFIG_LEGACY_PTY_COUNT=16
92# CONFIG_DEVKMEM is not set 98# CONFIG_DEVKMEM is not set
93CONFIG_SERIAL_8250=y 99CONFIG_SERIAL_8250=y
94CONFIG_SERIAL_8250_CONSOLE=y 100CONFIG_SERIAL_8250_CONSOLE=y
95CONFIG_SERIAL_8250_RUNTIME_UARTS=2 101CONFIG_SERIAL_8250_RUNTIME_UARTS=2
96CONFIG_LEGACY_PTY_COUNT=16 102CONFIG_SERIAL_OF_PLATFORM=y
97# CONFIG_HW_RANDOM is not set 103# CONFIG_HW_RANDOM is not set
98CONFIG_I2C=y 104CONFIG_I2C=y
99# CONFIG_I2C_COMPAT is not set 105# CONFIG_I2C_COMPAT is not set
@@ -103,7 +109,8 @@ CONFIG_SPI=y
103CONFIG_SPI_ORION=y 109CONFIG_SPI_ORION=y
104CONFIG_GPIO_SYSFS=y 110CONFIG_GPIO_SYSFS=y
105# CONFIG_HWMON is not set 111# CONFIG_HWMON is not set
106# CONFIG_VGA_CONSOLE is not set 112CONFIG_WATCHDOG=y
113CONFIG_ORION_WATCHDOG=y
107CONFIG_HID_DRAGONRISE=y 114CONFIG_HID_DRAGONRISE=y
108CONFIG_HID_GYRATION=y 115CONFIG_HID_GYRATION=y
109CONFIG_HID_TWINHAN=y 116CONFIG_HID_TWINHAN=y
@@ -119,10 +126,8 @@ CONFIG_HID_TOPSEED=y
119CONFIG_HID_THRUSTMASTER=y 126CONFIG_HID_THRUSTMASTER=y
120CONFIG_HID_ZEROPLUS=y 127CONFIG_HID_ZEROPLUS=y
121CONFIG_USB=y 128CONFIG_USB=y
122CONFIG_USB_DEVICEFS=y
123CONFIG_USB_EHCI_HCD=y 129CONFIG_USB_EHCI_HCD=y
124CONFIG_USB_EHCI_ROOT_HUB_TT=y 130CONFIG_USB_EHCI_ROOT_HUB_TT=y
125CONFIG_USB_EHCI_TT_NEWSCHED=y
126CONFIG_USB_PRINTER=m 131CONFIG_USB_PRINTER=m
127CONFIG_USB_STORAGE=y 132CONFIG_USB_STORAGE=y
128CONFIG_USB_STORAGE_DATAFAB=y 133CONFIG_USB_STORAGE_DATAFAB=y
@@ -148,7 +153,6 @@ CONFIG_MV_XOR=y
148CONFIG_EXT2_FS=y 153CONFIG_EXT2_FS=y
149CONFIG_EXT3_FS=y 154CONFIG_EXT3_FS=y
150# CONFIG_EXT3_FS_XATTR is not set 155# CONFIG_EXT3_FS_XATTR is not set
151CONFIG_INOTIFY=y
152CONFIG_ISO9660_FS=m 156CONFIG_ISO9660_FS=m
153CONFIG_JOLIET=y 157CONFIG_JOLIET=y
154CONFIG_UDF_FS=m 158CONFIG_UDF_FS=m
@@ -158,7 +162,6 @@ CONFIG_TMPFS=y
158CONFIG_JFFS2_FS=y 162CONFIG_JFFS2_FS=y
159CONFIG_CRAMFS=y 163CONFIG_CRAMFS=y
160CONFIG_NFS_FS=y 164CONFIG_NFS_FS=y
161CONFIG_NFS_V3=y
162CONFIG_ROOT_NFS=y 165CONFIG_ROOT_NFS=y
163CONFIG_NLS_CODEPAGE_437=y 166CONFIG_NLS_CODEPAGE_437=y
164CONFIG_NLS_CODEPAGE_850=y 167CONFIG_NLS_CODEPAGE_850=y
@@ -171,11 +174,8 @@ CONFIG_DEBUG_KERNEL=y
171# CONFIG_SCHED_DEBUG is not set 174# CONFIG_SCHED_DEBUG is not set
172# CONFIG_DEBUG_PREEMPT is not set 175# CONFIG_DEBUG_PREEMPT is not set
173CONFIG_DEBUG_INFO=y 176CONFIG_DEBUG_INFO=y
174# CONFIG_RCU_CPU_STALL_DETECTOR is not set
175CONFIG_SYSCTL_SYSCALL_CHECK=y
176# CONFIG_FTRACE is not set 177# CONFIG_FTRACE is not set
177CONFIG_DEBUG_USER=y 178CONFIG_DEBUG_USER=y
178CONFIG_DEBUG_ERRORS=y
179CONFIG_DEBUG_LL=y 179CONFIG_DEBUG_LL=y
180CONFIG_CRYPTO_CBC=m 180CONFIG_CRYPTO_CBC=m
181CONFIG_CRYPTO_PCBC=m 181CONFIG_CRYPTO_PCBC=m
diff --git a/arch/arm/configs/kzm9d_defconfig b/arch/arm/configs/kzm9d_defconfig
index 26146ffea1a..8c49df66cac 100644
--- a/arch/arm/configs/kzm9d_defconfig
+++ b/arch/arm/configs/kzm9d_defconfig
@@ -8,6 +8,7 @@ CONFIG_LOG_BUF_SHIFT=16
8CONFIG_CC_OPTIMIZE_FOR_SIZE=y 8CONFIG_CC_OPTIMIZE_FOR_SIZE=y
9CONFIG_SYSCTL_SYSCALL=y 9CONFIG_SYSCTL_SYSCALL=y
10CONFIG_EMBEDDED=y 10CONFIG_EMBEDDED=y
11CONFIG_PERF_EVENTS=y
11CONFIG_SLAB=y 12CONFIG_SLAB=y
12# CONFIG_BLK_DEV_BSG is not set 13# CONFIG_BLK_DEV_BSG is not set
13# CONFIG_IOSCHED_DEADLINE is not set 14# CONFIG_IOSCHED_DEADLINE is not set
diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
index 2388c861062..c88b57886e7 100644
--- a/arch/arm/configs/kzm9g_defconfig
+++ b/arch/arm/configs/kzm9g_defconfig
@@ -14,6 +14,7 @@ CONFIG_NAMESPACES=y
14CONFIG_CC_OPTIMIZE_FOR_SIZE=y 14CONFIG_CC_OPTIMIZE_FOR_SIZE=y
15CONFIG_SYSCTL_SYSCALL=y 15CONFIG_SYSCTL_SYSCALL=y
16CONFIG_EMBEDDED=y 16CONFIG_EMBEDDED=y
17CONFIG_PERF_EVENTS=y
17CONFIG_SLAB=y 18CONFIG_SLAB=y
18CONFIG_MODULES=y 19CONFIG_MODULES=y
19CONFIG_MODULE_FORCE_LOAD=y 20CONFIG_MODULE_FORCE_LOAD=y
@@ -22,7 +23,6 @@ CONFIG_MODULE_UNLOAD=y
22# CONFIG_IOSCHED_DEADLINE is not set 23# CONFIG_IOSCHED_DEADLINE is not set
23# CONFIG_IOSCHED_CFQ is not set 24# CONFIG_IOSCHED_CFQ is not set
24CONFIG_ARCH_SHMOBILE=y 25CONFIG_ARCH_SHMOBILE=y
25CONFIG_KEYBOARD_GPIO_POLLED=y
26CONFIG_ARCH_SH73A0=y 26CONFIG_ARCH_SH73A0=y
27CONFIG_MACH_KZM9G=y 27CONFIG_MACH_KZM9G=y
28CONFIG_MEMORY_START=0x41000000 28CONFIG_MEMORY_START=0x41000000
@@ -70,6 +70,7 @@ CONFIG_INPUT_SPARSEKMAP=y
70# CONFIG_INPUT_MOUSEDEV is not set 70# CONFIG_INPUT_MOUSEDEV is not set
71CONFIG_INPUT_EVDEV=y 71CONFIG_INPUT_EVDEV=y
72# CONFIG_KEYBOARD_ATKBD is not set 72# CONFIG_KEYBOARD_ATKBD is not set
73CONFIG_KEYBOARD_GPIO=y
73# CONFIG_INPUT_MOUSE is not set 74# CONFIG_INPUT_MOUSE is not set
74CONFIG_INPUT_TOUCHSCREEN=y 75CONFIG_INPUT_TOUCHSCREEN=y
75CONFIG_TOUCHSCREEN_ST1232=y 76CONFIG_TOUCHSCREEN_ST1232=y
diff --git a/arch/arm/configs/lpc32xx_defconfig b/arch/arm/configs/lpc32xx_defconfig
index e42a0e3d4c3..92386b20bd0 100644
--- a/arch/arm/configs/lpc32xx_defconfig
+++ b/arch/arm/configs/lpc32xx_defconfig
@@ -133,7 +133,6 @@ CONFIG_SND_DEBUG_VERBOSE=y
133# CONFIG_SND_ARM is not set 133# CONFIG_SND_ARM is not set
134# CONFIG_SND_SPI is not set 134# CONFIG_SND_SPI is not set
135CONFIG_SND_SOC=y 135CONFIG_SND_SOC=y
136# CONFIG_HID_SUPPORT is not set
137CONFIG_USB=y 136CONFIG_USB=y
138CONFIG_USB_OHCI_HCD=y 137CONFIG_USB_OHCI_HCD=y
139CONFIG_USB_STORAGE=y 138CONFIG_USB_STORAGE=y
@@ -149,6 +148,7 @@ CONFIG_LEDS_CLASS=y
149CONFIG_LEDS_PCA9532=y 148CONFIG_LEDS_PCA9532=y
150CONFIG_LEDS_PCA9532_GPIO=y 149CONFIG_LEDS_PCA9532_GPIO=y
151CONFIG_LEDS_GPIO=y 150CONFIG_LEDS_GPIO=y
151CONFIG_LEDS_PWM=y
152CONFIG_LEDS_TRIGGERS=y 152CONFIG_LEDS_TRIGGERS=y
153CONFIG_LEDS_TRIGGER_TIMER=y 153CONFIG_LEDS_TRIGGER_TIMER=y
154CONFIG_LEDS_TRIGGER_HEARTBEAT=y 154CONFIG_LEDS_TRIGGER_HEARTBEAT=y
@@ -161,10 +161,13 @@ CONFIG_RTC_DRV_DS1374=y
161CONFIG_RTC_DRV_PCF8563=y 161CONFIG_RTC_DRV_PCF8563=y
162CONFIG_RTC_DRV_LPC32XX=y 162CONFIG_RTC_DRV_LPC32XX=y
163CONFIG_DMADEVICES=y 163CONFIG_DMADEVICES=y
164CONFIG_AMBA_PL08X=y
164CONFIG_STAGING=y 165CONFIG_STAGING=y
165CONFIG_LPC32XX_ADC=y 166CONFIG_LPC32XX_ADC=y
166CONFIG_MAX517=y
167CONFIG_IIO=y 167CONFIG_IIO=y
168CONFIG_MAX517=y
169CONFIG_PWM=y
170CONFIG_PWM_LPC32XX=y
168CONFIG_EXT2_FS=y 171CONFIG_EXT2_FS=y
169CONFIG_AUTOFS4_FS=y 172CONFIG_AUTOFS4_FS=y
170CONFIG_MSDOS_FS=y 173CONFIG_MSDOS_FS=y
diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 864f9a5c39d..53382b6c8bb 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -1,13 +1,14 @@
1# CONFIG_ARM_PATCH_PHYS_VIRT is not set 1# CONFIG_ARM_PATCH_PHYS_VIRT is not set
2CONFIG_EXPERIMENTAL=y 2CONFIG_EXPERIMENTAL=y
3CONFIG_KERNEL_LZMA=y 3CONFIG_KERNEL_LZMA=y
4CONFIG_NO_HZ=y
4CONFIG_IKCONFIG=y 5CONFIG_IKCONFIG=y
5CONFIG_IKCONFIG_PROC=y 6CONFIG_IKCONFIG_PROC=y
6CONFIG_LOG_BUF_SHIFT=16 7CONFIG_LOG_BUF_SHIFT=16
7CONFIG_SYSCTL_SYSCALL=y 8CONFIG_SYSCTL_SYSCALL=y
8CONFIG_EMBEDDED=y 9CONFIG_EMBEDDED=y
9CONFIG_SLAB=y 10CONFIG_SLAB=y
10# CONFIG_BLOCK is not set 11# CONFIG_IOSCHED_CFQ is not set
11CONFIG_ARCH_SHMOBILE=y 12CONFIG_ARCH_SHMOBILE=y
12CONFIG_ARCH_R8A7779=y 13CONFIG_ARCH_R8A7779=y
13CONFIG_MACH_MARZEN=y 14CONFIG_MACH_MARZEN=y
@@ -21,7 +22,6 @@ CONFIG_ARM_ERRATA_458693=y
21CONFIG_ARM_ERRATA_460075=y 22CONFIG_ARM_ERRATA_460075=y
22CONFIG_ARM_ERRATA_743622=y 23CONFIG_ARM_ERRATA_743622=y
23CONFIG_ARM_ERRATA_754322=y 24CONFIG_ARM_ERRATA_754322=y
24CONFIG_NO_HZ=y
25CONFIG_SMP=y 25CONFIG_SMP=y
26# CONFIG_ARM_CPU_TOPOLOGY is not set 26# CONFIG_ARM_CPU_TOPOLOGY is not set
27CONFIG_AEABI=y 27CONFIG_AEABI=y
@@ -29,13 +29,16 @@ CONFIG_AEABI=y
29CONFIG_HIGHMEM=y 29CONFIG_HIGHMEM=y
30CONFIG_ZBOOT_ROM_TEXT=0x0 30CONFIG_ZBOOT_ROM_TEXT=0x0
31CONFIG_ZBOOT_ROM_BSS=0x0 31CONFIG_ZBOOT_ROM_BSS=0x0
32CONFIG_CMDLINE="console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel" 32CONFIG_CMDLINE="console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on"
33CONFIG_CMDLINE_FORCE=y 33CONFIG_CMDLINE_FORCE=y
34CONFIG_KEXEC=y 34CONFIG_KEXEC=y
35# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 35# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
36CONFIG_PM_RUNTIME=y 36CONFIG_PM_RUNTIME=y
37CONFIG_NET=y 37CONFIG_NET=y
38CONFIG_UNIX=y
38CONFIG_INET=y 39CONFIG_INET=y
40CONFIG_IP_PNP=y
41CONFIG_IP_PNP_DHCP=y
39# CONFIG_IPV6 is not set 42# CONFIG_IPV6 is not set
40# CONFIG_WIRELESS is not set 43# CONFIG_WIRELESS is not set
41CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 44CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
@@ -68,17 +71,21 @@ CONFIG_SERIAL_SH_SCI_CONSOLE=y
68# CONFIG_HW_RANDOM is not set 71# CONFIG_HW_RANDOM is not set
69CONFIG_GPIO_SYSFS=y 72CONFIG_GPIO_SYSFS=y
70# CONFIG_HWMON is not set 73# CONFIG_HWMON is not set
74CONFIG_THERMAL=y
75CONFIG_RCAR_THERMAL=y
71CONFIG_SSB=y 76CONFIG_SSB=y
72# CONFIG_HID_SUPPORT is not set
73# CONFIG_USB_SUPPORT is not set 77# CONFIG_USB_SUPPORT is not set
78CONFIG_MMC=y
79CONFIG_MMC_SDHI=y
74CONFIG_UIO=y 80CONFIG_UIO=y
75CONFIG_UIO_PDRV_GENIRQ=y 81CONFIG_UIO_PDRV_GENIRQ=y
76# CONFIG_IOMMU_SUPPORT is not set 82# CONFIG_IOMMU_SUPPORT is not set
77# CONFIG_FILE_LOCKING is not set
78# CONFIG_DNOTIFY is not set 83# CONFIG_DNOTIFY is not set
79# CONFIG_INOTIFY_USER is not set 84# CONFIG_INOTIFY_USER is not set
80CONFIG_TMPFS=y 85CONFIG_TMPFS=y
81# CONFIG_MISC_FILESYSTEMS is not set 86# CONFIG_MISC_FILESYSTEMS is not set
87CONFIG_NFS_FS=y
88CONFIG_ROOT_NFS=y
82CONFIG_MAGIC_SYSRQ=y 89CONFIG_MAGIC_SYSRQ=y
83CONFIG_DEBUG_INFO=y 90CONFIG_DEBUG_INFO=y
84CONFIG_DEBUG_INFO_REDUCED=y 91CONFIG_DEBUG_INFO_REDUCED=y
diff --git a/arch/arm/configs/mini2440_defconfig b/arch/arm/configs/mini2440_defconfig
index 082175c54e7..00630e6af45 100644
--- a/arch/arm/configs/mini2440_defconfig
+++ b/arch/arm/configs/mini2440_defconfig
@@ -102,7 +102,6 @@ CONFIG_MTD_CFI_STAA=y
102CONFIG_MTD_RAM=y 102CONFIG_MTD_RAM=y
103CONFIG_MTD_ROM=y 103CONFIG_MTD_ROM=y
104CONFIG_MTD_NAND=y 104CONFIG_MTD_NAND=y
105CONFIG_MTD_NAND_VERIFY_WRITE=y
106CONFIG_MTD_NAND_S3C2410=y 105CONFIG_MTD_NAND_S3C2410=y
107CONFIG_MTD_NAND_PLATFORM=y 106CONFIG_MTD_NAND_PLATFORM=y
108CONFIG_MTD_LPDDR=y 107CONFIG_MTD_LPDDR=y
diff --git a/arch/arm/configs/mmp2_defconfig b/arch/arm/configs/mmp2_defconfig
index 5a584520db2..f1cb95e58af 100644
--- a/arch/arm/configs/mmp2_defconfig
+++ b/arch/arm/configs/mmp2_defconfig
@@ -16,7 +16,7 @@ CONFIG_PREEMPT=y
16CONFIG_AEABI=y 16CONFIG_AEABI=y
17CONFIG_ZBOOT_ROM_TEXT=0x0 17CONFIG_ZBOOT_ROM_TEXT=0x0
18CONFIG_ZBOOT_ROM_BSS=0x0 18CONFIG_ZBOOT_ROM_BSS=0x0
19CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.1.100:/nfsroot/ ip=192.168.1.101:192.168.1.100::255.255.255.0::eth0:on console=ttyS2,38400 mem=128M user_debug=255" 19CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.1.100:/nfsroot/ ip=192.168.1.101:192.168.1.100::255.255.255.0::eth0:on console=ttyS2,38400 mem=128M user_debug=255 earlyprintk"
20CONFIG_VFP=y 20CONFIG_VFP=y
21CONFIG_NET=y 21CONFIG_NET=y
22CONFIG_PACKET=y 22CONFIG_PACKET=y
@@ -90,6 +90,9 @@ CONFIG_DEBUG_INFO=y
90# CONFIG_RCU_CPU_STALL_DETECTOR is not set 90# CONFIG_RCU_CPU_STALL_DETECTOR is not set
91# CONFIG_DYNAMIC_DEBUG is not set 91# CONFIG_DYNAMIC_DEBUG is not set
92CONFIG_DEBUG_USER=y 92CONFIG_DEBUG_USER=y
93CONFIG_DEBUG_LL=y
94CONFIG_DEBUG_MMP_UART3=y
95CONFIG_EARLY_PRINTK=y
93CONFIG_DEBUG_ERRORS=y 96CONFIG_DEBUG_ERRORS=y
94# CONFIG_CRYPTO_ANSI_CPRNG is not set 97# CONFIG_CRYPTO_ANSI_CPRNG is not set
95CONFIG_CRC_CCITT=y 98CONFIG_CRC_CCITT=y
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
new file mode 100644
index 00000000000..159f75fc437
--- /dev/null
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -0,0 +1,57 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_NO_HZ=y
3CONFIG_HIGH_RES_TIMERS=y
4CONFIG_ARCH_MVEBU=y
5CONFIG_MACH_ARMADA_370=y
6CONFIG_MACH_ARMADA_XP=y
7CONFIG_ARCH_HIGHBANK=y
8CONFIG_ARCH_SOCFPGA=y
9# CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set
10CONFIG_ARM_ERRATA_754322=y
11CONFIG_SMP=y
12CONFIG_ARM_ARCH_TIMER=y
13CONFIG_AEABI=y
14CONFIG_HIGHMEM=y
15CONFIG_HIGHPTE=y
16CONFIG_ARM_APPENDED_DTB=y
17CONFIG_VFP=y
18CONFIG_NEON=y
19CONFIG_NET=y
20CONFIG_ATA=y
21CONFIG_SATA_HIGHBANK=y
22CONFIG_NETDEVICES=y
23CONFIG_NET_CALXEDA_XGMAC=y
24CONFIG_SMSC911X=y
25CONFIG_STMMAC_ETH=y
26CONFIG_SERIO_AMBAKMI=y
27CONFIG_SERIAL_8250=y
28CONFIG_SERIAL_8250_CONSOLE=y
29CONFIG_SERIAL_8250_DW=y
30CONFIG_SERIAL_AMBA_PL011=y
31CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
32CONFIG_SERIAL_OF_PLATFORM=y
33CONFIG_IPMI_HANDLER=y
34CONFIG_IPMI_SI=y
35CONFIG_I2C=y
36CONFIG_I2C_DESIGNWARE_PLATFORM=y
37CONFIG_SPI=y
38CONFIG_SPI_PL022=y
39CONFIG_GPIOLIB=y
40CONFIG_FB=y
41CONFIG_FB_ARMCLCD=y
42CONFIG_FRAMEBUFFER_CONSOLE=y
43CONFIG_USB=y
44CONFIG_USB_ISP1760_HCD=y
45CONFIG_USB_STORAGE=y
46CONFIG_MMC=y
47CONFIG_MMC_ARMMMCI=y
48CONFIG_MMC_SDHCI=y
49CONFIG_MMC_SDHCI_PLTFM=y
50CONFIG_EDAC=y
51CONFIG_EDAC_MM_EDAC=y
52CONFIG_EDAC_HIGHBANK_MC=y
53CONFIG_EDAC_HIGHBANK_L2=y
54CONFIG_RTC_CLASS=y
55CONFIG_RTC_DRV_PL031=y
56CONFIG_DMADEVICES=y
57CONFIG_PL330_DMA=y
diff --git a/arch/arm/configs/mv78xx0_defconfig b/arch/arm/configs/mv78xx0_defconfig
index 7305ebddb51..1f08219c1b3 100644
--- a/arch/arm/configs/mv78xx0_defconfig
+++ b/arch/arm/configs/mv78xx0_defconfig
@@ -49,7 +49,6 @@ CONFIG_MTD_CFI_INTELEXT=y
49CONFIG_MTD_CFI_AMDSTD=y 49CONFIG_MTD_CFI_AMDSTD=y
50CONFIG_MTD_PHYSMAP=y 50CONFIG_MTD_PHYSMAP=y
51CONFIG_MTD_NAND=y 51CONFIG_MTD_NAND=y
52CONFIG_MTD_NAND_VERIFY_WRITE=y
53CONFIG_MTD_NAND_ORION=y 52CONFIG_MTD_NAND_ORION=y
54CONFIG_BLK_DEV_LOOP=y 53CONFIG_BLK_DEV_LOOP=y
55# CONFIG_SCSI_PROC_FS is not set 54# CONFIG_SCSI_PROC_FS is not set
diff --git a/arch/arm/configs/mvebu_defconfig b/arch/arm/configs/mvebu_defconfig
index 2e86b31c33c..7bcf850eddc 100644
--- a/arch/arm/configs/mvebu_defconfig
+++ b/arch/arm/configs/mvebu_defconfig
@@ -21,6 +21,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
21CONFIG_SERIAL_8250=y 21CONFIG_SERIAL_8250=y
22CONFIG_SERIAL_8250_CONSOLE=y 22CONFIG_SERIAL_8250_CONSOLE=y
23CONFIG_SERIAL_OF_PLATFORM=y 23CONFIG_SERIAL_OF_PLATFORM=y
24CONFIG_GPIOLIB=y
25CONFIG_GPIO_SYSFS=y
24CONFIG_EXT2_FS=y 26CONFIG_EXT2_FS=y
25CONFIG_EXT3_FS=y 27CONFIG_EXT3_FS=y
26# CONFIG_EXT3_FS_XATTR is not set 28# CONFIG_EXT3_FS_XATTR is not set
diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig
index 4edcfb4e4de..048aaca6081 100644
--- a/arch/arm/configs/mxs_defconfig
+++ b/arch/arm/configs/mxs_defconfig
@@ -23,12 +23,6 @@ CONFIG_BLK_DEV_INTEGRITY=y
23# CONFIG_IOSCHED_CFQ is not set 23# CONFIG_IOSCHED_CFQ is not set
24CONFIG_ARCH_MXS=y 24CONFIG_ARCH_MXS=y
25CONFIG_MACH_MXS_DT=y 25CONFIG_MACH_MXS_DT=y
26CONFIG_MACH_MX23EVK=y
27CONFIG_MACH_MX28EVK=y
28CONFIG_MACH_STMP378X_DEVB=y
29CONFIG_MACH_TX28=y
30CONFIG_MACH_M28EVK=y
31CONFIG_MACH_APX4DEVKIT=y
32# CONFIG_ARM_THUMB is not set 26# CONFIG_ARM_THUMB is not set
33CONFIG_NO_HZ=y 27CONFIG_NO_HZ=y
34CONFIG_HIGH_RES_TIMERS=y 28CONFIG_HIGH_RES_TIMERS=y
@@ -59,6 +53,9 @@ CONFIG_DEVTMPFS=y
59# CONFIG_FIRMWARE_IN_KERNEL is not set 53# CONFIG_FIRMWARE_IN_KERNEL is not set
60# CONFIG_BLK_DEV is not set 54# CONFIG_BLK_DEV is not set
61CONFIG_MTD=y 55CONFIG_MTD=y
56CONFIG_MTD_CHAR=y
57CONFIG_MTD_DATAFLASH=y
58CONFIG_MTD_M25P80
62CONFIG_MTD_NAND=y 59CONFIG_MTD_NAND=y
63CONFIG_MTD_NAND_GPMI_NAND=y 60CONFIG_MTD_NAND_GPMI_NAND=y
64CONFIG_NETDEVICES=y 61CONFIG_NETDEVICES=y
@@ -88,13 +85,13 @@ CONFIG_I2C_CHARDEV=y
88CONFIG_I2C_MXS=y 85CONFIG_I2C_MXS=y
89CONFIG_SPI=y 86CONFIG_SPI=y
90CONFIG_SPI_GPIO=m 87CONFIG_SPI_GPIO=m
88CONFIG_SPI_MXS=y
91CONFIG_DEBUG_GPIO=y 89CONFIG_DEBUG_GPIO=y
92CONFIG_GPIO_SYSFS=y 90CONFIG_GPIO_SYSFS=y
93# CONFIG_HWMON is not set 91# CONFIG_HWMON is not set
94# CONFIG_MFD_SUPPORT is not set 92# CONFIG_MFD_SUPPORT is not set
95CONFIG_DISPLAY_SUPPORT=m 93CONFIG_DISPLAY_SUPPORT=m
96# CONFIG_HID_SUPPORT is not set 94# CONFIG_HID_SUPPORT is not set
97# CONFIG_USB_SUPPORT is not set
98CONFIG_SOUND=y 95CONFIG_SOUND=y
99CONFIG_SND=y 96CONFIG_SND=y
100CONFIG_SND_TIMER=y 97CONFIG_SND_TIMER=y
@@ -109,14 +106,45 @@ CONFIG_SND_SOC_I2C_AND_SPI=y
109CONFIG_SND_SOC_SGTL5000=y 106CONFIG_SND_SOC_SGTL5000=y
110CONFIG_REGULATOR=y 107CONFIG_REGULATOR=y
111CONFIG_REGULATOR_FIXED_VOLTAGE=y 108CONFIG_REGULATOR_FIXED_VOLTAGE=y
109CONFIG_FB=y
110CONFIG_FB_MXS=y
111CONFIG_BACKLIGHT_LCD_SUPPORT=y
112CONFIG_LCD_CLASS_DEVICE=y
113CONFIG_BACKLIGHT_CLASS_DEVICE=y
114CONFIG_BACKLIGHT_PWM=y
115CONFIG_FRAMEBUFFER_CONSOLE=y
116CONFIG_FONTS=y
117CONFIG_LOGO=y
118CONFIG_USB=y
119CONFIG_USB_CHIPIDEA=y
120CONFIG_USB_CHIPIDEA_HOST=y
121CONFIG_USB_STORAGE=y
122CONFIG_USB_MXS_PHY=y
123CONFIG_SCSI=y
124CONFIG_BLK_DEV_SD=y
112CONFIG_MMC=y 125CONFIG_MMC=y
113CONFIG_MMC_MXS=y 126CONFIG_MMC_MXS=y
127CONFIG_NEW_LEDS=y
128CONFIG_LEDS_CLASS=y
129CONFIG_LEDS_GPIO=y
130CONFIG_LEDS_TRIGGERS=y
131CONFIG_LEDS_TRIGGER_TIMER=y
132CONFIG_LEDS_TRIGGER_ONESHOT=y
133CONFIG_LEDS_TRIGGER_HEARTBEAT=y
134CONFIG_LEDS_TRIGGER_BACKLIGHT=y
135CONFIG_LEDS_TRIGGER_GPIO=y
114CONFIG_RTC_CLASS=y 136CONFIG_RTC_CLASS=y
115CONFIG_RTC_DRV_DS1307=m 137CONFIG_RTC_DRV_DS1307=m
116CONFIG_RTC_DRV_STMP=y 138CONFIG_RTC_DRV_STMP=y
117CONFIG_DMADEVICES=y 139CONFIG_DMADEVICES=y
118CONFIG_MXS_DMA=y 140CONFIG_MXS_DMA=y
141CONFIG_STAGING=y
142CONFIG_MXS_LRADC=y
143CONFIG_IIO_SYSFS_TRIGGER=y
119CONFIG_COMMON_CLK_DEBUG=y 144CONFIG_COMMON_CLK_DEBUG=y
145CONFIG_IIO=y
146CONFIG_PWM=y
147CONFIG_PWM_MXS=y
120CONFIG_EXT3_FS=y 148CONFIG_EXT3_FS=y
121# CONFIG_DNOTIFY is not set 149# CONFIG_DNOTIFY is not set
122CONFIG_FSCACHE=m 150CONFIG_FSCACHE=m
diff --git a/arch/arm/configs/nhk8815_defconfig b/arch/arm/configs/nhk8815_defconfig
index bf123c5384d..240b25eea56 100644
--- a/arch/arm/configs/nhk8815_defconfig
+++ b/arch/arm/configs/nhk8815_defconfig
@@ -57,7 +57,6 @@ CONFIG_MTD_CHAR=y
57CONFIG_MTD_BLOCK=y 57CONFIG_MTD_BLOCK=y
58CONFIG_MTD_NAND=y 58CONFIG_MTD_NAND=y
59CONFIG_MTD_NAND_ECC_SMC=y 59CONFIG_MTD_NAND_ECC_SMC=y
60CONFIG_MTD_NAND_VERIFY_WRITE=y
61CONFIG_MTD_NAND_NOMADIK=y 60CONFIG_MTD_NAND_NOMADIK=y
62CONFIG_MTD_ONENAND=y 61CONFIG_MTD_ONENAND=y
63CONFIG_MTD_ONENAND_VERIFY_WRITE=y 62CONFIG_MTD_ONENAND_VERIFY_WRITE=y
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index e58edc36b40..62303043db9 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -123,6 +123,7 @@ CONFIG_HW_RANDOM=y
123CONFIG_I2C_CHARDEV=y 123CONFIG_I2C_CHARDEV=y
124CONFIG_SPI=y 124CONFIG_SPI=y
125CONFIG_SPI_OMAP24XX=y 125CONFIG_SPI_OMAP24XX=y
126CONFIG_PINCTRL_SINGLE=y
126CONFIG_DEBUG_GPIO=y 127CONFIG_DEBUG_GPIO=y
127CONFIG_GPIO_SYSFS=y 128CONFIG_GPIO_SYSFS=y
128CONFIG_GPIO_TWL4030=y 129CONFIG_GPIO_TWL4030=y
diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig
index a288d703395..cd5e6ba9a54 100644
--- a/arch/arm/configs/orion5x_defconfig
+++ b/arch/arm/configs/orion5x_defconfig
@@ -72,7 +72,6 @@ CONFIG_MTD_CFI_INTELEXT=y
72CONFIG_MTD_CFI_AMDSTD=y 72CONFIG_MTD_CFI_AMDSTD=y
73CONFIG_MTD_PHYSMAP=y 73CONFIG_MTD_PHYSMAP=y
74CONFIG_MTD_NAND=y 74CONFIG_MTD_NAND=y
75CONFIG_MTD_NAND_VERIFY_WRITE=y
76CONFIG_MTD_NAND_PLATFORM=y 75CONFIG_MTD_NAND_PLATFORM=y
77CONFIG_MTD_NAND_ORION=y 76CONFIG_MTD_NAND_ORION=y
78CONFIG_BLK_DEV_LOOP=y 77CONFIG_BLK_DEV_LOOP=y
diff --git a/arch/arm/configs/pnx4008_defconfig b/arch/arm/configs/pnx4008_defconfig
deleted file mode 100644
index 35a31ccacc3..00000000000
--- a/arch/arm/configs/pnx4008_defconfig
+++ /dev/null
@@ -1,472 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_BSD_PROCESS_ACCT=y
5CONFIG_AUDIT=y
6CONFIG_LOG_BUF_SHIFT=14
7CONFIG_BLK_DEV_INITRD=y
8CONFIG_EXPERT=y
9CONFIG_SLAB=y
10CONFIG_MODULES=y
11CONFIG_MODULE_UNLOAD=y
12CONFIG_MODULE_FORCE_UNLOAD=y
13CONFIG_MODVERSIONS=y
14CONFIG_MODULE_SRCVERSION_ALL=y
15CONFIG_ARCH_PNX4008=y
16CONFIG_PREEMPT=y
17CONFIG_ZBOOT_ROM_TEXT=0x0
18CONFIG_ZBOOT_ROM_BSS=0x0
19CONFIG_CMDLINE="mem=64M console=ttyS0,115200"
20CONFIG_FPE_NWFPE=y
21CONFIG_BINFMT_AOUT=m
22CONFIG_BINFMT_MISC=m
23CONFIG_PM=y
24CONFIG_PACKET=y
25CONFIG_UNIX=y
26CONFIG_INET=y
27CONFIG_IP_MULTICAST=y
28CONFIG_IP_ADVANCED_ROUTER=y
29CONFIG_IP_MULTIPLE_TABLES=y
30CONFIG_IP_ROUTE_MULTIPATH=y
31CONFIG_IP_ROUTE_VERBOSE=y
32CONFIG_IP_PNP=y
33CONFIG_IP_PNP_DHCP=y
34CONFIG_IP_PNP_BOOTP=y
35CONFIG_IP_MROUTE=y
36CONFIG_IP_PIMSM_V1=y
37CONFIG_IP_PIMSM_V2=y
38CONFIG_SYN_COOKIES=y
39CONFIG_INET_AH=m
40CONFIG_INET_ESP=m
41CONFIG_INET_IPCOMP=m
42CONFIG_IPV6_PRIVACY=y
43CONFIG_INET6_AH=m
44CONFIG_INET6_ESP=m
45CONFIG_INET6_IPCOMP=m
46CONFIG_IPV6_TUNNEL=m
47CONFIG_NETFILTER=y
48CONFIG_IP_VS=m
49CONFIG_IP_VS_PROTO_TCP=y
50CONFIG_IP_VS_PROTO_UDP=y
51CONFIG_IP_VS_PROTO_ESP=y
52CONFIG_IP_VS_PROTO_AH=y
53CONFIG_IP_VS_RR=m
54CONFIG_IP_VS_WRR=m
55CONFIG_IP_VS_LC=m
56CONFIG_IP_VS_WLC=m
57CONFIG_IP_VS_LBLC=m
58CONFIG_IP_VS_LBLCR=m
59CONFIG_IP_VS_DH=m
60CONFIG_IP_VS_SH=m
61CONFIG_IP_VS_SED=m
62CONFIG_IP_VS_NQ=m
63CONFIG_IP_VS_FTP=m
64CONFIG_IP_NF_QUEUE=m
65CONFIG_IP6_NF_QUEUE=m
66CONFIG_DECNET_NF_GRABULATOR=m
67CONFIG_BRIDGE_NF_EBTABLES=m
68CONFIG_BRIDGE_EBT_BROUTE=m
69CONFIG_BRIDGE_EBT_T_FILTER=m
70CONFIG_BRIDGE_EBT_T_NAT=m
71CONFIG_BRIDGE_EBT_802_3=m
72CONFIG_BRIDGE_EBT_AMONG=m
73CONFIG_BRIDGE_EBT_ARP=m
74CONFIG_BRIDGE_EBT_IP=m
75CONFIG_BRIDGE_EBT_LIMIT=m
76CONFIG_BRIDGE_EBT_MARK=m
77CONFIG_BRIDGE_EBT_PKTTYPE=m
78CONFIG_BRIDGE_EBT_STP=m
79CONFIG_BRIDGE_EBT_VLAN=m
80CONFIG_BRIDGE_EBT_ARPREPLY=m
81CONFIG_BRIDGE_EBT_DNAT=m
82CONFIG_BRIDGE_EBT_MARK_T=m
83CONFIG_BRIDGE_EBT_REDIRECT=m
84CONFIG_BRIDGE_EBT_SNAT=m
85CONFIG_BRIDGE_EBT_LOG=m
86CONFIG_IP_SCTP=m
87CONFIG_ATM=y
88CONFIG_ATM_CLIP=y
89CONFIG_ATM_LANE=m
90CONFIG_ATM_MPOA=m
91CONFIG_ATM_BR2684=m
92CONFIG_BRIDGE=m
93CONFIG_VLAN_8021Q=m
94CONFIG_DECNET=m
95CONFIG_LLC2=m
96CONFIG_IPX=m
97CONFIG_ATALK=m
98CONFIG_DEV_APPLETALK=m
99CONFIG_IPDDP=m
100CONFIG_IPDDP_ENCAP=y
101CONFIG_IPDDP_DECAP=y
102CONFIG_X25=m
103CONFIG_LAPB=m
104CONFIG_ECONET=m
105CONFIG_ECONET_AUNUDP=y
106CONFIG_ECONET_NATIVE=y
107CONFIG_WAN_ROUTER=m
108CONFIG_NET_SCHED=y
109CONFIG_NET_SCH_CBQ=m
110CONFIG_NET_SCH_HTB=m
111CONFIG_NET_SCH_HFSC=m
112CONFIG_NET_SCH_ATM=m
113CONFIG_NET_SCH_PRIO=m
114CONFIG_NET_SCH_RED=m
115CONFIG_NET_SCH_SFQ=m
116CONFIG_NET_SCH_TEQL=m
117CONFIG_NET_SCH_TBF=m
118CONFIG_NET_SCH_GRED=m
119CONFIG_NET_SCH_DSMARK=m
120CONFIG_NET_SCH_NETEM=m
121CONFIG_NET_CLS_TCINDEX=m
122CONFIG_NET_CLS_ROUTE4=m
123CONFIG_NET_CLS_FW=m
124CONFIG_NET_CLS_U32=m
125CONFIG_NET_CLS_RSVP=m
126CONFIG_NET_CLS_RSVP6=m
127CONFIG_NET_PKTGEN=m
128CONFIG_MTD=y
129CONFIG_MTD_CONCAT=y
130CONFIG_MTD_PARTITIONS=y
131CONFIG_MTD_REDBOOT_PARTS=y
132CONFIG_MTD_CHAR=y
133CONFIG_MTD_BLOCK=y
134CONFIG_MTD_SLRAM=m
135CONFIG_MTD_PHRAM=m
136CONFIG_MTD_MTDRAM=m
137CONFIG_MTD_DOC2000=m
138CONFIG_MTD_DOC2001=m
139CONFIG_MTD_DOC2001PLUS=m
140CONFIG_MTD_NAND=y
141CONFIG_MTD_NAND_NANDSIM=m
142CONFIG_BLK_DEV_LOOP=y
143CONFIG_BLK_DEV_CRYPTOLOOP=y
144CONFIG_BLK_DEV_NBD=y
145CONFIG_BLK_DEV_RAM=y
146CONFIG_BLK_DEV_RAM_SIZE=8192
147CONFIG_CDROM_PKTCDVD=m
148CONFIG_EEPROM_LEGACY=m
149CONFIG_SCSI=m
150CONFIG_BLK_DEV_SD=m
151CONFIG_CHR_DEV_ST=m
152CONFIG_CHR_DEV_OSST=m
153CONFIG_BLK_DEV_SR=m
154CONFIG_CHR_DEV_SG=m
155CONFIG_CHR_DEV_SCH=m
156CONFIG_SCSI_MULTI_LUN=y
157CONFIG_SCSI_CONSTANTS=y
158CONFIG_SCSI_LOGGING=y
159CONFIG_SCSI_SPI_ATTRS=m
160CONFIG_SCSI_FC_ATTRS=m
161CONFIG_SCSI_DEBUG=m
162CONFIG_NETDEVICES=y
163CONFIG_DUMMY=m
164CONFIG_BONDING=m
165CONFIG_EQUALIZER=m
166CONFIG_TUN=m
167CONFIG_NET_ETHERNET=y
168CONFIG_USB_CATC=m
169CONFIG_USB_KAWETH=m
170CONFIG_USB_PEGASUS=m
171CONFIG_USB_RTL8150=m
172CONFIG_USB_USBNET=m
173# CONFIG_USB_NET_CDC_SUBSET is not set
174CONFIG_WAN=y
175CONFIG_HDLC=m
176CONFIG_HDLC_RAW=m
177CONFIG_HDLC_RAW_ETH=m
178CONFIG_HDLC_CISCO=m
179CONFIG_HDLC_FR=m
180CONFIG_HDLC_PPP=m
181CONFIG_HDLC_X25=m
182CONFIG_DLCI=m
183CONFIG_WAN_ROUTER_DRIVERS=m
184CONFIG_LAPBETHER=m
185CONFIG_X25_ASY=m
186CONFIG_ATM_TCP=m
187CONFIG_PPP=m
188CONFIG_PPP_MULTILINK=y
189CONFIG_PPP_FILTER=y
190CONFIG_PPP_ASYNC=m
191CONFIG_PPP_SYNC_TTY=m
192CONFIG_PPP_DEFLATE=m
193CONFIG_PPP_BSDCOMP=m
194CONFIG_PPP_MPPE=m
195CONFIG_PPPOE=m
196CONFIG_PPPOATM=m
197CONFIG_SLIP=m
198CONFIG_SLIP_COMPRESSED=y
199CONFIG_SLIP_SMART=y
200CONFIG_SLIP_MODE_SLIP6=y
201CONFIG_NETCONSOLE=m
202# CONFIG_INPUT_MOUSEDEV is not set
203CONFIG_INPUT_JOYDEV=m
204CONFIG_INPUT_EVDEV=m
205CONFIG_INPUT_EVBUG=m
206CONFIG_KEYBOARD_LKKBD=m
207CONFIG_KEYBOARD_NEWTON=m
208CONFIG_KEYBOARD_SUNKBD=m
209CONFIG_KEYBOARD_XTKBD=m
210CONFIG_MOUSE_PS2=m
211CONFIG_MOUSE_SERIAL=m
212CONFIG_MOUSE_VSXXXAA=m
213CONFIG_INPUT_JOYSTICK=y
214CONFIG_JOYSTICK_ANALOG=m
215CONFIG_JOYSTICK_A3D=m
216CONFIG_JOYSTICK_ADI=m
217CONFIG_JOYSTICK_COBRA=m
218CONFIG_JOYSTICK_GF2K=m
219CONFIG_JOYSTICK_GRIP=m
220CONFIG_JOYSTICK_GRIP_MP=m
221CONFIG_JOYSTICK_GUILLEMOT=m
222CONFIG_JOYSTICK_INTERACT=m
223CONFIG_JOYSTICK_SIDEWINDER=m
224CONFIG_JOYSTICK_TMDC=m
225CONFIG_JOYSTICK_IFORCE=m
226CONFIG_JOYSTICK_IFORCE_USB=y
227CONFIG_JOYSTICK_IFORCE_232=y
228CONFIG_JOYSTICK_WARRIOR=m
229CONFIG_JOYSTICK_MAGELLAN=m
230CONFIG_JOYSTICK_SPACEORB=m
231CONFIG_JOYSTICK_SPACEBALL=m
232CONFIG_JOYSTICK_STINGER=m
233CONFIG_JOYSTICK_JOYDUMP=m
234CONFIG_INPUT_TOUCHSCREEN=y
235CONFIG_TOUCHSCREEN_GUNZE=m
236CONFIG_INPUT_MISC=y
237CONFIG_INPUT_UINPUT=m
238CONFIG_SERIO_SERPORT=m
239CONFIG_SERIO_RAW=m
240CONFIG_GAMEPORT_NS558=m
241CONFIG_GAMEPORT_L4=m
242CONFIG_SERIAL_8250=y
243CONFIG_SERIAL_8250_CONSOLE=y
244CONFIG_SERIAL_8250_EXTENDED=y
245CONFIG_SERIAL_8250_MANY_PORTS=y
246CONFIG_SERIAL_8250_SHARE_IRQ=y
247CONFIG_SERIAL_8250_RSA=y
248CONFIG_HW_RANDOM=y
249CONFIG_I2C=y
250CONFIG_I2C_CHARDEV=y
251CONFIG_SPI=y
252CONFIG_SPI_BITBANG=y
253# CONFIG_HWMON is not set
254CONFIG_WATCHDOG=y
255CONFIG_SOFT_WATCHDOG=m
256CONFIG_USBPCWATCHDOG=m
257# CONFIG_VGA_CONSOLE is not set
258CONFIG_SOUND=m
259CONFIG_SND=m
260CONFIG_SND_SEQUENCER=m
261CONFIG_SND_SEQ_DUMMY=m
262CONFIG_SND_MIXER_OSS=m
263CONFIG_SND_PCM_OSS=m
264CONFIG_SND_SEQUENCER_OSS=y
265CONFIG_SND_DUMMY=m
266CONFIG_SND_VIRMIDI=m
267CONFIG_SND_MTPAV=m
268CONFIG_SND_SERIAL_U16550=m
269CONFIG_SND_MPU401=m
270CONFIG_SND_USB_AUDIO=m
271CONFIG_SOUND_PRIME=m
272CONFIG_USB_HID=m
273CONFIG_USB_HIDDEV=y
274CONFIG_USB_KBD=m
275CONFIG_USB_MOUSE=m
276CONFIG_USB=y
277CONFIG_USB_DEVICEFS=y
278CONFIG_USB_MON=y
279CONFIG_USB_SL811_HCD=m
280CONFIG_USB_ACM=m
281CONFIG_USB_PRINTER=m
282CONFIG_USB_STORAGE=m
283CONFIG_USB_STORAGE_DATAFAB=m
284CONFIG_USB_STORAGE_FREECOM=m
285CONFIG_USB_STORAGE_USBAT=m
286CONFIG_USB_STORAGE_SDDR09=m
287CONFIG_USB_STORAGE_SDDR55=m
288CONFIG_USB_STORAGE_JUMPSHOT=m
289CONFIG_USB_MDC800=m
290CONFIG_USB_MICROTEK=m
291CONFIG_USB_SERIAL=m
292CONFIG_USB_SERIAL_GENERIC=y
293CONFIG_USB_SERIAL_BELKIN=m
294CONFIG_USB_SERIAL_WHITEHEAT=m
295CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
296CONFIG_USB_SERIAL_CYPRESS_M8=m
297CONFIG_USB_SERIAL_EMPEG=m
298CONFIG_USB_SERIAL_FTDI_SIO=m
299CONFIG_USB_SERIAL_VISOR=m
300CONFIG_USB_SERIAL_IPAQ=m
301CONFIG_USB_SERIAL_IR=m
302CONFIG_USB_SERIAL_EDGEPORT=m
303CONFIG_USB_SERIAL_EDGEPORT_TI=m
304CONFIG_USB_SERIAL_IPW=m
305CONFIG_USB_SERIAL_KEYSPAN_PDA=m
306CONFIG_USB_SERIAL_KEYSPAN=m
307CONFIG_USB_SERIAL_KLSI=m
308CONFIG_USB_SERIAL_KOBIL_SCT=m
309CONFIG_USB_SERIAL_MCT_U232=m
310CONFIG_USB_SERIAL_PL2303=m
311CONFIG_USB_SERIAL_SAFE=m
312CONFIG_USB_SERIAL_CYBERJACK=m
313CONFIG_USB_SERIAL_XIRCOM=m
314CONFIG_USB_SERIAL_OMNINET=m
315CONFIG_USB_RIO500=m
316CONFIG_USB_LEGOTOWER=m
317CONFIG_USB_LCD=m
318CONFIG_USB_LED=m
319CONFIG_USB_CYTHERM=m
320CONFIG_USB_TEST=m
321CONFIG_USB_ATM=m
322CONFIG_USB_SPEEDTOUCH=m
323CONFIG_USB_GADGET=m
324CONFIG_USB_GADGET_DUMMY_HCD=y
325CONFIG_USB_ZERO=m
326CONFIG_USB_ETH=m
327CONFIG_USB_GADGETFS=m
328CONFIG_USB_FILE_STORAGE=m
329CONFIG_USB_G_SERIAL=m
330CONFIG_MMC=m
331CONFIG_EXT2_FS=y
332CONFIG_EXT2_FS_XATTR=y
333CONFIG_EXT2_FS_POSIX_ACL=y
334CONFIG_EXT2_FS_SECURITY=y
335CONFIG_EXT3_FS=m
336CONFIG_EXT3_FS_POSIX_ACL=y
337CONFIG_EXT3_FS_SECURITY=y
338CONFIG_REISERFS_FS=m
339CONFIG_REISERFS_FS_XATTR=y
340CONFIG_REISERFS_FS_POSIX_ACL=y
341CONFIG_REISERFS_FS_SECURITY=y
342CONFIG_JFS_FS=m
343CONFIG_JFS_POSIX_ACL=y
344CONFIG_JFS_STATISTICS=y
345CONFIG_XFS_FS=m
346CONFIG_XFS_QUOTA=y
347CONFIG_XFS_POSIX_ACL=y
348CONFIG_XFS_RT=y
349CONFIG_INOTIFY=y
350CONFIG_QUOTA=y
351CONFIG_QFMT_V1=m
352CONFIG_QFMT_V2=m
353CONFIG_AUTOFS_FS=m
354CONFIG_AUTOFS4_FS=m
355CONFIG_ISO9660_FS=m
356CONFIG_JOLIET=y
357CONFIG_ZISOFS=y
358CONFIG_UDF_FS=m
359CONFIG_MSDOS_FS=m
360CONFIG_VFAT_FS=m
361CONFIG_NTFS_FS=m
362CONFIG_TMPFS=y
363CONFIG_ADFS_FS=m
364CONFIG_AFFS_FS=m
365CONFIG_HFS_FS=m
366CONFIG_HFSPLUS_FS=m
367CONFIG_BEFS_FS=m
368CONFIG_BFS_FS=m
369CONFIG_EFS_FS=m
370CONFIG_JFFS2_FS=m
371CONFIG_CRAMFS=y
372CONFIG_VXFS_FS=m
373CONFIG_MINIX_FS=m
374CONFIG_HPFS_FS=m
375CONFIG_QNX4FS_FS=m
376CONFIG_ROMFS_FS=m
377CONFIG_SYSV_FS=m
378CONFIG_UFS_FS=m
379CONFIG_NFS_FS=y
380CONFIG_NFS_V3=y
381CONFIG_NFS_V4=y
382CONFIG_ROOT_NFS=y
383CONFIG_NFSD=m
384CONFIG_NFSD_V4=y
385CONFIG_RPCSEC_GSS_SPKM3=m
386CONFIG_SMB_FS=m
387CONFIG_CIFS=m
388CONFIG_NCP_FS=m
389CONFIG_NCPFS_PACKET_SIGNING=y
390CONFIG_NCPFS_IOCTL_LOCKING=y
391CONFIG_NCPFS_STRONG=y
392CONFIG_NCPFS_NFS_NS=y
393CONFIG_NCPFS_OS2_NS=y
394CONFIG_NCPFS_NLS=y
395CONFIG_NCPFS_EXTRAS=y
396CONFIG_CODA_FS=m
397CONFIG_AFS_FS=m
398CONFIG_PARTITION_ADVANCED=y
399CONFIG_ACORN_PARTITION=y
400CONFIG_ACORN_PARTITION_ICS=y
401CONFIG_ACORN_PARTITION_RISCIX=y
402CONFIG_OSF_PARTITION=y
403CONFIG_AMIGA_PARTITION=y
404CONFIG_ATARI_PARTITION=y
405CONFIG_MAC_PARTITION=y
406CONFIG_BSD_DISKLABEL=y
407CONFIG_MINIX_SUBPARTITION=y
408CONFIG_SOLARIS_X86_PARTITION=y
409CONFIG_UNIXWARE_DISKLABEL=y
410CONFIG_LDM_PARTITION=y
411CONFIG_SGI_PARTITION=y
412CONFIG_ULTRIX_PARTITION=y
413CONFIG_SUN_PARTITION=y
414CONFIG_NLS_DEFAULT="cp437"
415CONFIG_NLS_CODEPAGE_437=m
416CONFIG_NLS_CODEPAGE_737=m
417CONFIG_NLS_CODEPAGE_775=m
418CONFIG_NLS_CODEPAGE_850=m
419CONFIG_NLS_CODEPAGE_852=m
420CONFIG_NLS_CODEPAGE_855=m
421CONFIG_NLS_CODEPAGE_857=m
422CONFIG_NLS_CODEPAGE_860=m
423CONFIG_NLS_CODEPAGE_861=m
424CONFIG_NLS_CODEPAGE_862=m
425CONFIG_NLS_CODEPAGE_863=m
426CONFIG_NLS_CODEPAGE_864=m
427CONFIG_NLS_CODEPAGE_865=m
428CONFIG_NLS_CODEPAGE_866=m
429CONFIG_NLS_CODEPAGE_869=m
430CONFIG_NLS_CODEPAGE_936=m
431CONFIG_NLS_CODEPAGE_950=m
432CONFIG_NLS_CODEPAGE_932=m
433CONFIG_NLS_CODEPAGE_949=m
434CONFIG_NLS_CODEPAGE_874=m
435CONFIG_NLS_ISO8859_8=m
436CONFIG_NLS_CODEPAGE_1250=m
437CONFIG_NLS_CODEPAGE_1251=m
438CONFIG_NLS_ASCII=m
439CONFIG_NLS_ISO8859_1=m
440CONFIG_NLS_ISO8859_2=m
441CONFIG_NLS_ISO8859_3=m
442CONFIG_NLS_ISO8859_4=m
443CONFIG_NLS_ISO8859_5=m
444CONFIG_NLS_ISO8859_6=m
445CONFIG_NLS_ISO8859_7=m
446CONFIG_NLS_ISO8859_9=m
447CONFIG_NLS_ISO8859_13=m
448CONFIG_NLS_ISO8859_14=m
449CONFIG_NLS_ISO8859_15=m
450CONFIG_NLS_KOI8_R=m
451CONFIG_NLS_KOI8_U=m
452CONFIG_MAGIC_SYSRQ=y
453CONFIG_DEBUG_KERNEL=y
454CONFIG_DEBUG_MUTEXES=y
455# CONFIG_DEBUG_BUGVERBOSE is not set
456CONFIG_SECURITY=y
457CONFIG_CRYPTO_NULL=m
458CONFIG_CRYPTO_TEST=m
459CONFIG_CRYPTO_HMAC=y
460CONFIG_CRYPTO_MD4=m
461CONFIG_CRYPTO_MICHAEL_MIC=m
462CONFIG_CRYPTO_SHA256=m
463CONFIG_CRYPTO_SHA512=m
464CONFIG_CRYPTO_WP512=m
465CONFIG_CRYPTO_ANUBIS=m
466CONFIG_CRYPTO_BLOWFISH=m
467CONFIG_CRYPTO_CAST6=m
468CONFIG_CRYPTO_KHAZAD=m
469CONFIG_CRYPTO_SERPENT=m
470CONFIG_CRYPTO_TEA=m
471CONFIG_CRYPTO_TWOFISH=m
472CONFIG_CRC16=m
diff --git a/arch/arm/configs/prima2_defconfig b/arch/arm/configs/prima2_defconfig
index c328ac65479..807d4e2acb1 100644
--- a/arch/arm/configs/prima2_defconfig
+++ b/arch/arm/configs/prima2_defconfig
@@ -1,4 +1,6 @@
1CONFIG_EXPERIMENTAL=y 1CONFIG_EXPERIMENTAL=y
2CONFIG_NO_HZ=y
3CONFIG_HIGH_RES_TIMERS=y
2CONFIG_RELAY=y 4CONFIG_RELAY=y
3CONFIG_BLK_DEV_INITRD=y 5CONFIG_BLK_DEV_INITRD=y
4CONFIG_KALLSYMS_ALL=y 6CONFIG_KALLSYMS_ALL=y
@@ -8,9 +10,7 @@ CONFIG_MODULE_UNLOAD=y
8CONFIG_PARTITION_ADVANCED=y 10CONFIG_PARTITION_ADVANCED=y
9CONFIG_BSD_DISKLABEL=y 11CONFIG_BSD_DISKLABEL=y
10CONFIG_SOLARIS_X86_PARTITION=y 12CONFIG_SOLARIS_X86_PARTITION=y
11CONFIG_ARCH_PRIMA2=y 13CONFIG_ARCH_SIRF=y
12CONFIG_NO_HZ=y
13CONFIG_HIGH_RES_TIMERS=y
14CONFIG_PREEMPT=y 14CONFIG_PREEMPT=y
15CONFIG_AEABI=y 15CONFIG_AEABI=y
16CONFIG_KEXEC=y 16CONFIG_KEXEC=y
@@ -36,7 +36,6 @@ CONFIG_SPI=y
36CONFIG_SPI_SIRF=y 36CONFIG_SPI_SIRF=y
37CONFIG_SPI_SPIDEV=y 37CONFIG_SPI_SPIDEV=y
38# CONFIG_HWMON is not set 38# CONFIG_HWMON is not set
39# CONFIG_HID_SUPPORT is not set
40CONFIG_USB_GADGET=y 39CONFIG_USB_GADGET=y
41CONFIG_USB_FILE_STORAGE=m 40CONFIG_USB_FILE_STORAGE=m
42CONFIG_USB_MASS_STORAGE=m 41CONFIG_USB_MASS_STORAGE=m
diff --git a/arch/arm/configs/pxa3xx_defconfig b/arch/arm/configs/pxa3xx_defconfig
index 1677a0607ca..60e313834b3 100644
--- a/arch/arm/configs/pxa3xx_defconfig
+++ b/arch/arm/configs/pxa3xx_defconfig
@@ -36,7 +36,6 @@ CONFIG_MTD_CONCAT=y
36CONFIG_MTD_CHAR=y 36CONFIG_MTD_CHAR=y
37CONFIG_MTD_BLOCK=y 37CONFIG_MTD_BLOCK=y
38CONFIG_MTD_NAND=y 38CONFIG_MTD_NAND=y
39CONFIG_MTD_NAND_VERIFY_WRITE=y
40CONFIG_MTD_NAND_PXA3xx=y 39CONFIG_MTD_NAND_PXA3xx=y
41CONFIG_MTD_NAND_PXA3xx_BUILTIN=y 40CONFIG_MTD_NAND_PXA3xx_BUILTIN=y
42CONFIG_MTD_ONENAND=y 41CONFIG_MTD_ONENAND=y
diff --git a/arch/arm/configs/pxa910_defconfig b/arch/arm/configs/pxa910_defconfig
index 1cd381e1d47..191118caa5c 100644
--- a/arch/arm/configs/pxa910_defconfig
+++ b/arch/arm/configs/pxa910_defconfig
@@ -17,7 +17,7 @@ CONFIG_PREEMPT=y
17CONFIG_AEABI=y 17CONFIG_AEABI=y
18CONFIG_ZBOOT_ROM_TEXT=0x0 18CONFIG_ZBOOT_ROM_TEXT=0x0
19CONFIG_ZBOOT_ROM_BSS=0x0 19CONFIG_ZBOOT_ROM_BSS=0x0
20CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.2.100:/nfsroot/ ip=192.168.2.101:192.168.2.100::255.255.255.0::eth0:on console=ttyS0,115200 mem=128M" 20CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.2.100:/nfsroot/ ip=192.168.2.101:192.168.2.100::255.255.255.0::eth0:on console=ttyS0,115200 mem=128M earlyprintk"
21CONFIG_FPE_NWFPE=y 21CONFIG_FPE_NWFPE=y
22CONFIG_NET=y 22CONFIG_NET=y
23CONFIG_PACKET=y 23CONFIG_PACKET=y
@@ -66,5 +66,7 @@ CONFIG_DEBUG_INFO=y
66CONFIG_DEBUG_USER=y 66CONFIG_DEBUG_USER=y
67CONFIG_DEBUG_ERRORS=y 67CONFIG_DEBUG_ERRORS=y
68CONFIG_DEBUG_LL=y 68CONFIG_DEBUG_LL=y
69CONFIG_DEBUG_MMP_UART2=y
70CONFIG_EARLY_PRINTK=y
69# CONFIG_CRYPTO_ANSI_CPRNG is not set 71# CONFIG_CRYPTO_ANSI_CPRNG is not set
70CONFIG_CRC_CCITT=y 72CONFIG_CRC_CCITT=y
diff --git a/arch/arm/configs/qil-a9260_defconfig b/arch/arm/configs/qil-a9260_defconfig
index 9160f3b7751..42d5db1876a 100644
--- a/arch/arm/configs/qil-a9260_defconfig
+++ b/arch/arm/configs/qil-a9260_defconfig
@@ -50,7 +50,6 @@ CONFIG_MTD_BLOCK=y
50CONFIG_MTD_DATAFLASH=y 50CONFIG_MTD_DATAFLASH=y
51CONFIG_MTD_NAND=y 51CONFIG_MTD_NAND=y
52CONFIG_MTD_NAND_ATMEL=y 52CONFIG_MTD_NAND_ATMEL=y
53CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
54CONFIG_BLK_DEV_LOOP=y 53CONFIG_BLK_DEV_LOOP=y
55# CONFIG_MISC_DEVICES is not set 54# CONFIG_MISC_DEVICES is not set
56CONFIG_SCSI=y 55CONFIG_SCSI=y
@@ -87,7 +86,7 @@ CONFIG_USB_STORAGE=y
87CONFIG_USB_GADGET=y 86CONFIG_USB_GADGET=y
88CONFIG_USB_ETH=m 87CONFIG_USB_ETH=m
89CONFIG_MMC=y 88CONFIG_MMC=y
90CONFIG_MMC_AT91=m 89CONFIG_MMC_ATMELMCI=m
91CONFIG_NEW_LEDS=y 90CONFIG_NEW_LEDS=y
92CONFIG_LEDS_CLASS=y 91CONFIG_LEDS_CLASS=y
93CONFIG_LEDS_GPIO=y 92CONFIG_LEDS_GPIO=y
diff --git a/arch/arm/configs/s3c6400_defconfig b/arch/arm/configs/s3c6400_defconfig
index ba6a515086b..3a186d653da 100644
--- a/arch/arm/configs/s3c6400_defconfig
+++ b/arch/arm/configs/s3c6400_defconfig
@@ -9,11 +9,14 @@ CONFIG_ARCH_S3C64XX=y
9CONFIG_S3C_BOOT_ERROR_RESET=y 9CONFIG_S3C_BOOT_ERROR_RESET=y
10CONFIG_MACH_SMDK6400=y 10CONFIG_MACH_SMDK6400=y
11CONFIG_MACH_ANW6410=y 11CONFIG_MACH_ANW6410=y
12CONFIG_MACH_MINI6410=y
13CONFIG_MACH_REAL6410=y
12CONFIG_MACH_SMDK6410=y 14CONFIG_MACH_SMDK6410=y
13CONFIG_MACH_NCP=y 15CONFIG_MACH_NCP=y
14CONFIG_MACH_HMT=y 16CONFIG_MACH_HMT=y
15CONFIG_MACH_SMARTQ5=y 17CONFIG_MACH_SMARTQ5=y
16CONFIG_MACH_SMARTQ7=y 18CONFIG_MACH_SMARTQ7=y
19CONFIG_MACH_WLF_CRAGG_6410=y
17CONFIG_CPU_32v6K=y 20CONFIG_CPU_32v6K=y
18CONFIG_AEABI=y 21CONFIG_AEABI=y
19CONFIG_CMDLINE="console=ttySAC0,115200 root=/dev/ram init=/linuxrc initrd=0x51000000,6M ramdisk_size=6144" 22CONFIG_CMDLINE="console=ttySAC0,115200 root=/dev/ram init=/linuxrc initrd=0x51000000,6M ramdisk_size=6144"
diff --git a/arch/arm/configs/sam9_l9260_defconfig b/arch/arm/configs/sam9_l9260_defconfig
index ecf2531523a..b4384af1bea 100644
--- a/arch/arm/configs/sam9_l9260_defconfig
+++ b/arch/arm/configs/sam9_l9260_defconfig
@@ -39,7 +39,7 @@ CONFIG_MTD_NAND=y
39CONFIG_MTD_NAND_ATMEL=y 39CONFIG_MTD_NAND_ATMEL=y
40CONFIG_MTD_NAND_PLATFORM=y 40CONFIG_MTD_NAND_PLATFORM=y
41CONFIG_MTD_UBI=y 41CONFIG_MTD_UBI=y
42CONFIG_MTD_UBI_BEB_RESERVE=3 42CONFIG_MTD_UBI_BEB_LIMIT=25
43CONFIG_MTD_UBI_GLUEBI=y 43CONFIG_MTD_UBI_GLUEBI=y
44CONFIG_BLK_DEV_LOOP=y 44CONFIG_BLK_DEV_LOOP=y
45CONFIG_BLK_DEV_RAM=y 45CONFIG_BLK_DEV_RAM=y
diff --git a/arch/arm/configs/spitz_defconfig b/arch/arm/configs/spitz_defconfig
index 70158273c6d..df77931a432 100644
--- a/arch/arm/configs/spitz_defconfig
+++ b/arch/arm/configs/spitz_defconfig
@@ -94,7 +94,6 @@ CONFIG_MTD_BLOCK=y
94CONFIG_MTD_ROM=y 94CONFIG_MTD_ROM=y
95CONFIG_MTD_COMPLEX_MAPPINGS=y 95CONFIG_MTD_COMPLEX_MAPPINGS=y
96CONFIG_MTD_NAND=y 96CONFIG_MTD_NAND=y
97CONFIG_MTD_NAND_VERIFY_WRITE=y
98CONFIG_MTD_NAND_SHARPSL=y 97CONFIG_MTD_NAND_SHARPSL=y
99CONFIG_BLK_DEV_LOOP=y 98CONFIG_BLK_DEV_LOOP=y
100CONFIG_IDE=y 99CONFIG_IDE=y
diff --git a/arch/arm/configs/stamp9g20_defconfig b/arch/arm/configs/stamp9g20_defconfig
index d5e260b8b16..52f1488591c 100644
--- a/arch/arm/configs/stamp9g20_defconfig
+++ b/arch/arm/configs/stamp9g20_defconfig
@@ -100,7 +100,6 @@ CONFIG_USB_ETH=m
100CONFIG_USB_FILE_STORAGE=m 100CONFIG_USB_FILE_STORAGE=m
101CONFIG_USB_G_SERIAL=m 101CONFIG_USB_G_SERIAL=m
102CONFIG_MMC=y 102CONFIG_MMC=y
103# CONFIG_MMC_AT91 is not set
104CONFIG_MMC_ATMELMCI=y 103CONFIG_MMC_ATMELMCI=y
105CONFIG_NEW_LEDS=y 104CONFIG_NEW_LEDS=y
106CONFIG_LEDS_CLASS=y 105CONFIG_LEDS_CLASS=y
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index db2245353f0..e2184f6c20b 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -24,11 +24,11 @@ CONFIG_EFI_PARTITION=y
24# CONFIG_IOSCHED_DEADLINE is not set 24# CONFIG_IOSCHED_DEADLINE is not set
25# CONFIG_IOSCHED_CFQ is not set 25# CONFIG_IOSCHED_CFQ is not set
26CONFIG_ARCH_TEGRA=y 26CONFIG_ARCH_TEGRA=y
27CONFIG_GPIO_PCA953X=y
27CONFIG_ARCH_TEGRA_2x_SOC=y 28CONFIG_ARCH_TEGRA_2x_SOC=y
28CONFIG_ARCH_TEGRA_3x_SOC=y 29CONFIG_ARCH_TEGRA_3x_SOC=y
29CONFIG_MACH_HARMONY=y 30CONFIG_TEGRA_PCI=y
30CONFIG_MACH_PAZ00=y 31CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA=y
31CONFIG_MACH_TRIMSLICE=y
32CONFIG_TEGRA_EMC_SCALING_ENABLE=y 32CONFIG_TEGRA_EMC_SCALING_ENABLE=y
33CONFIG_SMP=y 33CONFIG_SMP=y
34CONFIG_PREEMPT=y 34CONFIG_PREEMPT=y
@@ -67,7 +67,18 @@ CONFIG_INET6_IPCOMP=y
67CONFIG_IPV6_MIP6=y 67CONFIG_IPV6_MIP6=y
68CONFIG_IPV6_TUNNEL=y 68CONFIG_IPV6_TUNNEL=y
69CONFIG_IPV6_MULTIPLE_TABLES=y 69CONFIG_IPV6_MULTIPLE_TABLES=y
70# CONFIG_WIRELESS is not set 70CONFIG_BT=y
71CONFIG_BT_RFCOMM=y
72CONFIG_BT_BNEP=y
73CONFIG_BT_HIDP=y
74CONFIG_BT_HCIBTUSB=m
75CONFIG_CFG80211=y
76CONFIG_MAC80211=y
77CONFIG_RFKILL=y
78CONFIG_RFKILL_INPUT=y
79CONFIG_RFKILL_GPIO=y
80CONFIG_DEVTMPFS=y
81CONFIG_DEVTMPFS_MOUNT=y
71# CONFIG_FIRMWARE_IN_KERNEL is not set 82# CONFIG_FIRMWARE_IN_KERNEL is not set
72CONFIG_PROC_DEVICETREE=y 83CONFIG_PROC_DEVICETREE=y
73CONFIG_BLK_DEV_LOOP=y 84CONFIG_BLK_DEV_LOOP=y
@@ -87,7 +98,8 @@ CONFIG_USB_PEGASUS=y
87CONFIG_USB_USBNET=y 98CONFIG_USB_USBNET=y
88CONFIG_USB_NET_SMSC75XX=y 99CONFIG_USB_NET_SMSC75XX=y
89CONFIG_USB_NET_SMSC95XX=y 100CONFIG_USB_NET_SMSC95XX=y
90# CONFIG_WLAN is not set 101CONFIG_RT2X00=y
102CONFIG_RT2800USB=m
91CONFIG_INPUT_EVDEV=y 103CONFIG_INPUT_EVDEV=y
92CONFIG_INPUT_MISC=y 104CONFIG_INPUT_MISC=y
93CONFIG_INPUT_MPU3050=y 105CONFIG_INPUT_MPU3050=y
@@ -105,25 +117,31 @@ CONFIG_I2C_MUX_PINCTRL=y
105CONFIG_I2C_TEGRA=y 117CONFIG_I2C_TEGRA=y
106CONFIG_SPI=y 118CONFIG_SPI=y
107CONFIG_SPI_TEGRA=y 119CONFIG_SPI_TEGRA=y
108CONFIG_GPIO_TPS65910=y 120CONFIG_GPIO_PCA953X_IRQ=y
109CONFIG_GPIO_TPS6586X=y 121CONFIG_GPIO_TPS6586X=y
122CONFIG_GPIO_TPS65910=y
110CONFIG_POWER_SUPPLY=y 123CONFIG_POWER_SUPPLY=y
111CONFIG_BATTERY_SBS=y 124CONFIG_BATTERY_SBS=y
112CONFIG_SENSORS_LM90=y 125CONFIG_SENSORS_LM90=y
113CONFIG_MFD_TPS6586X=y 126CONFIG_MFD_TPS6586X=y
114CONFIG_MFD_TPS65910=y 127CONFIG_MFD_TPS65910=y
128CONFIG_MFD_MAX8907=y
115CONFIG_REGULATOR=y 129CONFIG_REGULATOR=y
116CONFIG_REGULATOR_FIXED_VOLTAGE=y 130CONFIG_REGULATOR_FIXED_VOLTAGE=y
117CONFIG_REGULATOR_VIRTUAL_CONSUMER=y 131CONFIG_REGULATOR_VIRTUAL_CONSUMER=y
118CONFIG_REGULATOR_GPIO=y 132CONFIG_REGULATOR_GPIO=y
133CONFIG_REGULATOR_MAX8907=y
119CONFIG_REGULATOR_TPS62360=y 134CONFIG_REGULATOR_TPS62360=y
120CONFIG_REGULATOR_TPS6586X=y 135CONFIG_REGULATOR_TPS6586X=y
121CONFIG_REGULATOR_TPS65910=y 136CONFIG_REGULATOR_TPS65910=y
137CONFIG_MEDIA_SUPPORT=y
138CONFIG_MEDIA_CAMERA_SUPPORT=y
139CONFIG_MEDIA_USB_SUPPORT=y
140CONFIG_USB_VIDEO_CLASS=m
122CONFIG_SOUND=y 141CONFIG_SOUND=y
123CONFIG_SND=y 142CONFIG_SND=y
124# CONFIG_SND_SUPPORT_OLD_API is not set 143# CONFIG_SND_SUPPORT_OLD_API is not set
125# CONFIG_SND_DRIVERS is not set 144# CONFIG_SND_DRIVERS is not set
126# CONFIG_SND_PCI is not set
127# CONFIG_SND_ARM is not set 145# CONFIG_SND_ARM is not set
128# CONFIG_SND_SPI is not set 146# CONFIG_SND_SPI is not set
129# CONFIG_SND_USB is not set 147# CONFIG_SND_USB is not set
@@ -136,15 +154,29 @@ CONFIG_SND_SOC_TEGRA_ALC5632=y
136CONFIG_USB=y 154CONFIG_USB=y
137CONFIG_USB_EHCI_HCD=y 155CONFIG_USB_EHCI_HCD=y
138CONFIG_USB_EHCI_TEGRA=y 156CONFIG_USB_EHCI_TEGRA=y
157CONFIG_USB_ACM=y
158CONFIG_USB_WDM=y
139CONFIG_USB_STORAGE=y 159CONFIG_USB_STORAGE=y
140CONFIG_MMC=y 160CONFIG_MMC=y
141CONFIG_MMC_BLOCK_MINORS=16 161CONFIG_MMC_BLOCK_MINORS=16
142CONFIG_MMC_SDHCI=y 162CONFIG_MMC_SDHCI=y
143CONFIG_MMC_SDHCI_PLTFM=y 163CONFIG_MMC_SDHCI_PLTFM=y
144CONFIG_MMC_SDHCI_TEGRA=y 164CONFIG_MMC_SDHCI_TEGRA=y
165CONFIG_NEW_LEDS=y
166CONFIG_LEDS_CLASS=y
167CONFIG_LEDS_GPIO=y
168CONFIG_LEDS_TRIGGERS=y
169CONFIG_LEDS_TRIGGER_GPIO=y
145CONFIG_RTC_CLASS=y 170CONFIG_RTC_CLASS=y
171CONFIG_RTC_INTF_SYSFS=y
172CONFIG_RTC_INTF_PROC=y
173CONFIG_RTC_INTF_DEV=y
174CONFIG_RTC_DRV_MAX8907=y
175CONFIG_RTC_DRV_TPS65910=y
146CONFIG_RTC_DRV_EM3027=y 176CONFIG_RTC_DRV_EM3027=y
147CONFIG_RTC_DRV_TEGRA=y 177CONFIG_RTC_DRV_TEGRA=y
178CONFIG_DMADEVICES=y
179CONFIG_TEGRA20_APB_DMA=y
148CONFIG_STAGING=y 180CONFIG_STAGING=y
149CONFIG_SENSORS_ISL29018=y 181CONFIG_SENSORS_ISL29018=y
150CONFIG_SENSORS_ISL29028=y 182CONFIG_SENSORS_ISL29028=y
@@ -152,10 +184,14 @@ CONFIG_SENSORS_AK8975=y
152CONFIG_MFD_NVEC=y 184CONFIG_MFD_NVEC=y
153CONFIG_KEYBOARD_NVEC=y 185CONFIG_KEYBOARD_NVEC=y
154CONFIG_SERIO_NVEC_PS2=y 186CONFIG_SERIO_NVEC_PS2=y
187CONFIG_NVEC_POWER=y
188CONFIG_NVEC_PAZ00=y
155CONFIG_TEGRA_IOMMU_GART=y 189CONFIG_TEGRA_IOMMU_GART=y
156CONFIG_TEGRA_IOMMU_SMMU=y 190CONFIG_TEGRA_IOMMU_SMMU=y
157CONFIG_MEMORY=y 191CONFIG_MEMORY=y
158CONFIG_IIO=y 192CONFIG_IIO=y
193CONFIG_PWM=y
194CONFIG_PWM_TEGRA=y
159CONFIG_EXT2_FS=y 195CONFIG_EXT2_FS=y
160CONFIG_EXT2_FS_XATTR=y 196CONFIG_EXT2_FS_XATTR=y
161CONFIG_EXT2_FS_POSIX_ACL=y 197CONFIG_EXT2_FS_POSIX_ACL=y
@@ -168,6 +204,7 @@ CONFIG_EXT4_FS=y
168# CONFIG_DNOTIFY is not set 204# CONFIG_DNOTIFY is not set
169CONFIG_VFAT_FS=y 205CONFIG_VFAT_FS=y
170CONFIG_TMPFS=y 206CONFIG_TMPFS=y
207CONFIG_TMPFS_POSIX_ACL=y
171CONFIG_NFS_FS=y 208CONFIG_NFS_FS=y
172CONFIG_ROOT_NFS=y 209CONFIG_ROOT_NFS=y
173CONFIG_NLS_CODEPAGE_437=y 210CONFIG_NLS_CODEPAGE_437=y
@@ -186,8 +223,6 @@ CONFIG_DEBUG_VM=y
186CONFIG_DEBUG_SG=y 223CONFIG_DEBUG_SG=y
187CONFIG_DEBUG_LL=y 224CONFIG_DEBUG_LL=y
188CONFIG_EARLY_PRINTK=y 225CONFIG_EARLY_PRINTK=y
189CONFIG_CRYPTO_ECB=y
190CONFIG_CRYPTO_ARC4=y
191CONFIG_CRYPTO_TWOFISH=y 226CONFIG_CRYPTO_TWOFISH=y
192# CONFIG_CRYPTO_ANSI_CPRNG is not set 227# CONFIG_CRYPTO_ANSI_CPRNG is not set
193CONFIG_CRYPTO_DEV_TEGRA_AES=y 228CONFIG_CRYPTO_DEV_TEGRA_AES=y
diff --git a/arch/arm/configs/usb-a9260_defconfig b/arch/arm/configs/usb-a9260_defconfig
index 2e39f38b962..a1501e1e1a9 100644
--- a/arch/arm/configs/usb-a9260_defconfig
+++ b/arch/arm/configs/usb-a9260_defconfig
@@ -49,7 +49,6 @@ CONFIG_MTD_BLOCK=y
49CONFIG_MTD_DATAFLASH=y 49CONFIG_MTD_DATAFLASH=y
50CONFIG_MTD_NAND=y 50CONFIG_MTD_NAND=y
51CONFIG_MTD_NAND_ATMEL=y 51CONFIG_MTD_NAND_ATMEL=y
52CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
53CONFIG_BLK_DEV_LOOP=y 52CONFIG_BLK_DEV_LOOP=y
54# CONFIG_MISC_DEVICES is not set 53# CONFIG_MISC_DEVICES is not set
55CONFIG_SCSI=y 54CONFIG_SCSI=y
diff --git a/arch/arm/crypto/Makefile b/arch/arm/crypto/Makefile
new file mode 100644
index 00000000000..a2c83851bc9
--- /dev/null
+++ b/arch/arm/crypto/Makefile
@@ -0,0 +1,9 @@
1#
2# Arch-specific CryptoAPI modules.
3#
4
5obj-$(CONFIG_CRYPTO_AES_ARM) += aes-arm.o
6obj-$(CONFIG_CRYPTO_SHA1_ARM) += sha1-arm.o
7
8aes-arm-y := aes-armv4.o aes_glue.o
9sha1-arm-y := sha1-armv4-large.o sha1_glue.o
diff --git a/arch/arm/crypto/aes-armv4.S b/arch/arm/crypto/aes-armv4.S
new file mode 100644
index 00000000000..e59b1d505d6
--- /dev/null
+++ b/arch/arm/crypto/aes-armv4.S
@@ -0,0 +1,1112 @@
1#define __ARM_ARCH__ __LINUX_ARM_ARCH__
2@ ====================================================================
3@ Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
4@ project. The module is, however, dual licensed under OpenSSL and
5@ CRYPTOGAMS licenses depending on where you obtain it. For further
6@ details see http://www.openssl.org/~appro/cryptogams/.
7@ ====================================================================
8
9@ AES for ARMv4
10
11@ January 2007.
12@
13@ Code uses single 1K S-box and is >2 times faster than code generated
14@ by gcc-3.4.1. This is thanks to unique feature of ARMv4 ISA, which
15@ allows to merge logical or arithmetic operation with shift or rotate
16@ in one instruction and emit combined result every cycle. The module
17@ is endian-neutral. The performance is ~42 cycles/byte for 128-bit
18@ key [on single-issue Xscale PXA250 core].
19
20@ May 2007.
21@
22@ AES_set_[en|de]crypt_key is added.
23
24@ July 2010.
25@
26@ Rescheduling for dual-issue pipeline resulted in 12% improvement on
27@ Cortex A8 core and ~25 cycles per byte processed with 128-bit key.
28
29@ February 2011.
30@
31@ Profiler-assisted and platform-specific optimization resulted in 16%
32@ improvement on Cortex A8 core and ~21.5 cycles per byte.
33
34@ A little glue here to select the correct code below for the ARM CPU
35@ that is being targetted.
36
37.text
38.code 32
39
40.type AES_Te,%object
41.align 5
42AES_Te:
43.word 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d
44.word 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554
45.word 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d
46.word 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a
47.word 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87
48.word 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b
49.word 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea
50.word 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b
51.word 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a
52.word 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f
53.word 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108
54.word 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f
55.word 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e
56.word 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5
57.word 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d
58.word 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f
59.word 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e
60.word 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb
61.word 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce
62.word 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497
63.word 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c
64.word 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed
65.word 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b
66.word 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a
67.word 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16
68.word 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594
69.word 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81
70.word 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3
71.word 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a
72.word 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504
73.word 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163
74.word 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d
75.word 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f
76.word 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739
77.word 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47
78.word 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395
79.word 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f
80.word 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883
81.word 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c
82.word 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76
83.word 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e
84.word 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4
85.word 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6
86.word 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b
87.word 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7
88.word 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0
89.word 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25
90.word 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818
91.word 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72
92.word 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651
93.word 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21
94.word 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85
95.word 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa
96.word 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12
97.word 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0
98.word 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9
99.word 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133
100.word 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7
101.word 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920
102.word 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a
103.word 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17
104.word 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8
105.word 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11
106.word 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a
107@ Te4[256]
108.byte 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5
109.byte 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76
110.byte 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0
111.byte 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0
112.byte 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc
113.byte 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15
114.byte 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a
115.byte 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75
116.byte 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0
117.byte 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84
118.byte 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b
119.byte 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf
120.byte 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85
121.byte 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8
122.byte 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5
123.byte 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2
124.byte 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17
125.byte 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73
126.byte 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88
127.byte 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb
128.byte 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c
129.byte 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79
130.byte 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9
131.byte 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08
132.byte 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6
133.byte 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a
134.byte 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e
135.byte 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e
136.byte 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94
137.byte 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf
138.byte 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68
139.byte 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
140@ rcon[]
141.word 0x01000000, 0x02000000, 0x04000000, 0x08000000
142.word 0x10000000, 0x20000000, 0x40000000, 0x80000000
143.word 0x1B000000, 0x36000000, 0, 0, 0, 0, 0, 0
144.size AES_Te,.-AES_Te
145
146@ void AES_encrypt(const unsigned char *in, unsigned char *out,
147@ const AES_KEY *key) {
148.global AES_encrypt
149.type AES_encrypt,%function
150.align 5
151AES_encrypt:
152 sub r3,pc,#8 @ AES_encrypt
153 stmdb sp!,{r1,r4-r12,lr}
154 mov r12,r0 @ inp
155 mov r11,r2
156 sub r10,r3,#AES_encrypt-AES_Te @ Te
157#if __ARM_ARCH__<7
158 ldrb r0,[r12,#3] @ load input data in endian-neutral
159 ldrb r4,[r12,#2] @ manner...
160 ldrb r5,[r12,#1]
161 ldrb r6,[r12,#0]
162 orr r0,r0,r4,lsl#8
163 ldrb r1,[r12,#7]
164 orr r0,r0,r5,lsl#16
165 ldrb r4,[r12,#6]
166 orr r0,r0,r6,lsl#24
167 ldrb r5,[r12,#5]
168 ldrb r6,[r12,#4]
169 orr r1,r1,r4,lsl#8
170 ldrb r2,[r12,#11]
171 orr r1,r1,r5,lsl#16
172 ldrb r4,[r12,#10]
173 orr r1,r1,r6,lsl#24
174 ldrb r5,[r12,#9]
175 ldrb r6,[r12,#8]
176 orr r2,r2,r4,lsl#8
177 ldrb r3,[r12,#15]
178 orr r2,r2,r5,lsl#16
179 ldrb r4,[r12,#14]
180 orr r2,r2,r6,lsl#24
181 ldrb r5,[r12,#13]
182 ldrb r6,[r12,#12]
183 orr r3,r3,r4,lsl#8
184 orr r3,r3,r5,lsl#16
185 orr r3,r3,r6,lsl#24
186#else
187 ldr r0,[r12,#0]
188 ldr r1,[r12,#4]
189 ldr r2,[r12,#8]
190 ldr r3,[r12,#12]
191#ifdef __ARMEL__
192 rev r0,r0
193 rev r1,r1
194 rev r2,r2
195 rev r3,r3
196#endif
197#endif
198 bl _armv4_AES_encrypt
199
200 ldr r12,[sp],#4 @ pop out
201#if __ARM_ARCH__>=7
202#ifdef __ARMEL__
203 rev r0,r0
204 rev r1,r1
205 rev r2,r2
206 rev r3,r3
207#endif
208 str r0,[r12,#0]
209 str r1,[r12,#4]
210 str r2,[r12,#8]
211 str r3,[r12,#12]
212#else
213 mov r4,r0,lsr#24 @ write output in endian-neutral
214 mov r5,r0,lsr#16 @ manner...
215 mov r6,r0,lsr#8
216 strb r4,[r12,#0]
217 strb r5,[r12,#1]
218 mov r4,r1,lsr#24
219 strb r6,[r12,#2]
220 mov r5,r1,lsr#16
221 strb r0,[r12,#3]
222 mov r6,r1,lsr#8
223 strb r4,[r12,#4]
224 strb r5,[r12,#5]
225 mov r4,r2,lsr#24
226 strb r6,[r12,#6]
227 mov r5,r2,lsr#16
228 strb r1,[r12,#7]
229 mov r6,r2,lsr#8
230 strb r4,[r12,#8]
231 strb r5,[r12,#9]
232 mov r4,r3,lsr#24
233 strb r6,[r12,#10]
234 mov r5,r3,lsr#16
235 strb r2,[r12,#11]
236 mov r6,r3,lsr#8
237 strb r4,[r12,#12]
238 strb r5,[r12,#13]
239 strb r6,[r12,#14]
240 strb r3,[r12,#15]
241#endif
242#if __ARM_ARCH__>=5
243 ldmia sp!,{r4-r12,pc}
244#else
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
252.type _armv4_AES_encrypt,%function
253.align 2
254_armv4_AES_encrypt:
255 str lr,[sp,#-4]! @ push lr
256 ldmia r11!,{r4-r7}
257 eor r0,r0,r4
258 ldr r12,[r11,#240-16]
259 eor r1,r1,r5
260 eor r2,r2,r6
261 eor r3,r3,r7
262 sub r12,r12,#1
263 mov lr,#255
264
265 and r7,lr,r0
266 and r8,lr,r0,lsr#8
267 and r9,lr,r0,lsr#16
268 mov r0,r0,lsr#24
269.Lenc_loop:
270 ldr r4,[r10,r7,lsl#2] @ Te3[s0>>0]
271 and r7,lr,r1,lsr#16 @ i0
272 ldr r5,[r10,r8,lsl#2] @ Te2[s0>>8]
273 and r8,lr,r1
274 ldr r6,[r10,r9,lsl#2] @ Te1[s0>>16]
275 and r9,lr,r1,lsr#8
276 ldr r0,[r10,r0,lsl#2] @ Te0[s0>>24]
277 mov r1,r1,lsr#24
278
279 ldr r7,[r10,r7,lsl#2] @ Te1[s1>>16]
280 ldr r8,[r10,r8,lsl#2] @ Te3[s1>>0]
281 ldr r9,[r10,r9,lsl#2] @ Te2[s1>>8]
282 eor r0,r0,r7,ror#8
283 ldr r1,[r10,r1,lsl#2] @ Te0[s1>>24]
284 and r7,lr,r2,lsr#8 @ i0
285 eor r5,r5,r8,ror#8
286 and r8,lr,r2,lsr#16 @ i1
287 eor r6,r6,r9,ror#8
288 and r9,lr,r2
289 ldr r7,[r10,r7,lsl#2] @ Te2[s2>>8]
290 eor r1,r1,r4,ror#24
291 ldr r8,[r10,r8,lsl#2] @ Te1[s2>>16]
292 mov r2,r2,lsr#24
293
294 ldr r9,[r10,r9,lsl#2] @ Te3[s2>>0]
295 eor r0,r0,r7,ror#16
296 ldr r2,[r10,r2,lsl#2] @ Te0[s2>>24]
297 and r7,lr,r3 @ i0
298 eor r1,r1,r8,ror#8
299 and r8,lr,r3,lsr#8 @ i1
300 eor r6,r6,r9,ror#16
301 and r9,lr,r3,lsr#16 @ i2
302 ldr r7,[r10,r7,lsl#2] @ Te3[s3>>0]
303 eor r2,r2,r5,ror#16
304 ldr r8,[r10,r8,lsl#2] @ Te2[s3>>8]
305 mov r3,r3,lsr#24
306
307 ldr r9,[r10,r9,lsl#2] @ Te1[s3>>16]
308 eor r0,r0,r7,ror#24
309 ldr r7,[r11],#16
310 eor r1,r1,r8,ror#16
311 ldr r3,[r10,r3,lsl#2] @ Te0[s3>>24]
312 eor r2,r2,r9,ror#8
313 ldr r4,[r11,#-12]
314 eor r3,r3,r6,ror#8
315
316 ldr r5,[r11,#-8]
317 eor r0,r0,r7
318 ldr r6,[r11,#-4]
319 and r7,lr,r0
320 eor r1,r1,r4
321 and r8,lr,r0,lsr#8
322 eor r2,r2,r5
323 and r9,lr,r0,lsr#16
324 eor r3,r3,r6
325 mov r0,r0,lsr#24
326
327 subs r12,r12,#1
328 bne .Lenc_loop
329
330 add r10,r10,#2
331
332 ldrb r4,[r10,r7,lsl#2] @ Te4[s0>>0]
333 and r7,lr,r1,lsr#16 @ i0
334 ldrb r5,[r10,r8,lsl#2] @ Te4[s0>>8]
335 and r8,lr,r1
336 ldrb r6,[r10,r9,lsl#2] @ Te4[s0>>16]
337 and r9,lr,r1,lsr#8
338 ldrb r0,[r10,r0,lsl#2] @ Te4[s0>>24]
339 mov r1,r1,lsr#24
340
341 ldrb r7,[r10,r7,lsl#2] @ Te4[s1>>16]
342 ldrb r8,[r10,r8,lsl#2] @ Te4[s1>>0]
343 ldrb r9,[r10,r9,lsl#2] @ Te4[s1>>8]
344 eor r0,r7,r0,lsl#8
345 ldrb r1,[r10,r1,lsl#2] @ Te4[s1>>24]
346 and r7,lr,r2,lsr#8 @ i0
347 eor r5,r8,r5,lsl#8
348 and r8,lr,r2,lsr#16 @ i1
349 eor r6,r9,r6,lsl#8
350 and r9,lr,r2
351 ldrb r7,[r10,r7,lsl#2] @ Te4[s2>>8]
352 eor r1,r4,r1,lsl#24
353 ldrb r8,[r10,r8,lsl#2] @ Te4[s2>>16]
354 mov r2,r2,lsr#24
355
356 ldrb r9,[r10,r9,lsl#2] @ Te4[s2>>0]
357 eor r0,r7,r0,lsl#8
358 ldrb r2,[r10,r2,lsl#2] @ Te4[s2>>24]
359 and r7,lr,r3 @ i0
360 eor r1,r1,r8,lsl#16
361 and r8,lr,r3,lsr#8 @ i1
362 eor r6,r9,r6,lsl#8
363 and r9,lr,r3,lsr#16 @ i2
364 ldrb r7,[r10,r7,lsl#2] @ Te4[s3>>0]
365 eor r2,r5,r2,lsl#24
366 ldrb r8,[r10,r8,lsl#2] @ Te4[s3>>8]
367 mov r3,r3,lsr#24
368
369 ldrb r9,[r10,r9,lsl#2] @ Te4[s3>>16]
370 eor r0,r7,r0,lsl#8
371 ldr r7,[r11,#0]
372 ldrb r3,[r10,r3,lsl#2] @ Te4[s3>>24]
373 eor r1,r1,r8,lsl#8
374 ldr r4,[r11,#4]
375 eor r2,r2,r9,lsl#16
376 ldr r5,[r11,#8]
377 eor r3,r6,r3,lsl#24
378 ldr r6,[r11,#12]
379
380 eor r0,r0,r7
381 eor r1,r1,r4
382 eor r2,r2,r5
383 eor r3,r3,r6
384
385 sub r10,r10,#2
386 ldr pc,[sp],#4 @ pop and return
387.size _armv4_AES_encrypt,.-_armv4_AES_encrypt
388
389.global private_AES_set_encrypt_key
390.type private_AES_set_encrypt_key,%function
391.align 5
392private_AES_set_encrypt_key:
393_armv4_AES_set_encrypt_key:
394 sub r3,pc,#8 @ AES_set_encrypt_key
395 teq r0,#0
396 moveq r0,#-1
397 beq .Labrt
398 teq r2,#0
399 moveq r0,#-1
400 beq .Labrt
401
402 teq r1,#128
403 beq .Lok
404 teq r1,#192
405 beq .Lok
406 teq r1,#256
407 movne r0,#-1
408 bne .Labrt
409
410.Lok: stmdb sp!,{r4-r12,lr}
411 sub r10,r3,#_armv4_AES_set_encrypt_key-AES_Te-1024 @ Te4
412
413 mov r12,r0 @ inp
414 mov lr,r1 @ bits
415 mov r11,r2 @ key
416
417#if __ARM_ARCH__<7
418 ldrb r0,[r12,#3] @ load input data in endian-neutral
419 ldrb r4,[r12,#2] @ manner...
420 ldrb r5,[r12,#1]
421 ldrb r6,[r12,#0]
422 orr r0,r0,r4,lsl#8
423 ldrb r1,[r12,#7]
424 orr r0,r0,r5,lsl#16
425 ldrb r4,[r12,#6]
426 orr r0,r0,r6,lsl#24
427 ldrb r5,[r12,#5]
428 ldrb r6,[r12,#4]
429 orr r1,r1,r4,lsl#8
430 ldrb r2,[r12,#11]
431 orr r1,r1,r5,lsl#16
432 ldrb r4,[r12,#10]
433 orr r1,r1,r6,lsl#24
434 ldrb r5,[r12,#9]
435 ldrb r6,[r12,#8]
436 orr r2,r2,r4,lsl#8
437 ldrb r3,[r12,#15]
438 orr r2,r2,r5,lsl#16
439 ldrb r4,[r12,#14]
440 orr r2,r2,r6,lsl#24
441 ldrb r5,[r12,#13]
442 ldrb r6,[r12,#12]
443 orr r3,r3,r4,lsl#8
444 str r0,[r11],#16
445 orr r3,r3,r5,lsl#16
446 str r1,[r11,#-12]
447 orr r3,r3,r6,lsl#24
448 str r2,[r11,#-8]
449 str r3,[r11,#-4]
450#else
451 ldr r0,[r12,#0]
452 ldr r1,[r12,#4]
453 ldr r2,[r12,#8]
454 ldr r3,[r12,#12]
455#ifdef __ARMEL__
456 rev r0,r0
457 rev r1,r1
458 rev r2,r2
459 rev r3,r3
460#endif
461 str r0,[r11],#16
462 str r1,[r11,#-12]
463 str r2,[r11,#-8]
464 str r3,[r11,#-4]
465#endif
466
467 teq lr,#128
468 bne .Lnot128
469 mov r12,#10
470 str r12,[r11,#240-16]
471 add r6,r10,#256 @ rcon
472 mov lr,#255
473
474.L128_loop:
475 and r5,lr,r3,lsr#24
476 and r7,lr,r3,lsr#16
477 ldrb r5,[r10,r5]
478 and r8,lr,r3,lsr#8
479 ldrb r7,[r10,r7]
480 and r9,lr,r3
481 ldrb r8,[r10,r8]
482 orr r5,r5,r7,lsl#24
483 ldrb r9,[r10,r9]
484 orr r5,r5,r8,lsl#16
485 ldr r4,[r6],#4 @ rcon[i++]
486 orr r5,r5,r9,lsl#8
487 eor r5,r5,r4
488 eor r0,r0,r5 @ rk[4]=rk[0]^...
489 eor r1,r1,r0 @ rk[5]=rk[1]^rk[4]
490 str r0,[r11],#16
491 eor r2,r2,r1 @ rk[6]=rk[2]^rk[5]
492 str r1,[r11,#-12]
493 eor r3,r3,r2 @ rk[7]=rk[3]^rk[6]
494 str r2,[r11,#-8]
495 subs r12,r12,#1
496 str r3,[r11,#-4]
497 bne .L128_loop
498 sub r2,r11,#176
499 b .Ldone
500
501.Lnot128:
502#if __ARM_ARCH__<7
503 ldrb r8,[r12,#19]
504 ldrb r4,[r12,#18]
505 ldrb r5,[r12,#17]
506 ldrb r6,[r12,#16]
507 orr r8,r8,r4,lsl#8
508 ldrb r9,[r12,#23]
509 orr r8,r8,r5,lsl#16
510 ldrb r4,[r12,#22]
511 orr r8,r8,r6,lsl#24
512 ldrb r5,[r12,#21]
513 ldrb r6,[r12,#20]
514 orr r9,r9,r4,lsl#8
515 orr r9,r9,r5,lsl#16
516 str r8,[r11],#8
517 orr r9,r9,r6,lsl#24
518 str r9,[r11,#-4]
519#else
520 ldr r8,[r12,#16]
521 ldr r9,[r12,#20]
522#ifdef __ARMEL__
523 rev r8,r8
524 rev r9,r9
525#endif
526 str r8,[r11],#8
527 str r9,[r11,#-4]
528#endif
529
530 teq lr,#192
531 bne .Lnot192
532 mov r12,#12
533 str r12,[r11,#240-24]
534 add r6,r10,#256 @ rcon
535 mov lr,#255
536 mov r12,#8
537
538.L192_loop:
539 and r5,lr,r9,lsr#24
540 and r7,lr,r9,lsr#16
541 ldrb r5,[r10,r5]
542 and r8,lr,r9,lsr#8
543 ldrb r7,[r10,r7]
544 and r9,lr,r9
545 ldrb r8,[r10,r8]
546 orr r5,r5,r7,lsl#24
547 ldrb r9,[r10,r9]
548 orr r5,r5,r8,lsl#16
549 ldr r4,[r6],#4 @ rcon[i++]
550 orr r5,r5,r9,lsl#8
551 eor r9,r5,r4
552 eor r0,r0,r9 @ rk[6]=rk[0]^...
553 eor r1,r1,r0 @ rk[7]=rk[1]^rk[6]
554 str r0,[r11],#24
555 eor r2,r2,r1 @ rk[8]=rk[2]^rk[7]
556 str r1,[r11,#-20]
557 eor r3,r3,r2 @ rk[9]=rk[3]^rk[8]
558 str r2,[r11,#-16]
559 subs r12,r12,#1
560 str r3,[r11,#-12]
561 subeq r2,r11,#216
562 beq .Ldone
563
564 ldr r7,[r11,#-32]
565 ldr r8,[r11,#-28]
566 eor r7,r7,r3 @ rk[10]=rk[4]^rk[9]
567 eor r9,r8,r7 @ rk[11]=rk[5]^rk[10]
568 str r7,[r11,#-8]
569 str r9,[r11,#-4]
570 b .L192_loop
571
572.Lnot192:
573#if __ARM_ARCH__<7
574 ldrb r8,[r12,#27]
575 ldrb r4,[r12,#26]
576 ldrb r5,[r12,#25]
577 ldrb r6,[r12,#24]
578 orr r8,r8,r4,lsl#8
579 ldrb r9,[r12,#31]
580 orr r8,r8,r5,lsl#16
581 ldrb r4,[r12,#30]
582 orr r8,r8,r6,lsl#24
583 ldrb r5,[r12,#29]
584 ldrb r6,[r12,#28]
585 orr r9,r9,r4,lsl#8
586 orr r9,r9,r5,lsl#16
587 str r8,[r11],#8
588 orr r9,r9,r6,lsl#24
589 str r9,[r11,#-4]
590#else
591 ldr r8,[r12,#24]
592 ldr r9,[r12,#28]
593#ifdef __ARMEL__
594 rev r8,r8
595 rev r9,r9
596#endif
597 str r8,[r11],#8
598 str r9,[r11,#-4]
599#endif
600
601 mov r12,#14
602 str r12,[r11,#240-32]
603 add r6,r10,#256 @ rcon
604 mov lr,#255
605 mov r12,#7
606
607.L256_loop:
608 and r5,lr,r9,lsr#24
609 and r7,lr,r9,lsr#16
610 ldrb r5,[r10,r5]
611 and r8,lr,r9,lsr#8
612 ldrb r7,[r10,r7]
613 and r9,lr,r9
614 ldrb r8,[r10,r8]
615 orr r5,r5,r7,lsl#24
616 ldrb r9,[r10,r9]
617 orr r5,r5,r8,lsl#16
618 ldr r4,[r6],#4 @ rcon[i++]
619 orr r5,r5,r9,lsl#8
620 eor r9,r5,r4
621 eor r0,r0,r9 @ rk[8]=rk[0]^...
622 eor r1,r1,r0 @ rk[9]=rk[1]^rk[8]
623 str r0,[r11],#32
624 eor r2,r2,r1 @ rk[10]=rk[2]^rk[9]
625 str r1,[r11,#-28]
626 eor r3,r3,r2 @ rk[11]=rk[3]^rk[10]
627 str r2,[r11,#-24]
628 subs r12,r12,#1
629 str r3,[r11,#-20]
630 subeq r2,r11,#256
631 beq .Ldone
632
633 and r5,lr,r3
634 and r7,lr,r3,lsr#8
635 ldrb r5,[r10,r5]
636 and r8,lr,r3,lsr#16
637 ldrb r7,[r10,r7]
638 and r9,lr,r3,lsr#24
639 ldrb r8,[r10,r8]
640 orr r5,r5,r7,lsl#8
641 ldrb r9,[r10,r9]
642 orr r5,r5,r8,lsl#16
643 ldr r4,[r11,#-48]
644 orr r5,r5,r9,lsl#24
645
646 ldr r7,[r11,#-44]
647 ldr r8,[r11,#-40]
648 eor r4,r4,r5 @ rk[12]=rk[4]^...
649 ldr r9,[r11,#-36]
650 eor r7,r7,r4 @ rk[13]=rk[5]^rk[12]
651 str r4,[r11,#-16]
652 eor r8,r8,r7 @ rk[14]=rk[6]^rk[13]
653 str r7,[r11,#-12]
654 eor r9,r9,r8 @ rk[15]=rk[7]^rk[14]
655 str r8,[r11,#-8]
656 str r9,[r11,#-4]
657 b .L256_loop
658
659.Ldone: mov r0,#0
660 ldmia sp!,{r4-r12,lr}
661.Labrt: tst lr,#1
662 moveq pc,lr @ be binary compatible with V4, yet
663 .word 0xe12fff1e @ interoperable with Thumb ISA:-)
664.size private_AES_set_encrypt_key,.-private_AES_set_encrypt_key
665
666.global private_AES_set_decrypt_key
667.type private_AES_set_decrypt_key,%function
668.align 5
669private_AES_set_decrypt_key:
670 str lr,[sp,#-4]! @ push lr
671#if 0
672 @ kernel does both of these in setkey so optimise this bit out by
673 @ expecting the key to already have the enc_key work done (see aes_glue.c)
674 bl _armv4_AES_set_encrypt_key
675#else
676 mov r0,#0
677#endif
678 teq r0,#0
679 ldrne lr,[sp],#4 @ pop lr
680 bne .Labrt
681
682 stmdb sp!,{r4-r12}
683
684 ldr r12,[r2,#240] @ AES_set_encrypt_key preserves r2,
685 mov r11,r2 @ which is AES_KEY *key
686 mov r7,r2
687 add r8,r2,r12,lsl#4
688
689.Linv: ldr r0,[r7]
690 ldr r1,[r7,#4]
691 ldr r2,[r7,#8]
692 ldr r3,[r7,#12]
693 ldr r4,[r8]
694 ldr r5,[r8,#4]
695 ldr r6,[r8,#8]
696 ldr r9,[r8,#12]
697 str r0,[r8],#-16
698 str r1,[r8,#16+4]
699 str r2,[r8,#16+8]
700 str r3,[r8,#16+12]
701 str r4,[r7],#16
702 str r5,[r7,#-12]
703 str r6,[r7,#-8]
704 str r9,[r7,#-4]
705 teq r7,r8
706 bne .Linv
707 ldr r0,[r11,#16]! @ prefetch tp1
708 mov r7,#0x80
709 mov r8,#0x1b
710 orr r7,r7,#0x8000
711 orr r8,r8,#0x1b00
712 orr r7,r7,r7,lsl#16
713 orr r8,r8,r8,lsl#16
714 sub r12,r12,#1
715 mvn r9,r7
716 mov r12,r12,lsl#2 @ (rounds-1)*4
717
718.Lmix: and r4,r0,r7
719 and r1,r0,r9
720 sub r4,r4,r4,lsr#7
721 and r4,r4,r8
722 eor r1,r4,r1,lsl#1 @ tp2
723
724 and r4,r1,r7
725 and r2,r1,r9
726 sub r4,r4,r4,lsr#7
727 and r4,r4,r8
728 eor r2,r4,r2,lsl#1 @ tp4
729
730 and r4,r2,r7
731 and r3,r2,r9
732 sub r4,r4,r4,lsr#7
733 and r4,r4,r8
734 eor r3,r4,r3,lsl#1 @ tp8
735
736 eor r4,r1,r2
737 eor r5,r0,r3 @ tp9
738 eor r4,r4,r3 @ tpe
739 eor r4,r4,r1,ror#24
740 eor r4,r4,r5,ror#24 @ ^= ROTATE(tpb=tp9^tp2,8)
741 eor r4,r4,r2,ror#16
742 eor r4,r4,r5,ror#16 @ ^= ROTATE(tpd=tp9^tp4,16)
743 eor r4,r4,r5,ror#8 @ ^= ROTATE(tp9,24)
744
745 ldr r0,[r11,#4] @ prefetch tp1
746 str r4,[r11],#4
747 subs r12,r12,#1
748 bne .Lmix
749
750 mov r0,#0
751#if __ARM_ARCH__>=5
752 ldmia sp!,{r4-r12,pc}
753#else
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
761.type AES_Td,%object
762.align 5
763AES_Td:
764.word 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96
765.word 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393
766.word 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25
767.word 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f
768.word 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1
769.word 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6
770.word 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da
771.word 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844
772.word 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd
773.word 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4
774.word 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45
775.word 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94
776.word 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7
777.word 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a
778.word 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5
779.word 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c
780.word 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1
781.word 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a
782.word 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75
783.word 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051
784.word 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46
785.word 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff
786.word 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77
787.word 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb
788.word 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000
789.word 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e
790.word 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927
791.word 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a
792.word 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e
793.word 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16
794.word 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d
795.word 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8
796.word 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd
797.word 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34
798.word 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163
799.word 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120
800.word 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d
801.word 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0
802.word 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422
803.word 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef
804.word 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36
805.word 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4
806.word 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662
807.word 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5
808.word 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3
809.word 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b
810.word 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8
811.word 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6
812.word 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6
813.word 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0
814.word 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815
815.word 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f
816.word 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df
817.word 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f
818.word 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e
819.word 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713
820.word 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89
821.word 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c
822.word 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf
823.word 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86
824.word 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f
825.word 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541
826.word 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190
827.word 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742
828@ Td4[256]
829.byte 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38
830.byte 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb
831.byte 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87
832.byte 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb
833.byte 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d
834.byte 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e
835.byte 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2
836.byte 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25
837.byte 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16
838.byte 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92
839.byte 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda
840.byte 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84
841.byte 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a
842.byte 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06
843.byte 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02
844.byte 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b
845.byte 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea
846.byte 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73
847.byte 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85
848.byte 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e
849.byte 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89
850.byte 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b
851.byte 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20
852.byte 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4
853.byte 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31
854.byte 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f
855.byte 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d
856.byte 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef
857.byte 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0
858.byte 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61
859.byte 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26
860.byte 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
861.size AES_Td,.-AES_Td
862
863@ void AES_decrypt(const unsigned char *in, unsigned char *out,
864@ const AES_KEY *key) {
865.global AES_decrypt
866.type AES_decrypt,%function
867.align 5
868AES_decrypt:
869 sub r3,pc,#8 @ AES_decrypt
870 stmdb sp!,{r1,r4-r12,lr}
871 mov r12,r0 @ inp
872 mov r11,r2
873 sub r10,r3,#AES_decrypt-AES_Td @ Td
874#if __ARM_ARCH__<7
875 ldrb r0,[r12,#3] @ load input data in endian-neutral
876 ldrb r4,[r12,#2] @ manner...
877 ldrb r5,[r12,#1]
878 ldrb r6,[r12,#0]
879 orr r0,r0,r4,lsl#8
880 ldrb r1,[r12,#7]
881 orr r0,r0,r5,lsl#16
882 ldrb r4,[r12,#6]
883 orr r0,r0,r6,lsl#24
884 ldrb r5,[r12,#5]
885 ldrb r6,[r12,#4]
886 orr r1,r1,r4,lsl#8
887 ldrb r2,[r12,#11]
888 orr r1,r1,r5,lsl#16
889 ldrb r4,[r12,#10]
890 orr r1,r1,r6,lsl#24
891 ldrb r5,[r12,#9]
892 ldrb r6,[r12,#8]
893 orr r2,r2,r4,lsl#8
894 ldrb r3,[r12,#15]
895 orr r2,r2,r5,lsl#16
896 ldrb r4,[r12,#14]
897 orr r2,r2,r6,lsl#24
898 ldrb r5,[r12,#13]
899 ldrb r6,[r12,#12]
900 orr r3,r3,r4,lsl#8
901 orr r3,r3,r5,lsl#16
902 orr r3,r3,r6,lsl#24
903#else
904 ldr r0,[r12,#0]
905 ldr r1,[r12,#4]
906 ldr r2,[r12,#8]
907 ldr r3,[r12,#12]
908#ifdef __ARMEL__
909 rev r0,r0
910 rev r1,r1
911 rev r2,r2
912 rev r3,r3
913#endif
914#endif
915 bl _armv4_AES_decrypt
916
917 ldr r12,[sp],#4 @ pop out
918#if __ARM_ARCH__>=7
919#ifdef __ARMEL__
920 rev r0,r0
921 rev r1,r1
922 rev r2,r2
923 rev r3,r3
924#endif
925 str r0,[r12,#0]
926 str r1,[r12,#4]
927 str r2,[r12,#8]
928 str r3,[r12,#12]
929#else
930 mov r4,r0,lsr#24 @ write output in endian-neutral
931 mov r5,r0,lsr#16 @ manner...
932 mov r6,r0,lsr#8
933 strb r4,[r12,#0]
934 strb r5,[r12,#1]
935 mov r4,r1,lsr#24
936 strb r6,[r12,#2]
937 mov r5,r1,lsr#16
938 strb r0,[r12,#3]
939 mov r6,r1,lsr#8
940 strb r4,[r12,#4]
941 strb r5,[r12,#5]
942 mov r4,r2,lsr#24
943 strb r6,[r12,#6]
944 mov r5,r2,lsr#16
945 strb r1,[r12,#7]
946 mov r6,r2,lsr#8
947 strb r4,[r12,#8]
948 strb r5,[r12,#9]
949 mov r4,r3,lsr#24
950 strb r6,[r12,#10]
951 mov r5,r3,lsr#16
952 strb r2,[r12,#11]
953 mov r6,r3,lsr#8
954 strb r4,[r12,#12]
955 strb r5,[r12,#13]
956 strb r6,[r12,#14]
957 strb r3,[r12,#15]
958#endif
959#if __ARM_ARCH__>=5
960 ldmia sp!,{r4-r12,pc}
961#else
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
969.type _armv4_AES_decrypt,%function
970.align 2
971_armv4_AES_decrypt:
972 str lr,[sp,#-4]! @ push lr
973 ldmia r11!,{r4-r7}
974 eor r0,r0,r4
975 ldr r12,[r11,#240-16]
976 eor r1,r1,r5
977 eor r2,r2,r6
978 eor r3,r3,r7
979 sub r12,r12,#1
980 mov lr,#255
981
982 and r7,lr,r0,lsr#16
983 and r8,lr,r0,lsr#8
984 and r9,lr,r0
985 mov r0,r0,lsr#24
986.Ldec_loop:
987 ldr r4,[r10,r7,lsl#2] @ Td1[s0>>16]
988 and r7,lr,r1 @ i0
989 ldr r5,[r10,r8,lsl#2] @ Td2[s0>>8]
990 and r8,lr,r1,lsr#16
991 ldr r6,[r10,r9,lsl#2] @ Td3[s0>>0]
992 and r9,lr,r1,lsr#8
993 ldr r0,[r10,r0,lsl#2] @ Td0[s0>>24]
994 mov r1,r1,lsr#24
995
996 ldr r7,[r10,r7,lsl#2] @ Td3[s1>>0]
997 ldr r8,[r10,r8,lsl#2] @ Td1[s1>>16]
998 ldr r9,[r10,r9,lsl#2] @ Td2[s1>>8]
999 eor r0,r0,r7,ror#24
1000 ldr r1,[r10,r1,lsl#2] @ Td0[s1>>24]
1001 and r7,lr,r2,lsr#8 @ i0
1002 eor r5,r8,r5,ror#8
1003 and r8,lr,r2 @ i1
1004 eor r6,r9,r6,ror#8
1005 and r9,lr,r2,lsr#16
1006 ldr r7,[r10,r7,lsl#2] @ Td2[s2>>8]
1007 eor r1,r1,r4,ror#8
1008 ldr r8,[r10,r8,lsl#2] @ Td3[s2>>0]
1009 mov r2,r2,lsr#24
1010
1011 ldr r9,[r10,r9,lsl#2] @ Td1[s2>>16]
1012 eor r0,r0,r7,ror#16
1013 ldr r2,[r10,r2,lsl#2] @ Td0[s2>>24]
1014 and r7,lr,r3,lsr#16 @ i0
1015 eor r1,r1,r8,ror#24
1016 and r8,lr,r3,lsr#8 @ i1
1017 eor r6,r9,r6,ror#8
1018 and r9,lr,r3 @ i2
1019 ldr r7,[r10,r7,lsl#2] @ Td1[s3>>16]
1020 eor r2,r2,r5,ror#8
1021 ldr r8,[r10,r8,lsl#2] @ Td2[s3>>8]
1022 mov r3,r3,lsr#24
1023
1024 ldr r9,[r10,r9,lsl#2] @ Td3[s3>>0]
1025 eor r0,r0,r7,ror#8
1026 ldr r7,[r11],#16
1027 eor r1,r1,r8,ror#16
1028 ldr r3,[r10,r3,lsl#2] @ Td0[s3>>24]
1029 eor r2,r2,r9,ror#24
1030
1031 ldr r4,[r11,#-12]
1032 eor r0,r0,r7
1033 ldr r5,[r11,#-8]
1034 eor r3,r3,r6,ror#8
1035 ldr r6,[r11,#-4]
1036 and r7,lr,r0,lsr#16
1037 eor r1,r1,r4
1038 and r8,lr,r0,lsr#8
1039 eor r2,r2,r5
1040 and r9,lr,r0
1041 eor r3,r3,r6
1042 mov r0,r0,lsr#24
1043
1044 subs r12,r12,#1
1045 bne .Ldec_loop
1046
1047 add r10,r10,#1024
1048
1049 ldr r5,[r10,#0] @ prefetch Td4
1050 ldr r6,[r10,#32]
1051 ldr r4,[r10,#64]
1052 ldr r5,[r10,#96]
1053 ldr r6,[r10,#128]
1054 ldr r4,[r10,#160]
1055 ldr r5,[r10,#192]
1056 ldr r6,[r10,#224]
1057
1058 ldrb r0,[r10,r0] @ Td4[s0>>24]
1059 ldrb r4,[r10,r7] @ Td4[s0>>16]
1060 and r7,lr,r1 @ i0
1061 ldrb r5,[r10,r8] @ Td4[s0>>8]
1062 and r8,lr,r1,lsr#16
1063 ldrb r6,[r10,r9] @ Td4[s0>>0]
1064 and r9,lr,r1,lsr#8
1065
1066 ldrb r7,[r10,r7] @ Td4[s1>>0]
1067 ldrb r1,[r10,r1,lsr#24] @ Td4[s1>>24]
1068 ldrb r8,[r10,r8] @ Td4[s1>>16]
1069 eor r0,r7,r0,lsl#24
1070 ldrb r9,[r10,r9] @ Td4[s1>>8]
1071 eor r1,r4,r1,lsl#8
1072 and r7,lr,r2,lsr#8 @ i0
1073 eor r5,r5,r8,lsl#8
1074 and r8,lr,r2 @ i1
1075 ldrb r7,[r10,r7] @ Td4[s2>>8]
1076 eor r6,r6,r9,lsl#8
1077 ldrb r8,[r10,r8] @ Td4[s2>>0]
1078 and r9,lr,r2,lsr#16
1079
1080 ldrb r2,[r10,r2,lsr#24] @ Td4[s2>>24]
1081 eor r0,r0,r7,lsl#8
1082 ldrb r9,[r10,r9] @ Td4[s2>>16]
1083 eor r1,r8,r1,lsl#16
1084 and r7,lr,r3,lsr#16 @ i0
1085 eor r2,r5,r2,lsl#16
1086 and r8,lr,r3,lsr#8 @ i1
1087 ldrb r7,[r10,r7] @ Td4[s3>>16]
1088 eor r6,r6,r9,lsl#16
1089 ldrb r8,[r10,r8] @ Td4[s3>>8]
1090 and r9,lr,r3 @ i2
1091
1092 ldrb r9,[r10,r9] @ Td4[s3>>0]
1093 ldrb r3,[r10,r3,lsr#24] @ Td4[s3>>24]
1094 eor r0,r0,r7,lsl#16
1095 ldr r7,[r11,#0]
1096 eor r1,r1,r8,lsl#8
1097 ldr r4,[r11,#4]
1098 eor r2,r9,r2,lsl#8
1099 ldr r5,[r11,#8]
1100 eor r3,r6,r3,lsl#24
1101 ldr r6,[r11,#12]
1102
1103 eor r0,r0,r7
1104 eor r1,r1,r4
1105 eor r2,r2,r5
1106 eor r3,r3,r6
1107
1108 sub r10,r10,#1024
1109 ldr pc,[sp],#4 @ pop and return
1110.size _armv4_AES_decrypt,.-_armv4_AES_decrypt
1111.asciz "AES for ARMv4, CRYPTOGAMS by <appro@openssl.org>"
1112.align 2
diff --git a/arch/arm/crypto/aes_glue.c b/arch/arm/crypto/aes_glue.c
new file mode 100644
index 00000000000..59f7877ead6
--- /dev/null
+++ b/arch/arm/crypto/aes_glue.c
@@ -0,0 +1,108 @@
1/*
2 * Glue Code for the asm optimized version of the AES Cipher Algorithm
3 */
4
5#include <linux/module.h>
6#include <linux/crypto.h>
7#include <crypto/aes.h>
8
9#define AES_MAXNR 14
10
11typedef struct {
12 unsigned int rd_key[4 *(AES_MAXNR + 1)];
13 int rounds;
14} AES_KEY;
15
16struct AES_CTX {
17 AES_KEY enc_key;
18 AES_KEY dec_key;
19};
20
21asmlinkage void AES_encrypt(const u8 *in, u8 *out, AES_KEY *ctx);
22asmlinkage void AES_decrypt(const u8 *in, u8 *out, AES_KEY *ctx);
23asmlinkage int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key);
24asmlinkage int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key);
25
26static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
27{
28 struct AES_CTX *ctx = crypto_tfm_ctx(tfm);
29 AES_encrypt(src, dst, &ctx->enc_key);
30}
31
32static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
33{
34 struct AES_CTX *ctx = crypto_tfm_ctx(tfm);
35 AES_decrypt(src, dst, &ctx->dec_key);
36}
37
38static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
39 unsigned int key_len)
40{
41 struct AES_CTX *ctx = crypto_tfm_ctx(tfm);
42
43 switch (key_len) {
44 case AES_KEYSIZE_128:
45 key_len = 128;
46 break;
47 case AES_KEYSIZE_192:
48 key_len = 192;
49 break;
50 case AES_KEYSIZE_256:
51 key_len = 256;
52 break;
53 default:
54 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
55 return -EINVAL;
56 }
57
58 if (private_AES_set_encrypt_key(in_key, key_len, &ctx->enc_key) == -1) {
59 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
60 return -EINVAL;
61 }
62 /* private_AES_set_decrypt_key expects an encryption key as input */
63 ctx->dec_key = ctx->enc_key;
64 if (private_AES_set_decrypt_key(in_key, key_len, &ctx->dec_key) == -1) {
65 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
66 return -EINVAL;
67 }
68 return 0;
69}
70
71static struct crypto_alg aes_alg = {
72 .cra_name = "aes",
73 .cra_driver_name = "aes-asm",
74 .cra_priority = 200,
75 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
76 .cra_blocksize = AES_BLOCK_SIZE,
77 .cra_ctxsize = sizeof(struct AES_CTX),
78 .cra_module = THIS_MODULE,
79 .cra_list = LIST_HEAD_INIT(aes_alg.cra_list),
80 .cra_u = {
81 .cipher = {
82 .cia_min_keysize = AES_MIN_KEY_SIZE,
83 .cia_max_keysize = AES_MAX_KEY_SIZE,
84 .cia_setkey = aes_set_key,
85 .cia_encrypt = aes_encrypt,
86 .cia_decrypt = aes_decrypt
87 }
88 }
89};
90
91static int __init aes_init(void)
92{
93 return crypto_register_alg(&aes_alg);
94}
95
96static void __exit aes_fini(void)
97{
98 crypto_unregister_alg(&aes_alg);
99}
100
101module_init(aes_init);
102module_exit(aes_fini);
103
104MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm (ASM)");
105MODULE_LICENSE("GPL");
106MODULE_ALIAS("aes");
107MODULE_ALIAS("aes-asm");
108MODULE_AUTHOR("David McCullough <ucdevel@gmail.com>");
diff --git a/arch/arm/crypto/sha1-armv4-large.S b/arch/arm/crypto/sha1-armv4-large.S
new file mode 100644
index 00000000000..7050ab133b9
--- /dev/null
+++ b/arch/arm/crypto/sha1-armv4-large.S
@@ -0,0 +1,503 @@
1#define __ARM_ARCH__ __LINUX_ARM_ARCH__
2@ ====================================================================
3@ Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
4@ project. The module is, however, dual licensed under OpenSSL and
5@ CRYPTOGAMS licenses depending on where you obtain it. For further
6@ details see http://www.openssl.org/~appro/cryptogams/.
7@ ====================================================================
8
9@ sha1_block procedure for ARMv4.
10@
11@ January 2007.
12
13@ Size/performance trade-off
14@ ====================================================================
15@ impl size in bytes comp cycles[*] measured performance
16@ ====================================================================
17@ thumb 304 3212 4420
18@ armv4-small 392/+29% 1958/+64% 2250/+96%
19@ armv4-compact 740/+89% 1552/+26% 1840/+22%
20@ armv4-large 1420/+92% 1307/+19% 1370/+34%[***]
21@ full unroll ~5100/+260% ~1260/+4% ~1300/+5%
22@ ====================================================================
23@ thumb = same as 'small' but in Thumb instructions[**] and
24@ with recurring code in two private functions;
25@ small = detached Xload/update, loops are folded;
26@ compact = detached Xload/update, 5x unroll;
27@ large = interleaved Xload/update, 5x unroll;
28@ full unroll = interleaved Xload/update, full unroll, estimated[!];
29@
30@ [*] Manually counted instructions in "grand" loop body. Measured
31@ performance is affected by prologue and epilogue overhead,
32@ i-cache availability, branch penalties, etc.
33@ [**] While each Thumb instruction is twice smaller, they are not as
34@ diverse as ARM ones: e.g., there are only two arithmetic
35@ instructions with 3 arguments, no [fixed] rotate, addressing
36@ modes are limited. As result it takes more instructions to do
37@ the same job in Thumb, therefore the code is never twice as
38@ small and always slower.
39@ [***] which is also ~35% better than compiler generated code. Dual-
40@ issue Cortex A8 core was measured to process input block in
41@ ~990 cycles.
42
43@ August 2010.
44@
45@ Rescheduling for dual-issue pipeline resulted in 13% improvement on
46@ Cortex A8 core and in absolute terms ~870 cycles per input block
47@ [or 13.6 cycles per byte].
48
49@ February 2011.
50@
51@ Profiler-assisted and platform-specific optimization resulted in 10%
52@ improvement on Cortex A8 core and 12.2 cycles per byte.
53
54.text
55
56.global sha1_block_data_order
57.type sha1_block_data_order,%function
58
59.align 2
60sha1_block_data_order:
61 stmdb sp!,{r4-r12,lr}
62 add r2,r1,r2,lsl#6 @ r2 to point at the end of r1
63 ldmia r0,{r3,r4,r5,r6,r7}
64.Lloop:
65 ldr r8,.LK_00_19
66 mov r14,sp
67 sub sp,sp,#15*4
68 mov r5,r5,ror#30
69 mov r6,r6,ror#30
70 mov r7,r7,ror#30 @ [6]
71.L_00_15:
72#if __ARM_ARCH__<7
73 ldrb r10,[r1,#2]
74 ldrb r9,[r1,#3]
75 ldrb r11,[r1,#1]
76 add r7,r8,r7,ror#2 @ E+=K_00_19
77 ldrb r12,[r1],#4
78 orr r9,r9,r10,lsl#8
79 eor r10,r5,r6 @ F_xx_xx
80 orr r9,r9,r11,lsl#16
81 add r7,r7,r3,ror#27 @ E+=ROR(A,27)
82 orr r9,r9,r12,lsl#24
83#else
84 ldr r9,[r1],#4 @ handles unaligned
85 add r7,r8,r7,ror#2 @ E+=K_00_19
86 eor r10,r5,r6 @ F_xx_xx
87 add r7,r7,r3,ror#27 @ E+=ROR(A,27)
88#ifdef __ARMEL__
89 rev r9,r9 @ byte swap
90#endif
91#endif
92 and r10,r4,r10,ror#2
93 add r7,r7,r9 @ E+=X[i]
94 eor r10,r10,r6,ror#2 @ F_00_19(B,C,D)
95 str r9,[r14,#-4]!
96 add r7,r7,r10 @ E+=F_00_19(B,C,D)
97#if __ARM_ARCH__<7
98 ldrb r10,[r1,#2]
99 ldrb r9,[r1,#3]
100 ldrb r11,[r1,#1]
101 add r6,r8,r6,ror#2 @ E+=K_00_19
102 ldrb r12,[r1],#4
103 orr r9,r9,r10,lsl#8
104 eor r10,r4,r5 @ F_xx_xx
105 orr r9,r9,r11,lsl#16
106 add r6,r6,r7,ror#27 @ E+=ROR(A,27)
107 orr r9,r9,r12,lsl#24
108#else
109 ldr r9,[r1],#4 @ handles unaligned
110 add r6,r8,r6,ror#2 @ E+=K_00_19
111 eor r10,r4,r5 @ F_xx_xx
112 add r6,r6,r7,ror#27 @ E+=ROR(A,27)
113#ifdef __ARMEL__
114 rev r9,r9 @ byte swap
115#endif
116#endif
117 and r10,r3,r10,ror#2
118 add r6,r6,r9 @ E+=X[i]
119 eor r10,r10,r5,ror#2 @ F_00_19(B,C,D)
120 str r9,[r14,#-4]!
121 add r6,r6,r10 @ E+=F_00_19(B,C,D)
122#if __ARM_ARCH__<7
123 ldrb r10,[r1,#2]
124 ldrb r9,[r1,#3]
125 ldrb r11,[r1,#1]
126 add r5,r8,r5,ror#2 @ E+=K_00_19
127 ldrb r12,[r1],#4
128 orr r9,r9,r10,lsl#8
129 eor r10,r3,r4 @ F_xx_xx
130 orr r9,r9,r11,lsl#16
131 add r5,r5,r6,ror#27 @ E+=ROR(A,27)
132 orr r9,r9,r12,lsl#24
133#else
134 ldr r9,[r1],#4 @ handles unaligned
135 add r5,r8,r5,ror#2 @ E+=K_00_19
136 eor r10,r3,r4 @ F_xx_xx
137 add r5,r5,r6,ror#27 @ E+=ROR(A,27)
138#ifdef __ARMEL__
139 rev r9,r9 @ byte swap
140#endif
141#endif
142 and r10,r7,r10,ror#2
143 add r5,r5,r9 @ E+=X[i]
144 eor r10,r10,r4,ror#2 @ F_00_19(B,C,D)
145 str r9,[r14,#-4]!
146 add r5,r5,r10 @ E+=F_00_19(B,C,D)
147#if __ARM_ARCH__<7
148 ldrb r10,[r1,#2]
149 ldrb r9,[r1,#3]
150 ldrb r11,[r1,#1]
151 add r4,r8,r4,ror#2 @ E+=K_00_19
152 ldrb r12,[r1],#4
153 orr r9,r9,r10,lsl#8
154 eor r10,r7,r3 @ F_xx_xx
155 orr r9,r9,r11,lsl#16
156 add r4,r4,r5,ror#27 @ E+=ROR(A,27)
157 orr r9,r9,r12,lsl#24
158#else
159 ldr r9,[r1],#4 @ handles unaligned
160 add r4,r8,r4,ror#2 @ E+=K_00_19
161 eor r10,r7,r3 @ F_xx_xx
162 add r4,r4,r5,ror#27 @ E+=ROR(A,27)
163#ifdef __ARMEL__
164 rev r9,r9 @ byte swap
165#endif
166#endif
167 and r10,r6,r10,ror#2
168 add r4,r4,r9 @ E+=X[i]
169 eor r10,r10,r3,ror#2 @ F_00_19(B,C,D)
170 str r9,[r14,#-4]!
171 add r4,r4,r10 @ E+=F_00_19(B,C,D)
172#if __ARM_ARCH__<7
173 ldrb r10,[r1,#2]
174 ldrb r9,[r1,#3]
175 ldrb r11,[r1,#1]
176 add r3,r8,r3,ror#2 @ E+=K_00_19
177 ldrb r12,[r1],#4
178 orr r9,r9,r10,lsl#8
179 eor r10,r6,r7 @ F_xx_xx
180 orr r9,r9,r11,lsl#16
181 add r3,r3,r4,ror#27 @ E+=ROR(A,27)
182 orr r9,r9,r12,lsl#24
183#else
184 ldr r9,[r1],#4 @ handles unaligned
185 add r3,r8,r3,ror#2 @ E+=K_00_19
186 eor r10,r6,r7 @ F_xx_xx
187 add r3,r3,r4,ror#27 @ E+=ROR(A,27)
188#ifdef __ARMEL__
189 rev r9,r9 @ byte swap
190#endif
191#endif
192 and r10,r5,r10,ror#2
193 add r3,r3,r9 @ E+=X[i]
194 eor r10,r10,r7,ror#2 @ F_00_19(B,C,D)
195 str r9,[r14,#-4]!
196 add r3,r3,r10 @ E+=F_00_19(B,C,D)
197 teq r14,sp
198 bne .L_00_15 @ [((11+4)*5+2)*3]
199#if __ARM_ARCH__<7
200 ldrb r10,[r1,#2]
201 ldrb r9,[r1,#3]
202 ldrb r11,[r1,#1]
203 add r7,r8,r7,ror#2 @ E+=K_00_19
204 ldrb r12,[r1],#4
205 orr r9,r9,r10,lsl#8
206 eor r10,r5,r6 @ F_xx_xx
207 orr r9,r9,r11,lsl#16
208 add r7,r7,r3,ror#27 @ E+=ROR(A,27)
209 orr r9,r9,r12,lsl#24
210#else
211 ldr r9,[r1],#4 @ handles unaligned
212 add r7,r8,r7,ror#2 @ E+=K_00_19
213 eor r10,r5,r6 @ F_xx_xx
214 add r7,r7,r3,ror#27 @ E+=ROR(A,27)
215#ifdef __ARMEL__
216 rev r9,r9 @ byte swap
217#endif
218#endif
219 and r10,r4,r10,ror#2
220 add r7,r7,r9 @ E+=X[i]
221 eor r10,r10,r6,ror#2 @ F_00_19(B,C,D)
222 str r9,[r14,#-4]!
223 add r7,r7,r10 @ E+=F_00_19(B,C,D)
224 ldr r9,[r14,#15*4]
225 ldr r10,[r14,#13*4]
226 ldr r11,[r14,#7*4]
227 add r6,r8,r6,ror#2 @ E+=K_xx_xx
228 ldr r12,[r14,#2*4]
229 eor r9,r9,r10
230 eor r11,r11,r12 @ 1 cycle stall
231 eor r10,r4,r5 @ F_xx_xx
232 mov r9,r9,ror#31
233 add r6,r6,r7,ror#27 @ E+=ROR(A,27)
234 eor r9,r9,r11,ror#31
235 str r9,[r14,#-4]!
236 and r10,r3,r10,ror#2 @ F_xx_xx
237 @ F_xx_xx
238 add r6,r6,r9 @ E+=X[i]
239 eor r10,r10,r5,ror#2 @ F_00_19(B,C,D)
240 add r6,r6,r10 @ E+=F_00_19(B,C,D)
241 ldr r9,[r14,#15*4]
242 ldr r10,[r14,#13*4]
243 ldr r11,[r14,#7*4]
244 add r5,r8,r5,ror#2 @ E+=K_xx_xx
245 ldr r12,[r14,#2*4]
246 eor r9,r9,r10
247 eor r11,r11,r12 @ 1 cycle stall
248 eor r10,r3,r4 @ F_xx_xx
249 mov r9,r9,ror#31
250 add r5,r5,r6,ror#27 @ E+=ROR(A,27)
251 eor r9,r9,r11,ror#31
252 str r9,[r14,#-4]!
253 and r10,r7,r10,ror#2 @ F_xx_xx
254 @ F_xx_xx
255 add r5,r5,r9 @ E+=X[i]
256 eor r10,r10,r4,ror#2 @ F_00_19(B,C,D)
257 add r5,r5,r10 @ E+=F_00_19(B,C,D)
258 ldr r9,[r14,#15*4]
259 ldr r10,[r14,#13*4]
260 ldr r11,[r14,#7*4]
261 add r4,r8,r4,ror#2 @ E+=K_xx_xx
262 ldr r12,[r14,#2*4]
263 eor r9,r9,r10
264 eor r11,r11,r12 @ 1 cycle stall
265 eor r10,r7,r3 @ F_xx_xx
266 mov r9,r9,ror#31
267 add r4,r4,r5,ror#27 @ E+=ROR(A,27)
268 eor r9,r9,r11,ror#31
269 str r9,[r14,#-4]!
270 and r10,r6,r10,ror#2 @ F_xx_xx
271 @ F_xx_xx
272 add r4,r4,r9 @ E+=X[i]
273 eor r10,r10,r3,ror#2 @ F_00_19(B,C,D)
274 add r4,r4,r10 @ E+=F_00_19(B,C,D)
275 ldr r9,[r14,#15*4]
276 ldr r10,[r14,#13*4]
277 ldr r11,[r14,#7*4]
278 add r3,r8,r3,ror#2 @ E+=K_xx_xx
279 ldr r12,[r14,#2*4]
280 eor r9,r9,r10
281 eor r11,r11,r12 @ 1 cycle stall
282 eor r10,r6,r7 @ F_xx_xx
283 mov r9,r9,ror#31
284 add r3,r3,r4,ror#27 @ E+=ROR(A,27)
285 eor r9,r9,r11,ror#31
286 str r9,[r14,#-4]!
287 and r10,r5,r10,ror#2 @ F_xx_xx
288 @ F_xx_xx
289 add r3,r3,r9 @ E+=X[i]
290 eor r10,r10,r7,ror#2 @ F_00_19(B,C,D)
291 add r3,r3,r10 @ E+=F_00_19(B,C,D)
292
293 ldr r8,.LK_20_39 @ [+15+16*4]
294 sub sp,sp,#25*4
295 cmn sp,#0 @ [+3], clear carry to denote 20_39
296.L_20_39_or_60_79:
297 ldr r9,[r14,#15*4]
298 ldr r10,[r14,#13*4]
299 ldr r11,[r14,#7*4]
300 add r7,r8,r7,ror#2 @ E+=K_xx_xx
301 ldr r12,[r14,#2*4]
302 eor r9,r9,r10
303 eor r11,r11,r12 @ 1 cycle stall
304 eor r10,r5,r6 @ F_xx_xx
305 mov r9,r9,ror#31
306 add r7,r7,r3,ror#27 @ E+=ROR(A,27)
307 eor r9,r9,r11,ror#31
308 str r9,[r14,#-4]!
309 eor r10,r4,r10,ror#2 @ F_xx_xx
310 @ F_xx_xx
311 add r7,r7,r9 @ E+=X[i]
312 add r7,r7,r10 @ E+=F_20_39(B,C,D)
313 ldr r9,[r14,#15*4]
314 ldr r10,[r14,#13*4]
315 ldr r11,[r14,#7*4]
316 add r6,r8,r6,ror#2 @ E+=K_xx_xx
317 ldr r12,[r14,#2*4]
318 eor r9,r9,r10
319 eor r11,r11,r12 @ 1 cycle stall
320 eor r10,r4,r5 @ F_xx_xx
321 mov r9,r9,ror#31
322 add r6,r6,r7,ror#27 @ E+=ROR(A,27)
323 eor r9,r9,r11,ror#31
324 str r9,[r14,#-4]!
325 eor r10,r3,r10,ror#2 @ F_xx_xx
326 @ F_xx_xx
327 add r6,r6,r9 @ E+=X[i]
328 add r6,r6,r10 @ E+=F_20_39(B,C,D)
329 ldr r9,[r14,#15*4]
330 ldr r10,[r14,#13*4]
331 ldr r11,[r14,#7*4]
332 add r5,r8,r5,ror#2 @ E+=K_xx_xx
333 ldr r12,[r14,#2*4]
334 eor r9,r9,r10
335 eor r11,r11,r12 @ 1 cycle stall
336 eor r10,r3,r4 @ F_xx_xx
337 mov r9,r9,ror#31
338 add r5,r5,r6,ror#27 @ E+=ROR(A,27)
339 eor r9,r9,r11,ror#31
340 str r9,[r14,#-4]!
341 eor r10,r7,r10,ror#2 @ F_xx_xx
342 @ F_xx_xx
343 add r5,r5,r9 @ E+=X[i]
344 add r5,r5,r10 @ E+=F_20_39(B,C,D)
345 ldr r9,[r14,#15*4]
346 ldr r10,[r14,#13*4]
347 ldr r11,[r14,#7*4]
348 add r4,r8,r4,ror#2 @ E+=K_xx_xx
349 ldr r12,[r14,#2*4]
350 eor r9,r9,r10
351 eor r11,r11,r12 @ 1 cycle stall
352 eor r10,r7,r3 @ F_xx_xx
353 mov r9,r9,ror#31
354 add r4,r4,r5,ror#27 @ E+=ROR(A,27)
355 eor r9,r9,r11,ror#31
356 str r9,[r14,#-4]!
357 eor r10,r6,r10,ror#2 @ F_xx_xx
358 @ F_xx_xx
359 add r4,r4,r9 @ E+=X[i]
360 add r4,r4,r10 @ E+=F_20_39(B,C,D)
361 ldr r9,[r14,#15*4]
362 ldr r10,[r14,#13*4]
363 ldr r11,[r14,#7*4]
364 add r3,r8,r3,ror#2 @ E+=K_xx_xx
365 ldr r12,[r14,#2*4]
366 eor r9,r9,r10
367 eor r11,r11,r12 @ 1 cycle stall
368 eor r10,r6,r7 @ F_xx_xx
369 mov r9,r9,ror#31
370 add r3,r3,r4,ror#27 @ E+=ROR(A,27)
371 eor r9,r9,r11,ror#31
372 str r9,[r14,#-4]!
373 eor r10,r5,r10,ror#2 @ F_xx_xx
374 @ F_xx_xx
375 add r3,r3,r9 @ E+=X[i]
376 add r3,r3,r10 @ E+=F_20_39(B,C,D)
377 teq r14,sp @ preserve carry
378 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
381 ldr r8,.LK_40_59
382 sub sp,sp,#20*4 @ [+2]
383.L_40_59:
384 ldr r9,[r14,#15*4]
385 ldr r10,[r14,#13*4]
386 ldr r11,[r14,#7*4]
387 add r7,r8,r7,ror#2 @ E+=K_xx_xx
388 ldr r12,[r14,#2*4]
389 eor r9,r9,r10
390 eor r11,r11,r12 @ 1 cycle stall
391 eor r10,r5,r6 @ F_xx_xx
392 mov r9,r9,ror#31
393 add r7,r7,r3,ror#27 @ E+=ROR(A,27)
394 eor r9,r9,r11,ror#31
395 str r9,[r14,#-4]!
396 and r10,r4,r10,ror#2 @ F_xx_xx
397 and r11,r5,r6 @ F_xx_xx
398 add r7,r7,r9 @ E+=X[i]
399 add r7,r7,r10 @ E+=F_40_59(B,C,D)
400 add r7,r7,r11,ror#2
401 ldr r9,[r14,#15*4]
402 ldr r10,[r14,#13*4]
403 ldr r11,[r14,#7*4]
404 add r6,r8,r6,ror#2 @ E+=K_xx_xx
405 ldr r12,[r14,#2*4]
406 eor r9,r9,r10
407 eor r11,r11,r12 @ 1 cycle stall
408 eor r10,r4,r5 @ F_xx_xx
409 mov r9,r9,ror#31
410 add r6,r6,r7,ror#27 @ E+=ROR(A,27)
411 eor r9,r9,r11,ror#31
412 str r9,[r14,#-4]!
413 and r10,r3,r10,ror#2 @ F_xx_xx
414 and r11,r4,r5 @ F_xx_xx
415 add r6,r6,r9 @ E+=X[i]
416 add r6,r6,r10 @ E+=F_40_59(B,C,D)
417 add r6,r6,r11,ror#2
418 ldr r9,[r14,#15*4]
419 ldr r10,[r14,#13*4]
420 ldr r11,[r14,#7*4]
421 add r5,r8,r5,ror#2 @ E+=K_xx_xx
422 ldr r12,[r14,#2*4]
423 eor r9,r9,r10
424 eor r11,r11,r12 @ 1 cycle stall
425 eor r10,r3,r4 @ F_xx_xx
426 mov r9,r9,ror#31
427 add r5,r5,r6,ror#27 @ E+=ROR(A,27)
428 eor r9,r9,r11,ror#31
429 str r9,[r14,#-4]!
430 and r10,r7,r10,ror#2 @ F_xx_xx
431 and r11,r3,r4 @ F_xx_xx
432 add r5,r5,r9 @ E+=X[i]
433 add r5,r5,r10 @ E+=F_40_59(B,C,D)
434 add r5,r5,r11,ror#2
435 ldr r9,[r14,#15*4]
436 ldr r10,[r14,#13*4]
437 ldr r11,[r14,#7*4]
438 add r4,r8,r4,ror#2 @ E+=K_xx_xx
439 ldr r12,[r14,#2*4]
440 eor r9,r9,r10
441 eor r11,r11,r12 @ 1 cycle stall
442 eor r10,r7,r3 @ F_xx_xx
443 mov r9,r9,ror#31
444 add r4,r4,r5,ror#27 @ E+=ROR(A,27)
445 eor r9,r9,r11,ror#31
446 str r9,[r14,#-4]!
447 and r10,r6,r10,ror#2 @ F_xx_xx
448 and r11,r7,r3 @ F_xx_xx
449 add r4,r4,r9 @ E+=X[i]
450 add r4,r4,r10 @ E+=F_40_59(B,C,D)
451 add r4,r4,r11,ror#2
452 ldr r9,[r14,#15*4]
453 ldr r10,[r14,#13*4]
454 ldr r11,[r14,#7*4]
455 add r3,r8,r3,ror#2 @ E+=K_xx_xx
456 ldr r12,[r14,#2*4]
457 eor r9,r9,r10
458 eor r11,r11,r12 @ 1 cycle stall
459 eor r10,r6,r7 @ F_xx_xx
460 mov r9,r9,ror#31
461 add r3,r3,r4,ror#27 @ E+=ROR(A,27)
462 eor r9,r9,r11,ror#31
463 str r9,[r14,#-4]!
464 and r10,r5,r10,ror#2 @ F_xx_xx
465 and r11,r6,r7 @ F_xx_xx
466 add r3,r3,r9 @ E+=X[i]
467 add r3,r3,r10 @ E+=F_40_59(B,C,D)
468 add r3,r3,r11,ror#2
469 teq r14,sp
470 bne .L_40_59 @ [+((12+5)*5+2)*4]
471
472 ldr r8,.LK_60_79
473 sub sp,sp,#20*4
474 cmp sp,#0 @ set carry to denote 60_79
475 b .L_20_39_or_60_79 @ [+4], spare 300 bytes
476.L_done:
477 add sp,sp,#80*4 @ "deallocate" stack frame
478 ldmia r0,{r8,r9,r10,r11,r12}
479 add r3,r8,r3
480 add r4,r9,r4
481 add r5,r10,r5,ror#2
482 add r6,r11,r6,ror#2
483 add r7,r12,r7,ror#2
484 stmia r0,{r3,r4,r5,r6,r7}
485 teq r1,r2
486 bne .Lloop @ [+18], total 1307
487
488#if __ARM_ARCH__>=5
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
497.LK_00_19: .word 0x5a827999
498.LK_20_39: .word 0x6ed9eba1
499.LK_40_59: .word 0x8f1bbcdc
500.LK_60_79: .word 0xca62c1d6
501.size sha1_block_data_order,.-sha1_block_data_order
502.asciz "SHA1 block transform for ARMv4, CRYPTOGAMS by <appro@openssl.org>"
503.align 2
diff --git a/arch/arm/crypto/sha1_glue.c b/arch/arm/crypto/sha1_glue.c
new file mode 100644
index 00000000000..76cd976230b
--- /dev/null
+++ b/arch/arm/crypto/sha1_glue.c
@@ -0,0 +1,179 @@
1/*
2 * Cryptographic API.
3 * Glue code for the SHA1 Secure Hash Algorithm assembler implementation
4 *
5 * This file is based on sha1_generic.c and sha1_ssse3_glue.c
6 *
7 * Copyright (c) Alan Smithee.
8 * Copyright (c) Andrew McDonald <andrew@mcdonald.org.uk>
9 * Copyright (c) Jean-Francois Dive <jef@linuxbe.org>
10 * Copyright (c) Mathias Krause <minipli@googlemail.com>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the Free
14 * Software Foundation; either version 2 of the License, or (at your option)
15 * any later version.
16 *
17 */
18
19#include <crypto/internal/hash.h>
20#include <linux/init.h>
21#include <linux/module.h>
22#include <linux/cryptohash.h>
23#include <linux/types.h>
24#include <crypto/sha.h>
25#include <asm/byteorder.h>
26
27struct SHA1_CTX {
28 uint32_t h0,h1,h2,h3,h4;
29 u64 count;
30 u8 data[SHA1_BLOCK_SIZE];
31};
32
33asmlinkage void sha1_block_data_order(struct SHA1_CTX *digest,
34 const unsigned char *data, unsigned int rounds);
35
36
37static int sha1_init(struct shash_desc *desc)
38{
39 struct SHA1_CTX *sctx = shash_desc_ctx(desc);
40 memset(sctx, 0, sizeof(*sctx));
41 sctx->h0 = SHA1_H0;
42 sctx->h1 = SHA1_H1;
43 sctx->h2 = SHA1_H2;
44 sctx->h3 = SHA1_H3;
45 sctx->h4 = SHA1_H4;
46 return 0;
47}
48
49
50static int __sha1_update(struct SHA1_CTX *sctx, const u8 *data,
51 unsigned int len, unsigned int partial)
52{
53 unsigned int done = 0;
54
55 sctx->count += len;
56
57 if (partial) {
58 done = SHA1_BLOCK_SIZE - partial;
59 memcpy(sctx->data + partial, data, done);
60 sha1_block_data_order(sctx, sctx->data, 1);
61 }
62
63 if (len - done >= SHA1_BLOCK_SIZE) {
64 const unsigned int rounds = (len - done) / SHA1_BLOCK_SIZE;
65 sha1_block_data_order(sctx, data + done, rounds);
66 done += rounds * SHA1_BLOCK_SIZE;
67 }
68
69 memcpy(sctx->data, data + done, len - done);
70 return 0;
71}
72
73
74static int sha1_update(struct shash_desc *desc, const u8 *data,
75 unsigned int len)
76{
77 struct SHA1_CTX *sctx = shash_desc_ctx(desc);
78 unsigned int partial = sctx->count % SHA1_BLOCK_SIZE;
79 int res;
80
81 /* Handle the fast case right here */
82 if (partial + len < SHA1_BLOCK_SIZE) {
83 sctx->count += len;
84 memcpy(sctx->data + partial, data, len);
85 return 0;
86 }
87 res = __sha1_update(sctx, data, len, partial);
88 return res;
89}
90
91
92/* Add padding and return the message digest. */
93static int sha1_final(struct shash_desc *desc, u8 *out)
94{
95 struct SHA1_CTX *sctx = shash_desc_ctx(desc);
96 unsigned int i, index, padlen;
97 __be32 *dst = (__be32 *)out;
98 __be64 bits;
99 static const u8 padding[SHA1_BLOCK_SIZE] = { 0x80, };
100
101 bits = cpu_to_be64(sctx->count << 3);
102
103 /* Pad out to 56 mod 64 and append length */
104 index = sctx->count % SHA1_BLOCK_SIZE;
105 padlen = (index < 56) ? (56 - index) : ((SHA1_BLOCK_SIZE+56) - index);
106 /* We need to fill a whole block for __sha1_update() */
107 if (padlen <= 56) {
108 sctx->count += padlen;
109 memcpy(sctx->data + index, padding, padlen);
110 } else {
111 __sha1_update(sctx, padding, padlen, index);
112 }
113 __sha1_update(sctx, (const u8 *)&bits, sizeof(bits), 56);
114
115 /* Store state in digest */
116 for (i = 0; i < 5; i++)
117 dst[i] = cpu_to_be32(((u32 *)sctx)[i]);
118
119 /* Wipe context */
120 memset(sctx, 0, sizeof(*sctx));
121 return 0;
122}
123
124
125static int sha1_export(struct shash_desc *desc, void *out)
126{
127 struct SHA1_CTX *sctx = shash_desc_ctx(desc);
128 memcpy(out, sctx, sizeof(*sctx));
129 return 0;
130}
131
132
133static int sha1_import(struct shash_desc *desc, const void *in)
134{
135 struct SHA1_CTX *sctx = shash_desc_ctx(desc);
136 memcpy(sctx, in, sizeof(*sctx));
137 return 0;
138}
139
140
141static struct shash_alg alg = {
142 .digestsize = SHA1_DIGEST_SIZE,
143 .init = sha1_init,
144 .update = sha1_update,
145 .final = sha1_final,
146 .export = sha1_export,
147 .import = sha1_import,
148 .descsize = sizeof(struct SHA1_CTX),
149 .statesize = sizeof(struct SHA1_CTX),
150 .base = {
151 .cra_name = "sha1",
152 .cra_driver_name= "sha1-asm",
153 .cra_priority = 150,
154 .cra_flags = CRYPTO_ALG_TYPE_SHASH,
155 .cra_blocksize = SHA1_BLOCK_SIZE,
156 .cra_module = THIS_MODULE,
157 }
158};
159
160
161static int __init sha1_mod_init(void)
162{
163 return crypto_register_shash(&alg);
164}
165
166
167static void __exit sha1_mod_fini(void)
168{
169 crypto_unregister_shash(&alg);
170}
171
172
173module_init(sha1_mod_init);
174module_exit(sha1_mod_fini);
175
176MODULE_LICENSE("GPL");
177MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm (ARM)");
178MODULE_ALIAS("sha1");
179MODULE_AUTHOR("David McCullough <ucdevel@gmail.com>");
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
index 960abceb8e1..f70ae175a3d 100644
--- a/arch/arm/include/asm/Kbuild
+++ b/arch/arm/include/asm/Kbuild
@@ -1,20 +1,35 @@
1include include/asm-generic/Kbuild.asm
2 1
3header-y += hwcap.h
4 2
5generic-y += auxvec.h 3generic-y += auxvec.h
6generic-y += bitsperlong.h 4generic-y += bitsperlong.h
7generic-y += cputime.h 5generic-y += cputime.h
6generic-y += current.h
8generic-y += emergency-restart.h 7generic-y += emergency-restart.h
9generic-y += errno.h 8generic-y += errno.h
9generic-y += exec.h
10generic-y += ioctl.h 10generic-y += ioctl.h
11generic-y += ipcbuf.h
11generic-y += irq_regs.h 12generic-y += irq_regs.h
12generic-y += kdebug.h 13generic-y += kdebug.h
13generic-y += local.h 14generic-y += local.h
14generic-y += local64.h 15generic-y += local64.h
16generic-y += msgbuf.h
17generic-y += param.h
18generic-y += parport.h
15generic-y += percpu.h 19generic-y += percpu.h
16generic-y += poll.h 20generic-y += poll.h
17generic-y += resource.h 21generic-y += resource.h
18generic-y += sections.h 22generic-y += sections.h
23generic-y += segment.h
24generic-y += sembuf.h
25generic-y += serial.h
26generic-y += shmbuf.h
19generic-y += siginfo.h 27generic-y += siginfo.h
20generic-y += sizes.h 28generic-y += sizes.h
29generic-y += socket.h
30generic-y += sockios.h
31generic-y += termbits.h
32generic-y += termios.h
33generic-y += timex.h
34generic-y += types.h
35generic-y += unaligned.h
diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h
index 62e75475e57..d40229d9a1c 100644
--- a/arch/arm/include/asm/arch_timer.h
+++ b/arch/arm/include/asm/arch_timer.h
@@ -2,11 +2,12 @@
2#define __ASMARM_ARCH_TIMER_H 2#define __ASMARM_ARCH_TIMER_H
3 3
4#include <asm/errno.h> 4#include <asm/errno.h>
5#include <linux/clocksource.h>
5 6
6#ifdef CONFIG_ARM_ARCH_TIMER 7#ifdef CONFIG_ARM_ARCH_TIMER
7#define ARCH_HAS_READ_CURRENT_TIMER
8int arch_timer_of_register(void); 8int arch_timer_of_register(void);
9int arch_timer_sched_clock_init(void); 9int arch_timer_sched_clock_init(void);
10struct timecounter *arch_timer_get_timecounter(void);
10#else 11#else
11static inline int arch_timer_of_register(void) 12static inline int arch_timer_of_register(void)
12{ 13{
@@ -17,6 +18,11 @@ static inline int arch_timer_sched_clock_init(void)
17{ 18{
18 return -ENXIO; 19 return -ENXIO;
19} 20}
21
22static inline struct timecounter *arch_timer_get_timecounter(void)
23{
24 return NULL;
25}
20#endif 26#endif
21 27
22#endif 28#endif
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index 03fb93621d0..2ef95813fce 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -22,6 +22,7 @@
22 22
23#include <asm/ptrace.h> 23#include <asm/ptrace.h>
24#include <asm/domain.h> 24#include <asm/domain.h>
25#include <asm/opcodes-virt.h>
25 26
26#define IOMEM(x) (x) 27#define IOMEM(x) (x)
27 28
@@ -240,6 +241,34 @@
240#endif 241#endif
241 242
242/* 243/*
244 * Helper macro to enter SVC mode cleanly and mask interrupts. reg is
245 * a scratch register for the macro to overwrite.
246 *
247 * This macro is intended for forcing the CPU into SVC mode at boot time.
248 * you cannot return to the original mode.
249 *
250 * Beware, it also clobers LR.
251 */
252.macro safe_svcmode_maskall reg:req
253 mrs \reg , cpsr
254 mov lr , \reg
255 and lr , lr , #MODE_MASK
256 cmp lr , #HYP_MODE
257 orr \reg , \reg , #PSR_I_BIT | PSR_F_BIT
258 bic \reg , \reg , #MODE_MASK
259 orr \reg , \reg , #SVC_MODE
260THUMB( orr \reg , \reg , #PSR_T_BIT )
261 bne 1f
262 orr \reg, \reg, #PSR_A_BIT
263 adr lr, BSYM(2f)
264 msr spsr_cxsf, \reg
265 __MSR_ELR_HYP(14)
266 __ERET
2671: msr cpsr_c, \reg
2682:
269.endm
270
271/*
243 * STRT/LDRT access macros with ARM and Thumb-2 variants 272 * STRT/LDRT access macros with ARM and Thumb-2 variants
244 */ 273 */
245#ifdef CONFIG_THUMB2_KERNEL 274#ifdef CONFIG_THUMB2_KERNEL
@@ -320,4 +349,12 @@
320 .size \name , . - \name 349 .size \name , . - \name
321 .endm 350 .endm
322 351
352 .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req
353#ifndef CONFIG_CPU_USE_DOMAINS
354 adds \tmp, \addr, #\size - 1
355 sbcccs \tmp, \tmp, \limit
356 bcs \bad
357#endif
358 .endm
359
323#endif /* __ASM_ASSEMBLER_H__ */ 360#endif /* __ASM_ASSEMBLER_H__ */
diff --git a/arch/arm/include/asm/barrier.h b/arch/arm/include/asm/barrier.h
index 05112380dc5..8dcd9c702d9 100644
--- a/arch/arm/include/asm/barrier.h
+++ b/arch/arm/include/asm/barrier.h
@@ -44,10 +44,9 @@
44#define rmb() dsb() 44#define rmb() dsb()
45#define wmb() mb() 45#define wmb() mb()
46#else 46#else
47#include <asm/memory.h> 47#define mb() barrier()
48#define mb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0) 48#define rmb() barrier()
49#define rmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0) 49#define wmb() barrier()
50#define wmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
51#endif 50#endif
52 51
53#ifndef CONFIG_SMP 52#ifndef CONFIG_SMP
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
index e4448e16046..e1489c54cd1 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -49,6 +49,13 @@
49 * 49 *
50 * Unconditionally clean and invalidate the entire cache. 50 * Unconditionally clean and invalidate the entire cache.
51 * 51 *
52 * flush_kern_louis()
53 *
54 * Flush data cache levels up to the level of unification
55 * inner shareable and invalidate the I-cache.
56 * Only needed from v7 onwards, falls back to flush_cache_all()
57 * for all other processor versions.
58 *
52 * flush_user_all() 59 * flush_user_all()
53 * 60 *
54 * Clean and invalidate all user space cache entries 61 * Clean and invalidate all user space cache entries
@@ -97,6 +104,7 @@
97struct cpu_cache_fns { 104struct cpu_cache_fns {
98 void (*flush_icache_all)(void); 105 void (*flush_icache_all)(void);
99 void (*flush_kern_all)(void); 106 void (*flush_kern_all)(void);
107 void (*flush_kern_louis)(void);
100 void (*flush_user_all)(void); 108 void (*flush_user_all)(void);
101 void (*flush_user_range)(unsigned long, unsigned long, unsigned int); 109 void (*flush_user_range)(unsigned long, unsigned long, unsigned int);
102 110
@@ -119,6 +127,7 @@ extern struct cpu_cache_fns cpu_cache;
119 127
120#define __cpuc_flush_icache_all cpu_cache.flush_icache_all 128#define __cpuc_flush_icache_all cpu_cache.flush_icache_all
121#define __cpuc_flush_kern_all cpu_cache.flush_kern_all 129#define __cpuc_flush_kern_all cpu_cache.flush_kern_all
130#define __cpuc_flush_kern_louis cpu_cache.flush_kern_louis
122#define __cpuc_flush_user_all cpu_cache.flush_user_all 131#define __cpuc_flush_user_all cpu_cache.flush_user_all
123#define __cpuc_flush_user_range cpu_cache.flush_user_range 132#define __cpuc_flush_user_range cpu_cache.flush_user_range
124#define __cpuc_coherent_kern_range cpu_cache.coherent_kern_range 133#define __cpuc_coherent_kern_range cpu_cache.coherent_kern_range
@@ -139,6 +148,7 @@ extern struct cpu_cache_fns cpu_cache;
139 148
140extern void __cpuc_flush_icache_all(void); 149extern void __cpuc_flush_icache_all(void);
141extern void __cpuc_flush_kern_all(void); 150extern void __cpuc_flush_kern_all(void);
151extern void __cpuc_flush_kern_louis(void);
142extern void __cpuc_flush_user_all(void); 152extern void __cpuc_flush_user_all(void);
143extern void __cpuc_flush_user_range(unsigned long, unsigned long, unsigned int); 153extern void __cpuc_flush_user_range(unsigned long, unsigned long, unsigned int);
144extern void __cpuc_coherent_kern_range(unsigned long, unsigned long); 154extern void __cpuc_coherent_kern_range(unsigned long, unsigned long);
@@ -204,6 +214,11 @@ static inline void __flush_icache_all(void)
204 __flush_icache_preferred(); 214 __flush_icache_preferred();
205} 215}
206 216
217/*
218 * Flush caches up to Level of Unification Inner Shareable
219 */
220#define flush_cache_louis() __cpuc_flush_kern_louis()
221
207#define flush_cache_all() __cpuc_flush_kern_all() 222#define flush_cache_all() __cpuc_flush_kern_all()
208 223
209static inline void vivt_flush_cache_mm(struct mm_struct *mm) 224static inline void vivt_flush_cache_mm(struct mm_struct *mm)
diff --git a/arch/arm/include/asm/current.h b/arch/arm/include/asm/current.h
deleted file mode 100644
index 75d21e2a3ff..00000000000
--- a/arch/arm/include/asm/current.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef _ASMARM_CURRENT_H
2#define _ASMARM_CURRENT_H
3
4#include <linux/thread_info.h>
5
6static inline struct task_struct *get_current(void) __attribute_const__;
7
8static inline struct task_struct *get_current(void)
9{
10 return current_thread_info()->task;
11}
12
13#define current (get_current())
14
15#endif /* _ASMARM_CURRENT_H */
diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h
index dc6145120de..ab98fdd083b 100644
--- a/arch/arm/include/asm/delay.h
+++ b/arch/arm/include/asm/delay.h
@@ -15,6 +15,11 @@
15 15
16#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
17 17
18struct delay_timer {
19 unsigned long (*read_current_timer)(void);
20 unsigned long freq;
21};
22
18extern struct arm_delay_ops { 23extern struct arm_delay_ops {
19 void (*delay)(unsigned long); 24 void (*delay)(unsigned long);
20 void (*const_udelay)(unsigned long); 25 void (*const_udelay)(unsigned long);
@@ -56,6 +61,10 @@ extern void __loop_delay(unsigned long loops);
56extern void __loop_udelay(unsigned long usecs); 61extern void __loop_udelay(unsigned long usecs);
57extern void __loop_const_udelay(unsigned long); 62extern void __loop_const_udelay(unsigned long);
58 63
64/* Delay-loop timer registration. */
65#define ARCH_HAS_READ_CURRENT_TIMER
66extern void register_current_timer_delay(const struct delay_timer *timer);
67
59#endif /* __ASSEMBLY__ */ 68#endif /* __ASSEMBLY__ */
60 69
61#endif /* defined(_ARM_DELAY_H) */ 70#endif /* defined(_ARM_DELAY_H) */
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
index 5c44dcb0987..23004847bb0 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -13,6 +13,7 @@
13 13
14#define DMA_ERROR_CODE (~0) 14#define DMA_ERROR_CODE (~0)
15extern struct dma_map_ops arm_dma_ops; 15extern struct dma_map_ops arm_dma_ops;
16extern struct dma_map_ops arm_coherent_dma_ops;
16 17
17static inline struct dma_map_ops *get_dma_ops(struct device *dev) 18static inline struct dma_map_ops *get_dma_ops(struct device *dev)
18{ 19{
diff --git a/arch/arm/include/asm/exec.h b/arch/arm/include/asm/exec.h
deleted file mode 100644
index 7c4fbef72b3..00000000000
--- a/arch/arm/include/asm/exec.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_ARM_EXEC_H
2#define __ASM_ARM_EXEC_H
3
4#define arch_align_stack(x) (x)
5
6#endif /* __ASM_ARM_EXEC_H */
diff --git a/arch/arm/include/asm/glue-cache.h b/arch/arm/include/asm/glue-cache.h
index 7e30874377e..cca9f15704e 100644
--- a/arch/arm/include/asm/glue-cache.h
+++ b/arch/arm/include/asm/glue-cache.h
@@ -110,19 +110,19 @@
110#endif 110#endif
111 111
112#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) 112#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
113//# ifdef _CACHE 113# ifdef _CACHE
114# define MULTI_CACHE 1 114# define MULTI_CACHE 1
115//# else 115# else
116//# define _CACHE v6 116# define _CACHE v6
117//# endif 117# endif
118#endif 118#endif
119 119
120#if defined(CONFIG_CPU_V7) 120#if defined(CONFIG_CPU_V7)
121//# ifdef _CACHE 121# ifdef _CACHE
122# define MULTI_CACHE 1 122# define MULTI_CACHE 1
123//# else 123# else
124//# define _CACHE v7 124# define _CACHE v7
125//# endif 125# endif
126#endif 126#endif
127 127
128#if !defined(_CACHE) && !defined(MULTI_CACHE) 128#if !defined(_CACHE) && !defined(MULTI_CACHE)
@@ -132,6 +132,7 @@
132#ifndef MULTI_CACHE 132#ifndef MULTI_CACHE
133#define __cpuc_flush_icache_all __glue(_CACHE,_flush_icache_all) 133#define __cpuc_flush_icache_all __glue(_CACHE,_flush_icache_all)
134#define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all) 134#define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all)
135#define __cpuc_flush_kern_louis __glue(_CACHE,_flush_kern_cache_louis)
135#define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all) 136#define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all)
136#define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range) 137#define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
137#define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range) 138#define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index c402e9b31f4..477e0206e01 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -6,7 +6,9 @@
6#endif 6#endif
7 7
8/* not all ARM platforms necessarily support this API ... */ 8/* not all ARM platforms necessarily support this API ... */
9#ifdef CONFIG_NEED_MACH_GPIO_H
9#include <mach/gpio.h> 10#include <mach/gpio.h>
11#endif
10 12
11#ifndef __ARM_GPIOLIB_COMPLEX 13#ifndef __ARM_GPIOLIB_COMPLEX
12/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */ 14/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
diff --git a/arch/arm/include/asm/hardirq.h b/arch/arm/include/asm/hardirq.h
index 436e60b2cf7..2740c2a2df6 100644
--- a/arch/arm/include/asm/hardirq.h
+++ b/arch/arm/include/asm/hardirq.h
@@ -5,7 +5,7 @@
5#include <linux/threads.h> 5#include <linux/threads.h>
6#include <asm/irq.h> 6#include <asm/irq.h>
7 7
8#define NR_IPI 5 8#define NR_IPI 6
9 9
10typedef struct { 10typedef struct {
11 unsigned int __softirq_pending; 11 unsigned int __softirq_pending;
diff --git a/arch/arm/include/asm/hardware/cache-tauros2.h b/arch/arm/include/asm/hardware/cache-tauros2.h
index 538f17ca905..295e2e40151 100644
--- a/arch/arm/include/asm/hardware/cache-tauros2.h
+++ b/arch/arm/include/asm/hardware/cache-tauros2.h
@@ -8,4 +8,7 @@
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10 10
11extern void __init tauros2_init(void); 11#define CACHE_TAUROS2_PREFETCH_ON (1 << 0)
12#define CACHE_TAUROS2_LINEFILL_BURST8 (1 << 1)
13
14extern void __init tauros2_init(unsigned int features);
diff --git a/arch/arm/include/asm/hardware/iop3xx.h b/arch/arm/include/asm/hardware/iop3xx.h
index 2ff2c75a463..02fe2fbe247 100644
--- a/arch/arm/include/asm/hardware/iop3xx.h
+++ b/arch/arm/include/asm/hardware/iop3xx.h
@@ -217,18 +217,8 @@ extern int iop3xx_get_init_atu(void);
217#define IOP3XX_PCI_LOWER_MEM_PA 0x80000000 217#define IOP3XX_PCI_LOWER_MEM_PA 0x80000000
218#define IOP3XX_PCI_MEM_WINDOW_SIZE 0x08000000 218#define IOP3XX_PCI_MEM_WINDOW_SIZE 0x08000000
219 219
220#define IOP3XX_PCI_IO_WINDOW_SIZE 0x00010000
221#define IOP3XX_PCI_LOWER_IO_PA 0x90000000 220#define IOP3XX_PCI_LOWER_IO_PA 0x90000000
222#define IOP3XX_PCI_LOWER_IO_VA 0xfe000000 221#define IOP3XX_PCI_LOWER_IO_BA 0x00000000
223#define IOP3XX_PCI_LOWER_IO_BA 0x90000000
224#define IOP3XX_PCI_UPPER_IO_PA (IOP3XX_PCI_LOWER_IO_PA +\
225 IOP3XX_PCI_IO_WINDOW_SIZE - 1)
226#define IOP3XX_PCI_UPPER_IO_VA (IOP3XX_PCI_LOWER_IO_VA +\
227 IOP3XX_PCI_IO_WINDOW_SIZE - 1)
228#define IOP3XX_PCI_IO_PHYS_TO_VIRT(addr) (((u32) (addr) -\
229 IOP3XX_PCI_LOWER_IO_PA) +\
230 IOP3XX_PCI_LOWER_IO_VA)
231
232 222
233#ifndef __ASSEMBLY__ 223#ifndef __ASSEMBLY__
234 224
diff --git a/arch/arm/include/asm/hardware/linkup-l1110.h b/arch/arm/include/asm/hardware/linkup-l1110.h
deleted file mode 100644
index 7ec91168a57..00000000000
--- a/arch/arm/include/asm/hardware/linkup-l1110.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2*
3* Definitions for H3600 Handheld Computer
4*
5* Copyright 2001 Compaq Computer Corporation.
6*
7* Use consistent with the GNU GPL is permitted,
8* provided that this copyright notice is
9* preserved in its entirety in all copies and derived works.
10*
11* COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
12* AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
13* FITNESS FOR ANY PARTICULAR PURPOSE.
14*
15* Author: Jamey Hicks.
16*
17*/
18
19/* LinkUp Systems PCCard/CompactFlash Interface for SA-1100 */
20
21/* PC Card Status Register */
22#define LINKUP_PRS_S1 (1 << 0) /* voltage control bits S1-S4 */
23#define LINKUP_PRS_S2 (1 << 1)
24#define LINKUP_PRS_S3 (1 << 2)
25#define LINKUP_PRS_S4 (1 << 3)
26#define LINKUP_PRS_BVD1 (1 << 4)
27#define LINKUP_PRS_BVD2 (1 << 5)
28#define LINKUP_PRS_VS1 (1 << 6)
29#define LINKUP_PRS_VS2 (1 << 7)
30#define LINKUP_PRS_RDY (1 << 8)
31#define LINKUP_PRS_CD1 (1 << 9)
32#define LINKUP_PRS_CD2 (1 << 10)
33
34/* PC Card Command Register */
35#define LINKUP_PRC_S1 (1 << 0)
36#define LINKUP_PRC_S2 (1 << 1)
37#define LINKUP_PRC_S3 (1 << 2)
38#define LINKUP_PRC_S4 (1 << 3)
39#define LINKUP_PRC_RESET (1 << 4)
40#define LINKUP_PRC_APOE (1 << 5) /* Auto Power Off Enable: clears S1-S4 when either nCD goes high */
41#define LINKUP_PRC_CFE (1 << 6) /* CompactFlash mode Enable: addresses A[10:0] only, A[25:11] high */
42#define LINKUP_PRC_SOE (1 << 7) /* signal output driver enable */
43#define LINKUP_PRC_SSP (1 << 8) /* sock select polarity: 0 for socket 0, 1 for socket 1 */
44#define LINKUP_PRC_MBZ (1 << 15) /* must be zero */
45
46struct linkup_l1110 {
47 volatile short prc;
48};
diff --git a/arch/arm/include/asm/hwcap.h b/arch/arm/include/asm/hwcap.h
index 917626128a1..6ff56eca3f1 100644
--- a/arch/arm/include/asm/hwcap.h
+++ b/arch/arm/include/asm/hwcap.h
@@ -1,31 +1,8 @@
1#ifndef __ASMARM_HWCAP_H 1#ifndef __ASMARM_HWCAP_H
2#define __ASMARM_HWCAP_H 2#define __ASMARM_HWCAP_H
3 3
4/* 4#include <uapi/asm/hwcap.h>
5 * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
6 */
7#define HWCAP_SWP (1 << 0)
8#define HWCAP_HALF (1 << 1)
9#define HWCAP_THUMB (1 << 2)
10#define HWCAP_26BIT (1 << 3) /* Play it safe */
11#define HWCAP_FAST_MULT (1 << 4)
12#define HWCAP_FPA (1 << 5)
13#define HWCAP_VFP (1 << 6)
14#define HWCAP_EDSP (1 << 7)
15#define HWCAP_JAVA (1 << 8)
16#define HWCAP_IWMMXT (1 << 9)
17#define HWCAP_CRUNCH (1 << 10)
18#define HWCAP_THUMBEE (1 << 11)
19#define HWCAP_NEON (1 << 12)
20#define HWCAP_VFPv3 (1 << 13)
21#define HWCAP_VFPv3D16 (1 << 14)
22#define HWCAP_TLS (1 << 15)
23#define HWCAP_VFPv4 (1 << 16)
24#define HWCAP_IDIVA (1 << 17)
25#define HWCAP_IDIVT (1 << 18)
26#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
27 5
28#if defined(__KERNEL__)
29#if !defined(__ASSEMBLY__) 6#if !defined(__ASSEMBLY__)
30/* 7/*
31 * This yields a mask that user programs can use to figure out what 8 * This yields a mask that user programs can use to figure out what
@@ -35,5 +12,3 @@
35extern unsigned int elf_hwcap; 12extern unsigned int elf_hwcap;
36#endif 13#endif
37#endif 14#endif
38
39#endif
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 815c669fec0..35c1ed89b93 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -47,13 +47,68 @@ extern void __raw_readsb(const void __iomem *addr, void *data, int bytelen);
47extern void __raw_readsw(const void __iomem *addr, void *data, int wordlen); 47extern void __raw_readsw(const void __iomem *addr, void *data, int wordlen);
48extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); 48extern void __raw_readsl(const void __iomem *addr, void *data, int longlen);
49 49
50#define __raw_writeb(v,a) ((void)(__chk_io_ptr(a), *(volatile unsigned char __force *)(a) = (v))) 50#if __LINUX_ARM_ARCH__ < 6
51#define __raw_writew(v,a) ((void)(__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v))) 51/*
52#define __raw_writel(v,a) ((void)(__chk_io_ptr(a), *(volatile unsigned int __force *)(a) = (v))) 52 * Half-word accesses are problematic with RiscPC due to limitations of
53 * the bus. Rather than special-case the machine, just let the compiler
54 * generate the access for CPUs prior to ARMv6.
55 */
56#define __raw_readw(a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a))
57#define __raw_writew(v,a) ((void)(__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v)))
58#else
59/*
60 * When running under a hypervisor, we want to avoid I/O accesses with
61 * writeback addressing modes as these incur a significant performance
62 * overhead (the address generation must be emulated in software).
63 */
64static inline void __raw_writew(u16 val, volatile void __iomem *addr)
65{
66 asm volatile("strh %1, %0"
67 : "+Qo" (*(volatile u16 __force *)addr)
68 : "r" (val));
69}
70
71static inline u16 __raw_readw(const volatile void __iomem *addr)
72{
73 u16 val;
74 asm volatile("ldrh %1, %0"
75 : "+Qo" (*(volatile u16 __force *)addr),
76 "=r" (val));
77 return val;
78}
79#endif
80
81static inline void __raw_writeb(u8 val, volatile void __iomem *addr)
82{
83 asm volatile("strb %1, %0"
84 : "+Qo" (*(volatile u8 __force *)addr)
85 : "r" (val));
86}
87
88static inline void __raw_writel(u32 val, volatile void __iomem *addr)
89{
90 asm volatile("str %1, %0"
91 : "+Qo" (*(volatile u32 __force *)addr)
92 : "r" (val));
93}
94
95static inline u8 __raw_readb(const volatile void __iomem *addr)
96{
97 u8 val;
98 asm volatile("ldrb %1, %0"
99 : "+Qo" (*(volatile u8 __force *)addr),
100 "=r" (val));
101 return val;
102}
53 103
54#define __raw_readb(a) (__chk_io_ptr(a), *(volatile unsigned char __force *)(a)) 104static inline u32 __raw_readl(const volatile void __iomem *addr)
55#define __raw_readw(a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a)) 105{
56#define __raw_readl(a) (__chk_io_ptr(a), *(volatile unsigned int __force *)(a)) 106 u32 val;
107 asm volatile("ldr %1, %0"
108 : "+Qo" (*(volatile u32 __force *)addr),
109 "=r" (val));
110 return val;
111}
57 112
58/* 113/*
59 * Architecture ioremap implementation. 114 * Architecture ioremap implementation.
@@ -113,11 +168,19 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
113#define __iowmb() do { } while (0) 168#define __iowmb() do { } while (0)
114#endif 169#endif
115 170
171/* PCI fixed i/o mapping */
172#define PCI_IO_VIRT_BASE 0xfee00000
173
174extern int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr);
175
116/* 176/*
117 * Now, pick up the machine-defined IO definitions 177 * Now, pick up the machine-defined IO definitions
118 */ 178 */
119#ifdef CONFIG_NEED_MACH_IO_H 179#ifdef CONFIG_NEED_MACH_IO_H
120#include <mach/io.h> 180#include <mach/io.h>
181#elif defined(CONFIG_PCI)
182#define IO_SPACE_LIMIT ((resource_size_t)0xfffff)
183#define __io(a) __typesafe_io(PCI_IO_VIRT_BASE + ((a) & IO_SPACE_LIMIT))
121#else 184#else
122#define __io(a) __typesafe_io((a) & IO_SPACE_LIMIT) 185#define __io(a) __typesafe_io((a) & IO_SPACE_LIMIT)
123#endif 186#endif
diff --git a/arch/arm/include/asm/ipcbuf.h b/arch/arm/include/asm/ipcbuf.h
deleted file mode 100644
index 84c7e51cb6d..00000000000
--- a/arch/arm/include/asm/ipcbuf.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipcbuf.h>
diff --git a/arch/arm/include/asm/leds.h b/arch/arm/include/asm/leds.h
deleted file mode 100644
index c545739f39b..00000000000
--- a/arch/arm/include/asm/leds.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * arch/arm/include/asm/leds.h
3 *
4 * Copyright (C) 1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Event-driven interface for LEDs on machines
11 * Added led_start and led_stop- Alex Holden, 28th Dec 1998.
12 */
13#ifndef ASM_ARM_LEDS_H
14#define ASM_ARM_LEDS_H
15
16
17typedef enum {
18 led_idle_start,
19 led_idle_end,
20 led_timer,
21 led_start,
22 led_stop,
23 led_claim, /* override idle & timer leds */
24 led_release, /* restore idle & timer leds */
25 led_start_timer_mode,
26 led_stop_timer_mode,
27 led_green_on,
28 led_green_off,
29 led_amber_on,
30 led_amber_off,
31 led_red_on,
32 led_red_off,
33 led_blue_on,
34 led_blue_off,
35 /*
36 * I want this between led_timer and led_start, but
37 * someone has decided to export this to user space
38 */
39 led_halted
40} led_event_t;
41
42/* Use this routine to handle LEDs */
43
44#ifdef CONFIG_LEDS
45extern void (*leds_event)(led_event_t);
46#else
47#define leds_event(e)
48#endif
49
50#endif
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 0b1c94b8c65..917d4fcfd9b 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -14,6 +14,12 @@ struct tag;
14struct meminfo; 14struct meminfo;
15struct sys_timer; 15struct sys_timer;
16struct pt_regs; 16struct pt_regs;
17struct smp_operations;
18#ifdef CONFIG_SMP
19#define smp_ops(ops) (&(ops))
20#else
21#define smp_ops(ops) (struct smp_operations *)NULL
22#endif
17 23
18struct machine_desc { 24struct machine_desc {
19 unsigned int nr; /* architecture number */ 25 unsigned int nr; /* architecture number */
@@ -35,6 +41,7 @@ struct machine_desc {
35 unsigned char reserve_lp1 :1; /* never has lp1 */ 41 unsigned char reserve_lp1 :1; /* never has lp1 */
36 unsigned char reserve_lp2 :1; /* never has lp2 */ 42 unsigned char reserve_lp2 :1; /* never has lp2 */
37 char restart_mode; /* default restart mode */ 43 char restart_mode; /* default restart mode */
44 struct smp_operations *smp; /* SMP operations */
38 void (*fixup)(struct tag *, char **, 45 void (*fixup)(struct tag *, char **,
39 struct meminfo *); 46 struct meminfo *);
40 void (*reserve)(void);/* reserve mem blocks */ 47 void (*reserve)(void);/* reserve mem blocks */
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
index a6efcdd6fd2..195ac2f9d3d 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -9,6 +9,9 @@
9 * 9 *
10 * Page table mapping constructs and function prototypes 10 * Page table mapping constructs and function prototypes
11 */ 11 */
12#ifndef __ASM_MACH_MAP_H
13#define __ASM_MACH_MAP_H
14
12#include <asm/io.h> 15#include <asm/io.h>
13 16
14struct map_desc { 17struct map_desc {
@@ -34,6 +37,8 @@ struct map_desc {
34 37
35#ifdef CONFIG_MMU 38#ifdef CONFIG_MMU
36extern void iotable_init(struct map_desc *, int); 39extern void iotable_init(struct map_desc *, int);
40extern void vm_reserve_area_early(unsigned long addr, unsigned long size,
41 void *caller);
37 42
38struct mem_type; 43struct mem_type;
39extern const struct mem_type *get_mem_type(unsigned int type); 44extern const struct mem_type *get_mem_type(unsigned int type);
@@ -44,4 +49,7 @@ extern int ioremap_page(unsigned long virt, unsigned long phys,
44 const struct mem_type *mtype); 49 const struct mem_type *mtype);
45#else 50#else
46#define iotable_init(map,num) do { } while (0) 51#define iotable_init(map,num) do { } while (0)
52#define vm_reserve_area_early(a,s,c) do { } while (0)
53#endif
54
47#endif 55#endif
diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h
index 26c511fddf8..db9fedb57f2 100644
--- a/arch/arm/include/asm/mach/pci.h
+++ b/arch/arm/include/asm/mach/pci.h
@@ -11,6 +11,8 @@
11#ifndef __ASM_MACH_PCI_H 11#ifndef __ASM_MACH_PCI_H
12#define __ASM_MACH_PCI_H 12#define __ASM_MACH_PCI_H
13 13
14#include <linux/ioport.h>
15
14struct pci_sys_data; 16struct pci_sys_data;
15struct pci_ops; 17struct pci_ops;
16struct pci_bus; 18struct pci_bus;
@@ -42,6 +44,8 @@ struct pci_sys_data {
42 unsigned long io_offset; /* bus->cpu IO mapping offset */ 44 unsigned long io_offset; /* bus->cpu IO mapping offset */
43 struct pci_bus *bus; /* PCI bus */ 45 struct pci_bus *bus; /* PCI bus */
44 struct list_head resources; /* root bus resources (apertures) */ 46 struct list_head resources; /* root bus resources (apertures) */
47 struct resource io_res;
48 char io_res_name[12];
45 /* Bridge swizzling */ 49 /* Bridge swizzling */
46 u8 (*swizzle)(struct pci_dev *, u8 *); 50 u8 (*swizzle)(struct pci_dev *, u8 *);
47 /* IRQ mapping */ 51 /* IRQ mapping */
@@ -55,6 +59,15 @@ struct pci_sys_data {
55void pci_common_init(struct hw_pci *); 59void pci_common_init(struct hw_pci *);
56 60
57/* 61/*
62 * Setup early fixed I/O mapping.
63 */
64#if defined(CONFIG_PCI)
65extern void pci_map_io_early(unsigned long pfn);
66#else
67static inline void pci_map_io_early(unsigned long pfn) {}
68#endif
69
70/*
58 * PCI controllers 71 * PCI controllers
59 */ 72 */
60extern struct pci_ops iop3xx_ops; 73extern struct pci_ops iop3xx_ops;
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index e965f1b560f..73cf03aa981 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -187,6 +187,7 @@ static inline unsigned long __phys_to_virt(unsigned long x)
187#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) 187#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET)
188#endif 188#endif
189#endif 189#endif
190#endif /* __ASSEMBLY__ */
190 191
191#ifndef PHYS_OFFSET 192#ifndef PHYS_OFFSET
192#ifdef PLAT_PHYS_OFFSET 193#ifdef PLAT_PHYS_OFFSET
@@ -196,6 +197,8 @@ static inline unsigned long __phys_to_virt(unsigned long x)
196#endif 197#endif
197#endif 198#endif
198 199
200#ifndef __ASSEMBLY__
201
199/* 202/*
200 * PFNs are used to describe any physical page; this means 203 * PFNs are used to describe any physical page; this means
201 * PFN 0 == physical address 0. 204 * PFN 0 == physical address 0.
@@ -272,14 +275,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
272#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 275#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
273#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) 276#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
274 277
275/*
276 * Optional coherency support. Currently used only by selected
277 * Intel XSC3-based systems.
278 */
279#ifndef arch_is_coherent
280#define arch_is_coherent() 0
281#endif
282
283#endif 278#endif
284 279
285#include <asm-generic/memory_model.h> 280#include <asm-generic/memory_model.h>
diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index 6c6809f982f..0d3a28dbc8e 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -1,9 +1,7 @@
1#ifndef _ASM_ARM_MODULE_H 1#ifndef _ASM_ARM_MODULE_H
2#define _ASM_ARM_MODULE_H 2#define _ASM_ARM_MODULE_H
3 3
4#define Elf_Shdr Elf32_Shdr 4#include <asm-generic/module.h>
5#define Elf_Sym Elf32_Sym
6#define Elf_Ehdr Elf32_Ehdr
7 5
8struct unwind_table; 6struct unwind_table;
9 7
@@ -16,13 +14,11 @@ enum {
16 ARM_SEC_DEVEXIT, 14 ARM_SEC_DEVEXIT,
17 ARM_SEC_MAX, 15 ARM_SEC_MAX,
18}; 16};
19#endif
20 17
21struct mod_arch_specific { 18struct mod_arch_specific {
22#ifdef CONFIG_ARM_UNWIND
23 struct unwind_table *unwind[ARM_SEC_MAX]; 19 struct unwind_table *unwind[ARM_SEC_MAX];
24#endif
25}; 20};
21#endif
26 22
27/* 23/*
28 * Add the ARM architecture version to the version magic string 24 * Add the ARM architecture version to the version magic string
diff --git a/arch/arm/include/asm/msgbuf.h b/arch/arm/include/asm/msgbuf.h
deleted file mode 100644
index 33b35b946ea..00000000000
--- a/arch/arm/include/asm/msgbuf.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef _ASMARM_MSGBUF_H
2#define _ASMARM_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct msqid64_ds {
15 struct ipc64_perm msg_perm;
16 __kernel_time_t msg_stime; /* last msgsnd time */
17 unsigned long __unused1;
18 __kernel_time_t msg_rtime; /* last msgrcv time */
19 unsigned long __unused2;
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long __unused3;
22 unsigned long msg_cbytes; /* current number of bytes on queue */
23 unsigned long msg_qnum; /* number of messages in queue */
24 unsigned long msg_qbytes; /* max number of bytes on queue */
25 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
26 __kernel_pid_t msg_lrpid; /* last receive pid */
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31#endif /* _ASMARM_MSGBUF_H */
diff --git a/arch/arm/include/asm/mutex.h b/arch/arm/include/asm/mutex.h
index b1479fd04a9..87c044910fe 100644
--- a/arch/arm/include/asm/mutex.h
+++ b/arch/arm/include/asm/mutex.h
@@ -9,8 +9,13 @@
9#define _ASM_MUTEX_H 9#define _ASM_MUTEX_H
10/* 10/*
11 * On pre-ARMv6 hardware this results in a swp-based implementation, 11 * On pre-ARMv6 hardware this results in a swp-based implementation,
12 * which is the most efficient. For ARMv6+, we emit a pair of exclusive 12 * which is the most efficient. For ARMv6+, we have exclusive memory
13 * accesses instead. 13 * accessors and use atomic_dec to avoid the extra xchg operations
14 * on the locking slowpaths.
14 */ 15 */
16#if __LINUX_ARM_ARCH__ < 6
15#include <asm-generic/mutex-xchg.h> 17#include <asm-generic/mutex-xchg.h>
18#else
19#include <asm-generic/mutex-dec.h>
16#endif 20#endif
21#endif /* _ASM_MUTEX_H */
diff --git a/arch/arm/mach-mxs/include/mach/entry-macro.S b/arch/arm/include/asm/opcodes-virt.h
index 0c14259705b..efcfdf92d9d 100644
--- a/arch/arm/mach-mxs/include/mach/entry-macro.S
+++ b/arch/arm/include/asm/opcodes-virt.h
@@ -1,7 +1,6 @@
1/* 1/*
2 * Low-level IRQ helper macros for Freescale MXS-based 2 * opcodes-virt.h: Opcode definitions for the ARM virtualization extensions
3 * 3 * Copyright (C) 2012 Linaro Limited
4 * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
5 * 4 *
6 * This program is free software; you can redistribute it and/or modify 5 * 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 6 * it under the terms of the GNU General Public License as published by
@@ -17,19 +16,24 @@
17 * with this program; if not, write to the Free Software Foundation, Inc., 16 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */ 18 */
19#ifndef __ASM_ARM_OPCODES_VIRT_H
20#define __ASM_ARM_OPCODES_VIRT_H
21
22#include <asm/opcodes.h>
20 23
21#include <mach/mxs.h> 24#define __HVC(imm16) __inst_arm_thumb32( \
25 0xE1400070 | (((imm16) & 0xFFF0) << 4) | ((imm16) & 0x000F), \
26 0xF7E08000 | (((imm16) & 0xF000) << 4) | ((imm16) & 0x0FFF) \
27)
22 28
23#define MXS_ICOLL_VBASE MXS_IO_ADDRESS(MXS_ICOLL_BASE_ADDR) 29#define __ERET __inst_arm_thumb32( \
24#define HW_ICOLL_STAT_OFFSET 0x70 30 0xE160006E, \
31 0xF3DE8F00 \
32)
25 33
26 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 34#define __MSR_ELR_HYP(regnum) __inst_arm_thumb32( \
27 ldr \irqnr, [\base, #HW_ICOLL_STAT_OFFSET] 35 0xE12EF300 | regnum, \
28 cmp \irqnr, #0x7F 36 0xF3808E30 | (regnum << 16) \
29 strne \irqnr, [\base] 37)
30 moveqs \irqnr, #0
31 .endm
32 38
33 .macro get_irqnr_preamble, base, tmp 39#endif /* ! __ASM_ARM_OPCODES_VIRT_H */
34 ldr \base, =MXS_ICOLL_VBASE
35 .endm
diff --git a/arch/arm/include/asm/opcodes.h b/arch/arm/include/asm/opcodes.h
index 19c48deda70..74e211a6fb2 100644
--- a/arch/arm/include/asm/opcodes.h
+++ b/arch/arm/include/asm/opcodes.h
@@ -19,6 +19,33 @@ extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr);
19 19
20 20
21/* 21/*
22 * Assembler opcode byteswap helpers.
23 * These are only intended for use by this header: don't use them directly,
24 * because they will be suboptimal in most cases.
25 */
26#define ___asm_opcode_swab32(x) ( \
27 (((x) << 24) & 0xFF000000) \
28 | (((x) << 8) & 0x00FF0000) \
29 | (((x) >> 8) & 0x0000FF00) \
30 | (((x) >> 24) & 0x000000FF) \
31)
32#define ___asm_opcode_swab16(x) ( \
33 (((x) << 8) & 0xFF00) \
34 | (((x) >> 8) & 0x00FF) \
35)
36#define ___asm_opcode_swahb32(x) ( \
37 (((x) << 8) & 0xFF00FF00) \
38 | (((x) >> 8) & 0x00FF00FF) \
39)
40#define ___asm_opcode_swahw32(x) ( \
41 (((x) << 16) & 0xFFFF0000) \
42 | (((x) >> 16) & 0x0000FFFF) \
43)
44#define ___asm_opcode_identity32(x) ((x) & 0xFFFFFFFF)
45#define ___asm_opcode_identity16(x) ((x) & 0xFFFF)
46
47
48/*
22 * Opcode byteswap helpers 49 * Opcode byteswap helpers
23 * 50 *
24 * These macros help with converting instructions between a canonical integer 51 * These macros help with converting instructions between a canonical integer
@@ -41,39 +68,163 @@ extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr);
41 * Note that values in the range 0x0000E800..0xE7FFFFFF intentionally do not 68 * Note that values in the range 0x0000E800..0xE7FFFFFF intentionally do not
42 * represent any valid Thumb-2 instruction. For this range, 69 * represent any valid Thumb-2 instruction. For this range,
43 * __opcode_is_thumb32() and __opcode_is_thumb16() will both be false. 70 * __opcode_is_thumb32() and __opcode_is_thumb16() will both be false.
71 *
72 * The ___asm variants are intended only for use by this header, in situations
73 * involving inline assembler. For .S files, the normal __opcode_*() macros
74 * should do the right thing.
44 */ 75 */
76#ifdef __ASSEMBLY__
45 77
46#ifndef __ASSEMBLY__ 78#define ___opcode_swab32(x) ___asm_opcode_swab32(x)
79#define ___opcode_swab16(x) ___asm_opcode_swab16(x)
80#define ___opcode_swahb32(x) ___asm_opcode_swahb32(x)
81#define ___opcode_swahw32(x) ___asm_opcode_swahw32(x)
82#define ___opcode_identity32(x) ___asm_opcode_identity32(x)
83#define ___opcode_identity16(x) ___asm_opcode_identity16(x)
84
85#else /* ! __ASSEMBLY__ */
47 86
48#include <linux/types.h> 87#include <linux/types.h>
49#include <linux/swab.h> 88#include <linux/swab.h>
50 89
90#define ___opcode_swab32(x) swab32(x)
91#define ___opcode_swab16(x) swab16(x)
92#define ___opcode_swahb32(x) swahb32(x)
93#define ___opcode_swahw32(x) swahw32(x)
94#define ___opcode_identity32(x) ((u32)(x))
95#define ___opcode_identity16(x) ((u16)(x))
96
97#endif /* ! __ASSEMBLY__ */
98
99
51#ifdef CONFIG_CPU_ENDIAN_BE8 100#ifdef CONFIG_CPU_ENDIAN_BE8
52#define __opcode_to_mem_arm(x) swab32(x) 101
53#define __opcode_to_mem_thumb16(x) swab16(x) 102#define __opcode_to_mem_arm(x) ___opcode_swab32(x)
54#define __opcode_to_mem_thumb32(x) swahb32(x) 103#define __opcode_to_mem_thumb16(x) ___opcode_swab16(x)
55#else 104#define __opcode_to_mem_thumb32(x) ___opcode_swahb32(x)
56#define __opcode_to_mem_arm(x) ((u32)(x)) 105#define ___asm_opcode_to_mem_arm(x) ___asm_opcode_swab32(x)
57#define __opcode_to_mem_thumb16(x) ((u16)(x)) 106#define ___asm_opcode_to_mem_thumb16(x) ___asm_opcode_swab16(x)
58#define __opcode_to_mem_thumb32(x) swahw32(x) 107#define ___asm_opcode_to_mem_thumb32(x) ___asm_opcode_swahb32(x)
108
109#else /* ! CONFIG_CPU_ENDIAN_BE8 */
110
111#define __opcode_to_mem_arm(x) ___opcode_identity32(x)
112#define __opcode_to_mem_thumb16(x) ___opcode_identity16(x)
113#define ___asm_opcode_to_mem_arm(x) ___asm_opcode_identity32(x)
114#define ___asm_opcode_to_mem_thumb16(x) ___asm_opcode_identity16(x)
115#ifndef CONFIG_CPU_ENDIAN_BE32
116/*
117 * On BE32 systems, using 32-bit accesses to store Thumb instructions will not
118 * work in all cases, due to alignment constraints. For now, a correct
119 * version is not provided for BE32.
120 */
121#define __opcode_to_mem_thumb32(x) ___opcode_swahw32(x)
122#define ___asm_opcode_to_mem_thumb32(x) ___asm_opcode_swahw32(x)
59#endif 123#endif
60 124
125#endif /* ! CONFIG_CPU_ENDIAN_BE8 */
126
61#define __mem_to_opcode_arm(x) __opcode_to_mem_arm(x) 127#define __mem_to_opcode_arm(x) __opcode_to_mem_arm(x)
62#define __mem_to_opcode_thumb16(x) __opcode_to_mem_thumb16(x) 128#define __mem_to_opcode_thumb16(x) __opcode_to_mem_thumb16(x)
129#ifndef CONFIG_CPU_ENDIAN_BE32
63#define __mem_to_opcode_thumb32(x) __opcode_to_mem_thumb32(x) 130#define __mem_to_opcode_thumb32(x) __opcode_to_mem_thumb32(x)
131#endif
64 132
65/* Operations specific to Thumb opcodes */ 133/* Operations specific to Thumb opcodes */
66 134
67/* Instruction size checks: */ 135/* Instruction size checks: */
68#define __opcode_is_thumb32(x) ((u32)(x) >= 0xE8000000UL) 136#define __opcode_is_thumb32(x) ( \
69#define __opcode_is_thumb16(x) ((u32)(x) < 0xE800UL) 137 ((x) & 0xF8000000) == 0xE8000000 \
138 || ((x) & 0xF0000000) == 0xF0000000 \
139)
140#define __opcode_is_thumb16(x) ( \
141 ((x) & 0xFFFF0000) == 0 \
142 && !(((x) & 0xF800) == 0xE800 || ((x) & 0xF000) == 0xF000) \
143)
70 144
71/* Operations to construct or split 32-bit Thumb instructions: */ 145/* Operations to construct or split 32-bit Thumb instructions: */
72#define __opcode_thumb32_first(x) ((u16)((x) >> 16)) 146#define __opcode_thumb32_first(x) (___opcode_identity16((x) >> 16))
73#define __opcode_thumb32_second(x) ((u16)(x)) 147#define __opcode_thumb32_second(x) (___opcode_identity16(x))
74#define __opcode_thumb32_compose(first, second) \ 148#define __opcode_thumb32_compose(first, second) ( \
75 (((u32)(u16)(first) << 16) | (u32)(u16)(second)) 149 (___opcode_identity32(___opcode_identity16(first)) << 16) \
150 | ___opcode_identity32(___opcode_identity16(second)) \
151)
152#define ___asm_opcode_thumb32_first(x) (___asm_opcode_identity16((x) >> 16))
153#define ___asm_opcode_thumb32_second(x) (___asm_opcode_identity16(x))
154#define ___asm_opcode_thumb32_compose(first, second) ( \
155 (___asm_opcode_identity32(___asm_opcode_identity16(first)) << 16) \
156 | ___asm_opcode_identity32(___asm_opcode_identity16(second)) \
157)
76 158
77#endif /* __ASSEMBLY__ */ 159/*
160 * Opcode injection helpers
161 *
162 * In rare cases it is necessary to assemble an opcode which the
163 * assembler does not support directly, or which would normally be
164 * rejected because of the CFLAGS or AFLAGS used to build the affected
165 * file.
166 *
167 * Before using these macros, consider carefully whether it is feasible
168 * instead to change the build flags for your file, or whether it really
169 * makes sense to support old assembler versions when building that
170 * particular kernel feature.
171 *
172 * The macros defined here should only be used where there is no viable
173 * alternative.
174 *
175 *
176 * __inst_arm(x): emit the specified ARM opcode
177 * __inst_thumb16(x): emit the specified 16-bit Thumb opcode
178 * __inst_thumb32(x): emit the specified 32-bit Thumb opcode
179 *
180 * __inst_arm_thumb16(arm, thumb): emit either the specified arm or
181 * 16-bit Thumb opcode, depending on whether an ARM or Thumb-2
182 * kernel is being built
183 *
184 * __inst_arm_thumb32(arm, thumb): emit either the specified arm or
185 * 32-bit Thumb opcode, depending on whether an ARM or Thumb-2
186 * kernel is being built
187 *
188 *
189 * Note that using these macros directly is poor practice. Instead, you
190 * should use them to define human-readable wrapper macros to encode the
191 * instructions that you care about. In code which might run on ARMv7 or
192 * above, you can usually use the __inst_arm_thumb{16,32} macros to
193 * specify the ARM and Thumb alternatives at the same time. This ensures
194 * that the correct opcode gets emitted depending on the instruction set
195 * used for the kernel build.
196 *
197 * Look at opcodes-virt.h for an example of how to use these macros.
198 */
199#include <linux/stringify.h>
200
201#define __inst_arm(x) ___inst_arm(___asm_opcode_to_mem_arm(x))
202#define __inst_thumb32(x) ___inst_thumb32( \
203 ___asm_opcode_to_mem_thumb16(___asm_opcode_thumb32_first(x)), \
204 ___asm_opcode_to_mem_thumb16(___asm_opcode_thumb32_second(x)) \
205)
206#define __inst_thumb16(x) ___inst_thumb16(___asm_opcode_to_mem_thumb16(x))
207
208#ifdef CONFIG_THUMB2_KERNEL
209#define __inst_arm_thumb16(arm_opcode, thumb_opcode) \
210 __inst_thumb16(thumb_opcode)
211#define __inst_arm_thumb32(arm_opcode, thumb_opcode) \
212 __inst_thumb32(thumb_opcode)
213#else
214#define __inst_arm_thumb16(arm_opcode, thumb_opcode) __inst_arm(arm_opcode)
215#define __inst_arm_thumb32(arm_opcode, thumb_opcode) __inst_arm(arm_opcode)
216#endif
217
218/* Helpers for the helpers. Don't use these directly. */
219#ifdef __ASSEMBLY__
220#define ___inst_arm(x) .long x
221#define ___inst_thumb16(x) .short x
222#define ___inst_thumb32(first, second) .short first, second
223#else
224#define ___inst_arm(x) ".long " __stringify(x) "\n\t"
225#define ___inst_thumb16(x) ".short " __stringify(x) "\n\t"
226#define ___inst_thumb32(first, second) \
227 ".short " __stringify(first) ", " __stringify(second) "\n\t"
228#endif
78 229
79#endif /* __ASM_ARM_OPCODES_H */ 230#endif /* __ASM_ARM_OPCODES_H */
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
index ecf901902e4..812a4944e78 100644
--- a/arch/arm/include/asm/page.h
+++ b/arch/arm/include/asm/page.h
@@ -19,7 +19,7 @@
19 19
20#ifndef CONFIG_MMU 20#ifndef CONFIG_MMU
21 21
22#include "page-nommu.h" 22#include <asm/page-nommu.h>
23 23
24#else 24#else
25 25
diff --git a/arch/arm/include/asm/param.h b/arch/arm/include/asm/param.h
deleted file mode 100644
index 8b24bf94c06..00000000000
--- a/arch/arm/include/asm/param.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * arch/arm/include/asm/param.h
3 *
4 * Copyright (C) 1995-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_PARAM_H
11#define __ASM_PARAM_H
12
13#ifdef __KERNEL__
14# define HZ CONFIG_HZ /* Internal kernel timer frequency */
15# define USER_HZ 100 /* User interfaces are in "ticks" */
16# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
17#else
18# define HZ 100
19#endif
20
21#define EXEC_PAGESIZE 4096
22
23#ifndef NOGROUP
24#define NOGROUP (-1)
25#endif
26
27/* max length of hostname */
28#define MAXHOSTNAMELEN 64
29
30#endif
31
diff --git a/arch/arm/include/asm/parport.h b/arch/arm/include/asm/parport.h
deleted file mode 100644
index 26e94b09035..00000000000
--- a/arch/arm/include/asm/parport.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * arch/arm/include/asm/parport.h: ARM-specific parport initialisation
3 *
4 * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
5 *
6 * This file should only be included by drivers/parport/parport_pc.c.
7 */
8
9#ifndef __ASMARM_PARPORT_H
10#define __ASMARM_PARPORT_H
11
12static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
13static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
14{
15 return parport_pc_find_isa_ports (autoirq, autodma);
16}
17
18#endif /* !(_ASMARM_PARPORT_H) */
diff --git a/arch/arm/include/asm/perf_event.h b/arch/arm/include/asm/perf_event.h
index e074948d814..625cd621a43 100644
--- a/arch/arm/include/asm/perf_event.h
+++ b/arch/arm/include/asm/perf_event.h
@@ -12,6 +12,13 @@
12#ifndef __ARM_PERF_EVENT_H__ 12#ifndef __ARM_PERF_EVENT_H__
13#define __ARM_PERF_EVENT_H__ 13#define __ARM_PERF_EVENT_H__
14 14
15/* Nothing to see here... */ 15/*
16 * The ARMv7 CPU PMU supports up to 32 event counters.
17 */
18#define ARMPMU_MAX_HWEVENTS 32
19
20#define HW_OP_UNSUPPORTED 0xFFFF
21#define C(_x) PERF_COUNT_HW_CACHE_##_x
22#define CACHE_OP_UNSUPPORTED 0xFFFF
16 23
17#endif /* __ARM_PERF_EVENT_H__ */ 24#endif /* __ARM_PERF_EVENT_H__ */
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 41dc31f834c..08c12312a1f 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -16,7 +16,7 @@
16#ifndef CONFIG_MMU 16#ifndef CONFIG_MMU
17 17
18#include <asm-generic/4level-fixup.h> 18#include <asm-generic/4level-fixup.h>
19#include "pgtable-nommu.h" 19#include <asm/pgtable-nommu.h>
20 20
21#else 21#else
22 22
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
index 4432305f4a2..a26170dce02 100644
--- a/arch/arm/include/asm/pmu.h
+++ b/arch/arm/include/asm/pmu.h
@@ -16,69 +16,30 @@
16#include <linux/perf_event.h> 16#include <linux/perf_event.h>
17 17
18/* 18/*
19 * Types of PMUs that can be accessed directly and require mutual
20 * exclusion between profiling tools.
21 */
22enum arm_pmu_type {
23 ARM_PMU_DEVICE_CPU = 0,
24 ARM_NUM_PMU_DEVICES,
25};
26
27/*
28 * struct arm_pmu_platdata - ARM PMU platform data 19 * struct arm_pmu_platdata - ARM PMU platform data
29 * 20 *
30 * @handle_irq: an optional handler which will be called from the 21 * @handle_irq: an optional handler which will be called from the
31 * interrupt and passed the address of the low level handler, 22 * interrupt and passed the address of the low level handler,
32 * and can be used to implement any platform specific handling 23 * and can be used to implement any platform specific handling
33 * before or after calling it. 24 * before or after calling it.
34 * @enable_irq: an optional handler which will be called after 25 * @runtime_resume: an optional handler which will be called by the
35 * request_irq and be used to handle some platform specific 26 * runtime PM framework following a call to pm_runtime_get().
36 * irq enablement 27 * Note that if pm_runtime_get() is called more than once in
37 * @disable_irq: an optional handler which will be called before 28 * succession this handler will only be called once.
38 * free_irq and be used to handle some platform specific 29 * @runtime_suspend: an optional handler which will be called by the
39 * irq disablement 30 * runtime PM framework following a call to pm_runtime_put().
31 * Note that if pm_runtime_get() is called more than once in
32 * succession this handler will only be called following the
33 * final call to pm_runtime_put() that actually disables the
34 * hardware.
40 */ 35 */
41struct arm_pmu_platdata { 36struct arm_pmu_platdata {
42 irqreturn_t (*handle_irq)(int irq, void *dev, 37 irqreturn_t (*handle_irq)(int irq, void *dev,
43 irq_handler_t pmu_handler); 38 irq_handler_t pmu_handler);
44 void (*enable_irq)(int irq); 39 int (*runtime_resume)(struct device *dev);
45 void (*disable_irq)(int irq); 40 int (*runtime_suspend)(struct device *dev);
46}; 41};
47 42
48#ifdef CONFIG_CPU_HAS_PMU
49
50/**
51 * reserve_pmu() - reserve the hardware performance counters
52 *
53 * Reserve the hardware performance counters in the system for exclusive use.
54 * Returns 0 on success or -EBUSY if the lock is already held.
55 */
56extern int
57reserve_pmu(enum arm_pmu_type type);
58
59/**
60 * release_pmu() - Relinquish control of the performance counters
61 *
62 * Release the performance counters and allow someone else to use them.
63 */
64extern void
65release_pmu(enum arm_pmu_type type);
66
67#else /* CONFIG_CPU_HAS_PMU */
68
69#include <linux/err.h>
70
71static inline int
72reserve_pmu(enum arm_pmu_type type)
73{
74 return -ENODEV;
75}
76
77static inline void
78release_pmu(enum arm_pmu_type type) { }
79
80#endif /* CONFIG_CPU_HAS_PMU */
81
82#ifdef CONFIG_HW_PERF_EVENTS 43#ifdef CONFIG_HW_PERF_EVENTS
83 44
84/* The events for a given PMU register set. */ 45/* The events for a given PMU register set. */
@@ -103,7 +64,6 @@ struct pmu_hw_events {
103 64
104struct arm_pmu { 65struct arm_pmu {
105 struct pmu pmu; 66 struct pmu pmu;
106 enum arm_pmu_type type;
107 cpumask_t active_irqs; 67 cpumask_t active_irqs;
108 char *name; 68 char *name;
109 irqreturn_t (*handle_irq)(int irq_num, void *dev); 69 irqreturn_t (*handle_irq)(int irq_num, void *dev);
@@ -118,6 +78,8 @@ struct arm_pmu {
118 void (*start)(void); 78 void (*start)(void);
119 void (*stop)(void); 79 void (*stop)(void);
120 void (*reset)(void *); 80 void (*reset)(void *);
81 int (*request_irq)(irq_handler_t handler);
82 void (*free_irq)(void);
121 int (*map_event)(struct perf_event *event); 83 int (*map_event)(struct perf_event *event);
122 int num_events; 84 int num_events;
123 atomic_t active_events; 85 atomic_t active_events;
@@ -129,7 +91,9 @@ struct arm_pmu {
129 91
130#define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu)) 92#define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu))
131 93
132int __init armpmu_register(struct arm_pmu *armpmu, char *name, int type); 94extern const struct dev_pm_ops armpmu_dev_pm_ops;
95
96int armpmu_register(struct arm_pmu *armpmu, char *name, int type);
133 97
134u64 armpmu_event_update(struct perf_event *event, 98u64 armpmu_event_update(struct perf_event *event,
135 struct hw_perf_event *hwc, 99 struct hw_perf_event *hwc,
@@ -139,6 +103,13 @@ int armpmu_event_set_period(struct perf_event *event,
139 struct hw_perf_event *hwc, 103 struct hw_perf_event *hwc,
140 int idx); 104 int idx);
141 105
106int armpmu_map_event(struct perf_event *event,
107 const unsigned (*event_map)[PERF_COUNT_HW_MAX],
108 const unsigned (*cache_map)[PERF_COUNT_HW_CACHE_MAX]
109 [PERF_COUNT_HW_CACHE_OP_MAX]
110 [PERF_COUNT_HW_CACHE_RESULT_MAX],
111 u32 raw_event_mask);
112
142#endif /* CONFIG_HW_PERF_EVENTS */ 113#endif /* CONFIG_HW_PERF_EVENTS */
143 114
144#endif /* __ARM_PMU_H__ */ 115#endif /* __ARM_PMU_H__ */
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
index 99afa749826..06e7d509eaa 100644
--- a/arch/arm/include/asm/processor.h
+++ b/arch/arm/include/asm/processor.h
@@ -85,11 +85,6 @@ unsigned long get_wchan(struct task_struct *p);
85#define cpu_relax() barrier() 85#define cpu_relax() barrier()
86#endif 86#endif
87 87
88/*
89 * Create a new kernel thread
90 */
91extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
92
93#define task_pt_regs(p) \ 88#define task_pt_regs(p) \
94 ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) 89 ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
95 90
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
index 355ece523f4..3d52ee1bfb3 100644
--- a/arch/arm/include/asm/ptrace.h
+++ b/arch/arm/include/asm/ptrace.h
@@ -10,132 +10,12 @@
10#ifndef __ASM_ARM_PTRACE_H 10#ifndef __ASM_ARM_PTRACE_H
11#define __ASM_ARM_PTRACE_H 11#define __ASM_ARM_PTRACE_H
12 12
13#include <asm/hwcap.h> 13#include <uapi/asm/ptrace.h>
14
15#define PTRACE_GETREGS 12
16#define PTRACE_SETREGS 13
17#define PTRACE_GETFPREGS 14
18#define PTRACE_SETFPREGS 15
19/* PTRACE_ATTACH is 16 */
20/* PTRACE_DETACH is 17 */
21#define PTRACE_GETWMMXREGS 18
22#define PTRACE_SETWMMXREGS 19
23/* 20 is unused */
24#define PTRACE_OLDSETOPTIONS 21
25#define PTRACE_GET_THREAD_AREA 22
26#define PTRACE_SET_SYSCALL 23
27/* PTRACE_SYSCALL is 24 */
28#define PTRACE_GETCRUNCHREGS 25
29#define PTRACE_SETCRUNCHREGS 26
30#define PTRACE_GETVFPREGS 27
31#define PTRACE_SETVFPREGS 28
32#define PTRACE_GETHBPREGS 29
33#define PTRACE_SETHBPREGS 30
34
35/*
36 * PSR bits
37 */
38#define USR26_MODE 0x00000000
39#define FIQ26_MODE 0x00000001
40#define IRQ26_MODE 0x00000002
41#define SVC26_MODE 0x00000003
42#define USR_MODE 0x00000010
43#define FIQ_MODE 0x00000011
44#define IRQ_MODE 0x00000012
45#define SVC_MODE 0x00000013
46#define ABT_MODE 0x00000017
47#define UND_MODE 0x0000001b
48#define SYSTEM_MODE 0x0000001f
49#define MODE32_BIT 0x00000010
50#define MODE_MASK 0x0000001f
51#define PSR_T_BIT 0x00000020
52#define PSR_F_BIT 0x00000040
53#define PSR_I_BIT 0x00000080
54#define PSR_A_BIT 0x00000100
55#define PSR_E_BIT 0x00000200
56#define PSR_J_BIT 0x01000000
57#define PSR_Q_BIT 0x08000000
58#define PSR_V_BIT 0x10000000
59#define PSR_C_BIT 0x20000000
60#define PSR_Z_BIT 0x40000000
61#define PSR_N_BIT 0x80000000
62
63/*
64 * Groups of PSR bits
65 */
66#define PSR_f 0xff000000 /* Flags */
67#define PSR_s 0x00ff0000 /* Status */
68#define PSR_x 0x0000ff00 /* Extension */
69#define PSR_c 0x000000ff /* Control */
70
71/*
72 * ARMv7 groups of PSR bits
73 */
74#define APSR_MASK 0xf80f0000 /* N, Z, C, V, Q and GE flags */
75#define PSR_ISET_MASK 0x01000010 /* ISA state (J, T) mask */
76#define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */
77#define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */
78
79/*
80 * Default endianness state
81 */
82#ifdef CONFIG_CPU_ENDIAN_BE8
83#define PSR_ENDSTATE PSR_E_BIT
84#else
85#define PSR_ENDSTATE 0
86#endif
87
88/*
89 * These are 'magic' values for PTRACE_PEEKUSR that return info about where a
90 * process is located in memory.
91 */
92#define PT_TEXT_ADDR 0x10000
93#define PT_DATA_ADDR 0x10004
94#define PT_TEXT_END_ADDR 0x10008
95 14
96#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
97
98/*
99 * This struct defines the way the registers are stored on the
100 * stack during a system call. Note that sizeof(struct pt_regs)
101 * has to be a multiple of 8.
102 */
103#ifndef __KERNEL__
104struct pt_regs {
105 long uregs[18];
106};
107#else /* __KERNEL__ */
108struct pt_regs { 16struct pt_regs {
109 unsigned long uregs[18]; 17 unsigned long uregs[18];
110}; 18};
111#endif /* __KERNEL__ */
112
113#define ARM_cpsr uregs[16]
114#define ARM_pc uregs[15]
115#define ARM_lr uregs[14]
116#define ARM_sp uregs[13]
117#define ARM_ip uregs[12]
118#define ARM_fp uregs[11]
119#define ARM_r10 uregs[10]
120#define ARM_r9 uregs[9]
121#define ARM_r8 uregs[8]
122#define ARM_r7 uregs[7]
123#define ARM_r6 uregs[6]
124#define ARM_r5 uregs[5]
125#define ARM_r4 uregs[4]
126#define ARM_r3 uregs[3]
127#define ARM_r2 uregs[2]
128#define ARM_r1 uregs[1]
129#define ARM_r0 uregs[0]
130#define ARM_ORIG_r0 uregs[17]
131
132/*
133 * The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS
134 * and core dumps.
135 */
136#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
137
138#ifdef __KERNEL__
139 19
140#define user_mode(regs) \ 20#define user_mode(regs) \
141 (((regs)->ARM_cpsr & 0xf) == 0) 21 (((regs)->ARM_cpsr & 0xf) == 0)
@@ -254,9 +134,10 @@ static inline unsigned long user_stack_pointer(struct pt_regs *regs)
254 return regs->ARM_sp; 134 return regs->ARM_sp;
255} 135}
256 136
257#endif /* __KERNEL__ */ 137#define current_pt_regs(void) ({ \
138 register unsigned long sp asm ("sp"); \
139 (struct pt_regs *)((sp | (THREAD_SIZE - 1)) - 7) - 1; \
140})
258 141
259#endif /* __ASSEMBLY__ */ 142#endif /* __ASSEMBLY__ */
260
261#endif 143#endif
262
diff --git a/arch/arm/include/asm/segment.h b/arch/arm/include/asm/segment.h
deleted file mode 100644
index 9e24c21f630..00000000000
--- a/arch/arm/include/asm/segment.h
+++ /dev/null
@@ -1,11 +0,0 @@
1#ifndef __ASM_ARM_SEGMENT_H
2#define __ASM_ARM_SEGMENT_H
3
4#define __KERNEL_CS 0x0
5#define __KERNEL_DS 0x0
6
7#define __USER_CS 0x1
8#define __USER_DS 0x1
9
10#endif /* __ASM_ARM_SEGMENT_H */
11
diff --git a/arch/arm/include/asm/sembuf.h b/arch/arm/include/asm/sembuf.h
deleted file mode 100644
index 1c028395428..00000000000
--- a/arch/arm/include/asm/sembuf.h
+++ /dev/null
@@ -1,25 +0,0 @@
1#ifndef _ASMARM_SEMBUF_H
2#define _ASMARM_SEMBUF_H
3
4/*
5 * The semid64_ds structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct semid64_ds {
15 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
16 __kernel_time_t sem_otime; /* last semop time */
17 unsigned long __unused1;
18 __kernel_time_t sem_ctime; /* last change time */
19 unsigned long __unused2;
20 unsigned long sem_nsems; /* no. of semaphores in array */
21 unsigned long __unused3;
22 unsigned long __unused4;
23};
24
25#endif /* _ASMARM_SEMBUF_H */
diff --git a/arch/arm/include/asm/serial.h b/arch/arm/include/asm/serial.h
deleted file mode 100644
index ebb049091e2..00000000000
--- a/arch/arm/include/asm/serial.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/include/asm/serial.h
3 *
4 * Copyright (C) 1996 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Changelog:
11 * 15-10-1996 RMK Created
12 */
13
14#ifndef __ASM_SERIAL_H
15#define __ASM_SERIAL_H
16
17#define BASE_BAUD (1843200 / 16)
18
19#endif
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 24d284a1bfc..c50f0560950 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -14,176 +14,8 @@
14#ifndef __ASMARM_SETUP_H 14#ifndef __ASMARM_SETUP_H
15#define __ASMARM_SETUP_H 15#define __ASMARM_SETUP_H
16 16
17#include <linux/types.h> 17#include <uapi/asm/setup.h>
18 18
19#define COMMAND_LINE_SIZE 1024
20
21/* The list ends with an ATAG_NONE node. */
22#define ATAG_NONE 0x00000000
23
24struct tag_header {
25 __u32 size;
26 __u32 tag;
27};
28
29/* The list must start with an ATAG_CORE node */
30#define ATAG_CORE 0x54410001
31
32struct tag_core {
33 __u32 flags; /* bit 0 = read-only */
34 __u32 pagesize;
35 __u32 rootdev;
36};
37
38/* it is allowed to have multiple ATAG_MEM nodes */
39#define ATAG_MEM 0x54410002
40
41struct tag_mem32 {
42 __u32 size;
43 __u32 start; /* physical start address */
44};
45
46/* VGA text type displays */
47#define ATAG_VIDEOTEXT 0x54410003
48
49struct tag_videotext {
50 __u8 x;
51 __u8 y;
52 __u16 video_page;
53 __u8 video_mode;
54 __u8 video_cols;
55 __u16 video_ega_bx;
56 __u8 video_lines;
57 __u8 video_isvga;
58 __u16 video_points;
59};
60
61/* describes how the ramdisk will be used in kernel */
62#define ATAG_RAMDISK 0x54410004
63
64struct tag_ramdisk {
65 __u32 flags; /* bit 0 = load, bit 1 = prompt */
66 __u32 size; /* decompressed ramdisk size in _kilo_ bytes */
67 __u32 start; /* starting block of floppy-based RAM disk image */
68};
69
70/* describes where the compressed ramdisk image lives (virtual address) */
71/*
72 * this one accidentally used virtual addresses - as such,
73 * it's deprecated.
74 */
75#define ATAG_INITRD 0x54410005
76
77/* describes where the compressed ramdisk image lives (physical address) */
78#define ATAG_INITRD2 0x54420005
79
80struct tag_initrd {
81 __u32 start; /* physical start address */
82 __u32 size; /* size of compressed ramdisk image in bytes */
83};
84
85/* board serial number. "64 bits should be enough for everybody" */
86#define ATAG_SERIAL 0x54410006
87
88struct tag_serialnr {
89 __u32 low;
90 __u32 high;
91};
92
93/* board revision */
94#define ATAG_REVISION 0x54410007
95
96struct tag_revision {
97 __u32 rev;
98};
99
100/* initial values for vesafb-type framebuffers. see struct screen_info
101 * in include/linux/tty.h
102 */
103#define ATAG_VIDEOLFB 0x54410008
104
105struct tag_videolfb {
106 __u16 lfb_width;
107 __u16 lfb_height;
108 __u16 lfb_depth;
109 __u16 lfb_linelength;
110 __u32 lfb_base;
111 __u32 lfb_size;
112 __u8 red_size;
113 __u8 red_pos;
114 __u8 green_size;
115 __u8 green_pos;
116 __u8 blue_size;
117 __u8 blue_pos;
118 __u8 rsvd_size;
119 __u8 rsvd_pos;
120};
121
122/* command line: \0 terminated string */
123#define ATAG_CMDLINE 0x54410009
124
125struct tag_cmdline {
126 char cmdline[1]; /* this is the minimum size */
127};
128
129/* acorn RiscPC specific information */
130#define ATAG_ACORN 0x41000101
131
132struct tag_acorn {
133 __u32 memc_control_reg;
134 __u32 vram_pages;
135 __u8 sounddefault;
136 __u8 adfsdrives;
137};
138
139/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
140#define ATAG_MEMCLK 0x41000402
141
142struct tag_memclk {
143 __u32 fmemclk;
144};
145
146struct tag {
147 struct tag_header hdr;
148 union {
149 struct tag_core core;
150 struct tag_mem32 mem;
151 struct tag_videotext videotext;
152 struct tag_ramdisk ramdisk;
153 struct tag_initrd initrd;
154 struct tag_serialnr serialnr;
155 struct tag_revision revision;
156 struct tag_videolfb videolfb;
157 struct tag_cmdline cmdline;
158
159 /*
160 * Acorn specific
161 */
162 struct tag_acorn acorn;
163
164 /*
165 * DC21285 specific
166 */
167 struct tag_memclk memclk;
168 } u;
169};
170
171struct tagtable {
172 __u32 tag;
173 int (*parse)(const struct tag *);
174};
175
176#define tag_member_present(tag,member) \
177 ((unsigned long)(&((struct tag *)0L)->member + 1) \
178 <= (tag)->hdr.size * 4)
179
180#define tag_next(t) ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
181#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
182
183#define for_each_tag(t,base) \
184 for (t = base; t->hdr.size; t = tag_next(t))
185
186#ifdef __KERNEL__
187 19
188#define __tag __used __attribute__((__section__(".taglist.init"))) 20#define __tag __used __attribute__((__section__(".taglist.init")))
189#define __tagtable(tag, fn) \ 21#define __tagtable(tag, fn) \
@@ -221,6 +53,4 @@ extern int arm_add_memory(phys_addr_t start, phys_addr_t size);
221extern void early_print(const char *str, ...); 53extern void early_print(const char *str, ...);
222extern void dump_machine_table(void); 54extern void dump_machine_table(void);
223 55
224#endif /* __KERNEL__ */
225
226#endif 56#endif
diff --git a/arch/arm/include/asm/shmbuf.h b/arch/arm/include/asm/shmbuf.h
deleted file mode 100644
index 2e5c67ba1c9..00000000000
--- a/arch/arm/include/asm/shmbuf.h
+++ /dev/null
@@ -1,42 +0,0 @@
1#ifndef _ASMARM_SHMBUF_H
2#define _ASMARM_SHMBUF_H
3
4/*
5 * The shmid64_ds structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct shmid64_ds {
15 struct ipc64_perm shm_perm; /* operation perms */
16 size_t shm_segsz; /* size of segment (bytes) */
17 __kernel_time_t shm_atime; /* last attach time */
18 unsigned long __unused1;
19 __kernel_time_t shm_dtime; /* last detach time */
20 unsigned long __unused2;
21 __kernel_time_t shm_ctime; /* last change time */
22 unsigned long __unused3;
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29
30struct shminfo64 {
31 unsigned long shmmax;
32 unsigned long shmmin;
33 unsigned long shmmni;
34 unsigned long shmseg;
35 unsigned long shmall;
36 unsigned long __unused1;
37 unsigned long __unused2;
38 unsigned long __unused3;
39 unsigned long __unused4;
40};
41
42#endif /* _ASMARM_SHMBUF_H */
diff --git a/arch/arm/include/asm/signal.h b/arch/arm/include/asm/signal.h
index 43ba0fb1c8a..5a7963dbd3f 100644
--- a/arch/arm/include/asm/signal.h
+++ b/arch/arm/include/asm/signal.h
@@ -1,12 +1,8 @@
1#ifndef _ASMARM_SIGNAL_H 1#ifndef _ASMARM_SIGNAL_H
2#define _ASMARM_SIGNAL_H 2#define _ASMARM_SIGNAL_H
3 3
4#include <linux/types.h> 4#include <uapi/asm/signal.h>
5 5
6/* Avoid too many header ordering problems. */
7struct siginfo;
8
9#ifdef __KERNEL__
10/* Most things should be clean enough to redefine this at will, if care 6/* Most things should be clean enough to redefine this at will, if care
11 is taken to make libc match. */ 7 is taken to make libc match. */
12 8
@@ -20,100 +16,6 @@ typedef struct {
20 unsigned long sig[_NSIG_WORDS]; 16 unsigned long sig[_NSIG_WORDS];
21} sigset_t; 17} sigset_t;
22 18
23#else
24/* Here we must cater to libcs that poke about in kernel headers. */
25
26#define NSIG 32
27typedef unsigned long sigset_t;
28
29#endif /* __KERNEL__ */
30
31#define SIGHUP 1
32#define SIGINT 2
33#define SIGQUIT 3
34#define SIGILL 4
35#define SIGTRAP 5
36#define SIGABRT 6
37#define SIGIOT 6
38#define SIGBUS 7
39#define SIGFPE 8
40#define SIGKILL 9
41#define SIGUSR1 10
42#define SIGSEGV 11
43#define SIGUSR2 12
44#define SIGPIPE 13
45#define SIGALRM 14
46#define SIGTERM 15
47#define SIGSTKFLT 16
48#define SIGCHLD 17
49#define SIGCONT 18
50#define SIGSTOP 19
51#define SIGTSTP 20
52#define SIGTTIN 21
53#define SIGTTOU 22
54#define SIGURG 23
55#define SIGXCPU 24
56#define SIGXFSZ 25
57#define SIGVTALRM 26
58#define SIGPROF 27
59#define SIGWINCH 28
60#define SIGIO 29
61#define SIGPOLL SIGIO
62/*
63#define SIGLOST 29
64*/
65#define SIGPWR 30
66#define SIGSYS 31
67#define SIGUNUSED 31
68
69/* These should not be considered constants from userland. */
70#define SIGRTMIN 32
71#define SIGRTMAX _NSIG
72
73#define SIGSWI 32
74
75/*
76 * SA_FLAGS values:
77 *
78 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
79 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
80 * SA_SIGINFO deliver the signal with SIGINFO structs
81 * SA_THIRTYTWO delivers the signal in 32-bit mode, even if the task
82 * is running in 26-bit.
83 * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)).
84 * SA_RESTART flag to get restarting signals (which were the default long ago)
85 * SA_NODEFER prevents the current signal from being masked in the handler.
86 * SA_RESETHAND clears the handler when the signal is delivered.
87 *
88 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
89 * Unix names RESETHAND and NODEFER respectively.
90 */
91#define SA_NOCLDSTOP 0x00000001
92#define SA_NOCLDWAIT 0x00000002
93#define SA_SIGINFO 0x00000004
94#define SA_THIRTYTWO 0x02000000
95#define SA_RESTORER 0x04000000
96#define SA_ONSTACK 0x08000000
97#define SA_RESTART 0x10000000
98#define SA_NODEFER 0x40000000
99#define SA_RESETHAND 0x80000000
100
101#define SA_NOMASK SA_NODEFER
102#define SA_ONESHOT SA_RESETHAND
103
104
105/*
106 * sigaltstack controls
107 */
108#define SS_ONSTACK 1
109#define SS_DISABLE 2
110
111#define MINSIGSTKSZ 2048
112#define SIGSTKSZ 8192
113
114#include <asm-generic/signal-defs.h>
115
116#ifdef __KERNEL__
117struct old_sigaction { 19struct old_sigaction {
118 __sighandler_t sa_handler; 20 __sighandler_t sa_handler;
119 old_sigset_t sa_mask; 21 old_sigset_t sa_mask;
@@ -132,33 +34,6 @@ struct k_sigaction {
132 struct sigaction sa; 34 struct sigaction sa;
133}; 35};
134 36
135#else
136/* Here we must cater to libcs that poke about in kernel headers. */
137
138struct sigaction {
139 union {
140 __sighandler_t _sa_handler;
141 void (*_sa_sigaction)(int, struct siginfo *, void *);
142 } _u;
143 sigset_t sa_mask;
144 unsigned long sa_flags;
145 void (*sa_restorer)(void);
146};
147
148#define sa_handler _u._sa_handler
149#define sa_sigaction _u._sa_sigaction
150
151#endif /* __KERNEL__ */
152
153typedef struct sigaltstack {
154 void __user *ss_sp;
155 int ss_flags;
156 size_t ss_size;
157} stack_t;
158
159#ifdef __KERNEL__
160#include <asm/sigcontext.h> 37#include <asm/sigcontext.h>
161#define ptrace_signal_deliver(regs, cookie) do { } while (0) 38#define ptrace_signal_deliver(regs, cookie) do { } while (0)
162#endif 39#endif
163
164#endif
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index ae29293270a..2e3be16c676 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -60,15 +60,6 @@ extern int boot_secondary(unsigned int cpu, struct task_struct *);
60 */ 60 */
61asmlinkage void secondary_start_kernel(void); 61asmlinkage void secondary_start_kernel(void);
62 62
63/*
64 * Perform platform specific initialisation of the specified CPU.
65 */
66extern void platform_secondary_init(unsigned int cpu);
67
68/*
69 * Initialize cpu_possible map, and enable coherency
70 */
71extern void platform_smp_prepare_cpus(unsigned int);
72 63
73/* 64/*
74 * Initial data for bringing up a secondary CPU. 65 * Initial data for bringing up a secondary CPU.
@@ -79,18 +70,47 @@ struct secondary_data {
79 void *stack; 70 void *stack;
80}; 71};
81extern struct secondary_data secondary_data; 72extern struct secondary_data secondary_data;
73extern volatile int pen_release;
82 74
83extern int __cpu_disable(void); 75extern int __cpu_disable(void);
84extern int platform_cpu_disable(unsigned int cpu);
85 76
86extern void __cpu_die(unsigned int cpu); 77extern void __cpu_die(unsigned int cpu);
87extern void cpu_die(void); 78extern void cpu_die(void);
88 79
89extern void platform_cpu_die(unsigned int cpu);
90extern int platform_cpu_kill(unsigned int cpu);
91extern void platform_cpu_enable(unsigned int cpu);
92
93extern void arch_send_call_function_single_ipi(int cpu); 80extern void arch_send_call_function_single_ipi(int cpu);
94extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 81extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
95 82
83struct smp_operations {
84#ifdef CONFIG_SMP
85 /*
86 * Setup the set of possible CPUs (via set_cpu_possible)
87 */
88 void (*smp_init_cpus)(void);
89 /*
90 * Initialize cpu_possible map, and enable coherency
91 */
92 void (*smp_prepare_cpus)(unsigned int max_cpus);
93
94 /*
95 * Perform platform specific initialisation of the specified CPU.
96 */
97 void (*smp_secondary_init)(unsigned int cpu);
98 /*
99 * Boot a secondary CPU, and assign it the specified idle task.
100 * This also gives us the initial stack to use for this CPU.
101 */
102 int (*smp_boot_secondary)(unsigned int cpu, struct task_struct *idle);
103#ifdef CONFIG_HOTPLUG_CPU
104 int (*cpu_kill)(unsigned int cpu);
105 void (*cpu_die)(unsigned int cpu);
106 int (*cpu_disable)(unsigned int cpu);
107#endif
108#endif
109};
110
111/*
112 * set platform specific SMP operations
113 */
114extern void smp_set_ops(struct smp_operations *);
115
96#endif /* ifndef __ASM_ARM_SMP_H */ 116#endif /* ifndef __ASM_ARM_SMP_H */
diff --git a/arch/arm/include/asm/socket.h b/arch/arm/include/asm/socket.h
deleted file mode 100644
index 6433cadb6ed..00000000000
--- a/arch/arm/include/asm/socket.h
+++ /dev/null
@@ -1,72 +0,0 @@
1#ifndef _ASMARM_SOCKET_H
2#define _ASMARM_SOCKET_H
3
4#include <asm/sockios.h>
5
6/* For setsockopt(2) */
7#define SOL_SOCKET 1
8
9#define SO_DEBUG 1
10#define SO_REUSEADDR 2
11#define SO_TYPE 3
12#define SO_ERROR 4
13#define SO_DONTROUTE 5
14#define SO_BROADCAST 6
15#define SO_SNDBUF 7
16#define SO_RCVBUF 8
17#define SO_SNDBUFFORCE 32
18#define SO_RCVBUFFORCE 33
19#define SO_KEEPALIVE 9
20#define SO_OOBINLINE 10
21#define SO_NO_CHECK 11
22#define SO_PRIORITY 12
23#define SO_LINGER 13
24#define SO_BSDCOMPAT 14
25/* To add :#define SO_REUSEPORT 15 */
26#define SO_PASSCRED 16
27#define SO_PEERCRED 17
28#define SO_RCVLOWAT 18
29#define SO_SNDLOWAT 19
30#define SO_RCVTIMEO 20
31#define SO_SNDTIMEO 21
32
33/* Security levels - as per NRL IPv6 - don't actually do anything */
34#define SO_SECURITY_AUTHENTICATION 22
35#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
36#define SO_SECURITY_ENCRYPTION_NETWORK 24
37
38#define SO_BINDTODEVICE 25
39
40/* Socket filtering */
41#define SO_ATTACH_FILTER 26
42#define SO_DETACH_FILTER 27
43
44#define SO_PEERNAME 28
45#define SO_TIMESTAMP 29
46#define SCM_TIMESTAMP SO_TIMESTAMP
47
48#define SO_ACCEPTCONN 30
49
50#define SO_PEERSEC 31
51#define SO_PASSSEC 34
52#define SO_TIMESTAMPNS 35
53#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
54
55#define SO_MARK 36
56
57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59
60#define SO_PROTOCOL 38
61#define SO_DOMAIN 39
62
63#define SO_RXQ_OVFL 40
64
65#define SO_WIFI_STATUS 41
66#define SCM_WIFI_STATUS SO_WIFI_STATUS
67#define SO_PEEK_OFF 42
68
69/* Instruct lower device to use last 4-bytes of skb data as FCS */
70#define SO_NOFCS 43
71
72#endif /* _ASM_SOCKET_H */
diff --git a/arch/arm/include/asm/sockios.h b/arch/arm/include/asm/sockios.h
deleted file mode 100644
index a2588a2512d..00000000000
--- a/arch/arm/include/asm/sockios.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef __ARCH_ARM_SOCKIOS_H
2#define __ARCH_ARM_SOCKIOS_H
3
4/* Socket-level I/O control calls. */
5#define FIOSETOWN 0x8901
6#define SIOCSPGRP 0x8902
7#define FIOGETOWN 0x8903
8#define SIOCGPGRP 0x8904
9#define SIOCATMARK 0x8905
10#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
11#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
12
13#endif
diff --git a/arch/arm/include/asm/swab.h b/arch/arm/include/asm/swab.h
index b859d82e30c..537fc9b9188 100644
--- a/arch/arm/include/asm/swab.h
+++ b/arch/arm/include/asm/swab.h
@@ -15,14 +15,8 @@
15#ifndef __ASM_ARM_SWAB_H 15#ifndef __ASM_ARM_SWAB_H
16#define __ASM_ARM_SWAB_H 16#define __ASM_ARM_SWAB_H
17 17
18#include <linux/compiler.h> 18#include <uapi/asm/swab.h>
19#include <linux/types.h>
20 19
21#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
22# define __SWAB_64_THRU_32__
23#endif
24
25#if defined(__KERNEL__)
26#if __LINUX_ARM_ARCH__ >= 6 20#if __LINUX_ARM_ARCH__ >= 6
27 21
28static inline __attribute_const__ __u32 __arch_swahb32(__u32 x) 22static inline __attribute_const__ __u32 __arch_swahb32(__u32 x)
@@ -42,32 +36,3 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
42 36
43#endif 37#endif
44#endif 38#endif
45
46#if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6
47static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
48{
49 __u32 t;
50
51#ifndef __thumb__
52 if (!__builtin_constant_p(x)) {
53 /*
54 * The compiler needs a bit of a hint here to always do the
55 * right thing and not screw it up to different degrees
56 * depending on the gcc version.
57 */
58 asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
59 } else
60#endif
61 t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
62
63 x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */
64 t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */
65 x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */
66
67 return x;
68}
69#define __arch_swab32 __arch_swab32
70
71#endif
72
73#endif
diff --git a/arch/arm/include/asm/syscall.h b/arch/arm/include/asm/syscall.h
index c334a23ddf7..9fdded6b108 100644
--- a/arch/arm/include/asm/syscall.h
+++ b/arch/arm/include/asm/syscall.h
@@ -8,6 +8,11 @@
8#define _ASM_ARM_SYSCALL_H 8#define _ASM_ARM_SYSCALL_H
9 9
10#include <linux/err.h> 10#include <linux/err.h>
11#include <linux/sched.h>
12
13#include <asm/unistd.h>
14
15#define NR_syscalls (__NR_syscalls)
11 16
12extern const unsigned long sys_call_table[]; 17extern const unsigned long sys_call_table[];
13 18
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 74542c52f9b..368165e33c1 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -2,7 +2,6 @@
2#include <asm/barrier.h> 2#include <asm/barrier.h>
3#include <asm/compiler.h> 3#include <asm/compiler.h>
4#include <asm/cmpxchg.h> 4#include <asm/cmpxchg.h>
5#include <asm/exec.h>
6#include <asm/switch_to.h> 5#include <asm/switch_to.h>
7#include <asm/system_info.h> 6#include <asm/system_info.h>
8#include <asm/system_misc.h> 7#include <asm/system_misc.h>
diff --git a/arch/arm/include/asm/termbits.h b/arch/arm/include/asm/termbits.h
deleted file mode 100644
index 704135d28d1..00000000000
--- a/arch/arm/include/asm/termbits.h
+++ /dev/null
@@ -1,198 +0,0 @@
1#ifndef __ASM_ARM_TERMBITS_H
2#define __ASM_ARM_TERMBITS_H
3
4typedef unsigned char cc_t;
5typedef unsigned int speed_t;
6typedef unsigned int tcflag_t;
7
8#define NCCS 19
9struct termios {
10 tcflag_t c_iflag; /* input mode flags */
11 tcflag_t c_oflag; /* output mode flags */
12 tcflag_t c_cflag; /* control mode flags */
13 tcflag_t c_lflag; /* local mode flags */
14 cc_t c_line; /* line discipline */
15 cc_t c_cc[NCCS]; /* control characters */
16};
17
18struct termios2 {
19 tcflag_t c_iflag; /* input mode flags */
20 tcflag_t c_oflag; /* output mode flags */
21 tcflag_t c_cflag; /* control mode flags */
22 tcflag_t c_lflag; /* local mode flags */
23 cc_t c_line; /* line discipline */
24 cc_t c_cc[NCCS]; /* control characters */
25 speed_t c_ispeed; /* input speed */
26 speed_t c_ospeed; /* output speed */
27};
28
29struct ktermios {
30 tcflag_t c_iflag; /* input mode flags */
31 tcflag_t c_oflag; /* output mode flags */
32 tcflag_t c_cflag; /* control mode flags */
33 tcflag_t c_lflag; /* local mode flags */
34 cc_t c_line; /* line discipline */
35 cc_t c_cc[NCCS]; /* control characters */
36 speed_t c_ispeed; /* input speed */
37 speed_t c_ospeed; /* output speed */
38};
39
40
41/* c_cc characters */
42#define VINTR 0
43#define VQUIT 1
44#define VERASE 2
45#define VKILL 3
46#define VEOF 4
47#define VTIME 5
48#define VMIN 6
49#define VSWTC 7
50#define VSTART 8
51#define VSTOP 9
52#define VSUSP 10
53#define VEOL 11
54#define VREPRINT 12
55#define VDISCARD 13
56#define VWERASE 14
57#define VLNEXT 15
58#define VEOL2 16
59
60/* c_iflag bits */
61#define IGNBRK 0000001
62#define BRKINT 0000002
63#define IGNPAR 0000004
64#define PARMRK 0000010
65#define INPCK 0000020
66#define ISTRIP 0000040
67#define INLCR 0000100
68#define IGNCR 0000200
69#define ICRNL 0000400
70#define IUCLC 0001000
71#define IXON 0002000
72#define IXANY 0004000
73#define IXOFF 0010000
74#define IMAXBEL 0020000
75#define IUTF8 0040000
76
77/* c_oflag bits */
78#define OPOST 0000001
79#define OLCUC 0000002
80#define ONLCR 0000004
81#define OCRNL 0000010
82#define ONOCR 0000020
83#define ONLRET 0000040
84#define OFILL 0000100
85#define OFDEL 0000200
86#define NLDLY 0000400
87#define NL0 0000000
88#define NL1 0000400
89#define CRDLY 0003000
90#define CR0 0000000
91#define CR1 0001000
92#define CR2 0002000
93#define CR3 0003000
94#define TABDLY 0014000
95#define TAB0 0000000
96#define TAB1 0004000
97#define TAB2 0010000
98#define TAB3 0014000
99#define XTABS 0014000
100#define BSDLY 0020000
101#define BS0 0000000
102#define BS1 0020000
103#define VTDLY 0040000
104#define VT0 0000000
105#define VT1 0040000
106#define FFDLY 0100000
107#define FF0 0000000
108#define FF1 0100000
109
110/* c_cflag bit meaning */
111#define CBAUD 0010017
112#define B0 0000000 /* hang up */
113#define B50 0000001
114#define B75 0000002
115#define B110 0000003
116#define B134 0000004
117#define B150 0000005
118#define B200 0000006
119#define B300 0000007
120#define B600 0000010
121#define B1200 0000011
122#define B1800 0000012
123#define B2400 0000013
124#define B4800 0000014
125#define B9600 0000015
126#define B19200 0000016
127#define B38400 0000017
128#define EXTA B19200
129#define EXTB B38400
130#define CSIZE 0000060
131#define CS5 0000000
132#define CS6 0000020
133#define CS7 0000040
134#define CS8 0000060
135#define CSTOPB 0000100
136#define CREAD 0000200
137#define PARENB 0000400
138#define PARODD 0001000
139#define HUPCL 0002000
140#define CLOCAL 0004000
141#define CBAUDEX 0010000
142#define BOTHER 0010000
143#define B57600 0010001
144#define B115200 0010002
145#define B230400 0010003
146#define B460800 0010004
147#define B500000 0010005
148#define B576000 0010006
149#define B921600 0010007
150#define B1000000 0010010
151#define B1152000 0010011
152#define B1500000 0010012
153#define B2000000 0010013
154#define B2500000 0010014
155#define B3000000 0010015
156#define B3500000 0010016
157#define B4000000 0010017
158#define CIBAUD 002003600000 /* input baud rate */
159#define CMSPAR 010000000000 /* mark or space (stick) parity */
160#define CRTSCTS 020000000000 /* flow control */
161
162#define IBSHIFT 16
163
164/* c_lflag bits */
165#define ISIG 0000001
166#define ICANON 0000002
167#define XCASE 0000004
168#define ECHO 0000010
169#define ECHOE 0000020
170#define ECHOK 0000040
171#define ECHONL 0000100
172#define NOFLSH 0000200
173#define TOSTOP 0000400
174#define ECHOCTL 0001000
175#define ECHOPRT 0002000
176#define ECHOKE 0004000
177#define FLUSHO 0010000
178#define PENDIN 0040000
179#define IEXTEN 0100000
180#define EXTPROC 0200000
181
182/* tcflow() and TCXONC use these */
183#define TCOOFF 0
184#define TCOON 1
185#define TCIOFF 2
186#define TCION 3
187
188/* tcflush() and TCFLSH use these */
189#define TCIFLUSH 0
190#define TCOFLUSH 1
191#define TCIOFLUSH 2
192
193/* tcsetattr uses these */
194#define TCSANOW 0
195#define TCSADRAIN 1
196#define TCSAFLUSH 2
197
198#endif /* __ASM_ARM_TERMBITS_H */
diff --git a/arch/arm/include/asm/termios.h b/arch/arm/include/asm/termios.h
deleted file mode 100644
index 293e3f1bc3f..00000000000
--- a/arch/arm/include/asm/termios.h
+++ /dev/null
@@ -1,92 +0,0 @@
1#ifndef __ASM_ARM_TERMIOS_H
2#define __ASM_ARM_TERMIOS_H
3
4#include <asm/termbits.h>
5#include <asm/ioctls.h>
6
7struct winsize {
8 unsigned short ws_row;
9 unsigned short ws_col;
10 unsigned short ws_xpixel;
11 unsigned short ws_ypixel;
12};
13
14#define NCC 8
15struct termio {
16 unsigned short c_iflag; /* input mode flags */
17 unsigned short c_oflag; /* output mode flags */
18 unsigned short c_cflag; /* control mode flags */
19 unsigned short c_lflag; /* local mode flags */
20 unsigned char c_line; /* line discipline */
21 unsigned char c_cc[NCC]; /* control characters */
22};
23
24#ifdef __KERNEL__
25/* intr=^C quit=^| erase=del kill=^U
26 eof=^D vtime=\0 vmin=\1 sxtc=\0
27 start=^Q stop=^S susp=^Z eol=\0
28 reprint=^R discard=^U werase=^W lnext=^V
29 eol2=\0
30*/
31#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
32#endif
33
34/* modem lines */
35#define TIOCM_LE 0x001
36#define TIOCM_DTR 0x002
37#define TIOCM_RTS 0x004
38#define TIOCM_ST 0x008
39#define TIOCM_SR 0x010
40#define TIOCM_CTS 0x020
41#define TIOCM_CAR 0x040
42#define TIOCM_RNG 0x080
43#define TIOCM_DSR 0x100
44#define TIOCM_CD TIOCM_CAR
45#define TIOCM_RI TIOCM_RNG
46#define TIOCM_OUT1 0x2000
47#define TIOCM_OUT2 0x4000
48#define TIOCM_LOOP 0x8000
49
50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
51
52#ifdef __KERNEL__
53
54/*
55 * Translate a "termio" structure into a "termios". Ugh.
56 */
57#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
58 unsigned short __tmp; \
59 get_user(__tmp,&(termio)->x); \
60 *(unsigned short *) &(termios)->x = __tmp; \
61}
62
63#define user_termio_to_kernel_termios(termios, termio) \
64({ \
65 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
66 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
67 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
68 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
69 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
70})
71
72/*
73 * Translate a "termios" structure into a "termio". Ugh.
74 */
75#define kernel_termios_to_user_termio(termio, termios) \
76({ \
77 put_user((termios)->c_iflag, &(termio)->c_iflag); \
78 put_user((termios)->c_oflag, &(termio)->c_oflag); \
79 put_user((termios)->c_cflag, &(termio)->c_cflag); \
80 put_user((termios)->c_lflag, &(termio)->c_lflag); \
81 put_user((termios)->c_line, &(termio)->c_line); \
82 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
83})
84
85#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
86#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
87#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
88#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
89
90#endif /* __KERNEL__ */
91
92#endif /* __ASM_ARM_TERMIOS_H */
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index af7b0bda335..8477b4c1d39 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -59,7 +59,9 @@ struct thread_info {
59 __u32 syscall; /* syscall number */ 59 __u32 syscall; /* syscall number */
60 __u8 used_cp[16]; /* thread used copro */ 60 __u8 used_cp[16]; /* thread used copro */
61 unsigned long tp_value; 61 unsigned long tp_value;
62#ifdef CONFIG_CRUNCH
62 struct crunch_state crunchstate; 63 struct crunch_state crunchstate;
64#endif
63 union fp_state fpstate __attribute__((aligned(8))); 65 union fp_state fpstate __attribute__((aligned(8)));
64 union vfp_state vfpstate; 66 union vfp_state vfpstate;
65#ifdef CONFIG_ARM_THUMBEE 67#ifdef CONFIG_ARM_THUMBEE
@@ -148,7 +150,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
148#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ 150#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
149#define TIF_SYSCALL_TRACE 8 151#define TIF_SYSCALL_TRACE 8
150#define TIF_SYSCALL_AUDIT 9 152#define TIF_SYSCALL_AUDIT 9
151#define TIF_POLLING_NRFLAG 16 153#define TIF_SYSCALL_TRACEPOINT 10
152#define TIF_USING_IWMMXT 17 154#define TIF_USING_IWMMXT 17
153#define TIF_MEMDIE 18 /* is terminating due to OOM killer */ 155#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
154#define TIF_RESTORE_SIGMASK 20 156#define TIF_RESTORE_SIGMASK 20
@@ -160,12 +162,12 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
160#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 162#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
161#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 163#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
162#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 164#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
163#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 165#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
164#define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) 166#define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT)
165#define _TIF_SECCOMP (1 << TIF_SECCOMP) 167#define _TIF_SECCOMP (1 << TIF_SECCOMP)
166 168
167/* Checks for any syscall work in entry-common.S */ 169/* Checks for any syscall work in entry-common.S */
168#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT) 170#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SYSCALL_TRACEPOINT)
169 171
170/* 172/*
171 * Change these and you break ASM code in entry-common.S 173 * Change these and you break ASM code in entry-common.S
diff --git a/arch/arm/include/asm/timex.h b/arch/arm/include/asm/timex.h
index ce119442277..83f2aa83899 100644
--- a/arch/arm/include/asm/timex.h
+++ b/arch/arm/include/asm/timex.h
@@ -12,15 +12,13 @@
12#ifndef _ASMARM_TIMEX_H 12#ifndef _ASMARM_TIMEX_H
13#define _ASMARM_TIMEX_H 13#define _ASMARM_TIMEX_H
14 14
15#include <asm/arch_timer.h> 15#ifdef CONFIG_ARCH_MULTIPLATFORM
16#define CLOCK_TICK_RATE 1000000
17#else
16#include <mach/timex.h> 18#include <mach/timex.h>
19#endif
17 20
18typedef unsigned long cycles_t; 21typedef unsigned long cycles_t;
19
20#ifdef ARCH_HAS_READ_CURRENT_TIMER
21#define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; }) 22#define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; })
22#else
23#define get_cycles() (0)
24#endif
25 23
26#endif 24#endif
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index 314d4664eae..99a19512ee2 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -199,6 +199,9 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
199{ 199{
200 pgtable_page_dtor(pte); 200 pgtable_page_dtor(pte);
201 201
202#ifdef CONFIG_ARM_LPAE
203 tlb_add_flush(tlb, addr);
204#else
202 /* 205 /*
203 * With the classic ARM MMU, a pte page has two corresponding pmd 206 * With the classic ARM MMU, a pte page has two corresponding pmd
204 * entries, each covering 1MB. 207 * entries, each covering 1MB.
@@ -206,6 +209,7 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
206 addr &= PMD_MASK; 209 addr &= PMD_MASK;
207 tlb_add_flush(tlb, addr + SZ_1M - PAGE_SIZE); 210 tlb_add_flush(tlb, addr + SZ_1M - PAGE_SIZE);
208 tlb_add_flush(tlb, addr + SZ_1M); 211 tlb_add_flush(tlb, addr + SZ_1M);
212#endif
209 213
210 tlb_remove_page(tlb, pte); 214 tlb_remove_page(tlb, pte);
211} 215}
diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
deleted file mode 100644
index 28beab917ff..00000000000
--- a/arch/arm/include/asm/types.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#ifndef __ASM_ARM_TYPES_H
2#define __ASM_ARM_TYPES_H
3
4#include <asm-generic/int-ll64.h>
5
6/*
7 * These aren't exported outside the kernel to avoid name space clashes
8 */
9#ifdef __KERNEL__
10
11#define BITS_PER_LONG 32
12
13#endif /* __KERNEL__ */
14
15#endif
16
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 479a6352e0b..77bd79f2ffd 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -101,28 +101,39 @@ extern int __get_user_1(void *);
101extern int __get_user_2(void *); 101extern int __get_user_2(void *);
102extern int __get_user_4(void *); 102extern int __get_user_4(void *);
103 103
104#define __get_user_x(__r2,__p,__e,__s,__i...) \ 104#define __GUP_CLOBBER_1 "lr", "cc"
105#ifdef CONFIG_CPU_USE_DOMAINS
106#define __GUP_CLOBBER_2 "ip", "lr", "cc"
107#else
108#define __GUP_CLOBBER_2 "lr", "cc"
109#endif
110#define __GUP_CLOBBER_4 "lr", "cc"
111
112#define __get_user_x(__r2,__p,__e,__l,__s) \
105 __asm__ __volatile__ ( \ 113 __asm__ __volatile__ ( \
106 __asmeq("%0", "r0") __asmeq("%1", "r2") \ 114 __asmeq("%0", "r0") __asmeq("%1", "r2") \
115 __asmeq("%3", "r1") \
107 "bl __get_user_" #__s \ 116 "bl __get_user_" #__s \
108 : "=&r" (__e), "=r" (__r2) \ 117 : "=&r" (__e), "=r" (__r2) \
109 : "0" (__p) \ 118 : "0" (__p), "r" (__l) \
110 : __i, "cc") 119 : __GUP_CLOBBER_##__s)
111 120
112#define get_user(x,p) \ 121#define __get_user_check(x,p) \
113 ({ \ 122 ({ \
123 unsigned long __limit = current_thread_info()->addr_limit - 1; \
114 register const typeof(*(p)) __user *__p asm("r0") = (p);\ 124 register const typeof(*(p)) __user *__p asm("r0") = (p);\
115 register unsigned long __r2 asm("r2"); \ 125 register unsigned long __r2 asm("r2"); \
126 register unsigned long __l asm("r1") = __limit; \
116 register int __e asm("r0"); \ 127 register int __e asm("r0"); \
117 switch (sizeof(*(__p))) { \ 128 switch (sizeof(*(__p))) { \
118 case 1: \ 129 case 1: \
119 __get_user_x(__r2, __p, __e, 1, "lr"); \ 130 __get_user_x(__r2, __p, __e, __l, 1); \
120 break; \ 131 break; \
121 case 2: \ 132 case 2: \
122 __get_user_x(__r2, __p, __e, 2, "r3", "lr"); \ 133 __get_user_x(__r2, __p, __e, __l, 2); \
123 break; \ 134 break; \
124 case 4: \ 135 case 4: \
125 __get_user_x(__r2, __p, __e, 4, "lr"); \ 136 __get_user_x(__r2, __p, __e, __l, 4); \
126 break; \ 137 break; \
127 default: __e = __get_user_bad(); break; \ 138 default: __e = __get_user_bad(); break; \
128 } \ 139 } \
@@ -130,42 +141,57 @@ extern int __get_user_4(void *);
130 __e; \ 141 __e; \
131 }) 142 })
132 143
144#define get_user(x,p) \
145 ({ \
146 might_fault(); \
147 __get_user_check(x,p); \
148 })
149
133extern int __put_user_1(void *, unsigned int); 150extern int __put_user_1(void *, unsigned int);
134extern int __put_user_2(void *, unsigned int); 151extern int __put_user_2(void *, unsigned int);
135extern int __put_user_4(void *, unsigned int); 152extern int __put_user_4(void *, unsigned int);
136extern int __put_user_8(void *, unsigned long long); 153extern int __put_user_8(void *, unsigned long long);
137 154
138#define __put_user_x(__r2,__p,__e,__s) \ 155#define __put_user_x(__r2,__p,__e,__l,__s) \
139 __asm__ __volatile__ ( \ 156 __asm__ __volatile__ ( \
140 __asmeq("%0", "r0") __asmeq("%2", "r2") \ 157 __asmeq("%0", "r0") __asmeq("%2", "r2") \
158 __asmeq("%3", "r1") \
141 "bl __put_user_" #__s \ 159 "bl __put_user_" #__s \
142 : "=&r" (__e) \ 160 : "=&r" (__e) \
143 : "0" (__p), "r" (__r2) \ 161 : "0" (__p), "r" (__r2), "r" (__l) \
144 : "ip", "lr", "cc") 162 : "ip", "lr", "cc")
145 163
146#define put_user(x,p) \ 164#define __put_user_check(x,p) \
147 ({ \ 165 ({ \
166 unsigned long __limit = current_thread_info()->addr_limit - 1; \
148 register const typeof(*(p)) __r2 asm("r2") = (x); \ 167 register const typeof(*(p)) __r2 asm("r2") = (x); \
149 register const typeof(*(p)) __user *__p asm("r0") = (p);\ 168 register const typeof(*(p)) __user *__p asm("r0") = (p);\
169 register unsigned long __l asm("r1") = __limit; \
150 register int __e asm("r0"); \ 170 register int __e asm("r0"); \
151 switch (sizeof(*(__p))) { \ 171 switch (sizeof(*(__p))) { \
152 case 1: \ 172 case 1: \
153 __put_user_x(__r2, __p, __e, 1); \ 173 __put_user_x(__r2, __p, __e, __l, 1); \
154 break; \ 174 break; \
155 case 2: \ 175 case 2: \
156 __put_user_x(__r2, __p, __e, 2); \ 176 __put_user_x(__r2, __p, __e, __l, 2); \
157 break; \ 177 break; \
158 case 4: \ 178 case 4: \
159 __put_user_x(__r2, __p, __e, 4); \ 179 __put_user_x(__r2, __p, __e, __l, 4); \
160 break; \ 180 break; \
161 case 8: \ 181 case 8: \
162 __put_user_x(__r2, __p, __e, 8); \ 182 __put_user_x(__r2, __p, __e, __l, 8); \
163 break; \ 183 break; \
164 default: __e = __put_user_bad(); break; \ 184 default: __e = __put_user_bad(); break; \
165 } \ 185 } \
166 __e; \ 186 __e; \
167 }) 187 })
168 188
189#define put_user(x,p) \
190 ({ \
191 might_fault(); \
192 __put_user_check(x,p); \
193 })
194
169#else /* CONFIG_MMU */ 195#else /* CONFIG_MMU */
170 196
171/* 197/*
@@ -219,6 +245,7 @@ do { \
219 unsigned long __gu_addr = (unsigned long)(ptr); \ 245 unsigned long __gu_addr = (unsigned long)(ptr); \
220 unsigned long __gu_val; \ 246 unsigned long __gu_val; \
221 __chk_user_ptr(ptr); \ 247 __chk_user_ptr(ptr); \
248 might_fault(); \
222 switch (sizeof(*(ptr))) { \ 249 switch (sizeof(*(ptr))) { \
223 case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \ 250 case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \
224 case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \ 251 case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \
@@ -300,6 +327,7 @@ do { \
300 unsigned long __pu_addr = (unsigned long)(ptr); \ 327 unsigned long __pu_addr = (unsigned long)(ptr); \
301 __typeof__(*(ptr)) __pu_val = (x); \ 328 __typeof__(*(ptr)) __pu_val = (x); \
302 __chk_user_ptr(ptr); \ 329 __chk_user_ptr(ptr); \
330 might_fault(); \
303 switch (sizeof(*(ptr))) { \ 331 switch (sizeof(*(ptr))) { \
304 case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \ 332 case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \
305 case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \ 333 case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \
diff --git a/arch/arm/include/asm/unaligned.h b/arch/arm/include/asm/unaligned.h
deleted file mode 100644
index 44593a89490..00000000000
--- a/arch/arm/include/asm/unaligned.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef _ASM_ARM_UNALIGNED_H
2#define _ASM_ARM_UNALIGNED_H
3
4#include <linux/unaligned/le_byteshift.h>
5#include <linux/unaligned/be_byteshift.h>
6#include <linux/unaligned/generic.h>
7
8/*
9 * Select endianness
10 */
11#ifndef __ARMEB__
12#define get_unaligned __get_unaligned_le
13#define put_unaligned __put_unaligned_le
14#else
15#define get_unaligned __get_unaligned_be
16#define put_unaligned __put_unaligned_be
17#endif
18
19#endif /* _ASM_ARM_UNALIGNED_H */
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index 0cab47d4a83..8f60b6e6bd4 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -13,438 +13,10 @@
13#ifndef __ASM_ARM_UNISTD_H 13#ifndef __ASM_ARM_UNISTD_H
14#define __ASM_ARM_UNISTD_H 14#define __ASM_ARM_UNISTD_H
15 15
16#define __NR_OABI_SYSCALL_BASE 0x900000 16#include <uapi/asm/unistd.h>
17 17
18#if defined(__thumb__) || defined(__ARM_EABI__) 18#define __NR_syscalls (380)
19#define __NR_SYSCALL_BASE 0
20#else
21#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
22#endif
23
24/*
25 * This file contains the system call numbers.
26 */
27
28#define __NR_restart_syscall (__NR_SYSCALL_BASE+ 0)
29#define __NR_exit (__NR_SYSCALL_BASE+ 1)
30#define __NR_fork (__NR_SYSCALL_BASE+ 2)
31#define __NR_read (__NR_SYSCALL_BASE+ 3)
32#define __NR_write (__NR_SYSCALL_BASE+ 4)
33#define __NR_open (__NR_SYSCALL_BASE+ 5)
34#define __NR_close (__NR_SYSCALL_BASE+ 6)
35 /* 7 was sys_waitpid */
36#define __NR_creat (__NR_SYSCALL_BASE+ 8)
37#define __NR_link (__NR_SYSCALL_BASE+ 9)
38#define __NR_unlink (__NR_SYSCALL_BASE+ 10)
39#define __NR_execve (__NR_SYSCALL_BASE+ 11)
40#define __NR_chdir (__NR_SYSCALL_BASE+ 12)
41#define __NR_time (__NR_SYSCALL_BASE+ 13)
42#define __NR_mknod (__NR_SYSCALL_BASE+ 14)
43#define __NR_chmod (__NR_SYSCALL_BASE+ 15)
44#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
45 /* 17 was sys_break */
46 /* 18 was sys_stat */
47#define __NR_lseek (__NR_SYSCALL_BASE+ 19)
48#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
49#define __NR_mount (__NR_SYSCALL_BASE+ 21)
50#define __NR_umount (__NR_SYSCALL_BASE+ 22)
51#define __NR_setuid (__NR_SYSCALL_BASE+ 23)
52#define __NR_getuid (__NR_SYSCALL_BASE+ 24)
53#define __NR_stime (__NR_SYSCALL_BASE+ 25)
54#define __NR_ptrace (__NR_SYSCALL_BASE+ 26)
55#define __NR_alarm (__NR_SYSCALL_BASE+ 27)
56 /* 28 was sys_fstat */
57#define __NR_pause (__NR_SYSCALL_BASE+ 29)
58#define __NR_utime (__NR_SYSCALL_BASE+ 30)
59 /* 31 was sys_stty */
60 /* 32 was sys_gtty */
61#define __NR_access (__NR_SYSCALL_BASE+ 33)
62#define __NR_nice (__NR_SYSCALL_BASE+ 34)
63 /* 35 was sys_ftime */
64#define __NR_sync (__NR_SYSCALL_BASE+ 36)
65#define __NR_kill (__NR_SYSCALL_BASE+ 37)
66#define __NR_rename (__NR_SYSCALL_BASE+ 38)
67#define __NR_mkdir (__NR_SYSCALL_BASE+ 39)
68#define __NR_rmdir (__NR_SYSCALL_BASE+ 40)
69#define __NR_dup (__NR_SYSCALL_BASE+ 41)
70#define __NR_pipe (__NR_SYSCALL_BASE+ 42)
71#define __NR_times (__NR_SYSCALL_BASE+ 43)
72 /* 44 was sys_prof */
73#define __NR_brk (__NR_SYSCALL_BASE+ 45)
74#define __NR_setgid (__NR_SYSCALL_BASE+ 46)
75#define __NR_getgid (__NR_SYSCALL_BASE+ 47)
76 /* 48 was sys_signal */
77#define __NR_geteuid (__NR_SYSCALL_BASE+ 49)
78#define __NR_getegid (__NR_SYSCALL_BASE+ 50)
79#define __NR_acct (__NR_SYSCALL_BASE+ 51)
80#define __NR_umount2 (__NR_SYSCALL_BASE+ 52)
81 /* 53 was sys_lock */
82#define __NR_ioctl (__NR_SYSCALL_BASE+ 54)
83#define __NR_fcntl (__NR_SYSCALL_BASE+ 55)
84 /* 56 was sys_mpx */
85#define __NR_setpgid (__NR_SYSCALL_BASE+ 57)
86 /* 58 was sys_ulimit */
87 /* 59 was sys_olduname */
88#define __NR_umask (__NR_SYSCALL_BASE+ 60)
89#define __NR_chroot (__NR_SYSCALL_BASE+ 61)
90#define __NR_ustat (__NR_SYSCALL_BASE+ 62)
91#define __NR_dup2 (__NR_SYSCALL_BASE+ 63)
92#define __NR_getppid (__NR_SYSCALL_BASE+ 64)
93#define __NR_getpgrp (__NR_SYSCALL_BASE+ 65)
94#define __NR_setsid (__NR_SYSCALL_BASE+ 66)
95#define __NR_sigaction (__NR_SYSCALL_BASE+ 67)
96 /* 68 was sys_sgetmask */
97 /* 69 was sys_ssetmask */
98#define __NR_setreuid (__NR_SYSCALL_BASE+ 70)
99#define __NR_setregid (__NR_SYSCALL_BASE+ 71)
100#define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72)
101#define __NR_sigpending (__NR_SYSCALL_BASE+ 73)
102#define __NR_sethostname (__NR_SYSCALL_BASE+ 74)
103#define __NR_setrlimit (__NR_SYSCALL_BASE+ 75)
104#define __NR_getrlimit (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
105#define __NR_getrusage (__NR_SYSCALL_BASE+ 77)
106#define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78)
107#define __NR_settimeofday (__NR_SYSCALL_BASE+ 79)
108#define __NR_getgroups (__NR_SYSCALL_BASE+ 80)
109#define __NR_setgroups (__NR_SYSCALL_BASE+ 81)
110#define __NR_select (__NR_SYSCALL_BASE+ 82)
111#define __NR_symlink (__NR_SYSCALL_BASE+ 83)
112 /* 84 was sys_lstat */
113#define __NR_readlink (__NR_SYSCALL_BASE+ 85)
114#define __NR_uselib (__NR_SYSCALL_BASE+ 86)
115#define __NR_swapon (__NR_SYSCALL_BASE+ 87)
116#define __NR_reboot (__NR_SYSCALL_BASE+ 88)
117#define __NR_readdir (__NR_SYSCALL_BASE+ 89)
118#define __NR_mmap (__NR_SYSCALL_BASE+ 90)
119#define __NR_munmap (__NR_SYSCALL_BASE+ 91)
120#define __NR_truncate (__NR_SYSCALL_BASE+ 92)
121#define __NR_ftruncate (__NR_SYSCALL_BASE+ 93)
122#define __NR_fchmod (__NR_SYSCALL_BASE+ 94)
123#define __NR_fchown (__NR_SYSCALL_BASE+ 95)
124#define __NR_getpriority (__NR_SYSCALL_BASE+ 96)
125#define __NR_setpriority (__NR_SYSCALL_BASE+ 97)
126 /* 98 was sys_profil */
127#define __NR_statfs (__NR_SYSCALL_BASE+ 99)
128#define __NR_fstatfs (__NR_SYSCALL_BASE+100)
129 /* 101 was sys_ioperm */
130#define __NR_socketcall (__NR_SYSCALL_BASE+102)
131#define __NR_syslog (__NR_SYSCALL_BASE+103)
132#define __NR_setitimer (__NR_SYSCALL_BASE+104)
133#define __NR_getitimer (__NR_SYSCALL_BASE+105)
134#define __NR_stat (__NR_SYSCALL_BASE+106)
135#define __NR_lstat (__NR_SYSCALL_BASE+107)
136#define __NR_fstat (__NR_SYSCALL_BASE+108)
137 /* 109 was sys_uname */
138 /* 110 was sys_iopl */
139#define __NR_vhangup (__NR_SYSCALL_BASE+111)
140 /* 112 was sys_idle */
141#define __NR_syscall (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
142#define __NR_wait4 (__NR_SYSCALL_BASE+114)
143#define __NR_swapoff (__NR_SYSCALL_BASE+115)
144#define __NR_sysinfo (__NR_SYSCALL_BASE+116)
145#define __NR_ipc (__NR_SYSCALL_BASE+117)
146#define __NR_fsync (__NR_SYSCALL_BASE+118)
147#define __NR_sigreturn (__NR_SYSCALL_BASE+119)
148#define __NR_clone (__NR_SYSCALL_BASE+120)
149#define __NR_setdomainname (__NR_SYSCALL_BASE+121)
150#define __NR_uname (__NR_SYSCALL_BASE+122)
151 /* 123 was sys_modify_ldt */
152#define __NR_adjtimex (__NR_SYSCALL_BASE+124)
153#define __NR_mprotect (__NR_SYSCALL_BASE+125)
154#define __NR_sigprocmask (__NR_SYSCALL_BASE+126)
155 /* 127 was sys_create_module */
156#define __NR_init_module (__NR_SYSCALL_BASE+128)
157#define __NR_delete_module (__NR_SYSCALL_BASE+129)
158 /* 130 was sys_get_kernel_syms */
159#define __NR_quotactl (__NR_SYSCALL_BASE+131)
160#define __NR_getpgid (__NR_SYSCALL_BASE+132)
161#define __NR_fchdir (__NR_SYSCALL_BASE+133)
162#define __NR_bdflush (__NR_SYSCALL_BASE+134)
163#define __NR_sysfs (__NR_SYSCALL_BASE+135)
164#define __NR_personality (__NR_SYSCALL_BASE+136)
165 /* 137 was sys_afs_syscall */
166#define __NR_setfsuid (__NR_SYSCALL_BASE+138)
167#define __NR_setfsgid (__NR_SYSCALL_BASE+139)
168#define __NR__llseek (__NR_SYSCALL_BASE+140)
169#define __NR_getdents (__NR_SYSCALL_BASE+141)
170#define __NR__newselect (__NR_SYSCALL_BASE+142)
171#define __NR_flock (__NR_SYSCALL_BASE+143)
172#define __NR_msync (__NR_SYSCALL_BASE+144)
173#define __NR_readv (__NR_SYSCALL_BASE+145)
174#define __NR_writev (__NR_SYSCALL_BASE+146)
175#define __NR_getsid (__NR_SYSCALL_BASE+147)
176#define __NR_fdatasync (__NR_SYSCALL_BASE+148)
177#define __NR__sysctl (__NR_SYSCALL_BASE+149)
178#define __NR_mlock (__NR_SYSCALL_BASE+150)
179#define __NR_munlock (__NR_SYSCALL_BASE+151)
180#define __NR_mlockall (__NR_SYSCALL_BASE+152)
181#define __NR_munlockall (__NR_SYSCALL_BASE+153)
182#define __NR_sched_setparam (__NR_SYSCALL_BASE+154)
183#define __NR_sched_getparam (__NR_SYSCALL_BASE+155)
184#define __NR_sched_setscheduler (__NR_SYSCALL_BASE+156)
185#define __NR_sched_getscheduler (__NR_SYSCALL_BASE+157)
186#define __NR_sched_yield (__NR_SYSCALL_BASE+158)
187#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE+159)
188#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE+160)
189#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE+161)
190#define __NR_nanosleep (__NR_SYSCALL_BASE+162)
191#define __NR_mremap (__NR_SYSCALL_BASE+163)
192#define __NR_setresuid (__NR_SYSCALL_BASE+164)
193#define __NR_getresuid (__NR_SYSCALL_BASE+165)
194 /* 166 was sys_vm86 */
195 /* 167 was sys_query_module */
196#define __NR_poll (__NR_SYSCALL_BASE+168)
197#define __NR_nfsservctl (__NR_SYSCALL_BASE+169)
198#define __NR_setresgid (__NR_SYSCALL_BASE+170)
199#define __NR_getresgid (__NR_SYSCALL_BASE+171)
200#define __NR_prctl (__NR_SYSCALL_BASE+172)
201#define __NR_rt_sigreturn (__NR_SYSCALL_BASE+173)
202#define __NR_rt_sigaction (__NR_SYSCALL_BASE+174)
203#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE+175)
204#define __NR_rt_sigpending (__NR_SYSCALL_BASE+176)
205#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)
206#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)
207#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
208#define __NR_pread64 (__NR_SYSCALL_BASE+180)
209#define __NR_pwrite64 (__NR_SYSCALL_BASE+181)
210#define __NR_chown (__NR_SYSCALL_BASE+182)
211#define __NR_getcwd (__NR_SYSCALL_BASE+183)
212#define __NR_capget (__NR_SYSCALL_BASE+184)
213#define __NR_capset (__NR_SYSCALL_BASE+185)
214#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)
215#define __NR_sendfile (__NR_SYSCALL_BASE+187)
216 /* 188 reserved */
217 /* 189 reserved */
218#define __NR_vfork (__NR_SYSCALL_BASE+190)
219#define __NR_ugetrlimit (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
220#define __NR_mmap2 (__NR_SYSCALL_BASE+192)
221#define __NR_truncate64 (__NR_SYSCALL_BASE+193)
222#define __NR_ftruncate64 (__NR_SYSCALL_BASE+194)
223#define __NR_stat64 (__NR_SYSCALL_BASE+195)
224#define __NR_lstat64 (__NR_SYSCALL_BASE+196)
225#define __NR_fstat64 (__NR_SYSCALL_BASE+197)
226#define __NR_lchown32 (__NR_SYSCALL_BASE+198)
227#define __NR_getuid32 (__NR_SYSCALL_BASE+199)
228#define __NR_getgid32 (__NR_SYSCALL_BASE+200)
229#define __NR_geteuid32 (__NR_SYSCALL_BASE+201)
230#define __NR_getegid32 (__NR_SYSCALL_BASE+202)
231#define __NR_setreuid32 (__NR_SYSCALL_BASE+203)
232#define __NR_setregid32 (__NR_SYSCALL_BASE+204)
233#define __NR_getgroups32 (__NR_SYSCALL_BASE+205)
234#define __NR_setgroups32 (__NR_SYSCALL_BASE+206)
235#define __NR_fchown32 (__NR_SYSCALL_BASE+207)
236#define __NR_setresuid32 (__NR_SYSCALL_BASE+208)
237#define __NR_getresuid32 (__NR_SYSCALL_BASE+209)
238#define __NR_setresgid32 (__NR_SYSCALL_BASE+210)
239#define __NR_getresgid32 (__NR_SYSCALL_BASE+211)
240#define __NR_chown32 (__NR_SYSCALL_BASE+212)
241#define __NR_setuid32 (__NR_SYSCALL_BASE+213)
242#define __NR_setgid32 (__NR_SYSCALL_BASE+214)
243#define __NR_setfsuid32 (__NR_SYSCALL_BASE+215)
244#define __NR_setfsgid32 (__NR_SYSCALL_BASE+216)
245#define __NR_getdents64 (__NR_SYSCALL_BASE+217)
246#define __NR_pivot_root (__NR_SYSCALL_BASE+218)
247#define __NR_mincore (__NR_SYSCALL_BASE+219)
248#define __NR_madvise (__NR_SYSCALL_BASE+220)
249#define __NR_fcntl64 (__NR_SYSCALL_BASE+221)
250 /* 222 for tux */
251 /* 223 is unused */
252#define __NR_gettid (__NR_SYSCALL_BASE+224)
253#define __NR_readahead (__NR_SYSCALL_BASE+225)
254#define __NR_setxattr (__NR_SYSCALL_BASE+226)
255#define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
256#define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
257#define __NR_getxattr (__NR_SYSCALL_BASE+229)
258#define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
259#define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
260#define __NR_listxattr (__NR_SYSCALL_BASE+232)
261#define __NR_llistxattr (__NR_SYSCALL_BASE+233)
262#define __NR_flistxattr (__NR_SYSCALL_BASE+234)
263#define __NR_removexattr (__NR_SYSCALL_BASE+235)
264#define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
265#define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
266#define __NR_tkill (__NR_SYSCALL_BASE+238)
267#define __NR_sendfile64 (__NR_SYSCALL_BASE+239)
268#define __NR_futex (__NR_SYSCALL_BASE+240)
269#define __NR_sched_setaffinity (__NR_SYSCALL_BASE+241)
270#define __NR_sched_getaffinity (__NR_SYSCALL_BASE+242)
271#define __NR_io_setup (__NR_SYSCALL_BASE+243)
272#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
273#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
274#define __NR_io_submit (__NR_SYSCALL_BASE+246)
275#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
276#define __NR_exit_group (__NR_SYSCALL_BASE+248)
277#define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249)
278#define __NR_epoll_create (__NR_SYSCALL_BASE+250)
279#define __NR_epoll_ctl (__NR_SYSCALL_BASE+251)
280#define __NR_epoll_wait (__NR_SYSCALL_BASE+252)
281#define __NR_remap_file_pages (__NR_SYSCALL_BASE+253)
282 /* 254 for set_thread_area */
283 /* 255 for get_thread_area */
284#define __NR_set_tid_address (__NR_SYSCALL_BASE+256)
285#define __NR_timer_create (__NR_SYSCALL_BASE+257)
286#define __NR_timer_settime (__NR_SYSCALL_BASE+258)
287#define __NR_timer_gettime (__NR_SYSCALL_BASE+259)
288#define __NR_timer_getoverrun (__NR_SYSCALL_BASE+260)
289#define __NR_timer_delete (__NR_SYSCALL_BASE+261)
290#define __NR_clock_settime (__NR_SYSCALL_BASE+262)
291#define __NR_clock_gettime (__NR_SYSCALL_BASE+263)
292#define __NR_clock_getres (__NR_SYSCALL_BASE+264)
293#define __NR_clock_nanosleep (__NR_SYSCALL_BASE+265)
294#define __NR_statfs64 (__NR_SYSCALL_BASE+266)
295#define __NR_fstatfs64 (__NR_SYSCALL_BASE+267)
296#define __NR_tgkill (__NR_SYSCALL_BASE+268)
297#define __NR_utimes (__NR_SYSCALL_BASE+269)
298#define __NR_arm_fadvise64_64 (__NR_SYSCALL_BASE+270)
299#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271)
300#define __NR_pciconfig_read (__NR_SYSCALL_BASE+272)
301#define __NR_pciconfig_write (__NR_SYSCALL_BASE+273)
302#define __NR_mq_open (__NR_SYSCALL_BASE+274)
303#define __NR_mq_unlink (__NR_SYSCALL_BASE+275)
304#define __NR_mq_timedsend (__NR_SYSCALL_BASE+276)
305#define __NR_mq_timedreceive (__NR_SYSCALL_BASE+277)
306#define __NR_mq_notify (__NR_SYSCALL_BASE+278)
307#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
308#define __NR_waitid (__NR_SYSCALL_BASE+280)
309#define __NR_socket (__NR_SYSCALL_BASE+281)
310#define __NR_bind (__NR_SYSCALL_BASE+282)
311#define __NR_connect (__NR_SYSCALL_BASE+283)
312#define __NR_listen (__NR_SYSCALL_BASE+284)
313#define __NR_accept (__NR_SYSCALL_BASE+285)
314#define __NR_getsockname (__NR_SYSCALL_BASE+286)
315#define __NR_getpeername (__NR_SYSCALL_BASE+287)
316#define __NR_socketpair (__NR_SYSCALL_BASE+288)
317#define __NR_send (__NR_SYSCALL_BASE+289)
318#define __NR_sendto (__NR_SYSCALL_BASE+290)
319#define __NR_recv (__NR_SYSCALL_BASE+291)
320#define __NR_recvfrom (__NR_SYSCALL_BASE+292)
321#define __NR_shutdown (__NR_SYSCALL_BASE+293)
322#define __NR_setsockopt (__NR_SYSCALL_BASE+294)
323#define __NR_getsockopt (__NR_SYSCALL_BASE+295)
324#define __NR_sendmsg (__NR_SYSCALL_BASE+296)
325#define __NR_recvmsg (__NR_SYSCALL_BASE+297)
326#define __NR_semop (__NR_SYSCALL_BASE+298)
327#define __NR_semget (__NR_SYSCALL_BASE+299)
328#define __NR_semctl (__NR_SYSCALL_BASE+300)
329#define __NR_msgsnd (__NR_SYSCALL_BASE+301)
330#define __NR_msgrcv (__NR_SYSCALL_BASE+302)
331#define __NR_msgget (__NR_SYSCALL_BASE+303)
332#define __NR_msgctl (__NR_SYSCALL_BASE+304)
333#define __NR_shmat (__NR_SYSCALL_BASE+305)
334#define __NR_shmdt (__NR_SYSCALL_BASE+306)
335#define __NR_shmget (__NR_SYSCALL_BASE+307)
336#define __NR_shmctl (__NR_SYSCALL_BASE+308)
337#define __NR_add_key (__NR_SYSCALL_BASE+309)
338#define __NR_request_key (__NR_SYSCALL_BASE+310)
339#define __NR_keyctl (__NR_SYSCALL_BASE+311)
340#define __NR_semtimedop (__NR_SYSCALL_BASE+312)
341#define __NR_vserver (__NR_SYSCALL_BASE+313)
342#define __NR_ioprio_set (__NR_SYSCALL_BASE+314)
343#define __NR_ioprio_get (__NR_SYSCALL_BASE+315)
344#define __NR_inotify_init (__NR_SYSCALL_BASE+316)
345#define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)
346#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)
347#define __NR_mbind (__NR_SYSCALL_BASE+319)
348#define __NR_get_mempolicy (__NR_SYSCALL_BASE+320)
349#define __NR_set_mempolicy (__NR_SYSCALL_BASE+321)
350#define __NR_openat (__NR_SYSCALL_BASE+322)
351#define __NR_mkdirat (__NR_SYSCALL_BASE+323)
352#define __NR_mknodat (__NR_SYSCALL_BASE+324)
353#define __NR_fchownat (__NR_SYSCALL_BASE+325)
354#define __NR_futimesat (__NR_SYSCALL_BASE+326)
355#define __NR_fstatat64 (__NR_SYSCALL_BASE+327)
356#define __NR_unlinkat (__NR_SYSCALL_BASE+328)
357#define __NR_renameat (__NR_SYSCALL_BASE+329)
358#define __NR_linkat (__NR_SYSCALL_BASE+330)
359#define __NR_symlinkat (__NR_SYSCALL_BASE+331)
360#define __NR_readlinkat (__NR_SYSCALL_BASE+332)
361#define __NR_fchmodat (__NR_SYSCALL_BASE+333)
362#define __NR_faccessat (__NR_SYSCALL_BASE+334)
363#define __NR_pselect6 (__NR_SYSCALL_BASE+335)
364#define __NR_ppoll (__NR_SYSCALL_BASE+336)
365#define __NR_unshare (__NR_SYSCALL_BASE+337)
366#define __NR_set_robust_list (__NR_SYSCALL_BASE+338)
367#define __NR_get_robust_list (__NR_SYSCALL_BASE+339)
368#define __NR_splice (__NR_SYSCALL_BASE+340)
369#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE+341)
370#define __NR_sync_file_range2 __NR_arm_sync_file_range
371#define __NR_tee (__NR_SYSCALL_BASE+342)
372#define __NR_vmsplice (__NR_SYSCALL_BASE+343)
373#define __NR_move_pages (__NR_SYSCALL_BASE+344)
374#define __NR_getcpu (__NR_SYSCALL_BASE+345)
375#define __NR_epoll_pwait (__NR_SYSCALL_BASE+346)
376#define __NR_kexec_load (__NR_SYSCALL_BASE+347)
377#define __NR_utimensat (__NR_SYSCALL_BASE+348)
378#define __NR_signalfd (__NR_SYSCALL_BASE+349)
379#define __NR_timerfd_create (__NR_SYSCALL_BASE+350)
380#define __NR_eventfd (__NR_SYSCALL_BASE+351)
381#define __NR_fallocate (__NR_SYSCALL_BASE+352)
382#define __NR_timerfd_settime (__NR_SYSCALL_BASE+353)
383#define __NR_timerfd_gettime (__NR_SYSCALL_BASE+354)
384#define __NR_signalfd4 (__NR_SYSCALL_BASE+355)
385#define __NR_eventfd2 (__NR_SYSCALL_BASE+356)
386#define __NR_epoll_create1 (__NR_SYSCALL_BASE+357)
387#define __NR_dup3 (__NR_SYSCALL_BASE+358)
388#define __NR_pipe2 (__NR_SYSCALL_BASE+359)
389#define __NR_inotify_init1 (__NR_SYSCALL_BASE+360)
390#define __NR_preadv (__NR_SYSCALL_BASE+361)
391#define __NR_pwritev (__NR_SYSCALL_BASE+362)
392#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE+363)
393#define __NR_perf_event_open (__NR_SYSCALL_BASE+364)
394#define __NR_recvmmsg (__NR_SYSCALL_BASE+365)
395#define __NR_accept4 (__NR_SYSCALL_BASE+366)
396#define __NR_fanotify_init (__NR_SYSCALL_BASE+367)
397#define __NR_fanotify_mark (__NR_SYSCALL_BASE+368)
398#define __NR_prlimit64 (__NR_SYSCALL_BASE+369)
399#define __NR_name_to_handle_at (__NR_SYSCALL_BASE+370)
400#define __NR_open_by_handle_at (__NR_SYSCALL_BASE+371)
401#define __NR_clock_adjtime (__NR_SYSCALL_BASE+372)
402#define __NR_syncfs (__NR_SYSCALL_BASE+373)
403#define __NR_sendmmsg (__NR_SYSCALL_BASE+374)
404#define __NR_setns (__NR_SYSCALL_BASE+375)
405#define __NR_process_vm_readv (__NR_SYSCALL_BASE+376)
406#define __NR_process_vm_writev (__NR_SYSCALL_BASE+377)
407
408/*
409 * The following SWIs are ARM private.
410 */
411#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
412#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
413#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
414#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
415#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
416#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
417
418/*
419 * *NOTE*: This is a ghost syscall private to the kernel. Only the
420 * __kuser_cmpxchg code in entry-armv.S should be aware of its
421 * existence. Don't ever use this from user code.
422 */
423#ifdef __KERNEL__
424#define __ARM_NR_cmpxchg (__ARM_NR_BASE+0x00fff0) 19#define __ARM_NR_cmpxchg (__ARM_NR_BASE+0x00fff0)
425#endif
426
427/*
428 * The following syscalls are obsolete and no longer available for EABI.
429 */
430#if !defined(__KERNEL__)
431#if defined(__ARM_EABI__)
432#undef __NR_time
433#undef __NR_umount
434#undef __NR_stime
435#undef __NR_alarm
436#undef __NR_utime
437#undef __NR_getrlimit
438#undef __NR_select
439#undef __NR_readdir
440#undef __NR_mmap
441#undef __NR_socketcall
442#undef __NR_syscall
443#undef __NR_ipc
444#endif
445#endif
446
447#ifdef __KERNEL__
448 20
449#define __ARCH_WANT_STAT64 21#define __ARCH_WANT_STAT64
450#define __ARCH_WANT_SYS_GETHOSTNAME 22#define __ARCH_WANT_SYS_GETHOSTNAME
@@ -469,6 +41,7 @@
469#define __ARCH_WANT_OLD_READDIR 41#define __ARCH_WANT_OLD_READDIR
470#define __ARCH_WANT_SYS_SOCKETCALL 42#define __ARCH_WANT_SYS_SOCKETCALL
471#endif 43#endif
44#define __ARCH_WANT_SYS_EXECVE
472 45
473/* 46/*
474 * "Conditional" syscalls 47 * "Conditional" syscalls
@@ -483,6 +56,6 @@
483 */ 56 */
484#define __IGNORE_fadvise64_64 57#define __IGNORE_fadvise64_64
485#define __IGNORE_migrate_pages 58#define __IGNORE_migrate_pages
59#define __IGNORE_kcmp
486 60
487#endif /* __KERNEL__ */
488#endif /* __ASM_ARM_UNISTD_H */ 61#endif /* __ASM_ARM_UNISTD_H */
diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
index 3d5fc41ae8d..6a6f1e485f4 100644
--- a/arch/arm/include/asm/vfpmacros.h
+++ b/arch/arm/include/asm/vfpmacros.h
@@ -5,7 +5,7 @@
5 */ 5 */
6#include <asm/hwcap.h> 6#include <asm/hwcap.h>
7 7
8#include "vfp.h" 8#include <asm/vfp.h>
9 9
10@ Macros to allow building with old toolkits (with no VFP support) 10@ Macros to allow building with old toolkits (with no VFP support)
11 .macro VFPFMRX, rd, sysreg, cond 11 .macro VFPFMRX, rd, sysreg, cond
@@ -28,7 +28,7 @@
28 ldr \tmp, =elf_hwcap @ may not have MVFR regs 28 ldr \tmp, =elf_hwcap @ may not have MVFR regs
29 ldr \tmp, [\tmp, #0] 29 ldr \tmp, [\tmp, #0]
30 tst \tmp, #HWCAP_VFPv3D16 30 tst \tmp, #HWCAP_VFPv3D16
31 ldceq p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} 31 ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
32 addne \base, \base, #32*4 @ step over unused register space 32 addne \base, \base, #32*4 @ step over unused register space
33#else 33#else
34 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 34 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
@@ -52,7 +52,7 @@
52 ldr \tmp, =elf_hwcap @ may not have MVFR regs 52 ldr \tmp, =elf_hwcap @ may not have MVFR regs
53 ldr \tmp, [\tmp, #0] 53 ldr \tmp, [\tmp, #0]
54 tst \tmp, #HWCAP_VFPv3D16 54 tst \tmp, #HWCAP_VFPv3D16
55 stceq p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} 55 stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
56 addne \base, \base, #32*4 @ step over unused register space 56 addne \base, \base, #32*4 @ step over unused register space
57#else 57#else
58 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 58 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
diff --git a/arch/arm/include/asm/virt.h b/arch/arm/include/asm/virt.h
new file mode 100644
index 00000000000..86164df86cb
--- /dev/null
+++ b/arch/arm/include/asm/virt.h
@@ -0,0 +1,69 @@
1/*
2 * Copyright (c) 2012 Linaro Limited.
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 VIRT_H
20#define VIRT_H
21
22#include <asm/ptrace.h>
23
24/*
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
27 * architecturally defined flag bit here (the N flag, as it happens)
28 */
29#define BOOT_CPU_MODE_MISMATCH (1<<31)
30
31#ifndef __ASSEMBLY__
32
33#ifdef CONFIG_ARM_VIRT_EXT
34/*
35 * __boot_cpu_mode records what mode the primary CPU was booted in.
36 * A correctly-implemented bootloader must start all CPUs in the same mode:
37 * if it fails to do this, the flag BOOT_CPU_MODE_MISMATCH is set to indicate
38 * that some CPU(s) were booted in a different mode.
39 *
40 * This allows the kernel to flag an error when the secondaries have come up.
41 */
42extern int __boot_cpu_mode;
43
44void __hyp_set_vectors(unsigned long phys_vector_base);
45unsigned long __hyp_get_vectors(void);
46#else
47#define __boot_cpu_mode (SVC_MODE)
48#endif
49
50#ifndef ZIMAGE
51void hyp_mode_check(void);
52
53/* Reports the availability of HYP mode */
54static inline bool is_hyp_mode_available(void)
55{
56 return ((__boot_cpu_mode & MODE_MASK) == HYP_MODE &&
57 !(__boot_cpu_mode & BOOT_CPU_MODE_MISMATCH));
58}
59
60/* Check if the bootloader has booted CPUs in different modes */
61static inline bool is_hyp_mode_mismatched(void)
62{
63 return !!(__boot_cpu_mode & BOOT_CPU_MODE_MISMATCH);
64}
65#endif
66
67#endif /* __ASSEMBLY__ */
68
69#endif /* ! VIRT_H */
diff --git a/arch/arm/mach-highbank/include/mach/debug-macro.S b/arch/arm/include/debug/highbank.S
index cb57fe5bcd0..8cad4322a5a 100644
--- a/arch/arm/mach-highbank/include/mach/debug-macro.S
+++ b/arch/arm/include/debug/highbank.S
@@ -10,10 +10,8 @@
10 */ 10 */
11 11
12 .macro addruart,rp,rv,tmp 12 .macro addruart,rp,rv,tmp
13 movw \rv, #0x6000 13 ldr \rv, =0xfee36000
14 movt \rv, #0xfee3 14 ldr \rp, =0xfff36000
15 movw \rp, #0x6000
16 movt \rp, #0xfff3
17 .endm 15 .endm
18 16
19#include <asm/hardware/debug-pl01x.S> 17#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/include/debug/icedcc.S b/arch/arm/include/debug/icedcc.S
new file mode 100644
index 00000000000..43afcb021fa
--- /dev/null
+++ b/arch/arm/include/debug/icedcc.S
@@ -0,0 +1,90 @@
1/*
2 * arch/arm/include/debug/icedcc.S
3 *
4 * Copyright (C) 1994-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12 @@ debug using ARM EmbeddedICE DCC channel
13
14 .macro addruart, rp, rv, tmp
15 .endm
16
17#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
18
19 .macro senduart, rd, rx
20 mcr p14, 0, \rd, c0, c5, 0
21 .endm
22
23 .macro busyuart, rd, rx
241001:
25 mrc p14, 0, \rx, c0, c1, 0
26 tst \rx, #0x20000000
27 beq 1001b
28 .endm
29
30 .macro waituart, rd, rx
31 mov \rd, #0x2000000
321001:
33 subs \rd, \rd, #1
34 bmi 1002f
35 mrc p14, 0, \rx, c0, c1, 0
36 tst \rx, #0x20000000
37 bne 1001b
381002:
39 .endm
40
41#elif defined(CONFIG_CPU_XSCALE)
42
43 .macro senduart, rd, rx
44 mcr p14, 0, \rd, c8, c0, 0
45 .endm
46
47 .macro busyuart, rd, rx
481001:
49 mrc p14, 0, \rx, c14, c0, 0
50 tst \rx, #0x10000000
51 beq 1001b
52 .endm
53
54 .macro waituart, rd, rx
55 mov \rd, #0x10000000
561001:
57 subs \rd, \rd, #1
58 bmi 1002f
59 mrc p14, 0, \rx, c14, c0, 0
60 tst \rx, #0x10000000
61 bne 1001b
621002:
63 .endm
64
65#else
66
67 .macro senduart, rd, rx
68 mcr p14, 0, \rd, c1, c0, 0
69 .endm
70
71 .macro busyuart, rd, rx
721001:
73 mrc p14, 0, \rx, c0, c0, 0
74 tst \rx, #2
75 beq 1001b
76
77 .endm
78
79 .macro waituart, rd, rx
80 mov \rd, #0x2000000
811001:
82 subs \rd, \rd, #1
83 bmi 1002f
84 mrc p14, 0, \rx, c0, c0, 0
85 tst \rx, #2
86 bne 1001b
871002:
88 .endm
89
90#endif /* CONFIG_CPU_V6 */
diff --git a/arch/arm/mach-mvebu/include/mach/debug-macro.S b/arch/arm/include/debug/mvebu.S
index 22825760c7e..865c6d02b33 100644
--- a/arch/arm/mach-mvebu/include/mach/debug-macro.S
+++ b/arch/arm/include/debug/mvebu.S
@@ -11,7 +11,8 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12*/ 12*/
13 13
14#include <mach/armada-370-xp.h> 14#define ARMADA_370_XP_REGS_PHYS_BASE 0xd0000000
15#define ARMADA_370_XP_REGS_VIRT_BASE 0xfeb00000
15 16
16 .macro addruart, rp, rv, tmp 17 .macro addruart, rp, rv, tmp
17 ldr \rp, =ARMADA_370_XP_REGS_PHYS_BASE 18 ldr \rp, =ARMADA_370_XP_REGS_PHYS_BASE
diff --git a/arch/arm/mach-picoxcell/include/mach/debug-macro.S b/arch/arm/include/debug/picoxcell.S
index 58d4ee3ae94..7419deb1b94 100644
--- a/arch/arm/mach-picoxcell/include/mach/debug-macro.S
+++ b/arch/arm/include/debug/picoxcell.S
@@ -9,10 +9,10 @@
9 * accesses to the 8250. 9 * accesses to the 8250.
10 */ 10 */
11#include <linux/serial_reg.h> 11#include <linux/serial_reg.h>
12#include <mach/hardware.h>
13#include <mach/map.h>
14 12
15#define UART_SHIFT 2 13#define UART_SHIFT 2
14#define PICOXCELL_UART1_BASE 0x80230000
15#define PHYS_TO_IO(x) (((x) & 0x00ffffff) | 0xfe000000)
16 16
17 .macro addruart, rp, rv, tmp 17 .macro addruart, rp, rv, tmp
18 ldr \rv, =PHYS_TO_IO(PICOXCELL_UART1_BASE) 18 ldr \rv, =PHYS_TO_IO(PICOXCELL_UART1_BASE)
diff --git a/arch/arm/mach-socfpga/include/mach/debug-macro.S b/arch/arm/include/debug/socfpga.S
index d6f26d23374..d6f26d23374 100644
--- a/arch/arm/mach-socfpga/include/mach/debug-macro.S
+++ b/arch/arm/include/debug/socfpga.S
diff --git a/arch/arm/mach-vexpress/include/mach/debug-macro.S b/arch/arm/include/debug/vexpress.S
index 9f509f55d07..9f509f55d07 100644
--- a/arch/arm/mach-vexpress/include/mach/debug-macro.S
+++ b/arch/arm/include/debug/vexpress.S
diff --git a/arch/arm/include/uapi/asm/Kbuild b/arch/arm/include/uapi/asm/Kbuild
new file mode 100644
index 00000000000..47bcb2d254a
--- /dev/null
+++ b/arch/arm/include/uapi/asm/Kbuild
@@ -0,0 +1,19 @@
1# UAPI Header export list
2include include/uapi/asm-generic/Kbuild.asm
3
4header-y += a.out.h
5header-y += byteorder.h
6header-y += fcntl.h
7header-y += hwcap.h
8header-y += ioctls.h
9header-y += kvm_para.h
10header-y += mman.h
11header-y += posix_types.h
12header-y += ptrace.h
13header-y += setup.h
14header-y += sigcontext.h
15header-y += signal.h
16header-y += stat.h
17header-y += statfs.h
18header-y += swab.h
19header-y += unistd.h
diff --git a/arch/arm/include/asm/a.out.h b/arch/arm/include/uapi/asm/a.out.h
index 083894b2e3b..083894b2e3b 100644
--- a/arch/arm/include/asm/a.out.h
+++ b/arch/arm/include/uapi/asm/a.out.h
diff --git a/arch/arm/include/asm/byteorder.h b/arch/arm/include/uapi/asm/byteorder.h
index 77379748b17..77379748b17 100644
--- a/arch/arm/include/asm/byteorder.h
+++ b/arch/arm/include/uapi/asm/byteorder.h
diff --git a/arch/arm/include/asm/fcntl.h b/arch/arm/include/uapi/asm/fcntl.h
index a80b6607b2e..a80b6607b2e 100644
--- a/arch/arm/include/asm/fcntl.h
+++ b/arch/arm/include/uapi/asm/fcntl.h
diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h
new file mode 100644
index 00000000000..f254f6503cc
--- /dev/null
+++ b/arch/arm/include/uapi/asm/hwcap.h
@@ -0,0 +1,29 @@
1#ifndef _UAPI__ASMARM_HWCAP_H
2#define _UAPI__ASMARM_HWCAP_H
3
4/*
5 * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
6 */
7#define HWCAP_SWP (1 << 0)
8#define HWCAP_HALF (1 << 1)
9#define HWCAP_THUMB (1 << 2)
10#define HWCAP_26BIT (1 << 3) /* Play it safe */
11#define HWCAP_FAST_MULT (1 << 4)
12#define HWCAP_FPA (1 << 5)
13#define HWCAP_VFP (1 << 6)
14#define HWCAP_EDSP (1 << 7)
15#define HWCAP_JAVA (1 << 8)
16#define HWCAP_IWMMXT (1 << 9)
17#define HWCAP_CRUNCH (1 << 10)
18#define HWCAP_THUMBEE (1 << 11)
19#define HWCAP_NEON (1 << 12)
20#define HWCAP_VFPv3 (1 << 13)
21#define HWCAP_VFPv3D16 (1 << 14)
22#define HWCAP_TLS (1 << 15)
23#define HWCAP_VFPv4 (1 << 16)
24#define HWCAP_IDIVA (1 << 17)
25#define HWCAP_IDIVT (1 << 18)
26#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
27
28
29#endif /* _UAPI__ASMARM_HWCAP_H */
diff --git a/arch/arm/include/asm/ioctls.h b/arch/arm/include/uapi/asm/ioctls.h
index 9c962981612..9c962981612 100644
--- a/arch/arm/include/asm/ioctls.h
+++ b/arch/arm/include/uapi/asm/ioctls.h
diff --git a/arch/arm/include/asm/kvm_para.h b/arch/arm/include/uapi/asm/kvm_para.h
index 14fab8f0b95..14fab8f0b95 100644
--- a/arch/arm/include/asm/kvm_para.h
+++ b/arch/arm/include/uapi/asm/kvm_para.h
diff --git a/arch/arm/include/asm/mman.h b/arch/arm/include/uapi/asm/mman.h
index 41f99c573b9..41f99c573b9 100644
--- a/arch/arm/include/asm/mman.h
+++ b/arch/arm/include/uapi/asm/mman.h
diff --git a/arch/arm/include/asm/posix_types.h b/arch/arm/include/uapi/asm/posix_types.h
index d2de9cbbcd9..d2de9cbbcd9 100644
--- a/arch/arm/include/asm/posix_types.h
+++ b/arch/arm/include/uapi/asm/posix_types.h
diff --git a/arch/arm/include/uapi/asm/ptrace.h b/arch/arm/include/uapi/asm/ptrace.h
new file mode 100644
index 00000000000..96ee0929790
--- /dev/null
+++ b/arch/arm/include/uapi/asm/ptrace.h
@@ -0,0 +1,138 @@
1/*
2 * arch/arm/include/asm/ptrace.h
3 *
4 * Copyright (C) 1996-2003 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef _UAPI__ASM_ARM_PTRACE_H
11#define _UAPI__ASM_ARM_PTRACE_H
12
13#include <asm/hwcap.h>
14
15#define PTRACE_GETREGS 12
16#define PTRACE_SETREGS 13
17#define PTRACE_GETFPREGS 14
18#define PTRACE_SETFPREGS 15
19/* PTRACE_ATTACH is 16 */
20/* PTRACE_DETACH is 17 */
21#define PTRACE_GETWMMXREGS 18
22#define PTRACE_SETWMMXREGS 19
23/* 20 is unused */
24#define PTRACE_OLDSETOPTIONS 21
25#define PTRACE_GET_THREAD_AREA 22
26#define PTRACE_SET_SYSCALL 23
27/* PTRACE_SYSCALL is 24 */
28#define PTRACE_GETCRUNCHREGS 25
29#define PTRACE_SETCRUNCHREGS 26
30#define PTRACE_GETVFPREGS 27
31#define PTRACE_SETVFPREGS 28
32#define PTRACE_GETHBPREGS 29
33#define PTRACE_SETHBPREGS 30
34
35/*
36 * PSR bits
37 */
38#define USR26_MODE 0x00000000
39#define FIQ26_MODE 0x00000001
40#define IRQ26_MODE 0x00000002
41#define SVC26_MODE 0x00000003
42#define USR_MODE 0x00000010
43#define FIQ_MODE 0x00000011
44#define IRQ_MODE 0x00000012
45#define SVC_MODE 0x00000013
46#define ABT_MODE 0x00000017
47#define HYP_MODE 0x0000001a
48#define UND_MODE 0x0000001b
49#define SYSTEM_MODE 0x0000001f
50#define MODE32_BIT 0x00000010
51#define MODE_MASK 0x0000001f
52#define PSR_T_BIT 0x00000020
53#define PSR_F_BIT 0x00000040
54#define PSR_I_BIT 0x00000080
55#define PSR_A_BIT 0x00000100
56#define PSR_E_BIT 0x00000200
57#define PSR_J_BIT 0x01000000
58#define PSR_Q_BIT 0x08000000
59#define PSR_V_BIT 0x10000000
60#define PSR_C_BIT 0x20000000
61#define PSR_Z_BIT 0x40000000
62#define PSR_N_BIT 0x80000000
63
64/*
65 * Groups of PSR bits
66 */
67#define PSR_f 0xff000000 /* Flags */
68#define PSR_s 0x00ff0000 /* Status */
69#define PSR_x 0x0000ff00 /* Extension */
70#define PSR_c 0x000000ff /* Control */
71
72/*
73 * ARMv7 groups of PSR bits
74 */
75#define APSR_MASK 0xf80f0000 /* N, Z, C, V, Q and GE flags */
76#define PSR_ISET_MASK 0x01000010 /* ISA state (J, T) mask */
77#define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */
78#define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */
79
80/*
81 * Default endianness state
82 */
83#ifdef CONFIG_CPU_ENDIAN_BE8
84#define PSR_ENDSTATE PSR_E_BIT
85#else
86#define PSR_ENDSTATE 0
87#endif
88
89/*
90 * These are 'magic' values for PTRACE_PEEKUSR that return info about where a
91 * process is located in memory.
92 */
93#define PT_TEXT_ADDR 0x10000
94#define PT_DATA_ADDR 0x10004
95#define PT_TEXT_END_ADDR 0x10008
96
97#ifndef __ASSEMBLY__
98
99/*
100 * This struct defines the way the registers are stored on the
101 * stack during a system call. Note that sizeof(struct pt_regs)
102 * has to be a multiple of 8.
103 */
104#ifndef __KERNEL__
105struct pt_regs {
106 long uregs[18];
107};
108#endif /* __KERNEL__ */
109
110#define ARM_cpsr uregs[16]
111#define ARM_pc uregs[15]
112#define ARM_lr uregs[14]
113#define ARM_sp uregs[13]
114#define ARM_ip uregs[12]
115#define ARM_fp uregs[11]
116#define ARM_r10 uregs[10]
117#define ARM_r9 uregs[9]
118#define ARM_r8 uregs[8]
119#define ARM_r7 uregs[7]
120#define ARM_r6 uregs[6]
121#define ARM_r5 uregs[5]
122#define ARM_r4 uregs[4]
123#define ARM_r3 uregs[3]
124#define ARM_r2 uregs[2]
125#define ARM_r1 uregs[1]
126#define ARM_r0 uregs[0]
127#define ARM_ORIG_r0 uregs[17]
128
129/*
130 * The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS
131 * and core dumps.
132 */
133#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
134
135
136#endif /* __ASSEMBLY__ */
137
138#endif /* _UAPI__ASM_ARM_PTRACE_H */
diff --git a/arch/arm/include/uapi/asm/setup.h b/arch/arm/include/uapi/asm/setup.h
new file mode 100644
index 00000000000..979ff401640
--- /dev/null
+++ b/arch/arm/include/uapi/asm/setup.h
@@ -0,0 +1,187 @@
1/*
2 * linux/include/asm/setup.h
3 *
4 * Copyright (C) 1997-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Structure passed to kernel to tell it about the
11 * hardware it's running on. See Documentation/arm/Setup
12 * for more info.
13 */
14#ifndef _UAPI__ASMARM_SETUP_H
15#define _UAPI__ASMARM_SETUP_H
16
17#include <linux/types.h>
18
19#define COMMAND_LINE_SIZE 1024
20
21/* The list ends with an ATAG_NONE node. */
22#define ATAG_NONE 0x00000000
23
24struct tag_header {
25 __u32 size;
26 __u32 tag;
27};
28
29/* The list must start with an ATAG_CORE node */
30#define ATAG_CORE 0x54410001
31
32struct tag_core {
33 __u32 flags; /* bit 0 = read-only */
34 __u32 pagesize;
35 __u32 rootdev;
36};
37
38/* it is allowed to have multiple ATAG_MEM nodes */
39#define ATAG_MEM 0x54410002
40
41struct tag_mem32 {
42 __u32 size;
43 __u32 start; /* physical start address */
44};
45
46/* VGA text type displays */
47#define ATAG_VIDEOTEXT 0x54410003
48
49struct tag_videotext {
50 __u8 x;
51 __u8 y;
52 __u16 video_page;
53 __u8 video_mode;
54 __u8 video_cols;
55 __u16 video_ega_bx;
56 __u8 video_lines;
57 __u8 video_isvga;
58 __u16 video_points;
59};
60
61/* describes how the ramdisk will be used in kernel */
62#define ATAG_RAMDISK 0x54410004
63
64struct tag_ramdisk {
65 __u32 flags; /* bit 0 = load, bit 1 = prompt */
66 __u32 size; /* decompressed ramdisk size in _kilo_ bytes */
67 __u32 start; /* starting block of floppy-based RAM disk image */
68};
69
70/* describes where the compressed ramdisk image lives (virtual address) */
71/*
72 * this one accidentally used virtual addresses - as such,
73 * it's deprecated.
74 */
75#define ATAG_INITRD 0x54410005
76
77/* describes where the compressed ramdisk image lives (physical address) */
78#define ATAG_INITRD2 0x54420005
79
80struct tag_initrd {
81 __u32 start; /* physical start address */
82 __u32 size; /* size of compressed ramdisk image in bytes */
83};
84
85/* board serial number. "64 bits should be enough for everybody" */
86#define ATAG_SERIAL 0x54410006
87
88struct tag_serialnr {
89 __u32 low;
90 __u32 high;
91};
92
93/* board revision */
94#define ATAG_REVISION 0x54410007
95
96struct tag_revision {
97 __u32 rev;
98};
99
100/* initial values for vesafb-type framebuffers. see struct screen_info
101 * in include/linux/tty.h
102 */
103#define ATAG_VIDEOLFB 0x54410008
104
105struct tag_videolfb {
106 __u16 lfb_width;
107 __u16 lfb_height;
108 __u16 lfb_depth;
109 __u16 lfb_linelength;
110 __u32 lfb_base;
111 __u32 lfb_size;
112 __u8 red_size;
113 __u8 red_pos;
114 __u8 green_size;
115 __u8 green_pos;
116 __u8 blue_size;
117 __u8 blue_pos;
118 __u8 rsvd_size;
119 __u8 rsvd_pos;
120};
121
122/* command line: \0 terminated string */
123#define ATAG_CMDLINE 0x54410009
124
125struct tag_cmdline {
126 char cmdline[1]; /* this is the minimum size */
127};
128
129/* acorn RiscPC specific information */
130#define ATAG_ACORN 0x41000101
131
132struct tag_acorn {
133 __u32 memc_control_reg;
134 __u32 vram_pages;
135 __u8 sounddefault;
136 __u8 adfsdrives;
137};
138
139/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
140#define ATAG_MEMCLK 0x41000402
141
142struct tag_memclk {
143 __u32 fmemclk;
144};
145
146struct tag {
147 struct tag_header hdr;
148 union {
149 struct tag_core core;
150 struct tag_mem32 mem;
151 struct tag_videotext videotext;
152 struct tag_ramdisk ramdisk;
153 struct tag_initrd initrd;
154 struct tag_serialnr serialnr;
155 struct tag_revision revision;
156 struct tag_videolfb videolfb;
157 struct tag_cmdline cmdline;
158
159 /*
160 * Acorn specific
161 */
162 struct tag_acorn acorn;
163
164 /*
165 * DC21285 specific
166 */
167 struct tag_memclk memclk;
168 } u;
169};
170
171struct tagtable {
172 __u32 tag;
173 int (*parse)(const struct tag *);
174};
175
176#define tag_member_present(tag,member) \
177 ((unsigned long)(&((struct tag *)0L)->member + 1) \
178 <= (tag)->hdr.size * 4)
179
180#define tag_next(t) ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
181#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
182
183#define for_each_tag(t,base) \
184 for (t = base; t->hdr.size; t = tag_next(t))
185
186
187#endif /* _UAPI__ASMARM_SETUP_H */
diff --git a/arch/arm/include/asm/sigcontext.h b/arch/arm/include/uapi/asm/sigcontext.h
index fc0b80b6a6f..fc0b80b6a6f 100644
--- a/arch/arm/include/asm/sigcontext.h
+++ b/arch/arm/include/uapi/asm/sigcontext.h
diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h
new file mode 100644
index 00000000000..921c57fdc52
--- /dev/null
+++ b/arch/arm/include/uapi/asm/signal.h
@@ -0,0 +1,127 @@
1#ifndef _UAPI_ASMARM_SIGNAL_H
2#define _UAPI_ASMARM_SIGNAL_H
3
4#include <linux/types.h>
5
6/* Avoid too many header ordering problems. */
7struct siginfo;
8
9#ifndef __KERNEL__
10/* Here we must cater to libcs that poke about in kernel headers. */
11
12#define NSIG 32
13typedef unsigned long sigset_t;
14
15#endif /* __KERNEL__ */
16
17#define SIGHUP 1
18#define SIGINT 2
19#define SIGQUIT 3
20#define SIGILL 4
21#define SIGTRAP 5
22#define SIGABRT 6
23#define SIGIOT 6
24#define SIGBUS 7
25#define SIGFPE 8
26#define SIGKILL 9
27#define SIGUSR1 10
28#define SIGSEGV 11
29#define SIGUSR2 12
30#define SIGPIPE 13
31#define SIGALRM 14
32#define SIGTERM 15
33#define SIGSTKFLT 16
34#define SIGCHLD 17
35#define SIGCONT 18
36#define SIGSTOP 19
37#define SIGTSTP 20
38#define SIGTTIN 21
39#define SIGTTOU 22
40#define SIGURG 23
41#define SIGXCPU 24
42#define SIGXFSZ 25
43#define SIGVTALRM 26
44#define SIGPROF 27
45#define SIGWINCH 28
46#define SIGIO 29
47#define SIGPOLL SIGIO
48/*
49#define SIGLOST 29
50*/
51#define SIGPWR 30
52#define SIGSYS 31
53#define SIGUNUSED 31
54
55/* These should not be considered constants from userland. */
56#define SIGRTMIN 32
57#define SIGRTMAX _NSIG
58
59#define SIGSWI 32
60
61/*
62 * SA_FLAGS values:
63 *
64 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
65 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
66 * SA_SIGINFO deliver the signal with SIGINFO structs
67 * SA_THIRTYTWO delivers the signal in 32-bit mode, even if the task
68 * is running in 26-bit.
69 * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)).
70 * SA_RESTART flag to get restarting signals (which were the default long ago)
71 * SA_NODEFER prevents the current signal from being masked in the handler.
72 * SA_RESETHAND clears the handler when the signal is delivered.
73 *
74 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
75 * Unix names RESETHAND and NODEFER respectively.
76 */
77#define SA_NOCLDSTOP 0x00000001
78#define SA_NOCLDWAIT 0x00000002
79#define SA_SIGINFO 0x00000004
80#define SA_THIRTYTWO 0x02000000
81#define SA_RESTORER 0x04000000
82#define SA_ONSTACK 0x08000000
83#define SA_RESTART 0x10000000
84#define SA_NODEFER 0x40000000
85#define SA_RESETHAND 0x80000000
86
87#define SA_NOMASK SA_NODEFER
88#define SA_ONESHOT SA_RESETHAND
89
90
91/*
92 * sigaltstack controls
93 */
94#define SS_ONSTACK 1
95#define SS_DISABLE 2
96
97#define MINSIGSTKSZ 2048
98#define SIGSTKSZ 8192
99
100#include <asm-generic/signal-defs.h>
101
102#ifndef __KERNEL__
103/* Here we must cater to libcs that poke about in kernel headers. */
104
105struct sigaction {
106 union {
107 __sighandler_t _sa_handler;
108 void (*_sa_sigaction)(int, struct siginfo *, void *);
109 } _u;
110 sigset_t sa_mask;
111 unsigned long sa_flags;
112 void (*sa_restorer)(void);
113};
114
115#define sa_handler _u._sa_handler
116#define sa_sigaction _u._sa_sigaction
117
118#endif /* __KERNEL__ */
119
120typedef struct sigaltstack {
121 void __user *ss_sp;
122 int ss_flags;
123 size_t ss_size;
124} stack_t;
125
126
127#endif /* _UAPI_ASMARM_SIGNAL_H */
diff --git a/arch/arm/include/asm/stat.h b/arch/arm/include/uapi/asm/stat.h
index 42c0c13999d..42c0c13999d 100644
--- a/arch/arm/include/asm/stat.h
+++ b/arch/arm/include/uapi/asm/stat.h
diff --git a/arch/arm/include/asm/statfs.h b/arch/arm/include/uapi/asm/statfs.h
index 079447c05ba..079447c05ba 100644
--- a/arch/arm/include/asm/statfs.h
+++ b/arch/arm/include/uapi/asm/statfs.h
diff --git a/arch/arm/include/uapi/asm/swab.h b/arch/arm/include/uapi/asm/swab.h
new file mode 100644
index 00000000000..6fcb32a5c45
--- /dev/null
+++ b/arch/arm/include/uapi/asm/swab.h
@@ -0,0 +1,53 @@
1/*
2 * arch/arm/include/asm/byteorder.h
3 *
4 * ARM Endian-ness. In little endian mode, the data bus is connected such
5 * that byte accesses appear as:
6 * 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
7 * and word accesses (data or instruction) appear as:
8 * d0...d31
9 *
10 * When in big endian mode, byte accesses appear as:
11 * 0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
12 * and word accesses (data or instruction) appear as:
13 * d0...d31
14 */
15#ifndef _UAPI__ASM_ARM_SWAB_H
16#define _UAPI__ASM_ARM_SWAB_H
17
18#include <linux/compiler.h>
19#include <linux/types.h>
20
21#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
22# define __SWAB_64_THRU_32__
23#endif
24
25
26#if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6
27static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
28{
29 __u32 t;
30
31#ifndef __thumb__
32 if (!__builtin_constant_p(x)) {
33 /*
34 * The compiler needs a bit of a hint here to always do the
35 * right thing and not screw it up to different degrees
36 * depending on the gcc version.
37 */
38 asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
39 } else
40#endif
41 t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
42
43 x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */
44 t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */
45 x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */
46
47 return x;
48}
49#define __arch_swab32 __arch_swab32
50
51#endif
52
53#endif /* _UAPI__ASM_ARM_SWAB_H */
diff --git a/arch/arm/include/uapi/asm/unistd.h b/arch/arm/include/uapi/asm/unistd.h
new file mode 100644
index 00000000000..ac03bdb4ae4
--- /dev/null
+++ b/arch/arm/include/uapi/asm/unistd.h
@@ -0,0 +1,450 @@
1/*
2 * arch/arm/include/asm/unistd.h
3 *
4 * Copyright (C) 2001-2005 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
11 * no matter what the change is. Thanks!
12 */
13#ifndef _UAPI__ASM_ARM_UNISTD_H
14#define _UAPI__ASM_ARM_UNISTD_H
15
16#define __NR_OABI_SYSCALL_BASE 0x900000
17
18#if defined(__thumb__) || defined(__ARM_EABI__)
19#define __NR_SYSCALL_BASE 0
20#else
21#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
22#endif
23
24/*
25 * This file contains the system call numbers.
26 */
27
28#define __NR_restart_syscall (__NR_SYSCALL_BASE+ 0)
29#define __NR_exit (__NR_SYSCALL_BASE+ 1)
30#define __NR_fork (__NR_SYSCALL_BASE+ 2)
31#define __NR_read (__NR_SYSCALL_BASE+ 3)
32#define __NR_write (__NR_SYSCALL_BASE+ 4)
33#define __NR_open (__NR_SYSCALL_BASE+ 5)
34#define __NR_close (__NR_SYSCALL_BASE+ 6)
35 /* 7 was sys_waitpid */
36#define __NR_creat (__NR_SYSCALL_BASE+ 8)
37#define __NR_link (__NR_SYSCALL_BASE+ 9)
38#define __NR_unlink (__NR_SYSCALL_BASE+ 10)
39#define __NR_execve (__NR_SYSCALL_BASE+ 11)
40#define __NR_chdir (__NR_SYSCALL_BASE+ 12)
41#define __NR_time (__NR_SYSCALL_BASE+ 13)
42#define __NR_mknod (__NR_SYSCALL_BASE+ 14)
43#define __NR_chmod (__NR_SYSCALL_BASE+ 15)
44#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
45 /* 17 was sys_break */
46 /* 18 was sys_stat */
47#define __NR_lseek (__NR_SYSCALL_BASE+ 19)
48#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
49#define __NR_mount (__NR_SYSCALL_BASE+ 21)
50#define __NR_umount (__NR_SYSCALL_BASE+ 22)
51#define __NR_setuid (__NR_SYSCALL_BASE+ 23)
52#define __NR_getuid (__NR_SYSCALL_BASE+ 24)
53#define __NR_stime (__NR_SYSCALL_BASE+ 25)
54#define __NR_ptrace (__NR_SYSCALL_BASE+ 26)
55#define __NR_alarm (__NR_SYSCALL_BASE+ 27)
56 /* 28 was sys_fstat */
57#define __NR_pause (__NR_SYSCALL_BASE+ 29)
58#define __NR_utime (__NR_SYSCALL_BASE+ 30)
59 /* 31 was sys_stty */
60 /* 32 was sys_gtty */
61#define __NR_access (__NR_SYSCALL_BASE+ 33)
62#define __NR_nice (__NR_SYSCALL_BASE+ 34)
63 /* 35 was sys_ftime */
64#define __NR_sync (__NR_SYSCALL_BASE+ 36)
65#define __NR_kill (__NR_SYSCALL_BASE+ 37)
66#define __NR_rename (__NR_SYSCALL_BASE+ 38)
67#define __NR_mkdir (__NR_SYSCALL_BASE+ 39)
68#define __NR_rmdir (__NR_SYSCALL_BASE+ 40)
69#define __NR_dup (__NR_SYSCALL_BASE+ 41)
70#define __NR_pipe (__NR_SYSCALL_BASE+ 42)
71#define __NR_times (__NR_SYSCALL_BASE+ 43)
72 /* 44 was sys_prof */
73#define __NR_brk (__NR_SYSCALL_BASE+ 45)
74#define __NR_setgid (__NR_SYSCALL_BASE+ 46)
75#define __NR_getgid (__NR_SYSCALL_BASE+ 47)
76 /* 48 was sys_signal */
77#define __NR_geteuid (__NR_SYSCALL_BASE+ 49)
78#define __NR_getegid (__NR_SYSCALL_BASE+ 50)
79#define __NR_acct (__NR_SYSCALL_BASE+ 51)
80#define __NR_umount2 (__NR_SYSCALL_BASE+ 52)
81 /* 53 was sys_lock */
82#define __NR_ioctl (__NR_SYSCALL_BASE+ 54)
83#define __NR_fcntl (__NR_SYSCALL_BASE+ 55)
84 /* 56 was sys_mpx */
85#define __NR_setpgid (__NR_SYSCALL_BASE+ 57)
86 /* 58 was sys_ulimit */
87 /* 59 was sys_olduname */
88#define __NR_umask (__NR_SYSCALL_BASE+ 60)
89#define __NR_chroot (__NR_SYSCALL_BASE+ 61)
90#define __NR_ustat (__NR_SYSCALL_BASE+ 62)
91#define __NR_dup2 (__NR_SYSCALL_BASE+ 63)
92#define __NR_getppid (__NR_SYSCALL_BASE+ 64)
93#define __NR_getpgrp (__NR_SYSCALL_BASE+ 65)
94#define __NR_setsid (__NR_SYSCALL_BASE+ 66)
95#define __NR_sigaction (__NR_SYSCALL_BASE+ 67)
96 /* 68 was sys_sgetmask */
97 /* 69 was sys_ssetmask */
98#define __NR_setreuid (__NR_SYSCALL_BASE+ 70)
99#define __NR_setregid (__NR_SYSCALL_BASE+ 71)
100#define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72)
101#define __NR_sigpending (__NR_SYSCALL_BASE+ 73)
102#define __NR_sethostname (__NR_SYSCALL_BASE+ 74)
103#define __NR_setrlimit (__NR_SYSCALL_BASE+ 75)
104#define __NR_getrlimit (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
105#define __NR_getrusage (__NR_SYSCALL_BASE+ 77)
106#define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78)
107#define __NR_settimeofday (__NR_SYSCALL_BASE+ 79)
108#define __NR_getgroups (__NR_SYSCALL_BASE+ 80)
109#define __NR_setgroups (__NR_SYSCALL_BASE+ 81)
110#define __NR_select (__NR_SYSCALL_BASE+ 82)
111#define __NR_symlink (__NR_SYSCALL_BASE+ 83)
112 /* 84 was sys_lstat */
113#define __NR_readlink (__NR_SYSCALL_BASE+ 85)
114#define __NR_uselib (__NR_SYSCALL_BASE+ 86)
115#define __NR_swapon (__NR_SYSCALL_BASE+ 87)
116#define __NR_reboot (__NR_SYSCALL_BASE+ 88)
117#define __NR_readdir (__NR_SYSCALL_BASE+ 89)
118#define __NR_mmap (__NR_SYSCALL_BASE+ 90)
119#define __NR_munmap (__NR_SYSCALL_BASE+ 91)
120#define __NR_truncate (__NR_SYSCALL_BASE+ 92)
121#define __NR_ftruncate (__NR_SYSCALL_BASE+ 93)
122#define __NR_fchmod (__NR_SYSCALL_BASE+ 94)
123#define __NR_fchown (__NR_SYSCALL_BASE+ 95)
124#define __NR_getpriority (__NR_SYSCALL_BASE+ 96)
125#define __NR_setpriority (__NR_SYSCALL_BASE+ 97)
126 /* 98 was sys_profil */
127#define __NR_statfs (__NR_SYSCALL_BASE+ 99)
128#define __NR_fstatfs (__NR_SYSCALL_BASE+100)
129 /* 101 was sys_ioperm */
130#define __NR_socketcall (__NR_SYSCALL_BASE+102)
131#define __NR_syslog (__NR_SYSCALL_BASE+103)
132#define __NR_setitimer (__NR_SYSCALL_BASE+104)
133#define __NR_getitimer (__NR_SYSCALL_BASE+105)
134#define __NR_stat (__NR_SYSCALL_BASE+106)
135#define __NR_lstat (__NR_SYSCALL_BASE+107)
136#define __NR_fstat (__NR_SYSCALL_BASE+108)
137 /* 109 was sys_uname */
138 /* 110 was sys_iopl */
139#define __NR_vhangup (__NR_SYSCALL_BASE+111)
140 /* 112 was sys_idle */
141#define __NR_syscall (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
142#define __NR_wait4 (__NR_SYSCALL_BASE+114)
143#define __NR_swapoff (__NR_SYSCALL_BASE+115)
144#define __NR_sysinfo (__NR_SYSCALL_BASE+116)
145#define __NR_ipc (__NR_SYSCALL_BASE+117)
146#define __NR_fsync (__NR_SYSCALL_BASE+118)
147#define __NR_sigreturn (__NR_SYSCALL_BASE+119)
148#define __NR_clone (__NR_SYSCALL_BASE+120)
149#define __NR_setdomainname (__NR_SYSCALL_BASE+121)
150#define __NR_uname (__NR_SYSCALL_BASE+122)
151 /* 123 was sys_modify_ldt */
152#define __NR_adjtimex (__NR_SYSCALL_BASE+124)
153#define __NR_mprotect (__NR_SYSCALL_BASE+125)
154#define __NR_sigprocmask (__NR_SYSCALL_BASE+126)
155 /* 127 was sys_create_module */
156#define __NR_init_module (__NR_SYSCALL_BASE+128)
157#define __NR_delete_module (__NR_SYSCALL_BASE+129)
158 /* 130 was sys_get_kernel_syms */
159#define __NR_quotactl (__NR_SYSCALL_BASE+131)
160#define __NR_getpgid (__NR_SYSCALL_BASE+132)
161#define __NR_fchdir (__NR_SYSCALL_BASE+133)
162#define __NR_bdflush (__NR_SYSCALL_BASE+134)
163#define __NR_sysfs (__NR_SYSCALL_BASE+135)
164#define __NR_personality (__NR_SYSCALL_BASE+136)
165 /* 137 was sys_afs_syscall */
166#define __NR_setfsuid (__NR_SYSCALL_BASE+138)
167#define __NR_setfsgid (__NR_SYSCALL_BASE+139)
168#define __NR__llseek (__NR_SYSCALL_BASE+140)
169#define __NR_getdents (__NR_SYSCALL_BASE+141)
170#define __NR__newselect (__NR_SYSCALL_BASE+142)
171#define __NR_flock (__NR_SYSCALL_BASE+143)
172#define __NR_msync (__NR_SYSCALL_BASE+144)
173#define __NR_readv (__NR_SYSCALL_BASE+145)
174#define __NR_writev (__NR_SYSCALL_BASE+146)
175#define __NR_getsid (__NR_SYSCALL_BASE+147)
176#define __NR_fdatasync (__NR_SYSCALL_BASE+148)
177#define __NR__sysctl (__NR_SYSCALL_BASE+149)
178#define __NR_mlock (__NR_SYSCALL_BASE+150)
179#define __NR_munlock (__NR_SYSCALL_BASE+151)
180#define __NR_mlockall (__NR_SYSCALL_BASE+152)
181#define __NR_munlockall (__NR_SYSCALL_BASE+153)
182#define __NR_sched_setparam (__NR_SYSCALL_BASE+154)
183#define __NR_sched_getparam (__NR_SYSCALL_BASE+155)
184#define __NR_sched_setscheduler (__NR_SYSCALL_BASE+156)
185#define __NR_sched_getscheduler (__NR_SYSCALL_BASE+157)
186#define __NR_sched_yield (__NR_SYSCALL_BASE+158)
187#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE+159)
188#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE+160)
189#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE+161)
190#define __NR_nanosleep (__NR_SYSCALL_BASE+162)
191#define __NR_mremap (__NR_SYSCALL_BASE+163)
192#define __NR_setresuid (__NR_SYSCALL_BASE+164)
193#define __NR_getresuid (__NR_SYSCALL_BASE+165)
194 /* 166 was sys_vm86 */
195 /* 167 was sys_query_module */
196#define __NR_poll (__NR_SYSCALL_BASE+168)
197#define __NR_nfsservctl (__NR_SYSCALL_BASE+169)
198#define __NR_setresgid (__NR_SYSCALL_BASE+170)
199#define __NR_getresgid (__NR_SYSCALL_BASE+171)
200#define __NR_prctl (__NR_SYSCALL_BASE+172)
201#define __NR_rt_sigreturn (__NR_SYSCALL_BASE+173)
202#define __NR_rt_sigaction (__NR_SYSCALL_BASE+174)
203#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE+175)
204#define __NR_rt_sigpending (__NR_SYSCALL_BASE+176)
205#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)
206#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)
207#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
208#define __NR_pread64 (__NR_SYSCALL_BASE+180)
209#define __NR_pwrite64 (__NR_SYSCALL_BASE+181)
210#define __NR_chown (__NR_SYSCALL_BASE+182)
211#define __NR_getcwd (__NR_SYSCALL_BASE+183)
212#define __NR_capget (__NR_SYSCALL_BASE+184)
213#define __NR_capset (__NR_SYSCALL_BASE+185)
214#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)
215#define __NR_sendfile (__NR_SYSCALL_BASE+187)
216 /* 188 reserved */
217 /* 189 reserved */
218#define __NR_vfork (__NR_SYSCALL_BASE+190)
219#define __NR_ugetrlimit (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
220#define __NR_mmap2 (__NR_SYSCALL_BASE+192)
221#define __NR_truncate64 (__NR_SYSCALL_BASE+193)
222#define __NR_ftruncate64 (__NR_SYSCALL_BASE+194)
223#define __NR_stat64 (__NR_SYSCALL_BASE+195)
224#define __NR_lstat64 (__NR_SYSCALL_BASE+196)
225#define __NR_fstat64 (__NR_SYSCALL_BASE+197)
226#define __NR_lchown32 (__NR_SYSCALL_BASE+198)
227#define __NR_getuid32 (__NR_SYSCALL_BASE+199)
228#define __NR_getgid32 (__NR_SYSCALL_BASE+200)
229#define __NR_geteuid32 (__NR_SYSCALL_BASE+201)
230#define __NR_getegid32 (__NR_SYSCALL_BASE+202)
231#define __NR_setreuid32 (__NR_SYSCALL_BASE+203)
232#define __NR_setregid32 (__NR_SYSCALL_BASE+204)
233#define __NR_getgroups32 (__NR_SYSCALL_BASE+205)
234#define __NR_setgroups32 (__NR_SYSCALL_BASE+206)
235#define __NR_fchown32 (__NR_SYSCALL_BASE+207)
236#define __NR_setresuid32 (__NR_SYSCALL_BASE+208)
237#define __NR_getresuid32 (__NR_SYSCALL_BASE+209)
238#define __NR_setresgid32 (__NR_SYSCALL_BASE+210)
239#define __NR_getresgid32 (__NR_SYSCALL_BASE+211)
240#define __NR_chown32 (__NR_SYSCALL_BASE+212)
241#define __NR_setuid32 (__NR_SYSCALL_BASE+213)
242#define __NR_setgid32 (__NR_SYSCALL_BASE+214)
243#define __NR_setfsuid32 (__NR_SYSCALL_BASE+215)
244#define __NR_setfsgid32 (__NR_SYSCALL_BASE+216)
245#define __NR_getdents64 (__NR_SYSCALL_BASE+217)
246#define __NR_pivot_root (__NR_SYSCALL_BASE+218)
247#define __NR_mincore (__NR_SYSCALL_BASE+219)
248#define __NR_madvise (__NR_SYSCALL_BASE+220)
249#define __NR_fcntl64 (__NR_SYSCALL_BASE+221)
250 /* 222 for tux */
251 /* 223 is unused */
252#define __NR_gettid (__NR_SYSCALL_BASE+224)
253#define __NR_readahead (__NR_SYSCALL_BASE+225)
254#define __NR_setxattr (__NR_SYSCALL_BASE+226)
255#define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
256#define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
257#define __NR_getxattr (__NR_SYSCALL_BASE+229)
258#define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
259#define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
260#define __NR_listxattr (__NR_SYSCALL_BASE+232)
261#define __NR_llistxattr (__NR_SYSCALL_BASE+233)
262#define __NR_flistxattr (__NR_SYSCALL_BASE+234)
263#define __NR_removexattr (__NR_SYSCALL_BASE+235)
264#define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
265#define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
266#define __NR_tkill (__NR_SYSCALL_BASE+238)
267#define __NR_sendfile64 (__NR_SYSCALL_BASE+239)
268#define __NR_futex (__NR_SYSCALL_BASE+240)
269#define __NR_sched_setaffinity (__NR_SYSCALL_BASE+241)
270#define __NR_sched_getaffinity (__NR_SYSCALL_BASE+242)
271#define __NR_io_setup (__NR_SYSCALL_BASE+243)
272#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
273#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
274#define __NR_io_submit (__NR_SYSCALL_BASE+246)
275#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
276#define __NR_exit_group (__NR_SYSCALL_BASE+248)
277#define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249)
278#define __NR_epoll_create (__NR_SYSCALL_BASE+250)
279#define __NR_epoll_ctl (__NR_SYSCALL_BASE+251)
280#define __NR_epoll_wait (__NR_SYSCALL_BASE+252)
281#define __NR_remap_file_pages (__NR_SYSCALL_BASE+253)
282 /* 254 for set_thread_area */
283 /* 255 for get_thread_area */
284#define __NR_set_tid_address (__NR_SYSCALL_BASE+256)
285#define __NR_timer_create (__NR_SYSCALL_BASE+257)
286#define __NR_timer_settime (__NR_SYSCALL_BASE+258)
287#define __NR_timer_gettime (__NR_SYSCALL_BASE+259)
288#define __NR_timer_getoverrun (__NR_SYSCALL_BASE+260)
289#define __NR_timer_delete (__NR_SYSCALL_BASE+261)
290#define __NR_clock_settime (__NR_SYSCALL_BASE+262)
291#define __NR_clock_gettime (__NR_SYSCALL_BASE+263)
292#define __NR_clock_getres (__NR_SYSCALL_BASE+264)
293#define __NR_clock_nanosleep (__NR_SYSCALL_BASE+265)
294#define __NR_statfs64 (__NR_SYSCALL_BASE+266)
295#define __NR_fstatfs64 (__NR_SYSCALL_BASE+267)
296#define __NR_tgkill (__NR_SYSCALL_BASE+268)
297#define __NR_utimes (__NR_SYSCALL_BASE+269)
298#define __NR_arm_fadvise64_64 (__NR_SYSCALL_BASE+270)
299#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271)
300#define __NR_pciconfig_read (__NR_SYSCALL_BASE+272)
301#define __NR_pciconfig_write (__NR_SYSCALL_BASE+273)
302#define __NR_mq_open (__NR_SYSCALL_BASE+274)
303#define __NR_mq_unlink (__NR_SYSCALL_BASE+275)
304#define __NR_mq_timedsend (__NR_SYSCALL_BASE+276)
305#define __NR_mq_timedreceive (__NR_SYSCALL_BASE+277)
306#define __NR_mq_notify (__NR_SYSCALL_BASE+278)
307#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
308#define __NR_waitid (__NR_SYSCALL_BASE+280)
309#define __NR_socket (__NR_SYSCALL_BASE+281)
310#define __NR_bind (__NR_SYSCALL_BASE+282)
311#define __NR_connect (__NR_SYSCALL_BASE+283)
312#define __NR_listen (__NR_SYSCALL_BASE+284)
313#define __NR_accept (__NR_SYSCALL_BASE+285)
314#define __NR_getsockname (__NR_SYSCALL_BASE+286)
315#define __NR_getpeername (__NR_SYSCALL_BASE+287)
316#define __NR_socketpair (__NR_SYSCALL_BASE+288)
317#define __NR_send (__NR_SYSCALL_BASE+289)
318#define __NR_sendto (__NR_SYSCALL_BASE+290)
319#define __NR_recv (__NR_SYSCALL_BASE+291)
320#define __NR_recvfrom (__NR_SYSCALL_BASE+292)
321#define __NR_shutdown (__NR_SYSCALL_BASE+293)
322#define __NR_setsockopt (__NR_SYSCALL_BASE+294)
323#define __NR_getsockopt (__NR_SYSCALL_BASE+295)
324#define __NR_sendmsg (__NR_SYSCALL_BASE+296)
325#define __NR_recvmsg (__NR_SYSCALL_BASE+297)
326#define __NR_semop (__NR_SYSCALL_BASE+298)
327#define __NR_semget (__NR_SYSCALL_BASE+299)
328#define __NR_semctl (__NR_SYSCALL_BASE+300)
329#define __NR_msgsnd (__NR_SYSCALL_BASE+301)
330#define __NR_msgrcv (__NR_SYSCALL_BASE+302)
331#define __NR_msgget (__NR_SYSCALL_BASE+303)
332#define __NR_msgctl (__NR_SYSCALL_BASE+304)
333#define __NR_shmat (__NR_SYSCALL_BASE+305)
334#define __NR_shmdt (__NR_SYSCALL_BASE+306)
335#define __NR_shmget (__NR_SYSCALL_BASE+307)
336#define __NR_shmctl (__NR_SYSCALL_BASE+308)
337#define __NR_add_key (__NR_SYSCALL_BASE+309)
338#define __NR_request_key (__NR_SYSCALL_BASE+310)
339#define __NR_keyctl (__NR_SYSCALL_BASE+311)
340#define __NR_semtimedop (__NR_SYSCALL_BASE+312)
341#define __NR_vserver (__NR_SYSCALL_BASE+313)
342#define __NR_ioprio_set (__NR_SYSCALL_BASE+314)
343#define __NR_ioprio_get (__NR_SYSCALL_BASE+315)
344#define __NR_inotify_init (__NR_SYSCALL_BASE+316)
345#define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)
346#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)
347#define __NR_mbind (__NR_SYSCALL_BASE+319)
348#define __NR_get_mempolicy (__NR_SYSCALL_BASE+320)
349#define __NR_set_mempolicy (__NR_SYSCALL_BASE+321)
350#define __NR_openat (__NR_SYSCALL_BASE+322)
351#define __NR_mkdirat (__NR_SYSCALL_BASE+323)
352#define __NR_mknodat (__NR_SYSCALL_BASE+324)
353#define __NR_fchownat (__NR_SYSCALL_BASE+325)
354#define __NR_futimesat (__NR_SYSCALL_BASE+326)
355#define __NR_fstatat64 (__NR_SYSCALL_BASE+327)
356#define __NR_unlinkat (__NR_SYSCALL_BASE+328)
357#define __NR_renameat (__NR_SYSCALL_BASE+329)
358#define __NR_linkat (__NR_SYSCALL_BASE+330)
359#define __NR_symlinkat (__NR_SYSCALL_BASE+331)
360#define __NR_readlinkat (__NR_SYSCALL_BASE+332)
361#define __NR_fchmodat (__NR_SYSCALL_BASE+333)
362#define __NR_faccessat (__NR_SYSCALL_BASE+334)
363#define __NR_pselect6 (__NR_SYSCALL_BASE+335)
364#define __NR_ppoll (__NR_SYSCALL_BASE+336)
365#define __NR_unshare (__NR_SYSCALL_BASE+337)
366#define __NR_set_robust_list (__NR_SYSCALL_BASE+338)
367#define __NR_get_robust_list (__NR_SYSCALL_BASE+339)
368#define __NR_splice (__NR_SYSCALL_BASE+340)
369#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE+341)
370#define __NR_sync_file_range2 __NR_arm_sync_file_range
371#define __NR_tee (__NR_SYSCALL_BASE+342)
372#define __NR_vmsplice (__NR_SYSCALL_BASE+343)
373#define __NR_move_pages (__NR_SYSCALL_BASE+344)
374#define __NR_getcpu (__NR_SYSCALL_BASE+345)
375#define __NR_epoll_pwait (__NR_SYSCALL_BASE+346)
376#define __NR_kexec_load (__NR_SYSCALL_BASE+347)
377#define __NR_utimensat (__NR_SYSCALL_BASE+348)
378#define __NR_signalfd (__NR_SYSCALL_BASE+349)
379#define __NR_timerfd_create (__NR_SYSCALL_BASE+350)
380#define __NR_eventfd (__NR_SYSCALL_BASE+351)
381#define __NR_fallocate (__NR_SYSCALL_BASE+352)
382#define __NR_timerfd_settime (__NR_SYSCALL_BASE+353)
383#define __NR_timerfd_gettime (__NR_SYSCALL_BASE+354)
384#define __NR_signalfd4 (__NR_SYSCALL_BASE+355)
385#define __NR_eventfd2 (__NR_SYSCALL_BASE+356)
386#define __NR_epoll_create1 (__NR_SYSCALL_BASE+357)
387#define __NR_dup3 (__NR_SYSCALL_BASE+358)
388#define __NR_pipe2 (__NR_SYSCALL_BASE+359)
389#define __NR_inotify_init1 (__NR_SYSCALL_BASE+360)
390#define __NR_preadv (__NR_SYSCALL_BASE+361)
391#define __NR_pwritev (__NR_SYSCALL_BASE+362)
392#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE+363)
393#define __NR_perf_event_open (__NR_SYSCALL_BASE+364)
394#define __NR_recvmmsg (__NR_SYSCALL_BASE+365)
395#define __NR_accept4 (__NR_SYSCALL_BASE+366)
396#define __NR_fanotify_init (__NR_SYSCALL_BASE+367)
397#define __NR_fanotify_mark (__NR_SYSCALL_BASE+368)
398#define __NR_prlimit64 (__NR_SYSCALL_BASE+369)
399#define __NR_name_to_handle_at (__NR_SYSCALL_BASE+370)
400#define __NR_open_by_handle_at (__NR_SYSCALL_BASE+371)
401#define __NR_clock_adjtime (__NR_SYSCALL_BASE+372)
402#define __NR_syncfs (__NR_SYSCALL_BASE+373)
403#define __NR_sendmmsg (__NR_SYSCALL_BASE+374)
404#define __NR_setns (__NR_SYSCALL_BASE+375)
405#define __NR_process_vm_readv (__NR_SYSCALL_BASE+376)
406#define __NR_process_vm_writev (__NR_SYSCALL_BASE+377)
407 /* 378 for kcmp */
408
409/*
410 * This may need to be greater than __NR_last_syscall+1 in order to
411 * account for the padding in the syscall table
412 */
413
414/*
415 * The following SWIs are ARM private.
416 */
417#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
418#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
419#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
420#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
421#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
422#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
423
424/*
425 * *NOTE*: This is a ghost syscall private to the kernel. Only the
426 * __kuser_cmpxchg code in entry-armv.S should be aware of its
427 * existence. Don't ever use this from user code.
428 */
429
430/*
431 * The following syscalls are obsolete and no longer available for EABI.
432 */
433#if !defined(__KERNEL__)
434#if defined(__ARM_EABI__)
435#undef __NR_time
436#undef __NR_umount
437#undef __NR_stime
438#undef __NR_alarm
439#undef __NR_utime
440#undef __NR_getrlimit
441#undef __NR_select
442#undef __NR_readdir
443#undef __NR_mmap
444#undef __NR_socketcall
445#undef __NR_syscall
446#undef __NR_ipc
447#endif
448#endif
449
450#endif /* _UAPI__ASM_ARM_UNISTD_H */
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 7ad2d5cf700..5bbec7b8183 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -19,9 +19,10 @@ obj-y := elf.o entry-armv.o entry-common.o irq.o opcodes.o \
19 process.o ptrace.o return_address.o sched_clock.o \ 19 process.o ptrace.o return_address.o sched_clock.o \
20 setup.o signal.o stacktrace.o sys_arm.o time.o traps.o 20 setup.o signal.o stacktrace.o sys_arm.o time.o traps.o
21 21
22obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += compat.o 22obj-$(CONFIG_ATAGS) += atags_parse.o
23obj-$(CONFIG_ATAGS_PROC) += atags_proc.o
24obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o
23 25
24obj-$(CONFIG_LEDS) += leds.o
25obj-$(CONFIG_OC_ETM) += etm.o 26obj-$(CONFIG_OC_ETM) += etm.o
26obj-$(CONFIG_CPU_IDLE) += cpuidle.o 27obj-$(CONFIG_CPU_IDLE) += cpuidle.o
27obj-$(CONFIG_ISA_DMA_API) += dma.o 28obj-$(CONFIG_ISA_DMA_API) += dma.o
@@ -52,7 +53,6 @@ test-kprobes-objs += kprobes-test-thumb.o
52else 53else
53test-kprobes-objs += kprobes-test-arm.o 54test-kprobes-objs += kprobes-test-arm.o
54endif 55endif
55obj-$(CONFIG_ATAGS_PROC) += atags.o
56obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o 56obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o
57obj-$(CONFIG_ARM_THUMBEE) += thumbee.o 57obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
58obj-$(CONFIG_KGDB) += kgdb.o 58obj-$(CONFIG_KGDB) += kgdb.o
@@ -69,8 +69,7 @@ obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o
69obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o 69obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
70obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o 70obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o
71obj-$(CONFIG_IWMMXT) += iwmmxt.o 71obj-$(CONFIG_IWMMXT) += iwmmxt.o
72obj-$(CONFIG_CPU_HAS_PMU) += pmu.o 72obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o perf_event_cpu.o
73obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o
74AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt 73AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt
75obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o 74obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o
76 75
@@ -82,4 +81,6 @@ head-y := head$(MMUEXT).o
82obj-$(CONFIG_DEBUG_LL) += debug.o 81obj-$(CONFIG_DEBUG_LL) += debug.o
83obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 82obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
84 83
84obj-$(CONFIG_ARM_VIRT_EXT) += hyp-stub.o
85
85extra-y := $(head-y) vmlinux.lds 86extra-y := $(head-y) vmlinux.lds
diff --git a/arch/arm/kernel/arch_timer.c b/arch/arm/kernel/arch_timer.c
index cf258807160..c8ef20747ee 100644
--- a/arch/arm/kernel/arch_timer.c
+++ b/arch/arm/kernel/arch_timer.c
@@ -21,18 +21,28 @@
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <asm/cputype.h> 23#include <asm/cputype.h>
24#include <asm/delay.h>
24#include <asm/localtimer.h> 25#include <asm/localtimer.h>
25#include <asm/arch_timer.h> 26#include <asm/arch_timer.h>
26#include <asm/system_info.h> 27#include <asm/system_info.h>
27#include <asm/sched_clock.h> 28#include <asm/sched_clock.h>
28 29
29static unsigned long arch_timer_rate; 30static unsigned long arch_timer_rate;
30static int arch_timer_ppi; 31
31static int arch_timer_ppi2; 32enum ppi_nr {
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];
32 41
33static struct clock_event_device __percpu **arch_timer_evt; 42static struct clock_event_device __percpu **arch_timer_evt;
43static struct delay_timer arch_delay_timer;
34 44
35extern void init_current_timer_delay(unsigned long freq); 45static bool arch_timer_use_virtual = true;
36 46
37/* 47/*
38 * Architected system timer support. 48 * Architected system timer support.
@@ -46,50 +56,104 @@ extern void init_current_timer_delay(unsigned long freq);
46#define ARCH_TIMER_REG_FREQ 1 56#define ARCH_TIMER_REG_FREQ 1
47#define ARCH_TIMER_REG_TVAL 2 57#define ARCH_TIMER_REG_TVAL 2
48 58
49static void arch_timer_reg_write(int reg, u32 val) 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)
50{ 68{
51 switch (reg) { 69 if (access == ARCH_TIMER_PHYS_ACCESS) {
52 case ARCH_TIMER_REG_CTRL: 70 switch (reg) {
53 asm volatile("mcr p15, 0, %0, c14, c2, 1" : : "r" (val)); 71 case ARCH_TIMER_REG_CTRL:
54 break; 72 asm volatile("mcr p15, 0, %0, c14, c2, 1" : : "r" (val));
55 case ARCH_TIMER_REG_TVAL: 73 break;
56 asm volatile("mcr p15, 0, %0, c14, c2, 0" : : "r" (val)); 74 case ARCH_TIMER_REG_TVAL:
57 break; 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 }
58 } 89 }
59 90
60 isb(); 91 isb();
61} 92}
62 93
63static u32 arch_timer_reg_read(int reg) 94static inline u32 arch_timer_reg_read(const int access, const int reg)
64{ 95{
65 u32 val; 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 }
66 111
67 switch (reg) { 112 if (access == ARCH_TIMER_VIRT_ACCESS) {
68 case ARCH_TIMER_REG_CTRL: 113 switch (reg) {
69 asm volatile("mrc p15, 0, %0, c14, c2, 1" : "=r" (val)); 114 case ARCH_TIMER_REG_CTRL:
70 break; 115 asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r" (val));
71 case ARCH_TIMER_REG_FREQ: 116 break;
72 asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val)); 117 case ARCH_TIMER_REG_TVAL:
73 break; 118 asm volatile("mrc p15, 0, %0, c14, c3, 0" : "=r" (val));
74 case ARCH_TIMER_REG_TVAL: 119 break;
75 asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val)); 120 }
76 break;
77 default:
78 BUG();
79 } 121 }
80 122
81 return val; 123 return val;
82} 124}
83 125
84static irqreturn_t arch_timer_handler(int irq, void *dev_id) 126static inline cycle_t arch_timer_counter_read(const int access)
85{ 127{
86 struct clock_event_device *evt = *(struct clock_event_device **)dev_id; 128 cycle_t cval = 0;
87 unsigned long ctrl; 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}
88 143
89 ctrl = arch_timer_reg_read(ARCH_TIMER_REG_CTRL); 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);
90 if (ctrl & ARCH_TIMER_CTRL_IT_STAT) { 154 if (ctrl & ARCH_TIMER_CTRL_IT_STAT) {
91 ctrl |= ARCH_TIMER_CTRL_IT_MASK; 155 ctrl |= ARCH_TIMER_CTRL_IT_MASK;
92 arch_timer_reg_write(ARCH_TIMER_REG_CTRL, ctrl); 156 arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ctrl);
93 evt->event_handler(evt); 157 evt->event_handler(evt);
94 return IRQ_HANDLED; 158 return IRQ_HANDLED;
95 } 159 }
@@ -97,63 +161,100 @@ static irqreturn_t arch_timer_handler(int irq, void *dev_id)
97 return IRQ_NONE; 161 return IRQ_NONE;
98} 162}
99 163
100static void arch_timer_disable(void) 164static irqreturn_t arch_timer_handler_virt(int irq, void *dev_id)
101{ 165{
102 unsigned long ctrl; 166 struct clock_event_device *evt = *(struct clock_event_device **)dev_id;
103 167
104 ctrl = arch_timer_reg_read(ARCH_TIMER_REG_CTRL); 168 return timer_handler(ARCH_TIMER_VIRT_ACCESS, evt);
105 ctrl &= ~ARCH_TIMER_CTRL_ENABLE;
106 arch_timer_reg_write(ARCH_TIMER_REG_CTRL, ctrl);
107} 169}
108 170
109static void arch_timer_set_mode(enum clock_event_mode mode, 171static irqreturn_t arch_timer_handler_phys(int irq, void *dev_id)
110 struct clock_event_device *clk)
111{ 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;
112 switch (mode) { 181 switch (mode) {
113 case CLOCK_EVT_MODE_UNUSED: 182 case CLOCK_EVT_MODE_UNUSED:
114 case CLOCK_EVT_MODE_SHUTDOWN: 183 case CLOCK_EVT_MODE_SHUTDOWN:
115 arch_timer_disable(); 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);
116 break; 187 break;
117 default: 188 default:
118 break; 189 break;
119 } 190 }
120} 191}
121 192
122static int arch_timer_set_next_event(unsigned long evt, 193static void arch_timer_set_mode_virt(enum clock_event_mode mode,
123 struct clock_event_device *unused) 194 struct clock_event_device *clk)
124{ 195{
125 unsigned long ctrl; 196 timer_set_mode(ARCH_TIMER_VIRT_ACCESS, mode);
197}
126 198
127 ctrl = arch_timer_reg_read(ARCH_TIMER_REG_CTRL); 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);
128 ctrl |= ARCH_TIMER_CTRL_ENABLE; 209 ctrl |= ARCH_TIMER_CTRL_ENABLE;
129 ctrl &= ~ARCH_TIMER_CTRL_IT_MASK; 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}
130 214
131 arch_timer_reg_write(ARCH_TIMER_REG_TVAL, evt); 215static int arch_timer_set_next_event_virt(unsigned long evt,
132 arch_timer_reg_write(ARCH_TIMER_REG_CTRL, ctrl); 216 struct clock_event_device *unused)
217{
218 set_next_event(ARCH_TIMER_VIRT_ACCESS, evt);
219 return 0;
220}
133 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);
134 return 0; 226 return 0;
135} 227}
136 228
137static int __cpuinit arch_timer_setup(struct clock_event_device *clk) 229static int __cpuinit arch_timer_setup(struct clock_event_device *clk)
138{ 230{
139 /* Be safe... */
140 arch_timer_disable();
141
142 clk->features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP; 231 clk->features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP;
143 clk->name = "arch_sys_timer"; 232 clk->name = "arch_sys_timer";
144 clk->rating = 450; 233 clk->rating = 450;
145 clk->set_mode = arch_timer_set_mode; 234 if (arch_timer_use_virtual) {
146 clk->set_next_event = arch_timer_set_next_event; 235 clk->irq = arch_timer_ppi[VIRT_PPI];
147 clk->irq = arch_timer_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);
148 245
149 clockevents_config_and_register(clk, arch_timer_rate, 246 clockevents_config_and_register(clk, arch_timer_rate,
150 0xf, 0x7fffffff); 247 0xf, 0x7fffffff);
151 248
152 *__this_cpu_ptr(arch_timer_evt) = clk; 249 *__this_cpu_ptr(arch_timer_evt) = clk;
153 250
154 enable_percpu_irq(clk->irq, 0); 251 if (arch_timer_use_virtual)
155 if (arch_timer_ppi2) 252 enable_percpu_irq(arch_timer_ppi[VIRT_PPI], 0);
156 enable_percpu_irq(arch_timer_ppi2, 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 }
157 258
158 return 0; 259 return 0;
159} 260}
@@ -173,8 +274,8 @@ static int arch_timer_available(void)
173 return -ENXIO; 274 return -ENXIO;
174 275
175 if (arch_timer_rate == 0) { 276 if (arch_timer_rate == 0) {
176 arch_timer_reg_write(ARCH_TIMER_REG_CTRL, 0); 277 freq = arch_timer_reg_read(ARCH_TIMER_PHYS_ACCESS,
177 freq = arch_timer_reg_read(ARCH_TIMER_REG_FREQ); 278 ARCH_TIMER_REG_FREQ);
178 279
179 /* Check the timer frequency. */ 280 /* Check the timer frequency. */
180 if (freq == 0) { 281 if (freq == 0) {
@@ -185,52 +286,57 @@ static int arch_timer_available(void)
185 arch_timer_rate = freq; 286 arch_timer_rate = freq;
186 } 287 }
187 288
188 pr_info_once("Architected local timer running at %lu.%02luMHz.\n", 289 pr_info_once("Architected local timer running at %lu.%02luMHz (%s).\n",
189 arch_timer_rate / 1000000, (arch_timer_rate / 10000) % 100); 290 arch_timer_rate / 1000000, (arch_timer_rate / 10000) % 100,
291 arch_timer_use_virtual ? "virt" : "phys");
190 return 0; 292 return 0;
191} 293}
192 294
193static inline cycle_t arch_counter_get_cntpct(void) 295static u32 notrace arch_counter_get_cntpct32(void)
194{ 296{
195 u32 cvall, cvalh; 297 cycle_t cnt = arch_counter_get_cntpct();
196
197 asm volatile("mrrc p15, 0, %0, %1, c14" : "=r" (cvall), "=r" (cvalh));
198 298
199 return ((cycle_t) cvalh << 32) | cvall; 299 /*
200} 300 * The sched_clock infrastructure only knows about counters
201 301 * with at most 32bits. Forget about the upper 24 bits for the
202static inline cycle_t arch_counter_get_cntvct(void) 302 * time being...
203{ 303 */
204 u32 cvall, cvalh; 304 return (u32)cnt;
205
206 asm volatile("mrrc p15, 1, %0, %1, c14" : "=r" (cvall), "=r" (cvalh));
207
208 return ((cycle_t) cvalh << 32) | cvall;
209} 305}
210 306
211static u32 notrace arch_counter_get_cntvct32(void) 307static u32 notrace arch_counter_get_cntvct32(void)
212{ 308{
213 cycle_t cntvct = arch_counter_get_cntvct(); 309 cycle_t cnt = arch_counter_get_cntvct();
214 310
215 /* 311 /*
216 * The sched_clock infrastructure only knows about counters 312 * The sched_clock infrastructure only knows about counters
217 * with at most 32bits. Forget about the upper 24 bits for the 313 * with at most 32bits. Forget about the upper 24 bits for the
218 * time being... 314 * time being...
219 */ 315 */
220 return (u32)(cntvct & (u32)~0); 316 return (u32)cnt;
221} 317}
222 318
223static cycle_t arch_counter_read(struct clocksource *cs) 319static cycle_t arch_counter_read(struct clocksource *cs)
224{ 320{
321 /*
322 * Always use the physical counter for the clocksource.
323 * CNTHCTL.PL1PCTEN must be set to 1.
324 */
225 return arch_counter_get_cntpct(); 325 return arch_counter_get_cntpct();
226} 326}
227 327
228int read_current_timer(unsigned long *timer_val) 328static unsigned long arch_timer_read_current_timer(void)
229{ 329{
230 if (!arch_timer_rate) 330 return arch_counter_get_cntpct();
231 return -ENXIO; 331}
232 *timer_val = arch_counter_get_cntpct(); 332
233 return 0; 333static cycle_t arch_counter_read_cc(const struct cyclecounter *cc)
334{
335 /*
336 * Always use the physical counter for the clocksource.
337 * CNTHCTL.PL1PCTEN must be set to 1.
338 */
339 return arch_counter_get_cntpct();
234} 340}
235 341
236static struct clocksource clocksource_counter = { 342static struct clocksource clocksource_counter = {
@@ -241,14 +347,32 @@ static struct clocksource clocksource_counter = {
241 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 347 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
242}; 348};
243 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
244static void __cpuinit arch_timer_stop(struct clock_event_device *clk) 362static void __cpuinit arch_timer_stop(struct clock_event_device *clk)
245{ 363{
246 pr_debug("arch_timer_teardown disable IRQ%d cpu #%d\n", 364 pr_debug("arch_timer_teardown disable IRQ%d cpu #%d\n",
247 clk->irq, smp_processor_id()); 365 clk->irq, smp_processor_id());
248 disable_percpu_irq(clk->irq); 366
249 if (arch_timer_ppi2) 367 if (arch_timer_use_virtual)
250 disable_percpu_irq(arch_timer_ppi2); 368 disable_percpu_irq(arch_timer_ppi[VIRT_PPI]);
251 arch_timer_set_mode(CLOCK_EVT_MODE_UNUSED, clk); 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);
252} 376}
253 377
254static struct local_timer_ops arch_timer_ops __cpuinitdata = { 378static struct local_timer_ops arch_timer_ops __cpuinitdata = {
@@ -261,36 +385,48 @@ static struct clock_event_device arch_timer_global_evt;
261static int __init arch_timer_register(void) 385static int __init arch_timer_register(void)
262{ 386{
263 int err; 387 int err;
388 int ppi;
264 389
265 err = arch_timer_available(); 390 err = arch_timer_available();
266 if (err) 391 if (err)
267 return err; 392 goto out;
268 393
269 arch_timer_evt = alloc_percpu(struct clock_event_device *); 394 arch_timer_evt = alloc_percpu(struct clock_event_device *);
270 if (!arch_timer_evt) 395 if (!arch_timer_evt) {
271 return -ENOMEM; 396 err = -ENOMEM;
397 goto out;
398 }
272 399
273 clocksource_register_hz(&clocksource_counter, arch_timer_rate); 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 }
274 423
275 err = request_percpu_irq(arch_timer_ppi, arch_timer_handler,
276 "arch_timer", arch_timer_evt);
277 if (err) { 424 if (err) {
278 pr_err("arch_timer: can't register interrupt %d (%d)\n", 425 pr_err("arch_timer: can't register interrupt %d (%d)\n",
279 arch_timer_ppi, err); 426 ppi, err);
280 goto out_free; 427 goto out_free;
281 } 428 }
282 429
283 if (arch_timer_ppi2) {
284 err = request_percpu_irq(arch_timer_ppi2, arch_timer_handler,
285 "arch_timer", arch_timer_evt);
286 if (err) {
287 pr_err("arch_timer: can't register interrupt %d (%d)\n",
288 arch_timer_ppi2, err);
289 arch_timer_ppi2 = 0;
290 goto out_free_irq;
291 }
292 }
293
294 err = local_timer_register(&arch_timer_ops); 430 err = local_timer_register(&arch_timer_ops);
295 if (err) { 431 if (err) {
296 /* 432 /*
@@ -302,21 +438,29 @@ static int __init arch_timer_register(void)
302 arch_timer_global_evt.cpumask = cpumask_of(0); 438 arch_timer_global_evt.cpumask = cpumask_of(0);
303 err = arch_timer_setup(&arch_timer_global_evt); 439 err = arch_timer_setup(&arch_timer_global_evt);
304 } 440 }
305
306 if (err) 441 if (err)
307 goto out_free_irq; 442 goto out_free_irq;
308 443
309 init_current_timer_delay(arch_timer_rate); 444 /* Use the architected timer for the delay loop. */
445 arch_delay_timer.read_current_timer = &arch_timer_read_current_timer;
446 arch_delay_timer.freq = arch_timer_rate;
447 register_current_timer_delay(&arch_delay_timer);
310 return 0; 448 return 0;
311 449
312out_free_irq: 450out_free_irq:
313 free_percpu_irq(arch_timer_ppi, arch_timer_evt); 451 if (arch_timer_use_virtual)
314 if (arch_timer_ppi2) 452 free_percpu_irq(arch_timer_ppi[VIRT_PPI], arch_timer_evt);
315 free_percpu_irq(arch_timer_ppi2, 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 }
316 460
317out_free: 461out_free:
318 free_percpu(arch_timer_evt); 462 free_percpu(arch_timer_evt);
319 463out:
320 return err; 464 return err;
321} 465}
322 466
@@ -329,6 +473,7 @@ int __init arch_timer_of_register(void)
329{ 473{
330 struct device_node *np; 474 struct device_node *np;
331 u32 freq; 475 u32 freq;
476 int i;
332 477
333 np = of_find_matching_node(NULL, arch_timer_of_match); 478 np = of_find_matching_node(NULL, arch_timer_of_match);
334 if (!np) { 479 if (!np) {
@@ -340,22 +485,40 @@ int __init arch_timer_of_register(void)
340 if (!of_property_read_u32(np, "clock-frequency", &freq)) 485 if (!of_property_read_u32(np, "clock-frequency", &freq))
341 arch_timer_rate = freq; 486 arch_timer_rate = freq;
342 487
343 arch_timer_ppi = irq_of_parse_and_map(np, 0); 488 for (i = PHYS_SECURE_PPI; i < MAX_TIMER_PPI; i++)
344 arch_timer_ppi2 = irq_of_parse_and_map(np, 1); 489 arch_timer_ppi[i] = irq_of_parse_and_map(np, i);
345 pr_info("arch_timer: found %s irqs %d %d\n", 490
346 np->name, arch_timer_ppi, arch_timer_ppi2); 491 /*
492 * If no interrupt provided for virtual timer, we'll have to
493 * stick to the physical timer. It'd better be accessible...
494 */
495 if (!arch_timer_ppi[VIRT_PPI]) {
496 arch_timer_use_virtual = false;
497
498 if (!arch_timer_ppi[PHYS_SECURE_PPI] ||
499 !arch_timer_ppi[PHYS_NONSECURE_PPI]) {
500 pr_warn("arch_timer: No interrupt available, giving up\n");
501 return -EINVAL;
502 }
503 }
347 504
348 return arch_timer_register(); 505 return arch_timer_register();
349} 506}
350 507
351int __init arch_timer_sched_clock_init(void) 508int __init arch_timer_sched_clock_init(void)
352{ 509{
510 u32 (*cnt32)(void);
353 int err; 511 int err;
354 512
355 err = arch_timer_available(); 513 err = arch_timer_available();
356 if (err) 514 if (err)
357 return err; 515 return err;
358 516
359 setup_sched_clock(arch_counter_get_cntvct32, 32, arch_timer_rate); 517 if (arch_timer_use_virtual)
518 cnt32 = arch_counter_get_cntvct32;
519 else
520 cnt32 = arch_counter_get_cntpct32;
521
522 setup_sched_clock(cnt32, 32, arch_timer_rate);
360 return 0; 523 return 0;
361} 524}
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 1429d8989fb..c985b481192 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -59,10 +59,12 @@ int main(void)
59 DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp)); 59 DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp));
60 DEFINE(TI_TP_VALUE, offsetof(struct thread_info, tp_value)); 60 DEFINE(TI_TP_VALUE, offsetof(struct thread_info, tp_value));
61 DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate)); 61 DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate));
62#ifdef CONFIG_VFP
62 DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate)); 63 DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate));
63#ifdef CONFIG_SMP 64#ifdef CONFIG_SMP
64 DEFINE(VFP_CPU, offsetof(union vfp_state, hard.cpu)); 65 DEFINE(VFP_CPU, offsetof(union vfp_state, hard.cpu));
65#endif 66#endif
67#endif
66#ifdef CONFIG_ARM_THUMBEE 68#ifdef CONFIG_ARM_THUMBEE
67 DEFINE(TI_THUMBEE_STATE, offsetof(struct thread_info, thumbee_state)); 69 DEFINE(TI_THUMBEE_STATE, offsetof(struct thread_info, thumbee_state));
68#endif 70#endif
diff --git a/arch/arm/kernel/atags.h b/arch/arm/kernel/atags.h
index e5f028d214a..9edc9692332 100644
--- a/arch/arm/kernel/atags.h
+++ b/arch/arm/kernel/atags.h
@@ -3,3 +3,17 @@ extern void save_atags(struct tag *tags);
3#else 3#else
4static inline void save_atags(struct tag *tags) { } 4static inline void save_atags(struct tag *tags) { }
5#endif 5#endif
6
7void convert_to_tag_list(struct tag *tags);
8
9#ifdef CONFIG_ATAGS
10struct machine_desc *setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr);
11#else
12static inline struct machine_desc *
13setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
14{
15 early_print("no ATAGS support: can't continue\n");
16 while (true);
17 unreachable();
18}
19#endif
diff --git a/arch/arm/kernel/compat.c b/arch/arm/kernel/atags_compat.c
index 925652318b8..5236ad38f41 100644
--- a/arch/arm/kernel/compat.c
+++ b/arch/arm/kernel/atags_compat.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/kernel/compat.c 2 * linux/arch/arm/kernel/atags_compat.c
3 * 3 *
4 * Copyright (C) 2001 Russell King 4 * Copyright (C) 2001 Russell King
5 * 5 *
@@ -26,7 +26,7 @@
26 26
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28 28
29#include "compat.h" 29#include "atags.h"
30 30
31/* 31/*
32 * Usage: 32 * Usage:
diff --git a/arch/arm/kernel/atags_parse.c b/arch/arm/kernel/atags_parse.c
new file mode 100644
index 00000000000..14512e6931d
--- /dev/null
+++ b/arch/arm/kernel/atags_parse.c
@@ -0,0 +1,238 @@
1/*
2 * Tag parsing.
3 *
4 * Copyright (C) 1995-2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/*
12 * This is the traditional way of passing data to the kernel at boot time. Rather
13 * than passing a fixed inflexible structure to the kernel, we pass a list
14 * of variable-sized tags to the kernel. The first tag must be a ATAG_CORE
15 * tag for the list to be recognised (to distinguish the tagged list from
16 * a param_struct). The list is terminated with a zero-length tag (this tag
17 * is not parsed in any way).
18 */
19
20#include <linux/init.h>
21#include <linux/kernel.h>
22#include <linux/fs.h>
23#include <linux/root_dev.h>
24#include <linux/screen_info.h>
25
26#include <asm/setup.h>
27#include <asm/system_info.h>
28#include <asm/page.h>
29#include <asm/mach/arch.h>
30
31#include "atags.h"
32
33static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
34
35#ifndef MEM_SIZE
36#define MEM_SIZE (16*1024*1024)
37#endif
38
39static struct {
40 struct tag_header hdr1;
41 struct tag_core core;
42 struct tag_header hdr2;
43 struct tag_mem32 mem;
44 struct tag_header hdr3;
45} default_tags __initdata = {
46 { tag_size(tag_core), ATAG_CORE },
47 { 1, PAGE_SIZE, 0xff },
48 { tag_size(tag_mem32), ATAG_MEM },
49 { MEM_SIZE },
50 { 0, ATAG_NONE }
51};
52
53static int __init parse_tag_core(const struct tag *tag)
54{
55 if (tag->hdr.size > 2) {
56 if ((tag->u.core.flags & 1) == 0)
57 root_mountflags &= ~MS_RDONLY;
58 ROOT_DEV = old_decode_dev(tag->u.core.rootdev);
59 }
60 return 0;
61}
62
63__tagtable(ATAG_CORE, parse_tag_core);
64
65static int __init parse_tag_mem32(const struct tag *tag)
66{
67 return arm_add_memory(tag->u.mem.start, tag->u.mem.size);
68}
69
70__tagtable(ATAG_MEM, parse_tag_mem32);
71
72#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
73static int __init parse_tag_videotext(const struct tag *tag)
74{
75 screen_info.orig_x = tag->u.videotext.x;
76 screen_info.orig_y = tag->u.videotext.y;
77 screen_info.orig_video_page = tag->u.videotext.video_page;
78 screen_info.orig_video_mode = tag->u.videotext.video_mode;
79 screen_info.orig_video_cols = tag->u.videotext.video_cols;
80 screen_info.orig_video_ega_bx = tag->u.videotext.video_ega_bx;
81 screen_info.orig_video_lines = tag->u.videotext.video_lines;
82 screen_info.orig_video_isVGA = tag->u.videotext.video_isvga;
83 screen_info.orig_video_points = tag->u.videotext.video_points;
84 return 0;
85}
86
87__tagtable(ATAG_VIDEOTEXT, parse_tag_videotext);
88#endif
89
90#ifdef CONFIG_BLK_DEV_RAM
91static int __init parse_tag_ramdisk(const struct tag *tag)
92{
93 extern int rd_size, rd_image_start, rd_prompt, rd_doload;
94
95 rd_image_start = tag->u.ramdisk.start;
96 rd_doload = (tag->u.ramdisk.flags & 1) == 0;
97 rd_prompt = (tag->u.ramdisk.flags & 2) == 0;
98
99 if (tag->u.ramdisk.size)
100 rd_size = tag->u.ramdisk.size;
101
102 return 0;
103}
104
105__tagtable(ATAG_RAMDISK, parse_tag_ramdisk);
106#endif
107
108static int __init parse_tag_serialnr(const struct tag *tag)
109{
110 system_serial_low = tag->u.serialnr.low;
111 system_serial_high = tag->u.serialnr.high;
112 return 0;
113}
114
115__tagtable(ATAG_SERIAL, parse_tag_serialnr);
116
117static int __init parse_tag_revision(const struct tag *tag)
118{
119 system_rev = tag->u.revision.rev;
120 return 0;
121}
122
123__tagtable(ATAG_REVISION, parse_tag_revision);
124
125static int __init parse_tag_cmdline(const struct tag *tag)
126{
127#if defined(CONFIG_CMDLINE_EXTEND)
128 strlcat(default_command_line, " ", COMMAND_LINE_SIZE);
129 strlcat(default_command_line, tag->u.cmdline.cmdline,
130 COMMAND_LINE_SIZE);
131#elif defined(CONFIG_CMDLINE_FORCE)
132 pr_warning("Ignoring tag cmdline (using the default kernel command line)\n");
133#else
134 strlcpy(default_command_line, tag->u.cmdline.cmdline,
135 COMMAND_LINE_SIZE);
136#endif
137 return 0;
138}
139
140__tagtable(ATAG_CMDLINE, parse_tag_cmdline);
141
142/*
143 * Scan the tag table for this tag, and call its parse function.
144 * The tag table is built by the linker from all the __tagtable
145 * declarations.
146 */
147static int __init parse_tag(const struct tag *tag)
148{
149 extern struct tagtable __tagtable_begin, __tagtable_end;
150 struct tagtable *t;
151
152 for (t = &__tagtable_begin; t < &__tagtable_end; t++)
153 if (tag->hdr.tag == t->tag) {
154 t->parse(tag);
155 break;
156 }
157
158 return t < &__tagtable_end;
159}
160
161/*
162 * Parse all tags in the list, checking both the global and architecture
163 * specific tag tables.
164 */
165static void __init parse_tags(const struct tag *t)
166{
167 for (; t->hdr.size; t = tag_next(t))
168 if (!parse_tag(t))
169 printk(KERN_WARNING
170 "Ignoring unrecognised tag 0x%08x\n",
171 t->hdr.tag);
172}
173
174static void __init squash_mem_tags(struct tag *tag)
175{
176 for (; tag->hdr.size; tag = tag_next(tag))
177 if (tag->hdr.tag == ATAG_MEM)
178 tag->hdr.tag = ATAG_NONE;
179}
180
181struct machine_desc * __init setup_machine_tags(phys_addr_t __atags_pointer,
182 unsigned int machine_nr)
183{
184 struct tag *tags = (struct tag *)&default_tags;
185 struct machine_desc *mdesc = NULL, *p;
186 char *from = default_command_line;
187
188 default_tags.mem.start = PHYS_OFFSET;
189
190 /*
191 * locate machine in the list of supported machines.
192 */
193 for_each_machine_desc(p)
194 if (machine_nr == p->nr) {
195 printk("Machine: %s\n", p->name);
196 mdesc = p;
197 break;
198 }
199
200 if (!mdesc) {
201 early_print("\nError: unrecognized/unsupported machine ID"
202 " (r1 = 0x%08x).\n\n", machine_nr);
203 dump_machine_table(); /* does not return */
204 }
205
206 if (__atags_pointer)
207 tags = phys_to_virt(__atags_pointer);
208 else if (mdesc->atag_offset)
209 tags = (void *)(PAGE_OFFSET + mdesc->atag_offset);
210
211#if defined(CONFIG_DEPRECATED_PARAM_STRUCT)
212 /*
213 * If we have the old style parameters, convert them to
214 * a tag list.
215 */
216 if (tags->hdr.tag != ATAG_CORE)
217 convert_to_tag_list(tags);
218#endif
219 if (tags->hdr.tag != ATAG_CORE) {
220 early_print("Warning: Neither atags nor dtb found\n");
221 tags = (struct tag *)&default_tags;
222 }
223
224 if (mdesc->fixup)
225 mdesc->fixup(tags, &from, &meminfo);
226
227 if (tags->hdr.tag == ATAG_CORE) {
228 if (meminfo.nr_banks != 0)
229 squash_mem_tags(tags);
230 save_atags(tags);
231 parse_tags(tags);
232 }
233
234 /* parse_early_param needs a boot_command_line */
235 strlcpy(boot_command_line, from, COMMAND_LINE_SIZE);
236
237 return mdesc;
238}
diff --git a/arch/arm/kernel/atags.c b/arch/arm/kernel/atags_proc.c
index 42a1a1415fa..42a1a1415fa 100644
--- a/arch/arm/kernel/atags.c
+++ b/arch/arm/kernel/atags_proc.c
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 2b2f25e7fef..9b722612553 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -13,6 +13,7 @@
13#include <linux/io.h> 13#include <linux/io.h>
14 14
15#include <asm/mach-types.h> 15#include <asm/mach-types.h>
16#include <asm/mach/map.h>
16#include <asm/mach/pci.h> 17#include <asm/mach/pci.h>
17 18
18static int debug_pci; 19static int debug_pci;
@@ -270,15 +271,6 @@ static void __devinit pci_fixup_it8152(struct pci_dev *dev)
270} 271}
271DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8152, pci_fixup_it8152); 272DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8152, pci_fixup_it8152);
272 273
273
274
275void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
276{
277 if (debug_pci)
278 printk("PCI: Assigning IRQ %02d to %s\n", irq, pci_name(dev));
279 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
280}
281
282/* 274/*
283 * If the bus contains any of these devices, then we must not turn on 275 * If the bus contains any of these devices, then we must not turn on
284 * parity checking of any kind. Currently this is CyberPro 20x0 only. 276 * parity checking of any kind. Currently this is CyberPro 20x0 only.
@@ -423,6 +415,38 @@ static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
423 return irq; 415 return irq;
424} 416}
425 417
418static int __init pcibios_init_resources(int busnr, struct pci_sys_data *sys)
419{
420 int ret;
421 struct pci_host_bridge_window *window;
422
423 if (list_empty(&sys->resources)) {
424 pci_add_resource_offset(&sys->resources,
425 &iomem_resource, sys->mem_offset);
426 }
427
428 list_for_each_entry(window, &sys->resources, list) {
429 if (resource_type(window->res) == IORESOURCE_IO)
430 return 0;
431 }
432
433 sys->io_res.start = (busnr * SZ_64K) ? : pcibios_min_io;
434 sys->io_res.end = (busnr + 1) * SZ_64K - 1;
435 sys->io_res.flags = IORESOURCE_IO;
436 sys->io_res.name = sys->io_res_name;
437 sprintf(sys->io_res_name, "PCI%d I/O", busnr);
438
439 ret = request_resource(&ioport_resource, &sys->io_res);
440 if (ret) {
441 pr_err("PCI: unable to allocate I/O port region (%d)\n", ret);
442 return ret;
443 }
444 pci_add_resource_offset(&sys->resources, &sys->io_res,
445 sys->io_offset);
446
447 return 0;
448}
449
426static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head) 450static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
427{ 451{
428 struct pci_sys_data *sys = NULL; 452 struct pci_sys_data *sys = NULL;
@@ -445,11 +469,10 @@ static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
445 ret = hw->setup(nr, sys); 469 ret = hw->setup(nr, sys);
446 470
447 if (ret > 0) { 471 if (ret > 0) {
448 if (list_empty(&sys->resources)) { 472 ret = pcibios_init_resources(nr, sys);
449 pci_add_resource_offset(&sys->resources, 473 if (ret) {
450 &ioport_resource, sys->io_offset); 474 kfree(sys);
451 pci_add_resource_offset(&sys->resources, 475 break;
452 &iomem_resource, sys->mem_offset);
453 } 476 }
454 477
455 if (hw->scan) 478 if (hw->scan)
@@ -627,3 +650,15 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
627 650
628 return 0; 651 return 0;
629} 652}
653
654void __init pci_map_io_early(unsigned long pfn)
655{
656 struct map_desc pci_io_desc = {
657 .virtual = PCI_IO_VIRT_BASE,
658 .type = MT_DEVICE,
659 .length = SZ_64K,
660 };
661
662 pci_io_desc.pfn = pfn;
663 iotable_init(&pci_io_desc, 1);
664}
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index 463ff4a0ec8..831cd38c8d9 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -20,7 +20,7 @@
20 CALL(sys_creat) 20 CALL(sys_creat)
21 CALL(sys_link) 21 CALL(sys_link)
22/* 10 */ CALL(sys_unlink) 22/* 10 */ CALL(sys_unlink)
23 CALL(sys_execve_wrapper) 23 CALL(sys_execve)
24 CALL(sys_chdir) 24 CALL(sys_chdir)
25 CALL(OBSOLETE(sys_time)) /* used by libc4 */ 25 CALL(OBSOLETE(sys_time)) /* used by libc4 */
26 CALL(sys_mknod) 26 CALL(sys_mknod)
@@ -387,6 +387,7 @@
387/* 375 */ CALL(sys_setns) 387/* 375 */ CALL(sys_setns)
388 CALL(sys_process_vm_readv) 388 CALL(sys_process_vm_readv)
389 CALL(sys_process_vm_writev) 389 CALL(sys_process_vm_writev)
390 CALL(sys_ni_syscall) /* reserved for sys_kcmp */
390#ifndef syscalls_counted 391#ifndef syscalls_counted
391.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls 392.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
392#define syscalls_counted 393#define syscalls_counted
diff --git a/arch/arm/kernel/compat.h b/arch/arm/kernel/compat.h
deleted file mode 100644
index 39264ab1b9c..00000000000
--- a/arch/arm/kernel/compat.h
+++ /dev/null
@@ -1,11 +0,0 @@
1/*
2 * linux/arch/arm/kernel/compat.h
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11extern void convert_to_tag_list(struct tag *tags);
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index c45522c3678..66f711b2e0e 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -20,90 +20,9 @@
20 * references to these in a production kernel! 20 * references to these in a production kernel!
21 */ 21 */
22 22
23#if defined(CONFIG_DEBUG_ICEDCC) 23#if !defined(CONFIG_DEBUG_SEMIHOSTING)
24 @@ debug using ARM EmbeddedICE DCC channel 24#include CONFIG_DEBUG_LL_INCLUDE
25 25#endif
26 .macro addruart, rp, rv, tmp
27 .endm
28
29#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
30
31 .macro senduart, rd, rx
32 mcr p14, 0, \rd, c0, c5, 0
33 .endm
34
35 .macro busyuart, rd, rx
361001:
37 mrc p14, 0, \rx, c0, c1, 0
38 tst \rx, #0x20000000
39 beq 1001b
40 .endm
41
42 .macro waituart, rd, rx
43 mov \rd, #0x2000000
441001:
45 subs \rd, \rd, #1
46 bmi 1002f
47 mrc p14, 0, \rx, c0, c1, 0
48 tst \rx, #0x20000000
49 bne 1001b
501002:
51 .endm
52
53#elif defined(CONFIG_CPU_XSCALE)
54
55 .macro senduart, rd, rx
56 mcr p14, 0, \rd, c8, c0, 0
57 .endm
58
59 .macro busyuart, rd, rx
601001:
61 mrc p14, 0, \rx, c14, c0, 0
62 tst \rx, #0x10000000
63 beq 1001b
64 .endm
65
66 .macro waituart, rd, rx
67 mov \rd, #0x10000000
681001:
69 subs \rd, \rd, #1
70 bmi 1002f
71 mrc p14, 0, \rx, c14, c0, 0
72 tst \rx, #0x10000000
73 bne 1001b
741002:
75 .endm
76
77#else
78
79 .macro senduart, rd, rx
80 mcr p14, 0, \rd, c1, c0, 0
81 .endm
82
83 .macro busyuart, rd, rx
841001:
85 mrc p14, 0, \rx, c0, c0, 0
86 tst \rx, #2
87 beq 1001b
88
89 .endm
90
91 .macro waituart, rd, rx
92 mov \rd, #0x2000000
931001:
94 subs \rd, \rd, #1
95 bmi 1002f
96 mrc p14, 0, \rx, c0, c0, 0
97 tst \rx, #2
98 bne 1001b
991002:
100 .endm
101
102#endif /* CONFIG_CPU_V6 */
103
104#elif !defined(CONFIG_DEBUG_SEMIHOSTING)
105#include <mach/debug-macro.S>
106#endif /* CONFIG_DEBUG_ICEDCC */
107 26
108#ifdef CONFIG_MMU 27#ifdef CONFIG_MMU
109 .macro addruart_current, rx, tmp1, tmp2 28 .macro addruart_current, rx, tmp1, tmp2
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 978eac57e04..417bac1846b 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -86,14 +86,26 @@ ENDPROC(ret_to_user)
86 */ 86 */
87ENTRY(ret_from_fork) 87ENTRY(ret_from_fork)
88 bl schedule_tail 88 bl schedule_tail
89 cmp r5, #0
90 movne r0, r4
91 movne lr, pc
92 movne pc, r5
89 get_thread_info tsk 93 get_thread_info tsk
90 mov why, #1
91 b ret_slow_syscall 94 b ret_slow_syscall
92ENDPROC(ret_from_fork) 95ENDPROC(ret_from_fork)
93 96
94 .equ NR_syscalls,0 97 .equ NR_syscalls,0
95#define CALL(x) .equ NR_syscalls,NR_syscalls+1 98#define CALL(x) .equ NR_syscalls,NR_syscalls+1
96#include "calls.S" 99#include "calls.S"
100
101/*
102 * Ensure that the system call table is equal to __NR_syscalls,
103 * which is the value the rest of the system sees
104 */
105.ifne NR_syscalls - __NR_syscalls
106.error "__NR_syscalls is not equal to the size of the syscall table"
107.endif
108
97#undef CALL 109#undef CALL
98#define CALL(x) .long x 110#define CALL(x) .long x
99 111
@@ -508,11 +520,6 @@ sys_vfork_wrapper:
508 b sys_vfork 520 b sys_vfork
509ENDPROC(sys_vfork_wrapper) 521ENDPROC(sys_vfork_wrapper)
510 522
511sys_execve_wrapper:
512 add r3, sp, #S_OFF
513 b sys_execve
514ENDPROC(sys_execve_wrapper)
515
516sys_clone_wrapper: 523sys_clone_wrapper:
517 add ip, sp, #S_OFF 524 add ip, sp, #S_OFF
518 str ip, [sp, #4] 525 str ip, [sp, #4]
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 3db960e20cb..4eee351f466 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -23,8 +23,8 @@
23#include <asm/thread_info.h> 23#include <asm/thread_info.h>
24#include <asm/pgtable.h> 24#include <asm/pgtable.h>
25 25
26#ifdef CONFIG_DEBUG_LL 26#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING)
27#include <mach/debug-macro.S> 27#include CONFIG_DEBUG_LL_INCLUDE
28#endif 28#endif
29 29
30/* 30/*
@@ -83,8 +83,12 @@ ENTRY(stext)
83 THUMB( .thumb ) @ switch to Thumb now. 83 THUMB( .thumb ) @ switch to Thumb now.
84 THUMB(1: ) 84 THUMB(1: )
85 85
86 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode 86#ifdef CONFIG_ARM_VIRT_EXT
87 @ and irqs disabled 87 bl __hyp_stub_install
88#endif
89 @ ensure svc mode and all interrupts masked
90 safe_svcmode_maskall r9
91
88 mrc p15, 0, r9, c0, c0 @ get processor id 92 mrc p15, 0, r9, c0, c0 @ get processor id
89 bl __lookup_processor_type @ r5=procinfo r9=cpuid 93 bl __lookup_processor_type @ r5=procinfo r9=cpuid
90 movs r10, r5 @ invalid processor (r5=0)? 94 movs r10, r5 @ invalid processor (r5=0)?
@@ -326,7 +330,11 @@ ENTRY(secondary_startup)
326 * the processor type - there is no need to check the machine type 330 * the processor type - there is no need to check the machine type
327 * as it has already been validated by the primary processor. 331 * as it has already been validated by the primary processor.
328 */ 332 */
329 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 333#ifdef CONFIG_ARM_VIRT_EXT
334 bl __hyp_stub_install
335#endif
336 safe_svcmode_maskall r9
337
330 mrc p15, 0, r9, c0, c0 @ get processor id 338 mrc p15, 0, r9, c0, c0 @ get processor id
331 bl __lookup_processor_type 339 bl __lookup_processor_type
332 movs r10, r5 @ invalid processor? 340 movs r10, r5 @ invalid processor?
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index ba386bd9410..281bf330124 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -159,6 +159,12 @@ static int debug_arch_supported(void)
159 arch >= ARM_DEBUG_ARCH_V7_1; 159 arch >= ARM_DEBUG_ARCH_V7_1;
160} 160}
161 161
162/* Can we determine the watchpoint access type from the fsr? */
163static int debug_exception_updates_fsr(void)
164{
165 return 0;
166}
167
162/* Determine number of WRP registers available. */ 168/* Determine number of WRP registers available. */
163static int get_num_wrp_resources(void) 169static int get_num_wrp_resources(void)
164{ 170{
@@ -604,13 +610,14 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
604 /* Aligned */ 610 /* Aligned */
605 break; 611 break;
606 case 1: 612 case 1:
607 /* Allow single byte watchpoint. */
608 if (info->ctrl.len == ARM_BREAKPOINT_LEN_1)
609 break;
610 case 2: 613 case 2:
611 /* Allow halfword watchpoints and breakpoints. */ 614 /* Allow halfword watchpoints and breakpoints. */
612 if (info->ctrl.len == ARM_BREAKPOINT_LEN_2) 615 if (info->ctrl.len == ARM_BREAKPOINT_LEN_2)
613 break; 616 break;
617 case 3:
618 /* Allow single byte watchpoint. */
619 if (info->ctrl.len == ARM_BREAKPOINT_LEN_1)
620 break;
614 default: 621 default:
615 ret = -EINVAL; 622 ret = -EINVAL;
616 goto out; 623 goto out;
@@ -619,18 +626,35 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
619 info->address &= ~alignment_mask; 626 info->address &= ~alignment_mask;
620 info->ctrl.len <<= offset; 627 info->ctrl.len <<= offset;
621 628
622 /* 629 if (!bp->overflow_handler) {
623 * Currently we rely on an overflow handler to take 630 /*
624 * care of single-stepping the breakpoint when it fires. 631 * Mismatch breakpoints are required for single-stepping
625 * In the case of userspace breakpoints on a core with V7 debug, 632 * breakpoints.
626 * we can use the mismatch feature as a poor-man's hardware 633 */
627 * single-step, but this only works for per-task breakpoints. 634 if (!core_has_mismatch_brps())
628 */ 635 return -EINVAL;
629 if (!bp->overflow_handler && (arch_check_bp_in_kernelspace(bp) || 636
630 !core_has_mismatch_brps() || !bp->hw.bp_target)) { 637 /* We don't allow mismatch breakpoints in kernel space. */
631 pr_warning("overflow handler required but none found\n"); 638 if (arch_check_bp_in_kernelspace(bp))
632 ret = -EINVAL; 639 return -EPERM;
640
641 /*
642 * Per-cpu breakpoints are not supported by our stepping
643 * mechanism.
644 */
645 if (!bp->hw.bp_target)
646 return -EINVAL;
647
648 /*
649 * We only support specific access types if the fsr
650 * reports them.
651 */
652 if (!debug_exception_updates_fsr() &&
653 (info->ctrl.type == ARM_BREAKPOINT_LOAD ||
654 info->ctrl.type == ARM_BREAKPOINT_STORE))
655 return -EINVAL;
633 } 656 }
657
634out: 658out:
635 return ret; 659 return ret;
636} 660}
@@ -706,10 +730,12 @@ static void watchpoint_handler(unsigned long addr, unsigned int fsr,
706 goto unlock; 730 goto unlock;
707 731
708 /* Check that the access type matches. */ 732 /* Check that the access type matches. */
709 access = (fsr & ARM_FSR_ACCESS_MASK) ? HW_BREAKPOINT_W : 733 if (debug_exception_updates_fsr()) {
710 HW_BREAKPOINT_R; 734 access = (fsr & ARM_FSR_ACCESS_MASK) ?
711 if (!(access & hw_breakpoint_type(wp))) 735 HW_BREAKPOINT_W : HW_BREAKPOINT_R;
712 goto unlock; 736 if (!(access & hw_breakpoint_type(wp)))
737 goto unlock;
738 }
713 739
714 /* We have a winner. */ 740 /* We have a winner. */
715 info->trigger = addr; 741 info->trigger = addr;
diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S
new file mode 100644
index 00000000000..65b2417aebc
--- /dev/null
+++ b/arch/arm/kernel/hyp-stub.S
@@ -0,0 +1,223 @@
1/*
2 * Copyright (c) 2012 Linaro Limited.
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#include <linux/init.h>
20#include <linux/linkage.h>
21#include <asm/assembler.h>
22#include <asm/virt.h>
23
24#ifndef ZIMAGE
25/*
26 * For the kernel proper, we need to find out the CPU boot mode long after
27 * boot, so we need to store it in a writable variable.
28 *
29 * This is not in .bss, because we set it sufficiently early that the boot-time
30 * zeroing of .bss would clobber it.
31 */
32.data
33ENTRY(__boot_cpu_mode)
34 .long 0
35.text
36
37 /*
38 * Save the primary CPU boot mode. Requires 3 scratch registers.
39 */
40 .macro store_primary_cpu_mode reg1, reg2, reg3
41 mrs \reg1, cpsr
42 and \reg1, \reg1, #MODE_MASK
43 adr \reg2, .L__boot_cpu_mode_offset
44 ldr \reg3, [\reg2]
45 str \reg1, [\reg2, \reg3]
46 .endm
47
48 /*
49 * Compare the current mode with the one saved on the primary CPU.
50 * If they don't match, record that fact. The Z bit indicates
51 * if there's a match or not.
52 * Requires 3 additionnal scratch registers.
53 */
54 .macro compare_cpu_mode_with_primary mode, reg1, reg2, reg3
55 adr \reg2, .L__boot_cpu_mode_offset
56 ldr \reg3, [\reg2]
57 ldr \reg1, [\reg2, \reg3]
58 cmp \mode, \reg1 @ matches primary CPU boot mode?
59 orrne r7, r7, #BOOT_CPU_MODE_MISMATCH
60 strne r7, [r5, r6] @ record what happened and give up
61 .endm
62
63#else /* ZIMAGE */
64
65 .macro store_primary_cpu_mode reg1:req, reg2:req, reg3:req
66 .endm
67
68/*
69 * The zImage loader only runs on one CPU, so we don't bother with mult-CPU
70 * consistency checking:
71 */
72 .macro compare_cpu_mode_with_primary mode, reg1, reg2, reg3
73 cmp \mode, \mode
74 .endm
75
76#endif /* ZIMAGE */
77
78/*
79 * Hypervisor stub installation functions.
80 *
81 * These must be called with the MMU and D-cache off.
82 * They are not ABI compliant and are only intended to be called from the kernel
83 * entry points in head.S.
84 */
85@ Call this from the primary CPU
86ENTRY(__hyp_stub_install)
87 store_primary_cpu_mode r4, r5, r6
88ENDPROC(__hyp_stub_install)
89
90 @ fall through...
91
92@ Secondary CPUs should call here
93ENTRY(__hyp_stub_install_secondary)
94 mrs r4, cpsr
95 and r4, r4, #MODE_MASK
96
97 /*
98 * If the secondary has booted with a different mode, give up
99 * immediately.
100 */
101 compare_cpu_mode_with_primary r4, r5, r6, r7
102 bxne lr
103
104 /*
105 * Once we have given up on one CPU, we do not try to install the
106 * stub hypervisor on the remaining ones: because the saved boot mode
107 * is modified, it can't compare equal to the CPSR mode field any
108 * more.
109 *
110 * Otherwise...
111 */
112
113 cmp r4, #HYP_MODE
114 bxne lr @ give up if the CPU is not in HYP mode
115
116/*
117 * Configure HSCTLR to set correct exception endianness/instruction set
118 * state etc.
119 * Turn off all traps
120 * Eventually, CPU-specific code might be needed -- assume not for now
121 *
122 * This code relies on the "eret" instruction to synchronize the
123 * various coprocessor accesses.
124 */
125 @ Now install the hypervisor stub:
126 adr r7, __hyp_stub_vectors
127 mcr p15, 4, r7, c12, c0, 0 @ set hypervisor vector base (HVBAR)
128
129 @ Disable all traps, so we don't get any nasty surprise
130 mov r7, #0
131 mcr p15, 4, r7, c1, c1, 0 @ HCR
132 mcr p15, 4, r7, c1, c1, 2 @ HCPTR
133 mcr p15, 4, r7, c1, c1, 3 @ HSTR
134
135THUMB( orr r7, #(1 << 30) ) @ HSCTLR.TE
136#ifdef CONFIG_CPU_BIG_ENDIAN
137 orr r7, #(1 << 9) @ HSCTLR.EE
138#endif
139 mcr p15, 4, r7, c1, c0, 0 @ HSCTLR
140
141 mrc p15, 4, r7, c1, c1, 1 @ HDCR
142 and r7, #0x1f @ Preserve HPMN
143 mcr p15, 4, r7, c1, c1, 1 @ HDCR
144
145#if !defined(ZIMAGE) && defined(CONFIG_ARM_ARCH_TIMER)
146 @ make CNTP_* and CNTPCT accessible from PL1
147 mrc p15, 0, r7, c0, c1, 1 @ ID_PFR1
148 lsr r7, #16
149 and r7, #0xf
150 cmp r7, #1
151 bne 1f
152 mrc p15, 4, r7, c14, c1, 0 @ CNTHCTL
153 orr r7, r7, #3 @ PL1PCEN | PL1PCTEN
154 mcr p15, 4, r7, c14, c1, 0 @ CNTHCTL
1551:
156#endif
157
158 bic r7, r4, #MODE_MASK
159 orr r7, r7, #SVC_MODE
160THUMB( orr r7, r7, #PSR_T_BIT )
161 msr spsr_cxsf, r7 @ This is SPSR_hyp.
162
163 __MSR_ELR_HYP(14) @ msr elr_hyp, lr
164 __ERET @ return, switching to SVC mode
165 @ The boot CPU mode is left in r4.
166ENDPROC(__hyp_stub_install_secondary)
167
168__hyp_stub_do_trap:
169 cmp r0, #-1
170 mrceq p15, 4, r0, c12, c0, 0 @ get HVBAR
171 mcrne p15, 4, r0, c12, c0, 0 @ set HVBAR
172 __ERET
173ENDPROC(__hyp_stub_do_trap)
174
175/*
176 * __hyp_set_vectors: Call this after boot to set the initial hypervisor
177 * vectors as part of hypervisor installation. On an SMP system, this should
178 * be called on each CPU.
179 *
180 * r0 must be the physical address of the new vector table (which must lie in
181 * the bottom 4GB of physical address space.
182 *
183 * r0 must be 32-byte aligned.
184 *
185 * Before calling this, you must check that the stub hypervisor is installed
186 * everywhere, by waiting for any secondary CPUs to be brought up and then
187 * checking that BOOT_CPU_MODE_HAVE_HYP(__boot_cpu_mode) is true.
188 *
189 * If not, there is a pre-existing hypervisor, some CPUs failed to boot, or
190 * something else went wrong... in such cases, trying to install a new
191 * hypervisor is unlikely to work as desired.
192 *
193 * When you call into your shiny new hypervisor, sp_hyp will contain junk,
194 * so you will need to set that to something sensible at the new hypervisor's
195 * initialisation entry point.
196 */
197ENTRY(__hyp_get_vectors)
198 mov r0, #-1
199ENDPROC(__hyp_get_vectors)
200 @ fall through
201ENTRY(__hyp_set_vectors)
202 __HVC(0)
203 bx lr
204ENDPROC(__hyp_set_vectors)
205
206#ifndef ZIMAGE
207.align 2
208.L__boot_cpu_mode_offset:
209 .long __boot_cpu_mode - .
210#endif
211
212.align 5
213__hyp_stub_vectors:
214__hyp_stub_reset: W(b) .
215__hyp_stub_und: W(b) .
216__hyp_stub_svc: W(b) .
217__hyp_stub_pabort: W(b) .
218__hyp_stub_dabort: W(b) .
219__hyp_stub_trap: W(b) __hyp_stub_do_trap
220__hyp_stub_irq: W(b) .
221__hyp_stub_fiq: W(b) .
222ENDPROC(__hyp_stub_vectors)
223
diff --git a/arch/arm/kernel/leds.c b/arch/arm/kernel/leds.c
deleted file mode 100644
index 1911dae19e4..00000000000
--- a/arch/arm/kernel/leds.c
+++ /dev/null
@@ -1,121 +0,0 @@
1/*
2 * LED support code, ripped out of arch/arm/kernel/time.c
3 *
4 * Copyright (C) 1994-2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/export.h>
11#include <linux/init.h>
12#include <linux/device.h>
13#include <linux/syscore_ops.h>
14#include <linux/string.h>
15
16#include <asm/leds.h>
17
18static void dummy_leds_event(led_event_t evt)
19{
20}
21
22void (*leds_event)(led_event_t) = dummy_leds_event;
23
24struct leds_evt_name {
25 const char name[8];
26 int on;
27 int off;
28};
29
30static const struct leds_evt_name evt_names[] = {
31 { "amber", led_amber_on, led_amber_off },
32 { "blue", led_blue_on, led_blue_off },
33 { "green", led_green_on, led_green_off },
34 { "red", led_red_on, led_red_off },
35};
36
37static ssize_t leds_store(struct device *dev,
38 struct device_attribute *attr,
39 const char *buf, size_t size)
40{
41 int ret = -EINVAL, len = strcspn(buf, " ");
42
43 if (len > 0 && buf[len] == '\0')
44 len--;
45
46 if (strncmp(buf, "claim", len) == 0) {
47 leds_event(led_claim);
48 ret = size;
49 } else if (strncmp(buf, "release", len) == 0) {
50 leds_event(led_release);
51 ret = size;
52 } else {
53 int i;
54
55 for (i = 0; i < ARRAY_SIZE(evt_names); i++) {
56 if (strlen(evt_names[i].name) != len ||
57 strncmp(buf, evt_names[i].name, len) != 0)
58 continue;
59 if (strncmp(buf+len, " on", 3) == 0) {
60 leds_event(evt_names[i].on);
61 ret = size;
62 } else if (strncmp(buf+len, " off", 4) == 0) {
63 leds_event(evt_names[i].off);
64 ret = size;
65 }
66 break;
67 }
68 }
69 return ret;
70}
71
72static DEVICE_ATTR(event, 0200, NULL, leds_store);
73
74static struct bus_type leds_subsys = {
75 .name = "leds",
76 .dev_name = "leds",
77};
78
79static struct device leds_device = {
80 .id = 0,
81 .bus = &leds_subsys,
82};
83
84static int leds_suspend(void)
85{
86 leds_event(led_stop);
87 return 0;
88}
89
90static void leds_resume(void)
91{
92 leds_event(led_start);
93}
94
95static void leds_shutdown(void)
96{
97 leds_event(led_halted);
98}
99
100static struct syscore_ops leds_syscore_ops = {
101 .shutdown = leds_shutdown,
102 .suspend = leds_suspend,
103 .resume = leds_resume,
104};
105
106static int __init leds_init(void)
107{
108 int ret;
109 ret = subsys_system_register(&leds_subsys, NULL);
110 if (ret == 0)
111 ret = device_register(&leds_device);
112 if (ret == 0)
113 ret = device_create_file(&leds_device, &dev_attr_event);
114 if (ret == 0)
115 register_syscore_ops(&leds_syscore_ops);
116 return ret;
117}
118
119device_initcall(leds_init);
120
121EXPORT_SYMBOL(leds_event);
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index dfcdb9f7c12..e29c3337ca8 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -8,7 +8,9 @@
8#include <linux/reboot.h> 8#include <linux/reboot.h>
9#include <linux/io.h> 9#include <linux/io.h>
10#include <linux/irq.h> 10#include <linux/irq.h>
11#include <linux/memblock.h>
11#include <asm/pgtable.h> 12#include <asm/pgtable.h>
13#include <linux/of_fdt.h>
12#include <asm/pgalloc.h> 14#include <asm/pgalloc.h>
13#include <asm/mmu_context.h> 15#include <asm/mmu_context.h>
14#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
@@ -32,6 +34,29 @@ static atomic_t waiting_for_crash_ipi;
32 34
33int machine_kexec_prepare(struct kimage *image) 35int machine_kexec_prepare(struct kimage *image)
34{ 36{
37 struct kexec_segment *current_segment;
38 __be32 header;
39 int i, err;
40
41 /*
42 * No segment at default ATAGs address. try to locate
43 * a dtb using magic.
44 */
45 for (i = 0; i < image->nr_segments; i++) {
46 current_segment = &image->segment[i];
47
48 err = memblock_is_region_memory(current_segment->mem,
49 current_segment->memsz);
50 if (err)
51 return - EINVAL;
52
53 err = get_user(header, (__be32*)current_segment->buf);
54 if (err)
55 return err;
56
57 if (be32_to_cpu(header) == OF_DT_HEADER)
58 kexec_boot_atags = current_segment->mem;
59 }
35 return 0; 60 return 0;
36} 61}
37 62
@@ -122,7 +147,9 @@ void machine_kexec(struct kimage *image)
122 kexec_start_address = image->start; 147 kexec_start_address = image->start;
123 kexec_indirection_page = page_list; 148 kexec_indirection_page = page_list;
124 kexec_mach_type = machine_arch_type; 149 kexec_mach_type = machine_arch_type;
125 kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET; 150 if (!kexec_boot_atags)
151 kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET;
152
126 153
127 /* copy our kernel relocation code to the control code page */ 154 /* copy our kernel relocation code to the control code page */
128 memcpy(reboot_code_buffer, 155 memcpy(reboot_code_buffer,
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index ab243b87118..93971b1a4f0 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -12,68 +12,15 @@
12 */ 12 */
13#define pr_fmt(fmt) "hw perfevents: " fmt 13#define pr_fmt(fmt) "hw perfevents: " fmt
14 14
15#include <linux/bitmap.h>
16#include <linux/interrupt.h>
17#include <linux/kernel.h> 15#include <linux/kernel.h>
18#include <linux/export.h>
19#include <linux/perf_event.h>
20#include <linux/platform_device.h> 16#include <linux/platform_device.h>
21#include <linux/spinlock.h> 17#include <linux/pm_runtime.h>
22#include <linux/uaccess.h> 18#include <linux/uaccess.h>
23 19
24#include <asm/cputype.h>
25#include <asm/irq.h>
26#include <asm/irq_regs.h> 20#include <asm/irq_regs.h>
27#include <asm/pmu.h> 21#include <asm/pmu.h>
28#include <asm/stacktrace.h> 22#include <asm/stacktrace.h>
29 23
30/*
31 * ARMv6 supports a maximum of 3 events, starting from index 0. If we add
32 * another platform that supports more, we need to increase this to be the
33 * largest of all platforms.
34 *
35 * ARMv7 supports up to 32 events:
36 * cycle counter CCNT + 31 events counters CNT0..30.
37 * Cortex-A8 has 1+4 counters, Cortex-A9 has 1+6 counters.
38 */
39#define ARMPMU_MAX_HWEVENTS 32
40
41static DEFINE_PER_CPU(struct perf_event * [ARMPMU_MAX_HWEVENTS], hw_events);
42static DEFINE_PER_CPU(unsigned long [BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)], used_mask);
43static DEFINE_PER_CPU(struct pmu_hw_events, cpu_hw_events);
44
45#define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu))
46
47/* Set at runtime when we know what CPU type we are. */
48static struct arm_pmu *cpu_pmu;
49
50const char *perf_pmu_name(void)
51{
52 if (!cpu_pmu)
53 return NULL;
54
55 return cpu_pmu->pmu.name;
56}
57EXPORT_SYMBOL_GPL(perf_pmu_name);
58
59int perf_num_counters(void)
60{
61 int max_events = 0;
62
63 if (cpu_pmu != NULL)
64 max_events = cpu_pmu->num_events;
65
66 return max_events;
67}
68EXPORT_SYMBOL_GPL(perf_num_counters);
69
70#define HW_OP_UNSUPPORTED 0xFFFF
71
72#define C(_x) \
73 PERF_COUNT_HW_CACHE_##_x
74
75#define CACHE_OP_UNSUPPORTED 0xFFFF
76
77static int 24static int
78armpmu_map_cache_event(const unsigned (*cache_map) 25armpmu_map_cache_event(const unsigned (*cache_map)
79 [PERF_COUNT_HW_CACHE_MAX] 26 [PERF_COUNT_HW_CACHE_MAX]
@@ -104,7 +51,7 @@ armpmu_map_cache_event(const unsigned (*cache_map)
104} 51}
105 52
106static int 53static int
107armpmu_map_event(const unsigned (*event_map)[PERF_COUNT_HW_MAX], u64 config) 54armpmu_map_hw_event(const unsigned (*event_map)[PERF_COUNT_HW_MAX], u64 config)
108{ 55{
109 int mapping = (*event_map)[config]; 56 int mapping = (*event_map)[config];
110 return mapping == HW_OP_UNSUPPORTED ? -ENOENT : mapping; 57 return mapping == HW_OP_UNSUPPORTED ? -ENOENT : mapping;
@@ -116,19 +63,20 @@ armpmu_map_raw_event(u32 raw_event_mask, u64 config)
116 return (int)(config & raw_event_mask); 63 return (int)(config & raw_event_mask);
117} 64}
118 65
119static int map_cpu_event(struct perf_event *event, 66int
120 const unsigned (*event_map)[PERF_COUNT_HW_MAX], 67armpmu_map_event(struct perf_event *event,
121 const unsigned (*cache_map) 68 const unsigned (*event_map)[PERF_COUNT_HW_MAX],
122 [PERF_COUNT_HW_CACHE_MAX] 69 const unsigned (*cache_map)
123 [PERF_COUNT_HW_CACHE_OP_MAX] 70 [PERF_COUNT_HW_CACHE_MAX]
124 [PERF_COUNT_HW_CACHE_RESULT_MAX], 71 [PERF_COUNT_HW_CACHE_OP_MAX]
125 u32 raw_event_mask) 72 [PERF_COUNT_HW_CACHE_RESULT_MAX],
73 u32 raw_event_mask)
126{ 74{
127 u64 config = event->attr.config; 75 u64 config = event->attr.config;
128 76
129 switch (event->attr.type) { 77 switch (event->attr.type) {
130 case PERF_TYPE_HARDWARE: 78 case PERF_TYPE_HARDWARE:
131 return armpmu_map_event(event_map, config); 79 return armpmu_map_hw_event(event_map, config);
132 case PERF_TYPE_HW_CACHE: 80 case PERF_TYPE_HW_CACHE:
133 return armpmu_map_cache_event(cache_map, config); 81 return armpmu_map_cache_event(cache_map, config);
134 case PERF_TYPE_RAW: 82 case PERF_TYPE_RAW:
@@ -222,7 +170,6 @@ armpmu_stop(struct perf_event *event, int flags)
222 */ 170 */
223 if (!(hwc->state & PERF_HES_STOPPED)) { 171 if (!(hwc->state & PERF_HES_STOPPED)) {
224 armpmu->disable(hwc, hwc->idx); 172 armpmu->disable(hwc, hwc->idx);
225 barrier(); /* why? */
226 armpmu_event_update(event, hwc, hwc->idx); 173 armpmu_event_update(event, hwc, hwc->idx);
227 hwc->state |= PERF_HES_STOPPED | PERF_HES_UPTODATE; 174 hwc->state |= PERF_HES_STOPPED | PERF_HES_UPTODATE;
228 } 175 }
@@ -350,99 +297,41 @@ validate_group(struct perf_event *event)
350 return 0; 297 return 0;
351} 298}
352 299
353static irqreturn_t armpmu_platform_irq(int irq, void *dev) 300static irqreturn_t armpmu_dispatch_irq(int irq, void *dev)
354{ 301{
355 struct arm_pmu *armpmu = (struct arm_pmu *) dev; 302 struct arm_pmu *armpmu = (struct arm_pmu *) dev;
356 struct platform_device *plat_device = armpmu->plat_device; 303 struct platform_device *plat_device = armpmu->plat_device;
357 struct arm_pmu_platdata *plat = dev_get_platdata(&plat_device->dev); 304 struct arm_pmu_platdata *plat = dev_get_platdata(&plat_device->dev);
358 305
359 return plat->handle_irq(irq, dev, armpmu->handle_irq); 306 if (plat && plat->handle_irq)
307 return plat->handle_irq(irq, dev, armpmu->handle_irq);
308 else
309 return armpmu->handle_irq(irq, dev);
360} 310}
361 311
362static void 312static void
363armpmu_release_hardware(struct arm_pmu *armpmu) 313armpmu_release_hardware(struct arm_pmu *armpmu)
364{ 314{
365 int i, irq, irqs; 315 armpmu->free_irq();
366 struct platform_device *pmu_device = armpmu->plat_device; 316 pm_runtime_put_sync(&armpmu->plat_device->dev);
367 struct arm_pmu_platdata *plat =
368 dev_get_platdata(&pmu_device->dev);
369
370 irqs = min(pmu_device->num_resources, num_possible_cpus());
371
372 for (i = 0; i < irqs; ++i) {
373 if (!cpumask_test_and_clear_cpu(i, &armpmu->active_irqs))
374 continue;
375 irq = platform_get_irq(pmu_device, i);
376 if (irq >= 0) {
377 if (plat && plat->disable_irq)
378 plat->disable_irq(irq);
379 free_irq(irq, armpmu);
380 }
381 }
382
383 release_pmu(armpmu->type);
384} 317}
385 318
386static int 319static int
387armpmu_reserve_hardware(struct arm_pmu *armpmu) 320armpmu_reserve_hardware(struct arm_pmu *armpmu)
388{ 321{
389 struct arm_pmu_platdata *plat; 322 int err;
390 irq_handler_t handle_irq;
391 int i, err, irq, irqs;
392 struct platform_device *pmu_device = armpmu->plat_device; 323 struct platform_device *pmu_device = armpmu->plat_device;
393 324
394 if (!pmu_device) 325 if (!pmu_device)
395 return -ENODEV; 326 return -ENODEV;
396 327
397 err = reserve_pmu(armpmu->type); 328 pm_runtime_get_sync(&pmu_device->dev);
329 err = armpmu->request_irq(armpmu_dispatch_irq);
398 if (err) { 330 if (err) {
399 pr_warning("unable to reserve pmu\n"); 331 armpmu_release_hardware(armpmu);
400 return err; 332 return err;
401 } 333 }
402 334
403 plat = dev_get_platdata(&pmu_device->dev);
404 if (plat && plat->handle_irq)
405 handle_irq = armpmu_platform_irq;
406 else
407 handle_irq = armpmu->handle_irq;
408
409 irqs = min(pmu_device->num_resources, num_possible_cpus());
410 if (irqs < 1) {
411 pr_err("no irqs for PMUs defined\n");
412 return -ENODEV;
413 }
414
415 for (i = 0; i < irqs; ++i) {
416 err = 0;
417 irq = platform_get_irq(pmu_device, i);
418 if (irq < 0)
419 continue;
420
421 /*
422 * If we have a single PMU interrupt that we can't shift,
423 * assume that we're running on a uniprocessor machine and
424 * continue. Otherwise, continue without this interrupt.
425 */
426 if (irq_set_affinity(irq, cpumask_of(i)) && irqs > 1) {
427 pr_warning("unable to set irq affinity (irq=%d, cpu=%u)\n",
428 irq, i);
429 continue;
430 }
431
432 err = request_irq(irq, handle_irq,
433 IRQF_DISABLED | IRQF_NOBALANCING,
434 "arm-pmu", armpmu);
435 if (err) {
436 pr_err("unable to request IRQ%d for ARM PMU counters\n",
437 irq);
438 armpmu_release_hardware(armpmu);
439 return err;
440 } else if (plat && plat->enable_irq)
441 plat->enable_irq(irq);
442
443 cpumask_set_cpu(i, &armpmu->active_irqs);
444 }
445
446 return 0; 335 return 0;
447} 336}
448 337
@@ -581,6 +470,32 @@ static void armpmu_disable(struct pmu *pmu)
581 armpmu->stop(); 470 armpmu->stop();
582} 471}
583 472
473#ifdef CONFIG_PM_RUNTIME
474static int armpmu_runtime_resume(struct device *dev)
475{
476 struct arm_pmu_platdata *plat = dev_get_platdata(dev);
477
478 if (plat && plat->runtime_resume)
479 return plat->runtime_resume(dev);
480
481 return 0;
482}
483
484static int armpmu_runtime_suspend(struct device *dev)
485{
486 struct arm_pmu_platdata *plat = dev_get_platdata(dev);
487
488 if (plat && plat->runtime_suspend)
489 return plat->runtime_suspend(dev);
490
491 return 0;
492}
493#endif
494
495const struct dev_pm_ops armpmu_dev_pm_ops = {
496 SET_RUNTIME_PM_OPS(armpmu_runtime_suspend, armpmu_runtime_resume, NULL)
497};
498
584static void __init armpmu_init(struct arm_pmu *armpmu) 499static void __init armpmu_init(struct arm_pmu *armpmu)
585{ 500{
586 atomic_set(&armpmu->active_events, 0); 501 atomic_set(&armpmu->active_events, 0);
@@ -598,174 +513,14 @@ static void __init armpmu_init(struct arm_pmu *armpmu)
598 }; 513 };
599} 514}
600 515
601int __init armpmu_register(struct arm_pmu *armpmu, char *name, int type) 516int armpmu_register(struct arm_pmu *armpmu, char *name, int type)
602{ 517{
603 armpmu_init(armpmu); 518 armpmu_init(armpmu);
519 pr_info("enabled with %s PMU driver, %d counters available\n",
520 armpmu->name, armpmu->num_events);
604 return perf_pmu_register(&armpmu->pmu, name, type); 521 return perf_pmu_register(&armpmu->pmu, name, type);
605} 522}
606 523
607/* Include the PMU-specific implementations. */
608#include "perf_event_xscale.c"
609#include "perf_event_v6.c"
610#include "perf_event_v7.c"
611
612/*
613 * Ensure the PMU has sane values out of reset.
614 * This requires SMP to be available, so exists as a separate initcall.
615 */
616static int __init
617cpu_pmu_reset(void)
618{
619 if (cpu_pmu && cpu_pmu->reset)
620 return on_each_cpu(cpu_pmu->reset, NULL, 1);
621 return 0;
622}
623arch_initcall(cpu_pmu_reset);
624
625/*
626 * PMU platform driver and devicetree bindings.
627 */
628static struct of_device_id armpmu_of_device_ids[] = {
629 {.compatible = "arm,cortex-a9-pmu"},
630 {.compatible = "arm,cortex-a8-pmu"},
631 {.compatible = "arm,arm1136-pmu"},
632 {.compatible = "arm,arm1176-pmu"},
633 {},
634};
635
636static struct platform_device_id armpmu_plat_device_ids[] = {
637 {.name = "arm-pmu"},
638 {},
639};
640
641static int __devinit armpmu_device_probe(struct platform_device *pdev)
642{
643 if (!cpu_pmu)
644 return -ENODEV;
645
646 cpu_pmu->plat_device = pdev;
647 return 0;
648}
649
650static struct platform_driver armpmu_driver = {
651 .driver = {
652 .name = "arm-pmu",
653 .of_match_table = armpmu_of_device_ids,
654 },
655 .probe = armpmu_device_probe,
656 .id_table = armpmu_plat_device_ids,
657};
658
659static int __init register_pmu_driver(void)
660{
661 return platform_driver_register(&armpmu_driver);
662}
663device_initcall(register_pmu_driver);
664
665static struct pmu_hw_events *armpmu_get_cpu_events(void)
666{
667 return &__get_cpu_var(cpu_hw_events);
668}
669
670static void __init cpu_pmu_init(struct arm_pmu *armpmu)
671{
672 int cpu;
673 for_each_possible_cpu(cpu) {
674 struct pmu_hw_events *events = &per_cpu(cpu_hw_events, cpu);
675 events->events = per_cpu(hw_events, cpu);
676 events->used_mask = per_cpu(used_mask, cpu);
677 raw_spin_lock_init(&events->pmu_lock);
678 }
679 armpmu->get_hw_events = armpmu_get_cpu_events;
680 armpmu->type = ARM_PMU_DEVICE_CPU;
681}
682
683/*
684 * PMU hardware loses all context when a CPU goes offline.
685 * When a CPU is hotplugged back in, since some hardware registers are
686 * UNKNOWN at reset, the PMU must be explicitly reset to avoid reading
687 * junk values out of them.
688 */
689static int __cpuinit pmu_cpu_notify(struct notifier_block *b,
690 unsigned long action, void *hcpu)
691{
692 if ((action & ~CPU_TASKS_FROZEN) != CPU_STARTING)
693 return NOTIFY_DONE;
694
695 if (cpu_pmu && cpu_pmu->reset)
696 cpu_pmu->reset(NULL);
697
698 return NOTIFY_OK;
699}
700
701static struct notifier_block __cpuinitdata pmu_cpu_notifier = {
702 .notifier_call = pmu_cpu_notify,
703};
704
705/*
706 * CPU PMU identification and registration.
707 */
708static int __init
709init_hw_perf_events(void)
710{
711 unsigned long cpuid = read_cpuid_id();
712 unsigned long implementor = (cpuid & 0xFF000000) >> 24;
713 unsigned long part_number = (cpuid & 0xFFF0);
714
715 /* ARM Ltd CPUs. */
716 if (0x41 == implementor) {
717 switch (part_number) {
718 case 0xB360: /* ARM1136 */
719 case 0xB560: /* ARM1156 */
720 case 0xB760: /* ARM1176 */
721 cpu_pmu = armv6pmu_init();
722 break;
723 case 0xB020: /* ARM11mpcore */
724 cpu_pmu = armv6mpcore_pmu_init();
725 break;
726 case 0xC080: /* Cortex-A8 */
727 cpu_pmu = armv7_a8_pmu_init();
728 break;
729 case 0xC090: /* Cortex-A9 */
730 cpu_pmu = armv7_a9_pmu_init();
731 break;
732 case 0xC050: /* Cortex-A5 */
733 cpu_pmu = armv7_a5_pmu_init();
734 break;
735 case 0xC0F0: /* Cortex-A15 */
736 cpu_pmu = armv7_a15_pmu_init();
737 break;
738 case 0xC070: /* Cortex-A7 */
739 cpu_pmu = armv7_a7_pmu_init();
740 break;
741 }
742 /* Intel CPUs [xscale]. */
743 } else if (0x69 == implementor) {
744 part_number = (cpuid >> 13) & 0x7;
745 switch (part_number) {
746 case 1:
747 cpu_pmu = xscale1pmu_init();
748 break;
749 case 2:
750 cpu_pmu = xscale2pmu_init();
751 break;
752 }
753 }
754
755 if (cpu_pmu) {
756 pr_info("enabled with %s PMU driver, %d counters available\n",
757 cpu_pmu->name, cpu_pmu->num_events);
758 cpu_pmu_init(cpu_pmu);
759 register_cpu_notifier(&pmu_cpu_notifier);
760 armpmu_register(cpu_pmu, cpu_pmu->name, PERF_TYPE_RAW);
761 } else {
762 pr_info("no hardware support available\n");
763 }
764
765 return 0;
766}
767early_initcall(init_hw_perf_events);
768
769/* 524/*
770 * Callchain handling code. 525 * Callchain handling code.
771 */ 526 */
diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c
new file mode 100644
index 00000000000..8d7d8d4de9d
--- /dev/null
+++ b/arch/arm/kernel/perf_event_cpu.c
@@ -0,0 +1,295 @@
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 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
14 *
15 * Copyright (C) 2012 ARM Limited
16 *
17 * Author: Will Deacon <will.deacon@arm.com>
18 */
19#define pr_fmt(fmt) "CPU PMU: " fmt
20
21#include <linux/bitmap.h>
22#include <linux/export.h>
23#include <linux/kernel.h>
24#include <linux/of.h>
25#include <linux/platform_device.h>
26#include <linux/spinlock.h>
27
28#include <asm/cputype.h>
29#include <asm/irq_regs.h>
30#include <asm/pmu.h>
31
32/* Set at runtime when we know what CPU type we are. */
33static struct arm_pmu *cpu_pmu;
34
35static DEFINE_PER_CPU(struct perf_event * [ARMPMU_MAX_HWEVENTS], hw_events);
36static DEFINE_PER_CPU(unsigned long [BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)], used_mask);
37static DEFINE_PER_CPU(struct pmu_hw_events, cpu_hw_events);
38
39/*
40 * Despite the names, these two functions are CPU-specific and are used
41 * by the OProfile/perf code.
42 */
43const char *perf_pmu_name(void)
44{
45 if (!cpu_pmu)
46 return NULL;
47
48 return cpu_pmu->pmu.name;
49}
50EXPORT_SYMBOL_GPL(perf_pmu_name);
51
52int perf_num_counters(void)
53{
54 int max_events = 0;
55
56 if (cpu_pmu != NULL)
57 max_events = cpu_pmu->num_events;
58
59 return max_events;
60}
61EXPORT_SYMBOL_GPL(perf_num_counters);
62
63/* Include the PMU-specific implementations. */
64#include "perf_event_xscale.c"
65#include "perf_event_v6.c"
66#include "perf_event_v7.c"
67
68static struct pmu_hw_events *cpu_pmu_get_cpu_events(void)
69{
70 return &__get_cpu_var(cpu_hw_events);
71}
72
73static void cpu_pmu_free_irq(void)
74{
75 int i, irq, irqs;
76 struct platform_device *pmu_device = cpu_pmu->plat_device;
77
78 irqs = min(pmu_device->num_resources, num_possible_cpus());
79
80 for (i = 0; i < irqs; ++i) {
81 if (!cpumask_test_and_clear_cpu(i, &cpu_pmu->active_irqs))
82 continue;
83 irq = platform_get_irq(pmu_device, i);
84 if (irq >= 0)
85 free_irq(irq, cpu_pmu);
86 }
87}
88
89static int cpu_pmu_request_irq(irq_handler_t handler)
90{
91 int i, err, irq, irqs;
92 struct platform_device *pmu_device = cpu_pmu->plat_device;
93
94 if (!pmu_device)
95 return -ENODEV;
96
97 irqs = min(pmu_device->num_resources, num_possible_cpus());
98 if (irqs < 1) {
99 pr_err("no irqs for PMUs defined\n");
100 return -ENODEV;
101 }
102
103 for (i = 0; i < irqs; ++i) {
104 err = 0;
105 irq = platform_get_irq(pmu_device, i);
106 if (irq < 0)
107 continue;
108
109 /*
110 * If we have a single PMU interrupt that we can't shift,
111 * assume that we're running on a uniprocessor machine and
112 * continue. Otherwise, continue without this interrupt.
113 */
114 if (irq_set_affinity(irq, cpumask_of(i)) && irqs > 1) {
115 pr_warning("unable to set irq affinity (irq=%d, cpu=%u)\n",
116 irq, i);
117 continue;
118 }
119
120 err = request_irq(irq, handler, IRQF_NOBALANCING, "arm-pmu",
121 cpu_pmu);
122 if (err) {
123 pr_err("unable to request IRQ%d for ARM PMU counters\n",
124 irq);
125 return err;
126 }
127
128 cpumask_set_cpu(i, &cpu_pmu->active_irqs);
129 }
130
131 return 0;
132}
133
134static void __devinit cpu_pmu_init(struct arm_pmu *cpu_pmu)
135{
136 int cpu;
137 for_each_possible_cpu(cpu) {
138 struct pmu_hw_events *events = &per_cpu(cpu_hw_events, cpu);
139 events->events = per_cpu(hw_events, cpu);
140 events->used_mask = per_cpu(used_mask, cpu);
141 raw_spin_lock_init(&events->pmu_lock);
142 }
143
144 cpu_pmu->get_hw_events = cpu_pmu_get_cpu_events;
145 cpu_pmu->request_irq = cpu_pmu_request_irq;
146 cpu_pmu->free_irq = cpu_pmu_free_irq;
147
148 /* Ensure the PMU has sane values out of reset. */
149 if (cpu_pmu && cpu_pmu->reset)
150 on_each_cpu(cpu_pmu->reset, NULL, 1);
151}
152
153/*
154 * PMU hardware loses all context when a CPU goes offline.
155 * When a CPU is hotplugged back in, since some hardware registers are
156 * UNKNOWN at reset, the PMU must be explicitly reset to avoid reading
157 * junk values out of them.
158 */
159static int __cpuinit cpu_pmu_notify(struct notifier_block *b,
160 unsigned long action, void *hcpu)
161{
162 if ((action & ~CPU_TASKS_FROZEN) != CPU_STARTING)
163 return NOTIFY_DONE;
164
165 if (cpu_pmu && cpu_pmu->reset)
166 cpu_pmu->reset(NULL);
167
168 return NOTIFY_OK;
169}
170
171static struct notifier_block __cpuinitdata cpu_pmu_hotplug_notifier = {
172 .notifier_call = cpu_pmu_notify,
173};
174
175/*
176 * PMU platform driver and devicetree bindings.
177 */
178static struct of_device_id __devinitdata cpu_pmu_of_device_ids[] = {
179 {.compatible = "arm,cortex-a15-pmu", .data = armv7_a15_pmu_init},
180 {.compatible = "arm,cortex-a9-pmu", .data = armv7_a9_pmu_init},
181 {.compatible = "arm,cortex-a8-pmu", .data = armv7_a8_pmu_init},
182 {.compatible = "arm,cortex-a7-pmu", .data = armv7_a7_pmu_init},
183 {.compatible = "arm,cortex-a5-pmu", .data = armv7_a5_pmu_init},
184 {.compatible = "arm,arm11mpcore-pmu", .data = armv6mpcore_pmu_init},
185 {.compatible = "arm,arm1176-pmu", .data = armv6pmu_init},
186 {.compatible = "arm,arm1136-pmu", .data = armv6pmu_init},
187 {},
188};
189
190static struct platform_device_id __devinitdata cpu_pmu_plat_device_ids[] = {
191 {.name = "arm-pmu"},
192 {},
193};
194
195/*
196 * CPU PMU identification and probing.
197 */
198static struct arm_pmu *__devinit probe_current_pmu(void)
199{
200 struct arm_pmu *pmu = NULL;
201 int cpu = get_cpu();
202 unsigned long cpuid = read_cpuid_id();
203 unsigned long implementor = (cpuid & 0xFF000000) >> 24;
204 unsigned long part_number = (cpuid & 0xFFF0);
205
206 pr_info("probing PMU on CPU %d\n", cpu);
207
208 /* ARM Ltd CPUs. */
209 if (0x41 == implementor) {
210 switch (part_number) {
211 case 0xB360: /* ARM1136 */
212 case 0xB560: /* ARM1156 */
213 case 0xB760: /* ARM1176 */
214 pmu = armv6pmu_init();
215 break;
216 case 0xB020: /* ARM11mpcore */
217 pmu = armv6mpcore_pmu_init();
218 break;
219 case 0xC080: /* Cortex-A8 */
220 pmu = armv7_a8_pmu_init();
221 break;
222 case 0xC090: /* Cortex-A9 */
223 pmu = armv7_a9_pmu_init();
224 break;
225 case 0xC050: /* Cortex-A5 */
226 pmu = armv7_a5_pmu_init();
227 break;
228 case 0xC0F0: /* Cortex-A15 */
229 pmu = armv7_a15_pmu_init();
230 break;
231 case 0xC070: /* Cortex-A7 */
232 pmu = armv7_a7_pmu_init();
233 break;
234 }
235 /* Intel CPUs [xscale]. */
236 } else if (0x69 == implementor) {
237 part_number = (cpuid >> 13) & 0x7;
238 switch (part_number) {
239 case 1:
240 pmu = xscale1pmu_init();
241 break;
242 case 2:
243 pmu = xscale2pmu_init();
244 break;
245 }
246 }
247
248 put_cpu();
249 return pmu;
250}
251
252static int __devinit cpu_pmu_device_probe(struct platform_device *pdev)
253{
254 const struct of_device_id *of_id;
255 struct arm_pmu *(*init_fn)(void);
256 struct device_node *node = pdev->dev.of_node;
257
258 if (cpu_pmu) {
259 pr_info("attempt to register multiple PMU devices!");
260 return -ENOSPC;
261 }
262
263 if (node && (of_id = of_match_node(cpu_pmu_of_device_ids, pdev->dev.of_node))) {
264 init_fn = of_id->data;
265 cpu_pmu = init_fn();
266 } else {
267 cpu_pmu = probe_current_pmu();
268 }
269
270 if (!cpu_pmu)
271 return -ENODEV;
272
273 cpu_pmu->plat_device = pdev;
274 cpu_pmu_init(cpu_pmu);
275 register_cpu_notifier(&cpu_pmu_hotplug_notifier);
276 armpmu_register(cpu_pmu, cpu_pmu->name, PERF_TYPE_RAW);
277
278 return 0;
279}
280
281static struct platform_driver cpu_pmu_driver = {
282 .driver = {
283 .name = "arm-pmu",
284 .pm = &armpmu_dev_pm_ops,
285 .of_match_table = cpu_pmu_of_device_ids,
286 },
287 .probe = cpu_pmu_device_probe,
288 .id_table = cpu_pmu_plat_device_ids,
289};
290
291static int __init register_pmu_driver(void)
292{
293 return platform_driver_register(&cpu_pmu_driver);
294}
295device_initcall(register_pmu_driver);
diff --git a/arch/arm/kernel/perf_event_v6.c b/arch/arm/kernel/perf_event_v6.c
index c90fcb2b696..6ccc0797174 100644
--- a/arch/arm/kernel/perf_event_v6.c
+++ b/arch/arm/kernel/perf_event_v6.c
@@ -645,7 +645,7 @@ armv6mpcore_pmu_disable_event(struct hw_perf_event *hwc,
645 645
646static int armv6_map_event(struct perf_event *event) 646static int armv6_map_event(struct perf_event *event)
647{ 647{
648 return map_cpu_event(event, &armv6_perf_map, 648 return armpmu_map_event(event, &armv6_perf_map,
649 &armv6_perf_cache_map, 0xFF); 649 &armv6_perf_cache_map, 0xFF);
650} 650}
651 651
@@ -664,7 +664,7 @@ static struct arm_pmu armv6pmu = {
664 .max_period = (1LLU << 32) - 1, 664 .max_period = (1LLU << 32) - 1,
665}; 665};
666 666
667static struct arm_pmu *__init armv6pmu_init(void) 667static struct arm_pmu *__devinit armv6pmu_init(void)
668{ 668{
669 return &armv6pmu; 669 return &armv6pmu;
670} 670}
@@ -679,7 +679,7 @@ static struct arm_pmu *__init armv6pmu_init(void)
679 679
680static int armv6mpcore_map_event(struct perf_event *event) 680static int armv6mpcore_map_event(struct perf_event *event)
681{ 681{
682 return map_cpu_event(event, &armv6mpcore_perf_map, 682 return armpmu_map_event(event, &armv6mpcore_perf_map,
683 &armv6mpcore_perf_cache_map, 0xFF); 683 &armv6mpcore_perf_cache_map, 0xFF);
684} 684}
685 685
@@ -698,17 +698,17 @@ static struct arm_pmu armv6mpcore_pmu = {
698 .max_period = (1LLU << 32) - 1, 698 .max_period = (1LLU << 32) - 1,
699}; 699};
700 700
701static struct arm_pmu *__init armv6mpcore_pmu_init(void) 701static struct arm_pmu *__devinit armv6mpcore_pmu_init(void)
702{ 702{
703 return &armv6mpcore_pmu; 703 return &armv6mpcore_pmu;
704} 704}
705#else 705#else
706static struct arm_pmu *__init armv6pmu_init(void) 706static struct arm_pmu *__devinit armv6pmu_init(void)
707{ 707{
708 return NULL; 708 return NULL;
709} 709}
710 710
711static struct arm_pmu *__init armv6mpcore_pmu_init(void) 711static struct arm_pmu *__devinit armv6mpcore_pmu_init(void)
712{ 712{
713 return NULL; 713 return NULL;
714} 714}
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
index f04070bd218..bd4b090ebcf 100644
--- a/arch/arm/kernel/perf_event_v7.c
+++ b/arch/arm/kernel/perf_event_v7.c
@@ -1204,31 +1204,31 @@ static void armv7pmu_reset(void *info)
1204 1204
1205static int armv7_a8_map_event(struct perf_event *event) 1205static int armv7_a8_map_event(struct perf_event *event)
1206{ 1206{
1207 return map_cpu_event(event, &armv7_a8_perf_map, 1207 return armpmu_map_event(event, &armv7_a8_perf_map,
1208 &armv7_a8_perf_cache_map, 0xFF); 1208 &armv7_a8_perf_cache_map, 0xFF);
1209} 1209}
1210 1210
1211static int armv7_a9_map_event(struct perf_event *event) 1211static int armv7_a9_map_event(struct perf_event *event)
1212{ 1212{
1213 return map_cpu_event(event, &armv7_a9_perf_map, 1213 return armpmu_map_event(event, &armv7_a9_perf_map,
1214 &armv7_a9_perf_cache_map, 0xFF); 1214 &armv7_a9_perf_cache_map, 0xFF);
1215} 1215}
1216 1216
1217static int armv7_a5_map_event(struct perf_event *event) 1217static int armv7_a5_map_event(struct perf_event *event)
1218{ 1218{
1219 return map_cpu_event(event, &armv7_a5_perf_map, 1219 return armpmu_map_event(event, &armv7_a5_perf_map,
1220 &armv7_a5_perf_cache_map, 0xFF); 1220 &armv7_a5_perf_cache_map, 0xFF);
1221} 1221}
1222 1222
1223static int armv7_a15_map_event(struct perf_event *event) 1223static int armv7_a15_map_event(struct perf_event *event)
1224{ 1224{
1225 return map_cpu_event(event, &armv7_a15_perf_map, 1225 return armpmu_map_event(event, &armv7_a15_perf_map,
1226 &armv7_a15_perf_cache_map, 0xFF); 1226 &armv7_a15_perf_cache_map, 0xFF);
1227} 1227}
1228 1228
1229static int armv7_a7_map_event(struct perf_event *event) 1229static int armv7_a7_map_event(struct perf_event *event)
1230{ 1230{
1231 return map_cpu_event(event, &armv7_a7_perf_map, 1231 return armpmu_map_event(event, &armv7_a7_perf_map,
1232 &armv7_a7_perf_cache_map, 0xFF); 1232 &armv7_a7_perf_cache_map, 0xFF);
1233} 1233}
1234 1234
@@ -1245,7 +1245,7 @@ static struct arm_pmu armv7pmu = {
1245 .max_period = (1LLU << 32) - 1, 1245 .max_period = (1LLU << 32) - 1,
1246}; 1246};
1247 1247
1248static u32 __init armv7_read_num_pmnc_events(void) 1248static u32 __devinit armv7_read_num_pmnc_events(void)
1249{ 1249{
1250 u32 nb_cnt; 1250 u32 nb_cnt;
1251 1251
@@ -1256,7 +1256,7 @@ static u32 __init armv7_read_num_pmnc_events(void)
1256 return nb_cnt + 1; 1256 return nb_cnt + 1;
1257} 1257}
1258 1258
1259static struct arm_pmu *__init armv7_a8_pmu_init(void) 1259static struct arm_pmu *__devinit armv7_a8_pmu_init(void)
1260{ 1260{
1261 armv7pmu.name = "ARMv7 Cortex-A8"; 1261 armv7pmu.name = "ARMv7 Cortex-A8";
1262 armv7pmu.map_event = armv7_a8_map_event; 1262 armv7pmu.map_event = armv7_a8_map_event;
@@ -1264,7 +1264,7 @@ static struct arm_pmu *__init armv7_a8_pmu_init(void)
1264 return &armv7pmu; 1264 return &armv7pmu;
1265} 1265}
1266 1266
1267static struct arm_pmu *__init armv7_a9_pmu_init(void) 1267static struct arm_pmu *__devinit armv7_a9_pmu_init(void)
1268{ 1268{
1269 armv7pmu.name = "ARMv7 Cortex-A9"; 1269 armv7pmu.name = "ARMv7 Cortex-A9";
1270 armv7pmu.map_event = armv7_a9_map_event; 1270 armv7pmu.map_event = armv7_a9_map_event;
@@ -1272,7 +1272,7 @@ static struct arm_pmu *__init armv7_a9_pmu_init(void)
1272 return &armv7pmu; 1272 return &armv7pmu;
1273} 1273}
1274 1274
1275static struct arm_pmu *__init armv7_a5_pmu_init(void) 1275static struct arm_pmu *__devinit armv7_a5_pmu_init(void)
1276{ 1276{
1277 armv7pmu.name = "ARMv7 Cortex-A5"; 1277 armv7pmu.name = "ARMv7 Cortex-A5";
1278 armv7pmu.map_event = armv7_a5_map_event; 1278 armv7pmu.map_event = armv7_a5_map_event;
@@ -1280,7 +1280,7 @@ static struct arm_pmu *__init armv7_a5_pmu_init(void)
1280 return &armv7pmu; 1280 return &armv7pmu;
1281} 1281}
1282 1282
1283static struct arm_pmu *__init armv7_a15_pmu_init(void) 1283static struct arm_pmu *__devinit armv7_a15_pmu_init(void)
1284{ 1284{
1285 armv7pmu.name = "ARMv7 Cortex-A15"; 1285 armv7pmu.name = "ARMv7 Cortex-A15";
1286 armv7pmu.map_event = armv7_a15_map_event; 1286 armv7pmu.map_event = armv7_a15_map_event;
@@ -1289,7 +1289,7 @@ static struct arm_pmu *__init armv7_a15_pmu_init(void)
1289 return &armv7pmu; 1289 return &armv7pmu;
1290} 1290}
1291 1291
1292static struct arm_pmu *__init armv7_a7_pmu_init(void) 1292static struct arm_pmu *__devinit armv7_a7_pmu_init(void)
1293{ 1293{
1294 armv7pmu.name = "ARMv7 Cortex-A7"; 1294 armv7pmu.name = "ARMv7 Cortex-A7";
1295 armv7pmu.map_event = armv7_a7_map_event; 1295 armv7pmu.map_event = armv7_a7_map_event;
@@ -1298,27 +1298,27 @@ static struct arm_pmu *__init armv7_a7_pmu_init(void)
1298 return &armv7pmu; 1298 return &armv7pmu;
1299} 1299}
1300#else 1300#else
1301static struct arm_pmu *__init armv7_a8_pmu_init(void) 1301static struct arm_pmu *__devinit armv7_a8_pmu_init(void)
1302{ 1302{
1303 return NULL; 1303 return NULL;
1304} 1304}
1305 1305
1306static struct arm_pmu *__init armv7_a9_pmu_init(void) 1306static struct arm_pmu *__devinit armv7_a9_pmu_init(void)
1307{ 1307{
1308 return NULL; 1308 return NULL;
1309} 1309}
1310 1310
1311static struct arm_pmu *__init armv7_a5_pmu_init(void) 1311static struct arm_pmu *__devinit armv7_a5_pmu_init(void)
1312{ 1312{
1313 return NULL; 1313 return NULL;
1314} 1314}
1315 1315
1316static struct arm_pmu *__init armv7_a15_pmu_init(void) 1316static struct arm_pmu *__devinit armv7_a15_pmu_init(void)
1317{ 1317{
1318 return NULL; 1318 return NULL;
1319} 1319}
1320 1320
1321static struct arm_pmu *__init armv7_a7_pmu_init(void) 1321static struct arm_pmu *__devinit armv7_a7_pmu_init(void)
1322{ 1322{
1323 return NULL; 1323 return NULL;
1324} 1324}
diff --git a/arch/arm/kernel/perf_event_xscale.c b/arch/arm/kernel/perf_event_xscale.c
index f759fe0bab6..426e19f380a 100644
--- a/arch/arm/kernel/perf_event_xscale.c
+++ b/arch/arm/kernel/perf_event_xscale.c
@@ -430,7 +430,7 @@ xscale1pmu_write_counter(int counter, u32 val)
430 430
431static int xscale_map_event(struct perf_event *event) 431static int xscale_map_event(struct perf_event *event)
432{ 432{
433 return map_cpu_event(event, &xscale_perf_map, 433 return armpmu_map_event(event, &xscale_perf_map,
434 &xscale_perf_cache_map, 0xFF); 434 &xscale_perf_cache_map, 0xFF);
435} 435}
436 436
@@ -449,7 +449,7 @@ static struct arm_pmu xscale1pmu = {
449 .max_period = (1LLU << 32) - 1, 449 .max_period = (1LLU << 32) - 1,
450}; 450};
451 451
452static struct arm_pmu *__init xscale1pmu_init(void) 452static struct arm_pmu *__devinit xscale1pmu_init(void)
453{ 453{
454 return &xscale1pmu; 454 return &xscale1pmu;
455} 455}
@@ -816,17 +816,17 @@ static struct arm_pmu xscale2pmu = {
816 .max_period = (1LLU << 32) - 1, 816 .max_period = (1LLU << 32) - 1,
817}; 817};
818 818
819static struct arm_pmu *__init xscale2pmu_init(void) 819static struct arm_pmu *__devinit xscale2pmu_init(void)
820{ 820{
821 return &xscale2pmu; 821 return &xscale2pmu;
822} 822}
823#else 823#else
824static struct arm_pmu *__init xscale1pmu_init(void) 824static struct arm_pmu *__devinit xscale1pmu_init(void)
825{ 825{
826 return NULL; 826 return NULL;
827} 827}
828 828
829static struct arm_pmu *__init xscale2pmu_init(void) 829static struct arm_pmu *__devinit xscale2pmu_init(void)
830{ 830{
831 return NULL; 831 return NULL;
832} 832}
diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c
deleted file mode 100644
index 2334bf8a650..00000000000
--- a/arch/arm/kernel/pmu.c
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * linux/arch/arm/kernel/pmu.c
3 *
4 * Copyright (C) 2009 picoChip Designs Ltd, Jamie Iles
5 * Copyright (C) 2010 ARM Ltd, Will Deacon
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
13#include <linux/err.h>
14#include <linux/kernel.h>
15#include <linux/module.h>
16
17#include <asm/pmu.h>
18
19/*
20 * PMU locking to ensure mutual exclusion between different subsystems.
21 */
22static unsigned long pmu_lock[BITS_TO_LONGS(ARM_NUM_PMU_DEVICES)];
23
24int
25reserve_pmu(enum arm_pmu_type type)
26{
27 return test_and_set_bit_lock(type, pmu_lock) ? -EBUSY : 0;
28}
29EXPORT_SYMBOL_GPL(reserve_pmu);
30
31void
32release_pmu(enum arm_pmu_type type)
33{
34 clear_bit_unlock(type, pmu_lock);
35}
36EXPORT_SYMBOL_GPL(release_pmu);
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 693b744fd57..90084a6de35 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -31,9 +31,9 @@
31#include <linux/random.h> 31#include <linux/random.h>
32#include <linux/hw_breakpoint.h> 32#include <linux/hw_breakpoint.h>
33#include <linux/cpuidle.h> 33#include <linux/cpuidle.h>
34#include <linux/leds.h>
34 35
35#include <asm/cacheflush.h> 36#include <asm/cacheflush.h>
36#include <asm/leds.h>
37#include <asm/processor.h> 37#include <asm/processor.h>
38#include <asm/thread_notify.h> 38#include <asm/thread_notify.h>
39#include <asm/stacktrace.h> 39#include <asm/stacktrace.h>
@@ -189,7 +189,7 @@ void cpu_idle(void)
189 while (1) { 189 while (1) {
190 tick_nohz_idle_enter(); 190 tick_nohz_idle_enter();
191 rcu_idle_enter(); 191 rcu_idle_enter();
192 leds_event(led_idle_start); 192 ledtrig_cpu(CPU_LED_IDLE_START);
193 while (!need_resched()) { 193 while (!need_resched()) {
194#ifdef CONFIG_HOTPLUG_CPU 194#ifdef CONFIG_HOTPLUG_CPU
195 if (cpu_is_offline(smp_processor_id())) 195 if (cpu_is_offline(smp_processor_id()))
@@ -220,7 +220,7 @@ void cpu_idle(void)
220 } else 220 } else
221 local_irq_enable(); 221 local_irq_enable();
222 } 222 }
223 leds_event(led_idle_end); 223 ledtrig_cpu(CPU_LED_IDLE_END);
224 rcu_idle_exit(); 224 rcu_idle_exit();
225 tick_nohz_idle_exit(); 225 tick_nohz_idle_exit();
226 schedule_preempt_disabled(); 226 schedule_preempt_disabled();
@@ -381,13 +381,20 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
381 struct thread_info *thread = task_thread_info(p); 381 struct thread_info *thread = task_thread_info(p);
382 struct pt_regs *childregs = task_pt_regs(p); 382 struct pt_regs *childregs = task_pt_regs(p);
383 383
384 *childregs = *regs;
385 childregs->ARM_r0 = 0;
386 childregs->ARM_sp = stack_start;
387
388 memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); 384 memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
389 thread->cpu_context.sp = (unsigned long)childregs; 385
386 if (likely(regs)) {
387 *childregs = *regs;
388 childregs->ARM_r0 = 0;
389 childregs->ARM_sp = stack_start;
390 } else {
391 memset(childregs, 0, sizeof(struct pt_regs));
392 thread->cpu_context.r4 = stk_sz;
393 thread->cpu_context.r5 = stack_start;
394 childregs->ARM_cpsr = SVC_MODE;
395 }
390 thread->cpu_context.pc = (unsigned long)ret_from_fork; 396 thread->cpu_context.pc = (unsigned long)ret_from_fork;
397 thread->cpu_context.sp = (unsigned long)childregs;
391 398
392 clear_ptrace_hw_breakpoint(p); 399 clear_ptrace_hw_breakpoint(p);
393 400
@@ -423,63 +430,6 @@ int dump_fpu (struct pt_regs *regs, struct user_fp *fp)
423} 430}
424EXPORT_SYMBOL(dump_fpu); 431EXPORT_SYMBOL(dump_fpu);
425 432
426/*
427 * Shuffle the argument into the correct register before calling the
428 * thread function. r4 is the thread argument, r5 is the pointer to
429 * the thread function, and r6 points to the exit function.
430 */
431extern void kernel_thread_helper(void);
432asm( ".pushsection .text\n"
433" .align\n"
434" .type kernel_thread_helper, #function\n"
435"kernel_thread_helper:\n"
436#ifdef CONFIG_TRACE_IRQFLAGS
437" bl trace_hardirqs_on\n"
438#endif
439" msr cpsr_c, r7\n"
440" mov r0, r4\n"
441" mov lr, r6\n"
442" mov pc, r5\n"
443" .size kernel_thread_helper, . - kernel_thread_helper\n"
444" .popsection");
445
446#ifdef CONFIG_ARM_UNWIND
447extern void kernel_thread_exit(long code);
448asm( ".pushsection .text\n"
449" .align\n"
450" .type kernel_thread_exit, #function\n"
451"kernel_thread_exit:\n"
452" .fnstart\n"
453" .cantunwind\n"
454" bl do_exit\n"
455" nop\n"
456" .fnend\n"
457" .size kernel_thread_exit, . - kernel_thread_exit\n"
458" .popsection");
459#else
460#define kernel_thread_exit do_exit
461#endif
462
463/*
464 * Create a kernel thread.
465 */
466pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
467{
468 struct pt_regs regs;
469
470 memset(&regs, 0, sizeof(regs));
471
472 regs.ARM_r4 = (unsigned long)arg;
473 regs.ARM_r5 = (unsigned long)fn;
474 regs.ARM_r6 = (unsigned long)kernel_thread_exit;
475 regs.ARM_r7 = SVC_MODE | PSR_ENDSTATE | PSR_ISETSTATE;
476 regs.ARM_pc = (unsigned long)kernel_thread_helper;
477 regs.ARM_cpsr = regs.ARM_r7 | PSR_I_BIT;
478
479 return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
480}
481EXPORT_SYMBOL(kernel_thread);
482
483unsigned long get_wchan(struct task_struct *p) 433unsigned long get_wchan(struct task_struct *p)
484{ 434{
485 struct stackframe frame; 435 struct stackframe frame;
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 3e0fc5f7ed4..739db3a1b2d 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -30,6 +30,9 @@
30#include <asm/pgtable.h> 30#include <asm/pgtable.h>
31#include <asm/traps.h> 31#include <asm/traps.h>
32 32
33#define CREATE_TRACE_POINTS
34#include <trace/events/syscalls.h>
35
33#define REG_PC 15 36#define REG_PC 15
34#define REG_PSR 16 37#define REG_PSR 16
35/* 38/*
@@ -918,11 +921,11 @@ static int ptrace_syscall_trace(struct pt_regs *regs, int scno,
918{ 921{
919 unsigned long ip; 922 unsigned long ip;
920 923
924 current_thread_info()->syscall = scno;
925
921 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 926 if (!test_thread_flag(TIF_SYSCALL_TRACE))
922 return scno; 927 return scno;
923 928
924 current_thread_info()->syscall = scno;
925
926 /* 929 /*
927 * IP is used to denote syscall entry/exit: 930 * IP is used to denote syscall entry/exit:
928 * IP = 0 -> entry, =1 -> exit 931 * IP = 0 -> entry, =1 -> exit
@@ -941,15 +944,19 @@ static int ptrace_syscall_trace(struct pt_regs *regs, int scno,
941 944
942asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno) 945asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno)
943{ 946{
944 int ret = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_ENTER); 947 scno = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_ENTER);
948 if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
949 trace_sys_enter(regs, scno);
945 audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, regs->ARM_r1, 950 audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, regs->ARM_r1,
946 regs->ARM_r2, regs->ARM_r3); 951 regs->ARM_r2, regs->ARM_r3);
947 return ret; 952 return scno;
948} 953}
949 954
950asmlinkage int syscall_trace_exit(struct pt_regs *regs, int scno) 955asmlinkage int syscall_trace_exit(struct pt_regs *regs, int scno)
951{ 956{
952 int ret = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_EXIT); 957 scno = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_EXIT);
958 if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
959 trace_sys_exit(regs, scno);
953 audit_syscall_exit(regs); 960 audit_syscall_exit(regs);
954 return ret; 961 return scno;
955} 962}
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
index f4515393248..e21bac20d90 100644
--- a/arch/arm/kernel/sched_clock.c
+++ b/arch/arm/kernel/sched_clock.c
@@ -9,6 +9,7 @@
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/jiffies.h> 10#include <linux/jiffies.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/moduleparam.h>
12#include <linux/sched.h> 13#include <linux/sched.h>
13#include <linux/syscore_ops.h> 14#include <linux/syscore_ops.h>
14#include <linux/timer.h> 15#include <linux/timer.h>
@@ -27,6 +28,9 @@ struct clock_data {
27 28
28static void sched_clock_poll(unsigned long wrap_ticks); 29static void sched_clock_poll(unsigned long wrap_ticks);
29static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0); 30static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0);
31static int irqtime = -1;
32
33core_param(irqtime, irqtime, int, 0400);
30 34
31static struct clock_data cd = { 35static struct clock_data cd = {
32 .mult = NSEC_PER_SEC / HZ, 36 .mult = NSEC_PER_SEC / HZ,
@@ -157,6 +161,10 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)
157 */ 161 */
158 cd.epoch_ns = 0; 162 cd.epoch_ns = 0;
159 163
164 /* Enable IRQ time accounting if we have a fast enough sched_clock */
165 if (irqtime > 0 || (irqtime == -1 && rate >= 1000000))
166 enable_sched_clock_irqtime();
167
160 pr_debug("Registered %pF as sched_clock source\n", read); 168 pr_debug("Registered %pF as sched_clock source\n", read);
161} 169}
162 170
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index a81dcecc734..da1d1aa20ad 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -21,11 +21,9 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/kexec.h> 22#include <linux/kexec.h>
23#include <linux/of_fdt.h> 23#include <linux/of_fdt.h>
24#include <linux/root_dev.h>
25#include <linux/cpu.h> 24#include <linux/cpu.h>
26#include <linux/interrupt.h> 25#include <linux/interrupt.h>
27#include <linux/smp.h> 26#include <linux/smp.h>
28#include <linux/fs.h>
29#include <linux/proc_fs.h> 27#include <linux/proc_fs.h>
30#include <linux/memblock.h> 28#include <linux/memblock.h>
31#include <linux/bug.h> 29#include <linux/bug.h>
@@ -55,16 +53,11 @@
55#include <asm/traps.h> 53#include <asm/traps.h>
56#include <asm/unwind.h> 54#include <asm/unwind.h>
57#include <asm/memblock.h> 55#include <asm/memblock.h>
56#include <asm/virt.h>
58 57
59#if defined(CONFIG_DEPRECATED_PARAM_STRUCT)
60#include "compat.h"
61#endif
62#include "atags.h" 58#include "atags.h"
63#include "tcm.h" 59#include "tcm.h"
64 60
65#ifndef MEM_SIZE
66#define MEM_SIZE (16*1024*1024)
67#endif
68 61
69#if defined(CONFIG_FPE_NWFPE) || defined(CONFIG_FPE_FASTFPE) 62#if defined(CONFIG_FPE_NWFPE) || defined(CONFIG_FPE_FASTFPE)
70char fpe_type[8]; 63char fpe_type[8];
@@ -145,7 +138,6 @@ static const char *machine_name;
145static char __initdata cmd_line[COMMAND_LINE_SIZE]; 138static char __initdata cmd_line[COMMAND_LINE_SIZE];
146struct machine_desc *machine_desc __initdata; 139struct machine_desc *machine_desc __initdata;
147 140
148static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
149static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } }; 141static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
150#define ENDIANNESS ((char)endian_test.l) 142#define ENDIANNESS ((char)endian_test.l)
151 143
@@ -583,21 +575,6 @@ static int __init early_mem(char *p)
583} 575}
584early_param("mem", early_mem); 576early_param("mem", early_mem);
585 577
586static void __init
587setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz)
588{
589#ifdef CONFIG_BLK_DEV_RAM
590 extern int rd_size, rd_image_start, rd_prompt, rd_doload;
591
592 rd_image_start = image_start;
593 rd_prompt = prompt;
594 rd_doload = doload;
595
596 if (rd_sz)
597 rd_size = rd_sz;
598#endif
599}
600
601static void __init request_standard_resources(struct machine_desc *mdesc) 578static void __init request_standard_resources(struct machine_desc *mdesc)
602{ 579{
603 struct memblock_region *region; 580 struct memblock_region *region;
@@ -643,35 +620,6 @@ static void __init request_standard_resources(struct machine_desc *mdesc)
643 request_resource(&ioport_resource, &lp2); 620 request_resource(&ioport_resource, &lp2);
644} 621}
645 622
646/*
647 * Tag parsing.
648 *
649 * This is the new way of passing data to the kernel at boot time. Rather
650 * than passing a fixed inflexible structure to the kernel, we pass a list
651 * of variable-sized tags to the kernel. The first tag must be a ATAG_CORE
652 * tag for the list to be recognised (to distinguish the tagged list from
653 * a param_struct). The list is terminated with a zero-length tag (this tag
654 * is not parsed in any way).
655 */
656static int __init parse_tag_core(const struct tag *tag)
657{
658 if (tag->hdr.size > 2) {
659 if ((tag->u.core.flags & 1) == 0)
660 root_mountflags &= ~MS_RDONLY;
661 ROOT_DEV = old_decode_dev(tag->u.core.rootdev);
662 }
663 return 0;
664}
665
666__tagtable(ATAG_CORE, parse_tag_core);
667
668static int __init parse_tag_mem32(const struct tag *tag)
669{
670 return arm_add_memory(tag->u.mem.start, tag->u.mem.size);
671}
672
673__tagtable(ATAG_MEM, parse_tag_mem32);
674
675#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) 623#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
676struct screen_info screen_info = { 624struct screen_info screen_info = {
677 .orig_video_lines = 30, 625 .orig_video_lines = 30,
@@ -681,117 +629,8 @@ struct screen_info screen_info = {
681 .orig_video_isVGA = 1, 629 .orig_video_isVGA = 1,
682 .orig_video_points = 8 630 .orig_video_points = 8
683}; 631};
684
685static int __init parse_tag_videotext(const struct tag *tag)
686{
687 screen_info.orig_x = tag->u.videotext.x;
688 screen_info.orig_y = tag->u.videotext.y;
689 screen_info.orig_video_page = tag->u.videotext.video_page;
690 screen_info.orig_video_mode = tag->u.videotext.video_mode;
691 screen_info.orig_video_cols = tag->u.videotext.video_cols;
692 screen_info.orig_video_ega_bx = tag->u.videotext.video_ega_bx;
693 screen_info.orig_video_lines = tag->u.videotext.video_lines;
694 screen_info.orig_video_isVGA = tag->u.videotext.video_isvga;
695 screen_info.orig_video_points = tag->u.videotext.video_points;
696 return 0;
697}
698
699__tagtable(ATAG_VIDEOTEXT, parse_tag_videotext);
700#endif 632#endif
701 633
702static int __init parse_tag_ramdisk(const struct tag *tag)
703{
704 setup_ramdisk((tag->u.ramdisk.flags & 1) == 0,
705 (tag->u.ramdisk.flags & 2) == 0,
706 tag->u.ramdisk.start, tag->u.ramdisk.size);
707 return 0;
708}
709
710__tagtable(ATAG_RAMDISK, parse_tag_ramdisk);
711
712static int __init parse_tag_serialnr(const struct tag *tag)
713{
714 system_serial_low = tag->u.serialnr.low;
715 system_serial_high = tag->u.serialnr.high;
716 return 0;
717}
718
719__tagtable(ATAG_SERIAL, parse_tag_serialnr);
720
721static int __init parse_tag_revision(const struct tag *tag)
722{
723 system_rev = tag->u.revision.rev;
724 return 0;
725}
726
727__tagtable(ATAG_REVISION, parse_tag_revision);
728
729static int __init parse_tag_cmdline(const struct tag *tag)
730{
731#if defined(CONFIG_CMDLINE_EXTEND)
732 strlcat(default_command_line, " ", COMMAND_LINE_SIZE);
733 strlcat(default_command_line, tag->u.cmdline.cmdline,
734 COMMAND_LINE_SIZE);
735#elif defined(CONFIG_CMDLINE_FORCE)
736 pr_warning("Ignoring tag cmdline (using the default kernel command line)\n");
737#else
738 strlcpy(default_command_line, tag->u.cmdline.cmdline,
739 COMMAND_LINE_SIZE);
740#endif
741 return 0;
742}
743
744__tagtable(ATAG_CMDLINE, parse_tag_cmdline);
745
746/*
747 * Scan the tag table for this tag, and call its parse function.
748 * The tag table is built by the linker from all the __tagtable
749 * declarations.
750 */
751static int __init parse_tag(const struct tag *tag)
752{
753 extern struct tagtable __tagtable_begin, __tagtable_end;
754 struct tagtable *t;
755
756 for (t = &__tagtable_begin; t < &__tagtable_end; t++)
757 if (tag->hdr.tag == t->tag) {
758 t->parse(tag);
759 break;
760 }
761
762 return t < &__tagtable_end;
763}
764
765/*
766 * Parse all tags in the list, checking both the global and architecture
767 * specific tag tables.
768 */
769static void __init parse_tags(const struct tag *t)
770{
771 for (; t->hdr.size; t = tag_next(t))
772 if (!parse_tag(t))
773 printk(KERN_WARNING
774 "Ignoring unrecognised tag 0x%08x\n",
775 t->hdr.tag);
776}
777
778/*
779 * This holds our defaults.
780 */
781static struct init_tags {
782 struct tag_header hdr1;
783 struct tag_core core;
784 struct tag_header hdr2;
785 struct tag_mem32 mem;
786 struct tag_header hdr3;
787} init_tags __initdata = {
788 { tag_size(tag_core), ATAG_CORE },
789 { 1, PAGE_SIZE, 0xff },
790 { tag_size(tag_mem32), ATAG_MEM },
791 { MEM_SIZE },
792 { 0, ATAG_NONE }
793};
794
795static int __init customize_machine(void) 634static int __init customize_machine(void)
796{ 635{
797 /* customizes platform devices, or adds new ones */ 636 /* customizes platform devices, or adds new ones */
@@ -858,78 +697,6 @@ static void __init reserve_crashkernel(void)
858static inline void reserve_crashkernel(void) {} 697static inline void reserve_crashkernel(void) {}
859#endif /* CONFIG_KEXEC */ 698#endif /* CONFIG_KEXEC */
860 699
861static void __init squash_mem_tags(struct tag *tag)
862{
863 for (; tag->hdr.size; tag = tag_next(tag))
864 if (tag->hdr.tag == ATAG_MEM)
865 tag->hdr.tag = ATAG_NONE;
866}
867
868static struct machine_desc * __init setup_machine_tags(unsigned int nr)
869{
870 struct tag *tags = (struct tag *)&init_tags;
871 struct machine_desc *mdesc = NULL, *p;
872 char *from = default_command_line;
873
874 init_tags.mem.start = PHYS_OFFSET;
875
876 /*
877 * locate machine in the list of supported machines.
878 */
879 for_each_machine_desc(p)
880 if (nr == p->nr) {
881 printk("Machine: %s\n", p->name);
882 mdesc = p;
883 break;
884 }
885
886 if (!mdesc) {
887 early_print("\nError: unrecognized/unsupported machine ID"
888 " (r1 = 0x%08x).\n\n", nr);
889 dump_machine_table(); /* does not return */
890 }
891
892 if (__atags_pointer)
893 tags = phys_to_virt(__atags_pointer);
894 else if (mdesc->atag_offset)
895 tags = (void *)(PAGE_OFFSET + mdesc->atag_offset);
896
897#if defined(CONFIG_DEPRECATED_PARAM_STRUCT)
898 /*
899 * If we have the old style parameters, convert them to
900 * a tag list.
901 */
902 if (tags->hdr.tag != ATAG_CORE)
903 convert_to_tag_list(tags);
904#endif
905
906 if (tags->hdr.tag != ATAG_CORE) {
907#if defined(CONFIG_OF)
908 /*
909 * If CONFIG_OF is set, then assume this is a reasonably
910 * modern system that should pass boot parameters
911 */
912 early_print("Warning: Neither atags nor dtb found\n");
913#endif
914 tags = (struct tag *)&init_tags;
915 }
916
917 if (mdesc->fixup)
918 mdesc->fixup(tags, &from, &meminfo);
919
920 if (tags->hdr.tag == ATAG_CORE) {
921 if (meminfo.nr_banks != 0)
922 squash_mem_tags(tags);
923 save_atags(tags);
924 parse_tags(tags);
925 }
926
927 /* parse_early_param needs a boot_command_line */
928 strlcpy(boot_command_line, from, COMMAND_LINE_SIZE);
929
930 return mdesc;
931}
932
933static int __init meminfo_cmp(const void *_a, const void *_b) 700static int __init meminfo_cmp(const void *_a, const void *_b)
934{ 701{
935 const struct membank *a = _a, *b = _b; 702 const struct membank *a = _a, *b = _b;
@@ -937,6 +704,21 @@ static int __init meminfo_cmp(const void *_a, const void *_b)
937 return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; 704 return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
938} 705}
939 706
707void __init hyp_mode_check(void)
708{
709#ifdef CONFIG_ARM_VIRT_EXT
710 if (is_hyp_mode_available()) {
711 pr_info("CPU: All CPU(s) started in HYP mode.\n");
712 pr_info("CPU: Virtualization extensions available.\n");
713 } else if (is_hyp_mode_mismatched()) {
714 pr_warn("CPU: WARNING: CPU(s) started in wrong/inconsistent modes (primary CPU mode 0x%x)\n",
715 __boot_cpu_mode & MODE_MASK);
716 pr_warn("CPU: This may indicate a broken bootloader or firmware.\n");
717 } else
718 pr_info("CPU: All CPU(s) started in SVC mode.\n");
719#endif
720}
721
940void __init setup_arch(char **cmdline_p) 722void __init setup_arch(char **cmdline_p)
941{ 723{
942 struct machine_desc *mdesc; 724 struct machine_desc *mdesc;
@@ -944,7 +726,7 @@ void __init setup_arch(char **cmdline_p)
944 setup_processor(); 726 setup_processor();
945 mdesc = setup_machine_fdt(__atags_pointer); 727 mdesc = setup_machine_fdt(__atags_pointer);
946 if (!mdesc) 728 if (!mdesc)
947 mdesc = setup_machine_tags(machine_arch_type); 729 mdesc = setup_machine_tags(__atags_pointer, machine_arch_type);
948 machine_desc = mdesc; 730 machine_desc = mdesc;
949 machine_name = mdesc->name; 731 machine_name = mdesc->name;
950 732
@@ -977,9 +759,15 @@ void __init setup_arch(char **cmdline_p)
977 unflatten_device_tree(); 759 unflatten_device_tree();
978 760
979#ifdef CONFIG_SMP 761#ifdef CONFIG_SMP
980 if (is_smp()) 762 if (is_smp()) {
763 smp_set_ops(mdesc->smp);
981 smp_init_cpus(); 764 smp_init_cpus();
765 }
982#endif 766#endif
767
768 if (!is_smp())
769 hyp_mode_check();
770
983 reserve_crashkernel(); 771 reserve_crashkernel();
984 772
985 tcm_init(); 773 tcm_init();
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index f27789e4e38..56f72d257eb 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -10,7 +10,6 @@
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/signal.h> 11#include <linux/signal.h>
12#include <linux/personality.h> 12#include <linux/personality.h>
13#include <linux/freezer.h>
14#include <linux/uaccess.h> 13#include <linux/uaccess.h>
15#include <linux/tracehook.h> 14#include <linux/tracehook.h>
16 15
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index ebd8ad274d7..8e20754dd31 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -19,14 +19,15 @@
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/err.h> 20#include <linux/err.h>
21#include <linux/cpu.h> 21#include <linux/cpu.h>
22#include <linux/smp.h>
23#include <linux/seq_file.h> 22#include <linux/seq_file.h>
24#include <linux/irq.h> 23#include <linux/irq.h>
25#include <linux/percpu.h> 24#include <linux/percpu.h>
26#include <linux/clockchips.h> 25#include <linux/clockchips.h>
27#include <linux/completion.h> 26#include <linux/completion.h>
27#include <linux/cpufreq.h>
28 28
29#include <linux/atomic.h> 29#include <linux/atomic.h>
30#include <asm/smp.h>
30#include <asm/cacheflush.h> 31#include <asm/cacheflush.h>
31#include <asm/cpu.h> 32#include <asm/cpu.h>
32#include <asm/cputype.h> 33#include <asm/cputype.h>
@@ -42,6 +43,8 @@
42#include <asm/ptrace.h> 43#include <asm/ptrace.h>
43#include <asm/localtimer.h> 44#include <asm/localtimer.h>
44#include <asm/smp_plat.h> 45#include <asm/smp_plat.h>
46#include <asm/virt.h>
47#include <asm/mach/arch.h>
45 48
46/* 49/*
47 * as from 2.5, kernels no longer have an init_tasks structure 50 * as from 2.5, kernels no longer have an init_tasks structure
@@ -50,8 +53,15 @@
50 */ 53 */
51struct secondary_data secondary_data; 54struct secondary_data secondary_data;
52 55
56/*
57 * control for which core is the next to come out of the secondary
58 * boot "holding pen"
59 */
60volatile int __cpuinitdata pen_release = -1;
61
53enum ipi_msg_type { 62enum ipi_msg_type {
54 IPI_TIMER = 2, 63 IPI_WAKEUP,
64 IPI_TIMER,
55 IPI_RESCHEDULE, 65 IPI_RESCHEDULE,
56 IPI_CALL_FUNC, 66 IPI_CALL_FUNC,
57 IPI_CALL_FUNC_SINGLE, 67 IPI_CALL_FUNC_SINGLE,
@@ -60,6 +70,14 @@ enum ipi_msg_type {
60 70
61static DECLARE_COMPLETION(cpu_running); 71static DECLARE_COMPLETION(cpu_running);
62 72
73static struct smp_operations smp_ops;
74
75void __init smp_set_ops(struct smp_operations *ops)
76{
77 if (ops)
78 smp_ops = *ops;
79};
80
63int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) 81int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle)
64{ 82{
65 int ret; 83 int ret;
@@ -100,13 +118,64 @@ int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle)
100 return ret; 118 return ret;
101} 119}
102 120
121/* platform specific SMP operations */
122void __init smp_init_cpus(void)
123{
124 if (smp_ops.smp_init_cpus)
125 smp_ops.smp_init_cpus();
126}
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)
141{
142 if (smp_ops.smp_boot_secondary)
143 return smp_ops.smp_boot_secondary(cpu, idle);
144 return -ENOSYS;
145}
146
103#ifdef CONFIG_HOTPLUG_CPU 147#ifdef CONFIG_HOTPLUG_CPU
104static void percpu_timer_stop(void); 148static void percpu_timer_stop(void);
105 149
150static int platform_cpu_kill(unsigned int cpu)
151{
152 if (smp_ops.cpu_kill)
153 return smp_ops.cpu_kill(cpu);
154 return 1;
155}
156
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)
164{
165 if (smp_ops.cpu_disable)
166 return smp_ops.cpu_disable(cpu);
167
168 /*
169 * By default, allow disabling all CPUs except the first one,
170 * since this is special on a lot of platforms, e.g. because
171 * of clock tick interrupts.
172 */
173 return cpu == 0 ? -EPERM : 0;
174}
106/* 175/*
107 * __cpu_disable runs on the processor to be shutdown. 176 * __cpu_disable runs on the processor to be shutdown.
108 */ 177 */
109int __cpu_disable(void) 178int __cpuinit __cpu_disable(void)
110{ 179{
111 unsigned int cpu = smp_processor_id(); 180 unsigned int cpu = smp_processor_id();
112 int ret; 181 int ret;
@@ -134,8 +203,11 @@ int __cpu_disable(void)
134 /* 203 /*
135 * Flush user cache and TLB mappings, and then remove this CPU 204 * Flush user cache and TLB mappings, and then remove this CPU
136 * from the vm mask set of all processes. 205 * from the vm mask set of all processes.
206 *
207 * Caches are flushed to the Level of Unification Inner Shareable
208 * to write-back dirty lines to unified caches shared by all CPUs.
137 */ 209 */
138 flush_cache_all(); 210 flush_cache_louis();
139 local_flush_tlb_all(); 211 local_flush_tlb_all();
140 212
141 clear_tasks_mm_cpumask(cpu); 213 clear_tasks_mm_cpumask(cpu);
@@ -149,7 +221,7 @@ static DECLARE_COMPLETION(cpu_died);
149 * called on the thread which is asking for a CPU to be shutdown - 221 * called on the thread which is asking for a CPU to be shutdown -
150 * waits until shutdown has completed, or it is timed out. 222 * waits until shutdown has completed, or it is timed out.
151 */ 223 */
152void __cpu_die(unsigned int cpu) 224void __cpuinit __cpu_die(unsigned int cpu)
153{ 225{
154 if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) { 226 if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) {
155 pr_err("CPU%u: cpu didn't die\n", cpu); 227 pr_err("CPU%u: cpu didn't die\n", cpu);
@@ -287,6 +359,8 @@ void __init smp_cpus_done(unsigned int max_cpus)
287 num_online_cpus(), 359 num_online_cpus(),
288 bogosum / (500000/HZ), 360 bogosum / (500000/HZ),
289 (bogosum / (5000/HZ)) % 100); 361 (bogosum / (5000/HZ)) % 100);
362
363 hyp_mode_check();
290} 364}
291 365
292void __init smp_prepare_boot_cpu(void) 366void __init smp_prepare_boot_cpu(void)
@@ -347,7 +421,8 @@ void arch_send_call_function_single_ipi(int cpu)
347} 421}
348 422
349static const char *ipi_types[NR_IPI] = { 423static const char *ipi_types[NR_IPI] = {
350#define S(x,s) [x - IPI_TIMER] = s 424#define S(x,s) [x] = s
425 S(IPI_WAKEUP, "CPU wakeup interrupts"),
351 S(IPI_TIMER, "Timer broadcast interrupts"), 426 S(IPI_TIMER, "Timer broadcast interrupts"),
352 S(IPI_RESCHEDULE, "Rescheduling interrupts"), 427 S(IPI_RESCHEDULE, "Rescheduling interrupts"),
353 S(IPI_CALL_FUNC, "Function call interrupts"), 428 S(IPI_CALL_FUNC, "Function call interrupts"),
@@ -500,10 +575,13 @@ void handle_IPI(int ipinr, struct pt_regs *regs)
500 unsigned int cpu = smp_processor_id(); 575 unsigned int cpu = smp_processor_id();
501 struct pt_regs *old_regs = set_irq_regs(regs); 576 struct pt_regs *old_regs = set_irq_regs(regs);
502 577
503 if (ipinr >= IPI_TIMER && ipinr < IPI_TIMER + NR_IPI) 578 if (ipinr < NR_IPI)
504 __inc_irq_stat(cpu, ipi_irqs[ipinr - IPI_TIMER]); 579 __inc_irq_stat(cpu, ipi_irqs[ipinr]);
505 580
506 switch (ipinr) { 581 switch (ipinr) {
582 case IPI_WAKEUP:
583 break;
584
507 case IPI_TIMER: 585 case IPI_TIMER:
508 irq_enter(); 586 irq_enter();
509 ipi_timer(); 587 ipi_timer();
@@ -584,3 +662,56 @@ int setup_profiling_timer(unsigned int multiplier)
584{ 662{
585 return -EINVAL; 663 return -EINVAL;
586} 664}
665
666#ifdef CONFIG_CPU_FREQ
667
668static DEFINE_PER_CPU(unsigned long, l_p_j_ref);
669static DEFINE_PER_CPU(unsigned long, l_p_j_ref_freq);
670static unsigned long global_l_p_j_ref;
671static unsigned long global_l_p_j_ref_freq;
672
673static int cpufreq_callback(struct notifier_block *nb,
674 unsigned long val, void *data)
675{
676 struct cpufreq_freqs *freq = data;
677 int cpu = freq->cpu;
678
679 if (freq->flags & CPUFREQ_CONST_LOOPS)
680 return NOTIFY_OK;
681
682 if (!per_cpu(l_p_j_ref, cpu)) {
683 per_cpu(l_p_j_ref, cpu) =
684 per_cpu(cpu_data, cpu).loops_per_jiffy;
685 per_cpu(l_p_j_ref_freq, cpu) = freq->old;
686 if (!global_l_p_j_ref) {
687 global_l_p_j_ref = loops_per_jiffy;
688 global_l_p_j_ref_freq = freq->old;
689 }
690 }
691
692 if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
693 (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
694 (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) {
695 loops_per_jiffy = cpufreq_scale(global_l_p_j_ref,
696 global_l_p_j_ref_freq,
697 freq->new);
698 per_cpu(cpu_data, cpu).loops_per_jiffy =
699 cpufreq_scale(per_cpu(l_p_j_ref, cpu),
700 per_cpu(l_p_j_ref_freq, cpu),
701 freq->new);
702 }
703 return NOTIFY_OK;
704}
705
706static struct notifier_block cpufreq_notifier = {
707 .notifier_call = cpufreq_callback,
708};
709
710static int __init register_cpufreq_notifier(void)
711{
712 return cpufreq_register_notifier(&cpufreq_notifier,
713 CPUFREQ_TRANSITION_NOTIFIER);
714}
715core_initcall(register_cpufreq_notifier);
716
717#endif
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index fef42b21cec..e1f906989bb 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -11,7 +11,6 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/cpufreq.h>
15#include <linux/delay.h> 14#include <linux/delay.h>
16#include <linux/device.h> 15#include <linux/device.h>
17#include <linux/err.h> 16#include <linux/err.h>
@@ -96,7 +95,52 @@ static void twd_timer_stop(struct clock_event_device *clk)
96 disable_percpu_irq(clk->irq); 95 disable_percpu_irq(clk->irq);
97} 96}
98 97
99#ifdef CONFIG_CPU_FREQ 98#ifdef CONFIG_COMMON_CLK
99
100/*
101 * Updates clockevent frequency when the cpu frequency changes.
102 * Called on the cpu that is changing frequency with interrupts disabled.
103 */
104static void twd_update_frequency(void *new_rate)
105{
106 twd_timer_rate = *((unsigned long *) new_rate);
107
108 clockevents_update_freq(*__this_cpu_ptr(twd_evt), twd_timer_rate);
109}
110
111static int twd_rate_change(struct notifier_block *nb,
112 unsigned long flags, void *data)
113{
114 struct clk_notifier_data *cnd = data;
115
116 /*
117 * The twd clock events must be reprogrammed to account for the new
118 * frequency. The timer is local to a cpu, so cross-call to the
119 * changing cpu.
120 */
121 if (flags == POST_RATE_CHANGE)
122 smp_call_function(twd_update_frequency,
123 (void *)&cnd->new_rate, 1);
124
125 return NOTIFY_OK;
126}
127
128static struct notifier_block twd_clk_nb = {
129 .notifier_call = twd_rate_change,
130};
131
132static int twd_clk_init(void)
133{
134 if (twd_evt && *__this_cpu_ptr(twd_evt) && !IS_ERR(twd_clk))
135 return clk_notifier_register(twd_clk, &twd_clk_nb);
136
137 return 0;
138}
139core_initcall(twd_clk_init);
140
141#elif defined (CONFIG_CPU_FREQ)
142
143#include <linux/cpufreq.h>
100 144
101/* 145/*
102 * Updates clockevent frequency when the cpu frequency changes. 146 * Updates clockevent frequency when the cpu frequency changes.
diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c
index 1794cc3b0f1..358bca3a995 100644
--- a/arch/arm/kernel/suspend.c
+++ b/arch/arm/kernel/suspend.c
@@ -17,6 +17,8 @@ extern void cpu_resume_mmu(void);
17 */ 17 */
18void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr) 18void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
19{ 19{
20 u32 *ctx = ptr;
21
20 *save_ptr = virt_to_phys(ptr); 22 *save_ptr = virt_to_phys(ptr);
21 23
22 /* This must correspond to the LDM in cpu_resume() assembly */ 24 /* This must correspond to the LDM in cpu_resume() assembly */
@@ -26,7 +28,20 @@ void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
26 28
27 cpu_do_suspend(ptr); 29 cpu_do_suspend(ptr);
28 30
29 flush_cache_all(); 31 flush_cache_louis();
32
33 /*
34 * flush_cache_louis does not guarantee that
35 * save_ptr and ptr are cleaned to main memory,
36 * just up to the Level of Unification Inner Shareable.
37 * Since the context pointer and context itself
38 * are to be retrieved with the MMU off that
39 * data must be cleaned from all cache levels
40 * to main memory using "area" cache primitives.
41 */
42 __cpuc_flush_dcache_area(ctx, ptrsz);
43 __cpuc_flush_dcache_area(save_ptr, sizeof(*save_ptr));
44
30 outer_clean_range(*save_ptr, *save_ptr + ptrsz); 45 outer_clean_range(*save_ptr, *save_ptr + ptrsz);
31 outer_clean_range(virt_to_phys(save_ptr), 46 outer_clean_range(virt_to_phys(save_ptr),
32 virt_to_phys(save_ptr) + sizeof(*save_ptr)); 47 virt_to_phys(save_ptr) + sizeof(*save_ptr));
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 76cbb055dd0..c2a898aa57a 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -59,69 +59,6 @@ asmlinkage int sys_vfork(struct pt_regs *regs)
59 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL); 59 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL);
60} 60}
61 61
62/* sys_execve() executes a new program.
63 * This is called indirectly via a small wrapper
64 */
65asmlinkage int sys_execve(const char __user *filenamei,
66 const char __user *const __user *argv,
67 const char __user *const __user *envp, struct pt_regs *regs)
68{
69 int error;
70 char * filename;
71
72 filename = getname(filenamei);
73 error = PTR_ERR(filename);
74 if (IS_ERR(filename))
75 goto out;
76 error = do_execve(filename, argv, envp, regs);
77 putname(filename);
78out:
79 return error;
80}
81
82int kernel_execve(const char *filename,
83 const char *const argv[],
84 const char *const envp[])
85{
86 struct pt_regs regs;
87 int ret;
88
89 memset(&regs, 0, sizeof(struct pt_regs));
90 ret = do_execve(filename,
91 (const char __user *const __user *)argv,
92 (const char __user *const __user *)envp, &regs);
93 if (ret < 0)
94 goto out;
95
96 /*
97 * Save argc to the register structure for userspace.
98 */
99 regs.ARM_r0 = ret;
100
101 /*
102 * We were successful. We won't be returning to our caller, but
103 * instead to user space by manipulating the kernel stack.
104 */
105 asm( "add r0, %0, %1\n\t"
106 "mov r1, %2\n\t"
107 "mov r2, %3\n\t"
108 "bl memmove\n\t" /* copy regs to top of stack */
109 "mov r8, #0\n\t" /* not a syscall */
110 "mov r9, %0\n\t" /* thread structure */
111 "mov sp, r0\n\t" /* reposition stack pointer */
112 "b ret_to_user"
113 :
114 : "r" (current_thread_info()),
115 "Ir" (THREAD_START_SP - sizeof(regs)),
116 "r" (&regs),
117 "Ir" (sizeof(regs))
118 : "r0", "r1", "r2", "r3", "r8", "r9", "ip", "lr", "memory");
119
120 out:
121 return ret;
122}
123EXPORT_SYMBOL(kernel_execve);
124
125/* 62/*
126 * Since loff_t is a 64 bit type we avoid a lot of ABI hassle 63 * Since loff_t is a 64 bit type we avoid a lot of ABI hassle
127 * with a different argument ordering. 64 * with a different argument ordering.
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index af2afb01967..09be0c3c906 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -25,7 +25,6 @@
25#include <linux/timer.h> 25#include <linux/timer.h>
26#include <linux/irq.h> 26#include <linux/irq.h>
27 27
28#include <asm/leds.h>
29#include <asm/thread_info.h> 28#include <asm/thread_info.h>
30#include <asm/sched_clock.h> 29#include <asm/sched_clock.h>
31#include <asm/stacktrace.h> 30#include <asm/stacktrace.h>
@@ -80,21 +79,6 @@ u32 arch_gettimeoffset(void)
80} 79}
81#endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */ 80#endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */
82 81
83#ifdef CONFIG_LEDS_TIMER
84static inline void do_leds(void)
85{
86 static unsigned int count = HZ/2;
87
88 if (--count == 0) {
89 count = HZ/2;
90 leds_event(led_timer);
91 }
92}
93#else
94#define do_leds()
95#endif
96
97
98#ifndef CONFIG_GENERIC_CLOCKEVENTS 82#ifndef CONFIG_GENERIC_CLOCKEVENTS
99/* 83/*
100 * Kernel system timer support. 84 * Kernel system timer support.
@@ -102,7 +86,6 @@ static inline void do_leds(void)
102void timer_tick(void) 86void timer_tick(void)
103{ 87{
104 profile_tick(CPU_PROFILING); 88 profile_tick(CPU_PROFILING);
105 do_leds();
106 xtime_update(1); 89 xtime_update(1);
107#ifndef CONFIG_SMP 90#ifndef CONFIG_SMP
108 update_process_times(user_mode(get_irq_regs())); 91 update_process_times(user_mode(get_irq_regs()));
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index f7945218b8c..b0179b89a04 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -420,20 +420,23 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
420#endif 420#endif
421 instr = *(u32 *) pc; 421 instr = *(u32 *) pc;
422 } else if (thumb_mode(regs)) { 422 } else if (thumb_mode(regs)) {
423 get_user(instr, (u16 __user *)pc); 423 if (get_user(instr, (u16 __user *)pc))
424 goto die_sig;
424 if (is_wide_instruction(instr)) { 425 if (is_wide_instruction(instr)) {
425 unsigned int instr2; 426 unsigned int instr2;
426 get_user(instr2, (u16 __user *)pc+1); 427 if (get_user(instr2, (u16 __user *)pc+1))
428 goto die_sig;
427 instr <<= 16; 429 instr <<= 16;
428 instr |= instr2; 430 instr |= instr2;
429 } 431 }
430 } else { 432 } else if (get_user(instr, (u32 __user *)pc)) {
431 get_user(instr, (u32 __user *)pc); 433 goto die_sig;
432 } 434 }
433 435
434 if (call_undef_hook(regs, instr) == 0) 436 if (call_undef_hook(regs, instr) == 0)
435 return; 437 return;
436 438
439die_sig:
437#ifdef CONFIG_DEBUG_USER 440#ifdef CONFIG_DEBUG_USER
438 if (user_debug & UDBG_UNDEFINED) { 441 if (user_debug & UDBG_UNDEFINED) {
439 printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n", 442 printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n",
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c
index d6dacc69254..9d0a30032d7 100644
--- a/arch/arm/lib/delay.c
+++ b/arch/arm/lib/delay.c
@@ -34,7 +34,18 @@ struct arm_delay_ops arm_delay_ops = {
34 .udelay = __loop_udelay, 34 .udelay = __loop_udelay,
35}; 35};
36 36
37#ifdef ARCH_HAS_READ_CURRENT_TIMER 37static const struct delay_timer *delay_timer;
38static bool delay_calibrated;
39
40int read_current_timer(unsigned long *timer_val)
41{
42 if (!delay_timer)
43 return -ENXIO;
44
45 *timer_val = delay_timer->read_current_timer();
46 return 0;
47}
48
38static void __timer_delay(unsigned long cycles) 49static void __timer_delay(unsigned long cycles)
39{ 50{
40 cycles_t start = get_cycles(); 51 cycles_t start = get_cycles();
@@ -55,17 +66,24 @@ static void __timer_udelay(unsigned long usecs)
55 __timer_const_udelay(usecs * UDELAY_MULT); 66 __timer_const_udelay(usecs * UDELAY_MULT);
56} 67}
57 68
58void __init init_current_timer_delay(unsigned long freq) 69void __init register_current_timer_delay(const struct delay_timer *timer)
59{ 70{
60 pr_info("Switching to timer-based delay loop\n"); 71 if (!delay_calibrated) {
61 lpj_fine = freq / HZ; 72 pr_info("Switching to timer-based delay loop\n");
62 arm_delay_ops.delay = __timer_delay; 73 delay_timer = timer;
63 arm_delay_ops.const_udelay = __timer_const_udelay; 74 lpj_fine = timer->freq / HZ;
64 arm_delay_ops.udelay = __timer_udelay; 75 loops_per_jiffy = lpj_fine;
76 arm_delay_ops.delay = __timer_delay;
77 arm_delay_ops.const_udelay = __timer_const_udelay;
78 arm_delay_ops.udelay = __timer_udelay;
79 delay_calibrated = true;
80 } else {
81 pr_info("Ignoring duplicate/late registration of read_current_timer delay\n");
82 }
65} 83}
66 84
67unsigned long __cpuinit calibrate_delay_is_known(void) 85unsigned long __cpuinit calibrate_delay_is_known(void)
68{ 86{
87 delay_calibrated = true;
69 return lpj_fine; 88 return lpj_fine;
70} 89}
71#endif
diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S
index 11093a7c3e3..9b06bb41fca 100644
--- a/arch/arm/lib/getuser.S
+++ b/arch/arm/lib/getuser.S
@@ -16,8 +16,9 @@
16 * __get_user_X 16 * __get_user_X
17 * 17 *
18 * Inputs: r0 contains the address 18 * Inputs: r0 contains the address
19 * r1 contains the address limit, which must be preserved
19 * Outputs: r0 is the error code 20 * Outputs: r0 is the error code
20 * r2, r3 contains the zero-extended value 21 * r2 contains the zero-extended value
21 * lr corrupted 22 * lr corrupted
22 * 23 *
23 * No other registers must be altered. (see <asm/uaccess.h> 24 * No other registers must be altered. (see <asm/uaccess.h>
@@ -27,33 +28,39 @@
27 * Note also that it is intended that __get_user_bad is not global. 28 * Note also that it is intended that __get_user_bad is not global.
28 */ 29 */
29#include <linux/linkage.h> 30#include <linux/linkage.h>
31#include <asm/assembler.h>
30#include <asm/errno.h> 32#include <asm/errno.h>
31#include <asm/domain.h> 33#include <asm/domain.h>
32 34
33ENTRY(__get_user_1) 35ENTRY(__get_user_1)
36 check_uaccess r0, 1, r1, r2, __get_user_bad
341: TUSER(ldrb) r2, [r0] 371: TUSER(ldrb) r2, [r0]
35 mov r0, #0 38 mov r0, #0
36 mov pc, lr 39 mov pc, lr
37ENDPROC(__get_user_1) 40ENDPROC(__get_user_1)
38 41
39ENTRY(__get_user_2) 42ENTRY(__get_user_2)
40#ifdef CONFIG_THUMB2_KERNEL 43 check_uaccess r0, 2, r1, r2, __get_user_bad
412: TUSER(ldrb) r2, [r0] 44#ifdef CONFIG_CPU_USE_DOMAINS
423: TUSER(ldrb) r3, [r0, #1] 45rb .req ip
462: ldrbt r2, [r0], #1
473: ldrbt rb, [r0], #0
43#else 48#else
442: TUSER(ldrb) r2, [r0], #1 49rb .req r0
453: TUSER(ldrb) r3, [r0] 502: ldrb r2, [r0]
513: ldrb rb, [r0, #1]
46#endif 52#endif
47#ifndef __ARMEB__ 53#ifndef __ARMEB__
48 orr r2, r2, r3, lsl #8 54 orr r2, r2, rb, lsl #8
49#else 55#else
50 orr r2, r3, r2, lsl #8 56 orr r2, rb, r2, lsl #8
51#endif 57#endif
52 mov r0, #0 58 mov r0, #0
53 mov pc, lr 59 mov pc, lr
54ENDPROC(__get_user_2) 60ENDPROC(__get_user_2)
55 61
56ENTRY(__get_user_4) 62ENTRY(__get_user_4)
63 check_uaccess r0, 4, r1, r2, __get_user_bad
574: TUSER(ldr) r2, [r0] 644: TUSER(ldr) r2, [r0]
58 mov r0, #0 65 mov r0, #0
59 mov pc, lr 66 mov pc, lr
diff --git a/arch/arm/lib/putuser.S b/arch/arm/lib/putuser.S
index 7db25990c58..3d73dcb959b 100644
--- a/arch/arm/lib/putuser.S
+++ b/arch/arm/lib/putuser.S
@@ -16,6 +16,7 @@
16 * __put_user_X 16 * __put_user_X
17 * 17 *
18 * Inputs: r0 contains the address 18 * Inputs: r0 contains the address
19 * r1 contains the address limit, which must be preserved
19 * r2, r3 contains the value 20 * r2, r3 contains the value
20 * Outputs: r0 is the error code 21 * Outputs: r0 is the error code
21 * lr corrupted 22 * lr corrupted
@@ -27,16 +28,19 @@
27 * Note also that it is intended that __put_user_bad is not global. 28 * Note also that it is intended that __put_user_bad is not global.
28 */ 29 */
29#include <linux/linkage.h> 30#include <linux/linkage.h>
31#include <asm/assembler.h>
30#include <asm/errno.h> 32#include <asm/errno.h>
31#include <asm/domain.h> 33#include <asm/domain.h>
32 34
33ENTRY(__put_user_1) 35ENTRY(__put_user_1)
36 check_uaccess r0, 1, r1, ip, __put_user_bad
341: TUSER(strb) r2, [r0] 371: TUSER(strb) r2, [r0]
35 mov r0, #0 38 mov r0, #0
36 mov pc, lr 39 mov pc, lr
37ENDPROC(__put_user_1) 40ENDPROC(__put_user_1)
38 41
39ENTRY(__put_user_2) 42ENTRY(__put_user_2)
43 check_uaccess r0, 2, r1, ip, __put_user_bad
40 mov ip, r2, lsr #8 44 mov ip, r2, lsr #8
41#ifdef CONFIG_THUMB2_KERNEL 45#ifdef CONFIG_THUMB2_KERNEL
42#ifndef __ARMEB__ 46#ifndef __ARMEB__
@@ -60,12 +64,14 @@ ENTRY(__put_user_2)
60ENDPROC(__put_user_2) 64ENDPROC(__put_user_2)
61 65
62ENTRY(__put_user_4) 66ENTRY(__put_user_4)
67 check_uaccess r0, 4, r1, ip, __put_user_bad
634: TUSER(str) r2, [r0] 684: TUSER(str) r2, [r0]
64 mov r0, #0 69 mov r0, #0
65 mov pc, lr 70 mov pc, lr
66ENDPROC(__put_user_4) 71ENDPROC(__put_user_4)
67 72
68ENTRY(__put_user_8) 73ENTRY(__put_user_8)
74 check_uaccess r0, 8, r1, ip, __put_user_bad
69#ifdef CONFIG_THUMB2_KERNEL 75#ifdef CONFIG_THUMB2_KERNEL
705: TUSER(str) r2, [r0] 765: TUSER(str) r2, [r0]
716: TUSER(str) r3, [r0, #4] 776: TUSER(str) r3, [r0, #4]
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index c8050b14e61..b1420710193 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -19,8 +19,8 @@ config AT91_SAM9G45_RESET
19 19
20config SOC_AT91SAM9 20config SOC_AT91SAM9
21 bool 21 bool
22 select GENERIC_CLOCKEVENTS
23 select CPU_ARM926T 22 select CPU_ARM926T
23 select GENERIC_CLOCKEVENTS
24 24
25menu "Atmel AT91 System-on-Chip" 25menu "Atmel AT91 System-on-Chip"
26 26
@@ -28,66 +28,66 @@ comment "Atmel AT91 Processor"
28 28
29config SOC_AT91SAM9 29config SOC_AT91SAM9
30 bool 30 bool
31 select AT91_SAM9_SMC
32 select AT91_SAM9_TIME
31 select CPU_ARM926T 33 select CPU_ARM926T
32 select MULTI_IRQ_HANDLER 34 select MULTI_IRQ_HANDLER
33 select SPARSE_IRQ 35 select SPARSE_IRQ
34 select AT91_SAM9_TIME
35 select AT91_SAM9_SMC
36 36
37config SOC_AT91RM9200 37config SOC_AT91RM9200
38 bool "AT91RM9200" 38 bool "AT91RM9200"
39 select CPU_ARM920T 39 select CPU_ARM920T
40 select MULTI_IRQ_HANDLER
41 select SPARSE_IRQ
42 select GENERIC_CLOCKEVENTS 40 select GENERIC_CLOCKEVENTS
43 select HAVE_AT91_DBGU0 41 select HAVE_AT91_DBGU0
42 select MULTI_IRQ_HANDLER
43 select SPARSE_IRQ
44 44
45config SOC_AT91SAM9260 45config SOC_AT91SAM9260
46 bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20" 46 bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
47 select SOC_AT91SAM9
48 select HAVE_AT91_DBGU0 47 select HAVE_AT91_DBGU0
49 select HAVE_NET_MACB 48 select HAVE_NET_MACB
49 select SOC_AT91SAM9
50 help 50 help
51 Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE 51 Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
52 or AT91SAM9G20 SoC. 52 or AT91SAM9G20 SoC.
53 53
54config SOC_AT91SAM9261 54config SOC_AT91SAM9261
55 bool "AT91SAM9261 or AT91SAM9G10" 55 bool "AT91SAM9261 or AT91SAM9G10"
56 select SOC_AT91SAM9
57 select HAVE_AT91_DBGU0 56 select HAVE_AT91_DBGU0
58 select HAVE_FB_ATMEL 57 select HAVE_FB_ATMEL
58 select SOC_AT91SAM9
59 help 59 help
60 Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC. 60 Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
61 61
62config SOC_AT91SAM9263 62config SOC_AT91SAM9263
63 bool "AT91SAM9263" 63 bool "AT91SAM9263"
64 select SOC_AT91SAM9
65 select HAVE_AT91_DBGU1 64 select HAVE_AT91_DBGU1
66 select HAVE_FB_ATMEL 65 select HAVE_FB_ATMEL
67 select HAVE_NET_MACB 66 select HAVE_NET_MACB
67 select SOC_AT91SAM9
68 68
69config SOC_AT91SAM9RL 69config SOC_AT91SAM9RL
70 bool "AT91SAM9RL" 70 bool "AT91SAM9RL"
71 select SOC_AT91SAM9
72 select HAVE_AT91_DBGU0 71 select HAVE_AT91_DBGU0
73 select HAVE_FB_ATMEL 72 select HAVE_FB_ATMEL
73 select SOC_AT91SAM9
74 74
75config SOC_AT91SAM9G45 75config SOC_AT91SAM9G45
76 bool "AT91SAM9G45 or AT91SAM9M10 families" 76 bool "AT91SAM9G45 or AT91SAM9M10 families"
77 select SOC_AT91SAM9
78 select HAVE_AT91_DBGU1 77 select HAVE_AT91_DBGU1
79 select HAVE_FB_ATMEL 78 select HAVE_FB_ATMEL
80 select HAVE_NET_MACB 79 select HAVE_NET_MACB
80 select SOC_AT91SAM9
81 help 81 help
82 Select this if you are using one of Atmel's AT91SAM9G45 family SoC. 82 Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
83 This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11. 83 This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
84 84
85config SOC_AT91SAM9X5 85config SOC_AT91SAM9X5
86 bool "AT91SAM9x5 family" 86 bool "AT91SAM9x5 family"
87 select SOC_AT91SAM9
88 select HAVE_AT91_DBGU0 87 select HAVE_AT91_DBGU0
89 select HAVE_FB_ATMEL 88 select HAVE_FB_ATMEL
90 select HAVE_NET_MACB 89 select HAVE_NET_MACB
90 select SOC_AT91SAM9
91 help 91 help
92 Select this if you are using one of Atmel's AT91SAM9x5 family SoC. 92 Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
93 This means that your SAM9 name finishes with a '5' (except if it is 93 This means that your SAM9 name finishes with a '5' (except if it is
@@ -97,9 +97,9 @@ config SOC_AT91SAM9X5
97 97
98config SOC_AT91SAM9N12 98config SOC_AT91SAM9N12
99 bool "AT91SAM9N12 family" 99 bool "AT91SAM9N12 family"
100 select SOC_AT91SAM9
101 select HAVE_AT91_DBGU0 100 select HAVE_AT91_DBGU0
102 select HAVE_FB_ATMEL 101 select HAVE_FB_ATMEL
102 select SOC_AT91SAM9
103 help 103 help
104 Select this if you are using Atmel's AT91SAM9N12 SoC. 104 Select this if you are using Atmel's AT91SAM9N12 SoC.
105 105
@@ -144,9 +144,9 @@ config ARCH_AT91SAM9G45
144config ARCH_AT91X40 144config ARCH_AT91X40
145 bool "AT91x40" 145 bool "AT91x40"
146 depends on !MMU 146 depends on !MMU
147 select ARCH_USES_GETTIMEOFFSET
147 select MULTI_IRQ_HANDLER 148 select MULTI_IRQ_HANDLER
148 select SPARSE_IRQ 149 select SPARSE_IRQ
149 select ARCH_USES_GETTIMEOFFSET
150 150
151endchoice 151endchoice
152 152
diff --git a/arch/arm/mach-at91/Makefile.boot b/arch/arm/mach-at91/Makefile.boot
index 30bb7332e30..5309f9b6aab 100644
--- a/arch/arm/mach-at91/Makefile.boot
+++ b/arch/arm/mach-at91/Makefile.boot
@@ -12,27 +12,3 @@ else
12params_phys-y := 0x20000100 12params_phys-y := 0x20000100
13initrd_phys-y := 0x20410000 13initrd_phys-y := 0x20410000
14endif 14endif
15
16# Keep dtb files sorted alphabetically for each SoC
17# sam9260
18dtb-$(CONFIG_MACH_AT91SAM_DT) += aks-cdu.dtb
19dtb-$(CONFIG_MACH_AT91SAM_DT) += ethernut5.dtb
20dtb-$(CONFIG_MACH_AT91SAM_DT) += evk-pro3.dtb
21dtb-$(CONFIG_MACH_AT91SAM_DT) += tny_a9260.dtb
22dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9260.dtb
23# sam9263
24dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9263ek.dtb
25dtb-$(CONFIG_MACH_AT91SAM_DT) += tny_a9263.dtb
26dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9263.dtb
27# sam9g20
28dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g20ek.dtb
29dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g20ek_2mmc.dtb
30dtb-$(CONFIG_MACH_AT91SAM_DT) += kizbox.dtb
31dtb-$(CONFIG_MACH_AT91SAM_DT) += tny_a9g20.dtb
32dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9g20.dtb
33# sam9g45
34dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9m10g45ek.dtb
35# sam9n12
36dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9n12ek.dtb
37# sam9x5
38dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g25ek.dtb
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 6f50c672227..b4f0565aff6 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -187,6 +187,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
187 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 187 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
188 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 188 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
189 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), 189 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
190 CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200", &twi_clk),
190 /* fake hclk clock */ 191 /* fake hclk clock */
191 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), 192 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
192 CLKDEV_CON_ID("pioA", &pioA_clk), 193 CLKDEV_CON_ID("pioA", &pioA_clk),
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 01fb7325fec..a563189cdfc 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -294,9 +294,9 @@ void __init at91_add_device_cf(struct at91_cf_data *data) {}
294 * MMC / SD 294 * MMC / SD
295 * -------------------------------------------------------------------- */ 295 * -------------------------------------------------------------------- */
296 296
297#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 297#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
298static u64 mmc_dmamask = DMA_BIT_MASK(32); 298static u64 mmc_dmamask = DMA_BIT_MASK(32);
299static struct at91_mmc_data mmc_data; 299static struct mci_platform_data mmc_data;
300 300
301static struct resource mmc_resources[] = { 301static struct resource mmc_resources[] = {
302 [0] = { 302 [0] = {
@@ -312,7 +312,7 @@ static struct resource mmc_resources[] = {
312}; 312};
313 313
314static struct platform_device at91rm9200_mmc_device = { 314static struct platform_device at91rm9200_mmc_device = {
315 .name = "at91_mci", 315 .name = "atmel_mci",
316 .id = -1, 316 .id = -1,
317 .dev = { 317 .dev = {
318 .dma_mask = &mmc_dmamask, 318 .dma_mask = &mmc_dmamask,
@@ -323,53 +323,69 @@ static struct platform_device at91rm9200_mmc_device = {
323 .num_resources = ARRAY_SIZE(mmc_resources), 323 .num_resources = ARRAY_SIZE(mmc_resources),
324}; 324};
325 325
326void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) 326void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
327{ 327{
328 unsigned int i;
329 unsigned int slot_count = 0;
330
328 if (!data) 331 if (!data)
329 return; 332 return;
330 333
331 /* input/irq */ 334 for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
332 if (gpio_is_valid(data->det_pin)) {
333 at91_set_gpio_input(data->det_pin, 1);
334 at91_set_deglitch(data->det_pin, 1);
335 }
336 if (gpio_is_valid(data->wp_pin))
337 at91_set_gpio_input(data->wp_pin, 1);
338 if (gpio_is_valid(data->vcc_pin))
339 at91_set_gpio_output(data->vcc_pin, 0);
340
341 /* CLK */
342 at91_set_A_periph(AT91_PIN_PA27, 0);
343 335
344 if (data->slot_b) { 336 if (!data->slot[i].bus_width)
345 /* CMD */ 337 continue;
346 at91_set_B_periph(AT91_PIN_PA8, 1);
347 338
348 /* DAT0, maybe DAT1..DAT3 */ 339 /* input/irq */
349 at91_set_B_periph(AT91_PIN_PA9, 1); 340 if (gpio_is_valid(data->slot[i].detect_pin)) {
350 if (data->wire4) { 341 at91_set_gpio_input(data->slot[i].detect_pin, 1);
351 at91_set_B_periph(AT91_PIN_PA10, 1); 342 at91_set_deglitch(data->slot[i].detect_pin, 1);
352 at91_set_B_periph(AT91_PIN_PA11, 1);
353 at91_set_B_periph(AT91_PIN_PA12, 1);
354 } 343 }
355 } else { 344 if (gpio_is_valid(data->slot[i].wp_pin))
356 /* CMD */ 345 at91_set_gpio_input(data->slot[i].wp_pin, 1);
357 at91_set_A_periph(AT91_PIN_PA28, 1); 346
358 347 switch (i) {
359 /* DAT0, maybe DAT1..DAT3 */ 348 case 0: /* slot A */
360 at91_set_A_periph(AT91_PIN_PA29, 1); 349 /* CMD */
361 if (data->wire4) { 350 at91_set_A_periph(AT91_PIN_PA28, 1);
362 at91_set_B_periph(AT91_PIN_PB3, 1); 351 /* DAT0, maybe DAT1..DAT3 */
363 at91_set_B_periph(AT91_PIN_PB4, 1); 352 at91_set_A_periph(AT91_PIN_PA29, 1);
364 at91_set_B_periph(AT91_PIN_PB5, 1); 353 if (data->slot[i].bus_width == 4) {
354 at91_set_B_periph(AT91_PIN_PB3, 1);
355 at91_set_B_periph(AT91_PIN_PB4, 1);
356 at91_set_B_periph(AT91_PIN_PB5, 1);
357 }
358 slot_count++;
359 break;
360 case 1: /* slot B */
361 /* CMD */
362 at91_set_B_periph(AT91_PIN_PA8, 1);
363 /* DAT0, maybe DAT1..DAT3 */
364 at91_set_B_periph(AT91_PIN_PA9, 1);
365 if (data->slot[i].bus_width == 4) {
366 at91_set_B_periph(AT91_PIN_PA10, 1);
367 at91_set_B_periph(AT91_PIN_PA11, 1);
368 at91_set_B_periph(AT91_PIN_PA12, 1);
369 }
370 slot_count++;
371 break;
372 default:
373 printk(KERN_ERR
374 "AT91: SD/MMC slot %d not available\n", i);
375 break;
376 }
377 if (slot_count) {
378 /* CLK */
379 at91_set_A_periph(AT91_PIN_PA27, 0);
380
381 mmc_data = *data;
382 platform_device_register(&at91rm9200_mmc_device);
365 } 383 }
366 } 384 }
367 385
368 mmc_data = *data;
369 platform_device_register(&at91rm9200_mmc_device);
370} 386}
371#else 387#else
372void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} 388void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
373#endif 389#endif
374 390
375 391
@@ -495,7 +511,7 @@ static struct resource twi_resources[] = {
495}; 511};
496 512
497static struct platform_device at91rm9200_twi_device = { 513static struct platform_device at91rm9200_twi_device = {
498 .name = "at91_i2c", 514 .name = "i2c-at91rm9200",
499 .id = -1, 515 .id = -1,
500 .resource = twi_resources, 516 .resource = twi_resources,
501 .num_resources = ARRAY_SIZE(twi_resources), 517 .num_resources = ARRAY_SIZE(twi_resources),
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 30c7f26a466..ad29f93f20c 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -211,6 +211,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
211 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk), 211 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk),
212 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk), 212 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk),
213 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), 213 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk),
214 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260", &twi_clk),
215 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20", &twi_clk),
214 /* more usart lookup table for DT entries */ 216 /* more usart lookup table for DT entries */
215 CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck), 217 CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck),
216 CLKDEV_CON_DEV_ID("usart", "fffb0000.serial", &usart0_clk), 218 CLKDEV_CON_DEV_ID("usart", "fffb0000.serial", &usart0_clk),
@@ -219,6 +221,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
219 CLKDEV_CON_DEV_ID("usart", "fffd0000.serial", &usart3_clk), 221 CLKDEV_CON_DEV_ID("usart", "fffd0000.serial", &usart3_clk),
220 CLKDEV_CON_DEV_ID("usart", "fffd4000.serial", &usart4_clk), 222 CLKDEV_CON_DEV_ID("usart", "fffd4000.serial", &usart4_clk),
221 CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk), 223 CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk),
224 CLKDEV_CON_DEV_ID(NULL, "fffac000.i2c", &twi_clk),
222 /* more tc lookup table for DT entries */ 225 /* more tc lookup table for DT entries */
223 CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk), 226 CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk),
224 CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk), 227 CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk),
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index bce572a530e..a76b8684f52 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -209,92 +209,10 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {}
209 209
210 210
211/* -------------------------------------------------------------------- 211/* --------------------------------------------------------------------
212 * MMC / SD
213 * -------------------------------------------------------------------- */
214
215#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
216static u64 mmc_dmamask = DMA_BIT_MASK(32);
217static struct at91_mmc_data mmc_data;
218
219static struct resource mmc_resources[] = {
220 [0] = {
221 .start = AT91SAM9260_BASE_MCI,
222 .end = AT91SAM9260_BASE_MCI + SZ_16K - 1,
223 .flags = IORESOURCE_MEM,
224 },
225 [1] = {
226 .start = NR_IRQS_LEGACY + AT91SAM9260_ID_MCI,
227 .end = NR_IRQS_LEGACY + AT91SAM9260_ID_MCI,
228 .flags = IORESOURCE_IRQ,
229 },
230};
231
232static struct platform_device at91sam9260_mmc_device = {
233 .name = "at91_mci",
234 .id = -1,
235 .dev = {
236 .dma_mask = &mmc_dmamask,
237 .coherent_dma_mask = DMA_BIT_MASK(32),
238 .platform_data = &mmc_data,
239 },
240 .resource = mmc_resources,
241 .num_resources = ARRAY_SIZE(mmc_resources),
242};
243
244void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
245{
246 if (!data)
247 return;
248
249 /* input/irq */
250 if (gpio_is_valid(data->det_pin)) {
251 at91_set_gpio_input(data->det_pin, 1);
252 at91_set_deglitch(data->det_pin, 1);
253 }
254 if (gpio_is_valid(data->wp_pin))
255 at91_set_gpio_input(data->wp_pin, 1);
256 if (gpio_is_valid(data->vcc_pin))
257 at91_set_gpio_output(data->vcc_pin, 0);
258
259 /* CLK */
260 at91_set_A_periph(AT91_PIN_PA8, 0);
261
262 if (data->slot_b) {
263 /* CMD */
264 at91_set_B_periph(AT91_PIN_PA1, 1);
265
266 /* DAT0, maybe DAT1..DAT3 */
267 at91_set_B_periph(AT91_PIN_PA0, 1);
268 if (data->wire4) {
269 at91_set_B_periph(AT91_PIN_PA5, 1);
270 at91_set_B_periph(AT91_PIN_PA4, 1);
271 at91_set_B_periph(AT91_PIN_PA3, 1);
272 }
273 } else {
274 /* CMD */
275 at91_set_A_periph(AT91_PIN_PA7, 1);
276
277 /* DAT0, maybe DAT1..DAT3 */
278 at91_set_A_periph(AT91_PIN_PA6, 1);
279 if (data->wire4) {
280 at91_set_A_periph(AT91_PIN_PA9, 1);
281 at91_set_A_periph(AT91_PIN_PA10, 1);
282 at91_set_A_periph(AT91_PIN_PA11, 1);
283 }
284 }
285
286 mmc_data = *data;
287 platform_device_register(&at91sam9260_mmc_device);
288}
289#else
290void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
291#endif
292
293/* --------------------------------------------------------------------
294 * MMC / SD Slot for Atmel MCI Driver 212 * MMC / SD Slot for Atmel MCI Driver
295 * -------------------------------------------------------------------- */ 213 * -------------------------------------------------------------------- */
296 214
297#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) 215#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
298static u64 mmc_dmamask = DMA_BIT_MASK(32); 216static u64 mmc_dmamask = DMA_BIT_MASK(32);
299static struct mci_platform_data mmc_data; 217static struct mci_platform_data mmc_data;
300 218
@@ -503,7 +421,6 @@ static struct resource twi_resources[] = {
503}; 421};
504 422
505static struct platform_device at91sam9260_twi_device = { 423static struct platform_device at91sam9260_twi_device = {
506 .name = "at91_i2c",
507 .id = -1, 424 .id = -1,
508 .resource = twi_resources, 425 .resource = twi_resources,
509 .num_resources = ARRAY_SIZE(twi_resources), 426 .num_resources = ARRAY_SIZE(twi_resources),
@@ -511,6 +428,13 @@ static struct platform_device at91sam9260_twi_device = {
511 428
512void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) 429void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
513{ 430{
431 /* IP version is not the same on 9260 and g20 */
432 if (cpu_is_at91sam9g20()) {
433 at91sam9260_twi_device.name = "i2c-at91sam9g20";
434 } else {
435 at91sam9260_twi_device.name = "i2c-at91sam9260";
436 }
437
514 /* pins used for TWI interface */ 438 /* pins used for TWI interface */
515 at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */ 439 at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */
516 at91_set_multi_drive(AT91_PIN_PA23, 1); 440 at91_set_multi_drive(AT91_PIN_PA23, 1);
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index f40762c5fed..8d999eb1a13 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -178,6 +178,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
178 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 178 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
179 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), 179 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
180 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0), 180 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0),
181 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261", &twi_clk),
182 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10", &twi_clk),
181 CLKDEV_CON_ID("pioA", &pioA_clk), 183 CLKDEV_CON_ID("pioA", &pioA_clk),
182 CLKDEV_CON_ID("pioB", &pioB_clk), 184 CLKDEV_CON_ID("pioB", &pioB_clk),
183 CLKDEV_CON_ID("pioC", &pioC_clk), 185 CLKDEV_CON_ID("pioC", &pioC_clk),
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index bc2590d712d..9752f17efba 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -137,9 +137,9 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
137 * MMC / SD 137 * MMC / SD
138 * -------------------------------------------------------------------- */ 138 * -------------------------------------------------------------------- */
139 139
140#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 140#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
141static u64 mmc_dmamask = DMA_BIT_MASK(32); 141static u64 mmc_dmamask = DMA_BIT_MASK(32);
142static struct at91_mmc_data mmc_data; 142static struct mci_platform_data mmc_data;
143 143
144static struct resource mmc_resources[] = { 144static struct resource mmc_resources[] = {
145 [0] = { 145 [0] = {
@@ -155,7 +155,7 @@ static struct resource mmc_resources[] = {
155}; 155};
156 156
157static struct platform_device at91sam9261_mmc_device = { 157static struct platform_device at91sam9261_mmc_device = {
158 .name = "at91_mci", 158 .name = "atmel_mci",
159 .id = -1, 159 .id = -1,
160 .dev = { 160 .dev = {
161 .dma_mask = &mmc_dmamask, 161 .dma_mask = &mmc_dmamask,
@@ -166,40 +166,40 @@ static struct platform_device at91sam9261_mmc_device = {
166 .num_resources = ARRAY_SIZE(mmc_resources), 166 .num_resources = ARRAY_SIZE(mmc_resources),
167}; 167};
168 168
169void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) 169void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
170{ 170{
171 if (!data) 171 if (!data)
172 return; 172 return;
173 173
174 /* input/irq */ 174 if (data->slot[0].bus_width) {
175 if (gpio_is_valid(data->det_pin)) { 175 /* input/irq */
176 at91_set_gpio_input(data->det_pin, 1); 176 if (gpio_is_valid(data->slot[0].detect_pin)) {
177 at91_set_deglitch(data->det_pin, 1); 177 at91_set_gpio_input(data->slot[0].detect_pin, 1);
178 } 178 at91_set_deglitch(data->slot[0].detect_pin, 1);
179 if (gpio_is_valid(data->wp_pin)) 179 }
180 at91_set_gpio_input(data->wp_pin, 1); 180 if (gpio_is_valid(data->slot[0].wp_pin))
181 if (gpio_is_valid(data->vcc_pin)) 181 at91_set_gpio_input(data->slot[0].wp_pin, 1);
182 at91_set_gpio_output(data->vcc_pin, 0); 182
183 183 /* CLK */
184 /* CLK */ 184 at91_set_B_periph(AT91_PIN_PA2, 0);
185 at91_set_B_periph(AT91_PIN_PA2, 0); 185
186 186 /* CMD */
187 /* CMD */ 187 at91_set_B_periph(AT91_PIN_PA1, 1);
188 at91_set_B_periph(AT91_PIN_PA1, 1); 188
189 189 /* DAT0, maybe DAT1..DAT3 */
190 /* DAT0, maybe DAT1..DAT3 */ 190 at91_set_B_periph(AT91_PIN_PA0, 1);
191 at91_set_B_periph(AT91_PIN_PA0, 1); 191 if (data->slot[0].bus_width == 4) {
192 if (data->wire4) { 192 at91_set_B_periph(AT91_PIN_PA4, 1);
193 at91_set_B_periph(AT91_PIN_PA4, 1); 193 at91_set_B_periph(AT91_PIN_PA5, 1);
194 at91_set_B_periph(AT91_PIN_PA5, 1); 194 at91_set_B_periph(AT91_PIN_PA6, 1);
195 at91_set_B_periph(AT91_PIN_PA6, 1); 195 }
196 }
197 196
198 mmc_data = *data; 197 mmc_data = *data;
199 platform_device_register(&at91sam9261_mmc_device); 198 platform_device_register(&at91sam9261_mmc_device);
199 }
200} 200}
201#else 201#else
202void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} 202void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
203#endif 203#endif
204 204
205 205
@@ -317,7 +317,6 @@ static struct resource twi_resources[] = {
317}; 317};
318 318
319static struct platform_device at91sam9261_twi_device = { 319static struct platform_device at91sam9261_twi_device = {
320 .name = "at91_i2c",
321 .id = -1, 320 .id = -1,
322 .resource = twi_resources, 321 .resource = twi_resources,
323 .num_resources = ARRAY_SIZE(twi_resources), 322 .num_resources = ARRAY_SIZE(twi_resources),
@@ -325,12 +324,19 @@ static struct platform_device at91sam9261_twi_device = {
325 324
326void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) 325void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
327{ 326{
327 /* IP version is not the same on 9261 and g10 */
328 if (cpu_is_at91sam9g10()) {
329 at91sam9261_twi_device.name = "i2c-at91sam9g10";
330 /* I2C PIO must not be configured as open-drain on this chip */
331 } else {
332 at91sam9261_twi_device.name = "i2c-at91sam9261";
333 at91_set_multi_drive(AT91_PIN_PA7, 1);
334 at91_set_multi_drive(AT91_PIN_PA8, 1);
335 }
336
328 /* pins used for TWI interface */ 337 /* pins used for TWI interface */
329 at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */ 338 at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */
330 at91_set_multi_drive(AT91_PIN_PA7, 1);
331
332 at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */ 339 at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */
333 at91_set_multi_drive(AT91_PIN_PA8, 1);
334 340
335 i2c_register_board_info(0, devices, nr_devices); 341 i2c_register_board_info(0, devices, nr_devices);
336 platform_device_register(&at91sam9261_twi_device); 342 platform_device_register(&at91sam9261_twi_device);
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 84b38105231..6a01d0360df 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -188,11 +188,12 @@ static struct clk_lookup periph_clocks_lookups[] = {
188 CLKDEV_CON_ID("hclk", &macb_clk), 188 CLKDEV_CON_ID("hclk", &macb_clk),
189 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 189 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
190 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 190 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
191 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), 191 CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
192 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk), 192 CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
193 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), 193 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
194 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), 194 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
195 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), 195 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
196 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260", &twi_clk),
196 /* fake hclk clock */ 197 /* fake hclk clock */
197 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), 198 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
198 CLKDEV_CON_ID("pioA", &pioA_clk), 199 CLKDEV_CON_ID("pioA", &pioA_clk),
@@ -210,6 +211,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
210 CLKDEV_CON_DEV_ID("hclk", "a00000.ohci", &ohci_clk), 211 CLKDEV_CON_DEV_ID("hclk", "a00000.ohci", &ohci_clk),
211 CLKDEV_CON_DEV_ID("spi_clk", "fffa4000.spi", &spi0_clk), 212 CLKDEV_CON_DEV_ID("spi_clk", "fffa4000.spi", &spi0_clk),
212 CLKDEV_CON_DEV_ID("spi_clk", "fffa8000.spi", &spi1_clk), 213 CLKDEV_CON_DEV_ID("spi_clk", "fffa8000.spi", &spi1_clk),
214 CLKDEV_CON_DEV_ID(NULL, "fff88000.i2c", &twi_clk),
213}; 215};
214 216
215static struct clk_lookup usart_clocks_lookups[] = { 217static struct clk_lookup usart_clocks_lookups[] = {
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 9b6ca734f1a..8dde220b42b 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -218,9 +218,9 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {}
218 * MMC / SD 218 * MMC / SD
219 * -------------------------------------------------------------------- */ 219 * -------------------------------------------------------------------- */
220 220
221#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 221#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
222static u64 mmc_dmamask = DMA_BIT_MASK(32); 222static u64 mmc_dmamask = DMA_BIT_MASK(32);
223static struct at91_mmc_data mmc0_data, mmc1_data; 223static struct mci_platform_data mmc0_data, mmc1_data;
224 224
225static struct resource mmc0_resources[] = { 225static struct resource mmc0_resources[] = {
226 [0] = { 226 [0] = {
@@ -236,7 +236,7 @@ static struct resource mmc0_resources[] = {
236}; 236};
237 237
238static struct platform_device at91sam9263_mmc0_device = { 238static struct platform_device at91sam9263_mmc0_device = {
239 .name = "at91_mci", 239 .name = "atmel_mci",
240 .id = 0, 240 .id = 0,
241 .dev = { 241 .dev = {
242 .dma_mask = &mmc_dmamask, 242 .dma_mask = &mmc_dmamask,
@@ -261,7 +261,7 @@ static struct resource mmc1_resources[] = {
261}; 261};
262 262
263static struct platform_device at91sam9263_mmc1_device = { 263static struct platform_device at91sam9263_mmc1_device = {
264 .name = "at91_mci", 264 .name = "atmel_mci",
265 .id = 1, 265 .id = 1,
266 .dev = { 266 .dev = {
267 .dma_mask = &mmc_dmamask, 267 .dma_mask = &mmc_dmamask,
@@ -272,85 +272,110 @@ static struct platform_device at91sam9263_mmc1_device = {
272 .num_resources = ARRAY_SIZE(mmc1_resources), 272 .num_resources = ARRAY_SIZE(mmc1_resources),
273}; 273};
274 274
275void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) 275void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
276{ 276{
277 unsigned int i;
278 unsigned int slot_count = 0;
279
277 if (!data) 280 if (!data)
278 return; 281 return;
279 282
280 /* input/irq */ 283 for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
281 if (gpio_is_valid(data->det_pin)) {
282 at91_set_gpio_input(data->det_pin, 1);
283 at91_set_deglitch(data->det_pin, 1);
284 }
285 if (gpio_is_valid(data->wp_pin))
286 at91_set_gpio_input(data->wp_pin, 1);
287 if (gpio_is_valid(data->vcc_pin))
288 at91_set_gpio_output(data->vcc_pin, 0);
289 284
290 if (mmc_id == 0) { /* MCI0 */ 285 if (!data->slot[i].bus_width)
291 /* CLK */ 286 continue;
292 at91_set_A_periph(AT91_PIN_PA12, 0);
293 287
294 if (data->slot_b) { 288 /* input/irq */
295 /* CMD */ 289 if (gpio_is_valid(data->slot[i].detect_pin)) {
296 at91_set_A_periph(AT91_PIN_PA16, 1); 290 at91_set_gpio_input(data->slot[i].detect_pin,
291 1);
292 at91_set_deglitch(data->slot[i].detect_pin,
293 1);
294 }
295 if (gpio_is_valid(data->slot[i].wp_pin))
296 at91_set_gpio_input(data->slot[i].wp_pin, 1);
297
298 if (mmc_id == 0) { /* MCI0 */
299 switch (i) {
300 case 0: /* slot A */
301 /* CMD */
302 at91_set_A_periph(AT91_PIN_PA1, 1);
303 /* DAT0, maybe DAT1..DAT3 */
304 at91_set_A_periph(AT91_PIN_PA0, 1);
305 if (data->slot[i].bus_width == 4) {
306 at91_set_A_periph(AT91_PIN_PA3, 1);
307 at91_set_A_periph(AT91_PIN_PA4, 1);
308 at91_set_A_periph(AT91_PIN_PA5, 1);
309 }
310 slot_count++;
311 break;
312 case 1: /* slot B */
313 /* CMD */
314 at91_set_A_periph(AT91_PIN_PA16, 1);
315 /* DAT0, maybe DAT1..DAT3 */
316 at91_set_A_periph(AT91_PIN_PA17, 1);
317 if (data->slot[i].bus_width == 4) {
318 at91_set_A_periph(AT91_PIN_PA18, 1);
319 at91_set_A_periph(AT91_PIN_PA19, 1);
320 at91_set_A_periph(AT91_PIN_PA20, 1);
321 }
322 slot_count++;
323 break;
324 default:
325 printk(KERN_ERR
326 "AT91: SD/MMC slot %d not available\n", i);
327 break;
328 }
329 if (slot_count) {
330 /* CLK */
331 at91_set_A_periph(AT91_PIN_PA12, 0);
297 332
298 /* DAT0, maybe DAT1..DAT3 */ 333 mmc0_data = *data;
299 at91_set_A_periph(AT91_PIN_PA17, 1); 334 platform_device_register(&at91sam9263_mmc0_device);
300 if (data->wire4) {
301 at91_set_A_periph(AT91_PIN_PA18, 1);
302 at91_set_A_periph(AT91_PIN_PA19, 1);
303 at91_set_A_periph(AT91_PIN_PA20, 1);
304 } 335 }
305 } else { 336 } else if (mmc_id == 1) { /* MCI1 */
306 /* CMD */ 337 switch (i) {
307 at91_set_A_periph(AT91_PIN_PA1, 1); 338 case 0: /* slot A */
308 339 /* CMD */
309 /* DAT0, maybe DAT1..DAT3 */ 340 at91_set_A_periph(AT91_PIN_PA7, 1);
310 at91_set_A_periph(AT91_PIN_PA0, 1); 341 /* DAT0, maybe DAT1..DAT3 */
311 if (data->wire4) { 342 at91_set_A_periph(AT91_PIN_PA8, 1);
312 at91_set_A_periph(AT91_PIN_PA3, 1); 343 if (data->slot[i].bus_width == 4) {
313 at91_set_A_periph(AT91_PIN_PA4, 1); 344 at91_set_A_periph(AT91_PIN_PA9, 1);
314 at91_set_A_periph(AT91_PIN_PA5, 1); 345 at91_set_A_periph(AT91_PIN_PA10, 1);
346 at91_set_A_periph(AT91_PIN_PA11, 1);
347 }
348 slot_count++;
349 break;
350 case 1: /* slot B */
351 /* CMD */
352 at91_set_A_periph(AT91_PIN_PA21, 1);
353 /* DAT0, maybe DAT1..DAT3 */
354 at91_set_A_periph(AT91_PIN_PA22, 1);
355 if (data->slot[i].bus_width == 4) {
356 at91_set_A_periph(AT91_PIN_PA23, 1);
357 at91_set_A_periph(AT91_PIN_PA24, 1);
358 at91_set_A_periph(AT91_PIN_PA25, 1);
359 }
360 slot_count++;
361 break;
362 default:
363 printk(KERN_ERR
364 "AT91: SD/MMC slot %d not available\n", i);
365 break;
315 } 366 }
316 } 367 if (slot_count) {
368 /* CLK */
369 at91_set_A_periph(AT91_PIN_PA6, 0);
317 370
318 mmc0_data = *data; 371 mmc1_data = *data;
319 platform_device_register(&at91sam9263_mmc0_device); 372 platform_device_register(&at91sam9263_mmc1_device);
320 } else { /* MCI1 */
321 /* CLK */
322 at91_set_A_periph(AT91_PIN_PA6, 0);
323
324 if (data->slot_b) {
325 /* CMD */
326 at91_set_A_periph(AT91_PIN_PA21, 1);
327
328 /* DAT0, maybe DAT1..DAT3 */
329 at91_set_A_periph(AT91_PIN_PA22, 1);
330 if (data->wire4) {
331 at91_set_A_periph(AT91_PIN_PA23, 1);
332 at91_set_A_periph(AT91_PIN_PA24, 1);
333 at91_set_A_periph(AT91_PIN_PA25, 1);
334 }
335 } else {
336 /* CMD */
337 at91_set_A_periph(AT91_PIN_PA7, 1);
338
339 /* DAT0, maybe DAT1..DAT3 */
340 at91_set_A_periph(AT91_PIN_PA8, 1);
341 if (data->wire4) {
342 at91_set_A_periph(AT91_PIN_PA9, 1);
343 at91_set_A_periph(AT91_PIN_PA10, 1);
344 at91_set_A_periph(AT91_PIN_PA11, 1);
345 } 373 }
346 } 374 }
347
348 mmc1_data = *data;
349 platform_device_register(&at91sam9263_mmc1_device);
350 } 375 }
351} 376}
352#else 377#else
353void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} 378void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
354#endif 379#endif
355 380
356/* -------------------------------------------------------------------- 381/* --------------------------------------------------------------------
@@ -574,7 +599,7 @@ static struct resource twi_resources[] = {
574}; 599};
575 600
576static struct platform_device at91sam9263_twi_device = { 601static struct platform_device at91sam9263_twi_device = {
577 .name = "at91_i2c", 602 .name = "i2c-at91sam9260",
578 .id = -1, 603 .id = -1,
579 .resource = twi_resources, 604 .resource = twi_resources,
580 .num_resources = ARRAY_SIZE(twi_resources), 605 .num_resources = ARRAY_SIZE(twi_resources),
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index ef6cedd52e3..84af1b506d9 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -237,6 +237,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
237 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), 237 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
238 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb0_clk), 238 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb0_clk),
239 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk), 239 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk),
240 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.0", &twi0_clk),
241 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.1", &twi1_clk),
240 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 242 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
241 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 243 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
242 CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk), 244 CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk),
@@ -254,6 +256,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
254 CLKDEV_CON_DEV_ID("t0_clk", "fffd4000.timer", &tcb0_clk), 256 CLKDEV_CON_DEV_ID("t0_clk", "fffd4000.timer", &tcb0_clk),
255 CLKDEV_CON_DEV_ID("hclk", "700000.ohci", &uhphs_clk), 257 CLKDEV_CON_DEV_ID("hclk", "700000.ohci", &uhphs_clk),
256 CLKDEV_CON_DEV_ID("ehci_clk", "800000.ehci", &uhphs_clk), 258 CLKDEV_CON_DEV_ID("ehci_clk", "800000.ehci", &uhphs_clk),
259 CLKDEV_CON_DEV_ID(NULL, "fff84000.i2c", &twi0_clk),
260 CLKDEV_CON_DEV_ID(NULL, "fff88000.i2c", &twi1_clk),
257 /* fake hclk clock */ 261 /* fake hclk clock */
258 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk), 262 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk),
259 CLKDEV_CON_ID("pioA", &pioA_clk), 263 CLKDEV_CON_ID("pioA", &pioA_clk),
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 1b47319ca00..b1596072dcc 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -31,7 +31,7 @@
31#include <mach/at91sam9g45_matrix.h> 31#include <mach/at91sam9g45_matrix.h>
32#include <mach/at91_matrix.h> 32#include <mach/at91_matrix.h>
33#include <mach/at91sam9_smc.h> 33#include <mach/at91sam9_smc.h>
34#include <mach/at_hdmac.h> 34#include <linux/platform_data/dma-atmel.h>
35#include <mach/atmel-mci.h> 35#include <mach/atmel-mci.h>
36 36
37#include <media/atmel-isi.h> 37#include <media/atmel-isi.h>
@@ -653,7 +653,7 @@ static struct resource twi0_resources[] = {
653}; 653};
654 654
655static struct platform_device at91sam9g45_twi0_device = { 655static struct platform_device at91sam9g45_twi0_device = {
656 .name = "at91_i2c", 656 .name = "i2c-at91sam9g10",
657 .id = 0, 657 .id = 0,
658 .resource = twi0_resources, 658 .resource = twi0_resources,
659 .num_resources = ARRAY_SIZE(twi0_resources), 659 .num_resources = ARRAY_SIZE(twi0_resources),
@@ -673,7 +673,7 @@ static struct resource twi1_resources[] = {
673}; 673};
674 674
675static struct platform_device at91sam9g45_twi1_device = { 675static struct platform_device at91sam9g45_twi1_device = {
676 .name = "at91_i2c", 676 .name = "i2c-at91sam9g10",
677 .id = 1, 677 .id = 1,
678 .resource = twi1_resources, 678 .resource = twi1_resources,
679 .num_resources = ARRAY_SIZE(twi1_resources), 679 .num_resources = ARRAY_SIZE(twi1_resources),
@@ -686,18 +686,12 @@ void __init at91_add_device_i2c(short i2c_id, struct i2c_board_info *devices, in
686 /* pins used for TWI interface */ 686 /* pins used for TWI interface */
687 if (i2c_id == 0) { 687 if (i2c_id == 0) {
688 at91_set_A_periph(AT91_PIN_PA20, 0); /* TWD */ 688 at91_set_A_periph(AT91_PIN_PA20, 0); /* TWD */
689 at91_set_multi_drive(AT91_PIN_PA20, 1);
690
691 at91_set_A_periph(AT91_PIN_PA21, 0); /* TWCK */ 689 at91_set_A_periph(AT91_PIN_PA21, 0); /* TWCK */
692 at91_set_multi_drive(AT91_PIN_PA21, 1);
693 690
694 platform_device_register(&at91sam9g45_twi0_device); 691 platform_device_register(&at91sam9g45_twi0_device);
695 } else { 692 } else {
696 at91_set_A_periph(AT91_PIN_PB10, 0); /* TWD */ 693 at91_set_A_periph(AT91_PIN_PB10, 0); /* TWD */
697 at91_set_multi_drive(AT91_PIN_PB10, 1);
698
699 at91_set_A_periph(AT91_PIN_PB11, 0); /* TWCK */ 694 at91_set_A_periph(AT91_PIN_PB11, 0); /* TWCK */
700 at91_set_multi_drive(AT91_PIN_PB11, 1);
701 695
702 platform_device_register(&at91sam9g45_twi1_device); 696 platform_device_register(&at91sam9g45_twi1_device);
703 } 697 }
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
index 08494664ab7..732d3d3f4ec 100644
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ b/arch/arm/mach-at91/at91sam9n12.c
@@ -169,6 +169,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
169 CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb_clk), 169 CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb_clk),
170 CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb_clk), 170 CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb_clk),
171 CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma_clk), 171 CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma_clk),
172 CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk),
173 CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk),
172 CLKDEV_CON_ID("pioA", &pioAB_clk), 174 CLKDEV_CON_ID("pioA", &pioAB_clk),
173 CLKDEV_CON_ID("pioB", &pioAB_clk), 175 CLKDEV_CON_ID("pioB", &pioAB_clk),
174 CLKDEV_CON_ID("pioC", &pioCD_clk), 176 CLKDEV_CON_ID("pioC", &pioCD_clk),
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 72ce50a50de..72e90841222 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -186,6 +186,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
186 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), 186 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
187 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 187 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
188 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 188 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
189 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi0_clk),
190 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.1", &twi1_clk),
189 CLKDEV_CON_ID("pioA", &pioA_clk), 191 CLKDEV_CON_ID("pioA", &pioA_clk),
190 CLKDEV_CON_ID("pioB", &pioB_clk), 192 CLKDEV_CON_ID("pioB", &pioB_clk),
191 CLKDEV_CON_ID("pioC", &pioC_clk), 193 CLKDEV_CON_ID("pioC", &pioC_clk),
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index b3d365dadef..d6ca0543ce8 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -22,7 +22,7 @@
22#include <mach/at91sam9rl_matrix.h> 22#include <mach/at91sam9rl_matrix.h>
23#include <mach/at91_matrix.h> 23#include <mach/at91_matrix.h>
24#include <mach/at91sam9_smc.h> 24#include <mach/at91sam9_smc.h>
25#include <mach/at_hdmac.h> 25#include <linux/platform_data/dma-atmel.h>
26 26
27#include "generic.h" 27#include "generic.h"
28 28
@@ -161,9 +161,9 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
161 * MMC / SD 161 * MMC / SD
162 * -------------------------------------------------------------------- */ 162 * -------------------------------------------------------------------- */
163 163
164#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 164#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
165static u64 mmc_dmamask = DMA_BIT_MASK(32); 165static u64 mmc_dmamask = DMA_BIT_MASK(32);
166static struct at91_mmc_data mmc_data; 166static struct mci_platform_data mmc_data;
167 167
168static struct resource mmc_resources[] = { 168static struct resource mmc_resources[] = {
169 [0] = { 169 [0] = {
@@ -179,7 +179,7 @@ static struct resource mmc_resources[] = {
179}; 179};
180 180
181static struct platform_device at91sam9rl_mmc_device = { 181static struct platform_device at91sam9rl_mmc_device = {
182 .name = "at91_mci", 182 .name = "atmel_mci",
183 .id = -1, 183 .id = -1,
184 .dev = { 184 .dev = {
185 .dma_mask = &mmc_dmamask, 185 .dma_mask = &mmc_dmamask,
@@ -190,40 +190,40 @@ static struct platform_device at91sam9rl_mmc_device = {
190 .num_resources = ARRAY_SIZE(mmc_resources), 190 .num_resources = ARRAY_SIZE(mmc_resources),
191}; 191};
192 192
193void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) 193void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
194{ 194{
195 if (!data) 195 if (!data)
196 return; 196 return;
197 197
198 /* input/irq */ 198 if (data->slot[0].bus_width) {
199 if (gpio_is_valid(data->det_pin)) { 199 /* input/irq */
200 at91_set_gpio_input(data->det_pin, 1); 200 if (gpio_is_valid(data->slot[0].detect_pin)) {
201 at91_set_deglitch(data->det_pin, 1); 201 at91_set_gpio_input(data->slot[0].detect_pin, 1);
202 } 202 at91_set_deglitch(data->slot[0].detect_pin, 1);
203 if (gpio_is_valid(data->wp_pin)) 203 }
204 at91_set_gpio_input(data->wp_pin, 1); 204 if (gpio_is_valid(data->slot[0].wp_pin))
205 if (gpio_is_valid(data->vcc_pin)) 205 at91_set_gpio_input(data->slot[0].wp_pin, 1);
206 at91_set_gpio_output(data->vcc_pin, 0); 206
207 207 /* CLK */
208 /* CLK */ 208 at91_set_A_periph(AT91_PIN_PA2, 0);
209 at91_set_A_periph(AT91_PIN_PA2, 0); 209
210 210 /* CMD */
211 /* CMD */ 211 at91_set_A_periph(AT91_PIN_PA1, 1);
212 at91_set_A_periph(AT91_PIN_PA1, 1); 212
213 213 /* DAT0, maybe DAT1..DAT3 */
214 /* DAT0, maybe DAT1..DAT3 */ 214 at91_set_A_periph(AT91_PIN_PA0, 1);
215 at91_set_A_periph(AT91_PIN_PA0, 1); 215 if (data->slot[0].bus_width == 4) {
216 if (data->wire4) { 216 at91_set_A_periph(AT91_PIN_PA3, 1);
217 at91_set_A_periph(AT91_PIN_PA3, 1); 217 at91_set_A_periph(AT91_PIN_PA4, 1);
218 at91_set_A_periph(AT91_PIN_PA4, 1); 218 at91_set_A_periph(AT91_PIN_PA5, 1);
219 at91_set_A_periph(AT91_PIN_PA5, 1); 219 }
220
221 mmc_data = *data;
222 platform_device_register(&at91sam9rl_mmc_device);
220 } 223 }
221
222 mmc_data = *data;
223 platform_device_register(&at91sam9rl_mmc_device);
224} 224}
225#else 225#else
226void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} 226void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
227#endif 227#endif
228 228
229 229
@@ -346,7 +346,7 @@ static struct resource twi_resources[] = {
346}; 346};
347 347
348static struct platform_device at91sam9rl_twi_device = { 348static struct platform_device at91sam9rl_twi_device = {
349 .name = "at91_i2c", 349 .name = "i2c-at91sam9g20",
350 .id = -1, 350 .id = -1,
351 .resource = twi_resources, 351 .resource = twi_resources,
352 .num_resources = ARRAY_SIZE(twi_resources), 352 .num_resources = ARRAY_SIZE(twi_resources),
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
index 477cf9d0667..e5035380dcb 100644
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ b/arch/arm/mach-at91/at91sam9x5.c
@@ -231,6 +231,9 @@ static struct clk_lookup periph_clocks_lookups[] = {
231 CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb0_clk), 231 CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb0_clk),
232 CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma0_clk), 232 CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma0_clk),
233 CLKDEV_CON_DEV_ID("dma_clk", "ffffee00.dma-controller", &dma1_clk), 233 CLKDEV_CON_DEV_ID("dma_clk", "ffffee00.dma-controller", &dma1_clk),
234 CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk),
235 CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk),
236 CLKDEV_CON_DEV_ID(NULL, "f8018000.i2c", &twi2_clk),
234 CLKDEV_CON_ID("pioA", &pioAB_clk), 237 CLKDEV_CON_ID("pioA", &pioAB_clk),
235 CLKDEV_CON_ID("pioB", &pioAB_clk), 238 CLKDEV_CON_ID("pioB", &pioAB_clk),
236 CLKDEV_CON_ID("pioC", &pioCD_clk), 239 CLKDEV_CON_ID("pioC", &pioCD_clk),
diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c
index 46090e642d8..6bd7300a2bc 100644
--- a/arch/arm/mach-at91/at91x40.c
+++ b/arch/arm/mach-at91/at91x40.c
@@ -47,7 +47,7 @@ static void at91x40_idle(void)
47 * Disable the processor clock. The processor will be automatically 47 * Disable the processor clock. The processor will be automatically
48 * re-enabled by an interrupt or by a reset. 48 * re-enabled by an interrupt or by a reset.
49 */ 49 */
50 __raw_writel(AT91_PS_CR_CPU, AT91_PS_CR); 50 __raw_writel(AT91_PS_CR_CPU, AT91_IO_P2V(AT91_PS_CR));
51 cpu_do_idle(); 51 cpu_do_idle();
52} 52}
53 53
diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c
index 6ca680a1d5d..ee06d7bcdf7 100644
--- a/arch/arm/mach-at91/at91x40_time.c
+++ b/arch/arm/mach-at91/at91x40_time.c
@@ -29,10 +29,10 @@
29#include <mach/at91_tc.h> 29#include <mach/at91_tc.h>
30 30
31#define at91_tc_read(field) \ 31#define at91_tc_read(field) \
32 __raw_readl(AT91_TC + field) 32 __raw_readl(AT91_IO_P2V(AT91_TC) + field)
33 33
34#define at91_tc_write(field, value) \ 34#define at91_tc_write(field, value) \
35 __raw_writel(value, AT91_TC + field); 35 __raw_writel(value, AT91_IO_P2V(AT91_TC) + field);
36 36
37/* 37/*
38 * 3 counter/timer units present. 38 * 3 counter/timer units present.
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c
index de7be193181..93a832f7023 100644
--- a/arch/arm/mach-at91/board-afeb-9260v1.c
+++ b/arch/arm/mach-at91/board-afeb-9260v1.c
@@ -133,12 +133,12 @@ static struct atmel_nand_data __initdata afeb9260_nand_data = {
133/* 133/*
134 * MCI (SD/MMC) 134 * MCI (SD/MMC)
135 */ 135 */
136static struct at91_mmc_data __initdata afeb9260_mmc_data = { 136static struct mci_platform_data __initdata afeb9260_mci0_data = {
137 .det_pin = AT91_PIN_PC9, 137 .slot[1] = {
138 .wp_pin = AT91_PIN_PC4, 138 .bus_width = 4,
139 .slot_b = 1, 139 .detect_pin = AT91_PIN_PC9,
140 .wire4 = 1, 140 .wp_pin = AT91_PIN_PC4,
141 .vcc_pin = -EINVAL, 141 },
142}; 142};
143 143
144 144
@@ -199,7 +199,7 @@ static void __init afeb9260_board_init(void)
199 at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */ 199 at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */
200 at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */ 200 at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */
201 /* MMC */ 201 /* MMC */
202 at91_add_device_mmc(0, &afeb9260_mmc_data); 202 at91_add_device_mci(0, &afeb9260_mci0_data);
203 /* I2C */ 203 /* I2C */
204 at91_add_device_i2c(afeb9260_i2c_devices, 204 at91_add_device_i2c(afeb9260_i2c_devices,
205 ARRAY_SIZE(afeb9260_i2c_devices)); 205 ARRAY_SIZE(afeb9260_i2c_devices));
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c
index a5b002f32a6..71d8f362a1d 100644
--- a/arch/arm/mach-at91/board-carmeva.c
+++ b/arch/arm/mach-at91/board-carmeva.c
@@ -71,12 +71,12 @@ static struct at91_udc_data __initdata carmeva_udc_data = {
71 // .vcc_pin = -EINVAL, 71 // .vcc_pin = -EINVAL,
72// }; 72// };
73 73
74static struct at91_mmc_data __initdata carmeva_mmc_data = { 74static struct mci_platform_data __initdata carmeva_mci0_data = {
75 .slot_b = 0, 75 .slot[0] = {
76 .wire4 = 1, 76 .bus_width = 4,
77 .det_pin = AT91_PIN_PB10, 77 .detect_pin = AT91_PIN_PB10,
78 .wp_pin = AT91_PIN_PC14, 78 .wp_pin = AT91_PIN_PC14,
79 .vcc_pin = -EINVAL, 79 },
80}; 80};
81 81
82static struct spi_board_info carmeva_spi_devices[] = { 82static struct spi_board_info carmeva_spi_devices[] = {
@@ -150,7 +150,7 @@ static void __init carmeva_board_init(void)
150 /* Compact Flash */ 150 /* Compact Flash */
151// at91_add_device_cf(&carmeva_cf_data); 151// at91_add_device_cf(&carmeva_cf_data);
152 /* MMC */ 152 /* MMC */
153 at91_add_device_mmc(0, &carmeva_mmc_data); 153 at91_add_device_mci(0, &carmeva_mci0_data);
154 /* LEDs */ 154 /* LEDs */
155 at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds)); 155 at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds));
156} 156}
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c
index ecbc13b594d..e71c473316e 100644
--- a/arch/arm/mach-at91/board-cpu9krea.c
+++ b/arch/arm/mach-at91/board-cpu9krea.c
@@ -254,8 +254,7 @@ static struct gpio_led cpu9krea_leds[] = {
254 254
255static struct i2c_board_info __initdata cpu9krea_i2c_devices[] = { 255static struct i2c_board_info __initdata cpu9krea_i2c_devices[] = {
256 { 256 {
257 I2C_BOARD_INFO("rtc-ds1307", 0x68), 257 I2C_BOARD_INFO("ds1339", 0x68),
258 .type = "ds1339",
259 }, 258 },
260}; 259};
261 260
@@ -312,12 +311,12 @@ static void __init cpu9krea_add_device_buttons(void)
312/* 311/*
313 * MCI (SD/MMC) 312 * MCI (SD/MMC)
314 */ 313 */
315static struct at91_mmc_data __initdata cpu9krea_mmc_data = { 314static struct mci_platform_data __initdata cpu9krea_mci0_data = {
316 .slot_b = 0, 315 .slot[0] = {
317 .wire4 = 1, 316 .bus_width = 4,
318 .det_pin = AT91_PIN_PA29, 317 .detect_pin = AT91_PIN_PA29,
319 .wp_pin = -EINVAL, 318 .wp_pin = -EINVAL,
320 .vcc_pin = -EINVAL, 319 },
321}; 320};
322 321
323static void __init cpu9krea_board_init(void) 322static void __init cpu9krea_board_init(void)
@@ -359,7 +358,7 @@ static void __init cpu9krea_board_init(void)
359 /* Ethernet */ 358 /* Ethernet */
360 at91_add_device_eth(&cpu9krea_macb_data); 359 at91_add_device_eth(&cpu9krea_macb_data);
361 /* MMC */ 360 /* MMC */
362 at91_add_device_mmc(0, &cpu9krea_mmc_data); 361 at91_add_device_mci(0, &cpu9krea_mci0_data);
363 /* I2C */ 362 /* I2C */
364 at91_add_device_i2c(cpu9krea_i2c_devices, 363 at91_add_device_i2c(cpu9krea_i2c_devices,
365 ARRAY_SIZE(cpu9krea_i2c_devices)); 364 ARRAY_SIZE(cpu9krea_i2c_devices));
diff --git a/arch/arm/mach-at91/board-cpuat91.c b/arch/arm/mach-at91/board-cpuat91.c
index 2e6d043c82f..2cbd1a2b6c3 100644
--- a/arch/arm/mach-at91/board-cpuat91.c
+++ b/arch/arm/mach-at91/board-cpuat91.c
@@ -78,11 +78,12 @@ static struct at91_udc_data __initdata cpuat91_udc_data = {
78 .pullup_pin = AT91_PIN_PC14, 78 .pullup_pin = AT91_PIN_PC14,
79}; 79};
80 80
81static struct at91_mmc_data __initdata cpuat91_mmc_data = { 81static struct mci_platform_data __initdata cpuat91_mci0_data = {
82 .det_pin = AT91_PIN_PC2, 82 .slot[0] = {
83 .wire4 = 1, 83 .bus_width = 4,
84 .wp_pin = -EINVAL, 84 .detect_pin = AT91_PIN_PC2,
85 .vcc_pin = -EINVAL, 85 .wp_pin = -EINVAL,
86 },
86}; 87};
87 88
88static struct physmap_flash_data cpuat91_flash_data = { 89static struct physmap_flash_data cpuat91_flash_data = {
@@ -168,7 +169,7 @@ static void __init cpuat91_board_init(void)
168 /* USB Device */ 169 /* USB Device */
169 at91_add_device_udc(&cpuat91_udc_data); 170 at91_add_device_udc(&cpuat91_udc_data);
170 /* MMC */ 171 /* MMC */
171 at91_add_device_mmc(0, &cpuat91_mmc_data); 172 at91_add_device_mci(0, &cpuat91_mci0_data);
172 /* I2C */ 173 /* I2C */
173 at91_add_device_i2c(NULL, 0); 174 at91_add_device_i2c(NULL, 0);
174 /* Platform devices */ 175 /* Platform devices */
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c
index 462bc319cbc..3e37437a7a6 100644
--- a/arch/arm/mach-at91/board-csb337.c
+++ b/arch/arm/mach-at91/board-csb337.c
@@ -87,12 +87,12 @@ static struct at91_cf_data __initdata csb337_cf_data = {
87 .rst_pin = AT91_PIN_PD2, 87 .rst_pin = AT91_PIN_PD2,
88}; 88};
89 89
90static struct at91_mmc_data __initdata csb337_mmc_data = { 90static struct mci_platform_data __initdata csb337_mci0_data = {
91 .det_pin = AT91_PIN_PD5, 91 .slot[0] = {
92 .slot_b = 0, 92 .bus_width = 4,
93 .wire4 = 1, 93 .detect_pin = AT91_PIN_PD5,
94 .wp_pin = AT91_PIN_PD6, 94 .wp_pin = AT91_PIN_PD6,
95 .vcc_pin = -EINVAL, 95 },
96}; 96};
97 97
98static struct spi_board_info csb337_spi_devices[] = { 98static struct spi_board_info csb337_spi_devices[] = {
@@ -220,8 +220,6 @@ static struct gpio_led csb_leds[] = {
220 220
221static void __init csb337_board_init(void) 221static void __init csb337_board_init(void)
222{ 222{
223 /* Setup the LEDs */
224 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
225 /* Serial */ 223 /* Serial */
226 /* DBGU on ttyS0 */ 224 /* DBGU on ttyS0 */
227 at91_register_uart(0, 0, 0); 225 at91_register_uart(0, 0, 0);
@@ -240,7 +238,7 @@ static void __init csb337_board_init(void)
240 /* SPI */ 238 /* SPI */
241 at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices)); 239 at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
242 /* MMC */ 240 /* MMC */
243 at91_add_device_mmc(0, &csb337_mmc_data); 241 at91_add_device_mci(0, &csb337_mci0_data);
244 /* NOR flash */ 242 /* NOR flash */
245 platform_device_register(&csb_flash); 243 platform_device_register(&csb_flash);
246 /* LEDs */ 244 /* LEDs */
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c
index d1e1f3fc0a4..0cfac16ee9d 100644
--- a/arch/arm/mach-at91/board-eb9200.c
+++ b/arch/arm/mach-at91/board-eb9200.c
@@ -70,12 +70,12 @@ static struct at91_cf_data __initdata eb9200_cf_data = {
70 .rst_pin = AT91_PIN_PC5, 70 .rst_pin = AT91_PIN_PC5,
71}; 71};
72 72
73static struct at91_mmc_data __initdata eb9200_mmc_data = { 73static struct mci_platform_data __initdata eb9200_mci0_data = {
74 .slot_b = 0, 74 .slot[0] = {
75 .wire4 = 1, 75 .bus_width = 4,
76 .det_pin = -EINVAL, 76 .detect_pin = -EINVAL,
77 .wp_pin = -EINVAL, 77 .wp_pin = -EINVAL,
78 .vcc_pin = -EINVAL, 78 },
79}; 79};
80 80
81static struct i2c_board_info __initdata eb9200_i2c_devices[] = { 81static struct i2c_board_info __initdata eb9200_i2c_devices[] = {
@@ -113,7 +113,7 @@ static void __init eb9200_board_init(void)
113 at91_add_device_spi(NULL, 0); 113 at91_add_device_spi(NULL, 0);
114 /* MMC */ 114 /* MMC */
115 /* only supports 1 or 4 bit interface, not wired through to SPI */ 115 /* only supports 1 or 4 bit interface, not wired through to SPI */
116 at91_add_device_mmc(0, &eb9200_mmc_data); 116 at91_add_device_mci(0, &eb9200_mci0_data);
117} 117}
118 118
119MACHINE_START(ATEB9200, "Embest ATEB9200") 119MACHINE_START(ATEB9200, "Embest ATEB9200")
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c
index 9c24cb25707..3d931ffac4b 100644
--- a/arch/arm/mach-at91/board-ecbat91.c
+++ b/arch/arm/mach-at91/board-ecbat91.c
@@ -64,12 +64,12 @@ static struct at91_usbh_data __initdata ecb_at91usbh_data = {
64 .overcurrent_pin= {-EINVAL, -EINVAL}, 64 .overcurrent_pin= {-EINVAL, -EINVAL},
65}; 65};
66 66
67static struct at91_mmc_data __initdata ecb_at91mmc_data = { 67static struct mci_platform_data __initdata ecbat91_mci0_data = {
68 .slot_b = 0, 68 .slot[0] = {
69 .wire4 = 1, 69 .bus_width = 4,
70 .det_pin = -EINVAL, 70 .detect_pin = -EINVAL,
71 .wp_pin = -EINVAL, 71 .wp_pin = -EINVAL,
72 .vcc_pin = -EINVAL, 72 },
73}; 73};
74 74
75 75
@@ -138,11 +138,20 @@ static struct spi_board_info __initdata ecb_at91spi_devices[] = {
138 }, 138 },
139}; 139};
140 140
141/*
142 * LEDs
143 */
144static struct gpio_led ecb_leds[] = {
145 { /* D1 */
146 .name = "led1",
147 .gpio = AT91_PIN_PC7,
148 .active_low = 1,
149 .default_trigger = "heartbeat",
150 }
151};
152
141static void __init ecb_at91board_init(void) 153static void __init ecb_at91board_init(void)
142{ 154{
143 /* Setup the LEDs */
144 at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7);
145
146 /* Serial */ 155 /* Serial */
147 /* DBGU on ttyS0. (Rx & Tx only) */ 156 /* DBGU on ttyS0. (Rx & Tx only) */
148 at91_register_uart(0, 0, 0); 157 at91_register_uart(0, 0, 0);
@@ -161,10 +170,13 @@ static void __init ecb_at91board_init(void)
161 at91_add_device_i2c(NULL, 0); 170 at91_add_device_i2c(NULL, 0);
162 171
163 /* MMC */ 172 /* MMC */
164 at91_add_device_mmc(0, &ecb_at91mmc_data); 173 at91_add_device_mci(0, &ecbat91_mci0_data);
165 174
166 /* SPI */ 175 /* SPI */
167 at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices)); 176 at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
177
178 /* LEDs */
179 at91_gpio_leds(ecb_leds, ARRAY_SIZE(ecb_leds));
168} 180}
169 181
170MACHINE_START(ECBAT91, "emQbit's ECB_AT91") 182MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c
index 82bdfde3405..d93658a2b12 100644
--- a/arch/arm/mach-at91/board-eco920.c
+++ b/arch/arm/mach-at91/board-eco920.c
@@ -56,12 +56,12 @@ static struct at91_udc_data __initdata eco920_udc_data = {
56 .pullup_pin = AT91_PIN_PB13, 56 .pullup_pin = AT91_PIN_PB13,
57}; 57};
58 58
59static struct at91_mmc_data __initdata eco920_mmc_data = { 59static struct mci_platform_data __initdata eco920_mci0_data = {
60 .slot_b = 0, 60 .slot[0] = {
61 .wire4 = 0, 61 .bus_width = 1,
62 .det_pin = -EINVAL, 62 .detect_pin = -EINVAL,
63 .wp_pin = -EINVAL, 63 .wp_pin = -EINVAL,
64 .vcc_pin = -EINVAL, 64 },
65}; 65};
66 66
67static struct physmap_flash_data eco920_flash_data = { 67static struct physmap_flash_data eco920_flash_data = {
@@ -93,10 +93,26 @@ static struct spi_board_info eco920_spi_devices[] = {
93 }, 93 },
94}; 94};
95 95
96/*
97 * LEDs
98 */
99static struct gpio_led eco920_leds[] = {
100 { /* D1 */
101 .name = "led1",
102 .gpio = AT91_PIN_PB0,
103 .active_low = 1,
104 .default_trigger = "heartbeat",
105 },
106 { /* D2 */
107 .name = "led2",
108 .gpio = AT91_PIN_PB1,
109 .active_low = 1,
110 .default_trigger = "timer",
111 }
112};
113
96static void __init eco920_board_init(void) 114static void __init eco920_board_init(void)
97{ 115{
98 /* Setup the LEDs */
99 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
100 /* DBGU on ttyS0. (Rx & Tx only */ 116 /* DBGU on ttyS0. (Rx & Tx only */
101 at91_register_uart(0, 0, 0); 117 at91_register_uart(0, 0, 0);
102 at91_add_device_serial(); 118 at91_add_device_serial();
@@ -104,7 +120,7 @@ static void __init eco920_board_init(void)
104 at91_add_device_usbh(&eco920_usbh_data); 120 at91_add_device_usbh(&eco920_usbh_data);
105 at91_add_device_udc(&eco920_udc_data); 121 at91_add_device_udc(&eco920_udc_data);
106 122
107 at91_add_device_mmc(0, &eco920_mmc_data); 123 at91_add_device_mci(0, &eco920_mci0_data);
108 platform_device_register(&eco920_flash); 124 platform_device_register(&eco920_flash);
109 125
110 at91_ramc_write(0, AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1) 126 at91_ramc_write(0, AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1)
@@ -127,6 +143,8 @@ static void __init eco920_board_init(void)
127 ); 143 );
128 144
129 at91_add_device_spi(eco920_spi_devices, ARRAY_SIZE(eco920_spi_devices)); 145 at91_add_device_spi(eco920_spi_devices, ARRAY_SIZE(eco920_spi_devices));
146 /* LEDs */
147 at91_gpio_leds(eco920_leds, ARRAY_SIZE(eco920_leds));
130} 148}
131 149
132MACHINE_START(ECO920, "eco920") 150MACHINE_START(ECO920, "eco920")
diff --git a/arch/arm/mach-at91/board-flexibity.c b/arch/arm/mach-at91/board-flexibity.c
index 6cc83a87d77..fa98abacb1b 100644
--- a/arch/arm/mach-at91/board-flexibity.c
+++ b/arch/arm/mach-at91/board-flexibity.c
@@ -75,12 +75,12 @@ static struct spi_board_info flexibity_spi_devices[] = {
75}; 75};
76 76
77/* MCI (SD/MMC) */ 77/* MCI (SD/MMC) */
78static struct at91_mmc_data __initdata flexibity_mmc_data = { 78static struct mci_platform_data __initdata flexibity_mci0_data = {
79 .slot_b = 0, 79 .slot[0] = {
80 .wire4 = 1, 80 .bus_width = 4,
81 .det_pin = AT91_PIN_PC9, 81 .detect_pin = AT91_PIN_PC9,
82 .wp_pin = AT91_PIN_PC4, 82 .wp_pin = AT91_PIN_PC4,
83 .vcc_pin = -EINVAL, 83 },
84}; 84};
85 85
86/* LEDs */ 86/* LEDs */
@@ -152,7 +152,7 @@ static void __init flexibity_board_init(void)
152 at91_add_device_spi(flexibity_spi_devices, 152 at91_add_device_spi(flexibity_spi_devices,
153 ARRAY_SIZE(flexibity_spi_devices)); 153 ARRAY_SIZE(flexibity_spi_devices));
154 /* MMC */ 154 /* MMC */
155 at91_add_device_mmc(0, &flexibity_mmc_data); 155 at91_add_device_mci(0, &flexibity_mci0_data);
156 /* LEDs */ 156 /* LEDs */
157 at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds)); 157 at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds));
158} 158}
diff --git a/arch/arm/mach-at91/board-foxg20.c b/arch/arm/mach-at91/board-foxg20.c
index 69ab1247ef8..6e47071d820 100644
--- a/arch/arm/mach-at91/board-foxg20.c
+++ b/arch/arm/mach-at91/board-foxg20.c
@@ -86,7 +86,7 @@ static struct at91_udc_data __initdata foxg20_udc_data = {
86 * SPI devices. 86 * SPI devices.
87 */ 87 */
88static struct spi_board_info foxg20_spi_devices[] = { 88static struct spi_board_info foxg20_spi_devices[] = {
89#if !defined(CONFIG_MMC_AT91) 89#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
90 { 90 {
91 .modalias = "mtd_dataflash", 91 .modalias = "mtd_dataflash",
92 .chip_select = 1, 92 .chip_select = 1,
@@ -109,12 +109,12 @@ static struct macb_platform_data __initdata foxg20_macb_data = {
109 * MCI (SD/MMC) 109 * MCI (SD/MMC)
110 * det_pin, wp_pin and vcc_pin are not connected 110 * det_pin, wp_pin and vcc_pin are not connected
111 */ 111 */
112static struct at91_mmc_data __initdata foxg20_mmc_data = { 112static struct mci_platform_data __initdata foxg20_mci0_data = {
113 .slot_b = 1, 113 .slot[1] = {
114 .wire4 = 1, 114 .bus_width = 4,
115 .det_pin = -EINVAL, 115 .detect_pin = -EINVAL,
116 .wp_pin = -EINVAL, 116 .wp_pin = -EINVAL,
117 .vcc_pin = -EINVAL, 117 },
118}; 118};
119 119
120 120
@@ -247,7 +247,7 @@ static void __init foxg20_board_init(void)
247 /* Ethernet */ 247 /* Ethernet */
248 at91_add_device_eth(&foxg20_macb_data); 248 at91_add_device_eth(&foxg20_macb_data);
249 /* MMC */ 249 /* MMC */
250 at91_add_device_mmc(0, &foxg20_mmc_data); 250 at91_add_device_mci(0, &foxg20_mci0_data);
251 /* I2C */ 251 /* I2C */
252 at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices)); 252 at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices));
253 /* LEDs */ 253 /* LEDs */
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c
index 64c1dbf88a0..86050da3ba5 100644
--- a/arch/arm/mach-at91/board-kafa.c
+++ b/arch/arm/mach-at91/board-kafa.c
@@ -66,11 +66,20 @@ static struct at91_udc_data __initdata kafa_udc_data = {
66 .pullup_pin = AT91_PIN_PB7, 66 .pullup_pin = AT91_PIN_PB7,
67}; 67};
68 68
69/*
70 * LEDs
71 */
72static struct gpio_led kafa_leds[] = {
73 { /* D1 */
74 .name = "led1",
75 .gpio = AT91_PIN_PB4,
76 .active_low = 1,
77 .default_trigger = "heartbeat",
78 },
79};
80
69static void __init kafa_board_init(void) 81static void __init kafa_board_init(void)
70{ 82{
71 /* Set up the LEDs */
72 at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4);
73
74 /* Serial */ 83 /* Serial */
75 /* DBGU on ttyS0. (Rx & Tx only) */ 84 /* DBGU on ttyS0. (Rx & Tx only) */
76 at91_register_uart(0, 0, 0); 85 at91_register_uart(0, 0, 0);
@@ -88,6 +97,8 @@ static void __init kafa_board_init(void)
88 at91_add_device_i2c(NULL, 0); 97 at91_add_device_i2c(NULL, 0);
89 /* SPI */ 98 /* SPI */
90 at91_add_device_spi(NULL, 0); 99 at91_add_device_spi(NULL, 0);
100 /* LEDs */
101 at91_gpio_leds(kafa_leds, ARRAY_SIZE(kafa_leds));
91} 102}
92 103
93MACHINE_START(KAFA, "Sperry-Sun KAFA") 104MACHINE_START(KAFA, "Sperry-Sun KAFA")
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c
index 5d96cb85175..abe9fed7a3e 100644
--- a/arch/arm/mach-at91/board-kb9202.c
+++ b/arch/arm/mach-at91/board-kb9202.c
@@ -69,12 +69,12 @@ static struct at91_udc_data __initdata kb9202_udc_data = {
69 .pullup_pin = AT91_PIN_PB22, 69 .pullup_pin = AT91_PIN_PB22,
70}; 70};
71 71
72static struct at91_mmc_data __initdata kb9202_mmc_data = { 72static struct mci_platform_data __initdata kb9202_mci0_data = {
73 .det_pin = AT91_PIN_PB2, 73 .slot[0] = {
74 .slot_b = 0, 74 .bus_width = 4,
75 .wire4 = 1, 75 .detect_pin = AT91_PIN_PB2,
76 .wp_pin = -EINVAL, 76 .wp_pin = -EINVAL,
77 .vcc_pin = -EINVAL, 77 },
78}; 78};
79 79
80static struct mtd_partition __initdata kb9202_nand_partition[] = { 80static struct mtd_partition __initdata kb9202_nand_partition[] = {
@@ -96,11 +96,26 @@ static struct atmel_nand_data __initdata kb9202_nand_data = {
96 .num_parts = ARRAY_SIZE(kb9202_nand_partition), 96 .num_parts = ARRAY_SIZE(kb9202_nand_partition),
97}; 97};
98 98
99/*
100 * LEDs
101 */
102static struct gpio_led kb9202_leds[] = {
103 { /* D1 */
104 .name = "led1",
105 .gpio = AT91_PIN_PC19,
106 .active_low = 1,
107 .default_trigger = "heartbeat",
108 },
109 { /* D2 */
110 .name = "led2",
111 .gpio = AT91_PIN_PC18,
112 .active_low = 1,
113 .default_trigger = "timer",
114 }
115};
116
99static void __init kb9202_board_init(void) 117static void __init kb9202_board_init(void)
100{ 118{
101 /* Set up the LEDs */
102 at91_init_leds(AT91_PIN_PC19, AT91_PIN_PC18);
103
104 /* Serial */ 119 /* Serial */
105 /* DBGU on ttyS0. (Rx & Tx only) */ 120 /* DBGU on ttyS0. (Rx & Tx only) */
106 at91_register_uart(0, 0, 0); 121 at91_register_uart(0, 0, 0);
@@ -121,13 +136,15 @@ static void __init kb9202_board_init(void)
121 /* USB Device */ 136 /* USB Device */
122 at91_add_device_udc(&kb9202_udc_data); 137 at91_add_device_udc(&kb9202_udc_data);
123 /* MMC */ 138 /* MMC */
124 at91_add_device_mmc(0, &kb9202_mmc_data); 139 at91_add_device_mci(0, &kb9202_mci0_data);
125 /* I2C */ 140 /* I2C */
126 at91_add_device_i2c(NULL, 0); 141 at91_add_device_i2c(NULL, 0);
127 /* SPI */ 142 /* SPI */
128 at91_add_device_spi(NULL, 0); 143 at91_add_device_spi(NULL, 0);
129 /* NAND */ 144 /* NAND */
130 at91_add_device_nand(&kb9202_nand_data); 145 at91_add_device_nand(&kb9202_nand_data);
146 /* LEDs */
147 at91_gpio_leds(kb9202_leds, ARRAY_SIZE(kb9202_leds));
131} 148}
132 149
133MACHINE_START(KB9200, "KB920x") 150MACHINE_START(KB9200, "KB920x")
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index 18103c5d993..9cda3fd346a 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -138,11 +138,12 @@ static struct spi_board_info neocore926_spi_devices[] = {
138/* 138/*
139 * MCI (SD/MMC) 139 * MCI (SD/MMC)
140 */ 140 */
141static struct at91_mmc_data __initdata neocore926_mmc_data = { 141static struct mci_platform_data __initdata neocore926_mci0_data = {
142 .wire4 = 1, 142 .slot[0] = {
143 .det_pin = AT91_PIN_PE18, 143 .bus_width = 4,
144 .wp_pin = AT91_PIN_PE19, 144 .detect_pin = AT91_PIN_PE18,
145 .vcc_pin = -EINVAL, 145 .wp_pin = AT91_PIN_PE19,
146 },
146}; 147};
147 148
148 149
@@ -354,7 +355,7 @@ static void __init neocore926_board_init(void)
354 neocore926_add_device_ts(); 355 neocore926_add_device_ts();
355 356
356 /* MMC */ 357 /* MMC */
357 at91_add_device_mmc(1, &neocore926_mmc_data); 358 at91_add_device_mci(0, &neocore926_mci0_data);
358 359
359 /* Ethernet */ 360 /* Ethernet */
360 at91_add_device_eth(&neocore926_macb_data); 361 at91_add_device_eth(&neocore926_macb_data);
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c
index 12706550450..f83e1de699e 100644
--- a/arch/arm/mach-at91/board-picotux200.c
+++ b/arch/arm/mach-at91/board-picotux200.c
@@ -62,12 +62,12 @@ static struct at91_usbh_data __initdata picotux200_usbh_data = {
62 .overcurrent_pin= {-EINVAL, -EINVAL}, 62 .overcurrent_pin= {-EINVAL, -EINVAL},
63}; 63};
64 64
65static struct at91_mmc_data __initdata picotux200_mmc_data = { 65static struct mci_platform_data __initdata picotux200_mci0_data = {
66 .det_pin = AT91_PIN_PB27, 66 .slot[0] = {
67 .slot_b = 0, 67 .bus_width = 4,
68 .wire4 = 1, 68 .detect_pin = AT91_PIN_PB27,
69 .wp_pin = AT91_PIN_PA17, 69 .wp_pin = AT91_PIN_PA17,
70 .vcc_pin = -EINVAL, 70 },
71}; 71};
72 72
73#define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0 73#define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0
@@ -112,7 +112,7 @@ static void __init picotux200_board_init(void)
112 at91_add_device_i2c(NULL, 0); 112 at91_add_device_i2c(NULL, 0);
113 /* MMC */ 113 /* MMC */
114 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ 114 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
115 at91_add_device_mmc(0, &picotux200_mmc_data); 115 at91_add_device_mci(0, &picotux200_mci0_data);
116 /* NOR Flash */ 116 /* NOR Flash */
117 platform_device_register(&picotux200_flash); 117 platform_device_register(&picotux200_flash);
118} 118}
diff --git a/arch/arm/mach-at91/board-qil-a9260.c b/arch/arm/mach-at91/board-qil-a9260.c
index bf351e28542..799f214edeb 100644
--- a/arch/arm/mach-at91/board-qil-a9260.c
+++ b/arch/arm/mach-at91/board-qil-a9260.c
@@ -156,12 +156,12 @@ static void __init ek_add_device_nand(void)
156/* 156/*
157 * MCI (SD/MMC) 157 * MCI (SD/MMC)
158 */ 158 */
159static struct at91_mmc_data __initdata ek_mmc_data = { 159static struct mci_platform_data __initdata ek_mci0_data = {
160 .slot_b = 0, 160 .slot[0] = {
161 .wire4 = 1, 161 .bus_width = 4,
162 .det_pin = -EINVAL, 162 .detect_pin = -EINVAL,
163 .wp_pin = -EINVAL, 163 .wp_pin = -EINVAL,
164 .vcc_pin = -EINVAL, 164 },
165}; 165};
166 166
167/* 167/*
@@ -245,7 +245,7 @@ static void __init ek_board_init(void)
245 /* Ethernet */ 245 /* Ethernet */
246 at91_add_device_eth(&ek_macb_data); 246 at91_add_device_eth(&ek_macb_data);
247 /* MMC */ 247 /* MMC */
248 at91_add_device_mmc(0, &ek_mmc_data); 248 at91_add_device_mci(0, &ek_mci0_data);
249 /* Push Buttons */ 249 /* Push Buttons */
250 ek_add_device_buttons(); 250 ek_add_device_buttons();
251 /* LEDs */ 251 /* LEDs */
diff --git a/arch/arm/mach-at91/board-rm9200dk.c b/arch/arm/mach-at91/board-rm9200dk.c
index cc2bf979607..66338e7ebfb 100644
--- a/arch/arm/mach-at91/board-rm9200dk.c
+++ b/arch/arm/mach-at91/board-rm9200dk.c
@@ -77,12 +77,12 @@ static struct at91_cf_data __initdata dk_cf_data = {
77}; 77};
78 78
79#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD 79#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
80static struct at91_mmc_data __initdata dk_mmc_data = { 80static struct mci_platform_data __initdata dk_mci0_data = {
81 .slot_b = 0, 81 .slot[0] = {
82 .wire4 = 1, 82 .bus_width = 4,
83 .det_pin = -EINVAL, 83 .detect_pin = -EINVAL,
84 .wp_pin = -EINVAL, 84 .wp_pin = -EINVAL,
85 .vcc_pin = -EINVAL, 85 },
86}; 86};
87#endif 87#endif
88 88
@@ -177,9 +177,6 @@ static struct gpio_led dk_leds[] = {
177 177
178static void __init dk_board_init(void) 178static void __init dk_board_init(void)
179{ 179{
180 /* Setup the LEDs */
181 at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
182
183 /* Serial */ 180 /* Serial */
184 /* DBGU on ttyS0. (Rx & Tx only) */ 181 /* DBGU on ttyS0. (Rx & Tx only) */
185 at91_register_uart(0, 0, 0); 182 at91_register_uart(0, 0, 0);
@@ -208,7 +205,7 @@ static void __init dk_board_init(void)
208#else 205#else
209 /* MMC */ 206 /* MMC */
210 at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ 207 at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
211 at91_add_device_mmc(0, &dk_mmc_data); 208 at91_add_device_mci(0, &dk_mci0_data);
212#endif 209#endif
213 /* NAND */ 210 /* NAND */
214 at91_add_device_nand(&dk_nand_data); 211 at91_add_device_nand(&dk_nand_data);
diff --git a/arch/arm/mach-at91/board-rm9200ek.c b/arch/arm/mach-at91/board-rm9200ek.c
index 62e19e64c9d..5d1b5729dc6 100644
--- a/arch/arm/mach-at91/board-rm9200ek.c
+++ b/arch/arm/mach-at91/board-rm9200ek.c
@@ -70,12 +70,12 @@ static struct at91_udc_data __initdata ek_udc_data = {
70}; 70};
71 71
72#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD 72#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
73static struct at91_mmc_data __initdata ek_mmc_data = { 73static struct mci_platform_data __initdata ek_mci0_data = {
74 .det_pin = AT91_PIN_PB27, 74 .slot[0] = {
75 .slot_b = 0, 75 .bus_width = 4,
76 .wire4 = 1, 76 .detect_pin = AT91_PIN_PB27,
77 .wp_pin = AT91_PIN_PA17, 77 .wp_pin = AT91_PIN_PA17,
78 .vcc_pin = -EINVAL, 78 }
79}; 79};
80#endif 80#endif
81 81
@@ -148,9 +148,6 @@ static struct gpio_led ek_leds[] = {
148 148
149static void __init ek_board_init(void) 149static void __init ek_board_init(void)
150{ 150{
151 /* Setup the LEDs */
152 at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
153
154 /* Serial */ 151 /* Serial */
155 /* DBGU on ttyS0. (Rx & Tx only) */ 152 /* DBGU on ttyS0. (Rx & Tx only) */
156 at91_register_uart(0, 0, 0); 153 at91_register_uart(0, 0, 0);
@@ -177,7 +174,7 @@ static void __init ek_board_init(void)
177#else 174#else
178 /* MMC */ 175 /* MMC */
179 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ 176 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
180 at91_add_device_mmc(0, &ek_mmc_data); 177 at91_add_device_mci(0, &ek_mci0_data);
181#endif 178#endif
182 /* NOR Flash */ 179 /* NOR Flash */
183 platform_device_register(&ek_flash); 180 platform_device_register(&ek_flash);
diff --git a/arch/arm/mach-at91/board-rsi-ews.c b/arch/arm/mach-at91/board-rsi-ews.c
index c3b43aefdb7..a0ecf04e9ae 100644
--- a/arch/arm/mach-at91/board-rsi-ews.c
+++ b/arch/arm/mach-at91/board-rsi-ews.c
@@ -58,11 +58,12 @@ static struct at91_usbh_data rsi_ews_usbh_data __initdata = {
58/* 58/*
59 * SD/MC 59 * SD/MC
60 */ 60 */
61static struct at91_mmc_data rsi_ews_mmc_data __initdata = { 61static struct mci_platform_data __initdata rsi_ews_mci0_data = {
62 .slot_b = 0, 62 .slot[0] = {
63 .wire4 = 1, 63 .bus_width = 4,
64 .det_pin = AT91_PIN_PB27, 64 .detect_pin = AT91_PIN_PB27,
65 .wp_pin = AT91_PIN_PB29, 65 .wp_pin = AT91_PIN_PB29,
66 },
66}; 67};
67 68
68/* 69/*
@@ -185,9 +186,6 @@ static struct platform_device rsiews_nor_flash = {
185 */ 186 */
186static void __init rsi_ews_board_init(void) 187static void __init rsi_ews_board_init(void)
187{ 188{
188 /* Setup the LEDs */
189 at91_init_leds(AT91_PIN_PB6, AT91_PIN_PB9);
190
191 /* Serial */ 189 /* Serial */
192 /* DBGU on ttyS0. (Rx & Tx only) */ 190 /* DBGU on ttyS0. (Rx & Tx only) */
193 /* This one is for debugging */ 191 /* This one is for debugging */
@@ -215,7 +213,7 @@ static void __init rsi_ews_board_init(void)
215 at91_add_device_spi(rsi_ews_spi_devices, 213 at91_add_device_spi(rsi_ews_spi_devices,
216 ARRAY_SIZE(rsi_ews_spi_devices)); 214 ARRAY_SIZE(rsi_ews_spi_devices));
217 /* MMC */ 215 /* MMC */
218 at91_add_device_mmc(0, &rsi_ews_mmc_data); 216 at91_add_device_mci(0, &rsi_ews_mci0_data);
219 /* NOR Flash */ 217 /* NOR Flash */
220 platform_device_register(&rsiews_nor_flash); 218 platform_device_register(&rsiews_nor_flash);
221 /* LEDs */ 219 /* LEDs */
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c
index 7bf6da70d7d..c5f01acce3c 100644
--- a/arch/arm/mach-at91/board-sam9-l9260.c
+++ b/arch/arm/mach-at91/board-sam9-l9260.c
@@ -73,7 +73,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
73 * SPI devices. 73 * SPI devices.
74 */ 74 */
75static struct spi_board_info ek_spi_devices[] = { 75static struct spi_board_info ek_spi_devices[] = {
76#if !defined(CONFIG_MMC_AT91) 76#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
77 { /* DataFlash chip */ 77 { /* DataFlash chip */
78 .modalias = "mtd_dataflash", 78 .modalias = "mtd_dataflash",
79 .chip_select = 1, 79 .chip_select = 1,
@@ -158,19 +158,34 @@ static void __init ek_add_device_nand(void)
158/* 158/*
159 * MCI (SD/MMC) 159 * MCI (SD/MMC)
160 */ 160 */
161static struct at91_mmc_data __initdata ek_mmc_data = { 161static struct mci_platform_data __initdata ek_mci0_data = {
162 .slot_b = 1, 162 .slot[1] = {
163 .wire4 = 1, 163 .bus_width = 4,
164 .det_pin = AT91_PIN_PC8, 164 .detect_pin = AT91_PIN_PC8,
165 .wp_pin = AT91_PIN_PC4, 165 .wp_pin = AT91_PIN_PC4,
166 .vcc_pin = -EINVAL, 166 },
167};
168
169/*
170 * LEDs
171 */
172static struct gpio_led ek_leds[] = {
173 { /* D1 */
174 .name = "led1",
175 .gpio = AT91_PIN_PA9,
176 .active_low = 1,
177 .default_trigger = "heartbeat",
178 },
179 { /* D2 */
180 .name = "led2",
181 .gpio = AT91_PIN_PA6,
182 .active_low = 1,
183 .default_trigger = "timer",
184 }
167}; 185};
168 186
169static void __init ek_board_init(void) 187static void __init ek_board_init(void)
170{ 188{
171 /* Setup the LEDs */
172 at91_init_leds(AT91_PIN_PA9, AT91_PIN_PA6);
173
174 /* Serial */ 189 /* Serial */
175 /* DBGU on ttyS0. (Rx & Tx only) */ 190 /* DBGU on ttyS0. (Rx & Tx only) */
176 at91_register_uart(0, 0, 0); 191 at91_register_uart(0, 0, 0);
@@ -194,9 +209,11 @@ static void __init ek_board_init(void)
194 /* Ethernet */ 209 /* Ethernet */
195 at91_add_device_eth(&ek_macb_data); 210 at91_add_device_eth(&ek_macb_data);
196 /* MMC */ 211 /* MMC */
197 at91_add_device_mmc(0, &ek_mmc_data); 212 at91_add_device_mci(0, &ek_mci0_data);
198 /* I2C */ 213 /* I2C */
199 at91_add_device_i2c(NULL, 0); 214 at91_add_device_i2c(NULL, 0);
215 /* LEDs */
216 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
200} 217}
201 218
202MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260") 219MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260")
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index 889c1bf71eb..8cd6e679fbe 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -108,7 +108,7 @@ static void __init at73c213_set_clk(struct at73c213_board_info *info) {}
108 * SPI devices. 108 * SPI devices.
109 */ 109 */
110static struct spi_board_info ek_spi_devices[] = { 110static struct spi_board_info ek_spi_devices[] = {
111#if !defined(CONFIG_MMC_AT91) 111#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
112 { /* DataFlash chip */ 112 { /* DataFlash chip */
113 .modalias = "mtd_dataflash", 113 .modalias = "mtd_dataflash",
114 .chip_select = 1, 114 .chip_select = 1,
@@ -211,12 +211,12 @@ static void __init ek_add_device_nand(void)
211/* 211/*
212 * MCI (SD/MMC) 212 * MCI (SD/MMC)
213 */ 213 */
214static struct at91_mmc_data __initdata ek_mmc_data = { 214static struct mci_platform_data __initdata ek_mci0_data = {
215 .slot_b = 1, 215 .slot[1] = {
216 .wire4 = 1, 216 .bus_width = 4,
217 .det_pin = -EINVAL, 217 .detect_pin = -EINVAL,
218 .wp_pin = -EINVAL, 218 .wp_pin = -EINVAL,
219 .vcc_pin = -EINVAL, 219 },
220}; 220};
221 221
222 222
@@ -329,7 +329,7 @@ static void __init ek_board_init(void)
329 /* Ethernet */ 329 /* Ethernet */
330 at91_add_device_eth(&ek_macb_data); 330 at91_add_device_eth(&ek_macb_data);
331 /* MMC */ 331 /* MMC */
332 at91_add_device_mmc(0, &ek_mmc_data); 332 at91_add_device_mci(0, &ek_mci0_data);
333 /* I2C */ 333 /* I2C */
334 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); 334 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
335 /* SSC (to AT73C213) */ 335 /* SSC (to AT73C213) */
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index 2269be5fa38..27b3af1a304 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -340,11 +340,12 @@ static struct spi_board_info ek_spi_devices[] = {
340 * MCI (SD/MMC) 340 * MCI (SD/MMC)
341 * det_pin, wp_pin and vcc_pin are not connected 341 * det_pin, wp_pin and vcc_pin are not connected
342 */ 342 */
343static struct at91_mmc_data __initdata ek_mmc_data = { 343static struct mci_platform_data __initdata mci0_data = {
344 .wire4 = 1, 344 .slot[0] = {
345 .det_pin = -EINVAL, 345 .bus_width = 4,
346 .wp_pin = -EINVAL, 346 .detect_pin = -EINVAL,
347 .vcc_pin = -EINVAL, 347 .wp_pin = -EINVAL,
348 },
348}; 349};
349 350
350#endif /* CONFIG_SPI_ATMEL_* */ 351#endif /* CONFIG_SPI_ATMEL_* */
@@ -569,9 +570,6 @@ static struct gpio_led ek_leds[] = {
569 570
570static void __init ek_board_init(void) 571static void __init ek_board_init(void)
571{ 572{
572 /* Setup the LEDs */
573 at91_init_leds(AT91_PIN_PA13, AT91_PIN_PA14);
574
575 /* Serial */ 573 /* Serial */
576 /* DBGU on ttyS0. (Rx & Tx only) */ 574 /* DBGU on ttyS0. (Rx & Tx only) */
577 at91_register_uart(0, 0, 0); 575 at91_register_uart(0, 0, 0);
@@ -598,7 +596,7 @@ static void __init ek_board_init(void)
598 at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX); 596 at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX);
599#else 597#else
600 /* MMC */ 598 /* MMC */
601 at91_add_device_mmc(0, &ek_mmc_data); 599 at91_add_device_mci(0, &mci0_data);
602#endif 600#endif
603 /* LCD Controller */ 601 /* LCD Controller */
604 at91_add_device_lcdc(&ek_lcdc_data); 602 at91_add_device_lcdc(&ek_lcdc_data);
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 82adf581afc..073e17403d9 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -141,11 +141,12 @@ static struct spi_board_info ek_spi_devices[] = {
141/* 141/*
142 * MCI (SD/MMC) 142 * MCI (SD/MMC)
143 */ 143 */
144static struct at91_mmc_data __initdata ek_mmc_data = { 144static struct mci_platform_data __initdata mci1_data = {
145 .wire4 = 1, 145 .slot[0] = {
146 .det_pin = AT91_PIN_PE18, 146 .bus_width = 4,
147 .wp_pin = AT91_PIN_PE19, 147 .detect_pin = AT91_PIN_PE18,
148 .vcc_pin = -EINVAL, 148 .wp_pin = AT91_PIN_PE19,
149 },
149}; 150};
150 151
151 152
@@ -420,7 +421,7 @@ static void __init ek_board_init(void)
420 /* Touchscreen */ 421 /* Touchscreen */
421 ek_add_device_ts(); 422 ek_add_device_ts();
422 /* MMC */ 423 /* MMC */
423 at91_add_device_mmc(1, &ek_mmc_data); 424 at91_add_device_mci(1, &mci1_data);
424 /* Ethernet */ 425 /* Ethernet */
425 at91_add_device_eth(&ek_macb_data); 426 at91_add_device_eth(&ek_macb_data);
426 /* NAND */ 427 /* NAND */
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index 4ea4ee00364..3ab2b86a376 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -92,7 +92,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
92 * SPI devices. 92 * SPI devices.
93 */ 93 */
94static struct spi_board_info ek_spi_devices[] = { 94static struct spi_board_info ek_spi_devices[] = {
95#if !(defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_AT91)) 95#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
96 { /* DataFlash chip */ 96 { /* DataFlash chip */
97 .modalias = "mtd_dataflash", 97 .modalias = "mtd_dataflash",
98 .chip_select = 1, 98 .chip_select = 1,
@@ -199,7 +199,6 @@ static void __init ek_add_device_nand(void)
199 * MCI (SD/MMC) 199 * MCI (SD/MMC)
200 * wp_pin and vcc_pin are not connected 200 * wp_pin and vcc_pin are not connected
201 */ 201 */
202#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
203static struct mci_platform_data __initdata ek_mmc_data = { 202static struct mci_platform_data __initdata ek_mmc_data = {
204 .slot[1] = { 203 .slot[1] = {
205 .bus_width = 4, 204 .bus_width = 4,
@@ -208,28 +207,15 @@ static struct mci_platform_data __initdata ek_mmc_data = {
208 }, 207 },
209 208
210}; 209};
211#else
212static struct at91_mmc_data __initdata ek_mmc_data = {
213 .slot_b = 1, /* Only one slot so use slot B */
214 .wire4 = 1,
215 .det_pin = AT91_PIN_PC9,
216 .wp_pin = -EINVAL,
217 .vcc_pin = -EINVAL,
218};
219#endif
220 210
221static void __init ek_add_device_mmc(void) 211static void __init ek_add_device_mmc(void)
222{ 212{
223#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
224 if (ek_have_2mmc()) { 213 if (ek_have_2mmc()) {
225 ek_mmc_data.slot[0].bus_width = 4; 214 ek_mmc_data.slot[0].bus_width = 4;
226 ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2; 215 ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2;
227 ek_mmc_data.slot[0].wp_pin = -1; 216 ek_mmc_data.slot[0].wp_pin = -1;
228 } 217 }
229 at91_add_device_mci(0, &ek_mmc_data); 218 at91_add_device_mci(0, &ek_mmc_data);
230#else
231 at91_add_device_mmc(0, &ek_mmc_data);
232#endif
233} 219}
234 220
235/* 221/*
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index e7dc3ead704..fb89ea92e3f 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -56,11 +56,12 @@ static struct usba_platform_data __initdata ek_usba_udc_data = {
56/* 56/*
57 * MCI (SD/MMC) 57 * MCI (SD/MMC)
58 */ 58 */
59static struct at91_mmc_data __initdata ek_mmc_data = { 59static struct mci_platform_data __initdata mci0_data = {
60 .wire4 = 1, 60 .slot[0] = {
61 .det_pin = AT91_PIN_PA15, 61 .bus_width = 4,
62 .wp_pin = -EINVAL, 62 .detect_pin = AT91_PIN_PA15,
63 .vcc_pin = -EINVAL, 63 .wp_pin = -EINVAL,
64 },
64}; 65};
65 66
66 67
@@ -303,7 +304,7 @@ static void __init ek_board_init(void)
303 /* SPI */ 304 /* SPI */
304 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); 305 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
305 /* MMC */ 306 /* MMC */
306 at91_add_device_mmc(0, &ek_mmc_data); 307 at91_add_device_mci(0, &mci0_data);
307 /* LCD Controller */ 308 /* LCD Controller */
308 at91_add_device_lcdc(&ek_lcdc_data); 309 at91_add_device_lcdc(&ek_lcdc_data);
309 /* AC97 */ 310 /* AC97 */
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
index 29eae1626bf..c3fb31d5116 100644
--- a/arch/arm/mach-at91/board-stamp9g20.c
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -83,7 +83,6 @@ static void __init add_device_nand(void)
83 * MCI (SD/MMC) 83 * MCI (SD/MMC)
84 * det_pin, wp_pin and vcc_pin are not connected 84 * det_pin, wp_pin and vcc_pin are not connected
85 */ 85 */
86#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
87static struct mci_platform_data __initdata mmc_data = { 86static struct mci_platform_data __initdata mmc_data = {
88 .slot[0] = { 87 .slot[0] = {
89 .bus_width = 4, 88 .bus_width = 4,
@@ -91,15 +90,6 @@ static struct mci_platform_data __initdata mmc_data = {
91 .wp_pin = -1, 90 .wp_pin = -1,
92 }, 91 },
93}; 92};
94#else
95static struct at91_mmc_data __initdata mmc_data = {
96 .slot_b = 0,
97 .wire4 = 1,
98 .det_pin = -EINVAL,
99 .wp_pin = -EINVAL,
100 .vcc_pin = -EINVAL,
101};
102#endif
103 93
104 94
105/* 95/*
@@ -223,11 +213,7 @@ void __init stamp9g20_board_init(void)
223 /* NAND */ 213 /* NAND */
224 add_device_nand(); 214 add_device_nand();
225 /* MMC */ 215 /* MMC */
226#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
227 at91_add_device_mci(0, &mmc_data); 216 at91_add_device_mci(0, &mmc_data);
228#else
229 at91_add_device_mmc(0, &mmc_data);
230#endif
231 /* W1 */ 217 /* W1 */
232 add_w1(); 218 add_w1();
233} 219}
diff --git a/arch/arm/mach-at91/board-usb-a926x.c b/arch/arm/mach-at91/board-usb-a926x.c
index c1476b9fe7b..6ea069b5733 100644
--- a/arch/arm/mach-at91/board-usb-a926x.c
+++ b/arch/arm/mach-at91/board-usb-a926x.c
@@ -109,14 +109,12 @@ static struct mmc_spi_platform_data at91_mmc_spi_pdata = {
109 * SPI devices. 109 * SPI devices.
110 */ 110 */
111static struct spi_board_info usb_a9263_spi_devices[] = { 111static struct spi_board_info usb_a9263_spi_devices[] = {
112#if !defined(CONFIG_MMC_AT91)
113 { /* DataFlash chip */ 112 { /* DataFlash chip */
114 .modalias = "mtd_dataflash", 113 .modalias = "mtd_dataflash",
115 .chip_select = 0, 114 .chip_select = 0,
116 .max_speed_hz = 15 * 1000 * 1000, 115 .max_speed_hz = 15 * 1000 * 1000,
117 .bus_num = 0, 116 .bus_num = 0,
118 } 117 }
119#endif
120}; 118};
121 119
122static struct spi_board_info usb_a9g20_spi_devices[] = { 120static struct spi_board_info usb_a9g20_spi_devices[] = {
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
index 516d340549d..f162fdfd66e 100644
--- a/arch/arm/mach-at91/board-yl-9200.c
+++ b/arch/arm/mach-at91/board-yl-9200.c
@@ -119,11 +119,12 @@ static struct at91_udc_data __initdata yl9200_udc_data = {
119/* 119/*
120 * MMC 120 * MMC
121 */ 121 */
122static struct at91_mmc_data __initdata yl9200_mmc_data = { 122static struct mci_platform_data __initdata yl9200_mci0_data = {
123 .det_pin = AT91_PIN_PB9, 123 .slot[0] = {
124 .wire4 = 1, 124 .bus_width = 4,
125 .wp_pin = -EINVAL, 125 .detect_pin = AT91_PIN_PB9,
126 .vcc_pin = -EINVAL, 126 .wp_pin = -EINVAL,
127 },
127}; 128};
128 129
129/* 130/*
@@ -541,9 +542,6 @@ void __init yl9200_add_device_video(void) {}
541 542
542static void __init yl9200_board_init(void) 543static void __init yl9200_board_init(void)
543{ 544{
544 /* Setup the LEDs D2=PB17 (timer), D3=PB16 (cpu) */
545 at91_init_leds(AT91_PIN_PB16, AT91_PIN_PB17);
546
547 /* Serial */ 545 /* Serial */
548 /* DBGU on ttyS0. (Rx & Tx only) */ 546 /* DBGU on ttyS0. (Rx & Tx only) */
549 at91_register_uart(0, 0, 0); 547 at91_register_uart(0, 0, 0);
@@ -568,7 +566,7 @@ static void __init yl9200_board_init(void)
568 /* I2C */ 566 /* I2C */
569 at91_add_device_i2c(yl9200_i2c_devices, ARRAY_SIZE(yl9200_i2c_devices)); 567 at91_add_device_i2c(yl9200_i2c_devices, ARRAY_SIZE(yl9200_i2c_devices));
570 /* MMC */ 568 /* MMC */
571 at91_add_device_mmc(0, &yl9200_mmc_data); 569 at91_add_device_mci(0, &yl9200_mci0_data);
572 /* NAND */ 570 /* NAND */
573 at91_add_device_nand(&yl9200_nand_data); 571 at91_add_device_nand(&yl9200_nand_data);
574 /* NOR Flash */ 572 /* NOR Flash */
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index 188c82971eb..33361505c0c 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -625,7 +625,7 @@ fail:
625 return 0; 625 return 0;
626} 626}
627 627
628static struct clk *const standard_pmc_clocks[] __initdata = { 628static struct clk *const standard_pmc_clocks[] __initconst = {
629 /* four primary clocks */ 629 /* four primary clocks */
630 &clk32k, 630 &clk32k,
631 &main_clk, 631 &main_clk,
diff --git a/arch/arm/mach-at91/include/mach/at91_twi.h b/arch/arm/mach-at91/include/mach/at91_twi.h
deleted file mode 100644
index bb2880f6ba3..00000000000
--- a/arch/arm/mach-at91/include/mach/at91_twi.h
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * arch/arm/mach-at91/include/mach/at91_twi.h
3 *
4 * Copyright (C) 2005 Ivan Kokshaysky
5 * Copyright (C) SAN People
6 *
7 * Two-wire Interface (TWI) registers.
8 * Based on AT91RM9200 datasheet revision E.
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; either version 2 of the License, or
13 * (at your option) any later version.
14 */
15
16#ifndef AT91_TWI_H
17#define AT91_TWI_H
18
19#define AT91_TWI_CR 0x00 /* Control Register */
20#define AT91_TWI_START (1 << 0) /* Send a Start Condition */
21#define AT91_TWI_STOP (1 << 1) /* Send a Stop Condition */
22#define AT91_TWI_MSEN (1 << 2) /* Master Transfer Enable */
23#define AT91_TWI_MSDIS (1 << 3) /* Master Transfer Disable */
24#define AT91_TWI_SVEN (1 << 4) /* Slave Transfer Enable [SAM9260 only] */
25#define AT91_TWI_SVDIS (1 << 5) /* Slave Transfer Disable [SAM9260 only] */
26#define AT91_TWI_SWRST (1 << 7) /* Software Reset */
27
28#define AT91_TWI_MMR 0x04 /* Master Mode Register */
29#define AT91_TWI_IADRSZ (3 << 8) /* Internal Device Address Size */
30#define AT91_TWI_IADRSZ_NO (0 << 8)
31#define AT91_TWI_IADRSZ_1 (1 << 8)
32#define AT91_TWI_IADRSZ_2 (2 << 8)
33#define AT91_TWI_IADRSZ_3 (3 << 8)
34#define AT91_TWI_MREAD (1 << 12) /* Master Read Direction */
35#define AT91_TWI_DADR (0x7f << 16) /* Device Address */
36
37#define AT91_TWI_SMR 0x08 /* Slave Mode Register [SAM9260 only] */
38#define AT91_TWI_SADR (0x7f << 16) /* Slave Address */
39
40#define AT91_TWI_IADR 0x0c /* Internal Address Register */
41
42#define AT91_TWI_CWGR 0x10 /* Clock Waveform Generator Register */
43#define AT91_TWI_CLDIV (0xff << 0) /* Clock Low Divisor */
44#define AT91_TWI_CHDIV (0xff << 8) /* Clock High Divisor */
45#define AT91_TWI_CKDIV (7 << 16) /* Clock Divider */
46
47#define AT91_TWI_SR 0x20 /* Status Register */
48#define AT91_TWI_TXCOMP (1 << 0) /* Transmission Complete */
49#define AT91_TWI_RXRDY (1 << 1) /* Receive Holding Register Ready */
50#define AT91_TWI_TXRDY (1 << 2) /* Transmit Holding Register Ready */
51#define AT91_TWI_SVREAD (1 << 3) /* Slave Read [SAM9260 only] */
52#define AT91_TWI_SVACC (1 << 4) /* Slave Access [SAM9260 only] */
53#define AT91_TWI_GACC (1 << 5) /* General Call Access [SAM9260 only] */
54#define AT91_TWI_OVRE (1 << 6) /* Overrun Error [AT91RM9200 only] */
55#define AT91_TWI_UNRE (1 << 7) /* Underrun Error [AT91RM9200 only] */
56#define AT91_TWI_NACK (1 << 8) /* Not Acknowledged */
57#define AT91_TWI_ARBLST (1 << 9) /* Arbitration Lost [SAM9260 only] */
58#define AT91_TWI_SCLWS (1 << 10) /* Clock Wait State [SAM9260 only] */
59#define AT91_TWI_EOSACC (1 << 11) /* End of Slave Address [SAM9260 only] */
60
61#define AT91_TWI_IER 0x24 /* Interrupt Enable Register */
62#define AT91_TWI_IDR 0x28 /* Interrupt Disable Register */
63#define AT91_TWI_IMR 0x2c /* Interrupt Mask Register */
64#define AT91_TWI_RHR 0x30 /* Receive Holding Register */
65#define AT91_TWI_THR 0x34 /* Transmit Holding Register */
66
67#endif
68
diff --git a/arch/arm/mach-at91/include/mach/at_hdmac.h b/arch/arm/mach-at91/include/mach/at_hdmac.h
deleted file mode 100644
index cab0997be3d..00000000000
--- a/arch/arm/mach-at91/include/mach/at_hdmac.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * Header file for the Atmel AHB DMA Controller driver
3 *
4 * Copyright (C) 2008 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11#ifndef AT_HDMAC_H
12#define AT_HDMAC_H
13
14#include <linux/dmaengine.h>
15
16/**
17 * struct at_dma_platform_data - Controller configuration parameters
18 * @nr_channels: Number of channels supported by hardware (max 8)
19 * @cap_mask: dma_capability flags supported by the platform
20 */
21struct at_dma_platform_data {
22 unsigned int nr_channels;
23 dma_cap_mask_t cap_mask;
24};
25
26/**
27 * struct at_dma_slave - Controller-specific information about a slave
28 * @dma_dev: required DMA master device
29 * @cfg: Platform-specific initializer for the CFG register
30 */
31struct at_dma_slave {
32 struct device *dma_dev;
33 u32 cfg;
34};
35
36
37/* Platform-configurable bits in CFG */
38#define ATC_SRC_PER(h) (0xFU & (h)) /* Channel src rq associated with periph handshaking ifc h */
39#define ATC_DST_PER(h) ((0xFU & (h)) << 4) /* Channel dst rq associated with periph handshaking ifc h */
40#define ATC_SRC_REP (0x1 << 8) /* Source Replay Mod */
41#define ATC_SRC_H2SEL (0x1 << 9) /* Source Handshaking Mod */
42#define ATC_SRC_H2SEL_SW (0x0 << 9)
43#define ATC_SRC_H2SEL_HW (0x1 << 9)
44#define ATC_DST_REP (0x1 << 12) /* Destination Replay Mod */
45#define ATC_DST_H2SEL (0x1 << 13) /* Destination Handshaking Mod */
46#define ATC_DST_H2SEL_SW (0x0 << 13)
47#define ATC_DST_H2SEL_HW (0x1 << 13)
48#define ATC_SOD (0x1 << 16) /* Stop On Done */
49#define ATC_LOCK_IF (0x1 << 20) /* Interface Lock */
50#define ATC_LOCK_B (0x1 << 21) /* AHB Bus Lock */
51#define ATC_LOCK_IF_L (0x1 << 22) /* Master Interface Arbiter Lock */
52#define ATC_LOCK_IF_L_CHUNK (0x0 << 22)
53#define ATC_LOCK_IF_L_BUFFER (0x1 << 22)
54#define ATC_AHB_PROT_MASK (0x7 << 24) /* AHB Protection */
55#define ATC_FIFOCFG_MASK (0x3 << 28) /* FIFO Request Configuration */
56#define ATC_FIFOCFG_LARGESTBURST (0x0 << 28)
57#define ATC_FIFOCFG_HALFFIFO (0x1 << 28)
58#define ATC_FIFOCFG_ENOUGHSPACE (0x2 << 28)
59
60
61#endif /* AT_HDMAC_H */
diff --git a/arch/arm/mach-at91/include/mach/atmel-mci.h b/arch/arm/mach-at91/include/mach/atmel-mci.h
index 998cb0c0713..cd580a12e90 100644
--- a/arch/arm/mach-at91/include/mach/atmel-mci.h
+++ b/arch/arm/mach-at91/include/mach/atmel-mci.h
@@ -1,7 +1,7 @@
1#ifndef __MACH_ATMEL_MCI_H 1#ifndef __MACH_ATMEL_MCI_H
2#define __MACH_ATMEL_MCI_H 2#define __MACH_ATMEL_MCI_H
3 3
4#include <mach/at_hdmac.h> 4#include <linux/platform_data/dma-atmel.h>
5 5
6/** 6/**
7 * struct mci_dma_data - DMA data for MCI interface 7 * struct mci_dma_data - DMA data for MCI interface
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index 369afc2ffc5..c55a4364ffb 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -187,7 +187,6 @@ struct at91_can_data {
187extern void __init at91_add_device_can(struct at91_can_data *data); 187extern void __init at91_add_device_can(struct at91_can_data *data);
188 188
189 /* LEDs */ 189 /* LEDs */
190extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
191extern void __init at91_gpio_leds(struct gpio_led *leds, int nr); 190extern void __init at91_gpio_leds(struct gpio_led *leds, int nr);
192extern void __init at91_pwm_leds(struct gpio_led *leds, int nr); 191extern void __init at91_pwm_leds(struct gpio_led *leds, int nr);
193 192
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h
index 09242b67d27..711a7892d33 100644
--- a/arch/arm/mach-at91/include/mach/hardware.h
+++ b/arch/arm/mach-at91/include/mach/hardware.h
@@ -67,13 +67,13 @@
67 * to 0xFEF78000 .. 0xFF000000. (544Kb) 67 * to 0xFEF78000 .. 0xFF000000. (544Kb)
68 */ 68 */
69#define AT91_IO_PHYS_BASE 0xFFF78000 69#define AT91_IO_PHYS_BASE 0xFFF78000
70#define AT91_IO_VIRT_BASE (0xFF000000 - AT91_IO_SIZE) 70#define AT91_IO_VIRT_BASE IOMEM(0xFF000000 - AT91_IO_SIZE)
71#else 71#else
72/* 72/*
73 * Identity mapping for the non MMU case. 73 * Identity mapping for the non MMU case.
74 */ 74 */
75#define AT91_IO_PHYS_BASE AT91_BASE_SYS 75#define AT91_IO_PHYS_BASE AT91_BASE_SYS
76#define AT91_IO_VIRT_BASE AT91_IO_PHYS_BASE 76#define AT91_IO_VIRT_BASE IOMEM(AT91_IO_PHYS_BASE)
77#endif 77#endif
78 78
79#define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1) 79#define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1)
diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h
index 6f6118d1576..97ad68a826f 100644
--- a/arch/arm/mach-at91/include/mach/uncompress.h
+++ b/arch/arm/mach-at91/include/mach/uncompress.h
@@ -94,7 +94,7 @@ static const u32 uarts_sam9x5[] = {
94 0, 94 0,
95}; 95};
96 96
97static inline const u32* decomp_soc_detect(u32 dbgu_base) 97static inline const u32* decomp_soc_detect(void __iomem *dbgu_base)
98{ 98{
99 u32 cidr, socid; 99 u32 cidr, socid;
100 100
@@ -142,10 +142,10 @@ static inline void arch_decomp_setup(void)
142 int i = 0; 142 int i = 0;
143 const u32* usarts; 143 const u32* usarts;
144 144
145 usarts = decomp_soc_detect(AT91_BASE_DBGU0); 145 usarts = decomp_soc_detect((void __iomem *)AT91_BASE_DBGU0);
146 146
147 if (!usarts) 147 if (!usarts)
148 usarts = decomp_soc_detect(AT91_BASE_DBGU1); 148 usarts = decomp_soc_detect((void __iomem *)AT91_BASE_DBGU1);
149 if (!usarts) { 149 if (!usarts) {
150 at91_uart = NULL; 150 at91_uart = NULL;
151 return; 151 return;
diff --git a/arch/arm/mach-at91/leds.c b/arch/arm/mach-at91/leds.c
index 8dfafe76ffe..1b1e62b5f41 100644
--- a/arch/arm/mach-at91/leds.c
+++ b/arch/arm/mach-at91/leds.c
@@ -90,108 +90,3 @@ void __init at91_pwm_leds(struct gpio_led *leds, int nr)
90#else 90#else
91void __init at91_pwm_leds(struct gpio_led *leds, int nr){} 91void __init at91_pwm_leds(struct gpio_led *leds, int nr){}
92#endif 92#endif
93
94
95/* ------------------------------------------------------------------------- */
96
97#if defined(CONFIG_LEDS)
98
99#include <asm/leds.h>
100
101/*
102 * Old ARM-specific LED framework; not fully functional when generic time is
103 * in use.
104 */
105
106static u8 at91_leds_cpu;
107static u8 at91_leds_timer;
108
109static inline void at91_led_on(unsigned int led)
110{
111 at91_set_gpio_value(led, 0);
112}
113
114static inline void at91_led_off(unsigned int led)
115{
116 at91_set_gpio_value(led, 1);
117}
118
119static inline void at91_led_toggle(unsigned int led)
120{
121 unsigned long is_off = at91_get_gpio_value(led);
122 if (is_off)
123 at91_led_on(led);
124 else
125 at91_led_off(led);
126}
127
128
129/*
130 * Handle LED events.
131 */
132static void at91_leds_event(led_event_t evt)
133{
134 unsigned long flags;
135
136 local_irq_save(flags);
137
138 switch(evt) {
139 case led_start: /* System startup */
140 at91_led_on(at91_leds_cpu);
141 break;
142
143 case led_stop: /* System stop / suspend */
144 at91_led_off(at91_leds_cpu);
145 break;
146
147#ifdef CONFIG_LEDS_TIMER
148 case led_timer: /* Every 50 timer ticks */
149 at91_led_toggle(at91_leds_timer);
150 break;
151#endif
152
153#ifdef CONFIG_LEDS_CPU
154 case led_idle_start: /* Entering idle state */
155 at91_led_off(at91_leds_cpu);
156 break;
157
158 case led_idle_end: /* Exit idle state */
159 at91_led_on(at91_leds_cpu);
160 break;
161#endif
162
163 default:
164 break;
165 }
166
167 local_irq_restore(flags);
168}
169
170
171static int __init leds_init(void)
172{
173 if (!at91_leds_timer || !at91_leds_cpu)
174 return -ENODEV;
175
176 leds_event = at91_leds_event;
177
178 leds_event(led_start);
179 return 0;
180}
181
182__initcall(leds_init);
183
184
185void __init at91_init_leds(u8 cpu_led, u8 timer_led)
186{
187 /* Enable GPIO to access the LEDs */
188 at91_set_gpio_output(cpu_led, 1);
189 at91_set_gpio_output(timer_led, 1);
190
191 at91_leds_cpu = cpu_led;
192 at91_leds_timer = timer_led;
193}
194
195#else
196void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
197#endif
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 2c2d86505a5..5315f05896e 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -153,7 +153,9 @@ static int at91_pm_verify_clocks(void)
153 } 153 }
154 } 154 }
155 155
156#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS 156 if (!IS_ENABLED(CONFIG_AT91_PROGRAMMABLE_CLOCKS))
157 return 1;
158
157 /* PCK0..PCK3 must be disabled, or configured to use clk32k */ 159 /* PCK0..PCK3 must be disabled, or configured to use clk32k */
158 for (i = 0; i < 4; i++) { 160 for (i = 0; i < 4; i++) {
159 u32 css; 161 u32 css;
@@ -167,7 +169,6 @@ static int at91_pm_verify_clocks(void)
167 return 0; 169 return 0;
168 } 170 }
169 } 171 }
170#endif
171 172
172 return 1; 173 return 1;
173} 174}
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 944bffb0899..da9881b161e 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -73,7 +73,7 @@ void __init at91_init_sram(int bank, unsigned long base, unsigned int length)
73{ 73{
74 struct map_desc *desc = &sram_desc[bank]; 74 struct map_desc *desc = &sram_desc[bank];
75 75
76 desc->virtual = AT91_IO_VIRT_BASE - length; 76 desc->virtual = (unsigned long)AT91_IO_VIRT_BASE - length;
77 if (bank > 0) 77 if (bank > 0)
78 desc->virtual -= sram_desc[bank - 1].length; 78 desc->virtual -= sram_desc[bank - 1].length;
79 79
@@ -87,8 +87,8 @@ void __init at91_init_sram(int bank, unsigned long base, unsigned int length)
87 iotable_init(desc, 1); 87 iotable_init(desc, 1);
88} 88}
89 89
90static struct map_desc at91_io_desc __initdata = { 90static struct map_desc at91_io_desc __initdata __maybe_unused = {
91 .virtual = AT91_VA_BASE_SYS, 91 .virtual = (unsigned long)AT91_VA_BASE_SYS,
92 .pfn = __phys_to_pfn(AT91_BASE_SYS), 92 .pfn = __phys_to_pfn(AT91_BASE_SYS),
93 .length = SZ_16K, 93 .length = SZ_16K,
94 .type = MT_DEVICE, 94 .type = MT_DEVICE,
diff --git a/arch/arm/mach-bcm2835/Makefile b/arch/arm/mach-bcm2835/Makefile
new file mode 100644
index 00000000000..4c3892fe02c
--- /dev/null
+++ b/arch/arm/mach-bcm2835/Makefile
@@ -0,0 +1 @@
obj-y += bcm2835.o
diff --git a/arch/arm/mach-bcm2835/Makefile.boot b/arch/arm/mach-bcm2835/Makefile.boot
new file mode 100644
index 00000000000..2d30e17f5b6
--- /dev/null
+++ b/arch/arm/mach-bcm2835/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000
diff --git a/arch/arm/mach-bcm2835/bcm2835.c b/arch/arm/mach-bcm2835/bcm2835.c
new file mode 100644
index 00000000000..f6fea493357
--- /dev/null
+++ b/arch/arm/mach-bcm2835/bcm2835.c
@@ -0,0 +1,64 @@
1/*
2 * Copyright (C) 2010 Broadcom
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#include <linux/init.h>
16#include <linux/irqchip/bcm2835.h>
17#include <linux/of_platform.h>
18#include <linux/bcm2835_timer.h>
19#include <linux/clk/bcm2835.h>
20
21#include <asm/mach/arch.h>
22#include <asm/mach/map.h>
23
24#include <mach/bcm2835_soc.h>
25
26static struct map_desc io_map __initdata = {
27 .virtual = BCM2835_PERIPH_VIRT,
28 .pfn = __phys_to_pfn(BCM2835_PERIPH_PHYS),
29 .length = BCM2835_PERIPH_SIZE,
30 .type = MT_DEVICE
31};
32
33void __init bcm2835_map_io(void)
34{
35 iotable_init(&io_map, 1);
36}
37
38void __init bcm2835_init(void)
39{
40 int ret;
41
42 bcm2835_init_clocks();
43
44 ret = of_platform_populate(NULL, of_default_bus_match_table, NULL,
45 NULL);
46 if (ret) {
47 pr_err("of_platform_populate failed: %d\n", ret);
48 BUG();
49 }
50}
51
52static const char * const bcm2835_compat[] = {
53 "brcm,bcm2835",
54 NULL
55};
56
57DT_MACHINE_START(BCM2835, "BCM2835")
58 .map_io = bcm2835_map_io,
59 .init_irq = bcm2835_init_irq,
60 .handle_irq = bcm2835_handle_irq,
61 .init_machine = bcm2835_init,
62 .timer = &bcm2835_timer,
63 .dt_compat = bcm2835_compat
64MACHINE_END
diff --git a/arch/arm/mach-picoxcell/include/mach/hardware.h b/arch/arm/mach-bcm2835/include/mach/bcm2835_soc.h
index 70ff58192ec..d4dfcf7a9cd 100644
--- a/arch/arm/mach-picoxcell/include/mach/hardware.h
+++ b/arch/arm/mach-bcm2835/include/mach/bcm2835_soc.h
@@ -1,7 +1,8 @@
1/* 1/*
2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles 2 * Copyright (C) 2012 Stephen Warren
3 * 3 *
4 * This file contains the hardware definitions of the picoXcell SoC devices. 4 * Derived from code:
5 * Copyright (C) 2010 Broadcom
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * 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 * it under the terms of the GNU General Public License as published by
@@ -13,9 +14,16 @@
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details. 15 * GNU General Public License for more details.
15 */ 16 */
16#ifndef __ASM_ARCH_HARDWARE_H
17#define __ASM_ARCH_HARDWARE_H
18 17
19#include <mach/picoxcell_soc.h> 18#ifndef __MACH_BCM2835_BCM2835_SOC_H__
19#define __MACH_BCM2835_BCM2835_SOC_H__
20
21#include <asm/sizes.h>
22
23#define BCM2835_PERIPH_PHYS 0x20000000
24#define BCM2835_PERIPH_VIRT 0xf0000000
25#define BCM2835_PERIPH_SIZE SZ_16M
26#define BCM2835_DEBUG_PHYS 0x20201000
27#define BCM2835_DEBUG_VIRT 0xf0201000
20 28
21#endif 29#endif
diff --git a/arch/arm/mach-bcm2835/include/mach/debug-macro.S b/arch/arm/mach-bcm2835/include/mach/debug-macro.S
new file mode 100644
index 00000000000..8a161e44ae2
--- /dev/null
+++ b/arch/arm/mach-bcm2835/include/mach/debug-macro.S
@@ -0,0 +1,21 @@
1/*
2 * Debugging macro include header
3 *
4 * Copyright (C) 2010 Broadcom
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#include <mach/bcm2835_soc.h>
15
16 .macro addruart, rp, rv, tmp
17 ldr \rp, =BCM2835_DEBUG_PHYS
18 ldr \rv, =BCM2835_DEBUG_VIRT
19 .endm
20
21#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mach-pnx4008/include/mach/param.h b/arch/arm/mach-bcm2835/include/mach/timex.h
index 6ea02f2176b..6d021e136ae 100644
--- a/arch/arm/mach-pnx4008/include/mach/param.h
+++ b/arch/arm/mach-bcm2835/include/mach/timex.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-pnx4008/include/mach/param.h 2 * BCM2835 system clock frequency
3 * 3 *
4 * Copyright (C) 1999 ARM Limited 4 * Copyright (C) 2010 Broadcom
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -18,4 +18,9 @@
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#define HZ 100 21#ifndef __ASM_ARCH_TIMEX_H
22#define __ASM_ARCH_TIMEX_H
23
24#define CLOCK_TICK_RATE (1000000)
25
26#endif
diff --git a/arch/arm/mach-bcm2835/include/mach/uncompress.h b/arch/arm/mach-bcm2835/include/mach/uncompress.h
new file mode 100644
index 00000000000..cc46dcc7237
--- /dev/null
+++ b/arch/arm/mach-bcm2835/include/mach/uncompress.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2010 Broadcom
3 * Copyright (C) 2003 ARM Limited
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include <linux/io.h>
17#include <linux/amba/serial.h>
18#include <mach/bcm2835_soc.h>
19
20#define UART0_BASE BCM2835_DEBUG_PHYS
21
22#define BCM2835_UART_DR IOMEM(UART0_BASE + UART01x_DR)
23#define BCM2835_UART_FR IOMEM(UART0_BASE + UART01x_FR)
24#define BCM2835_UART_CR IOMEM(UART0_BASE + UART011_CR)
25
26static inline void putc(int c)
27{
28 while (__raw_readl(BCM2835_UART_FR) & UART01x_FR_TXFF)
29 barrier();
30
31 __raw_writel(c, BCM2835_UART_DR);
32}
33
34static inline void flush(void)
35{
36 int fr;
37
38 do {
39 fr = __raw_readl(BCM2835_UART_FR);
40 barrier();
41 } while ((fr & (UART011_FR_TXFE | UART01x_FR_BUSY)) != UART011_FR_TXFE);
42}
43
44#define arch_decomp_setup()
45#define arch_decomp_wdog()
diff --git a/arch/arm/mach-bcmring/Kconfig b/arch/arm/mach-bcmring/Kconfig
deleted file mode 100644
index 9170d16dca5..00000000000
--- a/arch/arm/mach-bcmring/Kconfig
+++ /dev/null
@@ -1,19 +0,0 @@
1choice
2 prompt "Processor selection in BCMRING family of devices"
3 depends on ARCH_BCMRING
4 default ARCH_BCM11107
5
6config ARCH_FPGA11107
7 bool "FPGA11107"
8
9config ARCH_BCM11107
10 bool "BCM11107"
11endchoice
12
13menu "BCMRING Options"
14 depends on ARCH_BCMRING
15
16config BCM_ZRELADDR
17 hex "Compressed ZREL ADDR"
18
19endmenu
diff --git a/arch/arm/mach-bcmring/Makefile b/arch/arm/mach-bcmring/Makefile
deleted file mode 100644
index f8d9fcedf91..00000000000
--- a/arch/arm/mach-bcmring/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := arch.o mm.o irq.o clock.o core.o timer.o dma.o
8obj-y += csp/
diff --git a/arch/arm/mach-bcmring/Makefile.boot b/arch/arm/mach-bcmring/Makefile.boot
deleted file mode 100644
index aef2467757f..00000000000
--- a/arch/arm/mach-bcmring/Makefile.boot
+++ /dev/null
@@ -1,6 +0,0 @@
1# Address where decompressor will be written and eventually executed.
2#
3# default to SDRAM
4zreladdr-y += $(CONFIG_BCM_ZRELADDR)
5params_phys-y := 0x00000800
6
diff --git a/arch/arm/mach-bcmring/arch.c b/arch/arm/mach-bcmring/arch.c
deleted file mode 100644
index 45c97b1ee9b..00000000000
--- a/arch/arm/mach-bcmring/arch.c
+++ /dev/null
@@ -1,199 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#include <linux/kernel.h>
16#include <linux/platform_device.h>
17#include <linux/types.h>
18#include <linux/sched.h>
19#include <linux/interrupt.h>
20#include <linux/init.h>
21#include <linux/errno.h>
22#include <linux/spinlock.h>
23#include <linux/module.h>
24
25#include <linux/proc_fs.h>
26#include <linux/sysctl.h>
27
28#include <asm/irq.h>
29#include <asm/setup.h>
30#include <asm/mach-types.h>
31#include <asm/mach/time.h>
32#include <asm/pmu.h>
33
34#include <asm/mach/arch.h>
35#include <mach/dma.h>
36#include <mach/hardware.h>
37#include <mach/csp/mm_io.h>
38#include <mach/csp/chipcHw_def.h>
39#include <mach/csp/chipcHw_inline.h>
40
41#include <cfg_global.h>
42
43#include "core.h"
44
45HW_DECLARE_SPINLOCK(arch)
46HW_DECLARE_SPINLOCK(gpio)
47#if defined(CONFIG_DEBUG_SPINLOCK)
48 EXPORT_SYMBOL(bcmring_gpio_reg_lock);
49#endif
50
51/* sysctl */
52static int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */
53
54static void bcmring_restart(char mode, const char *cmd)
55{
56 printk("arch_reset:%c %x\n", mode, bcmring_arch_warm_reboot);
57
58 if (mode == 'h') {
59 /* Reboot configured in proc entry */
60 if (bcmring_arch_warm_reboot) {
61 printk("warm reset\n");
62 /* Issue Warm reset (do not reset ethernet switch, keep alive) */
63 chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_WARM);
64 } else {
65 /* Force reset of everything */
66 printk("force reset\n");
67 chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_SOFT);
68 }
69 } else {
70 /* Force reset of everything */
71 printk("force reset\n");
72 chipcHw_reset(chipcHw_REG_SOFT_RESET_CHIP_SOFT);
73 }
74}
75
76static struct ctl_table_header *bcmring_sysctl_header;
77
78static struct ctl_table bcmring_sysctl_warm_reboot[] = {
79 {
80 .procname = "warm",
81 .data = &bcmring_arch_warm_reboot,
82 .maxlen = sizeof(int),
83 .mode = 0644,
84 .proc_handler = proc_dointvec},
85 {}
86};
87
88static struct ctl_table bcmring_sysctl_reboot[] = {
89 {
90 .procname = "reboot",
91 .mode = 0555,
92 .child = bcmring_sysctl_warm_reboot},
93 {}
94};
95
96static struct resource nand_resource[] = {
97 [0] = {
98 .start = MM_ADDR_IO_NAND,
99 .end = MM_ADDR_IO_NAND + 0x1000 - 1,
100 .flags = IORESOURCE_MEM,
101 },
102};
103
104static struct platform_device nand_device = {
105 .name = "bcm-nand",
106 .id = -1,
107 .resource = nand_resource,
108 .num_resources = ARRAY_SIZE(nand_resource),
109};
110
111static struct resource pmu_resource = {
112 .start = IRQ_PMUIRQ,
113 .end = IRQ_PMUIRQ,
114 .flags = IORESOURCE_IRQ,
115};
116
117static struct platform_device pmu_device = {
118 .name = "arm-pmu",
119 .id = ARM_PMU_DEVICE_CPU,
120 .resource = &pmu_resource,
121 .num_resources = 1,
122};
123
124
125static struct platform_device *devices[] __initdata = {
126 &nand_device,
127 &pmu_device,
128};
129
130/****************************************************************************
131*
132* Called from the customize_machine function in arch/arm/kernel/setup.c
133*
134* The customize_machine function is tagged as an arch_initcall
135* (see include/linux/init.h for the order that the various init sections
136* are called in.
137*
138*****************************************************************************/
139static void __init bcmring_init_machine(void)
140{
141
142 bcmring_sysctl_header = register_sysctl_table(bcmring_sysctl_reboot);
143
144 /* Enable spread spectrum */
145 chipcHw_enableSpreadSpectrum();
146
147 platform_add_devices(devices, ARRAY_SIZE(devices));
148
149 bcmring_amba_init();
150
151 dma_init();
152}
153
154/****************************************************************************
155*
156* Called from setup_arch (in arch/arm/kernel/setup.c) to fixup any tags
157* passed in by the boot loader.
158*
159*****************************************************************************/
160
161static void __init bcmring_fixup(struct tag *t, char **cmdline,
162 struct meminfo *mi) {
163#ifdef CONFIG_BLK_DEV_INITRD
164 printk(KERN_NOTICE "bcmring_fixup\n");
165 t->hdr.tag = ATAG_CORE;
166 t->hdr.size = tag_size(tag_core);
167 t->u.core.flags = 0;
168 t->u.core.pagesize = PAGE_SIZE;
169 t->u.core.rootdev = 31 << 8 | 0;
170 t = tag_next(t);
171
172 t->hdr.tag = ATAG_MEM;
173 t->hdr.size = tag_size(tag_mem32);
174 t->u.mem.start = CFG_GLOBAL_RAM_BASE;
175 t->u.mem.size = CFG_GLOBAL_RAM_SIZE;
176
177 t = tag_next(t);
178
179 t->hdr.tag = ATAG_NONE;
180 t->hdr.size = 0;
181#endif
182}
183
184/****************************************************************************
185*
186* Machine Description
187*
188*****************************************************************************/
189
190MACHINE_START(BCMRING, "BCMRING")
191 /* Maintainer: Broadcom Corporation */
192 .fixup = bcmring_fixup,
193 .map_io = bcmring_map_io,
194 .init_early = bcmring_init_early,
195 .init_irq = bcmring_init_irq,
196 .timer = &bcmring_timer,
197 .init_machine = bcmring_init_machine,
198 .restart = bcmring_restart,
199MACHINE_END
diff --git a/arch/arm/mach-bcmring/clock.c b/arch/arm/mach-bcmring/clock.c
deleted file mode 100644
index ad237a42d26..00000000000
--- a/arch/arm/mach-bcmring/clock.c
+++ /dev/null
@@ -1,223 +0,0 @@
1/*****************************************************************************
2* Copyright 2001 - 2009 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#include <linux/module.h>
16#include <linux/kernel.h>
17#include <linux/device.h>
18#include <linux/list.h>
19#include <linux/errno.h>
20#include <linux/err.h>
21#include <linux/string.h>
22#include <linux/clk.h>
23#include <linux/spinlock.h>
24#include <linux/clkdev.h>
25#include <mach/csp/hw_cfg.h>
26#include <mach/csp/chipcHw_def.h>
27#include <mach/csp/chipcHw_reg.h>
28#include <mach/csp/chipcHw_inline.h>
29
30#include "clock.h"
31
32#define clk_is_primary(x) ((x)->type & CLK_TYPE_PRIMARY)
33#define clk_is_pll1(x) ((x)->type & CLK_TYPE_PLL1)
34#define clk_is_pll2(x) ((x)->type & CLK_TYPE_PLL2)
35#define clk_is_programmable(x) ((x)->type & CLK_TYPE_PROGRAMMABLE)
36#define clk_is_bypassable(x) ((x)->type & CLK_TYPE_BYPASSABLE)
37
38#define clk_is_using_xtal(x) ((x)->mode & CLK_MODE_XTAL)
39
40static DEFINE_SPINLOCK(clk_lock);
41
42static void __clk_enable(struct clk *clk)
43{
44 if (!clk)
45 return;
46
47 /* enable parent clock first */
48 if (clk->parent)
49 __clk_enable(clk->parent);
50
51 if (clk->use_cnt++ == 0) {
52 if (clk_is_pll1(clk)) { /* PLL1 */
53 chipcHw_pll1Enable(clk->rate_hz, 0);
54 } else if (clk_is_pll2(clk)) { /* PLL2 */
55 chipcHw_pll2Enable(clk->rate_hz);
56 } else if (clk_is_using_xtal(clk)) { /* source is crystal */
57 if (!clk_is_primary(clk))
58 chipcHw_bypassClockEnable(clk->csp_id);
59 } else { /* source is PLL */
60 chipcHw_setClockEnable(clk->csp_id);
61 }
62 }
63}
64
65int clk_enable(struct clk *clk)
66{
67 unsigned long flags;
68
69 if (!clk)
70 return -EINVAL;
71
72 spin_lock_irqsave(&clk_lock, flags);
73 __clk_enable(clk);
74 spin_unlock_irqrestore(&clk_lock, flags);
75
76 return 0;
77}
78EXPORT_SYMBOL(clk_enable);
79
80static void __clk_disable(struct clk *clk)
81{
82 if (!clk)
83 return;
84
85 BUG_ON(clk->use_cnt == 0);
86
87 if (--clk->use_cnt == 0) {
88 if (clk_is_pll1(clk)) { /* PLL1 */
89 chipcHw_pll1Disable();
90 } else if (clk_is_pll2(clk)) { /* PLL2 */
91 chipcHw_pll2Disable();
92 } else if (clk_is_using_xtal(clk)) { /* source is crystal */
93 if (!clk_is_primary(clk))
94 chipcHw_bypassClockDisable(clk->csp_id);
95 } else { /* source is PLL */
96 chipcHw_setClockDisable(clk->csp_id);
97 }
98 }
99
100 if (clk->parent)
101 __clk_disable(clk->parent);
102}
103
104void clk_disable(struct clk *clk)
105{
106 unsigned long flags;
107
108 if (!clk)
109 return;
110
111 spin_lock_irqsave(&clk_lock, flags);
112 __clk_disable(clk);
113 spin_unlock_irqrestore(&clk_lock, flags);
114}
115EXPORT_SYMBOL(clk_disable);
116
117unsigned long clk_get_rate(struct clk *clk)
118{
119 if (!clk)
120 return 0;
121
122 return clk->rate_hz;
123}
124EXPORT_SYMBOL(clk_get_rate);
125
126long clk_round_rate(struct clk *clk, unsigned long rate)
127{
128 unsigned long flags;
129 unsigned long actual;
130 unsigned long rate_hz;
131
132 if (!clk)
133 return -EINVAL;
134
135 if (!clk_is_programmable(clk))
136 return -EINVAL;
137
138 if (clk->use_cnt)
139 return -EBUSY;
140
141 spin_lock_irqsave(&clk_lock, flags);
142 actual = clk->parent->rate_hz;
143 rate_hz = min(actual, rate);
144 spin_unlock_irqrestore(&clk_lock, flags);
145
146 return rate_hz;
147}
148EXPORT_SYMBOL(clk_round_rate);
149
150int clk_set_rate(struct clk *clk, unsigned long rate)
151{
152 unsigned long flags;
153 unsigned long actual;
154 unsigned long rate_hz;
155
156 if (!clk)
157 return -EINVAL;
158
159 if (!clk_is_programmable(clk))
160 return -EINVAL;
161
162 if (clk->use_cnt)
163 return -EBUSY;
164
165 spin_lock_irqsave(&clk_lock, flags);
166 actual = clk->parent->rate_hz;
167 rate_hz = min(actual, rate);
168 rate_hz = chipcHw_setClockFrequency(clk->csp_id, rate_hz);
169 clk->rate_hz = rate_hz;
170 spin_unlock_irqrestore(&clk_lock, flags);
171
172 return 0;
173}
174EXPORT_SYMBOL(clk_set_rate);
175
176struct clk *clk_get_parent(struct clk *clk)
177{
178 if (!clk)
179 return NULL;
180
181 return clk->parent;
182}
183EXPORT_SYMBOL(clk_get_parent);
184
185int clk_set_parent(struct clk *clk, struct clk *parent)
186{
187 unsigned long flags;
188 struct clk *old_parent;
189
190 if (!clk || !parent)
191 return -EINVAL;
192
193 if (!clk_is_primary(parent) || !clk_is_bypassable(clk))
194 return -EINVAL;
195
196 /* if more than one user, parent is not allowed */
197 if (clk->use_cnt > 1)
198 return -EBUSY;
199
200 if (clk->parent == parent)
201 return 0;
202
203 spin_lock_irqsave(&clk_lock, flags);
204 old_parent = clk->parent;
205 clk->parent = parent;
206 if (clk_is_using_xtal(parent))
207 clk->mode |= CLK_MODE_XTAL;
208 else
209 clk->mode &= (~CLK_MODE_XTAL);
210
211 /* if clock is active */
212 if (clk->use_cnt != 0) {
213 clk->use_cnt--;
214 /* enable clock with the new parent */
215 __clk_enable(clk);
216 /* disable the old parent */
217 __clk_disable(old_parent);
218 }
219 spin_unlock_irqrestore(&clk_lock, flags);
220
221 return 0;
222}
223EXPORT_SYMBOL(clk_set_parent);
diff --git a/arch/arm/mach-bcmring/clock.h b/arch/arm/mach-bcmring/clock.h
deleted file mode 100644
index 5e0b9813897..00000000000
--- a/arch/arm/mach-bcmring/clock.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*****************************************************************************
2* Copyright 2001 - 2009 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14#include <mach/csp/chipcHw_def.h>
15
16#define CLK_TYPE_PRIMARY 1 /* primary clock must NOT have a parent */
17#define CLK_TYPE_PLL1 2 /* PPL1 */
18#define CLK_TYPE_PLL2 4 /* PPL2 */
19#define CLK_TYPE_PROGRAMMABLE 8 /* programmable clock rate */
20#define CLK_TYPE_BYPASSABLE 16 /* parent can be changed */
21
22#define CLK_MODE_XTAL 1 /* clock source is from crystal */
23
24struct clk {
25 const char *name; /* clock name */
26 unsigned int type; /* clock type */
27 unsigned int mode; /* current mode */
28 volatile int use_bypass; /* indicate if it's in bypass mode */
29 chipcHw_CLOCK_e csp_id; /* clock ID for CSP CHIPC */
30 unsigned long rate_hz; /* clock rate in Hz */
31 unsigned int use_cnt; /* usage count */
32 struct clk *parent; /* parent clock */
33};
diff --git a/arch/arm/mach-bcmring/core.c b/arch/arm/mach-bcmring/core.c
deleted file mode 100644
index adbfb199458..00000000000
--- a/arch/arm/mach-bcmring/core.c
+++ /dev/null
@@ -1,228 +0,0 @@
1/*
2 * derived from linux/arch/arm/mach-versatile/core.c
3 * linux/arch/arm/mach-bcmring/core.c
4 *
5 * Copyright (C) 1999 - 2003 ARM Limited
6 * Copyright (C) 2000 Deep Blue Solutions Ltd
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/* Portions copyright Broadcom 2008 */
23
24#include <linux/init.h>
25#include <linux/device.h>
26#include <linux/dma-mapping.h>
27#include <linux/platform_device.h>
28#include <linux/interrupt.h>
29#include <linux/amba/bus.h>
30#include <linux/clkdev.h>
31
32#include <mach/csp/mm_addr.h>
33#include <mach/hardware.h>
34#include <linux/io.h>
35#include <asm/irq.h>
36#include <asm/hardware/arm_timer.h>
37#include <asm/hardware/timer-sp.h>
38#include <asm/mach-types.h>
39
40#include <asm/mach/arch.h>
41#include <asm/mach/flash.h>
42#include <asm/mach/irq.h>
43#include <asm/mach/time.h>
44#include <asm/mach/map.h>
45
46#include <cfg_global.h>
47
48#include "clock.h"
49
50#include <csp/secHw.h>
51#include <mach/csp/secHw_def.h>
52#include <mach/csp/chipcHw_inline.h>
53#include <mach/csp/tmrHw_reg.h>
54
55static AMBA_APB_DEVICE(uartA, "uartA", 0, MM_ADDR_IO_UARTA, {IRQ_UARTA}, NULL);
56static AMBA_APB_DEVICE(uartB, "uartB", 0, MM_ADDR_IO_UARTB, {IRQ_UARTB}, NULL);
57
58static struct clk pll1_clk = {
59 .name = "PLL1",
60 .type = CLK_TYPE_PRIMARY | CLK_TYPE_PLL1,
61 .rate_hz = 2000000000,
62 .use_cnt = 7,
63};
64
65static struct clk uart_clk = {
66 .name = "UART",
67 .type = CLK_TYPE_PROGRAMMABLE,
68 .csp_id = chipcHw_CLOCK_UART,
69 .rate_hz = HW_CFG_UART_CLK_HZ,
70 .parent = &pll1_clk,
71};
72
73static struct clk dummy_apb_pclk = {
74 .name = "BUSCLK",
75 .type = CLK_TYPE_PRIMARY,
76 .mode = CLK_MODE_XTAL,
77};
78
79/* Timer 0 - 25 MHz, Timer3 at bus clock rate, typically 150-166 MHz */
80#if defined(CONFIG_ARCH_FPGA11107)
81/* fpga cpu/bus are currently 30 times slower so scale frequency as well to */
82/* slow down Linux's sense of time */
83#define TIMER0_FREQUENCY_MHZ (tmrHw_LOW_FREQUENCY_MHZ * 30)
84#define TIMER1_FREQUENCY_MHZ (tmrHw_LOW_FREQUENCY_MHZ * 30)
85#define TIMER3_FREQUENCY_MHZ (tmrHw_HIGH_FREQUENCY_MHZ * 30)
86#define TIMER3_FREQUENCY_KHZ (tmrHw_HIGH_FREQUENCY_HZ / 1000 * 30)
87#else
88#define TIMER0_FREQUENCY_MHZ tmrHw_LOW_FREQUENCY_MHZ
89#define TIMER1_FREQUENCY_MHZ tmrHw_LOW_FREQUENCY_MHZ
90#define TIMER3_FREQUENCY_MHZ tmrHw_HIGH_FREQUENCY_MHZ
91#define TIMER3_FREQUENCY_KHZ (tmrHw_HIGH_FREQUENCY_HZ / 1000)
92#endif
93
94static struct clk sp804_timer012_clk = {
95 .name = "sp804-timer-0,1,2",
96 .type = CLK_TYPE_PRIMARY,
97 .mode = CLK_MODE_XTAL,
98 .rate_hz = TIMER1_FREQUENCY_MHZ * 1000000,
99};
100
101static struct clk sp804_timer3_clk = {
102 .name = "sp804-timer-3",
103 .type = CLK_TYPE_PRIMARY,
104 .mode = CLK_MODE_XTAL,
105 .rate_hz = TIMER3_FREQUENCY_KHZ * 1000,
106};
107
108static struct clk_lookup lookups[] = {
109 { /* Bus clock */
110 .con_id = "apb_pclk",
111 .clk = &dummy_apb_pclk,
112 }, { /* UART0 */
113 .dev_id = "uarta",
114 .clk = &uart_clk,
115 }, { /* UART1 */
116 .dev_id = "uartb",
117 .clk = &uart_clk,
118 }, { /* SP804 timer 0 */
119 .dev_id = "sp804",
120 .con_id = "timer0",
121 .clk = &sp804_timer012_clk,
122 }, { /* SP804 timer 1 */
123 .dev_id = "sp804",
124 .con_id = "timer1",
125 .clk = &sp804_timer012_clk,
126 }, { /* SP804 timer 3 */
127 .dev_id = "sp804",
128 .con_id = "timer3",
129 .clk = &sp804_timer3_clk,
130 }
131};
132
133static struct amba_device *amba_devs[] __initdata = {
134 &uartA_device,
135 &uartB_device,
136};
137
138void __init bcmring_amba_init(void)
139{
140 int i;
141 u32 bus_clock;
142
143/* Linux is run initially in non-secure mode. Secure peripherals */
144/* generate FIQ, and must be handled in secure mode. Until we have */
145/* a linux security monitor implementation, keep everything in */
146/* non-secure mode. */
147 chipcHw_busInterfaceClockEnable(chipcHw_REG_BUS_CLOCK_SPU);
148 secHw_setUnsecure(secHw_BLK_MASK_CHIP_CONTROL |
149 secHw_BLK_MASK_KEY_SCAN |
150 secHw_BLK_MASK_TOUCH_SCREEN |
151 secHw_BLK_MASK_UART0 |
152 secHw_BLK_MASK_UART1 |
153 secHw_BLK_MASK_WATCHDOG |
154 secHw_BLK_MASK_SPUM |
155 secHw_BLK_MASK_DDR2 |
156 secHw_BLK_MASK_SPU |
157 secHw_BLK_MASK_PKA |
158 secHw_BLK_MASK_RNG |
159 secHw_BLK_MASK_RTC |
160 secHw_BLK_MASK_OTP |
161 secHw_BLK_MASK_BOOT |
162 secHw_BLK_MASK_MPU |
163 secHw_BLK_MASK_TZCTRL | secHw_BLK_MASK_INTR);
164
165 /* Only the devices attached to the AMBA bus are enabled just before the bus is */
166 /* scanned and the drivers are loaded. The clocks need to be on for the AMBA bus */
167 /* driver to access these blocks. The bus is probed, and the drivers are loaded. */
168 /* FIXME Need to remove enable of PIF once CLCD clock enable used properly in FPGA. */
169 bus_clock = chipcHw_REG_BUS_CLOCK_GE
170 | chipcHw_REG_BUS_CLOCK_SDIO0 | chipcHw_REG_BUS_CLOCK_SDIO1;
171
172 chipcHw_busInterfaceClockEnable(bus_clock);
173
174 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
175 struct amba_device *d = amba_devs[i];
176 amba_device_register(d, &iomem_resource);
177 }
178}
179
180/*
181 * Where is the timer (VA)?
182 */
183#define TIMER0_VA_BASE ((void __iomem *)MM_IO_BASE_TMR)
184#define TIMER1_VA_BASE ((void __iomem *)(MM_IO_BASE_TMR + 0x20))
185#define TIMER2_VA_BASE ((void __iomem *)(MM_IO_BASE_TMR + 0x40))
186#define TIMER3_VA_BASE ((void __iomem *)(MM_IO_BASE_TMR + 0x60))
187
188static int __init bcmring_clocksource_init(void)
189{
190 /* setup timer1 as free-running clocksource */
191 sp804_clocksource_init(TIMER1_VA_BASE, "timer1");
192
193 /* setup timer3 as free-running clocksource */
194 sp804_clocksource_init(TIMER3_VA_BASE, "timer3");
195
196 return 0;
197}
198
199/*
200 * Set up timer interrupt, and return the current time in seconds.
201 */
202void __init bcmring_init_timer(void)
203{
204 printk(KERN_INFO "bcmring_init_timer\n");
205 /*
206 * Initialise to a known state (all timers off)
207 */
208 writel(0, TIMER0_VA_BASE + TIMER_CTRL);
209 writel(0, TIMER1_VA_BASE + TIMER_CTRL);
210 writel(0, TIMER2_VA_BASE + TIMER_CTRL);
211 writel(0, TIMER3_VA_BASE + TIMER_CTRL);
212
213 /*
214 * Make irqs happen for the system timer
215 */
216 bcmring_clocksource_init();
217
218 sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMER0, "timer0");
219}
220
221struct sys_timer bcmring_timer = {
222 .init = bcmring_init_timer,
223};
224
225void __init bcmring_init_early(void)
226{
227 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
228}
diff --git a/arch/arm/mach-bcmring/core.h b/arch/arm/mach-bcmring/core.h
deleted file mode 100644
index e0e02c48f9b..00000000000
--- a/arch/arm/mach-bcmring/core.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * linux/arch/arm/mach-versatile/core.h
3 *
4 * Copyright (C) 2004 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/* Portions copyright Broadcom 2008 */
22#ifndef __ASM_ARCH_BCMRING_H
23#define __ASM_ARCH_BCMRING_H
24
25void __init bcmring_amba_init(void);
26void __init bcmring_map_io(void);
27void __init bcmring_init_irq(void);
28void __init bcmring_init_early(void);
29
30extern struct sys_timer bcmring_timer;
31#endif
diff --git a/arch/arm/mach-bcmring/csp/Makefile b/arch/arm/mach-bcmring/csp/Makefile
deleted file mode 100644
index 648c0377530..00000000000
--- a/arch/arm/mach-bcmring/csp/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
1obj-y += dmac/
2obj-y += tmr/
3obj-y += chipc/
diff --git a/arch/arm/mach-bcmring/csp/chipc/Makefile b/arch/arm/mach-bcmring/csp/chipc/Makefile
deleted file mode 100644
index 673952768ee..00000000000
--- a/arch/arm/mach-bcmring/csp/chipc/Makefile
+++ /dev/null
@@ -1 +0,0 @@
1obj-y += chipcHw.o chipcHw_str.o chipcHw_reset.o chipcHw_init.o
diff --git a/arch/arm/mach-bcmring/csp/chipc/chipcHw.c b/arch/arm/mach-bcmring/csp/chipc/chipcHw.c
deleted file mode 100644
index 96273ff3495..00000000000
--- a/arch/arm/mach-bcmring/csp/chipc/chipcHw.c
+++ /dev/null
@@ -1,776 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file chipcHw.c
18*
19* @brief Low level Various CHIP clock controlling routines
20*
21* @note
22*
23* These routines provide basic clock controlling functionality only.
24*/
25/****************************************************************************/
26
27/* ---- Include Files ---------------------------------------------------- */
28
29#include <csp/errno.h>
30#include <csp/stdint.h>
31#include <csp/module.h>
32
33#include <mach/csp/chipcHw_def.h>
34#include <mach/csp/chipcHw_inline.h>
35
36#include <csp/reg.h>
37#include <csp/delay.h>
38
39/* ---- Private Constants and Types --------------------------------------- */
40
41/* VPM alignment algorithm uses this */
42#define MAX_PHASE_ADJUST_COUNT 0xFFFF /* Max number of times allowed to adjust the phase */
43#define MAX_PHASE_ALIGN_ATTEMPTS 10 /* Max number of attempt to align the phase */
44
45/* Local definition of clock type */
46#define PLL_CLOCK 1 /* PLL Clock */
47#define NON_PLL_CLOCK 2 /* Divider clock */
48
49static int chipcHw_divide(int num, int denom)
50 __attribute__ ((section(".aramtext")));
51
52/****************************************************************************/
53/**
54* @brief Set clock fequency for miscellaneous configurable clocks
55*
56* This function sets clock frequency
57*
58* @return Configured clock frequency in hertz
59*
60*/
61/****************************************************************************/
62chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configurable clock */
63 ) {
64 volatile uint32_t *pPLLReg = (uint32_t *) 0x0;
65 volatile uint32_t *pClockCtrl = (uint32_t *) 0x0;
66 volatile uint32_t *pDependentClock = (uint32_t *) 0x0;
67 uint32_t vcoFreqPll1Hz = 0; /* Effective VCO frequency for PLL1 in Hz */
68 uint32_t vcoFreqPll2Hz = 0; /* Effective VCO frequency for PLL2 in Hz */
69 uint32_t dependentClockType = 0;
70 uint32_t vcoHz = 0;
71
72 /* Get VCO frequencies */
73 if ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) {
74 uint64_t adjustFreq = 0;
75
76 vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz *
77 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
78 ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
79 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT);
80
81 /* Adjusted frequency due to chipcHw_REG_PLL_DIVIDER_NDIV_f_SS */
82 adjustFreq = (uint64_t) chipcHw_XTAL_FREQ_Hz *
83 (uint64_t) chipcHw_REG_PLL_DIVIDER_NDIV_f_SS *
84 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, (chipcHw_REG_PLL_PREDIVIDER_P2 * (uint64_t) chipcHw_REG_PLL_DIVIDER_FRAC));
85 vcoFreqPll1Hz += (uint32_t) adjustFreq;
86 } else {
87 vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz *
88 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
89 ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
90 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT);
91 }
92 vcoFreqPll2Hz =
93 chipcHw_XTAL_FREQ_Hz *
94 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
95 ((pChipcHw->PLLPreDivider2 & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
96 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT);
97
98 switch (clock) {
99 case chipcHw_CLOCK_DDR:
100 pPLLReg = &pChipcHw->DDRClock;
101 vcoHz = vcoFreqPll1Hz;
102 break;
103 case chipcHw_CLOCK_ARM:
104 pPLLReg = &pChipcHw->ARMClock;
105 vcoHz = vcoFreqPll1Hz;
106 break;
107 case chipcHw_CLOCK_ESW:
108 pPLLReg = &pChipcHw->ESWClock;
109 vcoHz = vcoFreqPll1Hz;
110 break;
111 case chipcHw_CLOCK_VPM:
112 pPLLReg = &pChipcHw->VPMClock;
113 vcoHz = vcoFreqPll1Hz;
114 break;
115 case chipcHw_CLOCK_ESW125:
116 pPLLReg = &pChipcHw->ESW125Clock;
117 vcoHz = vcoFreqPll1Hz;
118 break;
119 case chipcHw_CLOCK_UART:
120 pPLLReg = &pChipcHw->UARTClock;
121 vcoHz = vcoFreqPll1Hz;
122 break;
123 case chipcHw_CLOCK_SDIO0:
124 pPLLReg = &pChipcHw->SDIO0Clock;
125 vcoHz = vcoFreqPll1Hz;
126 break;
127 case chipcHw_CLOCK_SDIO1:
128 pPLLReg = &pChipcHw->SDIO1Clock;
129 vcoHz = vcoFreqPll1Hz;
130 break;
131 case chipcHw_CLOCK_SPI:
132 pPLLReg = &pChipcHw->SPIClock;
133 vcoHz = vcoFreqPll1Hz;
134 break;
135 case chipcHw_CLOCK_ETM:
136 pPLLReg = &pChipcHw->ETMClock;
137 vcoHz = vcoFreqPll1Hz;
138 break;
139 case chipcHw_CLOCK_USB:
140 pPLLReg = &pChipcHw->USBClock;
141 vcoHz = vcoFreqPll2Hz;
142 break;
143 case chipcHw_CLOCK_LCD:
144 pPLLReg = &pChipcHw->LCDClock;
145 vcoHz = vcoFreqPll2Hz;
146 break;
147 case chipcHw_CLOCK_APM:
148 pPLLReg = &pChipcHw->APMClock;
149 vcoHz = vcoFreqPll2Hz;
150 break;
151 case chipcHw_CLOCK_BUS:
152 pClockCtrl = &pChipcHw->ACLKClock;
153 pDependentClock = &pChipcHw->ARMClock;
154 vcoHz = vcoFreqPll1Hz;
155 dependentClockType = PLL_CLOCK;
156 break;
157 case chipcHw_CLOCK_OTP:
158 pClockCtrl = &pChipcHw->OTPClock;
159 break;
160 case chipcHw_CLOCK_I2C:
161 pClockCtrl = &pChipcHw->I2CClock;
162 break;
163 case chipcHw_CLOCK_I2S0:
164 pClockCtrl = &pChipcHw->I2S0Clock;
165 break;
166 case chipcHw_CLOCK_RTBUS:
167 pClockCtrl = &pChipcHw->RTBUSClock;
168 pDependentClock = &pChipcHw->ACLKClock;
169 dependentClockType = NON_PLL_CLOCK;
170 break;
171 case chipcHw_CLOCK_APM100:
172 pClockCtrl = &pChipcHw->APM100Clock;
173 pDependentClock = &pChipcHw->APMClock;
174 vcoHz = vcoFreqPll2Hz;
175 dependentClockType = PLL_CLOCK;
176 break;
177 case chipcHw_CLOCK_TSC:
178 pClockCtrl = &pChipcHw->TSCClock;
179 break;
180 case chipcHw_CLOCK_LED:
181 pClockCtrl = &pChipcHw->LEDClock;
182 break;
183 case chipcHw_CLOCK_I2S1:
184 pClockCtrl = &pChipcHw->I2S1Clock;
185 break;
186 }
187
188 if (pPLLReg) {
189 /* Obtain PLL clock frequency */
190 if (*pPLLReg & chipcHw_REG_PLL_CLOCK_BYPASS_SELECT) {
191 /* Return crystal clock frequency when bypassed */
192 return chipcHw_XTAL_FREQ_Hz;
193 } else if (clock == chipcHw_CLOCK_DDR) {
194 /* DDR frequency is configured in PLLDivider register */
195 return chipcHw_divide (vcoHz, (((pChipcHw->PLLDivider & 0xFF000000) >> 24) ? ((pChipcHw->PLLDivider & 0xFF000000) >> 24) : 256));
196 } else {
197 /* From chip revision number B0, LCD clock is internally divided by 2 */
198 if ((pPLLReg == &pChipcHw->LCDClock) && (chipcHw_getChipRevisionNumber() != chipcHw_REV_NUMBER_A0)) {
199 vcoHz >>= 1;
200 }
201 /* Obtain PLL clock frequency using VCO dividers */
202 return chipcHw_divide(vcoHz, ((*pPLLReg & chipcHw_REG_PLL_CLOCK_MDIV_MASK) ? (*pPLLReg & chipcHw_REG_PLL_CLOCK_MDIV_MASK) : 256));
203 }
204 } else if (pClockCtrl) {
205 /* Obtain divider clock frequency */
206 uint32_t div;
207 uint32_t freq = 0;
208
209 if (*pClockCtrl & chipcHw_REG_DIV_CLOCK_BYPASS_SELECT) {
210 /* Return crystal clock frequency when bypassed */
211 return chipcHw_XTAL_FREQ_Hz;
212 } else if (pDependentClock) {
213 /* Identify the dependent clock frequency */
214 switch (dependentClockType) {
215 case PLL_CLOCK:
216 if (*pDependentClock & chipcHw_REG_PLL_CLOCK_BYPASS_SELECT) {
217 /* Use crystal clock frequency when dependent PLL clock is bypassed */
218 freq = chipcHw_XTAL_FREQ_Hz;
219 } else {
220 /* Obtain PLL clock frequency using VCO dividers */
221 div = *pDependentClock & chipcHw_REG_PLL_CLOCK_MDIV_MASK;
222 freq = div ? chipcHw_divide(vcoHz, div) : 0;
223 }
224 break;
225 case NON_PLL_CLOCK:
226 if (pDependentClock == (uint32_t *) &pChipcHw->ACLKClock) {
227 freq = chipcHw_getClockFrequency (chipcHw_CLOCK_BUS);
228 } else {
229 if (*pDependentClock & chipcHw_REG_DIV_CLOCK_BYPASS_SELECT) {
230 /* Use crystal clock frequency when dependent divider clock is bypassed */
231 freq = chipcHw_XTAL_FREQ_Hz;
232 } else {
233 /* Obtain divider clock frequency using XTAL dividers */
234 div = *pDependentClock & chipcHw_REG_DIV_CLOCK_DIV_MASK;
235 freq = chipcHw_divide (chipcHw_XTAL_FREQ_Hz, (div ? div : 256));
236 }
237 }
238 break;
239 }
240 } else {
241 /* Dependent on crystal clock */
242 freq = chipcHw_XTAL_FREQ_Hz;
243 }
244
245 div = *pClockCtrl & chipcHw_REG_DIV_CLOCK_DIV_MASK;
246 return chipcHw_divide(freq, (div ? div : 256));
247 }
248 return 0;
249}
250
251/****************************************************************************/
252/**
253* @brief Set clock fequency for miscellaneous configurable clocks
254*
255* This function sets clock frequency
256*
257* @return Configured clock frequency in Hz
258*
259*/
260/****************************************************************************/
261chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configurable clock */
262 uint32_t freq /* [ IN ] Clock frequency in Hz */
263 ) {
264 volatile uint32_t *pPLLReg = (uint32_t *) 0x0;
265 volatile uint32_t *pClockCtrl = (uint32_t *) 0x0;
266 volatile uint32_t *pDependentClock = (uint32_t *) 0x0;
267 uint32_t vcoFreqPll1Hz = 0; /* Effective VCO frequency for PLL1 in Hz */
268 uint32_t desVcoFreqPll1Hz = 0; /* Desired VCO frequency for PLL1 in Hz */
269 uint32_t vcoFreqPll2Hz = 0; /* Effective VCO frequency for PLL2 in Hz */
270 uint32_t dependentClockType = 0;
271 uint32_t vcoHz = 0;
272 uint32_t desVcoHz = 0;
273
274 /* Get VCO frequencies */
275 if ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) {
276 uint64_t adjustFreq = 0;
277
278 vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz *
279 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
280 ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
281 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT);
282
283 /* Adjusted frequency due to chipcHw_REG_PLL_DIVIDER_NDIV_f_SS */
284 adjustFreq = (uint64_t) chipcHw_XTAL_FREQ_Hz *
285 (uint64_t) chipcHw_REG_PLL_DIVIDER_NDIV_f_SS *
286 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, (chipcHw_REG_PLL_PREDIVIDER_P2 * (uint64_t) chipcHw_REG_PLL_DIVIDER_FRAC));
287 vcoFreqPll1Hz += (uint32_t) adjustFreq;
288
289 /* Desired VCO frequency */
290 desVcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz *
291 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
292 (((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
293 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT) + 1);
294 } else {
295 vcoFreqPll1Hz = desVcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz *
296 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
297 ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
298 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT);
299 }
300 vcoFreqPll2Hz = chipcHw_XTAL_FREQ_Hz * chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
301 ((pChipcHw->PLLPreDivider2 & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
302 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT);
303
304 switch (clock) {
305 case chipcHw_CLOCK_DDR:
306 /* Configure the DDR_ctrl:BUS ratio settings */
307 {
308 REG_LOCAL_IRQ_SAVE;
309 /* Dvide DDR_phy by two to obtain DDR_ctrl clock */
310 pChipcHw->DDRClock = (pChipcHw->DDRClock & ~chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_MASK) | ((((freq / 2) / chipcHw_getClockFrequency(chipcHw_CLOCK_BUS)) - 1)
311 << chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_SHIFT);
312 REG_LOCAL_IRQ_RESTORE;
313 }
314 pPLLReg = &pChipcHw->DDRClock;
315 vcoHz = vcoFreqPll1Hz;
316 desVcoHz = desVcoFreqPll1Hz;
317 break;
318 case chipcHw_CLOCK_ARM:
319 pPLLReg = &pChipcHw->ARMClock;
320 vcoHz = vcoFreqPll1Hz;
321 desVcoHz = desVcoFreqPll1Hz;
322 break;
323 case chipcHw_CLOCK_ESW:
324 pPLLReg = &pChipcHw->ESWClock;
325 vcoHz = vcoFreqPll1Hz;
326 desVcoHz = desVcoFreqPll1Hz;
327 break;
328 case chipcHw_CLOCK_VPM:
329 /* Configure the VPM:BUS ratio settings */
330 {
331 REG_LOCAL_IRQ_SAVE;
332 pChipcHw->VPMClock = (pChipcHw->VPMClock & ~chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_MASK) | ((chipcHw_divide (freq, chipcHw_getClockFrequency(chipcHw_CLOCK_BUS)) - 1)
333 << chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_SHIFT);
334 REG_LOCAL_IRQ_RESTORE;
335 }
336 pPLLReg = &pChipcHw->VPMClock;
337 vcoHz = vcoFreqPll1Hz;
338 desVcoHz = desVcoFreqPll1Hz;
339 break;
340 case chipcHw_CLOCK_ESW125:
341 pPLLReg = &pChipcHw->ESW125Clock;
342 vcoHz = vcoFreqPll1Hz;
343 desVcoHz = desVcoFreqPll1Hz;
344 break;
345 case chipcHw_CLOCK_UART:
346 pPLLReg = &pChipcHw->UARTClock;
347 vcoHz = vcoFreqPll1Hz;
348 desVcoHz = desVcoFreqPll1Hz;
349 break;
350 case chipcHw_CLOCK_SDIO0:
351 pPLLReg = &pChipcHw->SDIO0Clock;
352 vcoHz = vcoFreqPll1Hz;
353 desVcoHz = desVcoFreqPll1Hz;
354 break;
355 case chipcHw_CLOCK_SDIO1:
356 pPLLReg = &pChipcHw->SDIO1Clock;
357 vcoHz = vcoFreqPll1Hz;
358 desVcoHz = desVcoFreqPll1Hz;
359 break;
360 case chipcHw_CLOCK_SPI:
361 pPLLReg = &pChipcHw->SPIClock;
362 vcoHz = vcoFreqPll1Hz;
363 desVcoHz = desVcoFreqPll1Hz;
364 break;
365 case chipcHw_CLOCK_ETM:
366 pPLLReg = &pChipcHw->ETMClock;
367 vcoHz = vcoFreqPll1Hz;
368 desVcoHz = desVcoFreqPll1Hz;
369 break;
370 case chipcHw_CLOCK_USB:
371 pPLLReg = &pChipcHw->USBClock;
372 vcoHz = vcoFreqPll2Hz;
373 desVcoHz = vcoFreqPll2Hz;
374 break;
375 case chipcHw_CLOCK_LCD:
376 pPLLReg = &pChipcHw->LCDClock;
377 vcoHz = vcoFreqPll2Hz;
378 desVcoHz = vcoFreqPll2Hz;
379 break;
380 case chipcHw_CLOCK_APM:
381 pPLLReg = &pChipcHw->APMClock;
382 vcoHz = vcoFreqPll2Hz;
383 desVcoHz = vcoFreqPll2Hz;
384 break;
385 case chipcHw_CLOCK_BUS:
386 pClockCtrl = &pChipcHw->ACLKClock;
387 pDependentClock = &pChipcHw->ARMClock;
388 vcoHz = vcoFreqPll1Hz;
389 desVcoHz = desVcoFreqPll1Hz;
390 dependentClockType = PLL_CLOCK;
391 break;
392 case chipcHw_CLOCK_OTP:
393 pClockCtrl = &pChipcHw->OTPClock;
394 break;
395 case chipcHw_CLOCK_I2C:
396 pClockCtrl = &pChipcHw->I2CClock;
397 break;
398 case chipcHw_CLOCK_I2S0:
399 pClockCtrl = &pChipcHw->I2S0Clock;
400 break;
401 case chipcHw_CLOCK_RTBUS:
402 pClockCtrl = &pChipcHw->RTBUSClock;
403 pDependentClock = &pChipcHw->ACLKClock;
404 dependentClockType = NON_PLL_CLOCK;
405 break;
406 case chipcHw_CLOCK_APM100:
407 pClockCtrl = &pChipcHw->APM100Clock;
408 pDependentClock = &pChipcHw->APMClock;
409 vcoHz = vcoFreqPll2Hz;
410 desVcoHz = vcoFreqPll2Hz;
411 dependentClockType = PLL_CLOCK;
412 break;
413 case chipcHw_CLOCK_TSC:
414 pClockCtrl = &pChipcHw->TSCClock;
415 break;
416 case chipcHw_CLOCK_LED:
417 pClockCtrl = &pChipcHw->LEDClock;
418 break;
419 case chipcHw_CLOCK_I2S1:
420 pClockCtrl = &pChipcHw->I2S1Clock;
421 break;
422 }
423
424 if (pPLLReg) {
425 /* Select XTAL as bypass source */
426 reg32_modify_and(pPLLReg, ~chipcHw_REG_PLL_CLOCK_SOURCE_GPIO);
427 reg32_modify_or(pPLLReg, chipcHw_REG_PLL_CLOCK_BYPASS_SELECT);
428 /* For DDR settings use only the PLL divider clock */
429 if (pPLLReg == &pChipcHw->DDRClock) {
430 /* Set M1DIV for PLL1, which controls the DDR clock */
431 reg32_write(&pChipcHw->PLLDivider, (pChipcHw->PLLDivider & 0x00FFFFFF) | ((chipcHw_REG_PLL_DIVIDER_MDIV (desVcoHz, freq)) << 24));
432 /* Calculate expected frequency */
433 freq = chipcHw_divide(vcoHz, (((pChipcHw->PLLDivider & 0xFF000000) >> 24) ? ((pChipcHw->PLLDivider & 0xFF000000) >> 24) : 256));
434 } else {
435 /* From chip revision number B0, LCD clock is internally divided by 2 */
436 if ((pPLLReg == &pChipcHw->LCDClock) && (chipcHw_getChipRevisionNumber() != chipcHw_REV_NUMBER_A0)) {
437 desVcoHz >>= 1;
438 vcoHz >>= 1;
439 }
440 /* Set MDIV to change the frequency */
441 reg32_modify_and(pPLLReg, ~(chipcHw_REG_PLL_CLOCK_MDIV_MASK));
442 reg32_modify_or(pPLLReg, chipcHw_REG_PLL_DIVIDER_MDIV(desVcoHz, freq));
443 /* Calculate expected frequency */
444 freq = chipcHw_divide(vcoHz, ((*(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) ? (*(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) : 256));
445 }
446 /* Wait for for atleast 200ns as per the protocol to change frequency */
447 udelay(1);
448 /* Do not bypass */
449 reg32_modify_and(pPLLReg, ~chipcHw_REG_PLL_CLOCK_BYPASS_SELECT);
450 /* Return the configured frequency */
451 return freq;
452 } else if (pClockCtrl) {
453 uint32_t divider = 0;
454
455 /* Divider clock should not be bypassed */
456 reg32_modify_and(pClockCtrl,
457 ~chipcHw_REG_DIV_CLOCK_BYPASS_SELECT);
458
459 /* Identify the clock source */
460 if (pDependentClock) {
461 switch (dependentClockType) {
462 case PLL_CLOCK:
463 divider = chipcHw_divide(chipcHw_divide (desVcoHz, (*pDependentClock & chipcHw_REG_PLL_CLOCK_MDIV_MASK)), freq);
464 break;
465 case NON_PLL_CLOCK:
466 {
467 uint32_t sourceClock = 0;
468
469 if (pDependentClock == (uint32_t *) &pChipcHw->ACLKClock) {
470 sourceClock = chipcHw_getClockFrequency (chipcHw_CLOCK_BUS);
471 } else {
472 uint32_t div = *pDependentClock & chipcHw_REG_DIV_CLOCK_DIV_MASK;
473 sourceClock = chipcHw_divide (chipcHw_XTAL_FREQ_Hz, ((div) ? div : 256));
474 }
475 divider = chipcHw_divide(sourceClock, freq);
476 }
477 break;
478 }
479 } else {
480 divider = chipcHw_divide(chipcHw_XTAL_FREQ_Hz, freq);
481 }
482
483 if (divider) {
484 REG_LOCAL_IRQ_SAVE;
485 /* Set the divider to obtain the required frequency */
486 *pClockCtrl = (*pClockCtrl & (~chipcHw_REG_DIV_CLOCK_DIV_MASK)) | (((divider > 256) ? chipcHw_REG_DIV_CLOCK_DIV_256 : divider) & chipcHw_REG_DIV_CLOCK_DIV_MASK);
487 REG_LOCAL_IRQ_RESTORE;
488 return freq;
489 }
490 }
491
492 return 0;
493}
494
495EXPORT_SYMBOL(chipcHw_setClockFrequency);
496
497/****************************************************************************/
498/**
499* @brief Set VPM clock in sync with BUS clock for Chip Rev #A0
500*
501* This function does the phase adjustment between VPM and BUS clock
502*
503* @return >= 0 : On success (# of adjustment required)
504* -1 : On failure
505*
506*/
507/****************************************************************************/
508static int vpmPhaseAlignA0(void)
509{
510 uint32_t phaseControl;
511 uint32_t phaseValue;
512 uint32_t prevPhaseComp;
513 int iter = 0;
514 int adjustCount = 0;
515 int count = 0;
516
517 for (iter = 0; (iter < MAX_PHASE_ALIGN_ATTEMPTS) && (adjustCount < MAX_PHASE_ADJUST_COUNT); iter++) {
518 phaseControl = (pChipcHw->VPMClock & chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK) >> chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT;
519 phaseValue = 0;
520 prevPhaseComp = 0;
521
522 /* Step 1: Look for falling PH_COMP transition */
523
524 /* Read the contents of VPM Clock resgister */
525 phaseValue = pChipcHw->VPMClock;
526 do {
527 /* Store previous value of phase comparator */
528 prevPhaseComp = phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP;
529 /* Change the value of PH_CTRL. */
530 reg32_write(&pChipcHw->VPMClock, (pChipcHw->VPMClock & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT));
531 /* Wait atleast 20 ns */
532 udelay(1);
533 /* Toggle the LOAD_CH after phase control is written. */
534 pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE;
535 /* Read the contents of VPM Clock resgister. */
536 phaseValue = pChipcHw->VPMClock;
537
538 if ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0x0) {
539 phaseControl = (0x3F & (phaseControl - 1));
540 } else {
541 /* Increment to the Phase count value for next write, if Phase is not stable. */
542 phaseControl = (0x3F & (phaseControl + 1));
543 }
544 /* Count number of adjustment made */
545 adjustCount++;
546 } while (((prevPhaseComp == (phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP)) || /* Look for a transition */
547 ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) != 0x0)) && /* Look for a falling edge */
548 (adjustCount < MAX_PHASE_ADJUST_COUNT) /* Do not exceed the limit while trying */
549 );
550
551 if (adjustCount >= MAX_PHASE_ADJUST_COUNT) {
552 /* Failed to align VPM phase after MAX_PHASE_ADJUST_COUNT tries */
553 return -1;
554 }
555
556 /* Step 2: Keep moving forward to make sure falling PH_COMP transition was valid */
557
558 for (count = 0; (count < 5) && ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0); count++) {
559 phaseControl = (0x3F & (phaseControl + 1));
560 reg32_write(&pChipcHw->VPMClock, (pChipcHw->VPMClock & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT));
561 /* Wait atleast 20 ns */
562 udelay(1);
563 /* Toggle the LOAD_CH after phase control is written. */
564 pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE;
565 phaseValue = pChipcHw->VPMClock;
566 /* Count number of adjustment made */
567 adjustCount++;
568 }
569
570 if (adjustCount >= MAX_PHASE_ADJUST_COUNT) {
571 /* Failed to align VPM phase after MAX_PHASE_ADJUST_COUNT tries */
572 return -1;
573 }
574
575 if (count != 5) {
576 /* Detected false transition */
577 continue;
578 }
579
580 /* Step 3: Keep moving backward to make sure falling PH_COMP transition was stable */
581
582 for (count = 0; (count < 3) && ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0); count++) {
583 phaseControl = (0x3F & (phaseControl - 1));
584 reg32_write(&pChipcHw->VPMClock, (pChipcHw->VPMClock & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT));
585 /* Wait atleast 20 ns */
586 udelay(1);
587 /* Toggle the LOAD_CH after phase control is written. */
588 pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE;
589 phaseValue = pChipcHw->VPMClock;
590 /* Count number of adjustment made */
591 adjustCount++;
592 }
593
594 if (adjustCount >= MAX_PHASE_ADJUST_COUNT) {
595 /* Failed to align VPM phase after MAX_PHASE_ADJUST_COUNT tries */
596 return -1;
597 }
598
599 if (count != 3) {
600 /* Detected noisy transition */
601 continue;
602 }
603
604 /* Step 4: Keep moving backward before the original transition took place. */
605
606 for (count = 0; (count < 5); count++) {
607 phaseControl = (0x3F & (phaseControl - 1));
608 reg32_write(&pChipcHw->VPMClock, (pChipcHw->VPMClock & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT));
609 /* Wait atleast 20 ns */
610 udelay(1);
611 /* Toggle the LOAD_CH after phase control is written. */
612 pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE;
613 phaseValue = pChipcHw->VPMClock;
614 /* Count number of adjustment made */
615 adjustCount++;
616 }
617
618 if (adjustCount >= MAX_PHASE_ADJUST_COUNT) {
619 /* Failed to align VPM phase after MAX_PHASE_ADJUST_COUNT tries */
620 return -1;
621 }
622
623 if ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0) {
624 /* Detected false transition */
625 continue;
626 }
627
628 /* Step 5: Re discover the valid transition */
629
630 do {
631 /* Store previous value of phase comparator */
632 prevPhaseComp = phaseValue;
633 /* Change the value of PH_CTRL. */
634 reg32_write(&pChipcHw->VPMClock, (pChipcHw->VPMClock & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT));
635 /* Wait atleast 20 ns */
636 udelay(1);
637 /* Toggle the LOAD_CH after phase control is written. */
638 pChipcHw->VPMClock ^=
639 chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE;
640 /* Read the contents of VPM Clock resgister. */
641 phaseValue = pChipcHw->VPMClock;
642
643 if ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0x0) {
644 phaseControl = (0x3F & (phaseControl - 1));
645 } else {
646 /* Increment to the Phase count value for next write, if Phase is not stable. */
647 phaseControl = (0x3F & (phaseControl + 1));
648 }
649
650 /* Count number of adjustment made */
651 adjustCount++;
652 } while (((prevPhaseComp == (phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP)) || ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) != 0x0)) && (adjustCount < MAX_PHASE_ADJUST_COUNT));
653
654 if (adjustCount >= MAX_PHASE_ADJUST_COUNT) {
655 /* Failed to align VPM phase after MAX_PHASE_ADJUST_COUNT tries */
656 return -1;
657 } else {
658 /* Valid phase must have detected */
659 break;
660 }
661 }
662
663 /* For VPM Phase should be perfectly aligned. */
664 phaseControl = (((pChipcHw->VPMClock >> chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT) - 1) & 0x3F);
665 {
666 REG_LOCAL_IRQ_SAVE;
667
668 pChipcHw->VPMClock = (pChipcHw->VPMClock & ~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT);
669 /* Load new phase value */
670 pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE;
671
672 REG_LOCAL_IRQ_RESTORE;
673 }
674 /* Return the status */
675 return (int)adjustCount;
676}
677
678/****************************************************************************/
679/**
680* @brief Set VPM clock in sync with BUS clock
681*
682* This function does the phase adjustment between VPM and BUS clock
683*
684* @return >= 0 : On success (# of adjustment required)
685* -1 : On failure
686*
687*/
688/****************************************************************************/
689int chipcHw_vpmPhaseAlign(void)
690{
691
692 if (chipcHw_getChipRevisionNumber() == chipcHw_REV_NUMBER_A0) {
693 return vpmPhaseAlignA0();
694 } else {
695 uint32_t phaseControl = chipcHw_getVpmPhaseControl();
696 uint32_t phaseValue = 0;
697 int adjustCount = 0;
698
699 /* Disable VPM access */
700 pChipcHw->Spare1 &= ~chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE;
701 /* Disable HW VPM phase alignment */
702 chipcHw_vpmHwPhaseAlignDisable();
703 /* Enable SW VPM phase alignment */
704 chipcHw_vpmSwPhaseAlignEnable();
705 /* Adjust VPM phase */
706 while (adjustCount < MAX_PHASE_ADJUST_COUNT) {
707 phaseValue = chipcHw_getVpmHwPhaseAlignStatus();
708
709 /* Adjust phase control value */
710 if (phaseValue > 0xF) {
711 /* Increment phase control value */
712 phaseControl++;
713 } else if (phaseValue < 0xF) {
714 /* Decrement phase control value */
715 phaseControl--;
716 } else {
717 /* Enable VPM access */
718 pChipcHw->Spare1 |= chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE;
719 /* Return adjust count */
720 return adjustCount;
721 }
722 /* Change the value of PH_CTRL. */
723 reg32_write(&pChipcHw->VPMClock, (pChipcHw->VPMClock & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT));
724 /* Wait atleast 20 ns */
725 udelay(1);
726 /* Toggle the LOAD_CH after phase control is written. */
727 pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE;
728 /* Count adjustment */
729 adjustCount++;
730 }
731 }
732
733 /* Disable VPM access */
734 pChipcHw->Spare1 &= ~chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE;
735 return -1;
736}
737
738/****************************************************************************/
739/**
740* @brief Local Divide function
741*
742* This function does the divide
743*
744* @return divide value
745*
746*/
747/****************************************************************************/
748static int chipcHw_divide(int num, int denom)
749{
750 int r;
751 int t = 1;
752
753 /* Shift denom and t up to the largest value to optimize algorithm */
754 /* t contains the units of each divide */
755 while ((denom & 0x40000000) == 0) { /* fails if denom=0 */
756 denom = denom << 1;
757 t = t << 1;
758 }
759
760 /* Initialize the result */
761 r = 0;
762
763 do {
764 /* Determine if there exists a positive remainder */
765 if ((num - denom) >= 0) {
766 /* Accumlate t to the result and calculate a new remainder */
767 num = num - denom;
768 r = r + t;
769 }
770 /* Continue to shift denom and shift t down to 0 */
771 denom = denom >> 1;
772 t = t >> 1;
773 } while (t != 0);
774
775 return r;
776}
diff --git a/arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c b/arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c
deleted file mode 100644
index 367df75d4bb..00000000000
--- a/arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c
+++ /dev/null
@@ -1,293 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file chipcHw_init.c
18*
19* @brief Low level CHIPC PLL configuration functions
20*
21* @note
22*
23* These routines provide basic PLL controlling functionality only.
24*/
25/****************************************************************************/
26
27/* ---- Include Files ---------------------------------------------------- */
28
29#include <csp/errno.h>
30#include <csp/stdint.h>
31#include <csp/module.h>
32
33#include <mach/csp/chipcHw_def.h>
34#include <mach/csp/chipcHw_inline.h>
35
36#include <csp/reg.h>
37#include <csp/delay.h>
38/* ---- Private Constants and Types --------------------------------------- */
39
40/*
41 Calculation for NDIV_i to obtain VCO frequency
42 -----------------------------------------------
43
44 Freq_vco = Freq_ref * (P2 / P1) * (PLL_NDIV_i + PLL_NDIV_f)
45 for Freq_vco = VCO_FREQ_MHz
46 Freq_ref = chipcHw_XTAL_FREQ_Hz
47 PLL_P1 = PLL_P2 = 1
48 and
49 PLL_NDIV_f = 0
50
51 We get:
52 PLL_NDIV_i = Freq_vco / Freq_ref = VCO_FREQ_MHz / chipcHw_XTAL_FREQ_Hz
53
54 Calculation for PLL MDIV to obtain frequency Freq_x for channel x
55 -----------------------------------------------------------------
56 Freq_x = chipcHw_XTAL_FREQ_Hz * PLL_NDIV_i / PLL_MDIV_x = VCO_FREQ_MHz / PLL_MDIV_x
57
58 PLL_MDIV_x = VCO_FREQ_MHz / Freq_x
59*/
60
61/* ---- Private Variables ------------------------------------------------- */
62/****************************************************************************/
63/**
64* @brief Initializes the PLL2
65*
66* This function initializes the PLL2
67*
68*/
69/****************************************************************************/
70void chipcHw_pll2Enable(uint32_t vcoFreqHz)
71{
72 uint32_t pllPreDivider2 = 0;
73
74 {
75 REG_LOCAL_IRQ_SAVE;
76 pChipcHw->PLLConfig2 =
77 chipcHw_REG_PLL_CONFIG_D_RESET |
78 chipcHw_REG_PLL_CONFIG_A_RESET;
79
80 pllPreDivider2 = chipcHw_REG_PLL_PREDIVIDER_POWER_DOWN |
81 chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER |
82 (chipcHw_REG_PLL_PREDIVIDER_NDIV_i(vcoFreqHz) <<
83 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT) |
84 (chipcHw_REG_PLL_PREDIVIDER_P1 <<
85 chipcHw_REG_PLL_PREDIVIDER_P1_SHIFT) |
86 (chipcHw_REG_PLL_PREDIVIDER_P2 <<
87 chipcHw_REG_PLL_PREDIVIDER_P2_SHIFT);
88
89 /* Enable CHIPC registers to control the PLL */
90 pChipcHw->PLLStatus |= chipcHw_REG_PLL_STATUS_CONTROL_ENABLE;
91
92 /* Set pre divider to get desired VCO frequency */
93 pChipcHw->PLLPreDivider2 = pllPreDivider2;
94 /* Set NDIV Frac */
95 pChipcHw->PLLDivider2 = chipcHw_REG_PLL_DIVIDER_NDIV_f;
96
97 /* This has to be removed once the default values are fixed for PLL2. */
98 pChipcHw->PLLControl12 = 0x38000700;
99 pChipcHw->PLLControl22 = 0x00000015;
100
101 /* Reset PLL2 */
102 if (vcoFreqHz > chipcHw_REG_PLL_CONFIG_VCO_SPLIT_FREQ) {
103 pChipcHw->PLLConfig2 = chipcHw_REG_PLL_CONFIG_D_RESET |
104 chipcHw_REG_PLL_CONFIG_A_RESET |
105 chipcHw_REG_PLL_CONFIG_VCO_1601_3200 |
106 chipcHw_REG_PLL_CONFIG_POWER_DOWN;
107 } else {
108 pChipcHw->PLLConfig2 = chipcHw_REG_PLL_CONFIG_D_RESET |
109 chipcHw_REG_PLL_CONFIG_A_RESET |
110 chipcHw_REG_PLL_CONFIG_VCO_800_1600 |
111 chipcHw_REG_PLL_CONFIG_POWER_DOWN;
112 }
113 REG_LOCAL_IRQ_RESTORE;
114 }
115
116 /* Insert certain amount of delay before deasserting ARESET. */
117 udelay(1);
118
119 {
120 REG_LOCAL_IRQ_SAVE;
121 /* Remove analog reset and Power on the PLL */
122 pChipcHw->PLLConfig2 &=
123 ~(chipcHw_REG_PLL_CONFIG_A_RESET |
124 chipcHw_REG_PLL_CONFIG_POWER_DOWN);
125
126 REG_LOCAL_IRQ_RESTORE;
127
128 }
129
130 /* Wait until PLL is locked */
131 while (!(pChipcHw->PLLStatus2 & chipcHw_REG_PLL_STATUS_LOCKED))
132 ;
133
134 {
135 REG_LOCAL_IRQ_SAVE;
136 /* Remove digital reset */
137 pChipcHw->PLLConfig2 &= ~chipcHw_REG_PLL_CONFIG_D_RESET;
138
139 REG_LOCAL_IRQ_RESTORE;
140 }
141}
142
143EXPORT_SYMBOL(chipcHw_pll2Enable);
144
145/****************************************************************************/
146/**
147* @brief Initializes the PLL1
148*
149* This function initializes the PLL1
150*
151*/
152/****************************************************************************/
153void chipcHw_pll1Enable(uint32_t vcoFreqHz, chipcHw_SPREAD_SPECTRUM_e ssSupport)
154{
155 uint32_t pllPreDivider = 0;
156
157 {
158 REG_LOCAL_IRQ_SAVE;
159
160 pChipcHw->PLLConfig =
161 chipcHw_REG_PLL_CONFIG_D_RESET |
162 chipcHw_REG_PLL_CONFIG_A_RESET;
163 /* Setting VCO frequency */
164 if (ssSupport == chipcHw_SPREAD_SPECTRUM_ALLOW) {
165 pllPreDivider =
166 chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASH_1_8 |
167 ((chipcHw_REG_PLL_PREDIVIDER_NDIV_i(vcoFreqHz) -
168 1) << chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT) |
169 (chipcHw_REG_PLL_PREDIVIDER_P1 <<
170 chipcHw_REG_PLL_PREDIVIDER_P1_SHIFT) |
171 (chipcHw_REG_PLL_PREDIVIDER_P2 <<
172 chipcHw_REG_PLL_PREDIVIDER_P2_SHIFT);
173 } else {
174 pllPreDivider = chipcHw_REG_PLL_PREDIVIDER_POWER_DOWN |
175 chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER |
176 (chipcHw_REG_PLL_PREDIVIDER_NDIV_i(vcoFreqHz) <<
177 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT) |
178 (chipcHw_REG_PLL_PREDIVIDER_P1 <<
179 chipcHw_REG_PLL_PREDIVIDER_P1_SHIFT) |
180 (chipcHw_REG_PLL_PREDIVIDER_P2 <<
181 chipcHw_REG_PLL_PREDIVIDER_P2_SHIFT);
182 }
183
184 /* Enable CHIPC registers to control the PLL */
185 pChipcHw->PLLStatus |= chipcHw_REG_PLL_STATUS_CONTROL_ENABLE;
186
187 /* Set pre divider to get desired VCO frequency */
188 pChipcHw->PLLPreDivider = pllPreDivider;
189 /* Set NDIV Frac */
190 if (ssSupport == chipcHw_SPREAD_SPECTRUM_ALLOW) {
191 pChipcHw->PLLDivider = chipcHw_REG_PLL_DIVIDER_M1DIV |
192 chipcHw_REG_PLL_DIVIDER_NDIV_f_SS;
193 } else {
194 pChipcHw->PLLDivider = chipcHw_REG_PLL_DIVIDER_M1DIV |
195 chipcHw_REG_PLL_DIVIDER_NDIV_f;
196 }
197
198 /* Reset PLL1 */
199 if (vcoFreqHz > chipcHw_REG_PLL_CONFIG_VCO_SPLIT_FREQ) {
200 pChipcHw->PLLConfig = chipcHw_REG_PLL_CONFIG_D_RESET |
201 chipcHw_REG_PLL_CONFIG_A_RESET |
202 chipcHw_REG_PLL_CONFIG_VCO_1601_3200 |
203 chipcHw_REG_PLL_CONFIG_POWER_DOWN;
204 } else {
205 pChipcHw->PLLConfig = chipcHw_REG_PLL_CONFIG_D_RESET |
206 chipcHw_REG_PLL_CONFIG_A_RESET |
207 chipcHw_REG_PLL_CONFIG_VCO_800_1600 |
208 chipcHw_REG_PLL_CONFIG_POWER_DOWN;
209 }
210
211 REG_LOCAL_IRQ_RESTORE;
212
213 /* Insert certain amount of delay before deasserting ARESET. */
214 udelay(1);
215
216 {
217 REG_LOCAL_IRQ_SAVE;
218 /* Remove analog reset and Power on the PLL */
219 pChipcHw->PLLConfig &=
220 ~(chipcHw_REG_PLL_CONFIG_A_RESET |
221 chipcHw_REG_PLL_CONFIG_POWER_DOWN);
222 REG_LOCAL_IRQ_RESTORE;
223 }
224
225 /* Wait until PLL is locked */
226 while (!(pChipcHw->PLLStatus & chipcHw_REG_PLL_STATUS_LOCKED)
227 || !(pChipcHw->
228 PLLStatus2 & chipcHw_REG_PLL_STATUS_LOCKED))
229 ;
230
231 /* Remove digital reset */
232 {
233 REG_LOCAL_IRQ_SAVE;
234 pChipcHw->PLLConfig &= ~chipcHw_REG_PLL_CONFIG_D_RESET;
235 REG_LOCAL_IRQ_RESTORE;
236 }
237 }
238}
239
240EXPORT_SYMBOL(chipcHw_pll1Enable);
241
242/****************************************************************************/
243/**
244* @brief Initializes the chipc module
245*
246* This function initializes the PLLs and core system clocks
247*
248*/
249/****************************************************************************/
250
251void chipcHw_Init(chipcHw_INIT_PARAM_t *initParam /* [ IN ] Misc chip initialization parameter */
252 ) {
253#if !(defined(__KERNEL__) && !defined(STANDALONE))
254 delay_init();
255#endif
256
257 /* Do not program PLL, when warm reset */
258 if (!(chipcHw_getStickyBits() & chipcHw_REG_STICKY_CHIP_WARM_RESET)) {
259 chipcHw_pll1Enable(initParam->pllVcoFreqHz,
260 initParam->ssSupport);
261 chipcHw_pll2Enable(initParam->pll2VcoFreqHz);
262 } else {
263 /* Clear sticky bits */
264 chipcHw_clearStickyBits(chipcHw_REG_STICKY_CHIP_WARM_RESET);
265 }
266 /* Clear sticky bits */
267 chipcHw_clearStickyBits(chipcHw_REG_STICKY_CHIP_SOFT_RESET);
268
269 /* Before configuring the ARM clock, atleast we need to make sure BUS clock maintains the proper ratio with ARM clock */
270 pChipcHw->ACLKClock =
271 (pChipcHw->
272 ACLKClock & ~chipcHw_REG_ACLKClock_CLK_DIV_MASK) | (initParam->
273 armBusRatio &
274 chipcHw_REG_ACLKClock_CLK_DIV_MASK);
275
276 /* Set various core component frequencies. The order in which this is done is important for some. */
277 /* The RTBUS (DDR PHY) is derived from the BUS, and the BUS from the ARM, and VPM needs to know BUS */
278 /* frequency to find its ratio with the BUS. Hence we must set the ARM first, followed by the BUS, */
279 /* then VPM and RTBUS. */
280
281 chipcHw_setClockFrequency(chipcHw_CLOCK_ARM,
282 initParam->busClockFreqHz *
283 initParam->armBusRatio);
284 chipcHw_setClockFrequency(chipcHw_CLOCK_BUS, initParam->busClockFreqHz);
285 chipcHw_setClockFrequency(chipcHw_CLOCK_VPM,
286 initParam->busClockFreqHz *
287 initParam->vpmBusRatio);
288 chipcHw_setClockFrequency(chipcHw_CLOCK_DDR,
289 initParam->busClockFreqHz *
290 initParam->ddrBusRatio);
291 chipcHw_setClockFrequency(chipcHw_CLOCK_RTBUS,
292 initParam->busClockFreqHz / 2);
293}
diff --git a/arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c b/arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c
deleted file mode 100644
index 2671d8896bb..00000000000
--- a/arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c
+++ /dev/null
@@ -1,124 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/* ---- Include Files ---------------------------------------------------- */
16#include <csp/stdint.h>
17#include <mach/csp/chipcHw_def.h>
18#include <mach/csp/chipcHw_inline.h>
19#include <csp/intcHw.h>
20#include <csp/cache.h>
21
22/* ---- Private Constants and Types --------------------------------------- */
23/* ---- Private Variables ------------------------------------------------- */
24void chipcHw_reset_run_from_aram(void);
25
26typedef void (*RUNFUNC) (void);
27
28/****************************************************************************/
29/**
30* @brief warmReset
31*
32* @note warmReset configures the clocks which are not reset back to the state
33* required to execute on reset. To do so we need to copy the code into internal
34* memory to change the ARM clock while we are not executing from DDR.
35*/
36/****************************************************************************/
37void chipcHw_reset(uint32_t mask)
38{
39 int i = 0;
40 RUNFUNC runFunc = (RUNFUNC) (unsigned long)MM_ADDR_IO_ARAM;
41
42 /* Disable all interrupts */
43 intcHw_irq_disable(INTCHW_INTC0, 0xffffffff);
44 intcHw_irq_disable(INTCHW_INTC1, 0xffffffff);
45 intcHw_irq_disable(INTCHW_SINTC, 0xffffffff);
46
47 {
48 REG_LOCAL_IRQ_SAVE;
49 if (mask & chipcHw_REG_SOFT_RESET_CHIP_SOFT) {
50 chipcHw_softReset(chipcHw_REG_SOFT_RESET_CHIP_SOFT);
51 }
52 /* Bypass the PLL clocks before reboot */
53 pChipcHw->UARTClock |= chipcHw_REG_PLL_CLOCK_BYPASS_SELECT;
54 pChipcHw->SPIClock |= chipcHw_REG_PLL_CLOCK_BYPASS_SELECT;
55
56 /* Copy the chipcHw_warmReset_run_from_aram function into ARAM */
57 do {
58 ((uint32_t *) MM_IO_BASE_ARAM)[i] =
59 ((uint32_t *) &chipcHw_reset_run_from_aram)[i];
60 i++;
61 } while (((uint32_t *) MM_IO_BASE_ARAM)[i - 1] != 0xe1a0f00f); /* 0xe1a0f00f == asm ("mov r15, r15"); */
62
63 CSP_CACHE_FLUSH_ALL;
64
65 /* run the function from ARAM */
66 runFunc();
67
68 /* Code will never get here, but include it to balance REG_LOCAL_IRQ_SAVE above */
69 REG_LOCAL_IRQ_RESTORE;
70 }
71}
72
73/* This function must run from internal memory */
74void chipcHw_reset_run_from_aram(void)
75{
76/* Make sure, pipeline is filled with instructions coming from ARAM */
77__asm (" nop \n\t"
78 " nop \n\t"
79#if defined(__KERNEL__) && !defined(STANDALONE)
80 " MRC p15,#0x0,r0,c1,c0,#0 \n\t"
81 " BIC r0,r0,#0xd \n\t"
82 " MCR p15,#0x0,r0,c1,c0,#0 \n\t"
83 " nop \n\t"
84 " nop \n\t"
85 " nop \n\t"
86 " nop \n\t"
87 " nop \n\t"
88 " nop \n\t"
89#endif
90 " nop \n\t"
91 " nop \n\t"
92/* Bypass the ARM clock and switch to XTAL clock */
93 " MOV r2,#0x80000000 \n\t"
94 " LDR r3,[r2,#8] \n\t"
95 " ORR r3,r3,#0x20000 \n\t"
96 " STR r3,[r2,#8] \n\t"
97
98 " nop \n\t"
99 " nop \n\t"
100 " nop \n\t"
101 " nop \n\t"
102 " nop \n\t"
103 " nop \n\t"
104 " nop \n\t"
105 " nop \n\t"
106 " nop \n\t"
107 " nop \n\t"
108 " nop \n\t"
109 " nop \n\t"
110 " nop \n\t"
111 " nop \n\t"
112 " nop \n\t"
113 " nop \n\t"
114 " nop \n\t"
115 " nop \n\t"
116 " nop \n\t"
117 " nop \n\t"
118/* Issue reset */
119 " MOV r3,#0x2 \n\t"
120 " STR r3,[r2,#0x80] \n\t"
121/* End here */
122 " MOV pc,pc \n\t");
123/* 0xe1a0f00f == asm ("mov r15, r15"); */
124}
diff --git a/arch/arm/mach-bcmring/csp/chipc/chipcHw_str.c b/arch/arm/mach-bcmring/csp/chipc/chipcHw_str.c
deleted file mode 100644
index 54ad964fe94..00000000000
--- a/arch/arm/mach-bcmring/csp/chipc/chipcHw_str.c
+++ /dev/null
@@ -1,64 +0,0 @@
1/*****************************************************************************
2* Copyright 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14/****************************************************************************/
15/**
16* @file chipcHw_str.c
17*
18* @brief Contains strings which are useful to linux and csp
19*
20* @note
21*/
22/****************************************************************************/
23
24/* ---- Include Files ---------------------------------------------------- */
25
26#include <mach/csp/chipcHw_inline.h>
27
28/* ---- Private Constants and Types --------------------------------------- */
29
30static const char *gMuxStr[] = {
31 "GPIO", /* 0 */
32 "KeyPad", /* 1 */
33 "I2C-Host", /* 2 */
34 "SPI", /* 3 */
35 "Uart", /* 4 */
36 "LED-Mtx-P", /* 5 */
37 "LED-Mtx-S", /* 6 */
38 "SDIO-0", /* 7 */
39 "SDIO-1", /* 8 */
40 "PCM", /* 9 */
41 "I2S", /* 10 */
42 "ETM", /* 11 */
43 "Debug", /* 12 */
44 "Misc", /* 13 */
45 "0xE", /* 14 */
46 "0xF", /* 15 */
47};
48
49/****************************************************************************/
50/**
51* @brief Retrieves a string representation of the mux setting for a pin.
52*
53* @return Pointer to a character string.
54*/
55/****************************************************************************/
56
57const char *chipcHw_getGpioPinFunctionStr(int pin)
58{
59 if ((pin < 0) || (pin >= chipcHw_GPIO_COUNT)) {
60 return "";
61 }
62
63 return gMuxStr[chipcHw_getGpioPinFunction(pin)];
64}
diff --git a/arch/arm/mach-bcmring/csp/dmac/Makefile b/arch/arm/mach-bcmring/csp/dmac/Makefile
deleted file mode 100644
index fb1104fe56b..00000000000
--- a/arch/arm/mach-bcmring/csp/dmac/Makefile
+++ /dev/null
@@ -1 +0,0 @@
1obj-y += dmacHw.o dmacHw_extra.o \ No newline at end of file
diff --git a/arch/arm/mach-bcmring/csp/dmac/dmacHw.c b/arch/arm/mach-bcmring/csp/dmac/dmacHw.c
deleted file mode 100644
index 6b9be2e98e5..00000000000
--- a/arch/arm/mach-bcmring/csp/dmac/dmacHw.c
+++ /dev/null
@@ -1,917 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file dmacHw.c
18*
19* @brief Low level DMA controller driver routines
20*
21* @note
22*
23* These routines provide basic DMA functionality only.
24*/
25/****************************************************************************/
26
27/* ---- Include Files ---------------------------------------------------- */
28#include <csp/stdint.h>
29#include <csp/string.h>
30#include <stddef.h>
31
32#include <csp/dmacHw.h>
33#include <mach/csp/dmacHw_reg.h>
34#include <mach/csp/dmacHw_priv.h>
35#include <mach/csp/chipcHw_inline.h>
36
37/* ---- External Function Prototypes ------------------------------------- */
38
39/* Allocate DMA control blocks */
40dmacHw_CBLK_t dmacHw_gCblk[dmacHw_MAX_CHANNEL_COUNT];
41
42uint32_t dmaChannelCount_0 = dmacHw_MAX_CHANNEL_COUNT / 2;
43uint32_t dmaChannelCount_1 = dmacHw_MAX_CHANNEL_COUNT / 2;
44
45/****************************************************************************/
46/**
47* @brief Get maximum FIFO for a DMA channel
48*
49* @return Maximum allowable FIFO size
50*
51*
52*/
53/****************************************************************************/
54static uint32_t GetFifoSize(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
55 ) {
56 uint32_t val = 0;
57 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
58 dmacHw_MISC_t *pMiscReg =
59 (dmacHw_MISC_t *) dmacHw_REG_MISC_BASE(pCblk->module);
60
61 switch (pCblk->channel) {
62 case 0:
63 val = (pMiscReg->CompParm2.lo & 0x70000000) >> 28;
64 break;
65 case 1:
66 val = (pMiscReg->CompParm3.hi & 0x70000000) >> 28;
67 break;
68 case 2:
69 val = (pMiscReg->CompParm3.lo & 0x70000000) >> 28;
70 break;
71 case 3:
72 val = (pMiscReg->CompParm4.hi & 0x70000000) >> 28;
73 break;
74 case 4:
75 val = (pMiscReg->CompParm4.lo & 0x70000000) >> 28;
76 break;
77 case 5:
78 val = (pMiscReg->CompParm5.hi & 0x70000000) >> 28;
79 break;
80 case 6:
81 val = (pMiscReg->CompParm5.lo & 0x70000000) >> 28;
82 break;
83 case 7:
84 val = (pMiscReg->CompParm6.hi & 0x70000000) >> 28;
85 break;
86 }
87
88 if (val <= 0x4) {
89 return 8 << val;
90 } else {
91 dmacHw_ASSERT(0);
92 }
93 return 0;
94}
95
96/****************************************************************************/
97/**
98* @brief Program channel register to initiate transfer
99*
100* @return void
101*
102*
103* @note
104* - Descriptor buffer MUST ALWAYS be flushed before calling this function
105* - This function should also be called from ISR to program the channel with
106* pending descriptors
107*/
108/****************************************************************************/
109void dmacHw_initiateTransfer(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
110 dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
111 void *pDescriptor /* [ IN ] Descriptor buffer */
112 ) {
113 dmacHw_DESC_RING_t *pRing;
114 dmacHw_DESC_t *pProg;
115 dmacHw_CBLK_t *pCblk;
116
117 pCblk = dmacHw_HANDLE_TO_CBLK(handle);
118 pRing = dmacHw_GET_DESC_RING(pDescriptor);
119
120 if (CHANNEL_BUSY(pCblk->module, pCblk->channel)) {
121 /* Not safe yet to program the channel */
122 return;
123 }
124
125 if (pCblk->varDataStarted) {
126 if (pCblk->descUpdated) {
127 pCblk->descUpdated = 0;
128 pProg =
129 (dmacHw_DESC_t *) ((uint32_t)
130 dmacHw_REG_LLP(pCblk->module,
131 pCblk->channel) +
132 pRing->virt2PhyOffset);
133
134 /* Load descriptor if not loaded */
135 if (!(pProg->ctl.hi & dmacHw_REG_CTL_DONE)) {
136 dmacHw_SET_SAR(pCblk->module, pCblk->channel,
137 pProg->sar);
138 dmacHw_SET_DAR(pCblk->module, pCblk->channel,
139 pProg->dar);
140 dmacHw_REG_CTL_LO(pCblk->module,
141 pCblk->channel) =
142 pProg->ctl.lo;
143 dmacHw_REG_CTL_HI(pCblk->module,
144 pCblk->channel) =
145 pProg->ctl.hi;
146 } else if (pProg == (dmacHw_DESC_t *) pRing->pEnd->llp) {
147 /* Return as end descriptor is processed */
148 return;
149 } else {
150 dmacHw_ASSERT(0);
151 }
152 } else {
153 return;
154 }
155 } else {
156 if (pConfig->transferMode == dmacHw_TRANSFER_MODE_PERIODIC) {
157 /* Do not make a single chain, rather process one descriptor at a time */
158 pProg = pRing->pHead;
159 /* Point to the next descriptor for next iteration */
160 dmacHw_NEXT_DESC(pRing, pHead);
161 } else {
162 /* Return if no more pending descriptor */
163 if (pRing->pEnd == NULL) {
164 return;
165 }
166
167 pProg = pRing->pProg;
168 if (pConfig->transferMode ==
169 dmacHw_TRANSFER_MODE_CONTINUOUS) {
170 /* Make sure a complete ring can be formed */
171 dmacHw_ASSERT((dmacHw_DESC_t *) pRing->pEnd->
172 llp == pRing->pProg);
173 /* Make sure pProg pointing to the pHead */
174 dmacHw_ASSERT((dmacHw_DESC_t *) pRing->pProg ==
175 pRing->pHead);
176 /* Make a complete ring */
177 do {
178 pRing->pProg->ctl.lo |=
179 (dmacHw_REG_CTL_LLP_DST_EN |
180 dmacHw_REG_CTL_LLP_SRC_EN);
181 pRing->pProg =
182 (dmacHw_DESC_t *) pRing->pProg->llp;
183 } while (pRing->pProg != pRing->pHead);
184 } else {
185 /* Make a single long chain */
186 while (pRing->pProg != pRing->pEnd) {
187 pRing->pProg->ctl.lo |=
188 (dmacHw_REG_CTL_LLP_DST_EN |
189 dmacHw_REG_CTL_LLP_SRC_EN);
190 pRing->pProg =
191 (dmacHw_DESC_t *) pRing->pProg->llp;
192 }
193 }
194 }
195
196 /* Program the channel registers */
197 dmacHw_SET_SAR(pCblk->module, pCblk->channel, pProg->sar);
198 dmacHw_SET_DAR(pCblk->module, pCblk->channel, pProg->dar);
199 dmacHw_SET_LLP(pCblk->module, pCblk->channel,
200 (uint32_t) pProg - pRing->virt2PhyOffset);
201 dmacHw_REG_CTL_LO(pCblk->module, pCblk->channel) =
202 pProg->ctl.lo;
203 dmacHw_REG_CTL_HI(pCblk->module, pCblk->channel) =
204 pProg->ctl.hi;
205 if (pRing->pEnd) {
206 /* Remember the descriptor to use next */
207 pRing->pProg = (dmacHw_DESC_t *) pRing->pEnd->llp;
208 }
209 /* Indicate no more pending descriptor */
210 pRing->pEnd = (dmacHw_DESC_t *) NULL;
211 }
212 /* Start DMA operation */
213 dmacHw_DMA_START(pCblk->module, pCblk->channel);
214}
215
216/****************************************************************************/
217/**
218* @brief Initializes DMA
219*
220* This function initializes DMA CSP driver
221*
222* @note
223* Must be called before using any DMA channel
224*/
225/****************************************************************************/
226void dmacHw_initDma(void)
227{
228
229 uint32_t i = 0;
230
231 dmaChannelCount_0 = dmacHw_GET_NUM_CHANNEL(0);
232 dmaChannelCount_1 = dmacHw_GET_NUM_CHANNEL(1);
233
234 /* Enable access to the DMA block */
235 chipcHw_busInterfaceClockEnable(chipcHw_REG_BUS_CLOCK_DMAC0);
236 chipcHw_busInterfaceClockEnable(chipcHw_REG_BUS_CLOCK_DMAC1);
237
238 if ((dmaChannelCount_0 + dmaChannelCount_1) > dmacHw_MAX_CHANNEL_COUNT) {
239 dmacHw_ASSERT(0);
240 }
241
242 memset((void *)dmacHw_gCblk, 0,
243 sizeof(dmacHw_CBLK_t) * (dmaChannelCount_0 + dmaChannelCount_1));
244 for (i = 0; i < dmaChannelCount_0; i++) {
245 dmacHw_gCblk[i].module = 0;
246 dmacHw_gCblk[i].channel = i;
247 }
248 for (i = 0; i < dmaChannelCount_1; i++) {
249 dmacHw_gCblk[i + dmaChannelCount_0].module = 1;
250 dmacHw_gCblk[i + dmaChannelCount_0].channel = i;
251 }
252}
253
254/****************************************************************************/
255/**
256* @brief Exit function for DMA
257*
258* This function isolates DMA from the system
259*
260*/
261/****************************************************************************/
262void dmacHw_exitDma(void)
263{
264 /* Disable access to the DMA block */
265 chipcHw_busInterfaceClockDisable(chipcHw_REG_BUS_CLOCK_DMAC0);
266 chipcHw_busInterfaceClockDisable(chipcHw_REG_BUS_CLOCK_DMAC1);
267}
268
269/****************************************************************************/
270/**
271* @brief Gets a handle to a DMA channel
272*
273* This function returns a handle, representing a control block of a particular DMA channel
274*
275* @return -1 - On Failure
276* handle - On Success, representing a channel control block
277*
278* @note
279* None Channel ID must be created using "dmacHw_MAKE_CHANNEL_ID" macro
280*/
281/****************************************************************************/
282dmacHw_HANDLE_t dmacHw_getChannelHandle(dmacHw_ID_t channelId /* [ IN ] DMA Channel Id */
283 ) {
284 int idx;
285
286 switch ((channelId >> 8)) {
287 case 0:
288 dmacHw_ASSERT((channelId & 0xff) < dmaChannelCount_0);
289 idx = (channelId & 0xff);
290 break;
291 case 1:
292 dmacHw_ASSERT((channelId & 0xff) < dmaChannelCount_1);
293 idx = dmaChannelCount_0 + (channelId & 0xff);
294 break;
295 default:
296 dmacHw_ASSERT(0);
297 return (dmacHw_HANDLE_t) -1;
298 }
299
300 return dmacHw_CBLK_TO_HANDLE(&dmacHw_gCblk[idx]);
301}
302
303/****************************************************************************/
304/**
305* @brief Initializes a DMA channel for use
306*
307* This function initializes and resets a DMA channel for use
308*
309* @return -1 - On Failure
310* 0 - On Success
311*
312* @note
313* None
314*/
315/****************************************************************************/
316int dmacHw_initChannel(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
317 ) {
318 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
319 int module = pCblk->module;
320 int channel = pCblk->channel;
321
322 /* Reinitialize the control block */
323 memset((void *)pCblk, 0, sizeof(dmacHw_CBLK_t));
324 pCblk->module = module;
325 pCblk->channel = channel;
326
327 /* Enable DMA controller */
328 dmacHw_DMA_ENABLE(pCblk->module);
329 /* Reset DMA channel */
330 dmacHw_RESET_CONTROL_LO(pCblk->module, pCblk->channel);
331 dmacHw_RESET_CONTROL_HI(pCblk->module, pCblk->channel);
332 dmacHw_RESET_CONFIG_LO(pCblk->module, pCblk->channel);
333 dmacHw_RESET_CONFIG_HI(pCblk->module, pCblk->channel);
334
335 /* Clear all raw interrupt status */
336 dmacHw_TRAN_INT_CLEAR(pCblk->module, pCblk->channel);
337 dmacHw_BLOCK_INT_CLEAR(pCblk->module, pCblk->channel);
338 dmacHw_ERROR_INT_CLEAR(pCblk->module, pCblk->channel);
339
340 /* Mask event specific interrupts */
341 dmacHw_TRAN_INT_DISABLE(pCblk->module, pCblk->channel);
342 dmacHw_BLOCK_INT_DISABLE(pCblk->module, pCblk->channel);
343 dmacHw_STRAN_INT_DISABLE(pCblk->module, pCblk->channel);
344 dmacHw_DTRAN_INT_DISABLE(pCblk->module, pCblk->channel);
345 dmacHw_ERROR_INT_DISABLE(pCblk->module, pCblk->channel);
346
347 return 0;
348}
349
350/****************************************************************************/
351/**
352* @brief Finds amount of memory required to form a descriptor ring
353*
354*
355* @return Number of bytes required to form a descriptor ring
356*
357*
358*/
359/****************************************************************************/
360uint32_t dmacHw_descriptorLen(uint32_t descCnt /* [ IN ] Number of descriptor in the ring */
361 ) {
362 /* Need extra 4 byte to ensure 32 bit alignment */
363 return (descCnt * sizeof(dmacHw_DESC_t)) + sizeof(dmacHw_DESC_RING_t) +
364 sizeof(uint32_t);
365}
366
367/****************************************************************************/
368/**
369* @brief Initializes descriptor ring
370*
371* This function will initializes the descriptor ring of a DMA channel
372*
373*
374* @return -1 - On failure
375* 0 - On success
376* @note
377* - "len" parameter should be obtained from "dmacHw_descriptorLen"
378* - Descriptor buffer MUST be 32 bit aligned and uncached as it is
379* accessed by ARM and DMA
380*/
381/****************************************************************************/
382int dmacHw_initDescriptor(void *pDescriptorVirt, /* [ IN ] Virtual address of uncahced buffer allocated to form descriptor ring */
383 uint32_t descriptorPhyAddr, /* [ IN ] Physical address of pDescriptorVirt (descriptor buffer) */
384 uint32_t len, /* [ IN ] Size of the pBuf */
385 uint32_t num /* [ IN ] Number of descriptor in the ring */
386 ) {
387 uint32_t i;
388 dmacHw_DESC_RING_t *pRing;
389 dmacHw_DESC_t *pDesc;
390
391 /* Check the alignment of the descriptor */
392 if ((uint32_t) pDescriptorVirt & 0x00000003) {
393 dmacHw_ASSERT(0);
394 return -1;
395 }
396
397 /* Check if enough space has been allocated for descriptor ring */
398 if (len < dmacHw_descriptorLen(num)) {
399 return -1;
400 }
401
402 pRing = dmacHw_GET_DESC_RING(pDescriptorVirt);
403 pRing->pHead =
404 (dmacHw_DESC_t *) ((uint32_t) pRing + sizeof(dmacHw_DESC_RING_t));
405 pRing->pFree = pRing->pTail = pRing->pEnd = pRing->pHead;
406 pRing->pProg = dmacHw_DESC_INIT;
407 /* Initialize link item chain, starting from the head */
408 pDesc = pRing->pHead;
409 /* Find the offset between virtual to physical address */
410 pRing->virt2PhyOffset = (uint32_t) pDescriptorVirt - descriptorPhyAddr;
411
412 /* Form the descriptor ring */
413 for (i = 0; i < num - 1; i++) {
414 /* Clear link list item */
415 memset((void *)pDesc, 0, sizeof(dmacHw_DESC_t));
416 /* Point to the next item in the physical address */
417 pDesc->llpPhy = (uint32_t) (pDesc + 1) - pRing->virt2PhyOffset;
418 /* Point to the next item in the virtual address */
419 pDesc->llp = (uint32_t) (pDesc + 1);
420 /* Mark descriptor is ready to use */
421 pDesc->ctl.hi = dmacHw_DESC_FREE;
422 /* Look into next link list item */
423 pDesc++;
424 }
425
426 /* Clear last link list item */
427 memset((void *)pDesc, 0, sizeof(dmacHw_DESC_t));
428 /* Last item pointing to the first item in the
429 physical address to complete the ring */
430 pDesc->llpPhy = (uint32_t) pRing->pHead - pRing->virt2PhyOffset;
431 /* Last item pointing to the first item in the
432 virtual address to complete the ring
433 */
434 pDesc->llp = (uint32_t) pRing->pHead;
435 /* Mark descriptor is ready to use */
436 pDesc->ctl.hi = dmacHw_DESC_FREE;
437 /* Set the number of descriptors in the ring */
438 pRing->num = num;
439 return 0;
440}
441
442/****************************************************************************/
443/**
444* @brief Configure DMA channel
445*
446* @return 0 : On success
447* -1 : On failure
448*/
449/****************************************************************************/
450int dmacHw_configChannel(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
451 dmacHw_CONFIG_t *pConfig /* [ IN ] Configuration settings */
452 ) {
453 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
454 uint32_t cfgHigh = 0;
455 int srcTrSize;
456 int dstTrSize;
457
458 pCblk->varDataStarted = 0;
459 pCblk->userData = NULL;
460
461 /* Configure
462 - Burst transaction when enough data in available in FIFO
463 - AHB Access protection 1
464 - Source and destination peripheral ports
465 */
466 cfgHigh =
467 dmacHw_REG_CFG_HI_FIFO_ENOUGH | dmacHw_REG_CFG_HI_AHB_HPROT_1 |
468 dmacHw_SRC_PERI_INTF(pConfig->
469 srcPeripheralPort) |
470 dmacHw_DST_PERI_INTF(pConfig->dstPeripheralPort);
471 /* Set priority */
472 dmacHw_SET_CHANNEL_PRIORITY(pCblk->module, pCblk->channel,
473 pConfig->channelPriority);
474
475 if (pConfig->dstStatusRegisterAddress != 0) {
476 /* Destination status update enable */
477 cfgHigh |= dmacHw_REG_CFG_HI_UPDATE_DST_STAT;
478 /* Configure status registers */
479 dmacHw_SET_DSTATAR(pCblk->module, pCblk->channel,
480 pConfig->dstStatusRegisterAddress);
481 }
482
483 if (pConfig->srcStatusRegisterAddress != 0) {
484 /* Source status update enable */
485 cfgHigh |= dmacHw_REG_CFG_HI_UPDATE_SRC_STAT;
486 /* Source status update enable */
487 dmacHw_SET_SSTATAR(pCblk->module, pCblk->channel,
488 pConfig->srcStatusRegisterAddress);
489 }
490 /* Configure the config high register */
491 dmacHw_GET_CONFIG_HI(pCblk->module, pCblk->channel) = cfgHigh;
492
493 /* Clear all raw interrupt status */
494 dmacHw_TRAN_INT_CLEAR(pCblk->module, pCblk->channel);
495 dmacHw_BLOCK_INT_CLEAR(pCblk->module, pCblk->channel);
496 dmacHw_ERROR_INT_CLEAR(pCblk->module, pCblk->channel);
497
498 /* Configure block interrupt */
499 if (pConfig->blockTransferInterrupt == dmacHw_INTERRUPT_ENABLE) {
500 dmacHw_BLOCK_INT_ENABLE(pCblk->module, pCblk->channel);
501 } else {
502 dmacHw_BLOCK_INT_DISABLE(pCblk->module, pCblk->channel);
503 }
504 /* Configure complete transfer interrupt */
505 if (pConfig->completeTransferInterrupt == dmacHw_INTERRUPT_ENABLE) {
506 dmacHw_TRAN_INT_ENABLE(pCblk->module, pCblk->channel);
507 } else {
508 dmacHw_TRAN_INT_DISABLE(pCblk->module, pCblk->channel);
509 }
510 /* Configure error interrupt */
511 if (pConfig->errorInterrupt == dmacHw_INTERRUPT_ENABLE) {
512 dmacHw_ERROR_INT_ENABLE(pCblk->module, pCblk->channel);
513 } else {
514 dmacHw_ERROR_INT_DISABLE(pCblk->module, pCblk->channel);
515 }
516 /* Configure gather register */
517 if (pConfig->srcGatherWidth) {
518 srcTrSize =
519 dmacHw_GetTrWidthInBytes(pConfig->srcMaxTransactionWidth);
520 if (!
521 ((pConfig->srcGatherWidth % srcTrSize)
522 && (pConfig->srcGatherJump % srcTrSize))) {
523 dmacHw_REG_SGR_LO(pCblk->module, pCblk->channel) =
524 ((pConfig->srcGatherWidth /
525 srcTrSize) << 20) | (pConfig->srcGatherJump /
526 srcTrSize);
527 } else {
528 return -1;
529 }
530 }
531 /* Configure scatter register */
532 if (pConfig->dstScatterWidth) {
533 dstTrSize =
534 dmacHw_GetTrWidthInBytes(pConfig->dstMaxTransactionWidth);
535 if (!
536 ((pConfig->dstScatterWidth % dstTrSize)
537 && (pConfig->dstScatterJump % dstTrSize))) {
538 dmacHw_REG_DSR_LO(pCblk->module, pCblk->channel) =
539 ((pConfig->dstScatterWidth /
540 dstTrSize) << 20) | (pConfig->dstScatterJump /
541 dstTrSize);
542 } else {
543 return -1;
544 }
545 }
546 return 0;
547}
548
549/****************************************************************************/
550/**
551* @brief Indicates whether DMA transfer is in progress or completed
552*
553* @return DMA transfer status
554* dmacHw_TRANSFER_STATUS_BUSY: DMA Transfer ongoing
555* dmacHw_TRANSFER_STATUS_DONE: DMA Transfer completed
556* dmacHw_TRANSFER_STATUS_ERROR: DMA Transfer error
557*
558*/
559/****************************************************************************/
560dmacHw_TRANSFER_STATUS_e dmacHw_transferCompleted(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
561 ) {
562 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
563
564 if (CHANNEL_BUSY(pCblk->module, pCblk->channel)) {
565 return dmacHw_TRANSFER_STATUS_BUSY;
566 } else if (dmacHw_REG_INT_RAW_ERROR(pCblk->module) &
567 (0x00000001 << pCblk->channel)) {
568 return dmacHw_TRANSFER_STATUS_ERROR;
569 }
570
571 return dmacHw_TRANSFER_STATUS_DONE;
572}
573
574/****************************************************************************/
575/**
576* @brief Set descriptors for known data length
577*
578* When DMA has to work as a flow controller, this function prepares the
579* descriptor chain to transfer data
580*
581* from:
582* - Memory to memory
583* - Peripheral to memory
584* - Memory to Peripheral
585* - Peripheral to Peripheral
586*
587* @return -1 - On failure
588* 0 - On success
589*
590*/
591/****************************************************************************/
592int dmacHw_setDataDescriptor(dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
593 void *pDescriptor, /* [ IN ] Descriptor buffer */
594 void *pSrcAddr, /* [ IN ] Source (Peripheral/Memory) address */
595 void *pDstAddr, /* [ IN ] Destination (Peripheral/Memory) address */
596 size_t dataLen /* [ IN ] Data length in bytes */
597 ) {
598 dmacHw_TRANSACTION_WIDTH_e dstTrWidth;
599 dmacHw_TRANSACTION_WIDTH_e srcTrWidth;
600 dmacHw_DESC_RING_t *pRing = dmacHw_GET_DESC_RING(pDescriptor);
601 dmacHw_DESC_t *pStart;
602 dmacHw_DESC_t *pProg;
603 int srcTs = 0;
604 int blkTs = 0;
605 int oddSize = 0;
606 int descCount = 0;
607 int count = 0;
608 int dstTrSize = 0;
609 int srcTrSize = 0;
610 uint32_t maxBlockSize = dmacHw_MAX_BLOCKSIZE;
611
612 dstTrSize = dmacHw_GetTrWidthInBytes(pConfig->dstMaxTransactionWidth);
613 srcTrSize = dmacHw_GetTrWidthInBytes(pConfig->srcMaxTransactionWidth);
614
615 /* Skip Tx if buffer is NULL or length is unknown */
616 if ((pSrcAddr == NULL) || (pDstAddr == NULL) || (dataLen == 0)) {
617 /* Do not initiate transfer */
618 return -1;
619 }
620
621 /* Ensure scatter and gather are transaction aligned */
622 if ((pConfig->srcGatherWidth % srcTrSize)
623 || (pConfig->dstScatterWidth % dstTrSize)) {
624 return -2;
625 }
626
627 /*
628 Background 1: DMAC can not perform DMA if source and destination addresses are
629 not properly aligned with the channel's transaction width. So, for successful
630 DMA transfer, transaction width must be set according to the alignment of the
631 source and destination address.
632 */
633
634 /* Adjust destination transaction width if destination address is not aligned properly */
635 dstTrWidth = pConfig->dstMaxTransactionWidth;
636 while (dmacHw_ADDRESS_MASK(dstTrSize) & (uint32_t) pDstAddr) {
637 dstTrWidth = dmacHw_GetNextTrWidth(dstTrWidth);
638 dstTrSize = dmacHw_GetTrWidthInBytes(dstTrWidth);
639 }
640
641 /* Adjust source transaction width if source address is not aligned properly */
642 srcTrWidth = pConfig->srcMaxTransactionWidth;
643 while (dmacHw_ADDRESS_MASK(srcTrSize) & (uint32_t) pSrcAddr) {
644 srcTrWidth = dmacHw_GetNextTrWidth(srcTrWidth);
645 srcTrSize = dmacHw_GetTrWidthInBytes(srcTrWidth);
646 }
647
648 /* Find the maximum transaction per descriptor */
649 if (pConfig->maxDataPerBlock
650 && ((pConfig->maxDataPerBlock / srcTrSize) <
651 dmacHw_MAX_BLOCKSIZE)) {
652 maxBlockSize = pConfig->maxDataPerBlock / srcTrSize;
653 }
654
655 /* Find number of source transactions needed to complete the DMA transfer */
656 srcTs = dataLen / srcTrSize;
657 /* Find the odd number of bytes that need to be transferred as single byte transaction width */
658 if (srcTs && (dstTrSize > srcTrSize)) {
659 oddSize = dataLen % dstTrSize;
660 /* Adjust source transaction count due to "oddSize" */
661 srcTs = srcTs - (oddSize / srcTrSize);
662 } else {
663 oddSize = dataLen % srcTrSize;
664 }
665 /* Adjust "descCount" due to "oddSize" */
666 if (oddSize) {
667 descCount++;
668 }
669 /* Find the number of descriptor needed for total "srcTs" */
670 if (srcTs) {
671 descCount += ((srcTs - 1) / maxBlockSize) + 1;
672 }
673
674 /* Check the availability of "descCount" discriptors in the ring */
675 pProg = pRing->pHead;
676 for (count = 0; (descCount <= pRing->num) && (count < descCount);
677 count++) {
678 if ((pProg->ctl.hi & dmacHw_DESC_FREE) == 0) {
679 /* Sufficient descriptors are not available */
680 return -3;
681 }
682 pProg = (dmacHw_DESC_t *) pProg->llp;
683 }
684
685 /* Remember the link list item to program the channel registers */
686 pStart = pProg = pRing->pHead;
687 /* Make a link list with "descCount(=count)" number of descriptors */
688 while (count) {
689 /* Reset channel control information */
690 pProg->ctl.lo = 0;
691 /* Enable source gather if configured */
692 if (pConfig->srcGatherWidth) {
693 pProg->ctl.lo |= dmacHw_REG_CTL_SG_ENABLE;
694 }
695 /* Enable destination scatter if configured */
696 if (pConfig->dstScatterWidth) {
697 pProg->ctl.lo |= dmacHw_REG_CTL_DS_ENABLE;
698 }
699 /* Set source and destination address */
700 pProg->sar = (uint32_t) pSrcAddr;
701 pProg->dar = (uint32_t) pDstAddr;
702 /* Use "devCtl" to mark that user memory need to be freed later if needed */
703 if (pProg == pRing->pHead) {
704 pProg->devCtl = dmacHw_FREE_USER_MEMORY;
705 } else {
706 pProg->devCtl = 0;
707 }
708
709 blkTs = srcTs;
710
711 /* Special treatmeant for last descriptor */
712 if (count == 1) {
713 /* Mark the last descriptor */
714 pProg->ctl.lo &=
715 ~(dmacHw_REG_CTL_LLP_DST_EN |
716 dmacHw_REG_CTL_LLP_SRC_EN);
717 /* Treatment for odd data bytes */
718 if (oddSize) {
719 /* Adjust for single byte transaction width */
720 switch (pConfig->transferType) {
721 case dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM:
722 dstTrWidth =
723 dmacHw_DST_TRANSACTION_WIDTH_8;
724 blkTs =
725 (oddSize / srcTrSize) +
726 ((oddSize % srcTrSize) ? 1 : 0);
727 break;
728 case dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL:
729 srcTrWidth =
730 dmacHw_SRC_TRANSACTION_WIDTH_8;
731 blkTs = oddSize;
732 break;
733 case dmacHw_TRANSFER_TYPE_MEM_TO_MEM:
734 srcTrWidth =
735 dmacHw_SRC_TRANSACTION_WIDTH_8;
736 dstTrWidth =
737 dmacHw_DST_TRANSACTION_WIDTH_8;
738 blkTs = oddSize;
739 break;
740 case dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_PERIPHERAL:
741 /* Do not adjust the transaction width */
742 break;
743 }
744 } else {
745 srcTs -= blkTs;
746 }
747 } else {
748 if (srcTs / maxBlockSize) {
749 blkTs = maxBlockSize;
750 }
751 /* Remaining source transactions for next iteration */
752 srcTs -= blkTs;
753 }
754 /* Must have a valid source transactions */
755 dmacHw_ASSERT(blkTs > 0);
756 /* Set control information */
757 if (pConfig->flowControler == dmacHw_FLOW_CONTROL_DMA) {
758 pProg->ctl.lo |= pConfig->transferType |
759 pConfig->srcUpdate |
760 pConfig->dstUpdate |
761 srcTrWidth |
762 dstTrWidth |
763 pConfig->srcMaxBurstWidth |
764 pConfig->dstMaxBurstWidth |
765 pConfig->srcMasterInterface |
766 pConfig->dstMasterInterface | dmacHw_REG_CTL_INT_EN;
767 } else {
768 uint32_t transferType = 0;
769 switch (pConfig->transferType) {
770 case dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM:
771 transferType = dmacHw_REG_CTL_TTFC_PM_PERI;
772 break;
773 case dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL:
774 transferType = dmacHw_REG_CTL_TTFC_MP_PERI;
775 break;
776 default:
777 dmacHw_ASSERT(0);
778 }
779 pProg->ctl.lo |= transferType |
780 pConfig->srcUpdate |
781 pConfig->dstUpdate |
782 srcTrWidth |
783 dstTrWidth |
784 pConfig->srcMaxBurstWidth |
785 pConfig->dstMaxBurstWidth |
786 pConfig->srcMasterInterface |
787 pConfig->dstMasterInterface | dmacHw_REG_CTL_INT_EN;
788 }
789
790 /* Set block transaction size */
791 pProg->ctl.hi = blkTs & dmacHw_REG_CTL_BLOCK_TS_MASK;
792 /* Look for next descriptor */
793 if (count > 1) {
794 /* Point to the next descriptor */
795 pProg = (dmacHw_DESC_t *) pProg->llp;
796
797 /* Update source and destination address for next iteration */
798 switch (pConfig->transferType) {
799 case dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM:
800 if (pConfig->dstScatterWidth) {
801 pDstAddr =
802 (char *)pDstAddr +
803 blkTs * srcTrSize +
804 (((blkTs * srcTrSize) /
805 pConfig->dstScatterWidth) *
806 pConfig->dstScatterJump);
807 } else {
808 pDstAddr =
809 (char *)pDstAddr +
810 blkTs * srcTrSize;
811 }
812 break;
813 case dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL:
814 if (pConfig->srcGatherWidth) {
815 pSrcAddr =
816 (char *)pDstAddr +
817 blkTs * srcTrSize +
818 (((blkTs * srcTrSize) /
819 pConfig->srcGatherWidth) *
820 pConfig->srcGatherJump);
821 } else {
822 pSrcAddr =
823 (char *)pSrcAddr +
824 blkTs * srcTrSize;
825 }
826 break;
827 case dmacHw_TRANSFER_TYPE_MEM_TO_MEM:
828 if (pConfig->dstScatterWidth) {
829 pDstAddr =
830 (char *)pDstAddr +
831 blkTs * srcTrSize +
832 (((blkTs * srcTrSize) /
833 pConfig->dstScatterWidth) *
834 pConfig->dstScatterJump);
835 } else {
836 pDstAddr =
837 (char *)pDstAddr +
838 blkTs * srcTrSize;
839 }
840
841 if (pConfig->srcGatherWidth) {
842 pSrcAddr =
843 (char *)pDstAddr +
844 blkTs * srcTrSize +
845 (((blkTs * srcTrSize) /
846 pConfig->srcGatherWidth) *
847 pConfig->srcGatherJump);
848 } else {
849 pSrcAddr =
850 (char *)pSrcAddr +
851 blkTs * srcTrSize;
852 }
853 break;
854 case dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_PERIPHERAL:
855 /* Do not adjust the address */
856 break;
857 default:
858 dmacHw_ASSERT(0);
859 }
860 } else {
861 /* At the end of transfer "srcTs" must be zero */
862 dmacHw_ASSERT(srcTs == 0);
863 }
864 count--;
865 }
866
867 /* Remember the descriptor to initialize the registers */
868 if (pRing->pProg == dmacHw_DESC_INIT) {
869 pRing->pProg = pStart;
870 }
871 /* Indicate that the descriptor is updated */
872 pRing->pEnd = pProg;
873 /* Head pointing to the next descriptor */
874 pRing->pHead = (dmacHw_DESC_t *) pProg->llp;
875 /* Update Tail pointer if destination is a peripheral,
876 because no one is going to read from the pTail
877 */
878 if (!dmacHw_DST_IS_MEMORY(pConfig->transferType)) {
879 pRing->pTail = pRing->pHead;
880 }
881 return 0;
882}
883
884/****************************************************************************/
885/**
886* @brief Provides DMA controller attributes
887*
888*
889* @return DMA controller attributes
890*
891* @note
892* None
893*/
894/****************************************************************************/
895uint32_t dmacHw_getDmaControllerAttribute(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
896 dmacHw_CONTROLLER_ATTRIB_e attr /* [ IN ] DMA Controller attribute of type dmacHw_CONTROLLER_ATTRIB_e */
897 ) {
898 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
899
900 switch (attr) {
901 case dmacHw_CONTROLLER_ATTRIB_CHANNEL_NUM:
902 return dmacHw_GET_NUM_CHANNEL(pCblk->module);
903 case dmacHw_CONTROLLER_ATTRIB_CHANNEL_MAX_BLOCK_SIZE:
904 return (1 <<
905 (dmacHw_GET_MAX_BLOCK_SIZE
906 (pCblk->module, pCblk->module) + 2)) - 8;
907 case dmacHw_CONTROLLER_ATTRIB_MASTER_INTF_NUM:
908 return dmacHw_GET_NUM_INTERFACE(pCblk->module);
909 case dmacHw_CONTROLLER_ATTRIB_CHANNEL_BUS_WIDTH:
910 return 32 << dmacHw_GET_CHANNEL_DATA_WIDTH(pCblk->module,
911 pCblk->channel);
912 case dmacHw_CONTROLLER_ATTRIB_CHANNEL_FIFO_SIZE:
913 return GetFifoSize(handle);
914 }
915 dmacHw_ASSERT(0);
916 return 0;
917}
diff --git a/arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c b/arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c
deleted file mode 100644
index a1f328357aa..00000000000
--- a/arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c
+++ /dev/null
@@ -1,1017 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file dmacHw_extra.c
18*
19* @brief Extra Low level DMA controller driver routines
20*
21* @note
22*
23* These routines provide basic DMA functionality only.
24*/
25/****************************************************************************/
26
27/* ---- Include Files ---------------------------------------------------- */
28
29#include <csp/stdint.h>
30#include <stddef.h>
31
32#include <csp/dmacHw.h>
33#include <mach/csp/dmacHw_reg.h>
34#include <mach/csp/dmacHw_priv.h>
35
36extern dmacHw_CBLK_t dmacHw_gCblk[dmacHw_MAX_CHANNEL_COUNT]; /* Declared in dmacHw.c */
37
38/* ---- External Function Prototypes ------------------------------------- */
39
40/* ---- Internal Use Function Prototypes --------------------------------- */
41/****************************************************************************/
42/**
43* @brief Overwrites data length in the descriptor
44*
45* This function overwrites data length in the descriptor
46*
47*
48* @return void
49*
50* @note
51* This is only used for PCM channel
52*/
53/****************************************************************************/
54void dmacHw_setDataLength(dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
55 void *pDescriptor, /* [ IN ] Descriptor buffer */
56 size_t dataLen /* [ IN ] Data length in bytes */
57 );
58
59/****************************************************************************/
60/**
61* @brief Helper function to display DMA registers
62*
63* @return void
64*
65*
66* @note
67* None
68*/
69/****************************************************************************/
70static void DisplayRegisterContents(int module, /* [ IN ] DMA Controller unit (0-1) */
71 int channel, /* [ IN ] DMA Channel (0-7) / -1(all) */
72 int (*fpPrint) (const char *, ...) /* [ IN ] Callback to the print function */
73 ) {
74 int chan;
75
76 (*fpPrint) ("Displaying register content \n\n");
77 (*fpPrint) ("Module %d: Interrupt raw transfer 0x%X\n",
78 module, (uint32_t) (dmacHw_REG_INT_RAW_TRAN(module)));
79 (*fpPrint) ("Module %d: Interrupt raw block 0x%X\n",
80 module, (uint32_t) (dmacHw_REG_INT_RAW_BLOCK(module)));
81 (*fpPrint) ("Module %d: Interrupt raw src transfer 0x%X\n",
82 module, (uint32_t) (dmacHw_REG_INT_RAW_STRAN(module)));
83 (*fpPrint) ("Module %d: Interrupt raw dst transfer 0x%X\n",
84 module, (uint32_t) (dmacHw_REG_INT_RAW_DTRAN(module)));
85 (*fpPrint) ("Module %d: Interrupt raw error 0x%X\n",
86 module, (uint32_t) (dmacHw_REG_INT_RAW_ERROR(module)));
87 (*fpPrint) ("--------------------------------------------------\n");
88 (*fpPrint) ("Module %d: Interrupt stat transfer 0x%X\n",
89 module, (uint32_t) (dmacHw_REG_INT_STAT_TRAN(module)));
90 (*fpPrint) ("Module %d: Interrupt stat block 0x%X\n",
91 module, (uint32_t) (dmacHw_REG_INT_STAT_BLOCK(module)));
92 (*fpPrint) ("Module %d: Interrupt stat src transfer 0x%X\n",
93 module, (uint32_t) (dmacHw_REG_INT_STAT_STRAN(module)));
94 (*fpPrint) ("Module %d: Interrupt stat dst transfer 0x%X\n",
95 module, (uint32_t) (dmacHw_REG_INT_STAT_DTRAN(module)));
96 (*fpPrint) ("Module %d: Interrupt stat error 0x%X\n",
97 module, (uint32_t) (dmacHw_REG_INT_STAT_ERROR(module)));
98 (*fpPrint) ("--------------------------------------------------\n");
99 (*fpPrint) ("Module %d: Interrupt mask transfer 0x%X\n",
100 module, (uint32_t) (dmacHw_REG_INT_MASK_TRAN(module)));
101 (*fpPrint) ("Module %d: Interrupt mask block 0x%X\n",
102 module, (uint32_t) (dmacHw_REG_INT_MASK_BLOCK(module)));
103 (*fpPrint) ("Module %d: Interrupt mask src transfer 0x%X\n",
104 module, (uint32_t) (dmacHw_REG_INT_MASK_STRAN(module)));
105 (*fpPrint) ("Module %d: Interrupt mask dst transfer 0x%X\n",
106 module, (uint32_t) (dmacHw_REG_INT_MASK_DTRAN(module)));
107 (*fpPrint) ("Module %d: Interrupt mask error 0x%X\n",
108 module, (uint32_t) (dmacHw_REG_INT_MASK_ERROR(module)));
109 (*fpPrint) ("--------------------------------------------------\n");
110 (*fpPrint) ("Module %d: Interrupt clear transfer 0x%X\n",
111 module, (uint32_t) (dmacHw_REG_INT_CLEAR_TRAN(module)));
112 (*fpPrint) ("Module %d: Interrupt clear block 0x%X\n",
113 module, (uint32_t) (dmacHw_REG_INT_CLEAR_BLOCK(module)));
114 (*fpPrint) ("Module %d: Interrupt clear src transfer 0x%X\n",
115 module, (uint32_t) (dmacHw_REG_INT_CLEAR_STRAN(module)));
116 (*fpPrint) ("Module %d: Interrupt clear dst transfer 0x%X\n",
117 module, (uint32_t) (dmacHw_REG_INT_CLEAR_DTRAN(module)));
118 (*fpPrint) ("Module %d: Interrupt clear error 0x%X\n",
119 module, (uint32_t) (dmacHw_REG_INT_CLEAR_ERROR(module)));
120 (*fpPrint) ("--------------------------------------------------\n");
121 (*fpPrint) ("Module %d: SW source req 0x%X\n",
122 module, (uint32_t) (dmacHw_REG_SW_HS_SRC_REQ(module)));
123 (*fpPrint) ("Module %d: SW dest req 0x%X\n",
124 module, (uint32_t) (dmacHw_REG_SW_HS_DST_REQ(module)));
125 (*fpPrint) ("Module %d: SW source signal 0x%X\n",
126 module, (uint32_t) (dmacHw_REG_SW_HS_SRC_SGL_REQ(module)));
127 (*fpPrint) ("Module %d: SW dest signal 0x%X\n",
128 module, (uint32_t) (dmacHw_REG_SW_HS_DST_SGL_REQ(module)));
129 (*fpPrint) ("Module %d: SW source last 0x%X\n",
130 module, (uint32_t) (dmacHw_REG_SW_HS_SRC_LST_REQ(module)));
131 (*fpPrint) ("Module %d: SW dest last 0x%X\n",
132 module, (uint32_t) (dmacHw_REG_SW_HS_DST_LST_REQ(module)));
133 (*fpPrint) ("--------------------------------------------------\n");
134 (*fpPrint) ("Module %d: misc config 0x%X\n",
135 module, (uint32_t) (dmacHw_REG_MISC_CFG(module)));
136 (*fpPrint) ("Module %d: misc channel enable 0x%X\n",
137 module, (uint32_t) (dmacHw_REG_MISC_CH_ENABLE(module)));
138 (*fpPrint) ("Module %d: misc ID 0x%X\n",
139 module, (uint32_t) (dmacHw_REG_MISC_ID(module)));
140 (*fpPrint) ("Module %d: misc test 0x%X\n",
141 module, (uint32_t) (dmacHw_REG_MISC_TEST(module)));
142
143 if (channel == -1) {
144 for (chan = 0; chan < 8; chan++) {
145 (*fpPrint)
146 ("--------------------------------------------------\n");
147 (*fpPrint)
148 ("Module %d: Channel %d Source 0x%X\n",
149 module, chan,
150 (uint32_t) (dmacHw_REG_SAR(module, chan)));
151 (*fpPrint)
152 ("Module %d: Channel %d Destination 0x%X\n",
153 module, chan,
154 (uint32_t) (dmacHw_REG_DAR(module, chan)));
155 (*fpPrint)
156 ("Module %d: Channel %d LLP 0x%X\n",
157 module, chan,
158 (uint32_t) (dmacHw_REG_LLP(module, chan)));
159 (*fpPrint)
160 ("Module %d: Channel %d Control (LO) 0x%X\n",
161 module, chan,
162 (uint32_t) (dmacHw_REG_CTL_LO(module, chan)));
163 (*fpPrint)
164 ("Module %d: Channel %d Control (HI) 0x%X\n",
165 module, chan,
166 (uint32_t) (dmacHw_REG_CTL_HI(module, chan)));
167 (*fpPrint)
168 ("Module %d: Channel %d Source Stats 0x%X\n",
169 module, chan,
170 (uint32_t) (dmacHw_REG_SSTAT(module, chan)));
171 (*fpPrint)
172 ("Module %d: Channel %d Dest Stats 0x%X\n",
173 module, chan,
174 (uint32_t) (dmacHw_REG_DSTAT(module, chan)));
175 (*fpPrint)
176 ("Module %d: Channel %d Source Stats Addr 0x%X\n",
177 module, chan,
178 (uint32_t) (dmacHw_REG_SSTATAR(module, chan)));
179 (*fpPrint)
180 ("Module %d: Channel %d Dest Stats Addr 0x%X\n",
181 module, chan,
182 (uint32_t) (dmacHw_REG_DSTATAR(module, chan)));
183 (*fpPrint)
184 ("Module %d: Channel %d Config (LO) 0x%X\n",
185 module, chan,
186 (uint32_t) (dmacHw_REG_CFG_LO(module, chan)));
187 (*fpPrint)
188 ("Module %d: Channel %d Config (HI) 0x%X\n",
189 module, chan,
190 (uint32_t) (dmacHw_REG_CFG_HI(module, chan)));
191 }
192 } else {
193 chan = channel;
194 (*fpPrint)
195 ("--------------------------------------------------\n");
196 (*fpPrint)
197 ("Module %d: Channel %d Source 0x%X\n",
198 module, chan, (uint32_t) (dmacHw_REG_SAR(module, chan)));
199 (*fpPrint)
200 ("Module %d: Channel %d Destination 0x%X\n",
201 module, chan, (uint32_t) (dmacHw_REG_DAR(module, chan)));
202 (*fpPrint)
203 ("Module %d: Channel %d LLP 0x%X\n",
204 module, chan, (uint32_t) (dmacHw_REG_LLP(module, chan)));
205 (*fpPrint)
206 ("Module %d: Channel %d Control (LO) 0x%X\n",
207 module, chan,
208 (uint32_t) (dmacHw_REG_CTL_LO(module, chan)));
209 (*fpPrint)
210 ("Module %d: Channel %d Control (HI) 0x%X\n",
211 module, chan,
212 (uint32_t) (dmacHw_REG_CTL_HI(module, chan)));
213 (*fpPrint)
214 ("Module %d: Channel %d Source Stats 0x%X\n",
215 module, chan, (uint32_t) (dmacHw_REG_SSTAT(module, chan)));
216 (*fpPrint)
217 ("Module %d: Channel %d Dest Stats 0x%X\n",
218 module, chan, (uint32_t) (dmacHw_REG_DSTAT(module, chan)));
219 (*fpPrint)
220 ("Module %d: Channel %d Source Stats Addr 0x%X\n",
221 module, chan,
222 (uint32_t) (dmacHw_REG_SSTATAR(module, chan)));
223 (*fpPrint)
224 ("Module %d: Channel %d Dest Stats Addr 0x%X\n",
225 module, chan,
226 (uint32_t) (dmacHw_REG_DSTATAR(module, chan)));
227 (*fpPrint)
228 ("Module %d: Channel %d Config (LO) 0x%X\n",
229 module, chan,
230 (uint32_t) (dmacHw_REG_CFG_LO(module, chan)));
231 (*fpPrint)
232 ("Module %d: Channel %d Config (HI) 0x%X\n",
233 module, chan,
234 (uint32_t) (dmacHw_REG_CFG_HI(module, chan)));
235 }
236}
237
238/****************************************************************************/
239/**
240* @brief Helper function to display descriptor ring
241*
242* @return void
243*
244*
245* @note
246* None
247*/
248/****************************************************************************/
249static void DisplayDescRing(void *pDescriptor, /* [ IN ] Descriptor buffer */
250 int (*fpPrint) (const char *, ...) /* [ IN ] Callback to the print function */
251 ) {
252 dmacHw_DESC_RING_t *pRing = dmacHw_GET_DESC_RING(pDescriptor);
253 dmacHw_DESC_t *pStart;
254
255 if (pRing->pHead == NULL) {
256 return;
257 }
258
259 pStart = pRing->pHead;
260
261 while ((dmacHw_DESC_t *) pStart->llp != pRing->pHead) {
262 if (pStart == pRing->pHead) {
263 (*fpPrint) ("Head\n");
264 }
265 if (pStart == pRing->pTail) {
266 (*fpPrint) ("Tail\n");
267 }
268 if (pStart == pRing->pProg) {
269 (*fpPrint) ("Prog\n");
270 }
271 if (pStart == pRing->pEnd) {
272 (*fpPrint) ("End\n");
273 }
274 if (pStart == pRing->pFree) {
275 (*fpPrint) ("Free\n");
276 }
277 (*fpPrint) ("0x%X:\n", (uint32_t) pStart);
278 (*fpPrint) ("sar 0x%0X\n", pStart->sar);
279 (*fpPrint) ("dar 0x%0X\n", pStart->dar);
280 (*fpPrint) ("llp 0x%0X\n", pStart->llp);
281 (*fpPrint) ("ctl.lo 0x%0X\n", pStart->ctl.lo);
282 (*fpPrint) ("ctl.hi 0x%0X\n", pStart->ctl.hi);
283 (*fpPrint) ("sstat 0x%0X\n", pStart->sstat);
284 (*fpPrint) ("dstat 0x%0X\n", pStart->dstat);
285 (*fpPrint) ("devCtl 0x%0X\n", pStart->devCtl);
286
287 pStart = (dmacHw_DESC_t *) pStart->llp;
288 }
289 if (pStart == pRing->pHead) {
290 (*fpPrint) ("Head\n");
291 }
292 if (pStart == pRing->pTail) {
293 (*fpPrint) ("Tail\n");
294 }
295 if (pStart == pRing->pProg) {
296 (*fpPrint) ("Prog\n");
297 }
298 if (pStart == pRing->pEnd) {
299 (*fpPrint) ("End\n");
300 }
301 if (pStart == pRing->pFree) {
302 (*fpPrint) ("Free\n");
303 }
304 (*fpPrint) ("0x%X:\n", (uint32_t) pStart);
305 (*fpPrint) ("sar 0x%0X\n", pStart->sar);
306 (*fpPrint) ("dar 0x%0X\n", pStart->dar);
307 (*fpPrint) ("llp 0x%0X\n", pStart->llp);
308 (*fpPrint) ("ctl.lo 0x%0X\n", pStart->ctl.lo);
309 (*fpPrint) ("ctl.hi 0x%0X\n", pStart->ctl.hi);
310 (*fpPrint) ("sstat 0x%0X\n", pStart->sstat);
311 (*fpPrint) ("dstat 0x%0X\n", pStart->dstat);
312 (*fpPrint) ("devCtl 0x%0X\n", pStart->devCtl);
313}
314
315/****************************************************************************/
316/**
317* @brief Check if DMA channel is the flow controller
318*
319* @return 1 : If DMA is a flow controller
320* 0 : Peripheral is the flow controller
321*
322* @note
323* None
324*/
325/****************************************************************************/
326static inline int DmaIsFlowController(void *pDescriptor /* [ IN ] Descriptor buffer */
327 ) {
328 uint32_t ttfc =
329 (dmacHw_GET_DESC_RING(pDescriptor))->pTail->ctl.
330 lo & dmacHw_REG_CTL_TTFC_MASK;
331
332 switch (ttfc) {
333 case dmacHw_REG_CTL_TTFC_MM_DMAC:
334 case dmacHw_REG_CTL_TTFC_MP_DMAC:
335 case dmacHw_REG_CTL_TTFC_PM_DMAC:
336 case dmacHw_REG_CTL_TTFC_PP_DMAC:
337 return 1;
338 }
339
340 return 0;
341}
342
343/****************************************************************************/
344/**
345* @brief Overwrites data length in the descriptor
346*
347* This function overwrites data length in the descriptor
348*
349*
350* @return void
351*
352* @note
353* This is only used for PCM channel
354*/
355/****************************************************************************/
356void dmacHw_setDataLength(dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
357 void *pDescriptor, /* [ IN ] Descriptor buffer */
358 size_t dataLen /* [ IN ] Data length in bytes */
359 ) {
360 dmacHw_DESC_t *pProg;
361 dmacHw_DESC_t *pHead;
362 int srcTs = 0;
363 int srcTrSize = 0;
364
365 pHead = (dmacHw_GET_DESC_RING(pDescriptor))->pHead;
366 pProg = pHead;
367
368 srcTrSize = dmacHw_GetTrWidthInBytes(pConfig->srcMaxTransactionWidth);
369 srcTs = dataLen / srcTrSize;
370 do {
371 pProg->ctl.hi = srcTs & dmacHw_REG_CTL_BLOCK_TS_MASK;
372 pProg = (dmacHw_DESC_t *) pProg->llp;
373 } while (pProg != pHead);
374}
375
376/****************************************************************************/
377/**
378* @brief Clears the interrupt
379*
380* This function clears the DMA channel specific interrupt
381*
382*
383* @return void
384*
385* @note
386* Must be called under the context of ISR
387*/
388/****************************************************************************/
389void dmacHw_clearInterrupt(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
390 ) {
391 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
392
393 dmacHw_TRAN_INT_CLEAR(pCblk->module, pCblk->channel);
394 dmacHw_BLOCK_INT_CLEAR(pCblk->module, pCblk->channel);
395 dmacHw_ERROR_INT_CLEAR(pCblk->module, pCblk->channel);
396}
397
398/****************************************************************************/
399/**
400* @brief Returns the cause of channel specific DMA interrupt
401*
402* This function returns the cause of interrupt
403*
404* @return Interrupt status, each bit representing a specific type of interrupt
405*
406* @note
407* Should be called under the context of ISR
408*/
409/****************************************************************************/
410dmacHw_INTERRUPT_STATUS_e dmacHw_getInterruptStatus(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
411 ) {
412 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
413 dmacHw_INTERRUPT_STATUS_e status = dmacHw_INTERRUPT_STATUS_NONE;
414
415 if (dmacHw_REG_INT_STAT_TRAN(pCblk->module) &
416 ((0x00000001 << pCblk->channel))) {
417 status |= dmacHw_INTERRUPT_STATUS_TRANS;
418 }
419 if (dmacHw_REG_INT_STAT_BLOCK(pCblk->module) &
420 ((0x00000001 << pCblk->channel))) {
421 status |= dmacHw_INTERRUPT_STATUS_BLOCK;
422 }
423 if (dmacHw_REG_INT_STAT_ERROR(pCblk->module) &
424 ((0x00000001 << pCblk->channel))) {
425 status |= dmacHw_INTERRUPT_STATUS_ERROR;
426 }
427
428 return status;
429}
430
431/****************************************************************************/
432/**
433* @brief Indentifies a DMA channel causing interrupt
434*
435* This functions returns a channel causing interrupt of type dmacHw_INTERRUPT_STATUS_e
436*
437* @return NULL : No channel causing DMA interrupt
438* ! NULL : Handle to a channel causing DMA interrupt
439* @note
440* dmacHw_clearInterrupt() must be called with a valid handle after calling this function
441*/
442/****************************************************************************/
443dmacHw_HANDLE_t dmacHw_getInterruptSource(void)
444{
445 uint32_t i;
446
447 for (i = 0; i < dmaChannelCount_0 + dmaChannelCount_1; i++) {
448 if ((dmacHw_REG_INT_STAT_TRAN(dmacHw_gCblk[i].module) &
449 ((0x00000001 << dmacHw_gCblk[i].channel)))
450 || (dmacHw_REG_INT_STAT_BLOCK(dmacHw_gCblk[i].module) &
451 ((0x00000001 << dmacHw_gCblk[i].channel)))
452 || (dmacHw_REG_INT_STAT_ERROR(dmacHw_gCblk[i].module) &
453 ((0x00000001 << dmacHw_gCblk[i].channel)))
454 ) {
455 return dmacHw_CBLK_TO_HANDLE(&dmacHw_gCblk[i]);
456 }
457 }
458 return dmacHw_CBLK_TO_HANDLE(NULL);
459}
460
461/****************************************************************************/
462/**
463* @brief Estimates number of descriptor needed to perform certain DMA transfer
464*
465*
466* @return On failure : -1
467* On success : Number of descriptor count
468*
469*
470*/
471/****************************************************************************/
472int dmacHw_calculateDescriptorCount(dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
473 void *pSrcAddr, /* [ IN ] Source (Peripheral/Memory) address */
474 void *pDstAddr, /* [ IN ] Destination (Peripheral/Memory) address */
475 size_t dataLen /* [ IN ] Data length in bytes */
476 ) {
477 int srcTs = 0;
478 int oddSize = 0;
479 int descCount = 0;
480 int dstTrSize = 0;
481 int srcTrSize = 0;
482 uint32_t maxBlockSize = dmacHw_MAX_BLOCKSIZE;
483 dmacHw_TRANSACTION_WIDTH_e dstTrWidth;
484 dmacHw_TRANSACTION_WIDTH_e srcTrWidth;
485
486 dstTrSize = dmacHw_GetTrWidthInBytes(pConfig->dstMaxTransactionWidth);
487 srcTrSize = dmacHw_GetTrWidthInBytes(pConfig->srcMaxTransactionWidth);
488
489 /* Skip Tx if buffer is NULL or length is unknown */
490 if ((pSrcAddr == NULL) || (pDstAddr == NULL) || (dataLen == 0)) {
491 /* Do not initiate transfer */
492 return -1;
493 }
494
495 /* Ensure scatter and gather are transaction aligned */
496 if (pConfig->srcGatherWidth % srcTrSize
497 || pConfig->dstScatterWidth % dstTrSize) {
498 return -1;
499 }
500
501 /*
502 Background 1: DMAC can not perform DMA if source and destination addresses are
503 not properly aligned with the channel's transaction width. So, for successful
504 DMA transfer, transaction width must be set according to the alignment of the
505 source and destination address.
506 */
507
508 /* Adjust destination transaction width if destination address is not aligned properly */
509 dstTrWidth = pConfig->dstMaxTransactionWidth;
510 while (dmacHw_ADDRESS_MASK(dstTrSize) & (uint32_t) pDstAddr) {
511 dstTrWidth = dmacHw_GetNextTrWidth(dstTrWidth);
512 dstTrSize = dmacHw_GetTrWidthInBytes(dstTrWidth);
513 }
514
515 /* Adjust source transaction width if source address is not aligned properly */
516 srcTrWidth = pConfig->srcMaxTransactionWidth;
517 while (dmacHw_ADDRESS_MASK(srcTrSize) & (uint32_t) pSrcAddr) {
518 srcTrWidth = dmacHw_GetNextTrWidth(srcTrWidth);
519 srcTrSize = dmacHw_GetTrWidthInBytes(srcTrWidth);
520 }
521
522 /* Find the maximum transaction per descriptor */
523 if (pConfig->maxDataPerBlock
524 && ((pConfig->maxDataPerBlock / srcTrSize) <
525 dmacHw_MAX_BLOCKSIZE)) {
526 maxBlockSize = pConfig->maxDataPerBlock / srcTrSize;
527 }
528
529 /* Find number of source transactions needed to complete the DMA transfer */
530 srcTs = dataLen / srcTrSize;
531 /* Find the odd number of bytes that need to be transferred as single byte transaction width */
532 if (srcTs && (dstTrSize > srcTrSize)) {
533 oddSize = dataLen % dstTrSize;
534 /* Adjust source transaction count due to "oddSize" */
535 srcTs = srcTs - (oddSize / srcTrSize);
536 } else {
537 oddSize = dataLen % srcTrSize;
538 }
539 /* Adjust "descCount" due to "oddSize" */
540 if (oddSize) {
541 descCount++;
542 }
543
544 /* Find the number of descriptor needed for total "srcTs" */
545 if (srcTs) {
546 descCount += ((srcTs - 1) / maxBlockSize) + 1;
547 }
548
549 return descCount;
550}
551
552/****************************************************************************/
553/**
554* @brief Check the existence of pending descriptor
555*
556* This function confirmes if there is any pending descriptor in the chain
557* to program the channel
558*
559* @return 1 : Channel need to be programmed with pending descriptor
560* 0 : No more pending descriptor to programe the channel
561*
562* @note
563* - This function should be called from ISR in case there are pending
564* descriptor to program the channel.
565*
566* Example:
567*
568* dmac_isr ()
569* {
570* ...
571* if (dmacHw_descriptorPending (handle))
572* {
573* dmacHw_initiateTransfer (handle);
574* }
575* }
576*
577*/
578/****************************************************************************/
579uint32_t dmacHw_descriptorPending(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
580 void *pDescriptor /* [ IN ] Descriptor buffer */
581 ) {
582 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
583 dmacHw_DESC_RING_t *pRing = dmacHw_GET_DESC_RING(pDescriptor);
584
585 /* Make sure channel is not busy */
586 if (!CHANNEL_BUSY(pCblk->module, pCblk->channel)) {
587 /* Check if pEnd is not processed */
588 if (pRing->pEnd) {
589 /* Something left for processing */
590 return 1;
591 }
592 }
593 return 0;
594}
595
596/****************************************************************************/
597/**
598* @brief Program channel register to stop transfer
599*
600* Ensures the channel is not doing any transfer after calling this function
601*
602* @return void
603*
604*/
605/****************************************************************************/
606void dmacHw_stopTransfer(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
607 ) {
608 dmacHw_CBLK_t *pCblk;
609
610 pCblk = dmacHw_HANDLE_TO_CBLK(handle);
611
612 /* Stop the channel */
613 dmacHw_DMA_STOP(pCblk->module, pCblk->channel);
614}
615
616/****************************************************************************/
617/**
618* @brief Deallocates source or destination memory, allocated
619*
620* This function can be called to deallocate data memory that was DMAed successfully
621*
622* @return On failure : -1
623* On success : Number of buffer freed
624*
625* @note
626* This function will be called ONLY, when source OR destination address is pointing
627* to dynamic memory
628*/
629/****************************************************************************/
630int dmacHw_freeMem(dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
631 void *pDescriptor, /* [ IN ] Descriptor buffer */
632 void (*fpFree) (void *) /* [ IN ] Function pointer to free data memory */
633 ) {
634 dmacHw_DESC_RING_t *pRing = dmacHw_GET_DESC_RING(pDescriptor);
635 uint32_t count = 0;
636
637 if (fpFree == NULL) {
638 return -1;
639 }
640
641 while ((pRing->pFree != pRing->pTail)
642 && (pRing->pFree->ctl.lo & dmacHw_DESC_FREE)) {
643 if (pRing->pFree->devCtl == dmacHw_FREE_USER_MEMORY) {
644 /* Identify, which memory to free */
645 if (dmacHw_DST_IS_MEMORY(pConfig->transferType)) {
646 (*fpFree) ((void *)pRing->pFree->dar);
647 } else {
648 /* Destination was a peripheral */
649 (*fpFree) ((void *)pRing->pFree->sar);
650 }
651 /* Unmark user memory to indicate it is freed */
652 pRing->pFree->devCtl = ~dmacHw_FREE_USER_MEMORY;
653 }
654 dmacHw_NEXT_DESC(pRing, pFree);
655
656 count++;
657 }
658
659 return count;
660}
661
662/****************************************************************************/
663/**
664* @brief Prepares descriptor ring, when source peripheral working as a flow controller
665*
666* This function will update the discriptor ring by allocating buffers, when source peripheral
667* has to work as a flow controller to transfer data from:
668* - Peripheral to memory.
669*
670* @return On failure : -1
671* On success : Number of descriptor updated
672*
673*
674* @note
675* Channel must be configured for peripheral to memory transfer
676*
677*/
678/****************************************************************************/
679int dmacHw_setVariableDataDescriptor(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
680 dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
681 void *pDescriptor, /* [ IN ] Descriptor buffer */
682 uint32_t srcAddr, /* [ IN ] Source peripheral address */
683 void *(*fpAlloc) (int len), /* [ IN ] Function pointer that provides destination memory */
684 int len, /* [ IN ] Number of bytes "fpAlloc" will allocate for destination */
685 int num /* [ IN ] Number of descriptor to set */
686 ) {
687 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
688 dmacHw_DESC_t *pProg = NULL;
689 dmacHw_DESC_t *pLast = NULL;
690 dmacHw_DESC_RING_t *pRing = dmacHw_GET_DESC_RING(pDescriptor);
691 uint32_t dstAddr;
692 uint32_t controlParam;
693 int i;
694
695 dmacHw_ASSERT(pConfig->transferType ==
696 dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM);
697
698 if (num > pRing->num) {
699 return -1;
700 }
701
702 pLast = pRing->pEnd; /* Last descriptor updated */
703 pProg = pRing->pHead; /* First descriptor in the new list */
704
705 controlParam = pConfig->srcUpdate |
706 pConfig->dstUpdate |
707 pConfig->srcMaxTransactionWidth |
708 pConfig->dstMaxTransactionWidth |
709 pConfig->srcMasterInterface |
710 pConfig->dstMasterInterface |
711 pConfig->srcMaxBurstWidth |
712 pConfig->dstMaxBurstWidth |
713 dmacHw_REG_CTL_TTFC_PM_PERI |
714 dmacHw_REG_CTL_LLP_DST_EN |
715 dmacHw_REG_CTL_LLP_SRC_EN | dmacHw_REG_CTL_INT_EN;
716
717 for (i = 0; i < num; i++) {
718 /* Allocate Rx buffer only for idle descriptor */
719 if (((pRing->pHead->ctl.hi & dmacHw_DESC_FREE) == 0) ||
720 ((dmacHw_DESC_t *) pRing->pHead->llp == pRing->pTail)
721 ) {
722 /* Rx descriptor is not idle */
723 break;
724 }
725 /* Set source address */
726 pRing->pHead->sar = srcAddr;
727 if (fpAlloc) {
728 /* Allocate memory for buffer in descriptor */
729 dstAddr = (uint32_t) (*fpAlloc) (len);
730 /* Check the destination address */
731 if (dstAddr == 0) {
732 if (i == 0) {
733 /* Not a single descriptor is available */
734 return -1;
735 }
736 break;
737 }
738 /* Set destination address */
739 pRing->pHead->dar = dstAddr;
740 }
741 /* Set control information */
742 pRing->pHead->ctl.lo = controlParam;
743 /* Use "devCtl" to mark the memory that need to be freed later */
744 pRing->pHead->devCtl = dmacHw_FREE_USER_MEMORY;
745 /* Descriptor is now owned by the channel */
746 pRing->pHead->ctl.hi = 0;
747 /* Remember the descriptor last updated */
748 pRing->pEnd = pRing->pHead;
749 /* Update next descriptor */
750 dmacHw_NEXT_DESC(pRing, pHead);
751 }
752
753 /* Mark the end of the list */
754 pRing->pEnd->ctl.lo &=
755 ~(dmacHw_REG_CTL_LLP_DST_EN | dmacHw_REG_CTL_LLP_SRC_EN);
756 /* Connect the list */
757 if (pLast != pProg) {
758 pLast->ctl.lo |=
759 dmacHw_REG_CTL_LLP_DST_EN | dmacHw_REG_CTL_LLP_SRC_EN;
760 }
761 /* Mark the descriptors are updated */
762 pCblk->descUpdated = 1;
763 if (!pCblk->varDataStarted) {
764 /* LLP must be pointing to the first descriptor */
765 dmacHw_SET_LLP(pCblk->module, pCblk->channel,
766 (uint32_t) pProg - pRing->virt2PhyOffset);
767 /* Channel, handling variable data started */
768 pCblk->varDataStarted = 1;
769 }
770
771 return i;
772}
773
774/****************************************************************************/
775/**
776* @brief Read data DMAed to memory
777*
778* This function will read data that has been DMAed to memory while transferring from:
779* - Memory to memory
780* - Peripheral to memory
781*
782* @param handle -
783* @param ppBbuf -
784* @param pLen -
785*
786* @return 0 - No more data is available to read
787* 1 - More data might be available to read
788*
789*/
790/****************************************************************************/
791int dmacHw_readTransferredData(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
792 dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
793 void *pDescriptor, /* [ IN ] Descriptor buffer */
794 void **ppBbuf, /* [ OUT ] Data received */
795 size_t *pLlen /* [ OUT ] Length of the data received */
796 ) {
797 dmacHw_DESC_RING_t *pRing = dmacHw_GET_DESC_RING(pDescriptor);
798
799 (void)handle;
800
801 if (pConfig->transferMode != dmacHw_TRANSFER_MODE_CONTINUOUS) {
802 if (((pRing->pTail->ctl.hi & dmacHw_DESC_FREE) == 0) ||
803 (pRing->pTail == pRing->pHead)
804 ) {
805 /* No receive data available */
806 *ppBbuf = (char *)NULL;
807 *pLlen = 0;
808
809 return 0;
810 }
811 }
812
813 /* Return read buffer and length */
814 *ppBbuf = (char *)pRing->pTail->dar;
815
816 /* Extract length of the received data */
817 if (DmaIsFlowController(pDescriptor)) {
818 uint32_t srcTrSize = 0;
819
820 switch (pRing->pTail->ctl.lo & dmacHw_REG_CTL_SRC_TR_WIDTH_MASK) {
821 case dmacHw_REG_CTL_SRC_TR_WIDTH_8:
822 srcTrSize = 1;
823 break;
824 case dmacHw_REG_CTL_SRC_TR_WIDTH_16:
825 srcTrSize = 2;
826 break;
827 case dmacHw_REG_CTL_SRC_TR_WIDTH_32:
828 srcTrSize = 4;
829 break;
830 case dmacHw_REG_CTL_SRC_TR_WIDTH_64:
831 srcTrSize = 8;
832 break;
833 default:
834 dmacHw_ASSERT(0);
835 }
836 /* Calculate length from the block size */
837 *pLlen =
838 (pRing->pTail->ctl.hi & dmacHw_REG_CTL_BLOCK_TS_MASK) *
839 srcTrSize;
840 } else {
841 /* Extract length from the source peripheral */
842 *pLlen = pRing->pTail->sstat;
843 }
844
845 /* Advance tail to next descriptor */
846 dmacHw_NEXT_DESC(pRing, pTail);
847
848 return 1;
849}
850
851/****************************************************************************/
852/**
853* @brief Set descriptor carrying control information
854*
855* This function will be used to send specific control information to the device
856* using the DMA channel
857*
858*
859* @return -1 - On failure
860* 0 - On success
861*
862* @note
863* None
864*/
865/****************************************************************************/
866int dmacHw_setControlDescriptor(dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
867 void *pDescriptor, /* [ IN ] Descriptor buffer */
868 uint32_t ctlAddress, /* [ IN ] Address of the device control register */
869 uint32_t control /* [ IN ] Device control information */
870 ) {
871 dmacHw_DESC_RING_t *pRing = dmacHw_GET_DESC_RING(pDescriptor);
872
873 if (ctlAddress == 0) {
874 return -1;
875 }
876
877 /* Check the availability of descriptors in the ring */
878 if ((pRing->pHead->ctl.hi & dmacHw_DESC_FREE) == 0) {
879 return -1;
880 }
881 /* Set control information */
882 pRing->pHead->devCtl = control;
883 /* Set source and destination address */
884 pRing->pHead->sar = (uint32_t) &pRing->pHead->devCtl;
885 pRing->pHead->dar = ctlAddress;
886 /* Set control parameters */
887 if (pConfig->flowControler == dmacHw_FLOW_CONTROL_DMA) {
888 pRing->pHead->ctl.lo = pConfig->transferType |
889 dmacHw_SRC_ADDRESS_UPDATE_MODE_INC |
890 dmacHw_DST_ADDRESS_UPDATE_MODE_INC |
891 dmacHw_SRC_TRANSACTION_WIDTH_32 |
892 pConfig->dstMaxTransactionWidth |
893 dmacHw_SRC_BURST_WIDTH_0 |
894 dmacHw_DST_BURST_WIDTH_0 |
895 pConfig->srcMasterInterface |
896 pConfig->dstMasterInterface | dmacHw_REG_CTL_INT_EN;
897 } else {
898 uint32_t transferType = 0;
899 switch (pConfig->transferType) {
900 case dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM:
901 transferType = dmacHw_REG_CTL_TTFC_PM_PERI;
902 break;
903 case dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL:
904 transferType = dmacHw_REG_CTL_TTFC_MP_PERI;
905 break;
906 default:
907 dmacHw_ASSERT(0);
908 }
909 pRing->pHead->ctl.lo = transferType |
910 dmacHw_SRC_ADDRESS_UPDATE_MODE_INC |
911 dmacHw_DST_ADDRESS_UPDATE_MODE_INC |
912 dmacHw_SRC_TRANSACTION_WIDTH_32 |
913 pConfig->dstMaxTransactionWidth |
914 dmacHw_SRC_BURST_WIDTH_0 |
915 dmacHw_DST_BURST_WIDTH_0 |
916 pConfig->srcMasterInterface |
917 pConfig->dstMasterInterface |
918 pConfig->flowControler | dmacHw_REG_CTL_INT_EN;
919 }
920
921 /* Set block transaction size to one 32 bit transaction */
922 pRing->pHead->ctl.hi = dmacHw_REG_CTL_BLOCK_TS_MASK & 1;
923
924 /* Remember the descriptor to initialize the registers */
925 if (pRing->pProg == dmacHw_DESC_INIT) {
926 pRing->pProg = pRing->pHead;
927 }
928 pRing->pEnd = pRing->pHead;
929
930 /* Advance the descriptor */
931 dmacHw_NEXT_DESC(pRing, pHead);
932
933 /* Update Tail pointer if destination is a peripheral */
934 if (!dmacHw_DST_IS_MEMORY(pConfig->transferType)) {
935 pRing->pTail = pRing->pHead;
936 }
937 return 0;
938}
939
940/****************************************************************************/
941/**
942* @brief Sets channel specific user data
943*
944* This function associates user data to a specific DMA channel
945*
946*/
947/****************************************************************************/
948void dmacHw_setChannelUserData(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
949 void *userData /* [ IN ] User data */
950 ) {
951 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
952
953 pCblk->userData = userData;
954}
955
956/****************************************************************************/
957/**
958* @brief Gets channel specific user data
959*
960* This function returns user data specific to a DMA channel
961*
962* @return user data
963*/
964/****************************************************************************/
965void *dmacHw_getChannelUserData(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
966 ) {
967 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
968
969 return pCblk->userData;
970}
971
972/****************************************************************************/
973/**
974* @brief Resets descriptor control information
975*
976* @return void
977*/
978/****************************************************************************/
979void dmacHw_resetDescriptorControl(void *pDescriptor /* [ IN ] Descriptor buffer */
980 ) {
981 int i;
982 dmacHw_DESC_RING_t *pRing;
983 dmacHw_DESC_t *pDesc;
984
985 pRing = dmacHw_GET_DESC_RING(pDescriptor);
986 pDesc = pRing->pHead;
987
988 for (i = 0; i < pRing->num; i++) {
989 /* Mark descriptor is ready to use */
990 pDesc->ctl.hi = dmacHw_DESC_FREE;
991 /* Look into next link list item */
992 pDesc++;
993 }
994 pRing->pFree = pRing->pTail = pRing->pEnd = pRing->pHead;
995 pRing->pProg = dmacHw_DESC_INIT;
996}
997
998/****************************************************************************/
999/**
1000* @brief Displays channel specific registers and other control parameters
1001*
1002* @return void
1003*
1004*
1005* @note
1006* None
1007*/
1008/****************************************************************************/
1009void dmacHw_printDebugInfo(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
1010 void *pDescriptor, /* [ IN ] Descriptor buffer */
1011 int (*fpPrint) (const char *, ...) /* [ IN ] Print callback function */
1012 ) {
1013 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
1014
1015 DisplayRegisterContents(pCblk->module, pCblk->channel, fpPrint);
1016 DisplayDescRing(pDescriptor, fpPrint);
1017}
diff --git a/arch/arm/mach-bcmring/csp/tmr/Makefile b/arch/arm/mach-bcmring/csp/tmr/Makefile
deleted file mode 100644
index 244a61ab769..00000000000
--- a/arch/arm/mach-bcmring/csp/tmr/Makefile
+++ /dev/null
@@ -1 +0,0 @@
1obj-y += tmrHw.o
diff --git a/arch/arm/mach-bcmring/csp/tmr/tmrHw.c b/arch/arm/mach-bcmring/csp/tmr/tmrHw.c
deleted file mode 100644
index 16225e43f3c..00000000000
--- a/arch/arm/mach-bcmring/csp/tmr/tmrHw.c
+++ /dev/null
@@ -1,576 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file tmrHw.c
18*
19* @brief Low level Timer driver routines
20*
21* @note
22*
23* These routines provide basic timer functionality only.
24*/
25/****************************************************************************/
26
27/* ---- Include Files ---------------------------------------------------- */
28
29#include <csp/errno.h>
30#include <csp/stdint.h>
31
32#include <csp/tmrHw.h>
33#include <mach/csp/tmrHw_reg.h>
34
35#define tmrHw_ASSERT(a) if (!(a)) *(char *)0 = 0
36#define tmrHw_MILLISEC_PER_SEC (1000)
37
38#define tmrHw_LOW_1_RESOLUTION_COUNT (tmrHw_LOW_RESOLUTION_CLOCK / tmrHw_MILLISEC_PER_SEC)
39#define tmrHw_LOW_1_MAX_MILLISEC (0xFFFFFFFF / tmrHw_LOW_1_RESOLUTION_COUNT)
40#define tmrHw_LOW_16_RESOLUTION_COUNT (tmrHw_LOW_1_RESOLUTION_COUNT / 16)
41#define tmrHw_LOW_16_MAX_MILLISEC (0xFFFFFFFF / tmrHw_LOW_16_RESOLUTION_COUNT)
42#define tmrHw_LOW_256_RESOLUTION_COUNT (tmrHw_LOW_1_RESOLUTION_COUNT / 256)
43#define tmrHw_LOW_256_MAX_MILLISEC (0xFFFFFFFF / tmrHw_LOW_256_RESOLUTION_COUNT)
44
45#define tmrHw_HIGH_1_RESOLUTION_COUNT (tmrHw_HIGH_RESOLUTION_CLOCK / tmrHw_MILLISEC_PER_SEC)
46#define tmrHw_HIGH_1_MAX_MILLISEC (0xFFFFFFFF / tmrHw_HIGH_1_RESOLUTION_COUNT)
47#define tmrHw_HIGH_16_RESOLUTION_COUNT (tmrHw_HIGH_1_RESOLUTION_COUNT / 16)
48#define tmrHw_HIGH_16_MAX_MILLISEC (0xFFFFFFFF / tmrHw_HIGH_16_RESOLUTION_COUNT)
49#define tmrHw_HIGH_256_RESOLUTION_COUNT (tmrHw_HIGH_1_RESOLUTION_COUNT / 256)
50#define tmrHw_HIGH_256_MAX_MILLISEC (0xFFFFFFFF / tmrHw_HIGH_256_RESOLUTION_COUNT)
51
52static void ResetTimer(tmrHw_ID_t timerId)
53 __attribute__ ((section(".aramtext")));
54static int tmrHw_divide(int num, int denom)
55 __attribute__ ((section(".aramtext")));
56
57/****************************************************************************/
58/**
59* @brief Get timer capability
60*
61* This function returns various capabilities/attributes of a timer
62*
63* @return Capability
64*
65*/
66/****************************************************************************/
67uint32_t tmrHw_getTimerCapability(tmrHw_ID_t timerId, /* [ IN ] Timer Id */
68 tmrHw_CAPABILITY_e capability /* [ IN ] Timer capability */
69) {
70 switch (capability) {
71 case tmrHw_CAPABILITY_CLOCK:
72 return (timerId <=
73 1) ? tmrHw_LOW_RESOLUTION_CLOCK :
74 tmrHw_HIGH_RESOLUTION_CLOCK;
75 case tmrHw_CAPABILITY_RESOLUTION:
76 return 32;
77 default:
78 return 0;
79 }
80 return 0;
81}
82
83/****************************************************************************/
84/**
85* @brief Resets a timer
86*
87* This function initializes timer
88*
89* @return void
90*
91*/
92/****************************************************************************/
93static void ResetTimer(tmrHw_ID_t timerId /* [ IN ] Timer Id */
94) {
95 /* Reset timer */
96 pTmrHw[timerId].LoadValue = 0;
97 pTmrHw[timerId].CurrentValue = 0xFFFFFFFF;
98 pTmrHw[timerId].Control = 0;
99 pTmrHw[timerId].BackgroundLoad = 0;
100 /* Always configure as a 32 bit timer */
101 pTmrHw[timerId].Control |= tmrHw_CONTROL_32BIT;
102 /* Clear interrupt only if raw status interrupt is set */
103 if (pTmrHw[timerId].RawInterruptStatus) {
104 pTmrHw[timerId].InterruptClear = 0xFFFFFFFF;
105 }
106}
107
108/****************************************************************************/
109/**
110* @brief Sets counter value for an interval in ms
111*
112* @return On success: Effective counter value set
113* On failure: 0
114*
115*/
116/****************************************************************************/
117static tmrHw_INTERVAL_t SetTimerPeriod(tmrHw_ID_t timerId, /* [ IN ] Timer Id */
118 tmrHw_INTERVAL_t msec /* [ IN ] Interval in milli-second */
119) {
120 uint32_t scale = 0;
121 uint32_t count = 0;
122
123 if (timerId == 0 || timerId == 1) {
124 if (msec <= tmrHw_LOW_1_MAX_MILLISEC) {
125 pTmrHw[timerId].Control |= tmrHw_CONTROL_PRESCALE_1;
126 scale = tmrHw_LOW_1_RESOLUTION_COUNT;
127 } else if (msec <= tmrHw_LOW_16_MAX_MILLISEC) {
128 pTmrHw[timerId].Control |= tmrHw_CONTROL_PRESCALE_16;
129 scale = tmrHw_LOW_16_RESOLUTION_COUNT;
130 } else if (msec <= tmrHw_LOW_256_MAX_MILLISEC) {
131 pTmrHw[timerId].Control |= tmrHw_CONTROL_PRESCALE_256;
132 scale = tmrHw_LOW_256_RESOLUTION_COUNT;
133 } else {
134 return 0;
135 }
136
137 count = msec * scale;
138 /* Set counter value */
139 pTmrHw[timerId].LoadValue = count;
140 pTmrHw[timerId].BackgroundLoad = count;
141
142 } else if (timerId == 2 || timerId == 3) {
143 if (msec <= tmrHw_HIGH_1_MAX_MILLISEC) {
144 pTmrHw[timerId].Control |= tmrHw_CONTROL_PRESCALE_1;
145 scale = tmrHw_HIGH_1_RESOLUTION_COUNT;
146 } else if (msec <= tmrHw_HIGH_16_MAX_MILLISEC) {
147 pTmrHw[timerId].Control |= tmrHw_CONTROL_PRESCALE_16;
148 scale = tmrHw_HIGH_16_RESOLUTION_COUNT;
149 } else if (msec <= tmrHw_HIGH_256_MAX_MILLISEC) {
150 pTmrHw[timerId].Control |= tmrHw_CONTROL_PRESCALE_256;
151 scale = tmrHw_HIGH_256_RESOLUTION_COUNT;
152 } else {
153 return 0;
154 }
155
156 count = msec * scale;
157 /* Set counter value */
158 pTmrHw[timerId].LoadValue = count;
159 pTmrHw[timerId].BackgroundLoad = count;
160 }
161 return count / scale;
162}
163
164/****************************************************************************/
165/**
166* @brief Configures a periodic timer in terms of timer interrupt rate
167*
168* This function initializes a periodic timer to generate specific number of
169* timer interrupt per second
170*
171* @return On success: Effective timer frequency
172* On failure: 0
173*
174*/
175/****************************************************************************/
176tmrHw_RATE_t tmrHw_setPeriodicTimerRate(tmrHw_ID_t timerId, /* [ IN ] Timer Id */
177 tmrHw_RATE_t rate /* [ IN ] Number of timer interrupt per second */
178) {
179 uint32_t resolution = 0;
180 uint32_t count = 0;
181 ResetTimer(timerId);
182
183 /* Set timer mode periodic */
184 pTmrHw[timerId].Control |= tmrHw_CONTROL_PERIODIC;
185 pTmrHw[timerId].Control &= ~tmrHw_CONTROL_ONESHOT;
186 /* Set timer in highest resolution */
187 pTmrHw[timerId].Control |= tmrHw_CONTROL_PRESCALE_1;
188
189 if (rate && (timerId == 0 || timerId == 1)) {
190 if (rate > tmrHw_LOW_RESOLUTION_CLOCK) {
191 return 0;
192 }
193 resolution = tmrHw_LOW_RESOLUTION_CLOCK;
194 } else if (rate && (timerId == 2 || timerId == 3)) {
195 if (rate > tmrHw_HIGH_RESOLUTION_CLOCK) {
196 return 0;
197 } else {
198 resolution = tmrHw_HIGH_RESOLUTION_CLOCK;
199 }
200 } else {
201 return 0;
202 }
203 /* Find the counter value */
204 count = resolution / rate;
205 /* Set counter value */
206 pTmrHw[timerId].LoadValue = count;
207 pTmrHw[timerId].BackgroundLoad = count;
208
209 return resolution / count;
210}
211
212/****************************************************************************/
213/**
214* @brief Configures a periodic timer to generate timer interrupt after
215* certain time interval
216*
217* This function initializes a periodic timer to generate timer interrupt
218* after every time interval in millisecond
219*
220* @return On success: Effective interval set in milli-second
221* On failure: 0
222*
223*/
224/****************************************************************************/
225tmrHw_INTERVAL_t tmrHw_setPeriodicTimerInterval(tmrHw_ID_t timerId, /* [ IN ] Timer Id */
226 tmrHw_INTERVAL_t msec /* [ IN ] Interval in milli-second */
227) {
228 ResetTimer(timerId);
229
230 /* Set timer mode periodic */
231 pTmrHw[timerId].Control |= tmrHw_CONTROL_PERIODIC;
232 pTmrHw[timerId].Control &= ~tmrHw_CONTROL_ONESHOT;
233
234 return SetTimerPeriod(timerId, msec);
235}
236
237/****************************************************************************/
238/**
239* @brief Configures a periodic timer to generate timer interrupt just once
240* after certain time interval
241*
242* This function initializes a periodic timer to generate a single ticks after
243* certain time interval in millisecond
244*
245* @return On success: Effective interval set in milli-second
246* On failure: 0
247*
248*/
249/****************************************************************************/
250tmrHw_INTERVAL_t tmrHw_setOneshotTimerInterval(tmrHw_ID_t timerId, /* [ IN ] Timer Id */
251 tmrHw_INTERVAL_t msec /* [ IN ] Interval in milli-second */
252) {
253 ResetTimer(timerId);
254
255 /* Set timer mode oneshot */
256 pTmrHw[timerId].Control |= tmrHw_CONTROL_PERIODIC;
257 pTmrHw[timerId].Control |= tmrHw_CONTROL_ONESHOT;
258
259 return SetTimerPeriod(timerId, msec);
260}
261
262/****************************************************************************/
263/**
264* @brief Configures a timer to run as a free running timer
265*
266* This function initializes a timer to run as a free running timer
267*
268* @return Timer resolution (count / sec)
269*
270*/
271/****************************************************************************/
272tmrHw_RATE_t tmrHw_setFreeRunningTimer(tmrHw_ID_t timerId, /* [ IN ] Timer Id */
273 uint32_t divider /* [ IN ] Dividing the clock frequency */
274) {
275 uint32_t scale = 0;
276
277 ResetTimer(timerId);
278 /* Set timer as free running mode */
279 pTmrHw[timerId].Control &= ~tmrHw_CONTROL_PERIODIC;
280 pTmrHw[timerId].Control &= ~tmrHw_CONTROL_ONESHOT;
281
282 if (divider >= 64) {
283 pTmrHw[timerId].Control |= tmrHw_CONTROL_PRESCALE_256;
284 scale = 256;
285 } else if (divider >= 8) {
286 pTmrHw[timerId].Control |= tmrHw_CONTROL_PRESCALE_16;
287 scale = 16;
288 } else {
289 pTmrHw[timerId].Control |= tmrHw_CONTROL_PRESCALE_1;
290 scale = 1;
291 }
292
293 if (timerId == 0 || timerId == 1) {
294 return tmrHw_divide(tmrHw_LOW_RESOLUTION_CLOCK, scale);
295 } else if (timerId == 2 || timerId == 3) {
296 return tmrHw_divide(tmrHw_HIGH_RESOLUTION_CLOCK, scale);
297 }
298
299 return 0;
300}
301
302/****************************************************************************/
303/**
304* @brief Starts a timer
305*
306* This function starts a preconfigured timer
307*
308* @return -1 - On Failure
309* 0 - On Success
310*
311*/
312/****************************************************************************/
313int tmrHw_startTimer(tmrHw_ID_t timerId /* [ IN ] Timer id */
314) {
315 pTmrHw[timerId].Control |= tmrHw_CONTROL_TIMER_ENABLE;
316 return 0;
317}
318
319/****************************************************************************/
320/**
321* @brief Stops a timer
322*
323* This function stops a running timer
324*
325* @return -1 - On Failure
326* 0 - On Success
327*
328*/
329/****************************************************************************/
330int tmrHw_stopTimer(tmrHw_ID_t timerId /* [ IN ] Timer id */
331) {
332 pTmrHw[timerId].Control &= ~tmrHw_CONTROL_TIMER_ENABLE;
333 return 0;
334}
335
336/****************************************************************************/
337/**
338* @brief Gets current timer count
339*
340* This function returns the current timer value
341*
342* @return Current downcounting timer value
343*
344*/
345/****************************************************************************/
346uint32_t tmrHw_GetCurrentCount(tmrHw_ID_t timerId /* [ IN ] Timer id */
347) {
348 /* return 32 bit timer value */
349 switch (pTmrHw[timerId].Control & tmrHw_CONTROL_MODE_MASK) {
350 case tmrHw_CONTROL_FREE_RUNNING:
351 if (pTmrHw[timerId].CurrentValue) {
352 return tmrHw_MAX_COUNT - pTmrHw[timerId].CurrentValue;
353 }
354 break;
355 case tmrHw_CONTROL_PERIODIC:
356 case tmrHw_CONTROL_ONESHOT:
357 return pTmrHw[timerId].BackgroundLoad -
358 pTmrHw[timerId].CurrentValue;
359 }
360 return 0;
361}
362
363/****************************************************************************/
364/**
365* @brief Gets timer count rate
366*
367* This function returns the number of counts per second
368*
369* @return Count rate
370*
371*/
372/****************************************************************************/
373tmrHw_RATE_t tmrHw_getCountRate(tmrHw_ID_t timerId /* [ IN ] Timer id */
374) {
375 uint32_t divider = 0;
376
377 switch (pTmrHw[timerId].Control & tmrHw_CONTROL_PRESCALE_MASK) {
378 case tmrHw_CONTROL_PRESCALE_1:
379 divider = 1;
380 break;
381 case tmrHw_CONTROL_PRESCALE_16:
382 divider = 16;
383 break;
384 case tmrHw_CONTROL_PRESCALE_256:
385 divider = 256;
386 break;
387 default:
388 tmrHw_ASSERT(0);
389 }
390
391 if (timerId == 0 || timerId == 1) {
392 return tmrHw_divide(tmrHw_LOW_RESOLUTION_CLOCK, divider);
393 } else {
394 return tmrHw_divide(tmrHw_HIGH_RESOLUTION_CLOCK, divider);
395 }
396 return 0;
397}
398
399/****************************************************************************/
400/**
401* @brief Enables timer interrupt
402*
403* This function enables the timer interrupt
404*
405* @return N/A
406*
407*/
408/****************************************************************************/
409void tmrHw_enableInterrupt(tmrHw_ID_t timerId /* [ IN ] Timer id */
410) {
411 pTmrHw[timerId].Control |= tmrHw_CONTROL_INTERRUPT_ENABLE;
412}
413
414/****************************************************************************/
415/**
416* @brief Disables timer interrupt
417*
418* This function disable the timer interrupt
419*
420* @return N/A
421*
422*/
423/****************************************************************************/
424void tmrHw_disableInterrupt(tmrHw_ID_t timerId /* [ IN ] Timer id */
425) {
426 pTmrHw[timerId].Control &= ~tmrHw_CONTROL_INTERRUPT_ENABLE;
427}
428
429/****************************************************************************/
430/**
431* @brief Clears the interrupt
432*
433* This function clears the timer interrupt
434*
435* @return N/A
436*
437* @note
438* Must be called under the context of ISR
439*/
440/****************************************************************************/
441void tmrHw_clearInterrupt(tmrHw_ID_t timerId /* [ IN ] Timer id */
442) {
443 pTmrHw[timerId].InterruptClear = 0x1;
444}
445
446/****************************************************************************/
447/**
448* @brief Gets the interrupt status
449*
450* This function returns timer interrupt status
451*
452* @return Interrupt status
453*/
454/****************************************************************************/
455tmrHw_INTERRUPT_STATUS_e tmrHw_getInterruptStatus(tmrHw_ID_t timerId /* [ IN ] Timer id */
456) {
457 if (pTmrHw[timerId].InterruptStatus) {
458 return tmrHw_INTERRUPT_STATUS_SET;
459 } else {
460 return tmrHw_INTERRUPT_STATUS_UNSET;
461 }
462}
463
464/****************************************************************************/
465/**
466* @brief Indentifies a timer causing interrupt
467*
468* This functions returns a timer causing interrupt
469*
470* @return 0xFFFFFFFF : No timer causing an interrupt
471* ! 0xFFFFFFFF : timer causing an interrupt
472* @note
473* tmrHw_clearIntrrupt() must be called with a valid timer id after calling this function
474*/
475/****************************************************************************/
476tmrHw_ID_t tmrHw_getInterruptSource(void /* void */
477) {
478 int i;
479
480 for (i = 0; i < tmrHw_TIMER_NUM_COUNT; i++) {
481 if (pTmrHw[i].InterruptStatus) {
482 return i;
483 }
484 }
485
486 return 0xFFFFFFFF;
487}
488
489/****************************************************************************/
490/**
491* @brief Displays specific timer registers
492*
493*
494* @return void
495*
496*/
497/****************************************************************************/
498void tmrHw_printDebugInfo(tmrHw_ID_t timerId, /* [ IN ] Timer id */
499 int (*fpPrint) (const char *, ...) /* [ IN ] Print callback function */
500) {
501 (*fpPrint) ("Displaying register contents \n\n");
502 (*fpPrint) ("Timer %d: Load value 0x%X\n", timerId,
503 pTmrHw[timerId].LoadValue);
504 (*fpPrint) ("Timer %d: Background load value 0x%X\n", timerId,
505 pTmrHw[timerId].BackgroundLoad);
506 (*fpPrint) ("Timer %d: Control 0x%X\n", timerId,
507 pTmrHw[timerId].Control);
508 (*fpPrint) ("Timer %d: Interrupt clear 0x%X\n", timerId,
509 pTmrHw[timerId].InterruptClear);
510 (*fpPrint) ("Timer %d: Interrupt raw interrupt 0x%X\n", timerId,
511 pTmrHw[timerId].RawInterruptStatus);
512 (*fpPrint) ("Timer %d: Interrupt status 0x%X\n", timerId,
513 pTmrHw[timerId].InterruptStatus);
514}
515
516/****************************************************************************/
517/**
518* @brief Use a timer to perform a busy wait delay for a number of usecs.
519*
520* @return N/A
521*/
522/****************************************************************************/
523void tmrHw_udelay(tmrHw_ID_t timerId, /* [ IN ] Timer id */
524 unsigned long usecs /* [ IN ] usec to delay */
525) {
526 tmrHw_RATE_t usec_tick_rate;
527 tmrHw_COUNT_t start_time;
528 tmrHw_COUNT_t delta_time;
529
530 start_time = tmrHw_GetCurrentCount(timerId);
531 usec_tick_rate = tmrHw_divide(tmrHw_getCountRate(timerId), 1000000);
532 delta_time = usecs * usec_tick_rate;
533
534 /* Busy wait */
535 while (delta_time > (tmrHw_GetCurrentCount(timerId) - start_time))
536 ;
537}
538
539/****************************************************************************/
540/**
541* @brief Local Divide function
542*
543* This function does the divide
544*
545* @return divide value
546*
547*/
548/****************************************************************************/
549static int tmrHw_divide(int num, int denom)
550{
551 int r;
552 int t = 1;
553
554 /* Shift denom and t up to the largest value to optimize algorithm */
555 /* t contains the units of each divide */
556 while ((denom & 0x40000000) == 0) { /* fails if denom=0 */
557 denom = denom << 1;
558 t = t << 1;
559 }
560
561 /* Initialize the result */
562 r = 0;
563
564 do {
565 /* Determine if there exists a positive remainder */
566 if ((num - denom) >= 0) {
567 /* Accumlate t to the result and calculate a new remainder */
568 num = num - denom;
569 r = r + t;
570 }
571 /* Continue to shift denom and shift t down to 0 */
572 denom = denom >> 1;
573 t = t >> 1;
574 } while (t != 0);
575 return r;
576}
diff --git a/arch/arm/mach-bcmring/dma.c b/arch/arm/mach-bcmring/dma.c
deleted file mode 100644
index e5fd241fccd..00000000000
--- a/arch/arm/mach-bcmring/dma.c
+++ /dev/null
@@ -1,1518 +0,0 @@
1/*****************************************************************************
2* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file dma.c
18*
19* @brief Implements the DMA interface.
20*/
21/****************************************************************************/
22
23/* ---- Include Files ---------------------------------------------------- */
24
25#include <linux/module.h>
26#include <linux/device.h>
27#include <linux/dma-mapping.h>
28#include <linux/interrupt.h>
29#include <linux/sched.h>
30#include <linux/irqreturn.h>
31#include <linux/proc_fs.h>
32#include <linux/slab.h>
33
34#include <mach/timer.h>
35
36#include <linux/pfn.h>
37#include <linux/atomic.h>
38#include <mach/dma.h>
39
40/* ---- Public Variables ------------------------------------------------- */
41
42/* ---- Private Constants and Types -------------------------------------- */
43
44#define MAKE_HANDLE(controllerIdx, channelIdx) (((controllerIdx) << 4) | (channelIdx))
45
46#define CONTROLLER_FROM_HANDLE(handle) (((handle) >> 4) & 0x0f)
47#define CHANNEL_FROM_HANDLE(handle) ((handle) & 0x0f)
48
49
50/* ---- Private Variables ------------------------------------------------ */
51
52static DMA_Global_t gDMA;
53static struct proc_dir_entry *gDmaDir;
54
55#include "dma_device.c"
56
57/* ---- Private Function Prototypes -------------------------------------- */
58
59/* ---- Functions ------------------------------------------------------- */
60
61/****************************************************************************/
62/**
63* Displays information for /proc/dma/channels
64*/
65/****************************************************************************/
66
67static int dma_proc_read_channels(char *buf, char **start, off_t offset,
68 int count, int *eof, void *data)
69{
70 int controllerIdx;
71 int channelIdx;
72 int limit = count - 200;
73 int len = 0;
74 DMA_Channel_t *channel;
75
76 if (down_interruptible(&gDMA.lock) < 0) {
77 return -ERESTARTSYS;
78 }
79
80 for (controllerIdx = 0; controllerIdx < DMA_NUM_CONTROLLERS;
81 controllerIdx++) {
82 for (channelIdx = 0; channelIdx < DMA_NUM_CHANNELS;
83 channelIdx++) {
84 if (len >= limit) {
85 break;
86 }
87
88 channel =
89 &gDMA.controller[controllerIdx].channel[channelIdx];
90
91 len +=
92 sprintf(buf + len, "%d:%d ", controllerIdx,
93 channelIdx);
94
95 if ((channel->flags & DMA_CHANNEL_FLAG_IS_DEDICATED) !=
96 0) {
97 len +=
98 sprintf(buf + len, "Dedicated for %s ",
99 DMA_gDeviceAttribute[channel->
100 devType].name);
101 } else {
102 len += sprintf(buf + len, "Shared ");
103 }
104
105 if ((channel->flags & DMA_CHANNEL_FLAG_NO_ISR) != 0) {
106 len += sprintf(buf + len, "No ISR ");
107 }
108
109 if ((channel->flags & DMA_CHANNEL_FLAG_LARGE_FIFO) != 0) {
110 len += sprintf(buf + len, "Fifo: 128 ");
111 } else {
112 len += sprintf(buf + len, "Fifo: 64 ");
113 }
114
115 if ((channel->flags & DMA_CHANNEL_FLAG_IN_USE) != 0) {
116 len +=
117 sprintf(buf + len, "InUse by %s",
118 DMA_gDeviceAttribute[channel->
119 devType].name);
120#if (DMA_DEBUG_TRACK_RESERVATION)
121 len +=
122 sprintf(buf + len, " (%s:%d)",
123 channel->fileName,
124 channel->lineNum);
125#endif
126 } else {
127 len += sprintf(buf + len, "Avail ");
128 }
129
130 if (channel->lastDevType != DMA_DEVICE_NONE) {
131 len +=
132 sprintf(buf + len, "Last use: %s ",
133 DMA_gDeviceAttribute[channel->
134 lastDevType].
135 name);
136 }
137
138 len += sprintf(buf + len, "\n");
139 }
140 }
141 up(&gDMA.lock);
142 *eof = 1;
143
144 return len;
145}
146
147/****************************************************************************/
148/**
149* Displays information for /proc/dma/devices
150*/
151/****************************************************************************/
152
153static int dma_proc_read_devices(char *buf, char **start, off_t offset,
154 int count, int *eof, void *data)
155{
156 int limit = count - 200;
157 int len = 0;
158 int devIdx;
159
160 if (down_interruptible(&gDMA.lock) < 0) {
161 return -ERESTARTSYS;
162 }
163
164 for (devIdx = 0; devIdx < DMA_NUM_DEVICE_ENTRIES; devIdx++) {
165 DMA_DeviceAttribute_t *devAttr = &DMA_gDeviceAttribute[devIdx];
166
167 if (devAttr->name == NULL) {
168 continue;
169 }
170
171 if (len >= limit) {
172 break;
173 }
174
175 len += sprintf(buf + len, "%-12s ", devAttr->name);
176
177 if ((devAttr->flags & DMA_DEVICE_FLAG_IS_DEDICATED) != 0) {
178 len +=
179 sprintf(buf + len, "Dedicated %d:%d ",
180 devAttr->dedicatedController,
181 devAttr->dedicatedChannel);
182 } else {
183 len += sprintf(buf + len, "Shared DMA:");
184 if ((devAttr->flags & DMA_DEVICE_FLAG_ON_DMA0) != 0) {
185 len += sprintf(buf + len, "0");
186 }
187 if ((devAttr->flags & DMA_DEVICE_FLAG_ON_DMA1) != 0) {
188 len += sprintf(buf + len, "1");
189 }
190 len += sprintf(buf + len, " ");
191 }
192 if ((devAttr->flags & DMA_DEVICE_FLAG_NO_ISR) != 0) {
193 len += sprintf(buf + len, "NoISR ");
194 }
195 if ((devAttr->flags & DMA_DEVICE_FLAG_ALLOW_LARGE_FIFO) != 0) {
196 len += sprintf(buf + len, "Allow-128 ");
197 }
198
199 len +=
200 sprintf(buf + len,
201 "Xfer #: %Lu Ticks: %Lu Bytes: %Lu DescLen: %u\n",
202 devAttr->numTransfers, devAttr->transferTicks,
203 devAttr->transferBytes,
204 devAttr->ring.bytesAllocated);
205
206 }
207
208 up(&gDMA.lock);
209 *eof = 1;
210
211 return len;
212}
213
214/****************************************************************************/
215/**
216* Determines if a DMA_Device_t is "valid".
217*
218* @return
219* TRUE - dma device is valid
220* FALSE - dma device isn't valid
221*/
222/****************************************************************************/
223
224static inline int IsDeviceValid(DMA_Device_t device)
225{
226 return (device >= 0) && (device < DMA_NUM_DEVICE_ENTRIES);
227}
228
229/****************************************************************************/
230/**
231* Translates a DMA handle into a pointer to a channel.
232*
233* @return
234* non-NULL - pointer to DMA_Channel_t
235* NULL - DMA Handle was invalid
236*/
237/****************************************************************************/
238
239static inline DMA_Channel_t *HandleToChannel(DMA_Handle_t handle)
240{
241 int controllerIdx;
242 int channelIdx;
243
244 controllerIdx = CONTROLLER_FROM_HANDLE(handle);
245 channelIdx = CHANNEL_FROM_HANDLE(handle);
246
247 if ((controllerIdx > DMA_NUM_CONTROLLERS)
248 || (channelIdx > DMA_NUM_CHANNELS)) {
249 return NULL;
250 }
251 return &gDMA.controller[controllerIdx].channel[channelIdx];
252}
253
254/****************************************************************************/
255/**
256* Interrupt handler which is called to process DMA interrupts.
257*/
258/****************************************************************************/
259
260static irqreturn_t dma_interrupt_handler(int irq, void *dev_id)
261{
262 DMA_Channel_t *channel;
263 DMA_DeviceAttribute_t *devAttr;
264 int irqStatus;
265
266 channel = (DMA_Channel_t *) dev_id;
267
268 /* Figure out why we were called, and knock down the interrupt */
269
270 irqStatus = dmacHw_getInterruptStatus(channel->dmacHwHandle);
271 dmacHw_clearInterrupt(channel->dmacHwHandle);
272
273 if ((channel->devType < 0)
274 || (channel->devType > DMA_NUM_DEVICE_ENTRIES)) {
275 printk(KERN_ERR "dma_interrupt_handler: Invalid devType: %d\n",
276 channel->devType);
277 return IRQ_NONE;
278 }
279 devAttr = &DMA_gDeviceAttribute[channel->devType];
280
281 /* Update stats */
282
283 if ((irqStatus & dmacHw_INTERRUPT_STATUS_TRANS) != 0) {
284 devAttr->transferTicks +=
285 (timer_get_tick_count() - devAttr->transferStartTime);
286 }
287
288 if ((irqStatus & dmacHw_INTERRUPT_STATUS_ERROR) != 0) {
289 printk(KERN_ERR
290 "dma_interrupt_handler: devType :%d DMA error (%s)\n",
291 channel->devType, devAttr->name);
292 } else {
293 devAttr->numTransfers++;
294 devAttr->transferBytes += devAttr->numBytes;
295 }
296
297 /* Call any installed handler */
298
299 if (devAttr->devHandler != NULL) {
300 devAttr->devHandler(channel->devType, irqStatus,
301 devAttr->userData);
302 }
303
304 return IRQ_HANDLED;
305}
306
307/****************************************************************************/
308/**
309* Allocates memory to hold a descriptor ring. The descriptor ring then
310* needs to be populated by making one or more calls to
311* dna_add_descriptors.
312*
313* The returned descriptor ring will be automatically initialized.
314*
315* @return
316* 0 Descriptor ring was allocated successfully
317* -EINVAL Invalid parameters passed in
318* -ENOMEM Unable to allocate memory for the desired number of descriptors.
319*/
320/****************************************************************************/
321
322int dma_alloc_descriptor_ring(DMA_DescriptorRing_t *ring, /* Descriptor ring to populate */
323 int numDescriptors /* Number of descriptors that need to be allocated. */
324 ) {
325 size_t bytesToAlloc = dmacHw_descriptorLen(numDescriptors);
326
327 if ((ring == NULL) || (numDescriptors <= 0)) {
328 return -EINVAL;
329 }
330
331 ring->physAddr = 0;
332 ring->descriptorsAllocated = 0;
333 ring->bytesAllocated = 0;
334
335 ring->virtAddr = dma_alloc_writecombine(NULL,
336 bytesToAlloc,
337 &ring->physAddr,
338 GFP_KERNEL);
339 if (ring->virtAddr == NULL) {
340 return -ENOMEM;
341 }
342
343 ring->bytesAllocated = bytesToAlloc;
344 ring->descriptorsAllocated = numDescriptors;
345
346 return dma_init_descriptor_ring(ring, numDescriptors);
347}
348
349EXPORT_SYMBOL(dma_alloc_descriptor_ring);
350
351/****************************************************************************/
352/**
353* Releases the memory which was previously allocated for a descriptor ring.
354*/
355/****************************************************************************/
356
357void dma_free_descriptor_ring(DMA_DescriptorRing_t *ring /* Descriptor to release */
358 ) {
359 if (ring->virtAddr != NULL) {
360 dma_free_writecombine(NULL,
361 ring->bytesAllocated,
362 ring->virtAddr, ring->physAddr);
363 }
364
365 ring->bytesAllocated = 0;
366 ring->descriptorsAllocated = 0;
367 ring->virtAddr = NULL;
368 ring->physAddr = 0;
369}
370
371EXPORT_SYMBOL(dma_free_descriptor_ring);
372
373/****************************************************************************/
374/**
375* Initializes a descriptor ring, so that descriptors can be added to it.
376* Once a descriptor ring has been allocated, it may be reinitialized for
377* use with additional/different regions of memory.
378*
379* Note that if 7 descriptors are allocated, it's perfectly acceptable to
380* initialize the ring with a smaller number of descriptors. The amount
381* of memory allocated for the descriptor ring will not be reduced, and
382* the descriptor ring may be reinitialized later
383*
384* @return
385* 0 Descriptor ring was initialized successfully
386* -ENOMEM The descriptor which was passed in has insufficient space
387* to hold the desired number of descriptors.
388*/
389/****************************************************************************/
390
391int dma_init_descriptor_ring(DMA_DescriptorRing_t *ring, /* Descriptor ring to initialize */
392 int numDescriptors /* Number of descriptors to initialize. */
393 ) {
394 if (ring->virtAddr == NULL) {
395 return -EINVAL;
396 }
397 if (dmacHw_initDescriptor(ring->virtAddr,
398 ring->physAddr,
399 ring->bytesAllocated, numDescriptors) < 0) {
400 printk(KERN_ERR
401 "dma_init_descriptor_ring: dmacHw_initDescriptor failed\n");
402 return -ENOMEM;
403 }
404
405 return 0;
406}
407
408EXPORT_SYMBOL(dma_init_descriptor_ring);
409
410/****************************************************************************/
411/**
412* Determines the number of descriptors which would be required for a
413* transfer of the indicated memory region.
414*
415* This function also needs to know which DMA device this transfer will
416* be destined for, so that the appropriate DMA configuration can be retrieved.
417* DMA parameters such as transfer width, and whether this is a memory-to-memory
418* or memory-to-peripheral, etc can all affect the actual number of descriptors
419* required.
420*
421* @return
422* > 0 Returns the number of descriptors required for the indicated transfer
423* -ENODEV - Device handed in is invalid.
424* -EINVAL Invalid parameters
425* -ENOMEM Memory exhausted
426*/
427/****************************************************************************/
428
429int dma_calculate_descriptor_count(DMA_Device_t device, /* DMA Device that this will be associated with */
430 dma_addr_t srcData, /* Place to get data to write to device */
431 dma_addr_t dstData, /* Pointer to device data address */
432 size_t numBytes /* Number of bytes to transfer to the device */
433 ) {
434 int numDescriptors;
435 DMA_DeviceAttribute_t *devAttr;
436
437 if (!IsDeviceValid(device)) {
438 return -ENODEV;
439 }
440 devAttr = &DMA_gDeviceAttribute[device];
441
442 numDescriptors = dmacHw_calculateDescriptorCount(&devAttr->config,
443 (void *)srcData,
444 (void *)dstData,
445 numBytes);
446 if (numDescriptors < 0) {
447 printk(KERN_ERR
448 "dma_calculate_descriptor_count: dmacHw_calculateDescriptorCount failed\n");
449 return -EINVAL;
450 }
451
452 return numDescriptors;
453}
454
455EXPORT_SYMBOL(dma_calculate_descriptor_count);
456
457/****************************************************************************/
458/**
459* Adds a region of memory to the descriptor ring. Note that it may take
460* multiple descriptors for each region of memory. It is the callers
461* responsibility to allocate a sufficiently large descriptor ring.
462*
463* @return
464* 0 Descriptors were added successfully
465* -ENODEV Device handed in is invalid.
466* -EINVAL Invalid parameters
467* -ENOMEM Memory exhausted
468*/
469/****************************************************************************/
470
471int dma_add_descriptors(DMA_DescriptorRing_t *ring, /* Descriptor ring to add descriptors to */
472 DMA_Device_t device, /* DMA Device that descriptors are for */
473 dma_addr_t srcData, /* Place to get data (memory or device) */
474 dma_addr_t dstData, /* Place to put data (memory or device) */
475 size_t numBytes /* Number of bytes to transfer to the device */
476 ) {
477 int rc;
478 DMA_DeviceAttribute_t *devAttr;
479
480 if (!IsDeviceValid(device)) {
481 return -ENODEV;
482 }
483 devAttr = &DMA_gDeviceAttribute[device];
484
485 rc = dmacHw_setDataDescriptor(&devAttr->config,
486 ring->virtAddr,
487 (void *)srcData,
488 (void *)dstData, numBytes);
489 if (rc < 0) {
490 printk(KERN_ERR
491 "dma_add_descriptors: dmacHw_setDataDescriptor failed with code: %d\n",
492 rc);
493 return -ENOMEM;
494 }
495
496 return 0;
497}
498
499EXPORT_SYMBOL(dma_add_descriptors);
500
501/****************************************************************************/
502/**
503* Sets the descriptor ring associated with a device.
504*
505* Once set, the descriptor ring will be associated with the device, even
506* across channel request/free calls. Passing in a NULL descriptor ring
507* will release any descriptor ring currently associated with the device.
508*
509* Note: If you call dma_transfer, or one of the other dma_alloc_ functions
510* the descriptor ring may be released and reallocated.
511*
512* Note: This function will release the descriptor memory for any current
513* descriptor ring associated with this device.
514*
515* @return
516* 0 Descriptors were added successfully
517* -ENODEV Device handed in is invalid.
518*/
519/****************************************************************************/
520
521int dma_set_device_descriptor_ring(DMA_Device_t device, /* Device to update the descriptor ring for. */
522 DMA_DescriptorRing_t *ring /* Descriptor ring to add descriptors to */
523 ) {
524 DMA_DeviceAttribute_t *devAttr;
525
526 if (!IsDeviceValid(device)) {
527 return -ENODEV;
528 }
529 devAttr = &DMA_gDeviceAttribute[device];
530
531 /* Free the previously allocated descriptor ring */
532
533 dma_free_descriptor_ring(&devAttr->ring);
534
535 if (ring != NULL) {
536 /* Copy in the new one */
537
538 devAttr->ring = *ring;
539 }
540
541 /* Set things up so that if dma_transfer is called then this descriptor */
542 /* ring will get freed. */
543
544 devAttr->prevSrcData = 0;
545 devAttr->prevDstData = 0;
546 devAttr->prevNumBytes = 0;
547
548 return 0;
549}
550
551EXPORT_SYMBOL(dma_set_device_descriptor_ring);
552
553/****************************************************************************/
554/**
555* Retrieves the descriptor ring associated with a device.
556*
557* @return
558* 0 Descriptors were added successfully
559* -ENODEV Device handed in is invalid.
560*/
561/****************************************************************************/
562
563int dma_get_device_descriptor_ring(DMA_Device_t device, /* Device to retrieve the descriptor ring for. */
564 DMA_DescriptorRing_t *ring /* Place to store retrieved ring */
565 ) {
566 DMA_DeviceAttribute_t *devAttr;
567
568 memset(ring, 0, sizeof(*ring));
569
570 if (!IsDeviceValid(device)) {
571 return -ENODEV;
572 }
573 devAttr = &DMA_gDeviceAttribute[device];
574
575 *ring = devAttr->ring;
576
577 return 0;
578}
579
580EXPORT_SYMBOL(dma_get_device_descriptor_ring);
581
582/****************************************************************************/
583/**
584* Configures a DMA channel.
585*
586* @return
587* >= 0 - Initialization was successful.
588*
589* -EBUSY - Device is currently being used.
590* -ENODEV - Device handed in is invalid.
591*/
592/****************************************************************************/
593
594static int ConfigChannel(DMA_Handle_t handle)
595{
596 DMA_Channel_t *channel;
597 DMA_DeviceAttribute_t *devAttr;
598 int controllerIdx;
599
600 channel = HandleToChannel(handle);
601 if (channel == NULL) {
602 return -ENODEV;
603 }
604 devAttr = &DMA_gDeviceAttribute[channel->devType];
605 controllerIdx = CONTROLLER_FROM_HANDLE(handle);
606
607 if ((devAttr->flags & DMA_DEVICE_FLAG_PORT_PER_DMAC) != 0) {
608 if (devAttr->config.transferType ==
609 dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL) {
610 devAttr->config.dstPeripheralPort =
611 devAttr->dmacPort[controllerIdx];
612 } else if (devAttr->config.transferType ==
613 dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM) {
614 devAttr->config.srcPeripheralPort =
615 devAttr->dmacPort[controllerIdx];
616 }
617 }
618
619 if (dmacHw_configChannel(channel->dmacHwHandle, &devAttr->config) != 0) {
620 printk(KERN_ERR "ConfigChannel: dmacHw_configChannel failed\n");
621 return -EIO;
622 }
623
624 return 0;
625}
626
627/****************************************************************************/
628/**
629* Initializes all of the data structures associated with the DMA.
630* @return
631* >= 0 - Initialization was successful.
632*
633* -EBUSY - Device is currently being used.
634* -ENODEV - Device handed in is invalid.
635*/
636/****************************************************************************/
637
638int dma_init(void)
639{
640 int rc = 0;
641 int controllerIdx;
642 int channelIdx;
643 DMA_Device_t devIdx;
644 DMA_Channel_t *channel;
645 DMA_Handle_t dedicatedHandle;
646
647 memset(&gDMA, 0, sizeof(gDMA));
648
649 sema_init(&gDMA.lock, 0);
650 init_waitqueue_head(&gDMA.freeChannelQ);
651
652 /* Initialize the Hardware */
653
654 dmacHw_initDma();
655
656 /* Start off by marking all of the DMA channels as shared. */
657
658 for (controllerIdx = 0; controllerIdx < DMA_NUM_CONTROLLERS;
659 controllerIdx++) {
660 for (channelIdx = 0; channelIdx < DMA_NUM_CHANNELS;
661 channelIdx++) {
662 channel =
663 &gDMA.controller[controllerIdx].channel[channelIdx];
664
665 channel->flags = 0;
666 channel->devType = DMA_DEVICE_NONE;
667 channel->lastDevType = DMA_DEVICE_NONE;
668
669#if (DMA_DEBUG_TRACK_RESERVATION)
670 channel->fileName = "";
671 channel->lineNum = 0;
672#endif
673
674 channel->dmacHwHandle =
675 dmacHw_getChannelHandle(dmacHw_MAKE_CHANNEL_ID
676 (controllerIdx,
677 channelIdx));
678 dmacHw_initChannel(channel->dmacHwHandle);
679 }
680 }
681
682 /* Record any special attributes that channels may have */
683
684 gDMA.controller[0].channel[0].flags |= DMA_CHANNEL_FLAG_LARGE_FIFO;
685 gDMA.controller[0].channel[1].flags |= DMA_CHANNEL_FLAG_LARGE_FIFO;
686 gDMA.controller[1].channel[0].flags |= DMA_CHANNEL_FLAG_LARGE_FIFO;
687 gDMA.controller[1].channel[1].flags |= DMA_CHANNEL_FLAG_LARGE_FIFO;
688
689 /* Now walk through and record the dedicated channels. */
690
691 for (devIdx = 0; devIdx < DMA_NUM_DEVICE_ENTRIES; devIdx++) {
692 DMA_DeviceAttribute_t *devAttr = &DMA_gDeviceAttribute[devIdx];
693
694 if (((devAttr->flags & DMA_DEVICE_FLAG_NO_ISR) != 0)
695 && ((devAttr->flags & DMA_DEVICE_FLAG_IS_DEDICATED) == 0)) {
696 printk(KERN_ERR
697 "DMA Device: %s Can only request NO_ISR for dedicated devices\n",
698 devAttr->name);
699 rc = -EINVAL;
700 goto out;
701 }
702
703 if ((devAttr->flags & DMA_DEVICE_FLAG_IS_DEDICATED) != 0) {
704 /* This is a dedicated device. Mark the channel as being reserved. */
705
706 if (devAttr->dedicatedController >= DMA_NUM_CONTROLLERS) {
707 printk(KERN_ERR
708 "DMA Device: %s DMA Controller %d is out of range\n",
709 devAttr->name,
710 devAttr->dedicatedController);
711 rc = -EINVAL;
712 goto out;
713 }
714
715 if (devAttr->dedicatedChannel >= DMA_NUM_CHANNELS) {
716 printk(KERN_ERR
717 "DMA Device: %s DMA Channel %d is out of range\n",
718 devAttr->name,
719 devAttr->dedicatedChannel);
720 rc = -EINVAL;
721 goto out;
722 }
723
724 dedicatedHandle =
725 MAKE_HANDLE(devAttr->dedicatedController,
726 devAttr->dedicatedChannel);
727 channel = HandleToChannel(dedicatedHandle);
728
729 if ((channel->flags & DMA_CHANNEL_FLAG_IS_DEDICATED) !=
730 0) {
731 printk
732 ("DMA Device: %s attempting to use same DMA Controller:Channel (%d:%d) as %s\n",
733 devAttr->name,
734 devAttr->dedicatedController,
735 devAttr->dedicatedChannel,
736 DMA_gDeviceAttribute[channel->devType].
737 name);
738 rc = -EBUSY;
739 goto out;
740 }
741
742 channel->flags |= DMA_CHANNEL_FLAG_IS_DEDICATED;
743 channel->devType = devIdx;
744
745 if (devAttr->flags & DMA_DEVICE_FLAG_NO_ISR) {
746 channel->flags |= DMA_CHANNEL_FLAG_NO_ISR;
747 }
748
749 /* For dedicated channels, we can go ahead and configure the DMA channel now */
750 /* as well. */
751
752 ConfigChannel(dedicatedHandle);
753 }
754 }
755
756 /* Go through and register the interrupt handlers */
757
758 for (controllerIdx = 0; controllerIdx < DMA_NUM_CONTROLLERS;
759 controllerIdx++) {
760 for (channelIdx = 0; channelIdx < DMA_NUM_CHANNELS;
761 channelIdx++) {
762 channel =
763 &gDMA.controller[controllerIdx].channel[channelIdx];
764
765 if ((channel->flags & DMA_CHANNEL_FLAG_NO_ISR) == 0) {
766 snprintf(channel->name, sizeof(channel->name),
767 "dma %d:%d %s", controllerIdx,
768 channelIdx,
769 channel->devType ==
770 DMA_DEVICE_NONE ? "" :
771 DMA_gDeviceAttribute[channel->devType].
772 name);
773
774 rc =
775 request_irq(IRQ_DMA0C0 +
776 (controllerIdx *
777 DMA_NUM_CHANNELS) +
778 channelIdx,
779 dma_interrupt_handler,
780 IRQF_DISABLED, channel->name,
781 channel);
782 if (rc != 0) {
783 printk(KERN_ERR
784 "request_irq for IRQ_DMA%dC%d failed\n",
785 controllerIdx, channelIdx);
786 }
787 }
788 }
789 }
790
791 /* Create /proc/dma/channels and /proc/dma/devices */
792
793 gDmaDir = proc_mkdir("dma", NULL);
794
795 if (gDmaDir == NULL) {
796 printk(KERN_ERR "Unable to create /proc/dma\n");
797 } else {
798 create_proc_read_entry("channels", 0, gDmaDir,
799 dma_proc_read_channels, NULL);
800 create_proc_read_entry("devices", 0, gDmaDir,
801 dma_proc_read_devices, NULL);
802 }
803
804out:
805
806 up(&gDMA.lock);
807
808 return rc;
809}
810
811/****************************************************************************/
812/**
813* Reserves a channel for use with @a dev. If the device is setup to use
814* a shared channel, then this function will block until a free channel
815* becomes available.
816*
817* @return
818* >= 0 - A valid DMA Handle.
819* -EBUSY - Device is currently being used.
820* -ENODEV - Device handed in is invalid.
821*/
822/****************************************************************************/
823
824#if (DMA_DEBUG_TRACK_RESERVATION)
825DMA_Handle_t dma_request_channel_dbg
826 (DMA_Device_t dev, const char *fileName, int lineNum)
827#else
828DMA_Handle_t dma_request_channel(DMA_Device_t dev)
829#endif
830{
831 DMA_Handle_t handle;
832 DMA_DeviceAttribute_t *devAttr;
833 DMA_Channel_t *channel;
834 int controllerIdx;
835 int controllerIdx2;
836 int channelIdx;
837
838 if (down_interruptible(&gDMA.lock) < 0) {
839 return -ERESTARTSYS;
840 }
841
842 if ((dev < 0) || (dev >= DMA_NUM_DEVICE_ENTRIES)) {
843 handle = -ENODEV;
844 goto out;
845 }
846 devAttr = &DMA_gDeviceAttribute[dev];
847
848#if (DMA_DEBUG_TRACK_RESERVATION)
849 {
850 char *s;
851
852 s = strrchr(fileName, '/');
853 if (s != NULL) {
854 fileName = s + 1;
855 }
856 }
857#endif
858 if ((devAttr->flags & DMA_DEVICE_FLAG_IN_USE) != 0) {
859 /* This device has already been requested and not been freed */
860
861 printk(KERN_ERR "%s: device %s is already requested\n",
862 __func__, devAttr->name);
863 handle = -EBUSY;
864 goto out;
865 }
866
867 if ((devAttr->flags & DMA_DEVICE_FLAG_IS_DEDICATED) != 0) {
868 /* This device has a dedicated channel. */
869
870 channel =
871 &gDMA.controller[devAttr->dedicatedController].
872 channel[devAttr->dedicatedChannel];
873 if ((channel->flags & DMA_CHANNEL_FLAG_IN_USE) != 0) {
874 handle = -EBUSY;
875 goto out;
876 }
877
878 channel->flags |= DMA_CHANNEL_FLAG_IN_USE;
879 devAttr->flags |= DMA_DEVICE_FLAG_IN_USE;
880
881#if (DMA_DEBUG_TRACK_RESERVATION)
882 channel->fileName = fileName;
883 channel->lineNum = lineNum;
884#endif
885 handle =
886 MAKE_HANDLE(devAttr->dedicatedController,
887 devAttr->dedicatedChannel);
888 goto out;
889 }
890
891 /* This device needs to use one of the shared channels. */
892
893 handle = DMA_INVALID_HANDLE;
894 while (handle == DMA_INVALID_HANDLE) {
895 /* Scan through the shared channels and see if one is available */
896
897 for (controllerIdx2 = 0; controllerIdx2 < DMA_NUM_CONTROLLERS;
898 controllerIdx2++) {
899 /* Check to see if we should try on controller 1 first. */
900
901 controllerIdx = controllerIdx2;
902 if ((devAttr->
903 flags & DMA_DEVICE_FLAG_ALLOC_DMA1_FIRST) != 0) {
904 controllerIdx = 1 - controllerIdx;
905 }
906
907 /* See if the device is available on the controller being tested */
908
909 if ((devAttr->
910 flags & (DMA_DEVICE_FLAG_ON_DMA0 << controllerIdx))
911 != 0) {
912 for (channelIdx = 0;
913 channelIdx < DMA_NUM_CHANNELS;
914 channelIdx++) {
915 channel =
916 &gDMA.controller[controllerIdx].
917 channel[channelIdx];
918
919 if (((channel->
920 flags &
921 DMA_CHANNEL_FLAG_IS_DEDICATED) ==
922 0)
923 &&
924 ((channel->
925 flags & DMA_CHANNEL_FLAG_IN_USE)
926 == 0)) {
927 if (((channel->
928 flags &
929 DMA_CHANNEL_FLAG_LARGE_FIFO)
930 != 0)
931 &&
932 ((devAttr->
933 flags &
934 DMA_DEVICE_FLAG_ALLOW_LARGE_FIFO)
935 == 0)) {
936 /* This channel is a large fifo - don't tie it up */
937 /* with devices that we don't want using it. */
938
939 continue;
940 }
941
942 channel->flags |=
943 DMA_CHANNEL_FLAG_IN_USE;
944 channel->devType = dev;
945 devAttr->flags |=
946 DMA_DEVICE_FLAG_IN_USE;
947
948#if (DMA_DEBUG_TRACK_RESERVATION)
949 channel->fileName = fileName;
950 channel->lineNum = lineNum;
951#endif
952 handle =
953 MAKE_HANDLE(controllerIdx,
954 channelIdx);
955
956 /* Now that we've reserved the channel - we can go ahead and configure it */
957
958 if (ConfigChannel(handle) != 0) {
959 handle = -EIO;
960 printk(KERN_ERR
961 "dma_request_channel: ConfigChannel failed\n");
962 }
963 goto out;
964 }
965 }
966 }
967 }
968
969 /* No channels are currently available. Let's wait for one to free up. */
970
971 {
972 DEFINE_WAIT(wait);
973
974 prepare_to_wait(&gDMA.freeChannelQ, &wait,
975 TASK_INTERRUPTIBLE);
976 up(&gDMA.lock);
977 schedule();
978 finish_wait(&gDMA.freeChannelQ, &wait);
979
980 if (signal_pending(current)) {
981 /* We don't currently hold gDMA.lock, so we return directly */
982
983 return -ERESTARTSYS;
984 }
985 }
986
987 if (down_interruptible(&gDMA.lock)) {
988 return -ERESTARTSYS;
989 }
990 }
991
992out:
993 up(&gDMA.lock);
994
995 return handle;
996}
997
998/* Create both _dbg and non _dbg functions for modules. */
999
1000#if (DMA_DEBUG_TRACK_RESERVATION)
1001#undef dma_request_channel
1002DMA_Handle_t dma_request_channel(DMA_Device_t dev)
1003{
1004 return dma_request_channel_dbg(dev, __FILE__, __LINE__);
1005}
1006
1007EXPORT_SYMBOL(dma_request_channel_dbg);
1008#endif
1009EXPORT_SYMBOL(dma_request_channel);
1010
1011/****************************************************************************/
1012/**
1013* Frees a previously allocated DMA Handle.
1014*/
1015/****************************************************************************/
1016
1017int dma_free_channel(DMA_Handle_t handle /* DMA handle. */
1018 ) {
1019 int rc = 0;
1020 DMA_Channel_t *channel;
1021 DMA_DeviceAttribute_t *devAttr;
1022
1023 if (down_interruptible(&gDMA.lock) < 0) {
1024 return -ERESTARTSYS;
1025 }
1026
1027 channel = HandleToChannel(handle);
1028 if (channel == NULL) {
1029 rc = -EINVAL;
1030 goto out;
1031 }
1032
1033 devAttr = &DMA_gDeviceAttribute[channel->devType];
1034
1035 if ((channel->flags & DMA_CHANNEL_FLAG_IS_DEDICATED) == 0) {
1036 channel->lastDevType = channel->devType;
1037 channel->devType = DMA_DEVICE_NONE;
1038 }
1039 channel->flags &= ~DMA_CHANNEL_FLAG_IN_USE;
1040 devAttr->flags &= ~DMA_DEVICE_FLAG_IN_USE;
1041
1042out:
1043 up(&gDMA.lock);
1044
1045 wake_up_interruptible(&gDMA.freeChannelQ);
1046
1047 return rc;
1048}
1049
1050EXPORT_SYMBOL(dma_free_channel);
1051
1052/****************************************************************************/
1053/**
1054* Determines if a given device has been configured as using a shared
1055* channel.
1056*
1057* @return
1058* 0 Device uses a dedicated channel
1059* > zero Device uses a shared channel
1060* < zero Error code
1061*/
1062/****************************************************************************/
1063
1064int dma_device_is_channel_shared(DMA_Device_t device /* Device to check. */
1065 ) {
1066 DMA_DeviceAttribute_t *devAttr;
1067
1068 if (!IsDeviceValid(device)) {
1069 return -ENODEV;
1070 }
1071 devAttr = &DMA_gDeviceAttribute[device];
1072
1073 return ((devAttr->flags & DMA_DEVICE_FLAG_IS_DEDICATED) == 0);
1074}
1075
1076EXPORT_SYMBOL(dma_device_is_channel_shared);
1077
1078/****************************************************************************/
1079/**
1080* Allocates buffers for the descriptors. This is normally done automatically
1081* but needs to be done explicitly when initiating a dma from interrupt
1082* context.
1083*
1084* @return
1085* 0 Descriptors were allocated successfully
1086* -EINVAL Invalid device type for this kind of transfer
1087* (i.e. the device is _MEM_TO_DEV and not _DEV_TO_MEM)
1088* -ENOMEM Memory exhausted
1089*/
1090/****************************************************************************/
1091
1092int dma_alloc_descriptors(DMA_Handle_t handle, /* DMA Handle */
1093 dmacHw_TRANSFER_TYPE_e transferType, /* Type of transfer being performed */
1094 dma_addr_t srcData, /* Place to get data to write to device */
1095 dma_addr_t dstData, /* Pointer to device data address */
1096 size_t numBytes /* Number of bytes to transfer to the device */
1097 ) {
1098 DMA_Channel_t *channel;
1099 DMA_DeviceAttribute_t *devAttr;
1100 int numDescriptors;
1101 size_t ringBytesRequired;
1102 int rc = 0;
1103
1104 channel = HandleToChannel(handle);
1105 if (channel == NULL) {
1106 return -ENODEV;
1107 }
1108
1109 devAttr = &DMA_gDeviceAttribute[channel->devType];
1110
1111 if (devAttr->config.transferType != transferType) {
1112 return -EINVAL;
1113 }
1114
1115 /* Figure out how many descriptors we need. */
1116
1117 /* printk("srcData: 0x%08x dstData: 0x%08x, numBytes: %d\n", */
1118 /* srcData, dstData, numBytes); */
1119
1120 numDescriptors = dmacHw_calculateDescriptorCount(&devAttr->config,
1121 (void *)srcData,
1122 (void *)dstData,
1123 numBytes);
1124 if (numDescriptors < 0) {
1125 printk(KERN_ERR "%s: dmacHw_calculateDescriptorCount failed\n",
1126 __func__);
1127 return -EINVAL;
1128 }
1129
1130 /* Check to see if we can reuse the existing descriptor ring, or if we need to allocate */
1131 /* a new one. */
1132
1133 ringBytesRequired = dmacHw_descriptorLen(numDescriptors);
1134
1135 /* printk("ringBytesRequired: %d\n", ringBytesRequired); */
1136
1137 if (ringBytesRequired > devAttr->ring.bytesAllocated) {
1138 /* Make sure that this code path is never taken from interrupt context. */
1139 /* It's OK for an interrupt to initiate a DMA transfer, but the descriptor */
1140 /* allocation needs to have already been done. */
1141
1142 might_sleep();
1143
1144 /* Free the old descriptor ring and allocate a new one. */
1145
1146 dma_free_descriptor_ring(&devAttr->ring);
1147
1148 /* And allocate a new one. */
1149
1150 rc =
1151 dma_alloc_descriptor_ring(&devAttr->ring,
1152 numDescriptors);
1153 if (rc < 0) {
1154 printk(KERN_ERR
1155 "%s: dma_alloc_descriptor_ring(%d) failed\n",
1156 __func__, numDescriptors);
1157 return rc;
1158 }
1159 /* Setup the descriptor for this transfer */
1160
1161 if (dmacHw_initDescriptor(devAttr->ring.virtAddr,
1162 devAttr->ring.physAddr,
1163 devAttr->ring.bytesAllocated,
1164 numDescriptors) < 0) {
1165 printk(KERN_ERR "%s: dmacHw_initDescriptor failed\n",
1166 __func__);
1167 return -EINVAL;
1168 }
1169 } else {
1170 /* We've already got enough ring buffer allocated. All we need to do is reset */
1171 /* any control information, just in case the previous DMA was stopped. */
1172
1173 dmacHw_resetDescriptorControl(devAttr->ring.virtAddr);
1174 }
1175
1176 /* dma_alloc/free both set the prevSrc/DstData to 0. If they happen to be the same */
1177 /* as last time, then we don't need to call setDataDescriptor again. */
1178
1179 if (dmacHw_setDataDescriptor(&devAttr->config,
1180 devAttr->ring.virtAddr,
1181 (void *)srcData,
1182 (void *)dstData, numBytes) < 0) {
1183 printk(KERN_ERR "%s: dmacHw_setDataDescriptor failed\n",
1184 __func__);
1185 return -EINVAL;
1186 }
1187
1188 /* Remember the critical information for this transfer so that we can eliminate */
1189 /* another call to dma_alloc_descriptors if the caller reuses the same buffers */
1190
1191 devAttr->prevSrcData = srcData;
1192 devAttr->prevDstData = dstData;
1193 devAttr->prevNumBytes = numBytes;
1194
1195 return 0;
1196}
1197
1198EXPORT_SYMBOL(dma_alloc_descriptors);
1199
1200/****************************************************************************/
1201/**
1202* Allocates and sets up descriptors for a double buffered circular buffer.
1203*
1204* This is primarily intended to be used for things like the ingress samples
1205* from a microphone.
1206*
1207* @return
1208* > 0 Number of descriptors actually allocated.
1209* -EINVAL Invalid device type for this kind of transfer
1210* (i.e. the device is _MEM_TO_DEV and not _DEV_TO_MEM)
1211* -ENOMEM Memory exhausted
1212*/
1213/****************************************************************************/
1214
1215int dma_alloc_double_dst_descriptors(DMA_Handle_t handle, /* DMA Handle */
1216 dma_addr_t srcData, /* Physical address of source data */
1217 dma_addr_t dstData1, /* Physical address of first destination buffer */
1218 dma_addr_t dstData2, /* Physical address of second destination buffer */
1219 size_t numBytes /* Number of bytes in each destination buffer */
1220 ) {
1221 DMA_Channel_t *channel;
1222 DMA_DeviceAttribute_t *devAttr;
1223 int numDst1Descriptors;
1224 int numDst2Descriptors;
1225 int numDescriptors;
1226 size_t ringBytesRequired;
1227 int rc = 0;
1228
1229 channel = HandleToChannel(handle);
1230 if (channel == NULL) {
1231 return -ENODEV;
1232 }
1233
1234 devAttr = &DMA_gDeviceAttribute[channel->devType];
1235
1236 /* Figure out how many descriptors we need. */
1237
1238 /* printk("srcData: 0x%08x dstData: 0x%08x, numBytes: %d\n", */
1239 /* srcData, dstData, numBytes); */
1240
1241 numDst1Descriptors =
1242 dmacHw_calculateDescriptorCount(&devAttr->config, (void *)srcData,
1243 (void *)dstData1, numBytes);
1244 if (numDst1Descriptors < 0) {
1245 return -EINVAL;
1246 }
1247 numDst2Descriptors =
1248 dmacHw_calculateDescriptorCount(&devAttr->config, (void *)srcData,
1249 (void *)dstData2, numBytes);
1250 if (numDst2Descriptors < 0) {
1251 return -EINVAL;
1252 }
1253 numDescriptors = numDst1Descriptors + numDst2Descriptors;
1254 /* printk("numDescriptors: %d\n", numDescriptors); */
1255
1256 /* Check to see if we can reuse the existing descriptor ring, or if we need to allocate */
1257 /* a new one. */
1258
1259 ringBytesRequired = dmacHw_descriptorLen(numDescriptors);
1260
1261 /* printk("ringBytesRequired: %d\n", ringBytesRequired); */
1262
1263 if (ringBytesRequired > devAttr->ring.bytesAllocated) {
1264 /* Make sure that this code path is never taken from interrupt context. */
1265 /* It's OK for an interrupt to initiate a DMA transfer, but the descriptor */
1266 /* allocation needs to have already been done. */
1267
1268 might_sleep();
1269
1270 /* Free the old descriptor ring and allocate a new one. */
1271
1272 dma_free_descriptor_ring(&devAttr->ring);
1273
1274 /* And allocate a new one. */
1275
1276 rc =
1277 dma_alloc_descriptor_ring(&devAttr->ring,
1278 numDescriptors);
1279 if (rc < 0) {
1280 printk(KERN_ERR
1281 "%s: dma_alloc_descriptor_ring(%d) failed\n",
1282 __func__, ringBytesRequired);
1283 return rc;
1284 }
1285 }
1286
1287 /* Setup the descriptor for this transfer. Since this function is used with */
1288 /* CONTINUOUS DMA operations, we need to reinitialize every time, otherwise */
1289 /* setDataDescriptor will keep trying to append onto the end. */
1290
1291 if (dmacHw_initDescriptor(devAttr->ring.virtAddr,
1292 devAttr->ring.physAddr,
1293 devAttr->ring.bytesAllocated,
1294 numDescriptors) < 0) {
1295 printk(KERN_ERR "%s: dmacHw_initDescriptor failed\n", __func__);
1296 return -EINVAL;
1297 }
1298
1299 /* dma_alloc/free both set the prevSrc/DstData to 0. If they happen to be the same */
1300 /* as last time, then we don't need to call setDataDescriptor again. */
1301
1302 if (dmacHw_setDataDescriptor(&devAttr->config,
1303 devAttr->ring.virtAddr,
1304 (void *)srcData,
1305 (void *)dstData1, numBytes) < 0) {
1306 printk(KERN_ERR "%s: dmacHw_setDataDescriptor 1 failed\n",
1307 __func__);
1308 return -EINVAL;
1309 }
1310 if (dmacHw_setDataDescriptor(&devAttr->config,
1311 devAttr->ring.virtAddr,
1312 (void *)srcData,
1313 (void *)dstData2, numBytes) < 0) {
1314 printk(KERN_ERR "%s: dmacHw_setDataDescriptor 2 failed\n",
1315 __func__);
1316 return -EINVAL;
1317 }
1318
1319 /* You should use dma_start_transfer rather than dma_transfer_xxx so we don't */
1320 /* try to make the 'prev' variables right. */
1321
1322 devAttr->prevSrcData = 0;
1323 devAttr->prevDstData = 0;
1324 devAttr->prevNumBytes = 0;
1325
1326 return numDescriptors;
1327}
1328
1329EXPORT_SYMBOL(dma_alloc_double_dst_descriptors);
1330
1331/****************************************************************************/
1332/**
1333* Initiates a transfer when the descriptors have already been setup.
1334*
1335* This is a special case, and normally, the dma_transfer_xxx functions should
1336* be used.
1337*
1338* @return
1339* 0 Transfer was started successfully
1340* -ENODEV Invalid handle
1341*/
1342/****************************************************************************/
1343
1344int dma_start_transfer(DMA_Handle_t handle)
1345{
1346 DMA_Channel_t *channel;
1347 DMA_DeviceAttribute_t *devAttr;
1348
1349 channel = HandleToChannel(handle);
1350 if (channel == NULL) {
1351 return -ENODEV;
1352 }
1353 devAttr = &DMA_gDeviceAttribute[channel->devType];
1354
1355 dmacHw_initiateTransfer(channel->dmacHwHandle, &devAttr->config,
1356 devAttr->ring.virtAddr);
1357
1358 /* Since we got this far, everything went successfully */
1359
1360 return 0;
1361}
1362
1363EXPORT_SYMBOL(dma_start_transfer);
1364
1365/****************************************************************************/
1366/**
1367* Stops a previously started DMA transfer.
1368*
1369* @return
1370* 0 Transfer was stopped successfully
1371* -ENODEV Invalid handle
1372*/
1373/****************************************************************************/
1374
1375int dma_stop_transfer(DMA_Handle_t handle)
1376{
1377 DMA_Channel_t *channel;
1378
1379 channel = HandleToChannel(handle);
1380 if (channel == NULL) {
1381 return -ENODEV;
1382 }
1383
1384 dmacHw_stopTransfer(channel->dmacHwHandle);
1385
1386 return 0;
1387}
1388
1389EXPORT_SYMBOL(dma_stop_transfer);
1390
1391/****************************************************************************/
1392/**
1393* Waits for a DMA to complete by polling. This function is only intended
1394* to be used for testing. Interrupts should be used for most DMA operations.
1395*/
1396/****************************************************************************/
1397
1398int dma_wait_transfer_done(DMA_Handle_t handle)
1399{
1400 DMA_Channel_t *channel;
1401 dmacHw_TRANSFER_STATUS_e status;
1402
1403 channel = HandleToChannel(handle);
1404 if (channel == NULL) {
1405 return -ENODEV;
1406 }
1407
1408 while ((status =
1409 dmacHw_transferCompleted(channel->dmacHwHandle)) ==
1410 dmacHw_TRANSFER_STATUS_BUSY) {
1411 ;
1412 }
1413
1414 if (status == dmacHw_TRANSFER_STATUS_ERROR) {
1415 printk(KERN_ERR "%s: DMA transfer failed\n", __func__);
1416 return -EIO;
1417 }
1418 return 0;
1419}
1420
1421EXPORT_SYMBOL(dma_wait_transfer_done);
1422
1423/****************************************************************************/
1424/**
1425* Initiates a DMA, allocating the descriptors as required.
1426*
1427* @return
1428* 0 Transfer was started successfully
1429* -EINVAL Invalid device type for this kind of transfer
1430* (i.e. the device is _DEV_TO_MEM and not _MEM_TO_DEV)
1431*/
1432/****************************************************************************/
1433
1434int dma_transfer(DMA_Handle_t handle, /* DMA Handle */
1435 dmacHw_TRANSFER_TYPE_e transferType, /* Type of transfer being performed */
1436 dma_addr_t srcData, /* Place to get data to write to device */
1437 dma_addr_t dstData, /* Pointer to device data address */
1438 size_t numBytes /* Number of bytes to transfer to the device */
1439 ) {
1440 DMA_Channel_t *channel;
1441 DMA_DeviceAttribute_t *devAttr;
1442 int rc = 0;
1443
1444 channel = HandleToChannel(handle);
1445 if (channel == NULL) {
1446 return -ENODEV;
1447 }
1448
1449 devAttr = &DMA_gDeviceAttribute[channel->devType];
1450
1451 if (devAttr->config.transferType != transferType) {
1452 return -EINVAL;
1453 }
1454
1455 /* We keep track of the information about the previous request for this */
1456 /* device, and if the attributes match, then we can use the descriptors we setup */
1457 /* the last time, and not have to reinitialize everything. */
1458
1459 {
1460 rc =
1461 dma_alloc_descriptors(handle, transferType, srcData,
1462 dstData, numBytes);
1463 if (rc != 0) {
1464 return rc;
1465 }
1466 }
1467
1468 /* And kick off the transfer */
1469
1470 devAttr->numBytes = numBytes;
1471 devAttr->transferStartTime = timer_get_tick_count();
1472
1473 dmacHw_initiateTransfer(channel->dmacHwHandle, &devAttr->config,
1474 devAttr->ring.virtAddr);
1475
1476 /* Since we got this far, everything went successfully */
1477
1478 return 0;
1479}
1480
1481EXPORT_SYMBOL(dma_transfer);
1482
1483/****************************************************************************/
1484/**
1485* Set the callback function which will be called when a transfer completes.
1486* If a NULL callback function is set, then no callback will occur.
1487*
1488* @note @a devHandler will be called from IRQ context.
1489*
1490* @return
1491* 0 - Success
1492* -ENODEV - Device handed in is invalid.
1493*/
1494/****************************************************************************/
1495
1496int dma_set_device_handler(DMA_Device_t dev, /* Device to set the callback for. */
1497 DMA_DeviceHandler_t devHandler, /* Function to call when the DMA completes */
1498 void *userData /* Pointer which will be passed to devHandler. */
1499 ) {
1500 DMA_DeviceAttribute_t *devAttr;
1501 unsigned long flags;
1502
1503 if (!IsDeviceValid(dev)) {
1504 return -ENODEV;
1505 }
1506 devAttr = &DMA_gDeviceAttribute[dev];
1507
1508 local_irq_save(flags);
1509
1510 devAttr->userData = userData;
1511 devAttr->devHandler = devHandler;
1512
1513 local_irq_restore(flags);
1514
1515 return 0;
1516}
1517
1518EXPORT_SYMBOL(dma_set_device_handler);
diff --git a/arch/arm/mach-bcmring/dma_device.c b/arch/arm/mach-bcmring/dma_device.c
deleted file mode 100644
index ca0ad736870..00000000000
--- a/arch/arm/mach-bcmring/dma_device.c
+++ /dev/null
@@ -1,593 +0,0 @@
1/*****************************************************************************
2* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file dma_device.c
18*
19* @brief private array of DMA_DeviceAttribute_t
20*/
21/****************************************************************************/
22
23DMA_DeviceAttribute_t DMA_gDeviceAttribute[DMA_NUM_DEVICE_ENTRIES] = {
24 [DMA_DEVICE_MEM_TO_MEM] = /* MEM 2 MEM */
25 {
26 .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1,
27 .name = "mem-to-mem",
28 .config = {
29 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
30 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
31 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_MEM,
32 .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
33 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
34 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
35 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
36 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
37 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
38 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
39 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
40
41 },
42 },
43 [DMA_DEVICE_VPM_MEM_TO_MEM] = /* VPM */
44 {
45 .flags = DMA_DEVICE_FLAG_IS_DEDICATED | DMA_DEVICE_FLAG_NO_ISR,
46 .name = "vpm",
47 .dedicatedController = 0,
48 .dedicatedChannel = 0,
49 /* reserve DMA0:0 for VPM */
50 },
51 [DMA_DEVICE_NAND_MEM_TO_MEM] = /* NAND */
52 {
53 .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1,
54 .name = "nand",
55 .config = {
56 .srcPeripheralPort = 0,
57 .dstPeripheralPort = 0,
58 .srcStatusRegisterAddress = 0x00000000,
59 .dstStatusRegisterAddress = 0x00000000,
60 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_MEM,
61 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
62 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
63 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
64 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
65 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
66 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
67 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
68 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
69 .channelPriority = dmacHw_CHANNEL_PRIORITY_6,
70 },
71 },
72 [DMA_DEVICE_PIF_MEM_TO_DEV] = /* PIF TX */
73 {
74 .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1
75 | DMA_DEVICE_FLAG_ALLOW_LARGE_FIFO
76 | DMA_DEVICE_FLAG_ALLOC_DMA1_FIRST | DMA_DEVICE_FLAG_PORT_PER_DMAC,
77 .name = "pif_tx",
78 .dmacPort = {14, 5},
79 .config = {
80 .srcPeripheralPort = 0, /* SRC: memory */
81 /* dstPeripheralPort = 5 or 14 */
82 .srcStatusRegisterAddress = 0x00000000,
83 .dstStatusRegisterAddress = 0x00000000,
84 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
85 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
86 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
87 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
88 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
89 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
90 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
91 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
92 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
93 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
94 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
95 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
96 .maxDataPerBlock = 16256,
97 },
98 },
99 [DMA_DEVICE_PIF_DEV_TO_MEM] = /* PIF RX */
100 {
101 .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1
102 | DMA_DEVICE_FLAG_ALLOW_LARGE_FIFO
103 /* DMA_DEVICE_FLAG_ALLOC_DMA1_FIRST */
104 | DMA_DEVICE_FLAG_PORT_PER_DMAC,
105 .name = "pif_rx",
106 .dmacPort = {14, 5},
107 .config = {
108 /* srcPeripheralPort = 5 or 14 */
109 .dstPeripheralPort = 0, /* DST: memory */
110 .srcStatusRegisterAddress = 0x00000000,
111 .dstStatusRegisterAddress = 0x00000000,
112 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
113 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
114 .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
115 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
116 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
117 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
118 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
119 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
120 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
121 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
122 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
123 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
124 .maxDataPerBlock = 16256,
125 },
126 },
127 [DMA_DEVICE_I2S0_DEV_TO_MEM] = /* I2S RX */
128 {
129 .flags = DMA_DEVICE_FLAG_ON_DMA0,
130 .name = "i2s0_rx",
131 .config = {
132 .srcPeripheralPort = 0, /* SRC: I2S0 */
133 .dstPeripheralPort = 0, /* DST: memory */
134 .srcStatusRegisterAddress = 0,
135 .dstStatusRegisterAddress = 0,
136 .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
137 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
138 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
139 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_16,
140 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
141 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
142 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_0,
143 .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
144 .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
145 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
146 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
147 .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
148 },
149 },
150 [DMA_DEVICE_I2S0_MEM_TO_DEV] = /* I2S TX */
151 {
152 .flags = DMA_DEVICE_FLAG_ON_DMA0,
153 .name = "i2s0_tx",
154 .config = {
155 .srcPeripheralPort = 0, /* SRC: memory */
156 .dstPeripheralPort = 1, /* DST: I2S0 */
157 .srcStatusRegisterAddress = 0,
158 .dstStatusRegisterAddress = 0,
159 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
160 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
161 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
162 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
163 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_16,
164 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_0,
165 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
166 .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
167 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
168 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
169 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
170 .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
171 },
172 },
173 [DMA_DEVICE_I2S1_DEV_TO_MEM] = /* I2S1 RX */
174 {
175 .flags = DMA_DEVICE_FLAG_ON_DMA1,
176 .name = "i2s1_rx",
177 .config = {
178 .srcPeripheralPort = 2, /* SRC: I2S1 */
179 .dstPeripheralPort = 0, /* DST: memory */
180 .srcStatusRegisterAddress = 0,
181 .dstStatusRegisterAddress = 0,
182 .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
183 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
184 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
185 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_16,
186 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
187 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
188 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_0,
189 .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
190 .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
191 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
192 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
193 .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
194 },
195 },
196 [DMA_DEVICE_I2S1_MEM_TO_DEV] = /* I2S1 TX */
197 {
198 .flags = DMA_DEVICE_FLAG_ON_DMA1,
199 .name = "i2s1_tx",
200 .config = {
201 .srcPeripheralPort = 0, /* SRC: memory */
202 .dstPeripheralPort = 3, /* DST: I2S1 */
203 .srcStatusRegisterAddress = 0,
204 .dstStatusRegisterAddress = 0,
205 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
206 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
207 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
208 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
209 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_16,
210 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_0,
211 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
212 .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
213 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
214 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
215 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
216 .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
217 },
218 },
219 [DMA_DEVICE_ESW_MEM_TO_DEV] = /* ESW TX */
220 {
221 .name = "esw_tx",
222 .flags = DMA_DEVICE_FLAG_IS_DEDICATED,
223 .dedicatedController = 1,
224 .dedicatedChannel = 3,
225 .config = {
226 .srcPeripheralPort = 0, /* SRC: memory */
227 .dstPeripheralPort = 1, /* DST: ESW (MTP) */
228 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
229 .errorInterrupt = dmacHw_INTERRUPT_DISABLE,
230 /* DMAx_AHB_SSTATARy */
231 .srcStatusRegisterAddress = 0x00000000,
232 /* DMAx_AHB_DSTATARy */
233 .dstStatusRegisterAddress = 0x30490010,
234 /* DMAx_AHB_CFGy */
235 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
236 /* DMAx_AHB_CTLy */
237 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
238 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
239 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
240 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_0,
241 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
242 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
243 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
244 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
245 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
246 },
247 },
248 [DMA_DEVICE_ESW_DEV_TO_MEM] = /* ESW RX */
249 {
250 .name = "esw_rx",
251 .flags = DMA_DEVICE_FLAG_IS_DEDICATED,
252 .dedicatedController = 1,
253 .dedicatedChannel = 2,
254 .config = {
255 .srcPeripheralPort = 0, /* SRC: ESW (PTM) */
256 .dstPeripheralPort = 0, /* DST: memory */
257 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
258 .errorInterrupt = dmacHw_INTERRUPT_DISABLE,
259 /* DMAx_AHB_SSTATARy */
260 .srcStatusRegisterAddress = 0x30480010,
261 /* DMAx_AHB_DSTATARy */
262 .dstStatusRegisterAddress = 0x00000000,
263 /* DMAx_AHB_CFGy */
264 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
265 /* DMAx_AHB_CTLy */
266 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
267 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
268 .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
269 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
270 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_0,
271 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
272 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
273 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
274 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
275 },
276 },
277 [DMA_DEVICE_APM_CODEC_A_DEV_TO_MEM] = /* APM Codec A Ingress */
278 {
279 .flags = DMA_DEVICE_FLAG_ON_DMA0,
280 .name = "apm_a_rx",
281 .config = {
282 .srcPeripheralPort = 2, /* SRC: Codec A Ingress FIFO */
283 .dstPeripheralPort = 0, /* DST: memory */
284 .srcStatusRegisterAddress = 0x00000000,
285 .dstStatusRegisterAddress = 0x00000000,
286 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
287 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
288 .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
289 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
290 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
291 .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
292 .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
293 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
294 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
295 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
296 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
297 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
298 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
299 .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
300 },
301 },
302 [DMA_DEVICE_APM_CODEC_A_MEM_TO_DEV] = /* APM Codec A Egress */
303 {
304 .flags = DMA_DEVICE_FLAG_ON_DMA0,
305 .name = "apm_a_tx",
306 .config = {
307 .srcPeripheralPort = 0, /* SRC: memory */
308 .dstPeripheralPort = 3, /* DST: Codec A Egress FIFO */
309 .srcStatusRegisterAddress = 0x00000000,
310 .dstStatusRegisterAddress = 0x00000000,
311 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
312 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
313 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
314 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
315 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
316 .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
317 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
318 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
319 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
320 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
321 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
322 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
323 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
324 .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
325 },
326 },
327 [DMA_DEVICE_APM_CODEC_B_DEV_TO_MEM] = /* APM Codec B Ingress */
328 {
329 .flags = DMA_DEVICE_FLAG_ON_DMA0,
330 .name = "apm_b_rx",
331 .config = {
332 .srcPeripheralPort = 4, /* SRC: Codec B Ingress FIFO */
333 .dstPeripheralPort = 0, /* DST: memory */
334 .srcStatusRegisterAddress = 0x00000000,
335 .dstStatusRegisterAddress = 0x00000000,
336 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
337 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
338 .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
339 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
340 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
341 .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
342 .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
343 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
344 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
345 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
346 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
347 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
348 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
349 .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
350 },
351 },
352 [DMA_DEVICE_APM_CODEC_B_MEM_TO_DEV] = /* APM Codec B Egress */
353 {
354 .flags = DMA_DEVICE_FLAG_ON_DMA0,
355 .name = "apm_b_tx",
356 .config = {
357 .srcPeripheralPort = 0, /* SRC: memory */
358 .dstPeripheralPort = 5, /* DST: Codec B Egress FIFO */
359 .srcStatusRegisterAddress = 0x00000000,
360 .dstStatusRegisterAddress = 0x00000000,
361 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
362 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
363 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
364 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
365 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
366 .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
367 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
368 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
369 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
370 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
371 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
372 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
373 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
374 .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
375 },
376 },
377 [DMA_DEVICE_APM_CODEC_C_DEV_TO_MEM] = /* APM Codec C Ingress */
378 {
379 .flags = DMA_DEVICE_FLAG_ON_DMA1,
380 .name = "apm_c_rx",
381 .config = {
382 .srcPeripheralPort = 4, /* SRC: Codec C Ingress FIFO */
383 .dstPeripheralPort = 0, /* DST: memory */
384 .srcStatusRegisterAddress = 0x00000000,
385 .dstStatusRegisterAddress = 0x00000000,
386 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
387 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
388 .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
389 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
390 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
391 .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
392 .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
393 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
394 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
395 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
396 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
397 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
398 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
399 .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
400 },
401 },
402 [DMA_DEVICE_APM_PCM0_DEV_TO_MEM] = /* PCM0 RX */
403 {
404 .flags = DMA_DEVICE_FLAG_ON_DMA0,
405 .name = "pcm0_rx",
406 .config = {
407 .srcPeripheralPort = 12, /* SRC: PCM0 */
408 .dstPeripheralPort = 0, /* DST: memory */
409 .srcStatusRegisterAddress = 0,
410 .dstStatusRegisterAddress = 0,
411 .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
412 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
413 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
414 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
415 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
416 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
417 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
418 .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
419 .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
420 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
421 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
422 .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
423 },
424 },
425 [DMA_DEVICE_APM_PCM0_MEM_TO_DEV] = /* PCM0 TX */
426 {
427 .flags = DMA_DEVICE_FLAG_ON_DMA0,
428 .name = "pcm0_tx",
429 .config = {
430 .srcPeripheralPort = 0, /* SRC: memory */
431 .dstPeripheralPort = 13, /* DST: PCM0 */
432 .srcStatusRegisterAddress = 0,
433 .dstStatusRegisterAddress = 0,
434 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
435 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
436 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
437 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
438 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
439 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
440 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
441 .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
442 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
443 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
444 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
445 .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
446 },
447 },
448 [DMA_DEVICE_APM_PCM1_DEV_TO_MEM] = /* PCM1 RX */
449 {
450 .flags = DMA_DEVICE_FLAG_ON_DMA1,
451 .name = "pcm1_rx",
452 .config = {
453 .srcPeripheralPort = 14, /* SRC: PCM1 */
454 .dstPeripheralPort = 0, /* DST: memory */
455 .srcStatusRegisterAddress = 0,
456 .dstStatusRegisterAddress = 0,
457 .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
458 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
459 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
460 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
461 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
462 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
463 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_4,
464 .blockTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
465 .completeTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
466 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
467 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
468 .transferMode = dmacHw_TRANSFER_MODE_CONTINUOUS,
469 },
470 },
471 [DMA_DEVICE_APM_PCM1_MEM_TO_DEV] = /* PCM1 TX */
472 {
473 .flags = DMA_DEVICE_FLAG_ON_DMA1,
474 .name = "pcm1_tx",
475 .config = {
476 .srcPeripheralPort = 0, /* SRC: memory */
477 .dstPeripheralPort = 15, /* DST: PCM1 */
478 .srcStatusRegisterAddress = 0,
479 .dstStatusRegisterAddress = 0,
480 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
481 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
482 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
483 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
484 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
485 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_4,
486 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
487 .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
488 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
489 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
490 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
491 .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
492 },
493 },
494 [DMA_DEVICE_SPUM_DEV_TO_MEM] = /* SPUM RX */
495 {
496 .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1,
497 .name = "spum_rx",
498 .config = {
499 .srcPeripheralPort = 6, /* SRC: Codec A Ingress FIFO */
500 .dstPeripheralPort = 0, /* DST: memory */
501 .srcStatusRegisterAddress = 0x00000000,
502 .dstStatusRegisterAddress = 0x00000000,
503 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
504 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
505 .transferType = dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
506 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
507 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
508 .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
509 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
510 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
511 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
512 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
513 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
514 /* Busrt size **MUST** be 16 for SPUM to work */
515 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_16,
516 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_16,
517 .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
518 /* on the RX side, SPU needs to be the flow controller */
519 .flowControler = dmacHw_FLOW_CONTROL_PERIPHERAL,
520 },
521 },
522 [DMA_DEVICE_SPUM_MEM_TO_DEV] = /* SPUM TX */
523 {
524 .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1,
525 .name = "spum_tx",
526 .config = {
527 .srcPeripheralPort = 0, /* SRC: memory */
528 .dstPeripheralPort = 7, /* DST: SPUM */
529 .srcStatusRegisterAddress = 0x00000000,
530 .dstStatusRegisterAddress = 0x00000000,
531 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
532 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
533 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
534 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
535 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
536 .blockTransferInterrupt = dmacHw_INTERRUPT_DISABLE,
537 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
538 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
539 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
540 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_32,
541 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_32,
542 /* Busrt size **MUST** be 16 for SPUM to work */
543 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_16,
544 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_16,
545 .transferMode = dmacHw_TRANSFER_MODE_PERREQUEST,
546 },
547 },
548 [DMA_DEVICE_MEM_TO_VRAM] = /* MEM 2 VRAM */
549 {
550 .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1,
551 .name = "mem-to-vram",
552 .config = {
553 .srcPeripheralPort = 0, /* SRC: memory */
554 .srcStatusRegisterAddress = 0x00000000,
555 .dstStatusRegisterAddress = 0x00000000,
556 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
557 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
558 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_MEM,
559 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_1,
560 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_2,
561 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
562 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
563 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
564 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
565 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
566 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
567 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
568 },
569 },
570 [DMA_DEVICE_VRAM_TO_MEM] = /* VRAM 2 MEM */
571 {
572 .flags = DMA_DEVICE_FLAG_ON_DMA0 | DMA_DEVICE_FLAG_ON_DMA1,
573 .name = "vram-to-mem",
574 .config = {
575 .dstPeripheralPort = 0, /* DST: memory */
576 .srcStatusRegisterAddress = 0x00000000,
577 .dstStatusRegisterAddress = 0x00000000,
578 .srcUpdate = dmacHw_SRC_ADDRESS_UPDATE_MODE_INC,
579 .dstUpdate = dmacHw_DST_ADDRESS_UPDATE_MODE_INC,
580 .transferType = dmacHw_TRANSFER_TYPE_MEM_TO_MEM,
581 .srcMasterInterface = dmacHw_SRC_MASTER_INTERFACE_2,
582 .dstMasterInterface = dmacHw_DST_MASTER_INTERFACE_1,
583 .completeTransferInterrupt = dmacHw_INTERRUPT_ENABLE,
584 .errorInterrupt = dmacHw_INTERRUPT_ENABLE,
585 .channelPriority = dmacHw_CHANNEL_PRIORITY_7,
586 .srcMaxTransactionWidth = dmacHw_SRC_TRANSACTION_WIDTH_64,
587 .dstMaxTransactionWidth = dmacHw_DST_TRANSACTION_WIDTH_64,
588 .srcMaxBurstWidth = dmacHw_SRC_BURST_WIDTH_8,
589 .dstMaxBurstWidth = dmacHw_DST_BURST_WIDTH_8,
590 },
591 },
592};
593EXPORT_SYMBOL(DMA_gDeviceAttribute); /* primarily for dma-test.c */
diff --git a/arch/arm/mach-bcmring/include/cfg_global.h b/arch/arm/mach-bcmring/include/cfg_global.h
deleted file mode 100644
index f01da877148..00000000000
--- a/arch/arm/mach-bcmring/include/cfg_global.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef _CFG_GLOBAL_H_
2#define _CFG_GLOBAL_H_
3
4#include <cfg_global_defines.h>
5
6#define CFG_GLOBAL_CHIP BCM11107
7#define CFG_GLOBAL_CHIP_FAMILY CFG_GLOBAL_CHIP_FAMILY_BCMRING
8#define CFG_GLOBAL_CHIP_REV 0xB0
9#define CFG_GLOBAL_RAM_SIZE 0x10000000
10#define CFG_GLOBAL_RAM_BASE 0x00000000
11#define CFG_GLOBAL_RAM_RESERVED_SIZE 0x000000
12
13#endif /* _CFG_GLOBAL_H_ */
diff --git a/arch/arm/mach-bcmring/include/cfg_global_defines.h b/arch/arm/mach-bcmring/include/cfg_global_defines.h
deleted file mode 100644
index b5beb0b3073..00000000000
--- a/arch/arm/mach-bcmring/include/cfg_global_defines.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*****************************************************************************
2* Copyright 2006 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#ifndef CFG_GLOBAL_DEFINES_H
16#define CFG_GLOBAL_DEFINES_H
17
18/* CHIP */
19#define BCM1103 1
20
21#define BCM1191 4
22#define BCM2153 5
23#define BCM2820 6
24
25#define BCM2826 8
26#define FPGA11107 9
27#define BCM11107 10
28#define BCM11109 11
29#define BCM11170 12
30#define BCM11110 13
31#define BCM11211 14
32
33/* CFG_GLOBAL_CHIP_FAMILY types */
34#define CFG_GLOBAL_CHIP_FAMILY_NONE 0
35#define CFG_GLOBAL_CHIP_FAMILY_BCM116X 2
36#define CFG_GLOBAL_CHIP_FAMILY_BCMRING 4
37#define CFG_GLOBAL_CHIP_FAMILY_BCM1103 8
38
39#define IMAGE_HEADER_SIZE_CHECKSUM 4
40#endif
diff --git a/arch/arm/mach-bcmring/include/csp/cache.h b/arch/arm/mach-bcmring/include/csp/cache.h
deleted file mode 100644
index caa20e59db9..00000000000
--- a/arch/arm/mach-bcmring/include/csp/cache.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#ifndef CSP_CACHE_H
16#define CSP_CACHE_H
17
18/* ---- Include Files ---------------------------------------------------- */
19
20#include <csp/stdint.h>
21
22/* ---- Public Constants and Types --------------------------------------- */
23
24#if defined(__KERNEL__) && !defined(STANDALONE)
25#include <asm/cacheflush.h>
26
27#define CSP_CACHE_FLUSH_ALL flush_cache_all()
28
29#else
30
31#define CSP_CACHE_FLUSH_ALL
32
33#endif
34
35#endif /* CSP_CACHE_H */
diff --git a/arch/arm/mach-bcmring/include/csp/delay.h b/arch/arm/mach-bcmring/include/csp/delay.h
deleted file mode 100644
index 8b3d8036729..00000000000
--- a/arch/arm/mach-bcmring/include/csp/delay.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15
16#ifndef CSP_DELAY_H
17#define CSP_DELAY_H
18
19/* ---- Include Files ---------------------------------------------------- */
20
21/* Some CSP routines require use of the following delay routines. Use the OS */
22/* version if available, otherwise use a CSP specific definition. */
23/* void udelay(unsigned long usecs); */
24/* void mdelay(unsigned long msecs); */
25
26#if defined(__KERNEL__) && !defined(STANDALONE)
27 #include <linux/delay.h>
28#else
29 #include <mach/csp/delay.h>
30#endif
31
32/* ---- Public Constants and Types --------------------------------------- */
33/* ---- Public Variable Externs ------------------------------------------ */
34/* ---- Public Function Prototypes --------------------------------------- */
35
36#endif /* CSP_DELAY_H */
diff --git a/arch/arm/mach-bcmring/include/csp/dmacHw.h b/arch/arm/mach-bcmring/include/csp/dmacHw.h
deleted file mode 100644
index e6a1dc484ca..00000000000
--- a/arch/arm/mach-bcmring/include/csp/dmacHw.h
+++ /dev/null
@@ -1,596 +0,0 @@
1/*****************************************************************************
2* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file dmacHw.h
18*
19* @brief API definitions for low level DMA controller driver
20*
21*/
22/****************************************************************************/
23#ifndef _DMACHW_H
24#define _DMACHW_H
25
26#include <stddef.h>
27
28#include <csp/stdint.h>
29#include <mach/csp/dmacHw_reg.h>
30
31/* Define DMA Channel ID using DMA controller number (m) and channel number (c).
32
33 System specific channel ID should be defined as follows
34
35 For example:
36
37 #include <dmacHw.h>
38 ...
39 #define systemHw_LCD_CHANNEL_ID dmacHw_MAKE_CHANNEL_ID(0,5)
40 #define systemHw_SWITCH_RX_CHANNEL_ID dmacHw_MAKE_CHANNEL_ID(0,0)
41 #define systemHw_SWITCH_TX_CHANNEL_ID dmacHw_MAKE_CHANNEL_ID(0,1)
42 #define systemHw_APM_RX_CHANNEL_ID dmacHw_MAKE_CHANNEL_ID(0,3)
43 #define systemHw_APM_TX_CHANNEL_ID dmacHw_MAKE_CHANNEL_ID(0,4)
44 ...
45 #define systemHw_SHARED1_CHANNEL_ID dmacHw_MAKE_CHANNEL_ID(1,4)
46 #define systemHw_SHARED2_CHANNEL_ID dmacHw_MAKE_CHANNEL_ID(1,5)
47 #define systemHw_SHARED3_CHANNEL_ID dmacHw_MAKE_CHANNEL_ID(0,6)
48 ...
49*/
50#define dmacHw_MAKE_CHANNEL_ID(m, c) (m << 8 | c)
51
52typedef enum {
53 dmacHw_CHANNEL_PRIORITY_0 = dmacHw_REG_CFG_LO_CH_PRIORITY_0, /* Channel priority 0. Lowest priority DMA channel */
54 dmacHw_CHANNEL_PRIORITY_1 = dmacHw_REG_CFG_LO_CH_PRIORITY_1, /* Channel priority 1 */
55 dmacHw_CHANNEL_PRIORITY_2 = dmacHw_REG_CFG_LO_CH_PRIORITY_2, /* Channel priority 2 */
56 dmacHw_CHANNEL_PRIORITY_3 = dmacHw_REG_CFG_LO_CH_PRIORITY_3, /* Channel priority 3 */
57 dmacHw_CHANNEL_PRIORITY_4 = dmacHw_REG_CFG_LO_CH_PRIORITY_4, /* Channel priority 4 */
58 dmacHw_CHANNEL_PRIORITY_5 = dmacHw_REG_CFG_LO_CH_PRIORITY_5, /* Channel priority 5 */
59 dmacHw_CHANNEL_PRIORITY_6 = dmacHw_REG_CFG_LO_CH_PRIORITY_6, /* Channel priority 6 */
60 dmacHw_CHANNEL_PRIORITY_7 = dmacHw_REG_CFG_LO_CH_PRIORITY_7 /* Channel priority 7. Highest priority DMA channel */
61} dmacHw_CHANNEL_PRIORITY_e;
62
63/* Source destination master interface */
64typedef enum {
65 dmacHw_SRC_MASTER_INTERFACE_1 = dmacHw_REG_CTL_SMS_1, /* Source DMA master interface 1 */
66 dmacHw_SRC_MASTER_INTERFACE_2 = dmacHw_REG_CTL_SMS_2, /* Source DMA master interface 2 */
67 dmacHw_DST_MASTER_INTERFACE_1 = dmacHw_REG_CTL_DMS_1, /* Destination DMA master interface 1 */
68 dmacHw_DST_MASTER_INTERFACE_2 = dmacHw_REG_CTL_DMS_2 /* Destination DMA master interface 2 */
69} dmacHw_MASTER_INTERFACE_e;
70
71typedef enum {
72 dmacHw_SRC_TRANSACTION_WIDTH_8 = dmacHw_REG_CTL_SRC_TR_WIDTH_8, /* Source 8 bit (1 byte) per transaction */
73 dmacHw_SRC_TRANSACTION_WIDTH_16 = dmacHw_REG_CTL_SRC_TR_WIDTH_16, /* Source 16 bit (2 byte) per transaction */
74 dmacHw_SRC_TRANSACTION_WIDTH_32 = dmacHw_REG_CTL_SRC_TR_WIDTH_32, /* Source 32 bit (4 byte) per transaction */
75 dmacHw_SRC_TRANSACTION_WIDTH_64 = dmacHw_REG_CTL_SRC_TR_WIDTH_64, /* Source 64 bit (8 byte) per transaction */
76 dmacHw_DST_TRANSACTION_WIDTH_8 = dmacHw_REG_CTL_DST_TR_WIDTH_8, /* Destination 8 bit (1 byte) per transaction */
77 dmacHw_DST_TRANSACTION_WIDTH_16 = dmacHw_REG_CTL_DST_TR_WIDTH_16, /* Destination 16 bit (2 byte) per transaction */
78 dmacHw_DST_TRANSACTION_WIDTH_32 = dmacHw_REG_CTL_DST_TR_WIDTH_32, /* Destination 32 bit (4 byte) per transaction */
79 dmacHw_DST_TRANSACTION_WIDTH_64 = dmacHw_REG_CTL_DST_TR_WIDTH_64 /* Destination 64 bit (8 byte) per transaction */
80} dmacHw_TRANSACTION_WIDTH_e;
81
82typedef enum {
83 dmacHw_SRC_BURST_WIDTH_0 = dmacHw_REG_CTL_SRC_MSIZE_0, /* Source No burst */
84 dmacHw_SRC_BURST_WIDTH_4 = dmacHw_REG_CTL_SRC_MSIZE_4, /* Source 4 X dmacHw_TRANSACTION_WIDTH_xxx bytes per burst */
85 dmacHw_SRC_BURST_WIDTH_8 = dmacHw_REG_CTL_SRC_MSIZE_8, /* Source 8 X dmacHw_TRANSACTION_WIDTH_xxx bytes per burst */
86 dmacHw_SRC_BURST_WIDTH_16 = dmacHw_REG_CTL_SRC_MSIZE_16, /* Source 16 X dmacHw_TRANSACTION_WIDTH_xxx bytes per burst */
87 dmacHw_DST_BURST_WIDTH_0 = dmacHw_REG_CTL_DST_MSIZE_0, /* Destination No burst */
88 dmacHw_DST_BURST_WIDTH_4 = dmacHw_REG_CTL_DST_MSIZE_4, /* Destination 4 X dmacHw_TRANSACTION_WIDTH_xxx bytes per burst */
89 dmacHw_DST_BURST_WIDTH_8 = dmacHw_REG_CTL_DST_MSIZE_8, /* Destination 8 X dmacHw_TRANSACTION_WIDTH_xxx bytes per burst */
90 dmacHw_DST_BURST_WIDTH_16 = dmacHw_REG_CTL_DST_MSIZE_16 /* Destination 16 X dmacHw_TRANSACTION_WIDTH_xxx bytes per burst */
91} dmacHw_BURST_WIDTH_e;
92
93typedef enum {
94 dmacHw_TRANSFER_TYPE_MEM_TO_MEM = dmacHw_REG_CTL_TTFC_MM_DMAC, /* Memory to memory transfer */
95 dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM = dmacHw_REG_CTL_TTFC_PM_DMAC, /* Peripheral to memory transfer */
96 dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL = dmacHw_REG_CTL_TTFC_MP_DMAC, /* Memory to peripheral transfer */
97 dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_PERIPHERAL = dmacHw_REG_CTL_TTFC_PP_DMAC /* Peripheral to peripheral transfer */
98} dmacHw_TRANSFER_TYPE_e;
99
100typedef enum {
101 dmacHw_TRANSFER_MODE_PERREQUEST, /* Block transfer per DMA request */
102 dmacHw_TRANSFER_MODE_CONTINUOUS, /* Continuous transfer of streaming data */
103 dmacHw_TRANSFER_MODE_PERIODIC /* Periodic transfer of streaming data */
104} dmacHw_TRANSFER_MODE_e;
105
106typedef enum {
107 dmacHw_SRC_ADDRESS_UPDATE_MODE_INC = dmacHw_REG_CTL_SINC_INC, /* Increment source address after every transaction */
108 dmacHw_SRC_ADDRESS_UPDATE_MODE_DEC = dmacHw_REG_CTL_SINC_DEC, /* Decrement source address after every transaction */
109 dmacHw_DST_ADDRESS_UPDATE_MODE_INC = dmacHw_REG_CTL_DINC_INC, /* Increment destination address after every transaction */
110 dmacHw_DST_ADDRESS_UPDATE_MODE_DEC = dmacHw_REG_CTL_DINC_DEC, /* Decrement destination address after every transaction */
111 dmacHw_SRC_ADDRESS_UPDATE_MODE_NC = dmacHw_REG_CTL_SINC_NC, /* No change in source address after every transaction */
112 dmacHw_DST_ADDRESS_UPDATE_MODE_NC = dmacHw_REG_CTL_DINC_NC /* No change in destination address after every transaction */
113} dmacHw_ADDRESS_UPDATE_MODE_e;
114
115typedef enum {
116 dmacHw_FLOW_CONTROL_DMA, /* DMA working as flow controller (default) */
117 dmacHw_FLOW_CONTROL_PERIPHERAL /* Peripheral working as flow controller */
118} dmacHw_FLOW_CONTROL_e;
119
120typedef enum {
121 dmacHw_TRANSFER_STATUS_BUSY, /* DMA Transfer ongoing */
122 dmacHw_TRANSFER_STATUS_DONE, /* DMA Transfer completed */
123 dmacHw_TRANSFER_STATUS_ERROR /* DMA Transfer error */
124} dmacHw_TRANSFER_STATUS_e;
125
126typedef enum {
127 dmacHw_INTERRUPT_DISABLE, /* Interrupt disable */
128 dmacHw_INTERRUPT_ENABLE /* Interrupt enable */
129} dmacHw_INTERRUPT_e;
130
131typedef enum {
132 dmacHw_INTERRUPT_STATUS_NONE = 0x0, /* No DMA interrupt */
133 dmacHw_INTERRUPT_STATUS_TRANS = 0x1, /* End of DMA transfer interrupt */
134 dmacHw_INTERRUPT_STATUS_BLOCK = 0x2, /* End of block transfer interrupt */
135 dmacHw_INTERRUPT_STATUS_ERROR = 0x4 /* Error interrupt */
136} dmacHw_INTERRUPT_STATUS_e;
137
138typedef enum {
139 dmacHw_CONTROLLER_ATTRIB_CHANNEL_NUM, /* Number of DMA channel */
140 dmacHw_CONTROLLER_ATTRIB_CHANNEL_MAX_BLOCK_SIZE, /* Maximum channel burst size */
141 dmacHw_CONTROLLER_ATTRIB_MASTER_INTF_NUM, /* Number of DMA master interface */
142 dmacHw_CONTROLLER_ATTRIB_CHANNEL_BUS_WIDTH, /* Channel Data bus width */
143 dmacHw_CONTROLLER_ATTRIB_CHANNEL_FIFO_SIZE /* Channel FIFO size */
144} dmacHw_CONTROLLER_ATTRIB_e;
145
146typedef unsigned long dmacHw_HANDLE_t; /* DMA channel handle */
147typedef uint32_t dmacHw_ID_t; /* DMA channel Id. Must be created using
148 "dmacHw_MAKE_CHANNEL_ID" macro
149 */
150/* DMA channel configuration parameters */
151typedef struct {
152 uint32_t srcPeripheralPort; /* Source peripheral port */
153 uint32_t dstPeripheralPort; /* Destination peripheral port */
154 uint32_t srcStatusRegisterAddress; /* Source status register address */
155 uint32_t dstStatusRegisterAddress; /* Destination status register address of type */
156
157 uint32_t srcGatherWidth; /* Number of bytes gathered before successive gather opearation */
158 uint32_t srcGatherJump; /* Number of bytes jumpped before successive gather opearation */
159 uint32_t dstScatterWidth; /* Number of bytes sacattered before successive scatter opearation */
160 uint32_t dstScatterJump; /* Number of bytes jumpped before successive scatter opearation */
161 uint32_t maxDataPerBlock; /* Maximum number of bytes to be transferred per block/descrptor.
162 0 = Maximum possible.
163 */
164
165 dmacHw_ADDRESS_UPDATE_MODE_e srcUpdate; /* Source address update mode */
166 dmacHw_ADDRESS_UPDATE_MODE_e dstUpdate; /* Destination address update mode */
167 dmacHw_TRANSFER_TYPE_e transferType; /* DMA transfer type */
168 dmacHw_TRANSFER_MODE_e transferMode; /* DMA transfer mode */
169 dmacHw_MASTER_INTERFACE_e srcMasterInterface; /* DMA source interface */
170 dmacHw_MASTER_INTERFACE_e dstMasterInterface; /* DMA destination interface */
171 dmacHw_TRANSACTION_WIDTH_e srcMaxTransactionWidth; /* Source transaction width */
172 dmacHw_TRANSACTION_WIDTH_e dstMaxTransactionWidth; /* Destination transaction width */
173 dmacHw_BURST_WIDTH_e srcMaxBurstWidth; /* Source burst width */
174 dmacHw_BURST_WIDTH_e dstMaxBurstWidth; /* Destination burst width */
175 dmacHw_INTERRUPT_e blockTransferInterrupt; /* Block trsnafer interrupt */
176 dmacHw_INTERRUPT_e completeTransferInterrupt; /* Complete DMA trsnafer interrupt */
177 dmacHw_INTERRUPT_e errorInterrupt; /* Error interrupt */
178 dmacHw_CHANNEL_PRIORITY_e channelPriority; /* Channel priority */
179 dmacHw_FLOW_CONTROL_e flowControler; /* Data flow controller */
180} dmacHw_CONFIG_t;
181
182/****************************************************************************/
183/**
184* @brief Initializes DMA
185*
186* This function initializes DMA CSP driver
187*
188* @note
189* Must be called before using any DMA channel
190*/
191/****************************************************************************/
192void dmacHw_initDma(void);
193
194/****************************************************************************/
195/**
196* @brief Exit function for DMA
197*
198* This function isolates DMA from the system
199*
200*/
201/****************************************************************************/
202void dmacHw_exitDma(void);
203
204/****************************************************************************/
205/**
206* @brief Gets a handle to a DMA channel
207*
208* This function returns a handle, representing a control block of a particular DMA channel
209*
210* @return -1 - On Failure
211* handle - On Success, representing a channel control block
212*
213* @note
214* None Channel ID must be created using "dmacHw_MAKE_CHANNEL_ID" macro
215*/
216/****************************************************************************/
217dmacHw_HANDLE_t dmacHw_getChannelHandle(dmacHw_ID_t channelId /* [ IN ] DMA Channel Id */
218 );
219
220/****************************************************************************/
221/**
222* @brief Initializes a DMA channel for use
223*
224* This function initializes and resets a DMA channel for use
225*
226* @return -1 - On Failure
227* 0 - On Success
228*
229* @note
230* None
231*/
232/****************************************************************************/
233int dmacHw_initChannel(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
234 );
235
236/****************************************************************************/
237/**
238* @brief Estimates number of descriptor needed to perform certain DMA transfer
239*
240*
241* @return On failure : -1
242* On success : Number of descriptor count
243*
244*
245*/
246/****************************************************************************/
247int dmacHw_calculateDescriptorCount(dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
248 void *pSrcAddr, /* [ IN ] Source (Peripheral/Memory) address */
249 void *pDstAddr, /* [ IN ] Destination (Peripheral/Memory) address */
250 size_t dataLen /* [ IN ] Data length in bytes */
251 );
252
253/****************************************************************************/
254/**
255* @brief Initializes descriptor ring
256*
257* This function will initializes the descriptor ring of a DMA channel
258*
259*
260* @return -1 - On failure
261* 0 - On success
262* @note
263* - "len" parameter should be obtained from "dmacHw_descriptorLen"
264* - Descriptor buffer MUST be 32 bit aligned and uncached as it
265* is accessed by ARM and DMA
266*/
267/****************************************************************************/
268int dmacHw_initDescriptor(void *pDescriptorVirt, /* [ IN ] Virtual address of uncahced buffer allocated to form descriptor ring */
269 uint32_t descriptorPhyAddr, /* [ IN ] Physical address of pDescriptorVirt (descriptor buffer) */
270 uint32_t len, /* [ IN ] Size of the pBuf */
271 uint32_t num /* [ IN ] Number of descriptor in the ring */
272 );
273
274/****************************************************************************/
275/**
276* @brief Finds amount of memory required to form a descriptor ring
277*
278*
279* @return Number of bytes required to form a descriptor ring
280*
281*
282* @note
283* None
284*/
285/****************************************************************************/
286uint32_t dmacHw_descriptorLen(uint32_t descCnt /* [ IN ] Number of descriptor in the ring */
287 );
288
289/****************************************************************************/
290/**
291* @brief Configure DMA channel
292*
293* @return 0 : On success
294* -1 : On failure
295*/
296/****************************************************************************/
297int dmacHw_configChannel(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
298 dmacHw_CONFIG_t *pConfig /* [ IN ] Configuration settings */
299 );
300
301/****************************************************************************/
302/**
303* @brief Set descriptors for known data length
304*
305* When DMA has to work as a flow controller, this function prepares the
306* descriptor chain to transfer data
307*
308* from:
309* - Memory to memory
310* - Peripheral to memory
311* - Memory to Peripheral
312* - Peripheral to Peripheral
313*
314* @return -1 - On failure
315* 0 - On success
316*
317*/
318/****************************************************************************/
319int dmacHw_setDataDescriptor(dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
320 void *pDescriptor, /* [ IN ] Descriptor buffer */
321 void *pSrcAddr, /* [ IN ] Source (Peripheral/Memory) address */
322 void *pDstAddr, /* [ IN ] Destination (Peripheral/Memory) address */
323 size_t dataLen /* [ IN ] Length in bytes */
324 );
325
326/****************************************************************************/
327/**
328* @brief Indicates whether DMA transfer is in progress or completed
329*
330* @return DMA transfer status
331* dmacHw_TRANSFER_STATUS_BUSY: DMA Transfer ongoing
332* dmacHw_TRANSFER_STATUS_DONE: DMA Transfer completed
333* dmacHw_TRANSFER_STATUS_ERROR: DMA Transfer error
334*
335*/
336/****************************************************************************/
337dmacHw_TRANSFER_STATUS_e dmacHw_transferCompleted(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
338 );
339
340/****************************************************************************/
341/**
342* @brief Set descriptor carrying control information
343*
344* This function will be used to send specific control information to the device
345* using the DMA channel
346*
347*
348* @return -1 - On failure
349* 0 - On success
350*
351* @note
352* None
353*/
354/****************************************************************************/
355int dmacHw_setControlDescriptor(dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
356 void *pDescriptor, /* [ IN ] Descriptor buffer */
357 uint32_t ctlAddress, /* [ IN ] Address of the device control register */
358 uint32_t control /* [ IN ] Device control information */
359 );
360
361/****************************************************************************/
362/**
363* @brief Read data DMA transferred to memory
364*
365* This function will read data that has been DMAed to memory while transferring from:
366* - Memory to memory
367* - Peripheral to memory
368*
369* @return 0 - No more data is available to read
370* 1 - More data might be available to read
371*
372*/
373/****************************************************************************/
374int dmacHw_readTransferredData(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
375 dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
376 void *pDescriptor, /* [ IN ] Descriptor buffer */
377 void **ppBbuf, /* [ OUT ] Data received */
378 size_t *pLlen /* [ OUT ] Length of the data received */
379 );
380
381/****************************************************************************/
382/**
383* @brief Prepares descriptor ring, when source peripheral working as a flow controller
384*
385* This function will form the descriptor ring by allocating buffers, when source peripheral
386* has to work as a flow controller to transfer data from:
387* - Peripheral to memory.
388*
389* @return -1 - On failure
390* 0 - On success
391*
392*
393* @note
394* None
395*/
396/****************************************************************************/
397int dmacHw_setVariableDataDescriptor(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
398 dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
399 void *pDescriptor, /* [ IN ] Descriptor buffer */
400 uint32_t srcAddr, /* [ IN ] Source peripheral address */
401 void *(*fpAlloc) (int len), /* [ IN ] Function pointer that provides destination memory */
402 int len, /* [ IN ] Number of bytes "fpAlloc" will allocate for destination */
403 int num /* [ IN ] Number of descriptor to set */
404 );
405
406/****************************************************************************/
407/**
408* @brief Program channel register to initiate transfer
409*
410* @return void
411*
412*
413* @note
414* - Descriptor buffer MUST ALWAYS be flushed before calling this function
415* - This function should also be called from ISR to program the channel with
416* pending descriptors
417*/
418/****************************************************************************/
419void dmacHw_initiateTransfer(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
420 dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
421 void *pDescriptor /* [ IN ] Descriptor buffer */
422 );
423
424/****************************************************************************/
425/**
426* @brief Resets descriptor control information
427*
428* @return void
429*/
430/****************************************************************************/
431void dmacHw_resetDescriptorControl(void *pDescriptor /* [ IN ] Descriptor buffer */
432 );
433
434/****************************************************************************/
435/**
436* @brief Program channel register to stop transfer
437*
438* Ensures the channel is not doing any transfer after calling this function
439*
440* @return void
441*
442*/
443/****************************************************************************/
444void dmacHw_stopTransfer(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
445 );
446
447/****************************************************************************/
448/**
449* @brief Check the existence of pending descriptor
450*
451* This function confirmes if there is any pending descriptor in the chain
452* to program the channel
453*
454* @return 1 : Channel need to be programmed with pending descriptor
455* 0 : No more pending descriptor to programe the channel
456*
457* @note
458* - This function should be called from ISR in case there are pending
459* descriptor to program the channel.
460*
461* Example:
462*
463* dmac_isr ()
464* {
465* ...
466* if (dmacHw_descriptorPending (handle))
467* {
468* dmacHw_initiateTransfer (handle);
469* }
470* }
471*
472*/
473/****************************************************************************/
474uint32_t dmacHw_descriptorPending(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
475 void *pDescriptor /* [ IN ] Descriptor buffer */
476 );
477
478/****************************************************************************/
479/**
480* @brief Deallocates source or destination memory, allocated
481*
482* This function can be called to deallocate data memory that was DMAed successfully
483*
484* @return -1 - On failure
485* 0 - On success
486*
487* @note
488* This function will be called ONLY, when source OR destination address is pointing
489* to dynamic memory
490*/
491/****************************************************************************/
492int dmacHw_freeMem(dmacHw_CONFIG_t *pConfig, /* [ IN ] Configuration settings */
493 void *pDescriptor, /* [ IN ] Descriptor buffer */
494 void (*fpFree) (void *) /* [ IN ] Function pointer to free data memory */
495 );
496
497/****************************************************************************/
498/**
499* @brief Clears the interrupt
500*
501* This function clears the DMA channel specific interrupt
502*
503* @return N/A
504*
505* @note
506* Must be called under the context of ISR
507*/
508/****************************************************************************/
509void dmacHw_clearInterrupt(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
510 );
511
512/****************************************************************************/
513/**
514* @brief Returns the cause of channel specific DMA interrupt
515*
516* This function returns the cause of interrupt
517*
518* @return Interrupt status, each bit representing a specific type of interrupt
519* of type dmacHw_INTERRUPT_STATUS_e
520* @note
521* This function should be called under the context of ISR
522*/
523/****************************************************************************/
524dmacHw_INTERRUPT_STATUS_e dmacHw_getInterruptStatus(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
525 );
526
527/****************************************************************************/
528/**
529* @brief Indentifies a DMA channel causing interrupt
530*
531* This functions returns a channel causing interrupt of type dmacHw_INTERRUPT_STATUS_e
532*
533* @return NULL : No channel causing DMA interrupt
534* ! NULL : Handle to a channel causing DMA interrupt
535* @note
536* dmacHw_clearInterrupt() must be called with a valid handle after calling this function
537*/
538/****************************************************************************/
539dmacHw_HANDLE_t dmacHw_getInterruptSource(void);
540
541/****************************************************************************/
542/**
543* @brief Sets channel specific user data
544*
545* This function associates user data to a specific DMA channel
546*
547*/
548/****************************************************************************/
549void dmacHw_setChannelUserData(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
550 void *userData /* [ IN ] User data */
551 );
552
553/****************************************************************************/
554/**
555* @brief Gets channel specific user data
556*
557* This function returns user data specific to a DMA channel
558*
559* @return user data
560*/
561/****************************************************************************/
562void *dmacHw_getChannelUserData(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handle */
563 );
564
565/****************************************************************************/
566/**
567* @brief Displays channel specific registers and other control parameters
568*
569*
570* @return void
571*
572* @note
573* None
574*/
575/****************************************************************************/
576void dmacHw_printDebugInfo(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
577 void *pDescriptor, /* [ IN ] Descriptor buffer */
578 int (*fpPrint) (const char *, ...) /* [ IN ] Print callback function */
579 );
580
581/****************************************************************************/
582/**
583* @brief Provides DMA controller attributes
584*
585*
586* @return DMA controller attributes
587*
588* @note
589* None
590*/
591/****************************************************************************/
592uint32_t dmacHw_getDmaControllerAttribute(dmacHw_HANDLE_t handle, /* [ IN ] DMA Channel handle */
593 dmacHw_CONTROLLER_ATTRIB_e attr /* [ IN ] DMA Controller attribute of type dmacHw_CONTROLLER_ATTRIB_e */
594 );
595
596#endif /* _DMACHW_H */
diff --git a/arch/arm/mach-bcmring/include/csp/errno.h b/arch/arm/mach-bcmring/include/csp/errno.h
deleted file mode 100644
index 51357dd5b66..00000000000
--- a/arch/arm/mach-bcmring/include/csp/errno.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#ifndef CSP_ERRNO_H
16#define CSP_ERRNO_H
17
18/* ---- Include Files ---------------------------------------------------- */
19
20#if defined(__KERNEL__)
21#include <linux/errno.h>
22#elif defined(CSP_SIMULATION)
23#include <asm-generic/errno.h>
24#else
25#include <errno.h>
26#endif
27
28/* ---- Public Constants and Types --------------------------------------- */
29/* ---- Public Variable Externs ------------------------------------------ */
30/* ---- Public Function Prototypes --------------------------------------- */
31
32#endif /* CSP_ERRNO_H */
diff --git a/arch/arm/mach-bcmring/include/csp/intcHw.h b/arch/arm/mach-bcmring/include/csp/intcHw.h
deleted file mode 100644
index 1c639c8ee08..00000000000
--- a/arch/arm/mach-bcmring/include/csp/intcHw.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15
16/****************************************************************************/
17/**
18* @file intcHw.h
19*
20* @brief generic interrupt controller API
21*
22* @note
23* None
24*/
25/****************************************************************************/
26
27#ifndef _INTCHW_H
28#define _INTCHW_H
29
30/* ---- Include Files ---------------------------------------------------- */
31#include <mach/csp/intcHw_reg.h>
32
33/* ---- Public Constants and Types --------------------------------------- */
34/* ---- Public Variable Externs ------------------------------------------ */
35/* ---- Public Function Prototypes --------------------------------------- */
36static inline void intcHw_irq_disable(void *basep, uint32_t mask);
37static inline void intcHw_irq_enable(void *basep, uint32_t mask);
38
39#endif /* _INTCHW_H */
40
diff --git a/arch/arm/mach-bcmring/include/csp/module.h b/arch/arm/mach-bcmring/include/csp/module.h
deleted file mode 100644
index c30d2a5975a..00000000000
--- a/arch/arm/mach-bcmring/include/csp/module.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15
16#ifndef CSP_MODULE_H
17#define CSP_MODULE_H
18
19/* ---- Include Files ---------------------------------------------------- */
20
21#ifdef __KERNEL__
22 #include <linux/module.h>
23#else
24 #define EXPORT_SYMBOL(symbol)
25#endif
26
27/* ---- Public Constants and Types --------------------------------------- */
28/* ---- Public Variable Externs ------------------------------------------ */
29/* ---- Public Function Prototypes --------------------------------------- */
30
31
32#endif /* CSP_MODULE_H */
diff --git a/arch/arm/mach-bcmring/include/csp/reg.h b/arch/arm/mach-bcmring/include/csp/reg.h
deleted file mode 100644
index 56654d23c3d..00000000000
--- a/arch/arm/mach-bcmring/include/csp/reg.h
+++ /dev/null
@@ -1,114 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file reg.h
18*
19* @brief Generic register definitions used in CSP
20*/
21/****************************************************************************/
22
23#ifndef CSP_REG_H
24#define CSP_REG_H
25
26/* ---- Include Files ---------------------------------------------------- */
27
28#include <csp/stdint.h>
29
30/* ---- Public Constants and Types --------------------------------------- */
31
32#define __REG32(x) (*((volatile uint32_t *)(x)))
33#define __REG16(x) (*((volatile uint16_t *)(x)))
34#define __REG8(x) (*((volatile uint8_t *) (x)))
35
36/* Macros used to define a sequence of reserved registers. The start / end */
37/* are byte offsets in the particular register definition, with the "end" */
38/* being the offset of the next un-reserved register. E.g. if offsets */
39/* 0x10 through to 0x1f are reserved, then this reserved area could be */
40/* specified as follows. */
41/* typedef struct */
42/* { */
43/* uint32_t reg1; offset 0x00 */
44/* uint32_t reg2; offset 0x04 */
45/* uint32_t reg3; offset 0x08 */
46/* uint32_t reg4; offset 0x0c */
47/* REG32_RSVD(0x10, 0x20); */
48/* uint32_t reg5; offset 0x20 */
49/* ... */
50/* } EXAMPLE_REG_t; */
51#define REG8_RSVD(start, end) uint8_t rsvd_##start[(end - start) / sizeof(uint8_t)]
52#define REG16_RSVD(start, end) uint16_t rsvd_##start[(end - start) / sizeof(uint16_t)]
53#define REG32_RSVD(start, end) uint32_t rsvd_##start[(end - start) / sizeof(uint32_t)]
54
55/* ---- Public Variable Externs ------------------------------------------ */
56/* ---- Public Function Prototypes --------------------------------------- */
57
58/* Note: When protecting multiple statements, the REG_LOCAL_IRQ_SAVE and */
59/* REG_LOCAL_IRQ_RESTORE must be enclosed in { } to allow the */
60/* flags variable to be declared locally. */
61/* e.g. */
62/* statement1; */
63/* { */
64/* REG_LOCAL_IRQ_SAVE; */
65/* <multiple statements here> */
66/* REG_LOCAL_IRQ_RESTORE; */
67/* } */
68/* statement2; */
69/* */
70
71#if defined(__KERNEL__) && !defined(STANDALONE)
72#include <mach/hardware.h>
73#include <linux/interrupt.h>
74
75#define REG_LOCAL_IRQ_SAVE HW_DECLARE_SPINLOCK(reg32) \
76 unsigned long flags; HW_IRQ_SAVE(reg32, flags)
77
78#define REG_LOCAL_IRQ_RESTORE HW_IRQ_RESTORE(reg32, flags)
79
80#else
81
82#define REG_LOCAL_IRQ_SAVE
83#define REG_LOCAL_IRQ_RESTORE
84
85#endif
86
87static inline void reg32_modify_and(volatile uint32_t *reg, uint32_t value)
88{
89 REG_LOCAL_IRQ_SAVE;
90 *reg &= value;
91 REG_LOCAL_IRQ_RESTORE;
92}
93
94static inline void reg32_modify_or(volatile uint32_t *reg, uint32_t value)
95{
96 REG_LOCAL_IRQ_SAVE;
97 *reg |= value;
98 REG_LOCAL_IRQ_RESTORE;
99}
100
101static inline void reg32_modify_mask(volatile uint32_t *reg, uint32_t mask,
102 uint32_t value)
103{
104 REG_LOCAL_IRQ_SAVE;
105 *reg = (*reg & mask) | value;
106 REG_LOCAL_IRQ_RESTORE;
107}
108
109static inline void reg32_write(volatile uint32_t *reg, uint32_t value)
110{
111 *reg = value;
112}
113
114#endif /* CSP_REG_H */
diff --git a/arch/arm/mach-bcmring/include/csp/secHw.h b/arch/arm/mach-bcmring/include/csp/secHw.h
deleted file mode 100644
index b9d7e0732df..00000000000
--- a/arch/arm/mach-bcmring/include/csp/secHw.h
+++ /dev/null
@@ -1,65 +0,0 @@
1/*****************************************************************************
2* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file secHw.h
18*
19* @brief Definitions for accessing low level security features
20*
21*/
22/****************************************************************************/
23#ifndef SECHW_H
24#define SECHW_H
25
26typedef void (*secHw_FUNC_t) (void);
27
28typedef enum {
29 secHw_MODE_SECURE = 0x0, /* Switches processor into secure mode */
30 secHw_MODE_NONSECURE = 0x1 /* Switches processor into non-secure mode */
31} secHw_MODE;
32
33/****************************************************************************/
34/**
35* @brief Requesting to execute the function in secure mode
36*
37* This function requests the given function to run in secure mode
38*
39*/
40/****************************************************************************/
41void secHw_RunSecure(secHw_FUNC_t /* Function to run in secure mode */
42 );
43
44/****************************************************************************/
45/**
46* @brief Sets the mode
47*
48* his function sets the processor mode (secure/non-secure)
49*
50*/
51/****************************************************************************/
52void secHw_SetMode(secHw_MODE /* Processor mode */
53 );
54
55/****************************************************************************/
56/**
57* @brief Get the current mode
58*
59* This function retieves the processor mode (secure/non-secure)
60*
61*/
62/****************************************************************************/
63void secHw_GetMode(secHw_MODE *);
64
65#endif /* SECHW_H */
diff --git a/arch/arm/mach-bcmring/include/csp/stdint.h b/arch/arm/mach-bcmring/include/csp/stdint.h
deleted file mode 100644
index 3a8718bbf70..00000000000
--- a/arch/arm/mach-bcmring/include/csp/stdint.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#ifndef CSP_STDINT_H
16#define CSP_STDINT_H
17
18/* ---- Include Files ---------------------------------------------------- */
19
20#ifdef __KERNEL__
21#include <linux/types.h>
22#else
23#include <stdint.h>
24#endif
25
26/* ---- Public Constants and Types --------------------------------------- */
27/* ---- Public Variable Externs ------------------------------------------ */
28/* ---- Public Function Prototypes --------------------------------------- */
29
30#endif /* CSP_STDINT_H */
diff --git a/arch/arm/mach-bcmring/include/csp/string.h b/arch/arm/mach-bcmring/include/csp/string.h
deleted file mode 100644
index ad9e4005f14..00000000000
--- a/arch/arm/mach-bcmring/include/csp/string.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15
16
17#ifndef CSP_STRING_H
18#define CSP_STRING_H
19
20/* ---- Include Files ---------------------------------------------------- */
21
22#ifdef __KERNEL__
23 #include <linux/string.h>
24#else
25 #include <string.h>
26#endif
27
28/* ---- Public Constants and Types --------------------------------------- */
29/* ---- Public Variable Externs ------------------------------------------ */
30/* ---- Public Function Prototypes --------------------------------------- */
31
32
33#endif /* CSP_STRING_H */
34
diff --git a/arch/arm/mach-bcmring/include/csp/tmrHw.h b/arch/arm/mach-bcmring/include/csp/tmrHw.h
deleted file mode 100644
index 2cbb530db8e..00000000000
--- a/arch/arm/mach-bcmring/include/csp/tmrHw.h
+++ /dev/null
@@ -1,263 +0,0 @@
1/*****************************************************************************
2* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file tmrHw.h
18*
19* @brief API definitions for low level Timer driver
20*
21*/
22/****************************************************************************/
23#ifndef _TMRHW_H
24#define _TMRHW_H
25
26#include <csp/stdint.h>
27
28typedef uint32_t tmrHw_ID_t; /* Timer ID */
29typedef uint32_t tmrHw_COUNT_t; /* Timer count */
30typedef uint32_t tmrHw_INTERVAL_t; /* Timer interval */
31typedef uint32_t tmrHw_RATE_t; /* Timer event (count/interrupt) rate */
32
33typedef enum {
34 tmrHw_INTERRUPT_STATUS_SET, /* Interrupted */
35 tmrHw_INTERRUPT_STATUS_UNSET /* No Interrupt */
36} tmrHw_INTERRUPT_STATUS_e;
37
38typedef enum {
39 tmrHw_CAPABILITY_CLOCK, /* Clock speed in HHz */
40 tmrHw_CAPABILITY_RESOLUTION /* Timer resolution in bits */
41} tmrHw_CAPABILITY_e;
42
43/****************************************************************************/
44/**
45* @brief Get timer capability
46*
47* This function returns various capabilities/attributes of a timer
48*
49* @return Numeric capability
50*
51*/
52/****************************************************************************/
53uint32_t tmrHw_getTimerCapability(tmrHw_ID_t timerId, /* [ IN ] Timer Id */
54 tmrHw_CAPABILITY_e capability /* [ IN ] Timer capability */
55);
56
57/****************************************************************************/
58/**
59* @brief Configures a periodic timer in terms of timer interrupt rate
60*
61* This function initializes a periodic timer to generate specific number of
62* timer interrupt per second
63*
64* @return On success: Effective timer frequency
65* On failure: 0
66*
67*/
68/****************************************************************************/
69tmrHw_RATE_t tmrHw_setPeriodicTimerRate(tmrHw_ID_t timerId, /* [ IN ] Timer Id */
70 tmrHw_RATE_t rate /* [ IN ] Number of timer interrupt per second */
71);
72
73/****************************************************************************/
74/**
75* @brief Configures a periodic timer to generate timer interrupt after
76* certain time interval
77*
78* This function initializes a periodic timer to generate timer interrupt
79* after every time interval in millisecond
80*
81* @return On success: Effective interval set in mili-second
82* On failure: 0
83*
84*/
85/****************************************************************************/
86tmrHw_INTERVAL_t tmrHw_setPeriodicTimerInterval(tmrHw_ID_t timerId, /* [ IN ] Timer Id */
87 tmrHw_INTERVAL_t msec /* [ IN ] Interval in mili-second */
88);
89
90/****************************************************************************/
91/**
92* @brief Configures a periodic timer to generate timer interrupt just once
93* after certain time interval
94*
95* This function initializes a periodic timer to generate a single ticks after
96* certain time interval in millisecond
97*
98* @return On success: Effective interval set in mili-second
99* On failure: 0
100*
101*/
102/****************************************************************************/
103tmrHw_INTERVAL_t tmrHw_setOneshotTimerInterval(tmrHw_ID_t timerId, /* [ IN ] Timer Id */
104 tmrHw_INTERVAL_t msec /* [ IN ] Interval in mili-second */
105);
106
107/****************************************************************************/
108/**
109* @brief Configures a timer to run as a free running timer
110*
111* This function initializes a timer to run as a free running timer
112*
113* @return Timer resolution (count / sec)
114*
115*/
116/****************************************************************************/
117tmrHw_RATE_t tmrHw_setFreeRunningTimer(tmrHw_ID_t timerId, /* [ IN ] Timer Id */
118 uint32_t divider /* [ IN ] Dividing the clock frequency */
119) __attribute__ ((section(".aramtext")));
120
121/****************************************************************************/
122/**
123* @brief Starts a timer
124*
125* This function starts a preconfigured timer
126*
127* @return -1 - On Failure
128* 0 - On Success
129*/
130/****************************************************************************/
131int tmrHw_startTimer(tmrHw_ID_t timerId /* [ IN ] Timer id */
132) __attribute__ ((section(".aramtext")));
133
134/****************************************************************************/
135/**
136* @brief Stops a timer
137*
138* This function stops a running timer
139*
140* @return -1 - On Failure
141* 0 - On Success
142*/
143/****************************************************************************/
144int tmrHw_stopTimer(tmrHw_ID_t timerId /* [ IN ] Timer id */
145);
146
147/****************************************************************************/
148/**
149* @brief Gets current timer count
150*
151* This function returns the current timer value
152*
153* @return Current downcounting timer value
154*
155*/
156/****************************************************************************/
157tmrHw_COUNT_t tmrHw_GetCurrentCount(tmrHw_ID_t timerId /* [ IN ] Timer id */
158) __attribute__ ((section(".aramtext")));
159
160/****************************************************************************/
161/**
162* @brief Gets timer count rate
163*
164* This function returns the number of counts per second
165*
166* @return Count rate
167*
168*/
169/****************************************************************************/
170tmrHw_RATE_t tmrHw_getCountRate(tmrHw_ID_t timerId /* [ IN ] Timer id */
171) __attribute__ ((section(".aramtext")));
172
173/****************************************************************************/
174/**
175* @brief Enables timer interrupt
176*
177* This function enables the timer interrupt
178*
179* @return N/A
180*
181*/
182/****************************************************************************/
183void tmrHw_enableInterrupt(tmrHw_ID_t timerId /* [ IN ] Timer id */
184);
185
186/****************************************************************************/
187/**
188* @brief Disables timer interrupt
189*
190* This function disable the timer interrupt
191*
192* @return N/A
193*/
194/****************************************************************************/
195void tmrHw_disableInterrupt(tmrHw_ID_t timerId /* [ IN ] Timer id */
196);
197
198/****************************************************************************/
199/**
200* @brief Clears the interrupt
201*
202* This function clears the timer interrupt
203*
204* @return N/A
205*
206* @note
207* Must be called under the context of ISR
208*/
209/****************************************************************************/
210void tmrHw_clearInterrupt(tmrHw_ID_t timerId /* [ IN ] Timer id */
211);
212
213/****************************************************************************/
214/**
215* @brief Gets the interrupt status
216*
217* This function returns timer interrupt status
218*
219* @return Interrupt status
220*/
221/****************************************************************************/
222tmrHw_INTERRUPT_STATUS_e tmrHw_getInterruptStatus(tmrHw_ID_t timerId /* [ IN ] Timer id */
223);
224
225/****************************************************************************/
226/**
227* @brief Indentifies a timer causing interrupt
228*
229* This functions returns a timer causing interrupt
230*
231* @return 0xFFFFFFFF : No timer causing an interrupt
232* ! 0xFFFFFFFF : timer causing an interrupt
233* @note
234* tmrHw_clearIntrrupt() must be called with a valid timer id after calling this function
235*/
236/****************************************************************************/
237tmrHw_ID_t tmrHw_getInterruptSource(void);
238
239/****************************************************************************/
240/**
241* @brief Displays specific timer registers
242*
243*
244* @return void
245*
246*/
247/****************************************************************************/
248void tmrHw_printDebugInfo(tmrHw_ID_t timerId, /* [ IN ] Timer id */
249 int (*fpPrint) (const char *, ...) /* [ IN ] Print callback function */
250);
251
252/****************************************************************************/
253/**
254* @brief Use a timer to perform a busy wait delay for a number of usecs.
255*
256* @return N/A
257*/
258/****************************************************************************/
259void tmrHw_udelay(tmrHw_ID_t timerId, /* [ IN ] Timer id */
260 unsigned long usecs /* [ IN ] usec to delay */
261) __attribute__ ((section(".aramtext")));
262
263#endif /* _TMRHW_H */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/cap.h b/arch/arm/mach-bcmring/include/mach/csp/cap.h
deleted file mode 100644
index 30fa2d54063..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/cap.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/*****************************************************************************
2* Copyright 2009 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#ifndef CAP_H
16#define CAP_H
17
18/* ---- Include Files ---------------------------------------------------- */
19/* ---- Public Constants and Types --------------------------------------- */
20typedef enum {
21 CAP_NOT_PRESENT = 0,
22 CAP_PRESENT
23} CAP_RC_T;
24
25typedef enum {
26 CAP_VPM,
27 CAP_ETH_PHY,
28 CAP_ETH_GMII,
29 CAP_ETH_SGMII,
30 CAP_USB,
31 CAP_TSC,
32 CAP_EHSS,
33 CAP_SDIO,
34 CAP_UARTB,
35 CAP_KEYPAD,
36 CAP_CLCD,
37 CAP_GE,
38 CAP_LEDM,
39 CAP_BBL,
40 CAP_VDEC,
41 CAP_PIF,
42 CAP_APM,
43 CAP_SPU,
44 CAP_PKA,
45 CAP_RNG,
46} CAP_CAPABILITY_T;
47
48typedef enum {
49 CAP_LCD_WVGA = 0,
50 CAP_LCD_VGA = 0x1,
51 CAP_LCD_WQVGA = 0x2,
52 CAP_LCD_QVGA = 0x3
53} CAP_LCD_RES_T;
54
55/* ---- Public Variable Externs ------------------------------------------ */
56/* ---- Public Function Prototypes --------------------------------------- */
57
58static inline CAP_RC_T cap_isPresent(CAP_CAPABILITY_T capability, int index);
59static inline uint32_t cap_getMaxArmSpeedHz(void);
60static inline uint32_t cap_getMaxVpmSpeedHz(void);
61static inline CAP_LCD_RES_T cap_getMaxLcdRes(void);
62
63#endif
diff --git a/arch/arm/mach-bcmring/include/mach/csp/cap_inline.h b/arch/arm/mach-bcmring/include/mach/csp/cap_inline.h
deleted file mode 100644
index 933ce68ed90..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/cap_inline.h
+++ /dev/null
@@ -1,409 +0,0 @@
1/*****************************************************************************
2* Copyright 2009 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#ifndef CAP_INLINE_H
16#define CAP_INLINE_H
17
18/* ---- Include Files ---------------------------------------------------- */
19#include <mach/csp/cap.h>
20#include <cfg_global.h>
21
22/* ---- Public Constants and Types --------------------------------------- */
23#define CAP_CONFIG0_VPM_DIS 0x00000001
24#define CAP_CONFIG0_ETH_PHY0_DIS 0x00000002
25#define CAP_CONFIG0_ETH_PHY1_DIS 0x00000004
26#define CAP_CONFIG0_ETH_GMII0_DIS 0x00000008
27#define CAP_CONFIG0_ETH_GMII1_DIS 0x00000010
28#define CAP_CONFIG0_ETH_SGMII0_DIS 0x00000020
29#define CAP_CONFIG0_ETH_SGMII1_DIS 0x00000040
30#define CAP_CONFIG0_USB0_DIS 0x00000080
31#define CAP_CONFIG0_USB1_DIS 0x00000100
32#define CAP_CONFIG0_TSC_DIS 0x00000200
33#define CAP_CONFIG0_EHSS0_DIS 0x00000400
34#define CAP_CONFIG0_EHSS1_DIS 0x00000800
35#define CAP_CONFIG0_SDIO0_DIS 0x00001000
36#define CAP_CONFIG0_SDIO1_DIS 0x00002000
37#define CAP_CONFIG0_UARTB_DIS 0x00004000
38#define CAP_CONFIG0_KEYPAD_DIS 0x00008000
39#define CAP_CONFIG0_CLCD_DIS 0x00010000
40#define CAP_CONFIG0_GE_DIS 0x00020000
41#define CAP_CONFIG0_LEDM_DIS 0x00040000
42#define CAP_CONFIG0_BBL_DIS 0x00080000
43#define CAP_CONFIG0_VDEC_DIS 0x00100000
44#define CAP_CONFIG0_PIF_DIS 0x00200000
45#define CAP_CONFIG0_RESERVED1_DIS 0x00400000
46#define CAP_CONFIG0_RESERVED2_DIS 0x00800000
47
48#define CAP_CONFIG1_APMA_DIS 0x00000001
49#define CAP_CONFIG1_APMB_DIS 0x00000002
50#define CAP_CONFIG1_APMC_DIS 0x00000004
51#define CAP_CONFIG1_CLCD_RES_MASK 0x00000600
52#define CAP_CONFIG1_CLCD_RES_SHIFT 9
53#define CAP_CONFIG1_CLCD_RES_WVGA (CAP_LCD_WVGA << CAP_CONFIG1_CLCD_RES_SHIFT)
54#define CAP_CONFIG1_CLCD_RES_VGA (CAP_LCD_VGA << CAP_CONFIG1_CLCD_RES_SHIFT)
55#define CAP_CONFIG1_CLCD_RES_WQVGA (CAP_LCD_WQVGA << CAP_CONFIG1_CLCD_RES_SHIFT)
56#define CAP_CONFIG1_CLCD_RES_QVGA (CAP_LCD_QVGA << CAP_CONFIG1_CLCD_RES_SHIFT)
57
58#define CAP_CONFIG2_SPU_DIS 0x00000010
59#define CAP_CONFIG2_PKA_DIS 0x00000020
60#define CAP_CONFIG2_RNG_DIS 0x00000080
61
62#if (CFG_GLOBAL_CHIP == BCM11107)
63#define capConfig0 0
64#define capConfig1 CAP_CONFIG1_CLCD_RES_WVGA
65#define capConfig2 0
66#define CAP_APM_MAX_NUM_CHANS 3
67#elif (CFG_GLOBAL_CHIP == FPGA11107)
68#define capConfig0 0
69#define capConfig1 CAP_CONFIG1_CLCD_RES_WVGA
70#define capConfig2 0
71#define CAP_APM_MAX_NUM_CHANS 3
72#elif (CFG_GLOBAL_CHIP == BCM11109)
73#define capConfig0 (CAP_CONFIG0_USB1_DIS | CAP_CONFIG0_EHSS1_DIS | CAP_CONFIG0_SDIO1_DIS | CAP_CONFIG0_GE_DIS | CAP_CONFIG0_BBL_DIS | CAP_CONFIG0_VDEC_DIS)
74#define capConfig1 (CAP_CONFIG1_APMC_DIS | CAP_CONFIG1_CLCD_RES_WQVGA)
75#define capConfig2 (CAP_CONFIG2_SPU_DIS | CAP_CONFIG2_PKA_DIS)
76#define CAP_APM_MAX_NUM_CHANS 2
77#elif (CFG_GLOBAL_CHIP == BCM11170)
78#define capConfig0 (CAP_CONFIG0_ETH_GMII0_DIS | CAP_CONFIG0_ETH_GMII1_DIS | CAP_CONFIG0_USB0_DIS | CAP_CONFIG0_USB1_DIS | CAP_CONFIG0_TSC_DIS | CAP_CONFIG0_EHSS1_DIS | CAP_CONFIG0_SDIO0_DIS | CAP_CONFIG0_SDIO1_DIS | CAP_CONFIG0_UARTB_DIS | CAP_CONFIG0_CLCD_DIS | CAP_CONFIG0_GE_DIS | CAP_CONFIG0_BBL_DIS | CAP_CONFIG0_VDEC_DIS)
79#define capConfig1 (CAP_CONFIG1_APMC_DIS | CAP_CONFIG1_CLCD_RES_WQVGA)
80#define capConfig2 (CAP_CONFIG2_SPU_DIS | CAP_CONFIG2_PKA_DIS)
81#define CAP_APM_MAX_NUM_CHANS 2
82#elif (CFG_GLOBAL_CHIP == BCM11110)
83#define capConfig0 (CAP_CONFIG0_USB1_DIS | CAP_CONFIG0_TSC_DIS | CAP_CONFIG0_EHSS1_DIS | CAP_CONFIG0_SDIO0_DIS | CAP_CONFIG0_SDIO1_DIS | CAP_CONFIG0_UARTB_DIS | CAP_CONFIG0_GE_DIS | CAP_CONFIG0_BBL_DIS | CAP_CONFIG0_VDEC_DIS)
84#define capConfig1 CAP_CONFIG1_APMC_DIS
85#define capConfig2 (CAP_CONFIG2_SPU_DIS | CAP_CONFIG2_PKA_DIS)
86#define CAP_APM_MAX_NUM_CHANS 2
87#elif (CFG_GLOBAL_CHIP == BCM11211)
88#define capConfig0 (CAP_CONFIG0_ETH_PHY0_DIS | CAP_CONFIG0_ETH_GMII0_DIS | CAP_CONFIG0_ETH_GMII1_DIS | CAP_CONFIG0_ETH_SGMII0_DIS | CAP_CONFIG0_ETH_SGMII1_DIS | CAP_CONFIG0_CLCD_DIS)
89#define capConfig1 CAP_CONFIG1_APMC_DIS
90#define capConfig2 0
91#define CAP_APM_MAX_NUM_CHANS 2
92#else
93#error CFG_GLOBAL_CHIP type capabilities not defined
94#endif
95
96#if ((CFG_GLOBAL_CHIP == BCM11107) || (CFG_GLOBAL_CHIP == FPGA11107))
97#define CAP_HW_CFG_ARM_CLK_HZ 500000000
98#elif ((CFG_GLOBAL_CHIP == BCM11109) || (CFG_GLOBAL_CHIP == BCM11170) || (CFG_GLOBAL_CHIP == BCM11110))
99#define CAP_HW_CFG_ARM_CLK_HZ 300000000
100#elif (CFG_GLOBAL_CHIP == BCM11211)
101#define CAP_HW_CFG_ARM_CLK_HZ 666666666
102#else
103#error CFG_GLOBAL_CHIP type capabilities not defined
104#endif
105
106#if ((CFG_GLOBAL_CHIP == BCM11107) || (CFG_GLOBAL_CHIP == BCM11211) || (CFG_GLOBAL_CHIP == FPGA11107))
107#define CAP_HW_CFG_VPM_CLK_HZ 333333333
108#elif ((CFG_GLOBAL_CHIP == BCM11109) || (CFG_GLOBAL_CHIP == BCM11170) || (CFG_GLOBAL_CHIP == BCM11110))
109#define CAP_HW_CFG_VPM_CLK_HZ 200000000
110#else
111#error CFG_GLOBAL_CHIP type capabilities not defined
112#endif
113
114/* ---- Public Variable Externs ------------------------------------------ */
115/* ---- Public Function Prototypes --------------------------------------- */
116
117/****************************************************************************
118* cap_isPresent -
119*
120* PURPOSE:
121* Determines if the chip has a certain capability present
122*
123* PARAMETERS:
124* capability - type of capability to determine if present
125*
126* RETURNS:
127* CAP_PRESENT or CAP_NOT_PRESENT
128****************************************************************************/
129static inline CAP_RC_T cap_isPresent(CAP_CAPABILITY_T capability, int index)
130{
131 CAP_RC_T returnVal = CAP_NOT_PRESENT;
132
133 switch (capability) {
134 case CAP_VPM:
135 {
136 if (!(capConfig0 & CAP_CONFIG0_VPM_DIS)) {
137 returnVal = CAP_PRESENT;
138 }
139 }
140 break;
141
142 case CAP_ETH_PHY:
143 {
144 if ((index == 0)
145 && (!(capConfig0 & CAP_CONFIG0_ETH_PHY0_DIS))) {
146 returnVal = CAP_PRESENT;
147 }
148 if ((index == 1)
149 && (!(capConfig0 & CAP_CONFIG0_ETH_PHY1_DIS))) {
150 returnVal = CAP_PRESENT;
151 }
152 }
153 break;
154
155 case CAP_ETH_GMII:
156 {
157 if ((index == 0)
158 && (!(capConfig0 & CAP_CONFIG0_ETH_GMII0_DIS))) {
159 returnVal = CAP_PRESENT;
160 }
161 if ((index == 1)
162 && (!(capConfig0 & CAP_CONFIG0_ETH_GMII1_DIS))) {
163 returnVal = CAP_PRESENT;
164 }
165 }
166 break;
167
168 case CAP_ETH_SGMII:
169 {
170 if ((index == 0)
171 && (!(capConfig0 & CAP_CONFIG0_ETH_SGMII0_DIS))) {
172 returnVal = CAP_PRESENT;
173 }
174 if ((index == 1)
175 && (!(capConfig0 & CAP_CONFIG0_ETH_SGMII1_DIS))) {
176 returnVal = CAP_PRESENT;
177 }
178 }
179 break;
180
181 case CAP_USB:
182 {
183 if ((index == 0)
184 && (!(capConfig0 & CAP_CONFIG0_USB0_DIS))) {
185 returnVal = CAP_PRESENT;
186 }
187 if ((index == 1)
188 && (!(capConfig0 & CAP_CONFIG0_USB1_DIS))) {
189 returnVal = CAP_PRESENT;
190 }
191 }
192 break;
193
194 case CAP_TSC:
195 {
196 if (!(capConfig0 & CAP_CONFIG0_TSC_DIS)) {
197 returnVal = CAP_PRESENT;
198 }
199 }
200 break;
201
202 case CAP_EHSS:
203 {
204 if ((index == 0)
205 && (!(capConfig0 & CAP_CONFIG0_EHSS0_DIS))) {
206 returnVal = CAP_PRESENT;
207 }
208 if ((index == 1)
209 && (!(capConfig0 & CAP_CONFIG0_EHSS1_DIS))) {
210 returnVal = CAP_PRESENT;
211 }
212 }
213 break;
214
215 case CAP_SDIO:
216 {
217 if ((index == 0)
218 && (!(capConfig0 & CAP_CONFIG0_SDIO0_DIS))) {
219 returnVal = CAP_PRESENT;
220 }
221 if ((index == 1)
222 && (!(capConfig0 & CAP_CONFIG0_SDIO1_DIS))) {
223 returnVal = CAP_PRESENT;
224 }
225 }
226 break;
227
228 case CAP_UARTB:
229 {
230 if (!(capConfig0 & CAP_CONFIG0_UARTB_DIS)) {
231 returnVal = CAP_PRESENT;
232 }
233 }
234 break;
235
236 case CAP_KEYPAD:
237 {
238 if (!(capConfig0 & CAP_CONFIG0_KEYPAD_DIS)) {
239 returnVal = CAP_PRESENT;
240 }
241 }
242 break;
243
244 case CAP_CLCD:
245 {
246 if (!(capConfig0 & CAP_CONFIG0_CLCD_DIS)) {
247 returnVal = CAP_PRESENT;
248 }
249 }
250 break;
251
252 case CAP_GE:
253 {
254 if (!(capConfig0 & CAP_CONFIG0_GE_DIS)) {
255 returnVal = CAP_PRESENT;
256 }
257 }
258 break;
259
260 case CAP_LEDM:
261 {
262 if (!(capConfig0 & CAP_CONFIG0_LEDM_DIS)) {
263 returnVal = CAP_PRESENT;
264 }
265 }
266 break;
267
268 case CAP_BBL:
269 {
270 if (!(capConfig0 & CAP_CONFIG0_BBL_DIS)) {
271 returnVal = CAP_PRESENT;
272 }
273 }
274 break;
275
276 case CAP_VDEC:
277 {
278 if (!(capConfig0 & CAP_CONFIG0_VDEC_DIS)) {
279 returnVal = CAP_PRESENT;
280 }
281 }
282 break;
283
284 case CAP_PIF:
285 {
286 if (!(capConfig0 & CAP_CONFIG0_PIF_DIS)) {
287 returnVal = CAP_PRESENT;
288 }
289 }
290 break;
291
292 case CAP_APM:
293 {
294 if ((index == 0)
295 && (!(capConfig1 & CAP_CONFIG1_APMA_DIS))) {
296 returnVal = CAP_PRESENT;
297 }
298 if ((index == 1)
299 && (!(capConfig1 & CAP_CONFIG1_APMB_DIS))) {
300 returnVal = CAP_PRESENT;
301 }
302 if ((index == 2)
303 && (!(capConfig1 & CAP_CONFIG1_APMC_DIS))) {
304 returnVal = CAP_PRESENT;
305 }
306 }
307 break;
308
309 case CAP_SPU:
310 {
311 if (!(capConfig2 & CAP_CONFIG2_SPU_DIS)) {
312 returnVal = CAP_PRESENT;
313 }
314 }
315 break;
316
317 case CAP_PKA:
318 {
319 if (!(capConfig2 & CAP_CONFIG2_PKA_DIS)) {
320 returnVal = CAP_PRESENT;
321 }
322 }
323 break;
324
325 case CAP_RNG:
326 {
327 if (!(capConfig2 & CAP_CONFIG2_RNG_DIS)) {
328 returnVal = CAP_PRESENT;
329 }
330 }
331 break;
332
333 default:
334 {
335 }
336 break;
337 }
338 return returnVal;
339}
340
341/****************************************************************************
342* cap_getMaxArmSpeedHz -
343*
344* PURPOSE:
345* Determines the maximum speed of the ARM CPU
346*
347* PARAMETERS:
348* none
349*
350* RETURNS:
351* clock speed in Hz that the ARM processor is able to run at
352****************************************************************************/
353static inline uint32_t cap_getMaxArmSpeedHz(void)
354{
355#if ((CFG_GLOBAL_CHIP == BCM11107) || (CFG_GLOBAL_CHIP == FPGA11107))
356 return 500000000;
357#elif ((CFG_GLOBAL_CHIP == BCM11109) || (CFG_GLOBAL_CHIP == BCM11170) || (CFG_GLOBAL_CHIP == BCM11110))
358 return 300000000;
359#elif (CFG_GLOBAL_CHIP == BCM11211)
360 return 666666666;
361#else
362#error CFG_GLOBAL_CHIP type capabilities not defined
363#endif
364}
365
366/****************************************************************************
367* cap_getMaxVpmSpeedHz -
368*
369* PURPOSE:
370* Determines the maximum speed of the VPM
371*
372* PARAMETERS:
373* none
374*
375* RETURNS:
376* clock speed in Hz that the VPM is able to run at
377****************************************************************************/
378static inline uint32_t cap_getMaxVpmSpeedHz(void)
379{
380#if ((CFG_GLOBAL_CHIP == BCM11107) || (CFG_GLOBAL_CHIP == BCM11211) || (CFG_GLOBAL_CHIP == FPGA11107))
381 return 333333333;
382#elif ((CFG_GLOBAL_CHIP == BCM11109) || (CFG_GLOBAL_CHIP == BCM11170) || (CFG_GLOBAL_CHIP == BCM11110))
383 return 200000000;
384#else
385#error CFG_GLOBAL_CHIP type capabilities not defined
386#endif
387}
388
389/****************************************************************************
390* cap_getMaxLcdRes -
391*
392* PURPOSE:
393* Determines the maximum LCD resolution capabilities
394*
395* PARAMETERS:
396* none
397*
398* RETURNS:
399* CAP_LCD_WVGA, CAP_LCD_VGA, CAP_LCD_WQVGA or CAP_LCD_QVGA
400*
401****************************************************************************/
402static inline CAP_LCD_RES_T cap_getMaxLcdRes(void)
403{
404 return (CAP_LCD_RES_T)
405 ((capConfig1 & CAP_CONFIG1_CLCD_RES_MASK) >>
406 CAP_CONFIG1_CLCD_RES_SHIFT);
407}
408
409#endif
diff --git a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h
deleted file mode 100644
index 161973385fa..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h
+++ /dev/null
@@ -1,1123 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#ifndef CHIPC_DEF_H
16#define CHIPC_DEF_H
17
18/* ---- Include Files ----------------------------------------------------- */
19
20#include <csp/stdint.h>
21#include <csp/errno.h>
22#include <csp/reg.h>
23#include <mach/csp/chipcHw_reg.h>
24
25/* ---- Public Constants and Types ---------------------------------------- */
26
27/* Set 1 to configure DDR/VPM phase alignment by HW */
28#define chipcHw_DDR_HW_PHASE_ALIGN 0
29#define chipcHw_VPM_HW_PHASE_ALIGN 0
30
31typedef uint32_t chipcHw_freq;
32
33/* Configurable miscellaneous clocks */
34typedef enum {
35 chipcHw_CLOCK_DDR, /* DDR PHY Clock */
36 chipcHw_CLOCK_ARM, /* ARM Clock */
37 chipcHw_CLOCK_ESW, /* Ethernet Switch Clock */
38 chipcHw_CLOCK_VPM, /* VPM Clock */
39 chipcHw_CLOCK_ESW125, /* Ethernet MII Clock */
40 chipcHw_CLOCK_UART, /* UART Clock */
41 chipcHw_CLOCK_SDIO0, /* SDIO 0 Clock */
42 chipcHw_CLOCK_SDIO1, /* SDIO 1 Clock */
43 chipcHw_CLOCK_SPI, /* SPI Clock */
44 chipcHw_CLOCK_ETM, /* ARM ETM Clock */
45
46 chipcHw_CLOCK_BUS, /* BUS Clock */
47 chipcHw_CLOCK_OTP, /* OTP Clock */
48 chipcHw_CLOCK_I2C, /* I2C Host Clock */
49 chipcHw_CLOCK_I2S0, /* I2S 0 Host Clock */
50 chipcHw_CLOCK_RTBUS, /* DDR PHY Configuration Clock */
51 chipcHw_CLOCK_APM100, /* APM100 Clock */
52 chipcHw_CLOCK_TSC, /* Touch screen Clock */
53 chipcHw_CLOCK_LED, /* LED Clock */
54
55 chipcHw_CLOCK_USB, /* USB Clock */
56 chipcHw_CLOCK_LCD, /* LCD CLock */
57 chipcHw_CLOCK_APM, /* APM Clock */
58
59 chipcHw_CLOCK_I2S1, /* I2S 1 Host Clock */
60} chipcHw_CLOCK_e;
61
62/* System booting strap options */
63typedef enum {
64 chipcHw_BOOT_DEVICE_UART = chipcHw_STRAPS_BOOT_DEVICE_UART,
65 chipcHw_BOOT_DEVICE_SERIAL_FLASH =
66 chipcHw_STRAPS_BOOT_DEVICE_SERIAL_FLASH,
67 chipcHw_BOOT_DEVICE_NOR_FLASH_16 =
68 chipcHw_STRAPS_BOOT_DEVICE_NOR_FLASH_16,
69 chipcHw_BOOT_DEVICE_NAND_FLASH_8 =
70 chipcHw_STRAPS_BOOT_DEVICE_NAND_FLASH_8,
71 chipcHw_BOOT_DEVICE_NAND_FLASH_16 =
72 chipcHw_STRAPS_BOOT_DEVICE_NAND_FLASH_16
73} chipcHw_BOOT_DEVICE_e;
74
75/* System booting modes */
76typedef enum {
77 chipcHw_BOOT_MODE_NORMAL = chipcHw_STRAPS_BOOT_MODE_NORMAL,
78 chipcHw_BOOT_MODE_DBG_SW = chipcHw_STRAPS_BOOT_MODE_DBG_SW,
79 chipcHw_BOOT_MODE_DBG_BOOT = chipcHw_STRAPS_BOOT_MODE_DBG_BOOT,
80 chipcHw_BOOT_MODE_NORMAL_QUIET = chipcHw_STRAPS_BOOT_MODE_NORMAL_QUIET
81} chipcHw_BOOT_MODE_e;
82
83/* NAND Flash page size strap options */
84typedef enum {
85 chipcHw_NAND_PAGESIZE_512 = chipcHw_STRAPS_NAND_PAGESIZE_512,
86 chipcHw_NAND_PAGESIZE_2048 = chipcHw_STRAPS_NAND_PAGESIZE_2048,
87 chipcHw_NAND_PAGESIZE_4096 = chipcHw_STRAPS_NAND_PAGESIZE_4096,
88 chipcHw_NAND_PAGESIZE_EXT = chipcHw_STRAPS_NAND_PAGESIZE_EXT
89} chipcHw_NAND_PAGESIZE_e;
90
91/* GPIO Pin function */
92typedef enum {
93 chipcHw_GPIO_FUNCTION_KEYPAD = chipcHw_REG_GPIO_MUX_KEYPAD,
94 chipcHw_GPIO_FUNCTION_I2CH = chipcHw_REG_GPIO_MUX_I2CH,
95 chipcHw_GPIO_FUNCTION_SPI = chipcHw_REG_GPIO_MUX_SPI,
96 chipcHw_GPIO_FUNCTION_UART = chipcHw_REG_GPIO_MUX_UART,
97 chipcHw_GPIO_FUNCTION_LEDMTXP = chipcHw_REG_GPIO_MUX_LEDMTXP,
98 chipcHw_GPIO_FUNCTION_LEDMTXS = chipcHw_REG_GPIO_MUX_LEDMTXS,
99 chipcHw_GPIO_FUNCTION_SDIO0 = chipcHw_REG_GPIO_MUX_SDIO0,
100 chipcHw_GPIO_FUNCTION_SDIO1 = chipcHw_REG_GPIO_MUX_SDIO1,
101 chipcHw_GPIO_FUNCTION_PCM = chipcHw_REG_GPIO_MUX_PCM,
102 chipcHw_GPIO_FUNCTION_I2S = chipcHw_REG_GPIO_MUX_I2S,
103 chipcHw_GPIO_FUNCTION_ETM = chipcHw_REG_GPIO_MUX_ETM,
104 chipcHw_GPIO_FUNCTION_DEBUG = chipcHw_REG_GPIO_MUX_DEBUG,
105 chipcHw_GPIO_FUNCTION_MISC = chipcHw_REG_GPIO_MUX_MISC,
106 chipcHw_GPIO_FUNCTION_GPIO = chipcHw_REG_GPIO_MUX_GPIO
107} chipcHw_GPIO_FUNCTION_e;
108
109/* PIN Output slew rate */
110typedef enum {
111 chipcHw_PIN_SLEW_RATE_HIGH = chipcHw_REG_SLEW_RATE_HIGH,
112 chipcHw_PIN_SLEW_RATE_NORMAL = chipcHw_REG_SLEW_RATE_NORMAL
113} chipcHw_PIN_SLEW_RATE_e;
114
115/* PIN Current drive strength */
116typedef enum {
117 chipcHw_PIN_CURRENT_STRENGTH_2mA = chipcHw_REG_CURRENT_STRENGTH_2mA,
118 chipcHw_PIN_CURRENT_STRENGTH_4mA = chipcHw_REG_CURRENT_STRENGTH_4mA,
119 chipcHw_PIN_CURRENT_STRENGTH_6mA = chipcHw_REG_CURRENT_STRENGTH_6mA,
120 chipcHw_PIN_CURRENT_STRENGTH_8mA = chipcHw_REG_CURRENT_STRENGTH_8mA,
121 chipcHw_PIN_CURRENT_STRENGTH_10mA = chipcHw_REG_CURRENT_STRENGTH_10mA,
122 chipcHw_PIN_CURRENT_STRENGTH_12mA = chipcHw_REG_CURRENT_STRENGTH_12mA
123} chipcHw_PIN_CURRENT_STRENGTH_e;
124
125/* PIN Pull up register settings */
126typedef enum {
127 chipcHw_PIN_PULL_NONE = chipcHw_REG_PULL_NONE,
128 chipcHw_PIN_PULL_UP = chipcHw_REG_PULL_UP,
129 chipcHw_PIN_PULL_DOWN = chipcHw_REG_PULL_DOWN
130} chipcHw_PIN_PULL_e;
131
132/* PIN input type settings */
133typedef enum {
134 chipcHw_PIN_INPUTTYPE_CMOS = chipcHw_REG_INPUTTYPE_CMOS,
135 chipcHw_PIN_INPUTTYPE_ST = chipcHw_REG_INPUTTYPE_ST
136} chipcHw_PIN_INPUTTYPE_e;
137
138/* Allow/Disalow the support of spread spectrum */
139typedef enum {
140 chipcHw_SPREAD_SPECTRUM_DISALLOW, /* Spread spectrum support is not allowed */
141 chipcHw_SPREAD_SPECTRUM_ALLOW /* Spread spectrum support is allowed */
142} chipcHw_SPREAD_SPECTRUM_e;
143
144typedef struct {
145 chipcHw_SPREAD_SPECTRUM_e ssSupport; /* Allow/Disalow to support spread spectrum.
146 If supported, call chipcHw_enableSpreadSpectrum ()
147 to activate the spread spectrum with desired spread. */
148 uint32_t pllVcoFreqHz; /* PLL VCO frequency in Hz */
149 uint32_t pll2VcoFreqHz; /* PLL2 VCO frequency in Hz */
150 uint32_t busClockFreqHz; /* Bus clock frequency in Hz */
151 uint32_t armBusRatio; /* ARM clock : Bus clock */
152 uint32_t vpmBusRatio; /* VPM clock : Bus clock */
153 uint32_t ddrBusRatio; /* DDR clock : Bus clock */
154} chipcHw_INIT_PARAM_t;
155
156/* CHIP revision number */
157typedef enum {
158 chipcHw_REV_NUMBER_A0 = chipcHw_REG_REV_A0,
159 chipcHw_REV_NUMBER_B0 = chipcHw_REG_REV_B0
160} chipcHw_REV_NUMBER_e;
161
162typedef enum {
163 chipcHw_VPM_HW_PHASE_INTR_DISABLE = chipcHw_REG_VPM_INTR_DISABLE,
164 chipcHw_VPM_HW_PHASE_INTR_FAST = chipcHw_REG_VPM_INTR_FAST,
165 chipcHw_VPM_HW_PHASE_INTR_MEDIUM = chipcHw_REG_VPM_INTR_MEDIUM,
166 chipcHw_VPM_HW_PHASE_INTR_SLOW = chipcHw_REG_VPM_INTR_SLOW
167} chipcHw_VPM_HW_PHASE_INTR_e;
168
169typedef enum {
170 chipcHw_DDR_HW_PHASE_MARGIN_STRICT, /* Strict margin for DDR phase align condition */
171 chipcHw_DDR_HW_PHASE_MARGIN_MEDIUM, /* Medium margin for DDR phase align condition */
172 chipcHw_DDR_HW_PHASE_MARGIN_WIDE /* Wider margin for DDR phase align condition */
173} chipcHw_DDR_HW_PHASE_MARGIN_e;
174
175typedef enum {
176 chipcHw_VPM_HW_PHASE_MARGIN_STRICT, /* Strict margin for VPM phase align condition */
177 chipcHw_VPM_HW_PHASE_MARGIN_MEDIUM, /* Medium margin for VPM phase align condition */
178 chipcHw_VPM_HW_PHASE_MARGIN_WIDE /* Wider margin for VPM phase align condition */
179} chipcHw_VPM_HW_PHASE_MARGIN_e;
180
181#define chipcHw_XTAL_FREQ_Hz 25000000 /* Reference clock frequency in Hz */
182
183/* Programmable pin defines */
184#define chipcHw_PIN_GPIO(n) ((((n) >= 0) && ((n) < (chipcHw_GPIO_COUNT))) ? (n) : 0xFFFFFFFF)
185 /* GPIO pin 0 - 60 */
186#define chipcHw_PIN_UARTTXD (chipcHw_GPIO_COUNT + 0) /* UART Transmit */
187#define chipcHw_PIN_NVI_A (chipcHw_GPIO_COUNT + 1) /* NVI Interface */
188#define chipcHw_PIN_NVI_D (chipcHw_GPIO_COUNT + 2) /* NVI Interface */
189#define chipcHw_PIN_NVI_OEB (chipcHw_GPIO_COUNT + 3) /* NVI Interface */
190#define chipcHw_PIN_NVI_WEB (chipcHw_GPIO_COUNT + 4) /* NVI Interface */
191#define chipcHw_PIN_NVI_CS (chipcHw_GPIO_COUNT + 5) /* NVI Interface */
192#define chipcHw_PIN_NVI_NAND_CSB (chipcHw_GPIO_COUNT + 6) /* NVI Interface */
193#define chipcHw_PIN_NVI_FLASHWP (chipcHw_GPIO_COUNT + 7) /* NVI Interface */
194#define chipcHw_PIN_NVI_NAND_RDYB (chipcHw_GPIO_COUNT + 8) /* NVI Interface */
195#define chipcHw_PIN_CL_DATA_0_17 (chipcHw_GPIO_COUNT + 9) /* LCD Data 0 - 17 */
196#define chipcHw_PIN_CL_DATA_18_20 (chipcHw_GPIO_COUNT + 10) /* LCD Data 18 - 20 */
197#define chipcHw_PIN_CL_DATA_21_23 (chipcHw_GPIO_COUNT + 11) /* LCD Data 21 - 23 */
198#define chipcHw_PIN_CL_POWER (chipcHw_GPIO_COUNT + 12) /* LCD Power */
199#define chipcHw_PIN_CL_ACK (chipcHw_GPIO_COUNT + 13) /* LCD Ack */
200#define chipcHw_PIN_CL_FP (chipcHw_GPIO_COUNT + 14) /* LCD FP */
201#define chipcHw_PIN_CL_LP (chipcHw_GPIO_COUNT + 15) /* LCD LP */
202#define chipcHw_PIN_UARTRXD (chipcHw_GPIO_COUNT + 16) /* UART Receive */
203
204/* ---- Public Variable Externs ------------------------------------------ */
205/* ---- Public Function Prototypes --------------------------------------- */
206
207/****************************************************************************/
208/**
209* @brief Initializes the clock module
210*
211*/
212/****************************************************************************/
213void chipcHw_Init(chipcHw_INIT_PARAM_t *initParam /* [ IN ] Misc chip initialization parameter */
214 ) __attribute__ ((section(".aramtext")));
215
216/****************************************************************************/
217/**
218* @brief Enables the PLL1
219*
220* This function enables the PLL1
221*
222*/
223/****************************************************************************/
224void chipcHw_pll1Enable(uint32_t vcoFreqHz, /* [ IN ] VCO frequency in Hz */
225 chipcHw_SPREAD_SPECTRUM_e ssSupport /* [ IN ] SS status */
226 ) __attribute__ ((section(".aramtext")));
227
228/****************************************************************************/
229/**
230* @brief Enables the PLL2
231*
232* This function enables the PLL2
233*
234*/
235/****************************************************************************/
236void chipcHw_pll2Enable(uint32_t vcoFreqHz /* [ IN ] VCO frequency in Hz */
237 ) __attribute__ ((section(".aramtext")));
238
239/****************************************************************************/
240/**
241* @brief Disable the PLL1
242*
243*/
244/****************************************************************************/
245static inline void chipcHw_pll1Disable(void);
246
247/****************************************************************************/
248/**
249* @brief Disable the PLL2
250*
251*/
252/****************************************************************************/
253static inline void chipcHw_pll2Disable(void);
254
255/****************************************************************************/
256/**
257* @brief Set clock fequency for miscellaneous configurable clocks
258*
259* This function sets clock frequency
260*
261* @return Configured clock frequency in KHz
262*
263*/
264/****************************************************************************/
265chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configurable clock */
266 ) __attribute__ ((section(".aramtext")));
267
268/****************************************************************************/
269/**
270* @brief Set clock fequency for miscellaneous configurable clocks
271*
272* This function sets clock frequency
273*
274* @return Configured clock frequency in Hz
275*
276*/
277/****************************************************************************/
278chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configurable clock */
279 uint32_t freq /* [ IN ] Clock frequency in Hz */
280 ) __attribute__ ((section(".aramtext")));
281
282/****************************************************************************/
283/**
284* @brief Set VPM clock in sync with BUS clock
285*
286* This function does the phase adjustment between VPM and BUS clock
287*
288* @return >= 0 : On success ( # of adjustment required )
289* -1 : On failure
290*/
291/****************************************************************************/
292int chipcHw_vpmPhaseAlign(void);
293
294/****************************************************************************/
295/**
296* @brief Enables core a clock of a certain device
297*
298* This function enables a core clock
299*
300* @return void
301*
302* @note Doesnot affect the bus interface clock
303*/
304/****************************************************************************/
305static inline void chipcHw_setClockEnable(chipcHw_CLOCK_e clock /* [ IN ] Configurable clock */
306 );
307
308/****************************************************************************/
309/**
310* @brief Disabled a core clock of a certain device
311*
312* This function disables a core clock
313*
314* @return void
315*
316* @note Doesnot affect the bus interface clock
317*/
318/****************************************************************************/
319static inline void chipcHw_setClockDisable(chipcHw_CLOCK_e clock /* [ IN ] Configurable clock */
320 );
321
322/****************************************************************************/
323/**
324* @brief Enables bypass clock of a certain device
325*
326* This function enables bypass clock
327*
328* @note Doesnot affect the bus interface clock
329*/
330/****************************************************************************/
331static inline void chipcHw_bypassClockEnable(chipcHw_CLOCK_e clock /* [ IN ] Configurable clock */
332 );
333
334/****************************************************************************/
335/**
336* @brief Disabled bypass clock of a certain device
337*
338* This function disables bypass clock
339*
340* @note Doesnot affect the bus interface clock
341*/
342/****************************************************************************/
343static inline void chipcHw_bypassClockDisable(chipcHw_CLOCK_e clock /* [ IN ] Configurable clock */
344 );
345
346/****************************************************************************/
347/**
348* @brief Get Numeric Chip ID
349*
350* This function returns Chip ID that includes the revison number
351*
352* @return Complete numeric Chip ID
353*
354*/
355/****************************************************************************/
356static inline uint32_t chipcHw_getChipId(void);
357
358/****************************************************************************/
359/**
360* @brief Get Chip Product ID
361*
362* This function returns Chip Product ID
363*
364* @return Chip Product ID
365*/
366/****************************************************************************/
367static inline uint32_t chipcHw_getChipProductId(void);
368
369/****************************************************************************/
370/**
371* @brief Get revision number
372*
373* This function returns revision number of the chip
374*
375* @return Revision number
376*/
377/****************************************************************************/
378static inline chipcHw_REV_NUMBER_e chipcHw_getChipRevisionNumber(void);
379
380/****************************************************************************/
381/**
382* @brief Enables bus interface clock
383*
384* Enables bus interface clock of various device
385*
386* @return void
387*
388* @note use chipcHw_REG_BUS_CLOCK_XXXX
389*/
390/****************************************************************************/
391static inline void chipcHw_busInterfaceClockEnable(uint32_t mask /* [ IN ] Bit map of type chipcHw_REG_BUS_CLOCK_XXXXX */
392 );
393
394/****************************************************************************/
395/**
396* @brief Disables bus interface clock
397*
398* Disables bus interface clock of various device
399*
400* @return void
401*
402* @note use chipcHw_REG_BUS_CLOCK_XXXX
403*/
404/****************************************************************************/
405static inline void chipcHw_busInterfaceClockDisable(uint32_t mask /* [ IN ] Bit map of type chipcHw_REG_BUS_CLOCK_XXXXX */
406 );
407
408/****************************************************************************/
409/**
410* @brief Enables various audio channels
411*
412* Enables audio channel
413*
414* @return void
415*
416* @note use chipcHw_REG_AUDIO_CHANNEL_XXXXXX
417*/
418/****************************************************************************/
419static inline void chipcHw_audioChannelEnable(uint32_t mask /* [ IN ] Bit map of type chipcHw_REG_AUDIO_CHANNEL_XXXXXX */
420 );
421
422/****************************************************************************/
423/**
424* @brief Disables various audio channels
425*
426* Disables audio channel
427*
428* @return void
429*
430* @note use chipcHw_REG_AUDIO_CHANNEL_XXXXXX
431*/
432/****************************************************************************/
433static inline void chipcHw_audioChannelDisable(uint32_t mask /* [ IN ] Bit map of type chipcHw_REG_AUDIO_CHANNEL_XXXXXX */
434 );
435
436/****************************************************************************/
437/**
438* @brief Soft resets devices
439*
440* Soft resets various devices
441*
442* @return void
443*
444* @note use chipcHw_REG_SOFT_RESET_XXXXXX defines
445*/
446/****************************************************************************/
447static inline void chipcHw_softReset(uint64_t mask /* [ IN ] Bit map of type chipcHw_REG_SOFT_RESET_XXXXXX */
448 );
449
450static inline void chipcHw_softResetDisable(uint64_t mask /* [ IN ] Bit map of type chipcHw_REG_SOFT_RESET_XXXXXX */
451 );
452
453static inline void chipcHw_softResetEnable(uint64_t mask /* [ IN ] Bit map of type chipcHw_REG_SOFT_RESET_XXXXXX */
454 );
455
456/****************************************************************************/
457/**
458* @brief Configures misc CHIP functionality
459*
460* Configures CHIP functionality
461*
462* @return void
463*
464* @note use chipcHw_REG_MISC_CTRL_XXXXXX
465*/
466/****************************************************************************/
467static inline void chipcHw_miscControl(uint32_t mask /* [ IN ] Bit map of type chipcHw_REG_MISC_CTRL_XXXXXX */
468 );
469
470static inline void chipcHw_miscControlDisable(uint32_t mask /* [ IN ] Bit map of type chipcHw_REG_MISC_CTRL_XXXXXX */
471 );
472
473static inline void chipcHw_miscControlEnable(uint32_t mask /* [ IN ] Bit map of type chipcHw_REG_MISC_CTRL_XXXXXX */
474 );
475
476/****************************************************************************/
477/**
478* @brief Set OTP options
479*
480* Set OTP options
481*
482* @return void
483*
484* @note use chipcHw_REG_OTP_XXXXXX
485*/
486/****************************************************************************/
487static inline void chipcHw_setOTPOption(uint64_t mask /* [ IN ] Bit map of type chipcHw_REG_OTP_XXXXXX */
488 );
489
490/****************************************************************************/
491/**
492* @brief Get sticky bits
493*
494* @return Sticky bit options of type chipcHw_REG_STICKY_XXXXXX
495*
496*/
497/****************************************************************************/
498static inline uint32_t chipcHw_getStickyBits(void);
499
500/****************************************************************************/
501/**
502* @brief Set sticky bits
503*
504* @return void
505*
506* @note use chipcHw_REG_STICKY_XXXXXX
507*/
508/****************************************************************************/
509static inline void chipcHw_setStickyBits(uint32_t mask /* [ IN ] Bit map of type chipcHw_REG_STICKY_XXXXXX */
510 );
511
512/****************************************************************************/
513/**
514* @brief Clear sticky bits
515*
516* @return void
517*
518* @note use chipcHw_REG_STICKY_XXXXXX
519*/
520/****************************************************************************/
521static inline void chipcHw_clearStickyBits(uint32_t mask /* [ IN ] Bit map of type chipcHw_REG_STICKY_XXXXXX */
522 );
523
524/****************************************************************************/
525/**
526* @brief Get software override strap options
527*
528* Retrieves software override strap options
529*
530* @return Software override strap value
531*
532*/
533/****************************************************************************/
534static inline uint32_t chipcHw_getSoftStraps(void);
535
536/****************************************************************************/
537/**
538* @brief Set software override strap options
539*
540* set software override strap options
541*
542* @return nothing
543*
544*/
545/****************************************************************************/
546static inline void chipcHw_setSoftStraps(uint32_t strapOptions);
547
548/****************************************************************************/
549/**
550* @brief Get pin strap options
551*
552* Retrieves pin strap options
553*
554* @return Pin strap value
555*
556*/
557/****************************************************************************/
558static inline uint32_t chipcHw_getPinStraps(void);
559
560/****************************************************************************/
561/**
562* @brief Get valid pin strap options
563*
564* Retrieves valid pin strap options
565*
566* @return valid Pin strap value
567*
568*/
569/****************************************************************************/
570static inline uint32_t chipcHw_getValidStraps(void);
571
572/****************************************************************************/
573/**
574* @brief Initialize valid pin strap options
575*
576* Retrieves valid pin strap options by copying HW strap options to soft register
577* (if chipcHw_STRAPS_SOFT_OVERRIDE not set)
578*
579* @return nothing
580*
581*/
582/****************************************************************************/
583static inline void chipcHw_initValidStraps(void);
584
585/****************************************************************************/
586/**
587* @brief Get status (enabled/disabled) of bus interface clock
588*
589* This function returns the status of devices' bus interface clock
590*
591* @return Bus interface clock
592*
593*/
594/****************************************************************************/
595static inline uint32_t chipcHw_getBusInterfaceClockStatus(void);
596
597/****************************************************************************/
598/**
599* @brief Get boot device
600*
601* This function returns the device type used in booting the system
602*
603* @return Boot device of type chipcHw_BOOT_DEVICE_e
604*
605*/
606/****************************************************************************/
607static inline chipcHw_BOOT_DEVICE_e chipcHw_getBootDevice(void);
608
609/****************************************************************************/
610/**
611* @brief Get boot mode
612*
613* This function returns the way the system was booted
614*
615* @return Boot mode of type chipcHw_BOOT_MODE_e
616*
617*/
618/****************************************************************************/
619static inline chipcHw_BOOT_MODE_e chipcHw_getBootMode(void);
620
621/****************************************************************************/
622/**
623* @brief Get NAND flash page size
624*
625* This function returns the NAND device page size
626*
627* @return Boot NAND device page size
628*
629*/
630/****************************************************************************/
631static inline chipcHw_NAND_PAGESIZE_e chipcHw_getNandPageSize(void);
632
633/****************************************************************************/
634/**
635* @brief Get NAND flash address cycle configuration
636*
637* This function returns the NAND flash address cycle configuration
638*
639* @return 0 = Do not extra address cycle, 1 = Add extra cycle
640*
641*/
642/****************************************************************************/
643static inline int chipcHw_getNandExtraCycle(void);
644
645/****************************************************************************/
646/**
647* @brief Activates PIF interface
648*
649* This function activates PIF interface by taking control of LCD pins
650*
651* @note
652* When activated, LCD pins will be defined as follows for PIF operation
653*
654* CLD[17:0] = pif_data[17:0]
655* CLD[23:18] = pif_address[5:0]
656* CLPOWER = pif_wr_str
657* CLCP = pif_rd_str
658* CLAC = pif_hat1
659* CLFP = pif_hrdy1
660* CLLP = pif_hat2
661* GPIO[42] = pif_hrdy2
662*
663* In PIF mode, "pif_hrdy2" overrides other shared function for GPIO[42] pin
664*
665*/
666/****************************************************************************/
667static inline void chipcHw_activatePifInterface(void);
668
669/****************************************************************************/
670/**
671* @brief Activates LCD interface
672*
673* This function activates LCD interface
674*
675* @note
676* When activated, LCD pins will be defined as follows
677*
678* CLD[17:0] = LCD data
679* CLD[23:18] = LCD data
680* CLPOWER = LCD power
681* CLCP =
682* CLAC = LCD ack
683* CLFP =
684* CLLP =
685*/
686/****************************************************************************/
687static inline void chipcHw_activateLcdInterface(void);
688
689/****************************************************************************/
690/**
691* @brief Deactivates PIF/LCD interface
692*
693* This function deactivates PIF/LCD interface
694*
695* @note
696* When deactivated LCD pins will be in rti-stated
697*
698*/
699/****************************************************************************/
700static inline void chipcHw_deactivatePifLcdInterface(void);
701
702/****************************************************************************/
703/**
704* @brief Get to know the configuration of GPIO pin
705*
706*/
707/****************************************************************************/
708static inline chipcHw_GPIO_FUNCTION_e chipcHw_getGpioPinFunction(int pin /* GPIO Pin number */
709 );
710
711/****************************************************************************/
712/**
713* @brief Configure GPIO pin function
714*
715*/
716/****************************************************************************/
717static inline void chipcHw_setGpioPinFunction(int pin, /* GPIO Pin number */
718 chipcHw_GPIO_FUNCTION_e func /* Configuration function */
719 );
720
721/****************************************************************************/
722/**
723* @brief Set Pin slew rate
724*
725* This function sets the slew of individual pin
726*
727*/
728/****************************************************************************/
729static inline void chipcHw_setPinSlewRate(uint32_t pin, /* Pin of type chipcHw_PIN_XXXXX */
730 chipcHw_PIN_SLEW_RATE_e slewRate /* Pin slew rate */
731 );
732
733/****************************************************************************/
734/**
735* @brief Set Pin output drive current
736*
737* This function sets output drive current of individual pin
738*
739* Note: Avoid the use of the word 'current' since linux headers define this
740* to be the current task.
741*/
742/****************************************************************************/
743static inline void chipcHw_setPinOutputCurrent(uint32_t pin, /* Pin of type chipcHw_PIN_XXXXX */
744 chipcHw_PIN_CURRENT_STRENGTH_e curr /* Pin current rating */
745 );
746
747/****************************************************************************/
748/**
749* @brief Set Pin pullup register
750*
751* This function sets pullup register of individual pin
752*
753*/
754/****************************************************************************/
755static inline void chipcHw_setPinPullup(uint32_t pin, /* Pin of type chipcHw_PIN_XXXXX */
756 chipcHw_PIN_PULL_e pullup /* Pullup register settings */
757 );
758
759/****************************************************************************/
760/**
761* @brief Set Pin input type
762*
763* This function sets input type of individual Pin
764*
765*/
766/****************************************************************************/
767static inline void chipcHw_setPinInputType(uint32_t pin, /* Pin of type chipcHw_PIN_XXXXX */
768 chipcHw_PIN_INPUTTYPE_e inputType /* Pin input type */
769 );
770
771/****************************************************************************/
772/**
773* @brief Retrieves a string representation of the mux setting for a pin.
774*
775* @return Pointer to a character string.
776*/
777/****************************************************************************/
778
779const char *chipcHw_getGpioPinFunctionStr(int pin);
780
781/****************************************************************************/
782/** @brief issue warmReset
783 */
784/****************************************************************************/
785void chipcHw_reset(uint32_t mask);
786
787/****************************************************************************/
788/** @brief clock reconfigure
789 */
790/****************************************************************************/
791void chipcHw_clockReconfig(uint32_t busHz, uint32_t armRatio, uint32_t vpmRatio,
792 uint32_t ddrRatio);
793
794/****************************************************************************/
795/**
796* @brief Enable Spread Spectrum
797*
798* @note chipcHw_Init() must be called earlier
799*/
800/****************************************************************************/
801static inline void chipcHw_enableSpreadSpectrum(void);
802
803/****************************************************************************/
804/**
805* @brief Disable Spread Spectrum
806*
807*/
808/****************************************************************************/
809static inline void chipcHw_disableSpreadSpectrum(void);
810
811/****************************************************************************/
812/** @brief Checks if software strap is enabled
813 *
814 * @return 1 : When enable
815 * 0 : When disable
816 */
817/****************************************************************************/
818static inline int chipcHw_isSoftwareStrapsEnable(void);
819
820/****************************************************************************/
821/** @brief Enable software strap
822 */
823/****************************************************************************/
824static inline void chipcHw_softwareStrapsEnable(void);
825
826/****************************************************************************/
827/** @brief Disable software strap
828 */
829/****************************************************************************/
830static inline void chipcHw_softwareStrapsDisable(void);
831
832/****************************************************************************/
833/** @brief PLL test enable
834 */
835/****************************************************************************/
836static inline void chipcHw_pllTestEnable(void);
837
838/****************************************************************************/
839/** @brief PLL2 test enable
840 */
841/****************************************************************************/
842static inline void chipcHw_pll2TestEnable(void);
843
844/****************************************************************************/
845/** @brief PLL test disable
846 */
847/****************************************************************************/
848static inline void chipcHw_pllTestDisable(void);
849
850/****************************************************************************/
851/** @brief PLL2 test disable
852 */
853/****************************************************************************/
854static inline void chipcHw_pll2TestDisable(void);
855
856/****************************************************************************/
857/** @brief Get PLL test status
858 */
859/****************************************************************************/
860static inline int chipcHw_isPllTestEnable(void);
861
862/****************************************************************************/
863/** @brief Get PLL2 test status
864 */
865/****************************************************************************/
866static inline int chipcHw_isPll2TestEnable(void);
867
868/****************************************************************************/
869/** @brief PLL test select
870 */
871/****************************************************************************/
872static inline void chipcHw_pllTestSelect(uint32_t val);
873
874/****************************************************************************/
875/** @brief PLL2 test select
876 */
877/****************************************************************************/
878static inline void chipcHw_pll2TestSelect(uint32_t val);
879
880/****************************************************************************/
881/** @brief Get PLL test selected option
882 */
883/****************************************************************************/
884static inline uint8_t chipcHw_getPllTestSelected(void);
885
886/****************************************************************************/
887/** @brief Get PLL2 test selected option
888 */
889/****************************************************************************/
890static inline uint8_t chipcHw_getPll2TestSelected(void);
891
892/****************************************************************************/
893/**
894* @brief Enables DDR SW phase alignment interrupt
895*/
896/****************************************************************************/
897static inline void chipcHw_ddrPhaseAlignInterruptEnable(void);
898
899/****************************************************************************/
900/**
901* @brief Disables DDR SW phase alignment interrupt
902*/
903/****************************************************************************/
904static inline void chipcHw_ddrPhaseAlignInterruptDisable(void);
905
906/****************************************************************************/
907/**
908* @brief Set VPM SW phase alignment interrupt mode
909*
910* This function sets VPM phase alignment interrupt
911*
912*/
913/****************************************************************************/
914static inline void
915chipcHw_vpmPhaseAlignInterruptMode(chipcHw_VPM_HW_PHASE_INTR_e mode);
916
917/****************************************************************************/
918/**
919* @brief Enable DDR phase alignment in software
920*
921*/
922/****************************************************************************/
923static inline void chipcHw_ddrSwPhaseAlignEnable(void);
924
925/****************************************************************************/
926/**
927* @brief Disable DDR phase alignment in software
928*
929*/
930/****************************************************************************/
931static inline void chipcHw_ddrSwPhaseAlignDisable(void);
932
933/****************************************************************************/
934/**
935* @brief Enable DDR phase alignment in hardware
936*
937*/
938/****************************************************************************/
939static inline void chipcHw_ddrHwPhaseAlignEnable(void);
940
941/****************************************************************************/
942/**
943* @brief Disable DDR phase alignment in hardware
944*
945*/
946/****************************************************************************/
947static inline void chipcHw_ddrHwPhaseAlignDisable(void);
948
949/****************************************************************************/
950/**
951* @brief Enable VPM phase alignment in software
952*
953*/
954/****************************************************************************/
955static inline void chipcHw_vpmSwPhaseAlignEnable(void);
956
957/****************************************************************************/
958/**
959* @brief Disable VPM phase alignment in software
960*
961*/
962/****************************************************************************/
963static inline void chipcHw_vpmSwPhaseAlignDisable(void);
964
965/****************************************************************************/
966/**
967* @brief Enable VPM phase alignment in hardware
968*
969*/
970/****************************************************************************/
971static inline void chipcHw_vpmHwPhaseAlignEnable(void);
972
973/****************************************************************************/
974/**
975* @brief Disable VPM phase alignment in hardware
976*
977*/
978/****************************************************************************/
979static inline void chipcHw_vpmHwPhaseAlignDisable(void);
980
981/****************************************************************************/
982/**
983* @brief Set DDR phase alignment margin in hardware
984*
985*/
986/****************************************************************************/
987static inline void chipcHw_setDdrHwPhaseAlignMargin(chipcHw_DDR_HW_PHASE_MARGIN_e margin /* Margin alinging DDR phase */
988 );
989
990/****************************************************************************/
991/**
992* @brief Set VPM phase alignment margin in hardware
993*
994*/
995/****************************************************************************/
996static inline void chipcHw_setVpmHwPhaseAlignMargin(chipcHw_VPM_HW_PHASE_MARGIN_e margin /* Margin alinging VPM phase */
997 );
998
999/****************************************************************************/
1000/**
1001* @brief Checks DDR phase aligned status done by HW
1002*
1003* @return 1: When aligned
1004* 0: When not aligned
1005*/
1006/****************************************************************************/
1007static inline uint32_t chipcHw_isDdrHwPhaseAligned(void);
1008
1009/****************************************************************************/
1010/**
1011* @brief Checks VPM phase aligned status done by HW
1012*
1013* @return 1: When aligned
1014* 0: When not aligned
1015*/
1016/****************************************************************************/
1017static inline uint32_t chipcHw_isVpmHwPhaseAligned(void);
1018
1019/****************************************************************************/
1020/**
1021* @brief Get DDR phase aligned status done by HW
1022*
1023*/
1024/****************************************************************************/
1025static inline uint32_t chipcHw_getDdrHwPhaseAlignStatus(void);
1026
1027/****************************************************************************/
1028/**
1029* @brief Get VPM phase aligned status done by HW
1030*
1031*/
1032/****************************************************************************/
1033static inline uint32_t chipcHw_getVpmHwPhaseAlignStatus(void);
1034
1035/****************************************************************************/
1036/**
1037* @brief Get DDR phase control value
1038*
1039*/
1040/****************************************************************************/
1041static inline uint32_t chipcHw_getDdrPhaseControl(void);
1042
1043/****************************************************************************/
1044/**
1045* @brief Get VPM phase control value
1046*
1047*/
1048/****************************************************************************/
1049static inline uint32_t chipcHw_getVpmPhaseControl(void);
1050
1051/****************************************************************************/
1052/**
1053* @brief DDR phase alignment timeout count
1054*
1055* @note If HW fails to perform the phase alignment, it will trigger
1056* a DDR phase alignment timeout interrupt.
1057*/
1058/****************************************************************************/
1059static inline void chipcHw_ddrHwPhaseAlignTimeout(uint32_t busCycle /* Timeout in bus cycle */
1060 );
1061
1062/****************************************************************************/
1063/**
1064* @brief VPM phase alignment timeout count
1065*
1066* @note If HW fails to perform the phase alignment, it will trigger
1067* a VPM phase alignment timeout interrupt.
1068*/
1069/****************************************************************************/
1070static inline void chipcHw_vpmHwPhaseAlignTimeout(uint32_t busCycle /* Timeout in bus cycle */
1071 );
1072
1073/****************************************************************************/
1074/**
1075* @brief DDR phase alignment timeout interrupt enable
1076*
1077*/
1078/****************************************************************************/
1079static inline void chipcHw_ddrHwPhaseAlignTimeoutInterruptEnable(void);
1080
1081/****************************************************************************/
1082/**
1083* @brief VPM phase alignment timeout interrupt enable
1084*
1085*/
1086/****************************************************************************/
1087static inline void chipcHw_vpmHwPhaseAlignTimeoutInterruptEnable(void);
1088
1089/****************************************************************************/
1090/**
1091* @brief DDR phase alignment timeout interrupt disable
1092*
1093*/
1094/****************************************************************************/
1095static inline void chipcHw_ddrHwPhaseAlignTimeoutInterruptDisable(void);
1096
1097/****************************************************************************/
1098/**
1099* @brief VPM phase alignment timeout interrupt disable
1100*
1101*/
1102/****************************************************************************/
1103static inline void chipcHw_vpmHwPhaseAlignTimeoutInterruptDisable(void);
1104
1105/****************************************************************************/
1106/**
1107* @brief Clear DDR phase alignment timeout interrupt
1108*
1109*/
1110/****************************************************************************/
1111static inline void chipcHw_ddrHwPhaseAlignTimeoutInterruptClear(void);
1112
1113/****************************************************************************/
1114/**
1115* @brief Clear VPM phase alignment timeout interrupt
1116*
1117*/
1118/****************************************************************************/
1119static inline void chipcHw_vpmHwPhaseAlignTimeoutInterruptClear(void);
1120
1121/* ---- Private Constants and Types -------------------------------------- */
1122
1123#endif /* CHIPC_DEF_H */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h
deleted file mode 100644
index 03238c29900..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h
+++ /dev/null
@@ -1,1673 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#ifndef CHIPC_INLINE_H
16#define CHIPC_INLINE_H
17
18/* ---- Include Files ----------------------------------------------------- */
19
20#include <csp/errno.h>
21#include <csp/reg.h>
22#include <mach/csp/chipcHw_reg.h>
23#include <mach/csp/chipcHw_def.h>
24
25/* ---- Private Constants and Types --------------------------------------- */
26typedef enum {
27 chipcHw_OPTYPE_BYPASS, /* Bypass operation */
28 chipcHw_OPTYPE_OUTPUT /* Output operation */
29} chipcHw_OPTYPE_e;
30
31/* ---- Public Constants and Types ---------------------------------------- */
32/* ---- Public Variable Externs ------------------------------------------- */
33/* ---- Public Function Prototypes ---------------------------------------- */
34/* ---- Private Function Prototypes --------------------------------------- */
35static inline void chipcHw_setClock(chipcHw_CLOCK_e clock,
36 chipcHw_OPTYPE_e type, int mode);
37
38/****************************************************************************/
39/**
40* @brief Get Numeric Chip ID
41*
42* This function returns Chip ID that includes the revison number
43*
44* @return Complete numeric Chip ID
45*
46*/
47/****************************************************************************/
48static inline uint32_t chipcHw_getChipId(void)
49{
50 return pChipcHw->ChipId;
51}
52
53/****************************************************************************/
54/**
55* @brief Enable Spread Spectrum
56*
57* @note chipcHw_Init() must be called earlier
58*/
59/****************************************************************************/
60static inline void chipcHw_enableSpreadSpectrum(void)
61{
62 if ((pChipcHw->
63 PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) !=
64 chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) {
65 ddrcReg_PHY_ADDR_CTL_REGP->ssCfg =
66 (0xFFFF << ddrcReg_PHY_ADDR_SS_CFG_NDIV_AMPLITUDE_SHIFT) |
67 (ddrcReg_PHY_ADDR_SS_CFG_MIN_CYCLE_PER_TICK <<
68 ddrcReg_PHY_ADDR_SS_CFG_CYCLE_PER_TICK_SHIFT);
69 ddrcReg_PHY_ADDR_CTL_REGP->ssCtl |=
70 ddrcReg_PHY_ADDR_SS_CTRL_ENABLE;
71 }
72}
73
74/****************************************************************************/
75/**
76* @brief Disable Spread Spectrum
77*
78*/
79/****************************************************************************/
80static inline void chipcHw_disableSpreadSpectrum(void)
81{
82 ddrcReg_PHY_ADDR_CTL_REGP->ssCtl &= ~ddrcReg_PHY_ADDR_SS_CTRL_ENABLE;
83}
84
85/****************************************************************************/
86/**
87* @brief Get Chip Product ID
88*
89* This function returns Chip Product ID
90*
91* @return Chip Product ID
92*/
93/****************************************************************************/
94static inline uint32_t chipcHw_getChipProductId(void)
95{
96 return (pChipcHw->
97 ChipId & chipcHw_REG_CHIPID_BASE_MASK) >>
98 chipcHw_REG_CHIPID_BASE_SHIFT;
99}
100
101/****************************************************************************/
102/**
103* @brief Get revision number
104*
105* This function returns revision number of the chip
106*
107* @return Revision number
108*/
109/****************************************************************************/
110static inline chipcHw_REV_NUMBER_e chipcHw_getChipRevisionNumber(void)
111{
112 return pChipcHw->ChipId & chipcHw_REG_CHIPID_REV_MASK;
113}
114
115/****************************************************************************/
116/**
117* @brief Enables bus interface clock
118*
119* Enables bus interface clock of various device
120*
121* @return void
122*
123* @note use chipcHw_REG_BUS_CLOCK_XXXX for mask
124*/
125/****************************************************************************/
126static inline void chipcHw_busInterfaceClockEnable(uint32_t mask)
127{
128 reg32_modify_or(&pChipcHw->BusIntfClock, mask);
129}
130
131/****************************************************************************/
132/**
133* @brief Disables bus interface clock
134*
135* Disables bus interface clock of various device
136*
137* @return void
138*
139* @note use chipcHw_REG_BUS_CLOCK_XXXX
140*/
141/****************************************************************************/
142static inline void chipcHw_busInterfaceClockDisable(uint32_t mask)
143{
144 reg32_modify_and(&pChipcHw->BusIntfClock, ~mask);
145}
146
147/****************************************************************************/
148/**
149* @brief Get status (enabled/disabled) of bus interface clock
150*
151* This function returns the status of devices' bus interface clock
152*
153* @return Bus interface clock
154*
155*/
156/****************************************************************************/
157static inline uint32_t chipcHw_getBusInterfaceClockStatus(void)
158{
159 return pChipcHw->BusIntfClock;
160}
161
162/****************************************************************************/
163/**
164* @brief Enables various audio channels
165*
166* Enables audio channel
167*
168* @return void
169*
170* @note use chipcHw_REG_AUDIO_CHANNEL_XXXXXX
171*/
172/****************************************************************************/
173static inline void chipcHw_audioChannelEnable(uint32_t mask)
174{
175 reg32_modify_or(&pChipcHw->AudioEnable, mask);
176}
177
178/****************************************************************************/
179/**
180* @brief Disables various audio channels
181*
182* Disables audio channel
183*
184* @return void
185*
186* @note use chipcHw_REG_AUDIO_CHANNEL_XXXXXX
187*/
188/****************************************************************************/
189static inline void chipcHw_audioChannelDisable(uint32_t mask)
190{
191 reg32_modify_and(&pChipcHw->AudioEnable, ~mask);
192}
193
194/****************************************************************************/
195/**
196* @brief Soft resets devices
197*
198* Soft resets various devices
199*
200* @return void
201*
202* @note use chipcHw_REG_SOFT_RESET_XXXXXX defines
203*/
204/****************************************************************************/
205static inline void chipcHw_softReset(uint64_t mask)
206{
207 chipcHw_softResetEnable(mask);
208 chipcHw_softResetDisable(mask);
209}
210
211static inline void chipcHw_softResetDisable(uint64_t mask)
212{
213 uint32_t ctrl1 = (uint32_t) mask;
214 uint32_t ctrl2 = (uint32_t) (mask >> 32);
215
216 /* Deassert module soft reset */
217 REG_LOCAL_IRQ_SAVE;
218 pChipcHw->SoftReset1 ^= ctrl1;
219 pChipcHw->SoftReset2 ^= (ctrl2 & (~chipcHw_REG_SOFT_RESET_UNHOLD_MASK));
220 REG_LOCAL_IRQ_RESTORE;
221}
222
223static inline void chipcHw_softResetEnable(uint64_t mask)
224{
225 uint32_t ctrl1 = (uint32_t) mask;
226 uint32_t ctrl2 = (uint32_t) (mask >> 32);
227 uint32_t unhold = 0;
228
229 REG_LOCAL_IRQ_SAVE;
230 pChipcHw->SoftReset1 |= ctrl1;
231 /* Mask out unhold request bits */
232 pChipcHw->SoftReset2 |= (ctrl2 & (~chipcHw_REG_SOFT_RESET_UNHOLD_MASK));
233
234 /* Process unhold requests */
235 if (ctrl2 & chipcHw_REG_SOFT_RESET_VPM_GLOBAL_UNHOLD) {
236 unhold = chipcHw_REG_SOFT_RESET_VPM_GLOBAL_HOLD;
237 }
238
239 if (ctrl2 & chipcHw_REG_SOFT_RESET_VPM_UNHOLD) {
240 unhold |= chipcHw_REG_SOFT_RESET_VPM_HOLD;
241 }
242
243 if (ctrl2 & chipcHw_REG_SOFT_RESET_ARM_UNHOLD) {
244 unhold |= chipcHw_REG_SOFT_RESET_ARM_HOLD;
245 }
246
247 if (unhold) {
248 /* Make sure unhold request is effective */
249 pChipcHw->SoftReset1 &= ~unhold;
250 }
251 REG_LOCAL_IRQ_RESTORE;
252}
253
254/****************************************************************************/
255/**
256* @brief Configures misc CHIP functionality
257*
258* Configures CHIP functionality
259*
260* @return void
261*
262* @note use chipcHw_REG_MISC_CTRL_XXXXXX
263*/
264/****************************************************************************/
265static inline void chipcHw_miscControl(uint32_t mask)
266{
267 reg32_write(&pChipcHw->MiscCtrl, mask);
268}
269
270static inline void chipcHw_miscControlDisable(uint32_t mask)
271{
272 reg32_modify_and(&pChipcHw->MiscCtrl, ~mask);
273}
274
275static inline void chipcHw_miscControlEnable(uint32_t mask)
276{
277 reg32_modify_or(&pChipcHw->MiscCtrl, mask);
278}
279
280/****************************************************************************/
281/**
282* @brief Set OTP options
283*
284* Set OTP options
285*
286* @return void
287*
288* @note use chipcHw_REG_OTP_XXXXXX
289*/
290/****************************************************************************/
291static inline void chipcHw_setOTPOption(uint64_t mask)
292{
293 uint32_t ctrl1 = (uint32_t) mask;
294 uint32_t ctrl2 = (uint32_t) (mask >> 32);
295
296 reg32_modify_or(&pChipcHw->SoftOTP1, ctrl1);
297 reg32_modify_or(&pChipcHw->SoftOTP2, ctrl2);
298}
299
300/****************************************************************************/
301/**
302* @brief Get sticky bits
303*
304* @return Sticky bit options of type chipcHw_REG_STICKY_XXXXXX
305*
306*/
307/****************************************************************************/
308static inline uint32_t chipcHw_getStickyBits(void)
309{
310 return pChipcHw->Sticky;
311}
312
313/****************************************************************************/
314/**
315* @brief Set sticky bits
316*
317* @return void
318*
319* @note use chipcHw_REG_STICKY_XXXXXX
320*/
321/****************************************************************************/
322static inline void chipcHw_setStickyBits(uint32_t mask)
323{
324 uint32_t bits = 0;
325
326 REG_LOCAL_IRQ_SAVE;
327 if (mask & chipcHw_REG_STICKY_POR_BROM) {
328 bits |= chipcHw_REG_STICKY_POR_BROM;
329 } else {
330 uint32_t sticky;
331 sticky = pChipcHw->Sticky;
332
333 if ((mask & chipcHw_REG_STICKY_BOOT_DONE)
334 && (sticky & chipcHw_REG_STICKY_BOOT_DONE) == 0) {
335 bits |= chipcHw_REG_STICKY_BOOT_DONE;
336 }
337 if ((mask & chipcHw_REG_STICKY_GENERAL_1)
338 && (sticky & chipcHw_REG_STICKY_GENERAL_1) == 0) {
339 bits |= chipcHw_REG_STICKY_GENERAL_1;
340 }
341 if ((mask & chipcHw_REG_STICKY_GENERAL_2)
342 && (sticky & chipcHw_REG_STICKY_GENERAL_2) == 0) {
343 bits |= chipcHw_REG_STICKY_GENERAL_2;
344 }
345 if ((mask & chipcHw_REG_STICKY_GENERAL_3)
346 && (sticky & chipcHw_REG_STICKY_GENERAL_3) == 0) {
347 bits |= chipcHw_REG_STICKY_GENERAL_3;
348 }
349 if ((mask & chipcHw_REG_STICKY_GENERAL_4)
350 && (sticky & chipcHw_REG_STICKY_GENERAL_4) == 0) {
351 bits |= chipcHw_REG_STICKY_GENERAL_4;
352 }
353 if ((mask & chipcHw_REG_STICKY_GENERAL_5)
354 && (sticky & chipcHw_REG_STICKY_GENERAL_5) == 0) {
355 bits |= chipcHw_REG_STICKY_GENERAL_5;
356 }
357 }
358 pChipcHw->Sticky = bits;
359 REG_LOCAL_IRQ_RESTORE;
360}
361
362/****************************************************************************/
363/**
364* @brief Clear sticky bits
365*
366* @return void
367*
368* @note use chipcHw_REG_STICKY_XXXXXX
369*/
370/****************************************************************************/
371static inline void chipcHw_clearStickyBits(uint32_t mask)
372{
373 uint32_t bits = 0;
374
375 REG_LOCAL_IRQ_SAVE;
376 if (mask &
377 (chipcHw_REG_STICKY_BOOT_DONE | chipcHw_REG_STICKY_GENERAL_1 |
378 chipcHw_REG_STICKY_GENERAL_2 | chipcHw_REG_STICKY_GENERAL_3 |
379 chipcHw_REG_STICKY_GENERAL_4 | chipcHw_REG_STICKY_GENERAL_5)) {
380 uint32_t sticky = pChipcHw->Sticky;
381
382 if ((mask & chipcHw_REG_STICKY_BOOT_DONE)
383 && (sticky & chipcHw_REG_STICKY_BOOT_DONE)) {
384 bits = chipcHw_REG_STICKY_BOOT_DONE;
385 mask &= ~chipcHw_REG_STICKY_BOOT_DONE;
386 }
387 if ((mask & chipcHw_REG_STICKY_GENERAL_1)
388 && (sticky & chipcHw_REG_STICKY_GENERAL_1)) {
389 bits |= chipcHw_REG_STICKY_GENERAL_1;
390 mask &= ~chipcHw_REG_STICKY_GENERAL_1;
391 }
392 if ((mask & chipcHw_REG_STICKY_GENERAL_2)
393 && (sticky & chipcHw_REG_STICKY_GENERAL_2)) {
394 bits |= chipcHw_REG_STICKY_GENERAL_2;
395 mask &= ~chipcHw_REG_STICKY_GENERAL_2;
396 }
397 if ((mask & chipcHw_REG_STICKY_GENERAL_3)
398 && (sticky & chipcHw_REG_STICKY_GENERAL_3)) {
399 bits |= chipcHw_REG_STICKY_GENERAL_3;
400 mask &= ~chipcHw_REG_STICKY_GENERAL_3;
401 }
402 if ((mask & chipcHw_REG_STICKY_GENERAL_4)
403 && (sticky & chipcHw_REG_STICKY_GENERAL_4)) {
404 bits |= chipcHw_REG_STICKY_GENERAL_4;
405 mask &= ~chipcHw_REG_STICKY_GENERAL_4;
406 }
407 if ((mask & chipcHw_REG_STICKY_GENERAL_5)
408 && (sticky & chipcHw_REG_STICKY_GENERAL_5)) {
409 bits |= chipcHw_REG_STICKY_GENERAL_5;
410 mask &= ~chipcHw_REG_STICKY_GENERAL_5;
411 }
412 }
413 pChipcHw->Sticky = bits | mask;
414 REG_LOCAL_IRQ_RESTORE;
415}
416
417/****************************************************************************/
418/**
419* @brief Get software strap value
420*
421* Retrieves software strap value
422*
423* @return Software strap value
424*
425*/
426/****************************************************************************/
427static inline uint32_t chipcHw_getSoftStraps(void)
428{
429 return pChipcHw->SoftStraps;
430}
431
432/****************************************************************************/
433/**
434* @brief Set software override strap options
435*
436* set software override strap options
437*
438* @return nothing
439*
440*/
441/****************************************************************************/
442static inline void chipcHw_setSoftStraps(uint32_t strapOptions)
443{
444 reg32_write(&pChipcHw->SoftStraps, strapOptions);
445}
446
447/****************************************************************************/
448/**
449* @brief Get Pin Strap Options
450*
451* This function returns the raw boot strap options
452*
453* @return strap options
454*
455*/
456/****************************************************************************/
457static inline uint32_t chipcHw_getPinStraps(void)
458{
459 return pChipcHw->PinStraps;
460}
461
462/****************************************************************************/
463/**
464* @brief Get Valid Strap Options
465*
466* This function returns the valid raw boot strap options
467*
468* @return strap options
469*
470*/
471/****************************************************************************/
472static inline uint32_t chipcHw_getValidStraps(void)
473{
474 uint32_t softStraps;
475
476 /*
477 ** Always return the SoftStraps - bootROM calls chipcHw_initValidStraps
478 ** which copies HW straps to soft straps if there is no override
479 */
480 softStraps = chipcHw_getSoftStraps();
481
482 return softStraps;
483}
484
485/****************************************************************************/
486/**
487* @brief Initialize valid pin strap options
488*
489* Retrieves valid pin strap options by copying HW strap options to soft register
490* (if chipcHw_STRAPS_SOFT_OVERRIDE not set)
491*
492* @return nothing
493*
494*/
495/****************************************************************************/
496static inline void chipcHw_initValidStraps(void)
497{
498 uint32_t softStraps;
499
500 REG_LOCAL_IRQ_SAVE;
501 softStraps = chipcHw_getSoftStraps();
502
503 if ((softStraps & chipcHw_STRAPS_SOFT_OVERRIDE) == 0) {
504 /* Copy HW straps to software straps */
505 chipcHw_setSoftStraps(chipcHw_getPinStraps());
506 }
507 REG_LOCAL_IRQ_RESTORE;
508}
509
510/****************************************************************************/
511/**
512* @brief Get boot device
513*
514* This function returns the device type used in booting the system
515*
516* @return Boot device of type chipcHw_BOOT_DEVICE
517*
518*/
519/****************************************************************************/
520static inline chipcHw_BOOT_DEVICE_e chipcHw_getBootDevice(void)
521{
522 return chipcHw_getValidStraps() & chipcHw_STRAPS_BOOT_DEVICE_MASK;
523}
524
525/****************************************************************************/
526/**
527* @brief Get boot mode
528*
529* This function returns the way the system was booted
530*
531* @return Boot mode of type chipcHw_BOOT_MODE
532*
533*/
534/****************************************************************************/
535static inline chipcHw_BOOT_MODE_e chipcHw_getBootMode(void)
536{
537 return chipcHw_getValidStraps() & chipcHw_STRAPS_BOOT_MODE_MASK;
538}
539
540/****************************************************************************/
541/**
542* @brief Get NAND flash page size
543*
544* This function returns the NAND device page size
545*
546* @return Boot NAND device page size
547*
548*/
549/****************************************************************************/
550static inline chipcHw_NAND_PAGESIZE_e chipcHw_getNandPageSize(void)
551{
552 return chipcHw_getValidStraps() & chipcHw_STRAPS_NAND_PAGESIZE_MASK;
553}
554
555/****************************************************************************/
556/**
557* @brief Get NAND flash address cycle configuration
558*
559* This function returns the NAND flash address cycle configuration
560*
561* @return 0 = Do not extra address cycle, 1 = Add extra cycle
562*
563*/
564/****************************************************************************/
565static inline int chipcHw_getNandExtraCycle(void)
566{
567 if (chipcHw_getValidStraps() & chipcHw_STRAPS_NAND_EXTRA_CYCLE) {
568 return 1;
569 } else {
570 return 0;
571 }
572}
573
574/****************************************************************************/
575/**
576* @brief Activates PIF interface
577*
578* This function activates PIF interface by taking control of LCD pins
579*
580* @note
581* When activated, LCD pins will be defined as follows for PIF operation
582*
583* CLD[17:0] = pif_data[17:0]
584* CLD[23:18] = pif_address[5:0]
585* CLPOWER = pif_wr_str
586* CLCP = pif_rd_str
587* CLAC = pif_hat1
588* CLFP = pif_hrdy1
589* CLLP = pif_hat2
590* GPIO[42] = pif_hrdy2
591*
592* In PIF mode, "pif_hrdy2" overrides other shared function for GPIO[42] pin
593*
594*/
595/****************************************************************************/
596static inline void chipcHw_activatePifInterface(void)
597{
598 reg32_write(&pChipcHw->LcdPifMode, chipcHw_REG_PIF_PIN_ENABLE);
599}
600
601/****************************************************************************/
602/**
603* @brief Activates LCD interface
604*
605* This function activates LCD interface
606*
607* @note
608* When activated, LCD pins will be defined as follows
609*
610* CLD[17:0] = LCD data
611* CLD[23:18] = LCD data
612* CLPOWER = LCD power
613* CLCP =
614* CLAC = LCD ack
615* CLFP =
616* CLLP =
617*/
618/****************************************************************************/
619static inline void chipcHw_activateLcdInterface(void)
620{
621 reg32_write(&pChipcHw->LcdPifMode, chipcHw_REG_LCD_PIN_ENABLE);
622}
623
624/****************************************************************************/
625/**
626* @brief Deactivates PIF/LCD interface
627*
628* This function deactivates PIF/LCD interface
629*
630* @note
631* When deactivated LCD pins will be in rti-stated
632*
633*/
634/****************************************************************************/
635static inline void chipcHw_deactivatePifLcdInterface(void)
636{
637 reg32_write(&pChipcHw->LcdPifMode, 0);
638}
639
640/****************************************************************************/
641/**
642* @brief Select GE2
643*
644* This function select GE2 as the graphic engine
645*
646*/
647/****************************************************************************/
648static inline void chipcHw_selectGE2(void)
649{
650 reg32_modify_and(&pChipcHw->MiscCtrl, ~chipcHw_REG_MISC_CTRL_GE_SEL);
651}
652
653/****************************************************************************/
654/**
655* @brief Select GE3
656*
657* This function select GE3 as the graphic engine
658*
659*/
660/****************************************************************************/
661static inline void chipcHw_selectGE3(void)
662{
663 reg32_modify_or(&pChipcHw->MiscCtrl, chipcHw_REG_MISC_CTRL_GE_SEL);
664}
665
666/****************************************************************************/
667/**
668* @brief Get to know the configuration of GPIO pin
669*
670*/
671/****************************************************************************/
672static inline chipcHw_GPIO_FUNCTION_e chipcHw_getGpioPinFunction(int pin)
673{
674 return (*((uint32_t *) chipcHw_REG_GPIO_MUX(pin)) &
675 (chipcHw_REG_GPIO_MUX_MASK <<
676 chipcHw_REG_GPIO_MUX_POSITION(pin))) >>
677 chipcHw_REG_GPIO_MUX_POSITION(pin);
678}
679
680/****************************************************************************/
681/**
682* @brief Configure GPIO pin function
683*
684*/
685/****************************************************************************/
686static inline void chipcHw_setGpioPinFunction(int pin,
687 chipcHw_GPIO_FUNCTION_e func)
688{
689 REG_LOCAL_IRQ_SAVE;
690 *((uint32_t *) chipcHw_REG_GPIO_MUX(pin)) &=
691 ~(chipcHw_REG_GPIO_MUX_MASK << chipcHw_REG_GPIO_MUX_POSITION(pin));
692 *((uint32_t *) chipcHw_REG_GPIO_MUX(pin)) |=
693 func << chipcHw_REG_GPIO_MUX_POSITION(pin);
694 REG_LOCAL_IRQ_RESTORE;
695}
696
697/****************************************************************************/
698/**
699* @brief Set Pin slew rate
700*
701* This function sets the slew of individual pin
702*
703*/
704/****************************************************************************/
705static inline void chipcHw_setPinSlewRate(uint32_t pin,
706 chipcHw_PIN_SLEW_RATE_e slewRate)
707{
708 REG_LOCAL_IRQ_SAVE;
709 *((uint32_t *) chipcHw_REG_SLEW_RATE(pin)) &=
710 ~(chipcHw_REG_SLEW_RATE_MASK <<
711 chipcHw_REG_SLEW_RATE_POSITION(pin));
712 *((uint32_t *) chipcHw_REG_SLEW_RATE(pin)) |=
713 (uint32_t) slewRate << chipcHw_REG_SLEW_RATE_POSITION(pin);
714 REG_LOCAL_IRQ_RESTORE;
715}
716
717/****************************************************************************/
718/**
719* @brief Set Pin output drive current
720*
721* This function sets output drive current of individual pin
722*
723* Note: Avoid the use of the word 'current' since linux headers define this
724* to be the current task.
725*/
726/****************************************************************************/
727static inline void chipcHw_setPinOutputCurrent(uint32_t pin,
728 chipcHw_PIN_CURRENT_STRENGTH_e
729 curr)
730{
731 REG_LOCAL_IRQ_SAVE;
732 *((uint32_t *) chipcHw_REG_CURRENT(pin)) &=
733 ~(chipcHw_REG_CURRENT_MASK << chipcHw_REG_CURRENT_POSITION(pin));
734 *((uint32_t *) chipcHw_REG_CURRENT(pin)) |=
735 (uint32_t) curr << chipcHw_REG_CURRENT_POSITION(pin);
736 REG_LOCAL_IRQ_RESTORE;
737}
738
739/****************************************************************************/
740/**
741* @brief Set Pin pullup register
742*
743* This function sets pullup register of individual pin
744*
745*/
746/****************************************************************************/
747static inline void chipcHw_setPinPullup(uint32_t pin, chipcHw_PIN_PULL_e pullup)
748{
749 REG_LOCAL_IRQ_SAVE;
750 *((uint32_t *) chipcHw_REG_PULLUP(pin)) &=
751 ~(chipcHw_REG_PULLUP_MASK << chipcHw_REG_PULLUP_POSITION(pin));
752 *((uint32_t *) chipcHw_REG_PULLUP(pin)) |=
753 (uint32_t) pullup << chipcHw_REG_PULLUP_POSITION(pin);
754 REG_LOCAL_IRQ_RESTORE;
755}
756
757/****************************************************************************/
758/**
759* @brief Set Pin input type
760*
761* This function sets input type of individual pin
762*
763*/
764/****************************************************************************/
765static inline void chipcHw_setPinInputType(uint32_t pin,
766 chipcHw_PIN_INPUTTYPE_e inputType)
767{
768 REG_LOCAL_IRQ_SAVE;
769 *((uint32_t *) chipcHw_REG_INPUTTYPE(pin)) &=
770 ~(chipcHw_REG_INPUTTYPE_MASK <<
771 chipcHw_REG_INPUTTYPE_POSITION(pin));
772 *((uint32_t *) chipcHw_REG_INPUTTYPE(pin)) |=
773 (uint32_t) inputType << chipcHw_REG_INPUTTYPE_POSITION(pin);
774 REG_LOCAL_IRQ_RESTORE;
775}
776
777/****************************************************************************/
778/**
779* @brief Power up the USB PHY
780*
781* This function powers up the USB PHY
782*
783*/
784/****************************************************************************/
785static inline void chipcHw_powerUpUsbPhy(void)
786{
787 reg32_modify_and(&pChipcHw->MiscCtrl,
788 chipcHw_REG_MISC_CTRL_USB_POWERON);
789}
790
791/****************************************************************************/
792/**
793* @brief Power down the USB PHY
794*
795* This function powers down the USB PHY
796*
797*/
798/****************************************************************************/
799static inline void chipcHw_powerDownUsbPhy(void)
800{
801 reg32_modify_or(&pChipcHw->MiscCtrl,
802 chipcHw_REG_MISC_CTRL_USB_POWEROFF);
803}
804
805/****************************************************************************/
806/**
807* @brief Set the 2nd USB as host
808*
809* This function sets the 2nd USB as host
810*
811*/
812/****************************************************************************/
813static inline void chipcHw_setUsbHost(void)
814{
815 reg32_modify_or(&pChipcHw->MiscCtrl,
816 chipcHw_REG_MISC_CTRL_USB_MODE_HOST);
817}
818
819/****************************************************************************/
820/**
821* @brief Set the 2nd USB as device
822*
823* This function sets the 2nd USB as device
824*
825*/
826/****************************************************************************/
827static inline void chipcHw_setUsbDevice(void)
828{
829 reg32_modify_and(&pChipcHw->MiscCtrl,
830 chipcHw_REG_MISC_CTRL_USB_MODE_DEVICE);
831}
832
833/****************************************************************************/
834/**
835* @brief Lower layer function to enable/disable a clock of a certain device
836*
837* This function enables/disables a core clock
838*
839*/
840/****************************************************************************/
841static inline void chipcHw_setClock(chipcHw_CLOCK_e clock,
842 chipcHw_OPTYPE_e type, int mode)
843{
844 volatile uint32_t *pPLLReg = (uint32_t *) 0x0;
845 volatile uint32_t *pClockCtrl = (uint32_t *) 0x0;
846
847 switch (clock) {
848 case chipcHw_CLOCK_DDR:
849 pPLLReg = &pChipcHw->DDRClock;
850 break;
851 case chipcHw_CLOCK_ARM:
852 pPLLReg = &pChipcHw->ARMClock;
853 break;
854 case chipcHw_CLOCK_ESW:
855 pPLLReg = &pChipcHw->ESWClock;
856 break;
857 case chipcHw_CLOCK_VPM:
858 pPLLReg = &pChipcHw->VPMClock;
859 break;
860 case chipcHw_CLOCK_ESW125:
861 pPLLReg = &pChipcHw->ESW125Clock;
862 break;
863 case chipcHw_CLOCK_UART:
864 pPLLReg = &pChipcHw->UARTClock;
865 break;
866 case chipcHw_CLOCK_SDIO0:
867 pPLLReg = &pChipcHw->SDIO0Clock;
868 break;
869 case chipcHw_CLOCK_SDIO1:
870 pPLLReg = &pChipcHw->SDIO1Clock;
871 break;
872 case chipcHw_CLOCK_SPI:
873 pPLLReg = &pChipcHw->SPIClock;
874 break;
875 case chipcHw_CLOCK_ETM:
876 pPLLReg = &pChipcHw->ETMClock;
877 break;
878 case chipcHw_CLOCK_USB:
879 pPLLReg = &pChipcHw->USBClock;
880 if (type == chipcHw_OPTYPE_OUTPUT) {
881 if (mode) {
882 reg32_modify_and(pPLLReg,
883 ~chipcHw_REG_PLL_CLOCK_POWER_DOWN);
884 } else {
885 reg32_modify_or(pPLLReg,
886 chipcHw_REG_PLL_CLOCK_POWER_DOWN);
887 }
888 }
889 break;
890 case chipcHw_CLOCK_LCD:
891 pPLLReg = &pChipcHw->LCDClock;
892 if (type == chipcHw_OPTYPE_OUTPUT) {
893 if (mode) {
894 reg32_modify_and(pPLLReg,
895 ~chipcHw_REG_PLL_CLOCK_POWER_DOWN);
896 } else {
897 reg32_modify_or(pPLLReg,
898 chipcHw_REG_PLL_CLOCK_POWER_DOWN);
899 }
900 }
901 break;
902 case chipcHw_CLOCK_APM:
903 pPLLReg = &pChipcHw->APMClock;
904 if (type == chipcHw_OPTYPE_OUTPUT) {
905 if (mode) {
906 reg32_modify_and(pPLLReg,
907 ~chipcHw_REG_PLL_CLOCK_POWER_DOWN);
908 } else {
909 reg32_modify_or(pPLLReg,
910 chipcHw_REG_PLL_CLOCK_POWER_DOWN);
911 }
912 }
913 break;
914 case chipcHw_CLOCK_BUS:
915 pClockCtrl = &pChipcHw->ACLKClock;
916 break;
917 case chipcHw_CLOCK_OTP:
918 pClockCtrl = &pChipcHw->OTPClock;
919 break;
920 case chipcHw_CLOCK_I2C:
921 pClockCtrl = &pChipcHw->I2CClock;
922 break;
923 case chipcHw_CLOCK_I2S0:
924 pClockCtrl = &pChipcHw->I2S0Clock;
925 break;
926 case chipcHw_CLOCK_RTBUS:
927 pClockCtrl = &pChipcHw->RTBUSClock;
928 break;
929 case chipcHw_CLOCK_APM100:
930 pClockCtrl = &pChipcHw->APM100Clock;
931 break;
932 case chipcHw_CLOCK_TSC:
933 pClockCtrl = &pChipcHw->TSCClock;
934 break;
935 case chipcHw_CLOCK_LED:
936 pClockCtrl = &pChipcHw->LEDClock;
937 break;
938 case chipcHw_CLOCK_I2S1:
939 pClockCtrl = &pChipcHw->I2S1Clock;
940 break;
941 }
942
943 if (pPLLReg) {
944 switch (type) {
945 case chipcHw_OPTYPE_OUTPUT:
946 /* PLL clock output enable/disable */
947 if (mode) {
948 if (clock == chipcHw_CLOCK_DDR) {
949 /* DDR clock enable is inverted */
950 reg32_modify_and(pPLLReg,
951 ~chipcHw_REG_PLL_CLOCK_OUTPUT_ENABLE);
952 } else {
953 reg32_modify_or(pPLLReg,
954 chipcHw_REG_PLL_CLOCK_OUTPUT_ENABLE);
955 }
956 } else {
957 if (clock == chipcHw_CLOCK_DDR) {
958 /* DDR clock disable is inverted */
959 reg32_modify_or(pPLLReg,
960 chipcHw_REG_PLL_CLOCK_OUTPUT_ENABLE);
961 } else {
962 reg32_modify_and(pPLLReg,
963 ~chipcHw_REG_PLL_CLOCK_OUTPUT_ENABLE);
964 }
965 }
966 break;
967 case chipcHw_OPTYPE_BYPASS:
968 /* PLL clock bypass enable/disable */
969 if (mode) {
970 reg32_modify_or(pPLLReg,
971 chipcHw_REG_PLL_CLOCK_BYPASS_SELECT);
972 } else {
973 reg32_modify_and(pPLLReg,
974 ~chipcHw_REG_PLL_CLOCK_BYPASS_SELECT);
975 }
976 break;
977 }
978 } else if (pClockCtrl) {
979 switch (type) {
980 case chipcHw_OPTYPE_OUTPUT:
981 if (mode) {
982 reg32_modify_or(pClockCtrl,
983 chipcHw_REG_DIV_CLOCK_OUTPUT_ENABLE);
984 } else {
985 reg32_modify_and(pClockCtrl,
986 ~chipcHw_REG_DIV_CLOCK_OUTPUT_ENABLE);
987 }
988 break;
989 case chipcHw_OPTYPE_BYPASS:
990 if (mode) {
991 reg32_modify_or(pClockCtrl,
992 chipcHw_REG_DIV_CLOCK_BYPASS_SELECT);
993 } else {
994 reg32_modify_and(pClockCtrl,
995 ~chipcHw_REG_DIV_CLOCK_BYPASS_SELECT);
996 }
997 break;
998 }
999 }
1000}
1001
1002/****************************************************************************/
1003/**
1004* @brief Disables a core clock of a certain device
1005*
1006* This function disables a core clock
1007*
1008* @note no change in power consumption
1009*/
1010/****************************************************************************/
1011static inline void chipcHw_setClockDisable(chipcHw_CLOCK_e clock)
1012{
1013
1014 /* Disable output of the clock */
1015 chipcHw_setClock(clock, chipcHw_OPTYPE_OUTPUT, 0);
1016}
1017
1018/****************************************************************************/
1019/**
1020* @brief Enable a core clock of a certain device
1021*
1022* This function enables a core clock
1023*
1024* @note no change in power consumption
1025*/
1026/****************************************************************************/
1027static inline void chipcHw_setClockEnable(chipcHw_CLOCK_e clock)
1028{
1029
1030 /* Enable output of the clock */
1031 chipcHw_setClock(clock, chipcHw_OPTYPE_OUTPUT, 1);
1032}
1033
1034/****************************************************************************/
1035/**
1036* @brief Enables bypass clock of a certain device
1037*
1038* This function enables bypass clock
1039*
1040* @note Doesnot affect the bus interface clock
1041*/
1042/****************************************************************************/
1043static inline void chipcHw_bypassClockEnable(chipcHw_CLOCK_e clock)
1044{
1045 /* Enable bypass clock */
1046 chipcHw_setClock(clock, chipcHw_OPTYPE_BYPASS, 1);
1047}
1048
1049/****************************************************************************/
1050/**
1051* @brief Disabled bypass clock of a certain device
1052*
1053* This function disables bypass clock
1054*
1055* @note Doesnot affect the bus interface clock
1056*/
1057/****************************************************************************/
1058static inline void chipcHw_bypassClockDisable(chipcHw_CLOCK_e clock)
1059{
1060 /* Disable bypass clock */
1061 chipcHw_setClock(clock, chipcHw_OPTYPE_BYPASS, 0);
1062
1063}
1064
1065/****************************************************************************/
1066/** @brief Checks if software strap is enabled
1067 *
1068 * @return 1 : When enable
1069 * 0 : When disable
1070 */
1071/****************************************************************************/
1072static inline int chipcHw_isSoftwareStrapsEnable(void)
1073{
1074 return pChipcHw->SoftStraps & 0x00000001;
1075}
1076
1077/****************************************************************************/
1078/** @brief Enable software strap
1079 */
1080/****************************************************************************/
1081static inline void chipcHw_softwareStrapsEnable(void)
1082{
1083 reg32_modify_or(&pChipcHw->SoftStraps, 0x00000001);
1084}
1085
1086/****************************************************************************/
1087/** @brief Disable software strap
1088 */
1089/****************************************************************************/
1090static inline void chipcHw_softwareStrapsDisable(void)
1091{
1092 reg32_modify_and(&pChipcHw->SoftStraps, (~0x00000001));
1093}
1094
1095/****************************************************************************/
1096/** @brief PLL test enable
1097 */
1098/****************************************************************************/
1099static inline void chipcHw_pllTestEnable(void)
1100{
1101 reg32_modify_or(&pChipcHw->PLLConfig,
1102 chipcHw_REG_PLL_CONFIG_TEST_ENABLE);
1103}
1104
1105/****************************************************************************/
1106/** @brief PLL2 test enable
1107 */
1108/****************************************************************************/
1109static inline void chipcHw_pll2TestEnable(void)
1110{
1111 reg32_modify_or(&pChipcHw->PLLConfig2,
1112 chipcHw_REG_PLL_CONFIG_TEST_ENABLE);
1113}
1114
1115/****************************************************************************/
1116/** @brief PLL test disable
1117 */
1118/****************************************************************************/
1119static inline void chipcHw_pllTestDisable(void)
1120{
1121 reg32_modify_and(&pChipcHw->PLLConfig,
1122 ~chipcHw_REG_PLL_CONFIG_TEST_ENABLE);
1123}
1124
1125/****************************************************************************/
1126/** @brief PLL2 test disable
1127 */
1128/****************************************************************************/
1129static inline void chipcHw_pll2TestDisable(void)
1130{
1131 reg32_modify_and(&pChipcHw->PLLConfig2,
1132 ~chipcHw_REG_PLL_CONFIG_TEST_ENABLE);
1133}
1134
1135/****************************************************************************/
1136/** @brief Get PLL test status
1137 */
1138/****************************************************************************/
1139static inline int chipcHw_isPllTestEnable(void)
1140{
1141 return pChipcHw->PLLConfig & chipcHw_REG_PLL_CONFIG_TEST_ENABLE;
1142}
1143
1144/****************************************************************************/
1145/** @brief Get PLL2 test status
1146 */
1147/****************************************************************************/
1148static inline int chipcHw_isPll2TestEnable(void)
1149{
1150 return pChipcHw->PLLConfig2 & chipcHw_REG_PLL_CONFIG_TEST_ENABLE;
1151}
1152
1153/****************************************************************************/
1154/** @brief PLL test select
1155 */
1156/****************************************************************************/
1157static inline void chipcHw_pllTestSelect(uint32_t val)
1158{
1159 REG_LOCAL_IRQ_SAVE;
1160 pChipcHw->PLLConfig &= ~chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK;
1161 pChipcHw->PLLConfig |=
1162 (val) << chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT;
1163 REG_LOCAL_IRQ_RESTORE;
1164}
1165
1166/****************************************************************************/
1167/** @brief PLL2 test select
1168 */
1169/****************************************************************************/
1170static inline void chipcHw_pll2TestSelect(uint32_t val)
1171{
1172
1173 REG_LOCAL_IRQ_SAVE;
1174 pChipcHw->PLLConfig2 &= ~chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK;
1175 pChipcHw->PLLConfig2 |=
1176 (val) << chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT;
1177 REG_LOCAL_IRQ_RESTORE;
1178}
1179
1180/****************************************************************************/
1181/** @brief Get PLL test selected option
1182 */
1183/****************************************************************************/
1184static inline uint8_t chipcHw_getPllTestSelected(void)
1185{
1186 return (uint8_t) ((pChipcHw->
1187 PLLConfig & chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK)
1188 >> chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT);
1189}
1190
1191/****************************************************************************/
1192/** @brief Get PLL2 test selected option
1193 */
1194/****************************************************************************/
1195static inline uint8_t chipcHw_getPll2TestSelected(void)
1196{
1197 return (uint8_t) ((pChipcHw->
1198 PLLConfig2 & chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK)
1199 >> chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT);
1200}
1201
1202/****************************************************************************/
1203/**
1204* @brief Disable the PLL1
1205*
1206*/
1207/****************************************************************************/
1208static inline void chipcHw_pll1Disable(void)
1209{
1210 REG_LOCAL_IRQ_SAVE;
1211 pChipcHw->PLLConfig |= chipcHw_REG_PLL_CONFIG_POWER_DOWN;
1212 REG_LOCAL_IRQ_RESTORE;
1213}
1214
1215/****************************************************************************/
1216/**
1217* @brief Disable the PLL2
1218*
1219*/
1220/****************************************************************************/
1221static inline void chipcHw_pll2Disable(void)
1222{
1223 REG_LOCAL_IRQ_SAVE;
1224 pChipcHw->PLLConfig2 |= chipcHw_REG_PLL_CONFIG_POWER_DOWN;
1225 REG_LOCAL_IRQ_RESTORE;
1226}
1227
1228/****************************************************************************/
1229/**
1230* @brief Enables DDR SW phase alignment interrupt
1231*/
1232/****************************************************************************/
1233static inline void chipcHw_ddrPhaseAlignInterruptEnable(void)
1234{
1235 REG_LOCAL_IRQ_SAVE;
1236 pChipcHw->Spare1 |= chipcHw_REG_SPARE1_DDR_PHASE_INTR_ENABLE;
1237 REG_LOCAL_IRQ_RESTORE;
1238}
1239
1240/****************************************************************************/
1241/**
1242* @brief Disables DDR SW phase alignment interrupt
1243*/
1244/****************************************************************************/
1245static inline void chipcHw_ddrPhaseAlignInterruptDisable(void)
1246{
1247 REG_LOCAL_IRQ_SAVE;
1248 pChipcHw->Spare1 &= ~chipcHw_REG_SPARE1_DDR_PHASE_INTR_ENABLE;
1249 REG_LOCAL_IRQ_RESTORE;
1250}
1251
1252/****************************************************************************/
1253/**
1254* @brief Set VPM SW phase alignment interrupt mode
1255*
1256* This function sets VPM phase alignment interrupt
1257*/
1258/****************************************************************************/
1259static inline void
1260chipcHw_vpmPhaseAlignInterruptMode(chipcHw_VPM_HW_PHASE_INTR_e mode)
1261{
1262 REG_LOCAL_IRQ_SAVE;
1263 if (mode == chipcHw_VPM_HW_PHASE_INTR_DISABLE) {
1264 pChipcHw->Spare1 &= ~chipcHw_REG_SPARE1_VPM_PHASE_INTR_ENABLE;
1265 } else {
1266 pChipcHw->Spare1 |= chipcHw_REG_SPARE1_VPM_PHASE_INTR_ENABLE;
1267 }
1268 pChipcHw->VPMPhaseCtrl2 =
1269 (pChipcHw->
1270 VPMPhaseCtrl2 & ~(chipcHw_REG_VPM_INTR_SELECT_MASK <<
1271 chipcHw_REG_VPM_INTR_SELECT_SHIFT)) | mode;
1272 REG_LOCAL_IRQ_RESTORE;
1273}
1274
1275/****************************************************************************/
1276/**
1277* @brief Enable DDR phase alignment in software
1278*
1279*/
1280/****************************************************************************/
1281static inline void chipcHw_ddrSwPhaseAlignEnable(void)
1282{
1283 REG_LOCAL_IRQ_SAVE;
1284 pChipcHw->DDRPhaseCtrl1 |= chipcHw_REG_DDR_SW_PHASE_CTRL_ENABLE;
1285 REG_LOCAL_IRQ_RESTORE;
1286}
1287
1288/****************************************************************************/
1289/**
1290* @brief Disable DDR phase alignment in software
1291*
1292*/
1293/****************************************************************************/
1294static inline void chipcHw_ddrSwPhaseAlignDisable(void)
1295{
1296 REG_LOCAL_IRQ_SAVE;
1297 pChipcHw->DDRPhaseCtrl1 &= ~chipcHw_REG_DDR_SW_PHASE_CTRL_ENABLE;
1298 REG_LOCAL_IRQ_RESTORE;
1299}
1300
1301/****************************************************************************/
1302/**
1303* @brief Enable DDR phase alignment in hardware
1304*
1305*/
1306/****************************************************************************/
1307static inline void chipcHw_ddrHwPhaseAlignEnable(void)
1308{
1309 REG_LOCAL_IRQ_SAVE;
1310 pChipcHw->DDRPhaseCtrl1 |= chipcHw_REG_DDR_HW_PHASE_CTRL_ENABLE;
1311 REG_LOCAL_IRQ_RESTORE;
1312}
1313
1314/****************************************************************************/
1315/**
1316* @brief Disable DDR phase alignment in hardware
1317*
1318*/
1319/****************************************************************************/
1320static inline void chipcHw_ddrHwPhaseAlignDisable(void)
1321{
1322 REG_LOCAL_IRQ_SAVE;
1323 pChipcHw->DDRPhaseCtrl1 &= ~chipcHw_REG_DDR_HW_PHASE_CTRL_ENABLE;
1324 REG_LOCAL_IRQ_RESTORE;
1325}
1326
1327/****************************************************************************/
1328/**
1329* @brief Enable VPM phase alignment in software
1330*
1331*/
1332/****************************************************************************/
1333static inline void chipcHw_vpmSwPhaseAlignEnable(void)
1334{
1335 REG_LOCAL_IRQ_SAVE;
1336 pChipcHw->VPMPhaseCtrl1 |= chipcHw_REG_VPM_SW_PHASE_CTRL_ENABLE;
1337 REG_LOCAL_IRQ_RESTORE;
1338}
1339
1340/****************************************************************************/
1341/**
1342* @brief Disable VPM phase alignment in software
1343*
1344*/
1345/****************************************************************************/
1346static inline void chipcHw_vpmSwPhaseAlignDisable(void)
1347{
1348 REG_LOCAL_IRQ_SAVE;
1349 pChipcHw->VPMPhaseCtrl1 &= ~chipcHw_REG_VPM_SW_PHASE_CTRL_ENABLE;
1350 REG_LOCAL_IRQ_RESTORE;
1351}
1352
1353/****************************************************************************/
1354/**
1355* @brief Enable VPM phase alignment in hardware
1356*
1357*/
1358/****************************************************************************/
1359static inline void chipcHw_vpmHwPhaseAlignEnable(void)
1360{
1361 REG_LOCAL_IRQ_SAVE;
1362 pChipcHw->VPMPhaseCtrl1 |= chipcHw_REG_VPM_HW_PHASE_CTRL_ENABLE;
1363 REG_LOCAL_IRQ_RESTORE;
1364}
1365
1366/****************************************************************************/
1367/**
1368* @brief Disable VPM phase alignment in hardware
1369*
1370*/
1371/****************************************************************************/
1372static inline void chipcHw_vpmHwPhaseAlignDisable(void)
1373{
1374 REG_LOCAL_IRQ_SAVE;
1375 pChipcHw->VPMPhaseCtrl1 &= ~chipcHw_REG_VPM_HW_PHASE_CTRL_ENABLE;
1376 REG_LOCAL_IRQ_RESTORE;
1377}
1378
1379/****************************************************************************/
1380/**
1381* @brief Set DDR phase alignment margin in hardware
1382*
1383*/
1384/****************************************************************************/
1385static inline void
1386chipcHw_setDdrHwPhaseAlignMargin(chipcHw_DDR_HW_PHASE_MARGIN_e margin)
1387{
1388 uint32_t ge = 0;
1389 uint32_t le = 0;
1390
1391 switch (margin) {
1392 case chipcHw_DDR_HW_PHASE_MARGIN_STRICT:
1393 ge = 0x0F;
1394 le = 0x0F;
1395 break;
1396 case chipcHw_DDR_HW_PHASE_MARGIN_MEDIUM:
1397 ge = 0x03;
1398 le = 0x3F;
1399 break;
1400 case chipcHw_DDR_HW_PHASE_MARGIN_WIDE:
1401 ge = 0x01;
1402 le = 0x7F;
1403 break;
1404 }
1405
1406 {
1407 REG_LOCAL_IRQ_SAVE;
1408
1409 pChipcHw->DDRPhaseCtrl1 &=
1410 ~((chipcHw_REG_DDR_PHASE_VALUE_GE_MASK <<
1411 chipcHw_REG_DDR_PHASE_VALUE_GE_SHIFT)
1412 || (chipcHw_REG_DDR_PHASE_VALUE_LE_MASK <<
1413 chipcHw_REG_DDR_PHASE_VALUE_LE_SHIFT));
1414
1415 pChipcHw->DDRPhaseCtrl1 |=
1416 ((ge << chipcHw_REG_DDR_PHASE_VALUE_GE_SHIFT)
1417 || (le << chipcHw_REG_DDR_PHASE_VALUE_LE_SHIFT));
1418
1419 REG_LOCAL_IRQ_RESTORE;
1420 }
1421}
1422
1423/****************************************************************************/
1424/**
1425* @brief Set VPM phase alignment margin in hardware
1426*
1427*/
1428/****************************************************************************/
1429static inline void
1430chipcHw_setVpmHwPhaseAlignMargin(chipcHw_VPM_HW_PHASE_MARGIN_e margin)
1431{
1432 uint32_t ge = 0;
1433 uint32_t le = 0;
1434
1435 switch (margin) {
1436 case chipcHw_VPM_HW_PHASE_MARGIN_STRICT:
1437 ge = 0x0F;
1438 le = 0x0F;
1439 break;
1440 case chipcHw_VPM_HW_PHASE_MARGIN_MEDIUM:
1441 ge = 0x03;
1442 le = 0x3F;
1443 break;
1444 case chipcHw_VPM_HW_PHASE_MARGIN_WIDE:
1445 ge = 0x01;
1446 le = 0x7F;
1447 break;
1448 }
1449
1450 {
1451 REG_LOCAL_IRQ_SAVE;
1452
1453 pChipcHw->VPMPhaseCtrl1 &=
1454 ~((chipcHw_REG_VPM_PHASE_VALUE_GE_MASK <<
1455 chipcHw_REG_VPM_PHASE_VALUE_GE_SHIFT)
1456 || (chipcHw_REG_VPM_PHASE_VALUE_LE_MASK <<
1457 chipcHw_REG_VPM_PHASE_VALUE_LE_SHIFT));
1458
1459 pChipcHw->VPMPhaseCtrl1 |=
1460 ((ge << chipcHw_REG_VPM_PHASE_VALUE_GE_SHIFT)
1461 || (le << chipcHw_REG_VPM_PHASE_VALUE_LE_SHIFT));
1462
1463 REG_LOCAL_IRQ_RESTORE;
1464 }
1465}
1466
1467/****************************************************************************/
1468/**
1469* @brief Checks DDR phase aligned status done by HW
1470*
1471* @return 1: When aligned
1472* 0: When not aligned
1473*/
1474/****************************************************************************/
1475static inline uint32_t chipcHw_isDdrHwPhaseAligned(void)
1476{
1477 return (pChipcHw->
1478 PhaseAlignStatus & chipcHw_REG_DDR_PHASE_ALIGNED) ? 1 : 0;
1479}
1480
1481/****************************************************************************/
1482/**
1483* @brief Checks VPM phase aligned status done by HW
1484*
1485* @return 1: When aligned
1486* 0: When not aligned
1487*/
1488/****************************************************************************/
1489static inline uint32_t chipcHw_isVpmHwPhaseAligned(void)
1490{
1491 return (pChipcHw->
1492 PhaseAlignStatus & chipcHw_REG_VPM_PHASE_ALIGNED) ? 1 : 0;
1493}
1494
1495/****************************************************************************/
1496/**
1497* @brief Get DDR phase aligned status done by HW
1498*
1499*/
1500/****************************************************************************/
1501static inline uint32_t chipcHw_getDdrHwPhaseAlignStatus(void)
1502{
1503 return (pChipcHw->
1504 PhaseAlignStatus & chipcHw_REG_DDR_PHASE_STATUS_MASK) >>
1505 chipcHw_REG_DDR_PHASE_STATUS_SHIFT;
1506}
1507
1508/****************************************************************************/
1509/**
1510* @brief Get VPM phase aligned status done by HW
1511*
1512*/
1513/****************************************************************************/
1514static inline uint32_t chipcHw_getVpmHwPhaseAlignStatus(void)
1515{
1516 return (pChipcHw->
1517 PhaseAlignStatus & chipcHw_REG_VPM_PHASE_STATUS_MASK) >>
1518 chipcHw_REG_VPM_PHASE_STATUS_SHIFT;
1519}
1520
1521/****************************************************************************/
1522/**
1523* @brief Get DDR phase control value
1524*
1525*/
1526/****************************************************************************/
1527static inline uint32_t chipcHw_getDdrPhaseControl(void)
1528{
1529 return (pChipcHw->
1530 PhaseAlignStatus & chipcHw_REG_DDR_PHASE_CTRL_MASK) >>
1531 chipcHw_REG_DDR_PHASE_CTRL_SHIFT;
1532}
1533
1534/****************************************************************************/
1535/**
1536* @brief Get VPM phase control value
1537*
1538*/
1539/****************************************************************************/
1540static inline uint32_t chipcHw_getVpmPhaseControl(void)
1541{
1542 return (pChipcHw->
1543 PhaseAlignStatus & chipcHw_REG_VPM_PHASE_CTRL_MASK) >>
1544 chipcHw_REG_VPM_PHASE_CTRL_SHIFT;
1545}
1546
1547/****************************************************************************/
1548/**
1549* @brief DDR phase alignment timeout count
1550*
1551* @note If HW fails to perform the phase alignment, it will trigger
1552* a DDR phase alignment timeout interrupt.
1553*/
1554/****************************************************************************/
1555static inline void chipcHw_ddrHwPhaseAlignTimeout(uint32_t busCycle)
1556{
1557 REG_LOCAL_IRQ_SAVE;
1558 pChipcHw->DDRPhaseCtrl2 &=
1559 ~(chipcHw_REG_DDR_PHASE_TIMEOUT_COUNT_MASK <<
1560 chipcHw_REG_DDR_PHASE_TIMEOUT_COUNT_SHIFT);
1561 pChipcHw->DDRPhaseCtrl2 |=
1562 (busCycle & chipcHw_REG_DDR_PHASE_TIMEOUT_COUNT_MASK) <<
1563 chipcHw_REG_DDR_PHASE_TIMEOUT_COUNT_SHIFT;
1564 REG_LOCAL_IRQ_RESTORE;
1565}
1566
1567/****************************************************************************/
1568/**
1569* @brief VPM phase alignment timeout count
1570*
1571* @note If HW fails to perform the phase alignment, it will trigger
1572* a VPM phase alignment timeout interrupt.
1573*/
1574/****************************************************************************/
1575static inline void chipcHw_vpmHwPhaseAlignTimeout(uint32_t busCycle)
1576{
1577 REG_LOCAL_IRQ_SAVE;
1578 pChipcHw->VPMPhaseCtrl2 &=
1579 ~(chipcHw_REG_VPM_PHASE_TIMEOUT_COUNT_MASK <<
1580 chipcHw_REG_VPM_PHASE_TIMEOUT_COUNT_SHIFT);
1581 pChipcHw->VPMPhaseCtrl2 |=
1582 (busCycle & chipcHw_REG_VPM_PHASE_TIMEOUT_COUNT_MASK) <<
1583 chipcHw_REG_VPM_PHASE_TIMEOUT_COUNT_SHIFT;
1584 REG_LOCAL_IRQ_RESTORE;
1585}
1586
1587/****************************************************************************/
1588/**
1589* @brief Clear DDR phase alignment timeout interrupt
1590*
1591*/
1592/****************************************************************************/
1593static inline void chipcHw_ddrHwPhaseAlignTimeoutInterruptClear(void)
1594{
1595 REG_LOCAL_IRQ_SAVE;
1596 /* Clear timeout interrupt service bit */
1597 pChipcHw->DDRPhaseCtrl2 |= chipcHw_REG_DDR_INTR_SERVICED;
1598 pChipcHw->DDRPhaseCtrl2 &= ~chipcHw_REG_DDR_INTR_SERVICED;
1599 REG_LOCAL_IRQ_RESTORE;
1600}
1601
1602/****************************************************************************/
1603/**
1604* @brief Clear VPM phase alignment timeout interrupt
1605*
1606*/
1607/****************************************************************************/
1608static inline void chipcHw_vpmHwPhaseAlignTimeoutInterruptClear(void)
1609{
1610 REG_LOCAL_IRQ_SAVE;
1611 /* Clear timeout interrupt service bit */
1612 pChipcHw->VPMPhaseCtrl2 |= chipcHw_REG_VPM_INTR_SERVICED;
1613 pChipcHw->VPMPhaseCtrl2 &= ~chipcHw_REG_VPM_INTR_SERVICED;
1614 REG_LOCAL_IRQ_RESTORE;
1615}
1616
1617/****************************************************************************/
1618/**
1619* @brief DDR phase alignment timeout interrupt enable
1620*
1621*/
1622/****************************************************************************/
1623static inline void chipcHw_ddrHwPhaseAlignTimeoutInterruptEnable(void)
1624{
1625 REG_LOCAL_IRQ_SAVE;
1626 chipcHw_ddrHwPhaseAlignTimeoutInterruptClear(); /* Recommended */
1627 /* Enable timeout interrupt */
1628 pChipcHw->DDRPhaseCtrl2 |= chipcHw_REG_DDR_TIMEOUT_INTR_ENABLE;
1629 REG_LOCAL_IRQ_RESTORE;
1630}
1631
1632/****************************************************************************/
1633/**
1634* @brief VPM phase alignment timeout interrupt enable
1635*
1636*/
1637/****************************************************************************/
1638static inline void chipcHw_vpmHwPhaseAlignTimeoutInterruptEnable(void)
1639{
1640 REG_LOCAL_IRQ_SAVE;
1641 chipcHw_vpmHwPhaseAlignTimeoutInterruptClear(); /* Recommended */
1642 /* Enable timeout interrupt */
1643 pChipcHw->VPMPhaseCtrl2 |= chipcHw_REG_VPM_TIMEOUT_INTR_ENABLE;
1644 REG_LOCAL_IRQ_RESTORE;
1645}
1646
1647/****************************************************************************/
1648/**
1649* @brief DDR phase alignment timeout interrupt disable
1650*
1651*/
1652/****************************************************************************/
1653static inline void chipcHw_ddrHwPhaseAlignTimeoutInterruptDisable(void)
1654{
1655 REG_LOCAL_IRQ_SAVE;
1656 pChipcHw->DDRPhaseCtrl2 &= ~chipcHw_REG_DDR_TIMEOUT_INTR_ENABLE;
1657 REG_LOCAL_IRQ_RESTORE;
1658}
1659
1660/****************************************************************************/
1661/**
1662* @brief VPM phase alignment timeout interrupt disable
1663*
1664*/
1665/****************************************************************************/
1666static inline void chipcHw_vpmHwPhaseAlignTimeoutInterruptDisable(void)
1667{
1668 REG_LOCAL_IRQ_SAVE;
1669 pChipcHw->VPMPhaseCtrl2 &= ~chipcHw_REG_VPM_TIMEOUT_INTR_ENABLE;
1670 REG_LOCAL_IRQ_RESTORE;
1671}
1672
1673#endif /* CHIPC_INLINE_H */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h
deleted file mode 100644
index b162448f613..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h
+++ /dev/null
@@ -1,530 +0,0 @@
1/*****************************************************************************
2* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file chipcHw_reg.h
18*
19* @brief Definitions for low level chip control registers
20*
21*/
22/****************************************************************************/
23#ifndef CHIPCHW_REG_H
24#define CHIPCHW_REG_H
25
26#include <mach/csp/mm_io.h>
27#include <csp/reg.h>
28#include <mach/csp/ddrcReg.h>
29
30#define chipcHw_BASE_ADDRESS MM_IO_BASE_CHIPC
31
32typedef struct {
33 uint32_t ChipId; /* Chip ID */
34 uint32_t DDRClock; /* PLL1 Channel 1 for DDR clock */
35 uint32_t ARMClock; /* PLL1 Channel 2 for ARM clock */
36 uint32_t ESWClock; /* PLL1 Channel 3 for ESW system clock */
37 uint32_t VPMClock; /* PLL1 Channel 4 for VPM clock */
38 uint32_t ESW125Clock; /* PLL1 Channel 5 for ESW 125MHz clock */
39 uint32_t UARTClock; /* PLL1 Channel 6 for UART clock */
40 uint32_t SDIO0Clock; /* PLL1 Channel 7 for SDIO 0 clock */
41 uint32_t SDIO1Clock; /* PLL1 Channel 8 for SDIO 1 clock */
42 uint32_t SPIClock; /* PLL1 Channel 9 for SPI master Clock */
43 uint32_t ETMClock; /* PLL1 Channel 10 for ARM ETM Clock */
44
45 uint32_t ACLKClock; /* ACLK Clock (Divider) */
46 uint32_t OTPClock; /* OTP Clock (Divider) */
47 uint32_t I2CClock; /* I2C Clock (CK_13m) (Divider) */
48 uint32_t I2S0Clock; /* I2S0 Clock (Divider) */
49 uint32_t RTBUSClock; /* RTBUS (DDR PHY Config.) Clock (Divider) */
50 uint32_t pad1;
51 uint32_t APM100Clock; /* APM 100MHz CLK Clock (Divider) */
52 uint32_t TSCClock; /* TSC Clock (Divider) */
53 uint32_t LEDClock; /* LED Clock (Divider) */
54
55 uint32_t USBClock; /* PLL2 Channel 1 for USB clock */
56 uint32_t LCDClock; /* PLL2 Channel 2 for LCD clock */
57 uint32_t APMClock; /* PLL2 Channel 3 for APM 200 MHz clock */
58
59 uint32_t BusIntfClock; /* Bus interface clock */
60
61 uint32_t PLLStatus; /* PLL status register (PLL1) */
62 uint32_t PLLConfig; /* PLL configuration register (PLL1) */
63 uint32_t PLLPreDivider; /* PLL pre-divider control register (PLL1) */
64 uint32_t PLLDivider; /* PLL divider control register (PLL1) */
65 uint32_t PLLControl1; /* PLL analog control register #1 (PLL1) */
66 uint32_t PLLControl2; /* PLL analog control register #2 (PLL1) */
67
68 uint32_t I2S1Clock; /* I2S1 Clock */
69 uint32_t AudioEnable; /* Enable/ disable audio channel */
70 uint32_t SoftReset1; /* Reset blocks */
71 uint32_t SoftReset2; /* Reset blocks */
72 uint32_t Spare1; /* Phase align interrupts */
73 uint32_t Sticky; /* Sticky bits */
74 uint32_t MiscCtrl; /* Misc. control */
75 uint32_t pad3[3];
76
77 uint32_t PLLStatus2; /* PLL status register (PLL2) */
78 uint32_t PLLConfig2; /* PLL configuration register (PLL2) */
79 uint32_t PLLPreDivider2; /* PLL pre-divider control register (PLL2) */
80 uint32_t PLLDivider2; /* PLL divider control register (PLL2) */
81 uint32_t PLLControl12; /* PLL analog control register #1 (PLL2) */
82 uint32_t PLLControl22; /* PLL analog control register #2 (PLL2) */
83
84 uint32_t DDRPhaseCtrl1; /* DDR Clock Phase Alignment control1 */
85 uint32_t VPMPhaseCtrl1; /* VPM Clock Phase Alignment control1 */
86 uint32_t PhaseAlignStatus; /* DDR/VPM Clock Phase Alignment Status */
87 uint32_t PhaseCtrlStatus; /* DDR/VPM Clock HW DDR/VPM ph_ctrl and load_ch Status */
88 uint32_t DDRPhaseCtrl2; /* DDR Clock Phase Alignment control2 */
89 uint32_t VPMPhaseCtrl2; /* VPM Clock Phase Alignment control2 */
90 uint32_t pad4[9];
91
92 uint32_t SoftOTP1; /* Software OTP control */
93 uint32_t SoftOTP2; /* Software OTP control */
94 uint32_t SoftStraps; /* Software strap */
95 uint32_t PinStraps; /* Pin Straps */
96 uint32_t DiffOscCtrl; /* Diff oscillator control */
97 uint32_t DiagsCtrl; /* Diagnostic control */
98 uint32_t DiagsOutputCtrl; /* Diagnostic output enable */
99 uint32_t DiagsReadBackCtrl; /* Diagnostic read back control */
100
101 uint32_t LcdPifMode; /* LCD/PIF Pin Sharing MUX Mode */
102
103 uint32_t GpioMux_0_7; /* Pin Sharing MUX0 Control */
104 uint32_t GpioMux_8_15; /* Pin Sharing MUX1 Control */
105 uint32_t GpioMux_16_23; /* Pin Sharing MUX2 Control */
106 uint32_t GpioMux_24_31; /* Pin Sharing MUX3 Control */
107 uint32_t GpioMux_32_39; /* Pin Sharing MUX4 Control */
108 uint32_t GpioMux_40_47; /* Pin Sharing MUX5 Control */
109 uint32_t GpioMux_48_55; /* Pin Sharing MUX6 Control */
110 uint32_t GpioMux_56_63; /* Pin Sharing MUX7 Control */
111
112 uint32_t GpioSR_0_7; /* Slew rate for GPIO 0 - 7 */
113 uint32_t GpioSR_8_15; /* Slew rate for GPIO 8 - 15 */
114 uint32_t GpioSR_16_23; /* Slew rate for GPIO 16 - 23 */
115 uint32_t GpioSR_24_31; /* Slew rate for GPIO 24 - 31 */
116 uint32_t GpioSR_32_39; /* Slew rate for GPIO 32 - 39 */
117 uint32_t GpioSR_40_47; /* Slew rate for GPIO 40 - 47 */
118 uint32_t GpioSR_48_55; /* Slew rate for GPIO 48 - 55 */
119 uint32_t GpioSR_56_63; /* Slew rate for GPIO 56 - 63 */
120 uint32_t MiscSR_0_7; /* Slew rate for MISC 0 - 7 */
121 uint32_t MiscSR_8_15; /* Slew rate for MISC 8 - 15 */
122
123 uint32_t GpioPull_0_15; /* Pull up registers for GPIO 0 - 15 */
124 uint32_t GpioPull_16_31; /* Pull up registers for GPIO 16 - 31 */
125 uint32_t GpioPull_32_47; /* Pull up registers for GPIO 32 - 47 */
126 uint32_t GpioPull_48_63; /* Pull up registers for GPIO 48 - 63 */
127 uint32_t MiscPull_0_15; /* Pull up registers for MISC 0 - 15 */
128
129 uint32_t GpioInput_0_31; /* Input type for GPIO 0 - 31 */
130 uint32_t GpioInput_32_63; /* Input type for GPIO 32 - 63 */
131 uint32_t MiscInput_0_15; /* Input type for MISC 0 - 16 */
132} chipcHw_REG_t;
133
134#define pChipcHw ((volatile chipcHw_REG_t *) chipcHw_BASE_ADDRESS)
135#define pChipcPhysical ((volatile chipcHw_REG_t *) MM_ADDR_IO_CHIPC)
136
137#define chipcHw_REG_CHIPID_BASE_MASK 0xFFFFF000
138#define chipcHw_REG_CHIPID_BASE_SHIFT 12
139#define chipcHw_REG_CHIPID_REV_MASK 0x00000FFF
140#define chipcHw_REG_REV_A0 0xA00
141#define chipcHw_REG_REV_B0 0x0B0
142
143#define chipcHw_REG_PLL_STATUS_CONTROL_ENABLE 0x80000000 /* Allow controlling PLL registers */
144#define chipcHw_REG_PLL_STATUS_LOCKED 0x00000001 /* PLL is settled */
145#define chipcHw_REG_PLL_CONFIG_D_RESET 0x00000008 /* Digital reset */
146#define chipcHw_REG_PLL_CONFIG_A_RESET 0x00000004 /* Analog reset */
147#define chipcHw_REG_PLL_CONFIG_BYPASS_ENABLE 0x00000020 /* Bypass enable */
148#define chipcHw_REG_PLL_CONFIG_OUTPUT_ENABLE 0x00000010 /* Output enable */
149#define chipcHw_REG_PLL_CONFIG_POWER_DOWN 0x00000001 /* Power down */
150#define chipcHw_REG_PLL_CONFIG_VCO_SPLIT_FREQ 1600000000 /* 1.6GHz VCO split frequency */
151#define chipcHw_REG_PLL_CONFIG_VCO_800_1600 0x00000000 /* VCO range 800-1600 MHz */
152#define chipcHw_REG_PLL_CONFIG_VCO_1601_3200 0x00000080 /* VCO range 1601-3200 MHz */
153#define chipcHw_REG_PLL_CONFIG_TEST_ENABLE 0x00010000 /* PLL test output enable */
154#define chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK 0x003E0000 /* Mask to set test values */
155#define chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT 17
156
157#define chipcHw_REG_PLL_CLOCK_PHASE_COMP 0x00800000 /* Phase comparator output */
158#define chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_MASK 0x00300000 /* Clock to bus ratio mask */
159#define chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_SHIFT 20 /* Number of bits to be shifted */
160#define chipcHw_REG_PLL_CLOCK_POWER_DOWN 0x00080000 /* PLL channel power down */
161#define chipcHw_REG_PLL_CLOCK_SOURCE_GPIO 0x00040000 /* Use GPIO as source */
162#define chipcHw_REG_PLL_CLOCK_BYPASS_SELECT 0x00020000 /* Select bypass clock */
163#define chipcHw_REG_PLL_CLOCK_OUTPUT_ENABLE 0x00010000 /* Clock gated ON */
164#define chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE 0x00008000 /* Clock phase update enable */
165#define chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT 8 /* Number of bits to be shifted */
166#define chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK 0x00003F00 /* Phase control mask */
167#define chipcHw_REG_PLL_CLOCK_MDIV_MASK 0x000000FF /* Clock post divider mask
168
169 00000000 = divide-by-256
170 00000001 = divide-by-1
171 00000010 = divide-by-2
172 00000011 = divide-by-3
173 00000100 = divide-by-4
174 00000101 = divide-by-5
175 00000110 = divide-by-6
176 .
177 .
178 11111011 = divide-by-251
179 11111100 = divide-by-252
180 11111101 = divide-by-253
181 11111110 = divide-by-254
182 */
183
184#define chipcHw_REG_DIV_CLOCK_SOURCE_OTHER 0x00040000 /* NON-PLL clock source select */
185#define chipcHw_REG_DIV_CLOCK_BYPASS_SELECT 0x00020000 /* NON-PLL clock bypass enable */
186#define chipcHw_REG_DIV_CLOCK_OUTPUT_ENABLE 0x00010000 /* NON-PLL clock output enable */
187#define chipcHw_REG_DIV_CLOCK_DIV_MASK 0x000000FF /* NON-PLL clock post-divide mask */
188#define chipcHw_REG_DIV_CLOCK_DIV_256 0x00000000 /* NON-PLL clock post-divide by 256 */
189
190#define chipcHw_REG_PLL_PREDIVIDER_P1_SHIFT 0
191#define chipcHw_REG_PLL_PREDIVIDER_P2_SHIFT 4
192#define chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT 8
193#define chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK 0x0001FF00
194#define chipcHw_REG_PLL_PREDIVIDER_POWER_DOWN 0x02000000
195#define chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK 0x00700000 /* Divider mask */
196#define chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER 0x00000000 /* Integer-N Mode */
197#define chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASH_UNIT 0x00100000 /* MASH Sigma-Delta Modulator Unit Mode */
198#define chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MFB_UNIT 0x00200000 /* MFB Sigma-Delta Modulator Unit Mode */
199#define chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASH_1_8 0x00300000 /* MASH Sigma-Delta Modulator 1/8 Mode */
200#define chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MFB_1_8 0x00400000 /* MFB Sigma-Delta Modulator 1/8 Mode */
201
202#define chipcHw_REG_PLL_PREDIVIDER_NDIV_i(vco) ((vco) / chipcHw_XTAL_FREQ_Hz)
203#define chipcHw_REG_PLL_PREDIVIDER_P1 1
204#define chipcHw_REG_PLL_PREDIVIDER_P2 1
205
206#define chipcHw_REG_PLL_DIVIDER_M1DIV 0x03000000
207#define chipcHw_REG_PLL_DIVIDER_FRAC 0x00FFFFFF /* Fractional divider */
208
209#define chipcHw_REG_PLL_DIVIDER_NDIV_f_SS (0x00FFFFFF) /* To attain spread with max frequency */
210
211#define chipcHw_REG_PLL_DIVIDER_NDIV_f 0 /* ndiv_frac = chipcHw_REG_PLL_DIVIDER_NDIV_f /
212 chipcHw_REG_PLL_DIVIDER_FRAC
213 = 0, when SS is disable
214 */
215
216#define chipcHw_REG_PLL_DIVIDER_MDIV(vco, Hz) ((chipcHw_divide((vco), (Hz)) > 255) ? 0 : chipcHw_divide((vco), (Hz)))
217
218#define chipcHw_REG_ACLKClock_CLK_DIV_MASK 0x3
219
220/* System booting strap options */
221#define chipcHw_STRAPS_SOFT_OVERRIDE 0x00000001 /* Software Strap Override */
222
223#define chipcHw_STRAPS_BOOT_DEVICE_NAND_FLASH_8 0x00000000 /* 8 bit NAND FLASH Boot */
224#define chipcHw_STRAPS_BOOT_DEVICE_NOR_FLASH_16 0x00000002 /* 16 bit NOR FLASH Boot */
225#define chipcHw_STRAPS_BOOT_DEVICE_SERIAL_FLASH 0x00000004 /* Serial FLASH Boot */
226#define chipcHw_STRAPS_BOOT_DEVICE_NAND_FLASH_16 0x00000006 /* 16 bit NAND FLASH Boot */
227#define chipcHw_STRAPS_BOOT_DEVICE_UART 0x00000008 /* UART Boot */
228#define chipcHw_STRAPS_BOOT_DEVICE_MASK 0x0000000E /* Mask */
229
230/* System boot option */
231#define chipcHw_STRAPS_BOOT_OPTION_BROM 0x00000000 /* Boot from Boot ROM */
232#define chipcHw_STRAPS_BOOT_OPTION_ARAM 0x00000020 /* Boot from ARAM */
233#define chipcHw_STRAPS_BOOT_OPTION_NOR 0x00000030 /* Boot from NOR flash */
234
235/* NAND Flash page size strap options */
236#define chipcHw_STRAPS_NAND_PAGESIZE_512 0x00000000 /* NAND FLASH page size of 512 bytes */
237#define chipcHw_STRAPS_NAND_PAGESIZE_2048 0x00000040 /* NAND FLASH page size of 2048 bytes */
238#define chipcHw_STRAPS_NAND_PAGESIZE_4096 0x00000080 /* NAND FLASH page size of 4096 bytes */
239#define chipcHw_STRAPS_NAND_PAGESIZE_EXT 0x000000C0 /* NAND FLASH page of extened size */
240#define chipcHw_STRAPS_NAND_PAGESIZE_MASK 0x000000C0 /* Mask */
241
242#define chipcHw_STRAPS_NAND_EXTRA_CYCLE 0x00000400 /* NAND FLASH address cycle configuration */
243#define chipcHw_STRAPS_REBOOT_TO_UART 0x00000800 /* Reboot to UART on error */
244
245/* Secure boot mode strap options */
246#define chipcHw_STRAPS_BOOT_MODE_NORMAL 0x00000000 /* Normal Boot */
247#define chipcHw_STRAPS_BOOT_MODE_DBG_SW 0x00000100 /* Software debugging Boot */
248#define chipcHw_STRAPS_BOOT_MODE_DBG_BOOT 0x00000200 /* Boot rom debugging Boot */
249#define chipcHw_STRAPS_BOOT_MODE_NORMAL_QUIET 0x00000300 /* Normal Boot (Quiet BootRom) */
250#define chipcHw_STRAPS_BOOT_MODE_MASK 0x00000300 /* Mask */
251
252/* Slave Mode straps */
253#define chipcHw_STRAPS_I2CS 0x02000000 /* I2C Slave */
254#define chipcHw_STRAPS_SPIS 0x01000000 /* SPI Slave */
255
256/* Strap pin options */
257#define chipcHw_REG_SW_STRAPS ((pChipcHw->PinStraps & 0x0000FC00) >> 10)
258
259/* PIF/LCD pin sharing defines */
260#define chipcHw_REG_LCD_PIN_ENABLE 0x00000001 /* LCD Controller is used and the pins have LCD functions */
261#define chipcHw_REG_PIF_PIN_ENABLE 0x00000002 /* LCD pins are used to perform PIF functions */
262
263#define chipcHw_GPIO_COUNT 61 /* Number of GPIO pin accessible thorugh CHIPC */
264
265/* NOTE: Any changes to these constants will require a corresponding change to chipcHw_str.c */
266#define chipcHw_REG_GPIO_MUX_KEYPAD 0x00000001 /* GPIO mux for Keypad */
267#define chipcHw_REG_GPIO_MUX_I2CH 0x00000002 /* GPIO mux for I2CH */
268#define chipcHw_REG_GPIO_MUX_SPI 0x00000003 /* GPIO mux for SPI */
269#define chipcHw_REG_GPIO_MUX_UART 0x00000004 /* GPIO mux for UART */
270#define chipcHw_REG_GPIO_MUX_LEDMTXP 0x00000005 /* GPIO mux for LEDMTXP */
271#define chipcHw_REG_GPIO_MUX_LEDMTXS 0x00000006 /* GPIO mux for LEDMTXS */
272#define chipcHw_REG_GPIO_MUX_SDIO0 0x00000007 /* GPIO mux for SDIO0 */
273#define chipcHw_REG_GPIO_MUX_SDIO1 0x00000008 /* GPIO mux for SDIO1 */
274#define chipcHw_REG_GPIO_MUX_PCM 0x00000009 /* GPIO mux for PCM */
275#define chipcHw_REG_GPIO_MUX_I2S 0x0000000A /* GPIO mux for I2S */
276#define chipcHw_REG_GPIO_MUX_ETM 0x0000000B /* GPIO mux for ETM */
277#define chipcHw_REG_GPIO_MUX_DEBUG 0x0000000C /* GPIO mux for DEBUG */
278#define chipcHw_REG_GPIO_MUX_MISC 0x0000000D /* GPIO mux for MISC */
279#define chipcHw_REG_GPIO_MUX_GPIO 0x00000000 /* GPIO mux for GPIO */
280#define chipcHw_REG_GPIO_MUX(pin) (&pChipcHw->GpioMux_0_7 + ((pin) >> 3))
281#define chipcHw_REG_GPIO_MUX_POSITION(pin) (((pin) & 0x00000007) << 2)
282#define chipcHw_REG_GPIO_MUX_MASK 0x0000000F /* Mask */
283
284#define chipcHw_REG_SLEW_RATE_HIGH 0x00000000 /* High speed slew rate */
285#define chipcHw_REG_SLEW_RATE_NORMAL 0x00000008 /* Normal slew rate */
286 /* Pins beyond 42 are defined by skipping 8 bits within the register */
287#define chipcHw_REG_SLEW_RATE(pin) (((pin) > 42) ? (&pChipcHw->GpioSR_0_7 + (((pin) + 2) >> 3)) : (&pChipcHw->GpioSR_0_7 + ((pin) >> 3)))
288#define chipcHw_REG_SLEW_RATE_POSITION(pin) (((pin) > 42) ? ((((pin) + 2) & 0x00000007) << 2) : (((pin) & 0x00000007) << 2))
289#define chipcHw_REG_SLEW_RATE_MASK 0x00000008 /* Mask */
290
291#define chipcHw_REG_CURRENT_STRENGTH_2mA 0x00000001 /* Current driving strength 2 milli ampere */
292#define chipcHw_REG_CURRENT_STRENGTH_4mA 0x00000002 /* Current driving strength 4 milli ampere */
293#define chipcHw_REG_CURRENT_STRENGTH_6mA 0x00000004 /* Current driving strength 6 milli ampere */
294#define chipcHw_REG_CURRENT_STRENGTH_8mA 0x00000005 /* Current driving strength 8 milli ampere */
295#define chipcHw_REG_CURRENT_STRENGTH_10mA 0x00000006 /* Current driving strength 10 milli ampere */
296#define chipcHw_REG_CURRENT_STRENGTH_12mA 0x00000007 /* Current driving strength 12 milli ampere */
297#define chipcHw_REG_CURRENT_MASK 0x00000007 /* Mask */
298 /* Pins beyond 42 are defined by skipping 8 bits */
299#define chipcHw_REG_CURRENT(pin) (((pin) > 42) ? (&pChipcHw->GpioSR_0_7 + (((pin) + 2) >> 3)) : (&pChipcHw->GpioSR_0_7 + ((pin) >> 3)))
300#define chipcHw_REG_CURRENT_POSITION(pin) (((pin) > 42) ? ((((pin) + 2) & 0x00000007) << 2) : (((pin) & 0x00000007) << 2))
301
302#define chipcHw_REG_PULL_NONE 0x00000000 /* No pull up register */
303#define chipcHw_REG_PULL_UP 0x00000001 /* Pull up register enable */
304#define chipcHw_REG_PULL_DOWN 0x00000002 /* Pull down register enable */
305#define chipcHw_REG_PULLUP_MASK 0x00000003 /* Mask */
306 /* Pins beyond 42 are defined by skipping 4 bits */
307#define chipcHw_REG_PULLUP(pin) (((pin) > 42) ? (&pChipcHw->GpioPull_0_15 + (((pin) + 2) >> 4)) : (&pChipcHw->GpioPull_0_15 + ((pin) >> 4)))
308#define chipcHw_REG_PULLUP_POSITION(pin) (((pin) > 42) ? ((((pin) + 2) & 0x0000000F) << 1) : (((pin) & 0x0000000F) << 1))
309
310#define chipcHw_REG_INPUTTYPE_CMOS 0x00000000 /* Normal CMOS logic */
311#define chipcHw_REG_INPUTTYPE_ST 0x00000001 /* High speed Schmitt Trigger */
312#define chipcHw_REG_INPUTTYPE_MASK 0x00000001 /* Mask */
313 /* Pins beyond 42 are defined by skipping 2 bits */
314#define chipcHw_REG_INPUTTYPE(pin) (((pin) > 42) ? (&pChipcHw->GpioInput_0_31 + (((pin) + 2) >> 5)) : (&pChipcHw->GpioInput_0_31 + ((pin) >> 5)))
315#define chipcHw_REG_INPUTTYPE_POSITION(pin) (((pin) > 42) ? ((((pin) + 2) & 0x0000001F)) : (((pin) & 0x0000001F)))
316
317/* Device connected to the bus clock */
318#define chipcHw_REG_BUS_CLOCK_ARM 0x00000001 /* Bus interface clock for ARM */
319#define chipcHw_REG_BUS_CLOCK_VDEC 0x00000002 /* Bus interface clock for VDEC */
320#define chipcHw_REG_BUS_CLOCK_ARAM 0x00000004 /* Bus interface clock for ARAM */
321#define chipcHw_REG_BUS_CLOCK_HPM 0x00000008 /* Bus interface clock for HPM */
322#define chipcHw_REG_BUS_CLOCK_DDRC 0x00000010 /* Bus interface clock for DDRC */
323#define chipcHw_REG_BUS_CLOCK_DMAC0 0x00000020 /* Bus interface clock for DMAC0 */
324#define chipcHw_REG_BUS_CLOCK_DMAC1 0x00000040 /* Bus interface clock for DMAC1 */
325#define chipcHw_REG_BUS_CLOCK_NVI 0x00000080 /* Bus interface clock for NVI */
326#define chipcHw_REG_BUS_CLOCK_ESW 0x00000100 /* Bus interface clock for ESW */
327#define chipcHw_REG_BUS_CLOCK_GE 0x00000200 /* Bus interface clock for GE */
328#define chipcHw_REG_BUS_CLOCK_I2CH 0x00000400 /* Bus interface clock for I2CH */
329#define chipcHw_REG_BUS_CLOCK_I2S0 0x00000800 /* Bus interface clock for I2S0 */
330#define chipcHw_REG_BUS_CLOCK_I2S1 0x00001000 /* Bus interface clock for I2S1 */
331#define chipcHw_REG_BUS_CLOCK_VRAM 0x00002000 /* Bus interface clock for VRAM */
332#define chipcHw_REG_BUS_CLOCK_CLCD 0x00004000 /* Bus interface clock for CLCD */
333#define chipcHw_REG_BUS_CLOCK_LDK 0x00008000 /* Bus interface clock for LDK */
334#define chipcHw_REG_BUS_CLOCK_LED 0x00010000 /* Bus interface clock for LED */
335#define chipcHw_REG_BUS_CLOCK_OTP 0x00020000 /* Bus interface clock for OTP */
336#define chipcHw_REG_BUS_CLOCK_PIF 0x00040000 /* Bus interface clock for PIF */
337#define chipcHw_REG_BUS_CLOCK_SPU 0x00080000 /* Bus interface clock for SPU */
338#define chipcHw_REG_BUS_CLOCK_SDIO0 0x00100000 /* Bus interface clock for SDIO0 */
339#define chipcHw_REG_BUS_CLOCK_SDIO1 0x00200000 /* Bus interface clock for SDIO1 */
340#define chipcHw_REG_BUS_CLOCK_SPIH 0x00400000 /* Bus interface clock for SPIH */
341#define chipcHw_REG_BUS_CLOCK_SPIS 0x00800000 /* Bus interface clock for SPIS */
342#define chipcHw_REG_BUS_CLOCK_UART0 0x01000000 /* Bus interface clock for UART0 */
343#define chipcHw_REG_BUS_CLOCK_UART1 0x02000000 /* Bus interface clock for UART1 */
344#define chipcHw_REG_BUS_CLOCK_BBL 0x04000000 /* Bus interface clock for BBL */
345#define chipcHw_REG_BUS_CLOCK_I2CS 0x08000000 /* Bus interface clock for I2CS */
346#define chipcHw_REG_BUS_CLOCK_USBH 0x10000000 /* Bus interface clock for USB Host */
347#define chipcHw_REG_BUS_CLOCK_USBD 0x20000000 /* Bus interface clock for USB Device */
348#define chipcHw_REG_BUS_CLOCK_BROM 0x40000000 /* Bus interface clock for Boot ROM */
349#define chipcHw_REG_BUS_CLOCK_TSC 0x80000000 /* Bus interface clock for Touch screen */
350
351/* Software resets defines */
352#define chipcHw_REG_SOFT_RESET_VPM_GLOBAL_HOLD 0x0000000080000000ULL /* Reset Global VPM and hold */
353#define chipcHw_REG_SOFT_RESET_VPM_HOLD 0x0000000040000000ULL /* Reset VPM and hold */
354#define chipcHw_REG_SOFT_RESET_VPM_GLOBAL 0x0000000020000000ULL /* Reset Global VPM */
355#define chipcHw_REG_SOFT_RESET_VPM 0x0000000010000000ULL /* Reset VPM */
356#define chipcHw_REG_SOFT_RESET_KEYPAD 0x0000000008000000ULL /* Reset Key pad */
357#define chipcHw_REG_SOFT_RESET_LED 0x0000000004000000ULL /* Reset LED */
358#define chipcHw_REG_SOFT_RESET_SPU 0x0000000002000000ULL /* Reset SPU */
359#define chipcHw_REG_SOFT_RESET_RNG 0x0000000001000000ULL /* Reset RNG */
360#define chipcHw_REG_SOFT_RESET_PKA 0x0000000000800000ULL /* Reset PKA */
361#define chipcHw_REG_SOFT_RESET_LCD 0x0000000000400000ULL /* Reset LCD */
362#define chipcHw_REG_SOFT_RESET_PIF 0x0000000000200000ULL /* Reset PIF */
363#define chipcHw_REG_SOFT_RESET_I2CS 0x0000000000100000ULL /* Reset I2C Slave */
364#define chipcHw_REG_SOFT_RESET_I2CH 0x0000000000080000ULL /* Reset I2C Host */
365#define chipcHw_REG_SOFT_RESET_SDIO1 0x0000000000040000ULL /* Reset SDIO 1 */
366#define chipcHw_REG_SOFT_RESET_SDIO0 0x0000000000020000ULL /* Reset SDIO 0 */
367#define chipcHw_REG_SOFT_RESET_BBL 0x0000000000010000ULL /* Reset BBL */
368#define chipcHw_REG_SOFT_RESET_I2S1 0x0000000000008000ULL /* Reset I2S1 */
369#define chipcHw_REG_SOFT_RESET_I2S0 0x0000000000004000ULL /* Reset I2S0 */
370#define chipcHw_REG_SOFT_RESET_SPIS 0x0000000000002000ULL /* Reset SPI Slave */
371#define chipcHw_REG_SOFT_RESET_SPIH 0x0000000000001000ULL /* Reset SPI Host */
372#define chipcHw_REG_SOFT_RESET_GPIO1 0x0000000000000800ULL /* Reset GPIO block 1 */
373#define chipcHw_REG_SOFT_RESET_GPIO0 0x0000000000000400ULL /* Reset GPIO block 0 */
374#define chipcHw_REG_SOFT_RESET_UART1 0x0000000000000200ULL /* Reset UART 1 */
375#define chipcHw_REG_SOFT_RESET_UART0 0x0000000000000100ULL /* Reset UART 0 */
376#define chipcHw_REG_SOFT_RESET_NVI 0x0000000000000080ULL /* Reset NVI */
377#define chipcHw_REG_SOFT_RESET_WDOG 0x0000000000000040ULL /* Reset Watch dog */
378#define chipcHw_REG_SOFT_RESET_TMR 0x0000000000000020ULL /* Reset Timer */
379#define chipcHw_REG_SOFT_RESET_ETM 0x0000000000000010ULL /* Reset ETM */
380#define chipcHw_REG_SOFT_RESET_ARM_HOLD 0x0000000000000008ULL /* Reset ARM and HOLD */
381#define chipcHw_REG_SOFT_RESET_ARM 0x0000000000000004ULL /* Reset ARM */
382#define chipcHw_REG_SOFT_RESET_CHIP_WARM 0x0000000000000002ULL /* Chip warm reset */
383#define chipcHw_REG_SOFT_RESET_CHIP_SOFT 0x0000000000000001ULL /* Chip soft reset */
384#define chipcHw_REG_SOFT_RESET_VDEC 0x0000100000000000ULL /* Video decoder */
385#define chipcHw_REG_SOFT_RESET_GE 0x0000080000000000ULL /* Graphics engine */
386#define chipcHw_REG_SOFT_RESET_OTP 0x0000040000000000ULL /* Reset OTP */
387#define chipcHw_REG_SOFT_RESET_USB2 0x0000020000000000ULL /* Reset USB2 */
388#define chipcHw_REG_SOFT_RESET_USB1 0x0000010000000000ULL /* Reset USB 1 */
389#define chipcHw_REG_SOFT_RESET_USB 0x0000008000000000ULL /* Reset USB 1 and USB2 soft reset */
390#define chipcHw_REG_SOFT_RESET_ESW 0x0000004000000000ULL /* Reset Ethernet switch */
391#define chipcHw_REG_SOFT_RESET_ESWCLK 0x0000002000000000ULL /* Reset Ethernet switch clock */
392#define chipcHw_REG_SOFT_RESET_DDRPHY 0x0000001000000000ULL /* Reset DDR Physical */
393#define chipcHw_REG_SOFT_RESET_DDR 0x0000000800000000ULL /* Reset DDR Controller */
394#define chipcHw_REG_SOFT_RESET_TSC 0x0000000400000000ULL /* Reset Touch screen */
395#define chipcHw_REG_SOFT_RESET_PCM 0x0000000200000000ULL /* Reset PCM device */
396#define chipcHw_REG_SOFT_RESET_APM 0x0000200100000000ULL /* Reset APM device */
397
398#define chipcHw_REG_SOFT_RESET_VPM_GLOBAL_UNHOLD 0x8000000000000000ULL /* Unhold Global VPM */
399#define chipcHw_REG_SOFT_RESET_VPM_UNHOLD 0x4000000000000000ULL /* Unhold VPM */
400#define chipcHw_REG_SOFT_RESET_ARM_UNHOLD 0x2000000000000000ULL /* Unhold ARM reset */
401#define chipcHw_REG_SOFT_RESET_UNHOLD_MASK 0xF000000000000000ULL /* Mask to handle unhold request */
402
403/* Audio channel control defines */
404#define chipcHw_REG_AUDIO_CHANNEL_ENABLE_ALL 0x00000001 /* Enable all audio channel */
405#define chipcHw_REG_AUDIO_CHANNEL_ENABLE_A 0x00000002 /* Enable channel A */
406#define chipcHw_REG_AUDIO_CHANNEL_ENABLE_B 0x00000004 /* Enable channel B */
407#define chipcHw_REG_AUDIO_CHANNEL_ENABLE_C 0x00000008 /* Enable channel C */
408#define chipcHw_REG_AUDIO_CHANNEL_ENABLE_NTP_CLOCK 0x00000010 /* Enable NTP clock */
409#define chipcHw_REG_AUDIO_CHANNEL_ENABLE_PCM0_CLOCK 0x00000020 /* Enable PCM0 clock */
410#define chipcHw_REG_AUDIO_CHANNEL_ENABLE_PCM1_CLOCK 0x00000040 /* Enable PCM1 clock */
411#define chipcHw_REG_AUDIO_CHANNEL_ENABLE_APM_CLOCK 0x00000080 /* Enable APM clock */
412
413/* Misc. chip control defines */
414#define chipcHw_REG_MISC_CTRL_GE_SEL 0x00040000 /* Select GE2/GE3 */
415#define chipcHw_REG_MISC_CTRL_I2S1_CLOCK_ONCHIP 0x00000000 /* Use on chip clock for I2S1 */
416#define chipcHw_REG_MISC_CTRL_I2S1_CLOCK_GPIO 0x00020000 /* Use external clock via GPIO pin 26 for I2S1 */
417#define chipcHw_REG_MISC_CTRL_I2S0_CLOCK_ONCHIP 0x00000000 /* Use on chip clock for I2S0 */
418#define chipcHw_REG_MISC_CTRL_I2S0_CLOCK_GPIO 0x00010000 /* Use external clock via GPIO pin 45 for I2S0 */
419#define chipcHw_REG_MISC_CTRL_ARM_CP15_DISABLE 0x00008000 /* Disable ARM CP15 bit */
420#define chipcHw_REG_MISC_CTRL_RTC_DISABLE 0x00000008 /* Disable RTC registers */
421#define chipcHw_REG_MISC_CTRL_BBRAM_DISABLE 0x00000004 /* Disable Battery Backed RAM */
422#define chipcHw_REG_MISC_CTRL_USB_MODE_HOST 0x00000002 /* Set USB as host */
423#define chipcHw_REG_MISC_CTRL_USB_MODE_DEVICE 0xFFFFFFFD /* Set USB as device */
424#define chipcHw_REG_MISC_CTRL_USB_POWERON 0xFFFFFFFE /* Power up USB */
425#define chipcHw_REG_MISC_CTRL_USB_POWEROFF 0x00000001 /* Power down USB */
426
427/* OTP configuration defines */
428#define chipcHw_REG_OTP_SECURITY_OFF 0x0000020000000000ULL /* Security support is OFF */
429#define chipcHw_REG_OTP_SPU_SLOW 0x0000010000000000ULL /* Limited SPU throughput */
430#define chipcHw_REG_OTP_LCD_SPEED 0x0000000600000000ULL /* Set VPM speed one */
431#define chipcHw_REG_OTP_VPM_SPEED_1 0x0000000100000000ULL /* Set VPM speed one */
432#define chipcHw_REG_OTP_VPM_SPEED_0 0x0000000080000000ULL /* Set VPM speed zero */
433#define chipcHw_REG_OTP_AXI_SPEED 0x0000000060000000ULL /* Set maximum AXI bus speed */
434#define chipcHw_REG_OTP_APM_DISABLE 0x000000001F000000ULL /* Disable APM */
435#define chipcHw_REG_OTP_PIF_DISABLE 0x0000000000200000ULL /* Disable PIF */
436#define chipcHw_REG_OTP_VDEC_DISABLE 0x0000000000100000ULL /* Disable Video decoder */
437#define chipcHw_REG_OTP_BBL_DISABLE 0x0000000000080000ULL /* Disable RTC and BBRAM */
438#define chipcHw_REG_OTP_LED_DISABLE 0x0000000000040000ULL /* Disable LED */
439#define chipcHw_REG_OTP_GE_DISABLE 0x0000000000020000ULL /* Disable Graphics Engine */
440#define chipcHw_REG_OTP_LCD_DISABLE 0x0000000000010000ULL /* Disable LCD */
441#define chipcHw_REG_OTP_KEYPAD_DISABLE 0x0000000000008000ULL /* Disable keypad */
442#define chipcHw_REG_OTP_UART_DISABLE 0x0000000000004000ULL /* Disable UART */
443#define chipcHw_REG_OTP_SDIOH_DISABLE 0x0000000000003000ULL /* Disable SDIO host */
444#define chipcHw_REG_OTP_HSS_DISABLE 0x0000000000000C00ULL /* Disable HSS */
445#define chipcHw_REG_OTP_TSC_DISABLE 0x0000000000000200ULL /* Disable touch screen */
446#define chipcHw_REG_OTP_USB_DISABLE 0x0000000000000180ULL /* Disable USB */
447#define chipcHw_REG_OTP_SGMII_DISABLE 0x0000000000000060ULL /* Disable SGMII */
448#define chipcHw_REG_OTP_ETH_DISABLE 0x0000000000000018ULL /* Disable gigabit ethernet */
449#define chipcHw_REG_OTP_ETH_PHY_DISABLE 0x0000000000000006ULL /* Disable ethernet PHY */
450#define chipcHw_REG_OTP_VPM_DISABLE 0x0000000000000001ULL /* Disable VPM */
451
452/* Sticky bit defines */
453#define chipcHw_REG_STICKY_BOOT_DONE 0x00000001 /* Boot done */
454#define chipcHw_REG_STICKY_SOFT_RESET 0x00000002 /* ARM soft reset */
455#define chipcHw_REG_STICKY_GENERAL_1 0x00000004 /* General purpose bit 1 */
456#define chipcHw_REG_STICKY_GENERAL_2 0x00000008 /* General purpose bit 2 */
457#define chipcHw_REG_STICKY_GENERAL_3 0x00000010 /* General purpose bit 3 */
458#define chipcHw_REG_STICKY_GENERAL_4 0x00000020 /* General purpose bit 4 */
459#define chipcHw_REG_STICKY_GENERAL_5 0x00000040 /* General purpose bit 5 */
460#define chipcHw_REG_STICKY_POR_BROM 0x00000080 /* Special sticky bit for security - set in BROM to avoid other modes being entered */
461#define chipcHw_REG_STICKY_ARM_RESET 0x00000100 /* ARM reset */
462#define chipcHw_REG_STICKY_CHIP_SOFT_RESET 0x00000200 /* Chip soft reset */
463#define chipcHw_REG_STICKY_CHIP_WARM_RESET 0x00000400 /* Chip warm reset */
464#define chipcHw_REG_STICKY_WDOG_RESET 0x00000800 /* Watchdog reset */
465#define chipcHw_REG_STICKY_OTP_RESET 0x00001000 /* OTP reset */
466
467 /* HW phase alignment defines *//* Spare1 register definitions */
468#define chipcHw_REG_SPARE1_DDR_PHASE_INTR_ENABLE 0x80000000 /* Enable DDR phase align panic interrupt */
469#define chipcHw_REG_SPARE1_VPM_PHASE_INTR_ENABLE 0x40000000 /* Enable VPM phase align panic interrupt */
470#define chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE 0x00000002 /* Enable access to VPM using system BUS */
471#define chipcHw_REG_SPARE1_DDR_BUS_ACCESS_ENABLE 0x00000001 /* Enable access to DDR using system BUS */
472 /* DDRPhaseCtrl1 register definitions */
473#define chipcHw_REG_DDR_SW_PHASE_CTRL_ENABLE 0x80000000 /* Enable DDR SW phase alignment */
474#define chipcHw_REG_DDR_HW_PHASE_CTRL_ENABLE 0x40000000 /* Enable DDR HW phase alignment */
475#define chipcHw_REG_DDR_PHASE_VALUE_GE_MASK 0x0000007F /* DDR lower threshold for phase alignment */
476#define chipcHw_REG_DDR_PHASE_VALUE_GE_SHIFT 23
477#define chipcHw_REG_DDR_PHASE_VALUE_LE_MASK 0x0000007F /* DDR upper threshold for phase alignment */
478#define chipcHw_REG_DDR_PHASE_VALUE_LE_SHIFT 16
479#define chipcHw_REG_DDR_PHASE_ALIGN_WAIT_CYCLE_MASK 0x0000FFFF /* BUS Cycle to wait to run next DDR phase alignment */
480#define chipcHw_REG_DDR_PHASE_ALIGN_WAIT_CYCLE_SHIFT 0
481 /* VPMPhaseCtrl1 register definitions */
482#define chipcHw_REG_VPM_SW_PHASE_CTRL_ENABLE 0x80000000 /* Enable VPM SW phase alignment */
483#define chipcHw_REG_VPM_HW_PHASE_CTRL_ENABLE 0x40000000 /* Enable VPM HW phase alignment */
484#define chipcHw_REG_VPM_PHASE_VALUE_GE_MASK 0x0000007F /* VPM lower threshold for phase alignment */
485#define chipcHw_REG_VPM_PHASE_VALUE_GE_SHIFT 23
486#define chipcHw_REG_VPM_PHASE_VALUE_LE_MASK 0x0000007F /* VPM upper threshold for phase alignment */
487#define chipcHw_REG_VPM_PHASE_VALUE_LE_SHIFT 16
488#define chipcHw_REG_VPM_PHASE_ALIGN_WAIT_CYCLE_MASK 0x0000FFFF /* BUS Cycle to wait to complete the VPM phase alignment */
489#define chipcHw_REG_VPM_PHASE_ALIGN_WAIT_CYCLE_SHIFT 0
490 /* PhaseAlignStatus register definitions */
491#define chipcHw_REG_DDR_TIMEOUT_INTR_STATUS 0x80000000 /* DDR time out interrupt status */
492#define chipcHw_REG_DDR_PHASE_STATUS_MASK 0x0000007F /* DDR phase status value */
493#define chipcHw_REG_DDR_PHASE_STATUS_SHIFT 24
494#define chipcHw_REG_DDR_PHASE_ALIGNED 0x00800000 /* DDR Phase aligned status */
495#define chipcHw_REG_DDR_LOAD 0x00400000 /* Load DDR phase status */
496#define chipcHw_REG_DDR_PHASE_CTRL_MASK 0x0000003F /* DDR phase control value */
497#define chipcHw_REG_DDR_PHASE_CTRL_SHIFT 16
498#define chipcHw_REG_VPM_TIMEOUT_INTR_STATUS 0x80000000 /* VPM time out interrupt status */
499#define chipcHw_REG_VPM_PHASE_STATUS_MASK 0x0000007F /* VPM phase status value */
500#define chipcHw_REG_VPM_PHASE_STATUS_SHIFT 8
501#define chipcHw_REG_VPM_PHASE_ALIGNED 0x00000080 /* VPM Phase aligned status */
502#define chipcHw_REG_VPM_LOAD 0x00000040 /* Load VPM phase status */
503#define chipcHw_REG_VPM_PHASE_CTRL_MASK 0x0000003F /* VPM phase control value */
504#define chipcHw_REG_VPM_PHASE_CTRL_SHIFT 0
505 /* DDRPhaseCtrl2 register definitions */
506#define chipcHw_REG_DDR_INTR_SERVICED 0x02000000 /* Acknowledge that interrupt was serviced */
507#define chipcHw_REG_DDR_TIMEOUT_INTR_ENABLE 0x01000000 /* Enable time out interrupt */
508#define chipcHw_REG_DDR_LOAD_COUNT_PHASE_CTRL_MASK 0x0000000F /* Wait before toggling load_ch */
509#define chipcHw_REG_DDR_LOAD_COUNT_PHASE_CTRL_SHIFT 20
510#define chipcHw_REG_DDR_TOTAL_LOAD_COUNT_CTRL_MASK 0x0000000F /* Total wait to settle ph_ctrl and load_ch */
511#define chipcHw_REG_DDR_TOTAL_LOAD_COUNT_CTRL_SHIFT 16
512#define chipcHw_REG_DDR_PHASE_TIMEOUT_COUNT_MASK 0x0000FFFF /* Time out value for DDR HW phase alignment */
513#define chipcHw_REG_DDR_PHASE_TIMEOUT_COUNT_SHIFT 0
514 /* VPMPhaseCtrl2 register definitions */
515#define chipcHw_REG_VPM_INTR_SELECT_MASK 0x00000003 /* Interrupt select */
516#define chipcHw_REG_VPM_INTR_SELECT_SHIFT 26
517#define chipcHw_REG_VPM_INTR_DISABLE 0x00000000
518#define chipcHw_REG_VPM_INTR_FAST (0x1 << chipcHw_REG_VPM_INTR_SELECT_SHIFT)
519#define chipcHw_REG_VPM_INTR_MEDIUM (0x2 << chipcHw_REG_VPM_INTR_SELECT_SHIFT)
520#define chipcHw_REG_VPM_INTR_SLOW (0x3 << chipcHw_REG_VPM_INTR_SELECT_SHIFT)
521#define chipcHw_REG_VPM_INTR_SERVICED 0x02000000 /* Acknowledge that interrupt was serviced */
522#define chipcHw_REG_VPM_TIMEOUT_INTR_ENABLE 0x01000000 /* Enable time out interrupt */
523#define chipcHw_REG_VPM_LOAD_COUNT_PHASE_CTRL_MASK 0x0000000F /* Wait before toggling load_ch */
524#define chipcHw_REG_VPM_LOAD_COUNT_PHASE_CTRL_SHIFT 20
525#define chipcHw_REG_VPM_TOTAL_LOAD_COUNT_CTRL_MASK 0x0000000F /* Total wait cycle to settle ph_ctrl and load_ch */
526#define chipcHw_REG_VPM_TOTAL_LOAD_COUNT_CTRL_SHIFT 16
527#define chipcHw_REG_VPM_PHASE_TIMEOUT_COUNT_MASK 0x0000FFFF /* Time out value for VPM HW phase alignment */
528#define chipcHw_REG_VPM_PHASE_TIMEOUT_COUNT_SHIFT 0
529
530#endif /* CHIPCHW_REG_H */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h b/arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h
deleted file mode 100644
index f1b68e26fa6..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h
+++ /dev/null
@@ -1,872 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file ddrcReg.h
18*
19* @brief Register definitions for BCMRING DDR2 Controller and PHY
20*
21*/
22/****************************************************************************/
23
24#ifndef DDRC_REG_H
25#define DDRC_REG_H
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31/* ---- Include Files ---------------------------------------------------- */
32
33#include <csp/reg.h>
34#include <csp/stdint.h>
35
36#include <mach/csp/mm_io.h>
37
38/* ---- Public Constants and Types --------------------------------------- */
39
40/*********************************************************************/
41/* DDR2 Controller (ARM PL341) register definitions */
42/*********************************************************************/
43
44/* -------------------------------------------------------------------- */
45/* -------------------------------------------------------------------- */
46/* ARM PL341 DDR2 configuration registers, offset 0x000 */
47/* -------------------------------------------------------------------- */
48/* -------------------------------------------------------------------- */
49
50 typedef struct {
51 uint32_t memcStatus;
52 uint32_t memcCmd;
53 uint32_t directCmd;
54 uint32_t memoryCfg;
55 uint32_t refreshPrd;
56 uint32_t casLatency;
57 uint32_t writeLatency;
58 uint32_t tMrd;
59 uint32_t tRas;
60 uint32_t tRc;
61 uint32_t tRcd;
62 uint32_t tRfc;
63 uint32_t tRp;
64 uint32_t tRrd;
65 uint32_t tWr;
66 uint32_t tWtr;
67 uint32_t tXp;
68 uint32_t tXsr;
69 uint32_t tEsr;
70 uint32_t memoryCfg2;
71 uint32_t memoryCfg3;
72 uint32_t tFaw;
73 } ddrcReg_CTLR_MEMC_REG_t;
74
75#define ddrcReg_CTLR_MEMC_REG_OFFSET 0x0000
76#define ddrcReg_CTLR_MEMC_REGP ((volatile ddrcReg_CTLR_MEMC_REG_t *) (MM_IO_BASE_DDRC + ddrcReg_CTLR_MEMC_REG_OFFSET))
77
78/* ----------------------------------------------------- */
79
80#define ddrcReg_CTLR_MEMC_STATUS_BANKS_MASK (0x3 << 12)
81#define ddrcReg_CTLR_MEMC_STATUS_BANKS_4 (0x0 << 12)
82#define ddrcReg_CTLR_MEMC_STATUS_BANKS_8 (0x3 << 12)
83
84#define ddrcReg_CTLR_MEMC_STATUS_MONITORS_MASK (0x3 << 10)
85#define ddrcReg_CTLR_MEMC_STATUS_MONITORS_0 (0x0 << 10)
86#define ddrcReg_CTLR_MEMC_STATUS_MONITORS_1 (0x1 << 10)
87#define ddrcReg_CTLR_MEMC_STATUS_MONITORS_2 (0x2 << 10)
88#define ddrcReg_CTLR_MEMC_STATUS_MONITORS_4 (0x3 << 10)
89
90#define ddrcReg_CTLR_MEMC_STATUS_CHIPS_MASK (0x3 << 7)
91#define ddrcReg_CTLR_MEMC_STATUS_CHIPS_1 (0x0 << 7)
92#define ddrcReg_CTLR_MEMC_STATUS_CHIPS_2 (0x1 << 7)
93#define ddrcReg_CTLR_MEMC_STATUS_CHIPS_3 (0x2 << 7)
94#define ddrcReg_CTLR_MEMC_STATUS_CHIPS_4 (0x3 << 7)
95
96#define ddrcReg_CTLR_MEMC_STATUS_TYPE_MASK (0x7 << 4)
97#define ddrcReg_CTLR_MEMC_STATUS_TYPE_DDR2 (0x5 << 4)
98
99#define ddrcReg_CTLR_MEMC_STATUS_WIDTH_MASK (0x3 << 2)
100#define ddrcReg_CTLR_MEMC_STATUS_WIDTH_16 (0x0 << 2)
101#define ddrcReg_CTLR_MEMC_STATUS_WIDTH_32 (0x1 << 2)
102#define ddrcReg_CTLR_MEMC_STATUS_WIDTH_64 (0x2 << 2)
103#define ddrcReg_CTLR_MEMC_STATUS_WIDTH_128 (0x3 << 2)
104
105#define ddrcReg_CTLR_MEMC_STATUS_STATE_MASK (0x3 << 0)
106#define ddrcReg_CTLR_MEMC_STATUS_STATE_CONFIG (0x0 << 0)
107#define ddrcReg_CTLR_MEMC_STATUS_STATE_READY (0x1 << 0)
108#define ddrcReg_CTLR_MEMC_STATUS_STATE_PAUSED (0x2 << 0)
109#define ddrcReg_CTLR_MEMC_STATUS_STATE_LOWPWR (0x3 << 0)
110
111/* ----------------------------------------------------- */
112
113#define ddrcReg_CTLR_MEMC_CMD_MASK (0x7 << 0)
114#define ddrcReg_CTLR_MEMC_CMD_GO (0x0 << 0)
115#define ddrcReg_CTLR_MEMC_CMD_SLEEP (0x1 << 0)
116#define ddrcReg_CTLR_MEMC_CMD_WAKEUP (0x2 << 0)
117#define ddrcReg_CTLR_MEMC_CMD_PAUSE (0x3 << 0)
118#define ddrcReg_CTLR_MEMC_CMD_CONFIGURE (0x4 << 0)
119#define ddrcReg_CTLR_MEMC_CMD_ACTIVE_PAUSE (0x7 << 0)
120
121/* ----------------------------------------------------- */
122
123#define ddrcReg_CTLR_DIRECT_CMD_CHIP_SHIFT 20
124#define ddrcReg_CTLR_DIRECT_CMD_CHIP_MASK (0x3 << ddrcReg_CTLR_DIRECT_CMD_CHIP_SHIFT)
125
126#define ddrcReg_CTLR_DIRECT_CMD_TYPE_PRECHARGEALL (0x0 << 18)
127#define ddrcReg_CTLR_DIRECT_CMD_TYPE_AUTOREFRESH (0x1 << 18)
128#define ddrcReg_CTLR_DIRECT_CMD_TYPE_MODEREG (0x2 << 18)
129#define ddrcReg_CTLR_DIRECT_CMD_TYPE_NOP (0x3 << 18)
130
131#define ddrcReg_CTLR_DIRECT_CMD_BANK_SHIFT 16
132#define ddrcReg_CTLR_DIRECT_CMD_BANK_MASK (0x3 << ddrcReg_CTLR_DIRECT_CMD_BANK_SHIFT)
133
134#define ddrcReg_CTLR_DIRECT_CMD_ADDR_SHIFT 0
135#define ddrcReg_CTLR_DIRECT_CMD_ADDR_MASK (0x1ffff << ddrcReg_CTLR_DIRECT_CMD_ADDR_SHIFT)
136
137/* ----------------------------------------------------- */
138
139#define ddrcReg_CTLR_MEMORY_CFG_CHIP_CNT_MASK (0x3 << 21)
140#define ddrcReg_CTLR_MEMORY_CFG_CHIP_CNT_1 (0x0 << 21)
141#define ddrcReg_CTLR_MEMORY_CFG_CHIP_CNT_2 (0x1 << 21)
142#define ddrcReg_CTLR_MEMORY_CFG_CHIP_CNT_3 (0x2 << 21)
143#define ddrcReg_CTLR_MEMORY_CFG_CHIP_CNT_4 (0x3 << 21)
144
145#define ddrcReg_CTLR_MEMORY_CFG_QOS_ARID_MASK (0x7 << 18)
146#define ddrcReg_CTLR_MEMORY_CFG_QOS_ARID_3_0 (0x0 << 18)
147#define ddrcReg_CTLR_MEMORY_CFG_QOS_ARID_4_1 (0x1 << 18)
148#define ddrcReg_CTLR_MEMORY_CFG_QOS_ARID_5_2 (0x2 << 18)
149#define ddrcReg_CTLR_MEMORY_CFG_QOS_ARID_6_3 (0x3 << 18)
150#define ddrcReg_CTLR_MEMORY_CFG_QOS_ARID_7_4 (0x4 << 18)
151#define ddrcReg_CTLR_MEMORY_CFG_QOS_ARID_8_5 (0x5 << 18)
152#define ddrcReg_CTLR_MEMORY_CFG_QOS_ARID_9_6 (0x6 << 18)
153#define ddrcReg_CTLR_MEMORY_CFG_QOS_ARID_10_7 (0x7 << 18)
154
155#define ddrcReg_CTLR_MEMORY_CFG_BURST_LEN_MASK (0x7 << 15)
156#define ddrcReg_CTLR_MEMORY_CFG_BURST_LEN_4 (0x2 << 15)
157#define ddrcReg_CTLR_MEMORY_CFG_BURST_LEN_8 (0x3 << 15) /* @note Not supported in PL341 */
158
159#define ddrcReg_CTLR_MEMORY_CFG_PWRDOWN_ENABLE (0x1 << 13)
160
161#define ddrcReg_CTLR_MEMORY_CFG_PWRDOWN_CYCLES_SHIFT 7
162#define ddrcReg_CTLR_MEMORY_CFG_PWRDOWN_CYCLES_MASK (0x3f << ddrcReg_CTLR_MEMORY_CFG_PWRDOWN_CYCLES_SHIFT)
163
164#define ddrcReg_CTLR_MEMORY_CFG_AXI_ROW_BITS_MASK (0x7 << 3)
165#define ddrcReg_CTLR_MEMORY_CFG_AXI_ROW_BITS_11 (0x0 << 3)
166#define ddrcReg_CTLR_MEMORY_CFG_AXI_ROW_BITS_12 (0x1 << 3)
167#define ddrcReg_CTLR_MEMORY_CFG_AXI_ROW_BITS_13 (0x2 << 3)
168#define ddrcReg_CTLR_MEMORY_CFG_AXI_ROW_BITS_14 (0x3 << 3)
169#define ddrcReg_CTLR_MEMORY_CFG_AXI_ROW_BITS_15 (0x4 << 3)
170#define ddrcReg_CTLR_MEMORY_CFG_AXI_ROW_BITS_16 (0x5 << 3)
171
172#define ddrcReg_CTLR_MEMORY_CFG_AXI_COL_BITS_MASK (0x7 << 0)
173#define ddrcReg_CTLR_MEMORY_CFG_AXI_COL_BITS_9 (0x1 << 0)
174#define ddrcReg_CTLR_MEMORY_CFG_AXI_COL_BITS_10 (0x2 << 0)
175#define ddrcReg_CTLR_MEMORY_CFG_AXI_COL_BITS_11 (0x3 << 0)
176
177/* ----------------------------------------------------- */
178
179#define ddrcReg_CTLR_REFRESH_PRD_SHIFT 0
180#define ddrcReg_CTLR_REFRESH_PRD_MASK (0x7fff << ddrcReg_CTLR_REFRESH_PRD_SHIFT)
181
182/* ----------------------------------------------------- */
183
184#define ddrcReg_CTLR_CAS_LATENCY_SHIFT 1
185#define ddrcReg_CTLR_CAS_LATENCY_MASK (0x7 << ddrcReg_CTLR_CAS_LATENCY_SHIFT)
186
187/* ----------------------------------------------------- */
188
189#define ddrcReg_CTLR_WRITE_LATENCY_SHIFT 0
190#define ddrcReg_CTLR_WRITE_LATENCY_MASK (0x7 << ddrcReg_CTLR_WRITE_LATENCY_SHIFT)
191
192/* ----------------------------------------------------- */
193
194#define ddrcReg_CTLR_T_MRD_SHIFT 0
195#define ddrcReg_CTLR_T_MRD_MASK (0x7f << ddrcReg_CTLR_T_MRD_SHIFT)
196
197/* ----------------------------------------------------- */
198
199#define ddrcReg_CTLR_T_RAS_SHIFT 0
200#define ddrcReg_CTLR_T_RAS_MASK (0x1f << ddrcReg_CTLR_T_RAS_SHIFT)
201
202/* ----------------------------------------------------- */
203
204#define ddrcReg_CTLR_T_RC_SHIFT 0
205#define ddrcReg_CTLR_T_RC_MASK (0x1f << ddrcReg_CTLR_T_RC_SHIFT)
206
207/* ----------------------------------------------------- */
208
209#define ddrcReg_CTLR_T_RCD_SCHEDULE_DELAY_SHIFT 8
210#define ddrcReg_CTLR_T_RCD_SCHEDULE_DELAY_MASK (0x7 << ddrcReg_CTLR_T_RCD_SCHEDULE_DELAY_SHIFT)
211
212#define ddrcReg_CTLR_T_RCD_SHIFT 0
213#define ddrcReg_CTLR_T_RCD_MASK (0x7 << ddrcReg_CTLR_T_RCD_SHIFT)
214
215/* ----------------------------------------------------- */
216
217#define ddrcReg_CTLR_T_RFC_SCHEDULE_DELAY_SHIFT 8
218#define ddrcReg_CTLR_T_RFC_SCHEDULE_DELAY_MASK (0x7f << ddrcReg_CTLR_T_RFC_SCHEDULE_DELAY_SHIFT)
219
220#define ddrcReg_CTLR_T_RFC_SHIFT 0
221#define ddrcReg_CTLR_T_RFC_MASK (0x7f << ddrcReg_CTLR_T_RFC_SHIFT)
222
223/* ----------------------------------------------------- */
224
225#define ddrcReg_CTLR_T_RP_SCHEDULE_DELAY_SHIFT 8
226#define ddrcReg_CTLR_T_RP_SCHEDULE_DELAY_MASK (0x7 << ddrcReg_CTLR_T_RP_SCHEDULE_DELAY_SHIFT)
227
228#define ddrcReg_CTLR_T_RP_SHIFT 0
229#define ddrcReg_CTLR_T_RP_MASK (0xf << ddrcReg_CTLR_T_RP_SHIFT)
230
231/* ----------------------------------------------------- */
232
233#define ddrcReg_CTLR_T_RRD_SHIFT 0
234#define ddrcReg_CTLR_T_RRD_MASK (0xf << ddrcReg_CTLR_T_RRD_SHIFT)
235
236/* ----------------------------------------------------- */
237
238#define ddrcReg_CTLR_T_WR_SHIFT 0
239#define ddrcReg_CTLR_T_WR_MASK (0x7 << ddrcReg_CTLR_T_WR_SHIFT)
240
241/* ----------------------------------------------------- */
242
243#define ddrcReg_CTLR_T_WTR_SHIFT 0
244#define ddrcReg_CTLR_T_WTR_MASK (0x7 << ddrcReg_CTLR_T_WTR_SHIFT)
245
246/* ----------------------------------------------------- */
247
248#define ddrcReg_CTLR_T_XP_SHIFT 0
249#define ddrcReg_CTLR_T_XP_MASK (0xff << ddrcReg_CTLR_T_XP_SHIFT)
250
251/* ----------------------------------------------------- */
252
253#define ddrcReg_CTLR_T_XSR_SHIFT 0
254#define ddrcReg_CTLR_T_XSR_MASK (0xff << ddrcReg_CTLR_T_XSR_SHIFT)
255
256/* ----------------------------------------------------- */
257
258#define ddrcReg_CTLR_T_ESR_SHIFT 0
259#define ddrcReg_CTLR_T_ESR_MASK (0xff << ddrcReg_CTLR_T_ESR_SHIFT)
260
261/* ----------------------------------------------------- */
262
263#define ddrcReg_CTLR_MEMORY_CFG2_WIDTH_MASK (0x3 << 6)
264#define ddrcReg_CTLR_MEMORY_CFG2_WIDTH_16BITS (0 << 6)
265#define ddrcReg_CTLR_MEMORY_CFG2_WIDTH_32BITS (1 << 6)
266#define ddrcReg_CTLR_MEMORY_CFG2_WIDTH_64BITS (2 << 6)
267
268#define ddrcReg_CTLR_MEMORY_CFG2_AXI_BANK_BITS_MASK (0x3 << 4)
269#define ddrcReg_CTLR_MEMORY_CFG2_AXI_BANK_BITS_2 (0 << 4)
270#define ddrcReg_CTLR_MEMORY_CFG2_AXI_BANK_BITS_3 (3 << 4)
271
272#define ddrcReg_CTLR_MEMORY_CFG2_CKE_INIT_STATE_LOW (0 << 3)
273#define ddrcReg_CTLR_MEMORY_CFG2_CKE_INIT_STATE_HIGH (1 << 3)
274
275#define ddrcReg_CTLR_MEMORY_CFG2_DQM_INIT_STATE_LOW (0 << 2)
276#define ddrcReg_CTLR_MEMORY_CFG2_DQM_INIT_STATE_HIGH (1 << 2)
277
278#define ddrcReg_CTLR_MEMORY_CFG2_CLK_MASK (0x3 << 0)
279#define ddrcReg_CTLR_MEMORY_CFG2_CLK_ASYNC (0 << 0)
280#define ddrcReg_CTLR_MEMORY_CFG2_CLK_SYNC_A_LE_M (1 << 0)
281#define ddrcReg_CTLR_MEMORY_CFG2_CLK_SYNC_A_GT_M (3 << 0)
282
283/* ----------------------------------------------------- */
284
285#define ddrcReg_CTLR_MEMORY_CFG3_REFRESH_TO_SHIFT 0
286#define ddrcReg_CTLR_MEMORY_CFG3_REFRESH_TO_MASK (0x7 << ddrcReg_CTLR_MEMORY_CFG3_REFRESH_TO_SHIFT)
287
288/* ----------------------------------------------------- */
289
290#define ddrcReg_CTLR_T_FAW_SCHEDULE_DELAY_SHIFT 8
291#define ddrcReg_CTLR_T_FAW_SCHEDULE_DELAY_MASK (0x1f << ddrcReg_CTLR_T_FAW_SCHEDULE_DELAY_SHIFT)
292
293#define ddrcReg_CTLR_T_FAW_PERIOD_SHIFT 0
294#define ddrcReg_CTLR_T_FAW_PERIOD_MASK (0x1f << ddrcReg_CTLR_T_FAW_PERIOD_SHIFT)
295
296/* -------------------------------------------------------------------- */
297/* -------------------------------------------------------------------- */
298/* ARM PL341 AXI ID QOS configuration registers, offset 0x100 */
299/* -------------------------------------------------------------------- */
300/* -------------------------------------------------------------------- */
301
302#define ddrcReg_CTLR_QOS_CNT 16
303#define ddrcReg_CTLR_QOS_MAX (ddrcReg_CTLR_QOS_CNT - 1)
304
305 typedef struct {
306 uint32_t cfg[ddrcReg_CTLR_QOS_CNT];
307 } ddrcReg_CTLR_QOS_REG_t;
308
309#define ddrcReg_CTLR_QOS_REG_OFFSET 0x100
310#define ddrcReg_CTLR_QOS_REGP ((volatile ddrcReg_CTLR_QOS_REG_t *) (MM_IO_BASE_DDRC + ddrcReg_CTLR_QOS_REG_OFFSET))
311
312/* ----------------------------------------------------- */
313
314#define ddrcReg_CTLR_QOS_CFG_MAX_SHIFT 2
315#define ddrcReg_CTLR_QOS_CFG_MAX_MASK (0xff << ddrcReg_CTLR_QOS_CFG_MAX_SHIFT)
316
317#define ddrcReg_CTLR_QOS_CFG_MIN_SHIFT 1
318#define ddrcReg_CTLR_QOS_CFG_MIN_MASK (1 << ddrcReg_CTLR_QOS_CFG_MIN_SHIFT)
319
320#define ddrcReg_CTLR_QOS_CFG_ENABLE (1 << 0)
321
322/* -------------------------------------------------------------------- */
323/* -------------------------------------------------------------------- */
324/* ARM PL341 Memory chip configuration registers, offset 0x200 */
325/* -------------------------------------------------------------------- */
326/* -------------------------------------------------------------------- */
327
328#define ddrcReg_CTLR_CHIP_CNT 4
329#define ddrcReg_CTLR_CHIP_MAX (ddrcReg_CTLR_CHIP_CNT - 1)
330
331 typedef struct {
332 uint32_t cfg[ddrcReg_CTLR_CHIP_CNT];
333 } ddrcReg_CTLR_CHIP_REG_t;
334
335#define ddrcReg_CTLR_CHIP_REG_OFFSET 0x200
336#define ddrcReg_CTLR_CHIP_REGP ((volatile ddrcReg_CTLR_CHIP_REG_t *) (MM_IO_BASE_DDRC + ddrcReg_CTLR_CHIP_REG_OFFSET))
337
338/* ----------------------------------------------------- */
339
340#define ddrcReg_CTLR_CHIP_CFG_MEM_ORG_MASK (1 << 16)
341#define ddrcReg_CTLR_CHIP_CFG_MEM_ORG_ROW_BANK_COL (0 << 16)
342#define ddrcReg_CTLR_CHIP_CFG_MEM_ORG_BANK_ROW_COL (1 << 16)
343
344#define ddrcReg_CTLR_CHIP_CFG_AXI_ADDR_MATCH_SHIFT 8
345#define ddrcReg_CTLR_CHIP_CFG_AXI_ADDR_MATCH_MASK (0xff << ddrcReg_CTLR_CHIP_CFG_AXI_ADDR_MATCH_SHIFT)
346
347#define ddrcReg_CTLR_CHIP_CFG_AXI_ADDR_MASK_SHIFT 0
348#define ddrcReg_CTLR_CHIP_CFG_AXI_ADDR_MASK_MASK (0xff << ddrcReg_CTLR_CHIP_CFG_AXI_ADDR_MASK_SHIFT)
349
350/* -------------------------------------------------------------------- */
351/* -------------------------------------------------------------------- */
352/* ARM PL341 User configuration registers, offset 0x300 */
353/* -------------------------------------------------------------------- */
354/* -------------------------------------------------------------------- */
355
356#define ddrcReg_CTLR_USER_OUTPUT_CNT 2
357
358 typedef struct {
359 uint32_t input;
360 uint32_t output[ddrcReg_CTLR_USER_OUTPUT_CNT];
361 uint32_t feature;
362 } ddrcReg_CTLR_USER_REG_t;
363
364#define ddrcReg_CTLR_USER_REG_OFFSET 0x300
365#define ddrcReg_CTLR_USER_REGP ((volatile ddrcReg_CTLR_USER_REG_t *) (MM_IO_BASE_DDRC + ddrcReg_CTLR_USER_REG_OFFSET))
366
367/* ----------------------------------------------------- */
368
369#define ddrcReg_CTLR_USER_INPUT_STATUS_SHIFT 0
370#define ddrcReg_CTLR_USER_INPUT_STATUS_MASK (0xff << ddrcReg_CTLR_USER_INPUT_STATUS_SHIFT)
371
372/* ----------------------------------------------------- */
373
374#define ddrcReg_CTLR_USER_OUTPUT_CFG_SHIFT 0
375#define ddrcReg_CTLR_USER_OUTPUT_CFG_MASK (0xff << ddrcReg_CTLR_USER_OUTPUT_CFG_SHIFT)
376
377#define ddrcReg_CTLR_USER_OUTPUT_0_CFG_SYNC_BRIDGE_SHIFT 1
378#define ddrcReg_CTLR_USER_OUTPUT_0_CFG_SYNC_BRIDGE_MASK (1 << ddrcReg_CTLR_USER_OUTPUT_0_CFG_SYNC_BRIDGE_SHIFT)
379#define ddrcReg_CTLR_USER_OUTPUT_0_CFG_SYNC_BRIDGE_BP134 (0 << ddrcReg_CTLR_USER_OUTPUT_0_CFG_SYNC_BRIDGE_SHIFT)
380#define ddrcReg_CTLR_USER_OUTPUT_0_CFG_SYNC_BRIDGE_PL301 (1 << ddrcReg_CTLR_USER_OUTPUT_0_CFG_SYNC_BRIDGE_SHIFT)
381#define ddrcReg_CTLR_USER_OUTPUT_0_CFG_SYNC_BRIDGE_REGISTERED ddrcReg_CTLR_USER_OUTPUT_0_CFG_SYNC_BRIDGE_PL301
382
383/* ----------------------------------------------------- */
384
385#define ddrcReg_CTLR_FEATURE_WRITE_BLOCK_DISABLE (1 << 2)
386#define ddrcReg_CTLR_FEATURE_EARLY_BURST_RSP_DISABLE (1 << 0)
387
388/*********************************************************************/
389/* Broadcom DDR23 PHY register definitions */
390/*********************************************************************/
391
392/* -------------------------------------------------------------------- */
393/* -------------------------------------------------------------------- */
394/* Broadcom DDR23 PHY Address and Control register definitions */
395/* -------------------------------------------------------------------- */
396/* -------------------------------------------------------------------- */
397
398 typedef struct {
399 uint32_t revision;
400 uint32_t pmCtl;
401 REG32_RSVD(0x0008, 0x0010);
402 uint32_t pllStatus;
403 uint32_t pllCfg;
404 uint32_t pllPreDiv;
405 uint32_t pllDiv;
406 uint32_t pllCtl1;
407 uint32_t pllCtl2;
408 uint32_t ssCtl;
409 uint32_t ssCfg;
410 uint32_t vdlStatic;
411 uint32_t vdlDynamic;
412 uint32_t padIdle;
413 uint32_t pvtComp;
414 uint32_t padDrive;
415 uint32_t clkRgltrCtl;
416 } ddrcReg_PHY_ADDR_CTL_REG_t;
417
418#define ddrcReg_PHY_ADDR_CTL_REG_OFFSET 0x0400
419#define ddrcReg_PHY_ADDR_CTL_REGP ((volatile ddrcReg_PHY_ADDR_CTL_REG_t *) (MM_IO_BASE_DDRC + ddrcReg_PHY_ADDR_CTL_REG_OFFSET))
420
421/* @todo These SS definitions are duplicates of ones below */
422
423#define ddrcReg_PHY_ADDR_SS_CTRL_ENABLE 0x00000001
424#define ddrcReg_PHY_ADDR_SS_CFG_CYCLE_PER_TICK_MASK 0xFFFF0000
425#define ddrcReg_PHY_ADDR_SS_CFG_CYCLE_PER_TICK_SHIFT 16
426#define ddrcReg_PHY_ADDR_SS_CFG_MIN_CYCLE_PER_TICK 10 /* Higher the value, lower the SS modulation frequency */
427#define ddrcReg_PHY_ADDR_SS_CFG_NDIV_AMPLITUDE_MASK 0x0000FFFF
428#define ddrcReg_PHY_ADDR_SS_CFG_NDIV_AMPLITUDE_SHIFT 0
429
430/* ----------------------------------------------------- */
431
432#define ddrcReg_PHY_ADDR_CTL_REVISION_MAJOR_SHIFT 8
433#define ddrcReg_PHY_ADDR_CTL_REVISION_MAJOR_MASK (0xff << ddrcReg_PHY_ADDR_CTL_REVISION_MAJOR_SHIFT)
434
435#define ddrcReg_PHY_ADDR_CTL_REVISION_MINOR_SHIFT 0
436#define ddrcReg_PHY_ADDR_CTL_REVISION_MINOR_MASK (0xff << ddrcReg_PHY_ADDR_CTL_REVISION_MINOR_SHIFT)
437
438/* ----------------------------------------------------- */
439
440#define ddrcReg_PHY_ADDR_CTL_CLK_PM_CTL_DDR_CLK_DISABLE (1 << 0)
441
442/* ----------------------------------------------------- */
443
444#define ddrcReg_PHY_ADDR_CTL_PLL_STATUS_LOCKED (1 << 0)
445
446/* ----------------------------------------------------- */
447
448#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_DIV2_CLK_RESET (1 << 31)
449
450#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_TEST_SEL_SHIFT 17
451#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_TEST_SEL_MASK (0x1f << ddrcReg_PHY_ADDR_CTL_PLL_CFG_TEST_SEL_SHIFT)
452
453#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_TEST_ENABLE (1 << 16)
454
455#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_BGAP_ADJ_SHIFT 12
456#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_BGAP_ADJ_MASK (0xf << ddrcReg_PHY_ADDR_CTL_PLL_CFG_BGAP_ADJ_SHIFT)
457
458#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_VCO_RNG (1 << 7)
459#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_CH1_PWRDWN (1 << 6)
460#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_BYPASS_ENABLE (1 << 5)
461#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_CLKOUT_ENABLE (1 << 4)
462#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_D_RESET (1 << 3)
463#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_A_RESET (1 << 2)
464#define ddrcReg_PHY_ADDR_CTL_PLL_CFG_PWRDWN (1 << 0)
465
466/* ----------------------------------------------------- */
467
468#define ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_DITHER_MFB (1 << 26)
469#define ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_PWRDWN (1 << 25)
470
471#define ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_MODE_SHIFT 20
472#define ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_MODE_MASK (0x7 << ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_MODE_SHIFT)
473
474#define ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_INT_SHIFT 8
475#define ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_INT_MASK (0x1ff << ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_INT_SHIFT)
476
477#define ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_P2_SHIFT 4
478#define ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_P2_MASK (0xf << ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_P2_SHIFT)
479
480#define ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_P1_SHIFT 0
481#define ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_P1_MASK (0xf << ddrcReg_PHY_ADDR_CTL_PLL_PRE_DIV_P1_SHIFT)
482
483/* ----------------------------------------------------- */
484
485#define ddrcReg_PHY_ADDR_CTL_PLL_DIV_M1_SHIFT 24
486#define ddrcReg_PHY_ADDR_CTL_PLL_DIV_M1_MASK (0xff << ddrcReg_PHY_ADDR_CTL_PLL_DIV_M1_SHIFT)
487
488#define ddrcReg_PHY_ADDR_CTL_PLL_DIV_FRAC_SHIFT 0
489#define ddrcReg_PHY_ADDR_CTL_PLL_DIV_FRAC_MASK (0xffffff << ddrcReg_PHY_ADDR_CTL_PLL_DIV_FRAC_SHIFT)
490
491/* ----------------------------------------------------- */
492
493#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_TESTA_SHIFT 30
494#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_TESTA_MASK (0x3 << ddrcReg_PHY_ADDR_CTL_PLL_CTL1_TESTA_SHIFT)
495
496#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_KVCO_XS_SHIFT 27
497#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_KVCO_XS_MASK (0x7 << ddrcReg_PHY_ADDR_CTL_PLL_CTL1_KVCO_XS_SHIFT)
498
499#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_KVCO_XF_SHIFT 24
500#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_KVCO_XF_MASK (0x7 << ddrcReg_PHY_ADDR_CTL_PLL_CTL1_KVCO_XF_SHIFT)
501
502#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_LPF_BW_SHIFT 22
503#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_LPF_BW_MASK (0x3 << ddrcReg_PHY_ADDR_CTL_PLL_CTL1_LPF_BW_SHIFT)
504
505#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_LF_ORDER (0x1 << 21)
506
507#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_CN_SHIFT 19
508#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_CN_MASK (0x3 << ddrcReg_PHY_ADDR_CTL_PLL_CTL1_CN_SHIFT)
509
510#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_RN_SHIFT 17
511#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_RN_MASK (0x3 << ddrcReg_PHY_ADDR_CTL_PLL_CTL1_RN_SHIFT)
512
513#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_CP_SHIFT 15
514#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_CP_MASK (0x3 << ddrcReg_PHY_ADDR_CTL_PLL_CTL1_CP_SHIFT)
515
516#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_CZ_SHIFT 13
517#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_CZ_MASK (0x3 << ddrcReg_PHY_ADDR_CTL_PLL_CTL1_CZ_SHIFT)
518
519#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_RZ_SHIFT 10
520#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_RZ_MASK (0x7 << ddrcReg_PHY_ADDR_CTL_PLL_CTL1_RZ_SHIFT)
521
522#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_ICPX_SHIFT 5
523#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_ICPX_MASK (0x1f << ddrcReg_PHY_ADDR_CTL_PLL_CTL1_ICPX_SHIFT)
524
525#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_ICP_OFF_SHIFT 0
526#define ddrcReg_PHY_ADDR_CTL_PLL_CTL1_ICP_OFF_MASK (0x1f << ddrcReg_PHY_ADDR_CTL_PLL_CTL1_ICP_OFF_SHIFT)
527
528/* ----------------------------------------------------- */
529#define ddrcReg_PHY_ADDR_CTL_PLL_CTL2_PTAP_ADJ_SHIFT 4
530#define ddrcReg_PHY_ADDR_CTL_PLL_CTL2_PTAP_ADJ_MASK (0x3 << ddrcReg_PHY_ADDR_CTL_PLL_CTL2_PTAP_ADJ_SHIFT)
531
532#define ddrcReg_PHY_ADDR_CTL_PLL_CTL2_CTAP_ADJ_SHIFT 2
533#define ddrcReg_PHY_ADDR_CTL_PLL_CTL2_CTAP_ADJ_MASK (0x3 << ddrcReg_PHY_ADDR_CTL_PLL_CTL2_CTAP_ADJ_SHIFT)
534
535#define ddrcReg_PHY_ADDR_CTL_PLL_CTL2_LOWCUR_ENABLE (0x1 << 1)
536#define ddrcReg_PHY_ADDR_CTL_PLL_CTL2_BIASIN_ENABLE (0x1 << 0)
537
538/* ----------------------------------------------------- */
539
540#define ddrcReg_PHY_ADDR_CTL_PLL_SS_EN_ENABLE (0x1 << 0)
541
542/* ----------------------------------------------------- */
543
544#define ddrcReg_PHY_ADDR_CTL_PLL_SS_CFG_CYC_PER_TICK_SHIFT 16
545#define ddrcReg_PHY_ADDR_CTL_PLL_SS_CFG_CYC_PER_TICK_MASK (0xffff << ddrcReg_PHY_ADDR_CTL_PLL_SS_CFG_CYC_PER_TICK_SHIFT)
546
547#define ddrcReg_PHY_ADDR_CTL_PLL_SS_CFG_NDIV_AMP_SHIFT 0
548#define ddrcReg_PHY_ADDR_CTL_PLL_SS_CFG_NDIV_AMP_MASK (0xffff << ddrcReg_PHY_ADDR_CTL_PLL_SS_CFG_NDIV_AMP_SHIFT)
549
550/* ----------------------------------------------------- */
551
552#define ddrcReg_PHY_ADDR_CTL_VDL_STATIC_OVR_FORCE (1 << 20)
553#define ddrcReg_PHY_ADDR_CTL_VDL_STATIC_OVR_ENABLE (1 << 16)
554
555#define ddrcReg_PHY_ADDR_CTL_VDL_STATIC_OVR_FALL_SHIFT 12
556#define ddrcReg_PHY_ADDR_CTL_VDL_STATIC_OVR_FALL_MASK (0x3 << ddrcReg_PHY_ADDR_CTL_VDL_STATIC_OVR_FALL_SHIFT)
557
558#define ddrcReg_PHY_ADDR_CTL_VDL_STATIC_OVR_RISE_SHIFT 8
559#define ddrcReg_PHY_ADDR_CTL_VDL_STATIC_OVR_RISE_MASK (0x3 << ddrcReg_PHY_ADDR_CTL_VDL_STATIC_OVR_RISE_SHIFT)
560
561#define ddrcReg_PHY_ADDR_CTL_VDL_STATIC_OVR_STEP_SHIFT 0
562#define ddrcReg_PHY_ADDR_CTL_VDL_STATIC_OVR_STEP_MASK (0x3f << ddrcReg_PHY_ADDR_CTL_VDL_STATIC_OVR_STEP_SHIFT)
563
564/* ----------------------------------------------------- */
565
566#define ddrcReg_PHY_ADDR_CTL_VDL_DYNAMIC_OVR_ENABLE (1 << 16)
567
568#define ddrcReg_PHY_ADDR_CTL_VDL_DYNAMIC_OVR_FALL_SHIFT 12
569#define ddrcReg_PHY_ADDR_CTL_VDL_DYNAMIC_OVR_FALL_MASK (0x3 << ddrcReg_PHY_ADDR_CTL_VDL_DYNAMIC_OVR_FALL_SHIFT)
570
571#define ddrcReg_PHY_ADDR_CTL_VDL_DYNAMIC_OVR_RISE_SHIFT 8
572#define ddrcReg_PHY_ADDR_CTL_VDL_DYNAMIC_OVR_RISE_MASK (0x3 << ddrcReg_PHY_ADDR_CTL_VDL_DYNAMIC_OVR_RISE_SHIFT)
573
574#define ddrcReg_PHY_ADDR_CTL_VDL_DYNAMIC_OVR_STEP_SHIFT 0
575#define ddrcReg_PHY_ADDR_CTL_VDL_DYNAMIC_OVR_STEP_MASK (0x3f << ddrcReg_PHY_ADDR_CTL_VDL_DYNAMIC_OVR_STEP_SHIFT)
576
577/* ----------------------------------------------------- */
578
579#define ddrcReg_PHY_ADDR_CTL_PAD_IDLE_ENABLE (1u << 31)
580#define ddrcReg_PHY_ADDR_CTL_PAD_IDLE_RXENB_DISABLE (1 << 8)
581#define ddrcReg_PHY_ADDR_CTL_PAD_IDLE_CTL_IDDQ_DISABLE (1 << 6)
582#define ddrcReg_PHY_ADDR_CTL_PAD_IDLE_CTL_REB_DISABLE (1 << 5)
583#define ddrcReg_PHY_ADDR_CTL_PAD_IDLE_CTL_OEB_DISABLE (1 << 4)
584#define ddrcReg_PHY_ADDR_CTL_PAD_IDLE_CKE_IDDQ_DISABLE (1 << 2)
585#define ddrcReg_PHY_ADDR_CTL_PAD_IDLE_CKE_REB_DISABLE (1 << 1)
586#define ddrcReg_PHY_ADDR_CTL_PAD_IDLE_CKE_OEB_DISABLE (1 << 0)
587
588/* ----------------------------------------------------- */
589
590#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_PD_DONE (1 << 30)
591#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_ND_DONE (1 << 29)
592#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_SAMPLE_DONE (1 << 28)
593#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_SAMPLE_AUTO_ENABLE (1 << 27)
594#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_SAMPLE_ENABLE (1 << 26)
595#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_ADDR_OVR_ENABLE (1 << 25)
596#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_DQ_OVR_ENABLE (1 << 24)
597
598#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_PD_SHIFT 20
599#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_PD_MASK (0xf << ddrcReg_PHY_ADDR_CTL_PVT_COMP_PD_SHIFT)
600
601#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_ND_SHIFT 16
602#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_ND_MASK (0xf << ddrcReg_PHY_ADDR_CTL_PVT_COMP_ND_SHIFT)
603
604#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_ADDR_PD_SHIFT 12
605#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_ADDR_PD_MASK (0xf << ddrcReg_PHY_ADDR_CTL_PVT_COMP_ADDR_PD_SHIFT)
606
607#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_ADDR_ND_SHIFT 8
608#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_ADDR_ND_MASK (0xf << ddrcReg_PHY_ADDR_CTL_PVT_COMP_ADDR_ND_SHIFT)
609
610#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_DQ_PD_SHIFT 4
611#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_DQ_PD_MASK (0xf << ddrcReg_PHY_ADDR_CTL_PVT_COMP_DQ_PD_SHIFT)
612
613#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_DQ_ND_SHIFT 0
614#define ddrcReg_PHY_ADDR_CTL_PVT_COMP_DQ_ND_MASK (0xf << ddrcReg_PHY_ADDR_CTL_PVT_COMP_DQ_ND_SHIFT)
615
616/* ----------------------------------------------------- */
617
618#define ddrcReg_PHY_ADDR_CTL_PAD_DRIVE_RT60B (1 << 4)
619#define ddrcReg_PHY_ADDR_CTL_PAD_DRIVE_SEL_SSTL18 (1 << 3)
620#define ddrcReg_PHY_ADDR_CTL_PAD_DRIVE_SELTXDRV_CI (1 << 2)
621#define ddrcReg_PHY_ADDR_CTL_PAD_DRIVE_SELRXDRV (1 << 1)
622#define ddrcReg_PHY_ADDR_CTL_PAD_DRIVE_SLEW (1 << 0)
623
624/* ----------------------------------------------------- */
625
626#define ddrcReg_PHY_ADDR_CTL_CLK_RGLTR_CTL_PWR_HALF (1 << 1)
627#define ddrcReg_PHY_ADDR_CTL_CLK_RGLTR_CTL_PWR_OFF (1 << 0)
628
629/* -------------------------------------------------------------------- */
630/* -------------------------------------------------------------------- */
631/* Broadcom DDR23 PHY Byte Lane register definitions */
632/* -------------------------------------------------------------------- */
633/* -------------------------------------------------------------------- */
634
635#define ddrcReg_PHY_BYTE_LANE_CNT 2
636#define ddrcReg_PHY_BYTE_LANE_MAX (ddrcReg_CTLR_BYTE_LANE_CNT - 1)
637
638#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_CNT 8
639
640 typedef struct {
641 uint32_t revision;
642 uint32_t vdlCalibrate;
643 uint32_t vdlStatus;
644 REG32_RSVD(0x000c, 0x0010);
645 uint32_t vdlOverride[ddrcReg_PHY_BYTE_LANE_VDL_OVR_CNT];
646 uint32_t readCtl;
647 uint32_t readStatus;
648 uint32_t readClear;
649 uint32_t padIdleCtl;
650 uint32_t padDriveCtl;
651 uint32_t padClkCtl;
652 uint32_t writeCtl;
653 uint32_t clkRegCtl;
654 } ddrcReg_PHY_BYTE_LANE_REG_t;
655
656/* There are 2 instances of the byte Lane registers, one for each byte lane. */
657#define ddrcReg_PHY_BYTE_LANE_1_REG_OFFSET 0x0500
658#define ddrcReg_PHY_BYTE_LANE_2_REG_OFFSET 0x0600
659
660#define ddrcReg_PHY_BYTE_LANE_1_REGP ((volatile ddrcReg_PHY_BYTE_LANE_REG_t *) (MM_IO_BASE_DDRC + ddrcReg_PHY_BYTE_LANE_1_REG_OFFSET))
661#define ddrcReg_PHY_BYTE_LANE_2_REGP ((volatile ddrcReg_PHY_BYTE_LANE_REG_t *) (MM_IO_BASE_DDRC + ddrcReg_PHY_BYTE_LANE_2_REG_OFFSET))
662
663/* ----------------------------------------------------- */
664
665#define ddrcReg_PHY_BYTE_LANE_REVISION_MAJOR_SHIFT 8
666#define ddrcReg_PHY_BYTE_LANE_REVISION_MAJOR_MASK (0xff << ddrcReg_PHY_BYTE_LANE_REVISION_MAJOR_SHIFT)
667
668#define ddrcReg_PHY_BYTE_LANE_REVISION_MINOR_SHIFT 0
669#define ddrcReg_PHY_BYTE_LANE_REVISION_MINOR_MASK (0xff << ddrcReg_PHY_BYTE_LANE_REVISION_MINOR_SHIFT)
670
671/* ----------------------------------------------------- */
672
673#define ddrcReg_PHY_BYTE_LANE_VDL_CALIB_CLK_2CYCLE (1 << 4)
674#define ddrcReg_PHY_BYTE_LANE_VDL_CALIB_CLK_1CYCLE (0 << 4)
675
676#define ddrcReg_PHY_BYTE_LANE_VDL_CALIB_TEST (1 << 3)
677#define ddrcReg_PHY_BYTE_LANE_VDL_CALIB_ALWAYS (1 << 2)
678#define ddrcReg_PHY_BYTE_LANE_VDL_CALIB_ONCE (1 << 1)
679#define ddrcReg_PHY_BYTE_LANE_VDL_CALIB_FAST (1 << 0)
680
681/* ----------------------------------------------------- */
682
683/* The byte lane VDL status calibTotal[9:0] is comprised of [9:4] step value, [3:2] fine fall */
684/* and [1:0] fine rise. Note that calibTotal[9:0] is located at bit 4 in the VDL status */
685/* register. The fine rise and fall are no longer used, so add some definitions for just */
686/* the step setting to simplify things. */
687
688#define ddrcReg_PHY_BYTE_LANE_VDL_STATUS_STEP_SHIFT 8
689#define ddrcReg_PHY_BYTE_LANE_VDL_STATUS_STEP_MASK (0x3f << ddrcReg_PHY_BYTE_LANE_VDL_STATUS_STEP_SHIFT)
690
691#define ddrcReg_PHY_BYTE_LANE_VDL_STATUS_TOTAL_SHIFT 4
692#define ddrcReg_PHY_BYTE_LANE_VDL_STATUS_TOTAL_MASK (0x3ff << ddrcReg_PHY_BYTE_LANE_VDL_STATUS_TOTAL_SHIFT)
693
694#define ddrcReg_PHY_BYTE_LANE_VDL_STATUS_LOCK (1 << 1)
695#define ddrcReg_PHY_BYTE_LANE_VDL_STATUS_IDLE (1 << 0)
696
697/* ----------------------------------------------------- */
698
699#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_ENABLE (1 << 16)
700
701#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_FALL_SHIFT 12
702#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_FALL_MASK (0x3 << ddrcReg_PHY_BYTE_LANE_VDL_OVR_FALL_SHIFT)
703
704#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_RISE_SHIFT 8
705#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_RISE_MASK (0x3 << ddrcReg_PHY_BYTE_LANE_VDL_OVR_RISE_SHIFT)
706
707#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_STEP_SHIFT 0
708#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_STEP_MASK (0x3f << ddrcReg_PHY_BYTE_LANE_VDL_OVR_STEP_SHIFT)
709
710#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_IDX_STATIC_READ_DQS_P 0
711#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_IDX_STATIC_READ_DQS_N 1
712#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_IDX_STATIC_READ_EN 2
713#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_IDX_STATIC_WRITE_DQ_DQM 3
714#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_IDX_DYNAMIC_READ_DQS_P 4
715#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_IDX_DYNAMIC_READ_DQS_N 5
716#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_IDX_DYNAMIC_READ_EN 6
717#define ddrcReg_PHY_BYTE_LANE_VDL_OVR_IDX_DYNAMIC_WRITE_DQ_DQM 7
718
719/* ----------------------------------------------------- */
720
721#define ddrcReg_PHY_BYTE_LANE_READ_CTL_DELAY_SHIFT 8
722#define ddrcReg_PHY_BYTE_LANE_READ_CTL_DELAY_MASK (0x3 << ddrcReg_PHY_BYTE_LANE_READ_CTL_DELAY_SHIFT)
723
724#define ddrcReg_PHY_BYTE_LANE_READ_CTL_DQ_ODT_ENABLE (1 << 3)
725#define ddrcReg_PHY_BYTE_LANE_READ_CTL_DQ_ODT_ADJUST (1 << 2)
726#define ddrcReg_PHY_BYTE_LANE_READ_CTL_RD_ODT_ENABLE (1 << 1)
727#define ddrcReg_PHY_BYTE_LANE_READ_CTL_RD_ODT_ADJUST (1 << 0)
728
729/* ----------------------------------------------------- */
730
731#define ddrcReg_PHY_BYTE_LANE_READ_STATUS_ERROR_SHIFT 0
732#define ddrcReg_PHY_BYTE_LANE_READ_STATUS_ERROR_MASK (0xf << ddrcReg_PHY_BYTE_LANE_READ_STATUS_ERROR_SHIFT)
733
734/* ----------------------------------------------------- */
735
736#define ddrcReg_PHY_BYTE_LANE_READ_CLEAR_STATUS (1 << 0)
737
738/* ----------------------------------------------------- */
739
740#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_ENABLE (1u << 31)
741#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_DM_RXENB_DISABLE (1 << 19)
742#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_DM_IDDQ_DISABLE (1 << 18)
743#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_DM_REB_DISABLE (1 << 17)
744#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_DM_OEB_DISABLE (1 << 16)
745#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_DQ_RXENB_DISABLE (1 << 15)
746#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_DQ_IDDQ_DISABLE (1 << 14)
747#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_DQ_REB_DISABLE (1 << 13)
748#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_DQ_OEB_DISABLE (1 << 12)
749#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_READ_ENB_RXENB_DISABLE (1 << 11)
750#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_READ_ENB_IDDQ_DISABLE (1 << 10)
751#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_READ_ENB_REB_DISABLE (1 << 9)
752#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_READ_ENB_OEB_DISABLE (1 << 8)
753#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_DQS_RXENB_DISABLE (1 << 7)
754#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_DQS_IDDQ_DISABLE (1 << 6)
755#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_DQS_REB_DISABLE (1 << 5)
756#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_DQS_OEB_DISABLE (1 << 4)
757#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_CLK_RXENB_DISABLE (1 << 3)
758#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_CLK_IDDQ_DISABLE (1 << 2)
759#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_CLK_REB_DISABLE (1 << 1)
760#define ddrcReg_PHY_BYTE_LANE_PAD_IDLE_CTL_CLK_OEB_DISABLE (1 << 0)
761
762/* ----------------------------------------------------- */
763
764#define ddrcReg_PHY_BYTE_LANE_PAD_DRIVE_CTL_RT60B_DDR_READ_ENB (1 << 5)
765#define ddrcReg_PHY_BYTE_LANE_PAD_DRIVE_CTL_RT60B (1 << 4)
766#define ddrcReg_PHY_BYTE_LANE_PAD_DRIVE_CTL_SEL_SSTL18 (1 << 3)
767#define ddrcReg_PHY_BYTE_LANE_PAD_DRIVE_CTL_SELTXDRV_CI (1 << 2)
768#define ddrcReg_PHY_BYTE_LANE_PAD_DRIVE_CTL_SELRXDRV (1 << 1)
769#define ddrcReg_PHY_BYTE_LANE_PAD_DRIVE_CTL_SLEW (1 << 0)
770
771/* ----------------------------------------------------- */
772
773#define ddrcReg_PHY_BYTE_LANE_PAD_CLK_CTL_DISABLE (1 << 0)
774
775/* ----------------------------------------------------- */
776
777#define ddrcReg_PHY_BYTE_LANE_WRITE_CTL_PREAMBLE_DDR3 (1 << 0)
778
779/* ----------------------------------------------------- */
780
781#define ddrcReg_PHY_BYTE_LANE_CLK_REG_CTL_PWR_HALF (1 << 1)
782#define ddrcReg_PHY_BYTE_LANE_CLK_REG_CTL_PWR_OFF (1 << 0)
783
784/*********************************************************************/
785/* ARM PL341 DDRC to Broadcom DDR23 PHY glue register definitions */
786/*********************************************************************/
787
788 typedef struct {
789 uint32_t cfg;
790 uint32_t actMonCnt;
791 uint32_t ctl;
792 uint32_t lbistCtl;
793 uint32_t lbistSeed;
794 uint32_t lbistStatus;
795 uint32_t tieOff;
796 uint32_t actMonClear;
797 uint32_t status;
798 uint32_t user;
799 } ddrcReg_CTLR_PHY_GLUE_REG_t;
800
801#define ddrcReg_CTLR_PHY_GLUE_OFFSET 0x0700
802#define ddrcReg_CTLR_PHY_GLUE_REGP ((volatile ddrcReg_CTLR_PHY_GLUE_REG_t *) (MM_IO_BASE_DDRC + ddrcReg_CTLR_PHY_GLUE_OFFSET))
803
804/* ----------------------------------------------------- */
805
806/* DDR2 / AXI block phase alignment interrupt control */
807#define ddrcReg_CTLR_PHY_GLUE_CFG_INT_SHIFT 18
808#define ddrcReg_CTLR_PHY_GLUE_CFG_INT_MASK (0x3 << ddrcReg_CTLR_PHY_GLUE_CFG_INT_SHIFT)
809#define ddrcReg_CTLR_PHY_GLUE_CFG_INT_OFF (0 << ddrcReg_CTLR_PHY_GLUE_CFG_INT_SHIFT)
810#define ddrcReg_CTLR_PHY_GLUE_CFG_INT_ON_TIGHT (1 << ddrcReg_CTLR_PHY_GLUE_CFG_INT_SHIFT)
811#define ddrcReg_CTLR_PHY_GLUE_CFG_INT_ON_MEDIUM (2 << ddrcReg_CTLR_PHY_GLUE_CFG_INT_SHIFT)
812#define ddrcReg_CTLR_PHY_GLUE_CFG_INT_ON_LOOSE (3 << ddrcReg_CTLR_PHY_GLUE_CFG_INT_SHIFT)
813
814#define ddrcReg_CTLR_PHY_GLUE_CFG_PLL_REFCLK_SHIFT 17
815#define ddrcReg_CTLR_PHY_GLUE_CFG_PLL_REFCLK_MASK (1 << ddrcReg_CTLR_PHY_GLUE_CFG_PLL_REFCLK_SHIFT)
816#define ddrcReg_CTLR_PHY_GLUE_CFG_PLL_REFCLK_DIFFERENTIAL (0 << ddrcReg_CTLR_PHY_GLUE_CFG_PLL_REFCLK_SHIFT)
817#define ddrcReg_CTLR_PHY_GLUE_CFG_PLL_REFCLK_CMOS (1 << ddrcReg_CTLR_PHY_GLUE_CFG_PLL_REFCLK_SHIFT)
818
819#define ddrcReg_CTLR_PHY_GLUE_CFG_DIV2CLK_TREE_SHIFT 16
820#define ddrcReg_CTLR_PHY_GLUE_CFG_DIV2CLK_TREE_MASK (1 << ddrcReg_CTLR_PHY_GLUE_CFG_DIV2CLK_TREE_SHIFT)
821#define ddrcReg_CTLR_PHY_GLUE_CFG_DIV2CLK_TREE_DEEP (0 << ddrcReg_CTLR_PHY_GLUE_CFG_DIV2CLK_TREE_SHIFT)
822#define ddrcReg_CTLR_PHY_GLUE_CFG_DIV2CLK_TREE_SHALLOW (1 << ddrcReg_CTLR_PHY_GLUE_CFG_DIV2CLK_TREE_SHIFT)
823#define ddrcReg_CTLR_PHY_GLUE_CFG_HW_FIXED_ALIGNMENT_DISABLED ddrcReg_CTLR_PHY_GLUE_CFG_DIV2CLK_TREE_SHALLOW
824
825#define ddrcReg_CTLR_PHY_GLUE_CFG_SYNC_BRIDGE_SHIFT 15
826#define ddrcReg_CTLR_PHY_GLUE_CFG_SYNC_BRIDGE_MASK (1 << ddrcReg_CTLR_PHY_GLUE_CFG_SYNC_BRIDGE_SHIFT)
827#define ddrcReg_CTLR_PHY_GLUE_CFG_SYNC_BRIDGE_BP134 (0 << ddrcReg_CTLR_PHY_GLUE_CFG_SYNC_BRIDGE_SHIFT)
828#define ddrcReg_CTLR_PHY_GLUE_CFG_SYNC_BRIDGE_PL301 (1 << ddrcReg_CTLR_PHY_GLUE_CFG_SYNC_BRIDGE_SHIFT)
829#define ddrcReg_CTLR_PHY_GLUE_CFG_SYNC_BRIDGE_REGISTERED ddrcReg_CTLR_PHY_GLUE_CFG_SYNC_BRIDGE_PL301
830
831/* Software control of PHY VDL updates from control register settings. Bit 13 enables the use of Bit 14. */
832/* If software control is not enabled, then updates occur when a refresh command is issued by the hardware */
833/* controller. If 2 chips selects are being used, then software control must be enabled. */
834#define ddrcReg_CTLR_PHY_GLUE_CFG_PHY_VDL_UPDATE_SW_CTL_LOAD (1 << 14)
835#define ddrcReg_CTLR_PHY_GLUE_CFG_PHY_VDL_UPDATE_SW_CTL_ENABLE (1 << 13)
836
837/* Use these to bypass a pipeline stage. By default the ADDR is off but the BYTE LANE in / out are on. */
838#define ddrcReg_CTLR_PHY_GLUE_CFG_PHY_ADDR_CTL_IN_BYPASS_PIPELINE_STAGE (1 << 12)
839#define ddrcReg_CTLR_PHY_GLUE_CFG_PHY_BYTE_LANE_IN_BYPASS_PIPELINE_STAGE (1 << 11)
840#define ddrcReg_CTLR_PHY_GLUE_CFG_PHY_BYTE_LANE_OUT_BYPASS_PIPELINE_STAGE (1 << 10)
841
842/* Chip select count */
843#define ddrcReg_CTLR_PHY_GLUE_CFG_CS_CNT_SHIFT 9
844#define ddrcReg_CTLR_PHY_GLUE_CFG_CS_CNT_MASK (1 << ddrcReg_CTLR_PHY_GLUE_CFG_CS_CNT_SHIFT)
845#define ddrcReg_CTLR_PHY_GLUE_CFG_CS_CNT_1 (0 << ddrcReg_CTLR_PHY_GLUE_CFG_CS_CNT_SHIFT)
846#define ddrcReg_CTLR_PHY_GLUE_CFG_CS_CNT_2 (1 << ddrcReg_CTLR_PHY_GLUE_CFG_CS_CNT_SHIFT)
847
848#define ddrcReg_CTLR_PHY_GLUE_CFG_CLK_SHIFT 8
849#define ddrcReg_CTLR_PHY_GLUE_CFG_CLK_ASYNC (0 << ddrcReg_CTLR_PHY_GLUE_CFG_CLK_SHIFT)
850#define ddrcReg_CTLR_PHY_GLUE_CFG_CLK_SYNC (1 << ddrcReg_CTLR_PHY_GLUE_CFG_CLK_SHIFT)
851
852#define ddrcReg_CTLR_PHY_GLUE_CFG_CKE_INIT_SHIFT 7
853#define ddrcReg_CTLR_PHY_GLUE_CFG_CKE_INIT_LOW (0 << ddrcReg_CTLR_PHY_GLUE_CFG_CKE_INIT_SHIFT)
854#define ddrcReg_CTLR_PHY_GLUE_CFG_CKE_INIT_HIGH (1 << ddrcReg_CTLR_PHY_GLUE_CFG_CKE_INIT_SHIFT)
855
856#define ddrcReg_CTLR_PHY_GLUE_CFG_DQM_INIT_SHIFT 6
857#define ddrcReg_CTLR_PHY_GLUE_CFG_DQM_INIT_LOW (0 << ddrcReg_CTLR_PHY_GLUE_CFG_DQM_INIT_SHIFT)
858#define ddrcReg_CTLR_PHY_GLUE_CFG_DQM_INIT_HIGH (1 << ddrcReg_CTLR_PHY_GLUE_CFG_DQM_INIT_SHIFT)
859
860#define ddrcReg_CTLR_PHY_GLUE_CFG_CAS_LATENCY_SHIFT 0
861#define ddrcReg_CTLR_PHY_GLUE_CFG_CAS_LATENCY_MASK (0x7 << ddrcReg_CTLR_PHY_GLUE_CFG_CAS_LATENCY_SHIFT)
862
863/* ----------------------------------------------------- */
864#define ddrcReg_CTLR_PHY_GLUE_STATUS_PHASE_SHIFT 0
865#define ddrcReg_CTLR_PHY_GLUE_STATUS_PHASE_MASK (0x7f << ddrcReg_CTLR_PHY_GLUE_STATUS_PHASE_SHIFT)
866
867/* ---- Public Function Prototypes --------------------------------------- */
868
869#ifdef __cplusplus
870} /* end extern "C" */
871#endif
872#endif /* DDRC_REG_H */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h b/arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h
deleted file mode 100644
index d67e2f8c22d..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h
+++ /dev/null
@@ -1,145 +0,0 @@
1/*****************************************************************************
2* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file dmacHw_priv.h
18*
19* @brief Private Definitions for low level DMA driver
20*
21*/
22/****************************************************************************/
23
24#ifndef _DMACHW_PRIV_H
25#define _DMACHW_PRIV_H
26
27#include <csp/stdint.h>
28
29/* Data type for DMA Link List Item */
30typedef struct {
31 uint32_t sar; /* Source Address Register.
32 Address must be aligned to CTLx.SRC_TR_WIDTH. */
33 uint32_t dar; /* Destination Address Register.
34 Address must be aligned to CTLx.DST_TR_WIDTH. */
35 uint32_t llpPhy; /* LLP contains the physical address of the next descriptor for block chaining using linked lists.
36 Address MUST be aligned to a 32-bit boundary. */
37 dmacHw_REG64_t ctl; /* Control Register. 64 bits */
38 uint32_t sstat; /* Source Status Register */
39 uint32_t dstat; /* Destination Status Register */
40 uint32_t devCtl; /* Device specific control information */
41 uint32_t llp; /* LLP contains the virtual address of the next descriptor for block chaining using linked lists. */
42} dmacHw_DESC_t;
43
44/*
45 * Descriptor ring pointers
46 */
47typedef struct {
48 int num; /* Number of link items */
49 dmacHw_DESC_t *pHead; /* Head of descriptor ring (for writing) */
50 dmacHw_DESC_t *pTail; /* Tail of descriptor ring (for reading) */
51 dmacHw_DESC_t *pProg; /* Descriptor to program the channel (for programming the channel register) */
52 dmacHw_DESC_t *pEnd; /* End of current descriptor chain */
53 dmacHw_DESC_t *pFree; /* Descriptor to free memory (freeing dynamic memory) */
54 uint32_t virt2PhyOffset; /* Virtual to physical address offset for the descriptor ring */
55} dmacHw_DESC_RING_t;
56
57/*
58 * DMA channel control block
59 */
60typedef struct {
61 uint32_t module; /* DMA controller module (0-1) */
62 uint32_t channel; /* DMA channel (0-7) */
63 volatile uint32_t varDataStarted; /* Flag indicating variable data channel is enabled */
64 volatile uint32_t descUpdated; /* Flag to indicate descriptor update is complete */
65 void *userData; /* Channel specifc user data */
66} dmacHw_CBLK_t;
67
68#define dmacHw_ASSERT(a) if (!(a)) while (1)
69#define dmacHw_MAX_CHANNEL_COUNT 16
70#define dmacHw_FREE_USER_MEMORY 0xFFFFFFFF
71#define dmacHw_DESC_FREE dmacHw_REG_CTL_DONE
72#define dmacHw_DESC_INIT ((dmacHw_DESC_t *) 0xFFFFFFFF)
73#define dmacHw_MAX_BLOCKSIZE 4064
74#define dmacHw_GET_DESC_RING(addr) (dmacHw_DESC_RING_t *)(addr)
75#define dmacHw_ADDRESS_MASK(byte) ((byte) - 1)
76#define dmacHw_NEXT_DESC(rp, dp) ((rp)->dp = (dmacHw_DESC_t *)(rp)->dp->llp)
77#define dmacHw_HANDLE_TO_CBLK(handle) ((dmacHw_CBLK_t *) (handle))
78#define dmacHw_CBLK_TO_HANDLE(cblkp) ((dmacHw_HANDLE_t) (cblkp))
79#define dmacHw_DST_IS_MEMORY(tt) (((tt) == dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM) || ((tt) == dmacHw_TRANSFER_TYPE_MEM_TO_MEM)) ? 1 : 0
80
81/****************************************************************************/
82/**
83* @brief Get next available transaction width
84*
85*
86* @return On success : Next available transaction width
87* On failure : dmacHw_TRANSACTION_WIDTH_8
88*
89* @note
90* None
91*/
92/****************************************************************************/
93static inline dmacHw_TRANSACTION_WIDTH_e dmacHw_GetNextTrWidth(dmacHw_TRANSACTION_WIDTH_e tw /* [ IN ] Current transaction width */
94 ) {
95 if (tw & dmacHw_REG_CTL_SRC_TR_WIDTH_MASK) {
96 return ((tw >> dmacHw_REG_CTL_SRC_TR_WIDTH_SHIFT) -
97 1) << dmacHw_REG_CTL_SRC_TR_WIDTH_SHIFT;
98 } else if (tw & dmacHw_REG_CTL_DST_TR_WIDTH_MASK) {
99 return ((tw >> dmacHw_REG_CTL_DST_TR_WIDTH_SHIFT) -
100 1) << dmacHw_REG_CTL_DST_TR_WIDTH_SHIFT;
101 }
102
103 /* Default return */
104 return dmacHw_SRC_TRANSACTION_WIDTH_8;
105}
106
107/****************************************************************************/
108/**
109* @brief Get number of bytes per transaction
110*
111* @return Number of bytes per transaction
112*
113*
114* @note
115* None
116*/
117/****************************************************************************/
118static inline int dmacHw_GetTrWidthInBytes(dmacHw_TRANSACTION_WIDTH_e tw /* [ IN ] Transaction width */
119 ) {
120 int width = 1;
121 switch (tw) {
122 case dmacHw_SRC_TRANSACTION_WIDTH_8:
123 width = 1;
124 break;
125 case dmacHw_SRC_TRANSACTION_WIDTH_16:
126 case dmacHw_DST_TRANSACTION_WIDTH_16:
127 width = 2;
128 break;
129 case dmacHw_SRC_TRANSACTION_WIDTH_32:
130 case dmacHw_DST_TRANSACTION_WIDTH_32:
131 width = 4;
132 break;
133 case dmacHw_SRC_TRANSACTION_WIDTH_64:
134 case dmacHw_DST_TRANSACTION_WIDTH_64:
135 width = 8;
136 break;
137 default:
138 dmacHw_ASSERT(0);
139 }
140
141 /* Default transaction width */
142 return width;
143}
144
145#endif /* _DMACHW_PRIV_H */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h b/arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h
deleted file mode 100644
index f1ecf96f2da..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h
+++ /dev/null
@@ -1,406 +0,0 @@
1/*****************************************************************************
2* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file dmacHw_reg.h
18*
19* @brief Definitions for low level DMA registers
20*
21*/
22/****************************************************************************/
23
24#ifndef _DMACHW_REG_H
25#define _DMACHW_REG_H
26
27#include <csp/stdint.h>
28#include <mach/csp/mm_io.h>
29
30/* Data type for 64 bit little endian register */
31typedef struct {
32 volatile uint32_t lo; /* Lower 32 bit in little endian mode */
33 volatile uint32_t hi; /* Upper 32 bit in little endian mode */
34} dmacHw_REG64_t;
35
36/* Data type representing DMA channel registers */
37typedef struct {
38 dmacHw_REG64_t ChannelSar; /* Source Address Register. 64 bits (upper 32 bits are reserved)
39 Address must be aligned to CTLx.SRC_TR_WIDTH.
40 */
41 dmacHw_REG64_t ChannelDar; /* Destination Address Register.64 bits (upper 32 bits are reserved)
42 Address must be aligned to CTLx.DST_TR_WIDTH.
43 */
44 dmacHw_REG64_t ChannelLlp; /* Link List Pointer.64 bits (upper 32 bits are reserved)
45 LLP contains the pointer to the next LLI for block chaining using linked lists.
46 If LLPis set to 0x0, then transfers using linked lists are not enabled.
47 Address MUST be aligned to a 32-bit boundary.
48 */
49 dmacHw_REG64_t ChannelCtl; /* Control Register. 64 bits */
50 dmacHw_REG64_t ChannelSstat; /* Source Status Register */
51 dmacHw_REG64_t ChannelDstat; /* Destination Status Register */
52 dmacHw_REG64_t ChannelSstatAddr; /* Source Status Address Register */
53 dmacHw_REG64_t ChannelDstatAddr; /* Destination Status Address Register */
54 dmacHw_REG64_t ChannelConfig; /* Channel Configuration Register */
55 dmacHw_REG64_t SrcGather; /* Source gather register */
56 dmacHw_REG64_t DstScatter; /* Destination scatter register */
57} dmacHw_CH_REG_t;
58
59/* Data type for RAW interrupt status registers */
60typedef struct {
61 dmacHw_REG64_t RawTfr; /* Raw Status for IntTfr Interrupt */
62 dmacHw_REG64_t RawBlock; /* Raw Status for IntBlock Interrupt */
63 dmacHw_REG64_t RawSrcTran; /* Raw Status for IntSrcTran Interrupt */
64 dmacHw_REG64_t RawDstTran; /* Raw Status for IntDstTran Interrupt */
65 dmacHw_REG64_t RawErr; /* Raw Status for IntErr Interrupt */
66} dmacHw_INT_RAW_t;
67
68/* Data type for interrupt status registers */
69typedef struct {
70 dmacHw_REG64_t StatusTfr; /* Status for IntTfr Interrupt */
71 dmacHw_REG64_t StatusBlock; /* Status for IntBlock Interrupt */
72 dmacHw_REG64_t StatusSrcTran; /* Status for IntSrcTran Interrupt */
73 dmacHw_REG64_t StatusDstTran; /* Status for IntDstTran Interrupt */
74 dmacHw_REG64_t StatusErr; /* Status for IntErr Interrupt */
75} dmacHw_INT_STATUS_t;
76
77/* Data type for interrupt mask registers*/
78typedef struct {
79 dmacHw_REG64_t MaskTfr; /* Mask for IntTfr Interrupt */
80 dmacHw_REG64_t MaskBlock; /* Mask for IntBlock Interrupt */
81 dmacHw_REG64_t MaskSrcTran; /* Mask for IntSrcTran Interrupt */
82 dmacHw_REG64_t MaskDstTran; /* Mask for IntDstTran Interrupt */
83 dmacHw_REG64_t MaskErr; /* Mask for IntErr Interrupt */
84} dmacHw_INT_MASK_t;
85
86/* Data type for interrupt clear registers */
87typedef struct {
88 dmacHw_REG64_t ClearTfr; /* Clear for IntTfr Interrupt */
89 dmacHw_REG64_t ClearBlock; /* Clear for IntBlock Interrupt */
90 dmacHw_REG64_t ClearSrcTran; /* Clear for IntSrcTran Interrupt */
91 dmacHw_REG64_t ClearDstTran; /* Clear for IntDstTran Interrupt */
92 dmacHw_REG64_t ClearErr; /* Clear for IntErr Interrupt */
93 dmacHw_REG64_t StatusInt; /* Status for each interrupt type */
94} dmacHw_INT_CLEAR_t;
95
96/* Data type for software handshaking registers */
97typedef struct {
98 dmacHw_REG64_t ReqSrcReg; /* Source Software Transaction Request Register */
99 dmacHw_REG64_t ReqDstReg; /* Destination Software Transaction Request Register */
100 dmacHw_REG64_t SglReqSrcReg; /* Single Source Transaction Request Register */
101 dmacHw_REG64_t SglReqDstReg; /* Single Destination Transaction Request Register */
102 dmacHw_REG64_t LstSrcReg; /* Last Source Transaction Request Register */
103 dmacHw_REG64_t LstDstReg; /* Last Destination Transaction Request Register */
104} dmacHw_SW_HANDSHAKE_t;
105
106/* Data type for misc. registers */
107typedef struct {
108 dmacHw_REG64_t DmaCfgReg; /* DMA Configuration Register */
109 dmacHw_REG64_t ChEnReg; /* DMA Channel Enable Register */
110 dmacHw_REG64_t DmaIdReg; /* DMA ID Register */
111 dmacHw_REG64_t DmaTestReg; /* DMA Test Register */
112 dmacHw_REG64_t Reserved0; /* Reserved */
113 dmacHw_REG64_t Reserved1; /* Reserved */
114 dmacHw_REG64_t CompParm6; /* Component Parameter 6 */
115 dmacHw_REG64_t CompParm5; /* Component Parameter 5 */
116 dmacHw_REG64_t CompParm4; /* Component Parameter 4 */
117 dmacHw_REG64_t CompParm3; /* Component Parameter 3 */
118 dmacHw_REG64_t CompParm2; /* Component Parameter 2 */
119 dmacHw_REG64_t CompParm1; /* Component Parameter 1 */
120 dmacHw_REG64_t CompId; /* Compoent ID */
121} dmacHw_MISC_t;
122
123/* Base registers */
124#define dmacHw_0_MODULE_BASE_ADDR (char *) MM_IO_BASE_DMA0 /* DMAC 0 module's base address */
125#define dmacHw_1_MODULE_BASE_ADDR (char *) MM_IO_BASE_DMA1 /* DMAC 1 module's base address */
126
127extern uint32_t dmaChannelCount_0;
128extern uint32_t dmaChannelCount_1;
129
130/* Define channel specific registers */
131#define dmacHw_CHAN_BASE(module, chan) ((dmacHw_CH_REG_t *) ((char *)((module) ? dmacHw_1_MODULE_BASE_ADDR : dmacHw_0_MODULE_BASE_ADDR) + ((chan) * sizeof(dmacHw_CH_REG_t))))
132
133/* Raw interrupt status registers */
134#define dmacHw_REG_INT_RAW_BASE(module) ((char *)dmacHw_CHAN_BASE((module), ((module) ? dmaChannelCount_1 : dmaChannelCount_0)))
135#define dmacHw_REG_INT_RAW_TRAN(module) (((dmacHw_INT_RAW_t *) dmacHw_REG_INT_RAW_BASE((module)))->RawTfr.lo)
136#define dmacHw_REG_INT_RAW_BLOCK(module) (((dmacHw_INT_RAW_t *) dmacHw_REG_INT_RAW_BASE((module)))->RawBlock.lo)
137#define dmacHw_REG_INT_RAW_STRAN(module) (((dmacHw_INT_RAW_t *) dmacHw_REG_INT_RAW_BASE((module)))->RawSrcTran.lo)
138#define dmacHw_REG_INT_RAW_DTRAN(module) (((dmacHw_INT_RAW_t *) dmacHw_REG_INT_RAW_BASE((module)))->RawDstTran.lo)
139#define dmacHw_REG_INT_RAW_ERROR(module) (((dmacHw_INT_RAW_t *) dmacHw_REG_INT_RAW_BASE((module)))->RawErr.lo)
140
141/* Interrupt status registers */
142#define dmacHw_REG_INT_STAT_BASE(module) ((char *)(dmacHw_REG_INT_RAW_BASE((module)) + sizeof(dmacHw_INT_RAW_t)))
143#define dmacHw_REG_INT_STAT_TRAN(module) (((dmacHw_INT_STATUS_t *) dmacHw_REG_INT_STAT_BASE((module)))->StatusTfr.lo)
144#define dmacHw_REG_INT_STAT_BLOCK(module) (((dmacHw_INT_STATUS_t *) dmacHw_REG_INT_STAT_BASE((module)))->StatusBlock.lo)
145#define dmacHw_REG_INT_STAT_STRAN(module) (((dmacHw_INT_STATUS_t *) dmacHw_REG_INT_STAT_BASE((module)))->StatusSrcTran.lo)
146#define dmacHw_REG_INT_STAT_DTRAN(module) (((dmacHw_INT_STATUS_t *) dmacHw_REG_INT_STAT_BASE((module)))->StatusDstTran.lo)
147#define dmacHw_REG_INT_STAT_ERROR(module) (((dmacHw_INT_STATUS_t *) dmacHw_REG_INT_STAT_BASE((module)))->StatusErr.lo)
148
149/* Interrupt status registers */
150#define dmacHw_REG_INT_MASK_BASE(module) ((char *)(dmacHw_REG_INT_STAT_BASE((module)) + sizeof(dmacHw_INT_STATUS_t)))
151#define dmacHw_REG_INT_MASK_TRAN(module) (((dmacHw_INT_MASK_t *) dmacHw_REG_INT_MASK_BASE((module)))->MaskTfr.lo)
152#define dmacHw_REG_INT_MASK_BLOCK(module) (((dmacHw_INT_MASK_t *) dmacHw_REG_INT_MASK_BASE((module)))->MaskBlock.lo)
153#define dmacHw_REG_INT_MASK_STRAN(module) (((dmacHw_INT_MASK_t *) dmacHw_REG_INT_MASK_BASE((module)))->MaskSrcTran.lo)
154#define dmacHw_REG_INT_MASK_DTRAN(module) (((dmacHw_INT_MASK_t *) dmacHw_REG_INT_MASK_BASE((module)))->MaskDstTran.lo)
155#define dmacHw_REG_INT_MASK_ERROR(module) (((dmacHw_INT_MASK_t *) dmacHw_REG_INT_MASK_BASE((module)))->MaskErr.lo)
156
157/* Interrupt clear registers */
158#define dmacHw_REG_INT_CLEAR_BASE(module) ((char *)(dmacHw_REG_INT_MASK_BASE((module)) + sizeof(dmacHw_INT_MASK_t)))
159#define dmacHw_REG_INT_CLEAR_TRAN(module) (((dmacHw_INT_CLEAR_t *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearTfr.lo)
160#define dmacHw_REG_INT_CLEAR_BLOCK(module) (((dmacHw_INT_CLEAR_t *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearBlock.lo)
161#define dmacHw_REG_INT_CLEAR_STRAN(module) (((dmacHw_INT_CLEAR_t *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearSrcTran.lo)
162#define dmacHw_REG_INT_CLEAR_DTRAN(module) (((dmacHw_INT_CLEAR_t *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearDstTran.lo)
163#define dmacHw_REG_INT_CLEAR_ERROR(module) (((dmacHw_INT_CLEAR_t *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearErr.lo)
164#define dmacHw_REG_INT_STATUS(module) (((dmacHw_INT_CLEAR_t *) dmacHw_REG_INT_CLEAR_BASE((module)))->StatusInt.lo)
165
166/* Software handshaking registers */
167#define dmacHw_REG_SW_HS_BASE(module) ((char *)(dmacHw_REG_INT_CLEAR_BASE((module)) + sizeof(dmacHw_INT_CLEAR_t)))
168#define dmacHw_REG_SW_HS_SRC_REQ(module) (((dmacHw_SW_HANDSHAKE_t *) dmacHw_REG_SW_HS_BASE((module)))->ReqSrcReg.lo)
169#define dmacHw_REG_SW_HS_DST_REQ(module) (((dmacHw_SW_HANDSHAKE_t *) dmacHw_REG_SW_HS_BASE((module)))->ReqDstReg.lo)
170#define dmacHw_REG_SW_HS_SRC_SGL_REQ(module) (((dmacHw_SW_HANDSHAKE_t *) dmacHw_REG_SW_HS_BASE((module)))->SglReqSrcReg.lo)
171#define dmacHw_REG_SW_HS_DST_SGL_REQ(module) (((dmacHw_SW_HANDSHAKE_t *) dmacHw_REG_SW_HS_BASE((module)))->SglReqDstReg.lo)
172#define dmacHw_REG_SW_HS_SRC_LST_REQ(module) (((dmacHw_SW_HANDSHAKE_t *) dmacHw_REG_SW_HS_BASE((module)))->LstSrcReg.lo)
173#define dmacHw_REG_SW_HS_DST_LST_REQ(module) (((dmacHw_SW_HANDSHAKE_t *) dmacHw_REG_SW_HS_BASE((module)))->LstDstReg.lo)
174
175/* Miscellaneous registers */
176#define dmacHw_REG_MISC_BASE(module) ((char *)(dmacHw_REG_SW_HS_BASE((module)) + sizeof(dmacHw_SW_HANDSHAKE_t)))
177#define dmacHw_REG_MISC_CFG(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->DmaCfgReg.lo)
178#define dmacHw_REG_MISC_CH_ENABLE(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->ChEnReg.lo)
179#define dmacHw_REG_MISC_ID(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->DmaIdReg.lo)
180#define dmacHw_REG_MISC_TEST(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->DmaTestReg.lo)
181#define dmacHw_REG_MISC_COMP_PARAM1_LO(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm1.lo)
182#define dmacHw_REG_MISC_COMP_PARAM1_HI(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm1.hi)
183#define dmacHw_REG_MISC_COMP_PARAM2_LO(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm2.lo)
184#define dmacHw_REG_MISC_COMP_PARAM2_HI(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm2.hi)
185#define dmacHw_REG_MISC_COMP_PARAM3_LO(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm3.lo)
186#define dmacHw_REG_MISC_COMP_PARAM3_HI(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm3.hi)
187#define dmacHw_REG_MISC_COMP_PARAM4_LO(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm4.lo)
188#define dmacHw_REG_MISC_COMP_PARAM4_HI(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm4.hi)
189#define dmacHw_REG_MISC_COMP_PARAM5_LO(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm5.lo)
190#define dmacHw_REG_MISC_COMP_PARAM5_HI(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm5.hi)
191#define dmacHw_REG_MISC_COMP_PARAM6_LO(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm6.lo)
192#define dmacHw_REG_MISC_COMP_PARAM6_HI(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm6.hi)
193
194/* Channel control registers */
195#define dmacHw_REG_SAR(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelSar.lo)
196#define dmacHw_REG_DAR(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelDar.lo)
197#define dmacHw_REG_LLP(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelLlp.lo)
198
199#define dmacHw_REG_CTL_LO(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelCtl.lo)
200#define dmacHw_REG_CTL_HI(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelCtl.hi)
201
202#define dmacHw_REG_SSTAT(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelSstat.lo)
203#define dmacHw_REG_DSTAT(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelDstat.lo)
204#define dmacHw_REG_SSTATAR(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelSstatAddr.lo)
205#define dmacHw_REG_DSTATAR(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelDstatAddr.lo)
206
207#define dmacHw_REG_CFG_LO(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelConfig.lo)
208#define dmacHw_REG_CFG_HI(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelConfig.hi)
209
210#define dmacHw_REG_SGR_LO(module, chan) (dmacHw_CHAN_BASE((module), (chan))->SrcGather.lo)
211#define dmacHw_REG_SGR_HI(module, chan) (dmacHw_CHAN_BASE((module), (chan))->SrcGather.hi)
212
213#define dmacHw_REG_DSR_LO(module, chan) (dmacHw_CHAN_BASE((module), (chan))->DstScatter.lo)
214#define dmacHw_REG_DSR_HI(module, chan) (dmacHw_CHAN_BASE((module), (chan))->DstScatter.hi)
215
216#define INT_STATUS_MASK(channel) (0x00000001 << (channel))
217#define CHANNEL_BUSY(mod, channel) (dmacHw_REG_MISC_CH_ENABLE((mod)) & (0x00000001 << (channel)))
218
219/* Bit mask for REG_DMACx_CTL_LO */
220
221#define dmacHw_REG_CTL_INT_EN 0x00000001 /* Channel interrupt enable */
222
223#define dmacHw_REG_CTL_DST_TR_WIDTH_MASK 0x0000000E /* Destination transaction width mask */
224#define dmacHw_REG_CTL_DST_TR_WIDTH_SHIFT 1
225#define dmacHw_REG_CTL_DST_TR_WIDTH_8 0x00000000 /* Destination transaction width 8 bit */
226#define dmacHw_REG_CTL_DST_TR_WIDTH_16 0x00000002 /* Destination transaction width 16 bit */
227#define dmacHw_REG_CTL_DST_TR_WIDTH_32 0x00000004 /* Destination transaction width 32 bit */
228#define dmacHw_REG_CTL_DST_TR_WIDTH_64 0x00000006 /* Destination transaction width 64 bit */
229
230#define dmacHw_REG_CTL_SRC_TR_WIDTH_MASK 0x00000070 /* Source transaction width mask */
231#define dmacHw_REG_CTL_SRC_TR_WIDTH_SHIFT 4
232#define dmacHw_REG_CTL_SRC_TR_WIDTH_8 0x00000000 /* Source transaction width 8 bit */
233#define dmacHw_REG_CTL_SRC_TR_WIDTH_16 0x00000010 /* Source transaction width 16 bit */
234#define dmacHw_REG_CTL_SRC_TR_WIDTH_32 0x00000020 /* Source transaction width 32 bit */
235#define dmacHw_REG_CTL_SRC_TR_WIDTH_64 0x00000030 /* Source transaction width 64 bit */
236
237#define dmacHw_REG_CTL_DS_ENABLE 0x00040000 /* Destination scatter enable */
238#define dmacHw_REG_CTL_SG_ENABLE 0x00020000 /* Source gather enable */
239
240#define dmacHw_REG_CTL_DINC_MASK 0x00000180 /* Destination address inc/dec mask */
241#define dmacHw_REG_CTL_DINC_INC 0x00000000 /* Destination address increment */
242#define dmacHw_REG_CTL_DINC_DEC 0x00000080 /* Destination address decrement */
243#define dmacHw_REG_CTL_DINC_NC 0x00000100 /* Destination address no change */
244
245#define dmacHw_REG_CTL_SINC_MASK 0x00000600 /* Source address inc/dec mask */
246#define dmacHw_REG_CTL_SINC_INC 0x00000000 /* Source address increment */
247#define dmacHw_REG_CTL_SINC_DEC 0x00000200 /* Source address decrement */
248#define dmacHw_REG_CTL_SINC_NC 0x00000400 /* Source address no change */
249
250#define dmacHw_REG_CTL_DST_MSIZE_MASK 0x00003800 /* Destination burst transaction length */
251#define dmacHw_REG_CTL_DST_MSIZE_0 0x00000000 /* No Destination burst */
252#define dmacHw_REG_CTL_DST_MSIZE_4 0x00000800 /* Destination burst transaction length 4 */
253#define dmacHw_REG_CTL_DST_MSIZE_8 0x00001000 /* Destination burst transaction length 8 */
254#define dmacHw_REG_CTL_DST_MSIZE_16 0x00001800 /* Destination burst transaction length 16 */
255
256#define dmacHw_REG_CTL_SRC_MSIZE_MASK 0x0001C000 /* Source burst transaction length */
257#define dmacHw_REG_CTL_SRC_MSIZE_0 0x00000000 /* No Source burst */
258#define dmacHw_REG_CTL_SRC_MSIZE_4 0x00004000 /* Source burst transaction length 4 */
259#define dmacHw_REG_CTL_SRC_MSIZE_8 0x00008000 /* Source burst transaction length 8 */
260#define dmacHw_REG_CTL_SRC_MSIZE_16 0x0000C000 /* Source burst transaction length 16 */
261
262#define dmacHw_REG_CTL_TTFC_MASK 0x00700000 /* Transfer type and flow controller */
263#define dmacHw_REG_CTL_TTFC_MM_DMAC 0x00000000 /* Memory to Memory with DMAC as flow controller */
264#define dmacHw_REG_CTL_TTFC_MP_DMAC 0x00100000 /* Memory to Peripheral with DMAC as flow controller */
265#define dmacHw_REG_CTL_TTFC_PM_DMAC 0x00200000 /* Peripheral to Memory with DMAC as flow controller */
266#define dmacHw_REG_CTL_TTFC_PP_DMAC 0x00300000 /* Peripheral to Peripheral with DMAC as flow controller */
267#define dmacHw_REG_CTL_TTFC_PM_PERI 0x00400000 /* Peripheral to Memory with Peripheral as flow controller */
268#define dmacHw_REG_CTL_TTFC_PP_SPERI 0x00500000 /* Peripheral to Peripheral with Source Peripheral as flow controller */
269#define dmacHw_REG_CTL_TTFC_MP_PERI 0x00600000 /* Memory to Peripheral with Peripheral as flow controller */
270#define dmacHw_REG_CTL_TTFC_PP_DPERI 0x00700000 /* Peripheral to Peripheral with Destination Peripheral as flow controller */
271
272#define dmacHw_REG_CTL_DMS_MASK 0x01800000 /* Destination AHB master interface */
273#define dmacHw_REG_CTL_DMS_1 0x00000000 /* Destination AHB master interface 1 */
274#define dmacHw_REG_CTL_DMS_2 0x00800000 /* Destination AHB master interface 2 */
275
276#define dmacHw_REG_CTL_SMS_MASK 0x06000000 /* Source AHB master interface */
277#define dmacHw_REG_CTL_SMS_1 0x00000000 /* Source AHB master interface 1 */
278#define dmacHw_REG_CTL_SMS_2 0x02000000 /* Source AHB master interface 2 */
279
280#define dmacHw_REG_CTL_LLP_DST_EN 0x08000000 /* Block chaining enable for destination side */
281#define dmacHw_REG_CTL_LLP_SRC_EN 0x10000000 /* Block chaining enable for source side */
282
283/* Bit mask for REG_DMACx_CTL_HI */
284#define dmacHw_REG_CTL_BLOCK_TS_MASK 0x00000FFF /* Block transfer size */
285#define dmacHw_REG_CTL_DONE 0x00001000 /* Block trasnfer done */
286
287/* Bit mask for REG_DMACx_CFG_LO */
288#define dmacHw_REG_CFG_LO_CH_PRIORITY_SHIFT 5 /* Channel priority shift */
289#define dmacHw_REG_CFG_LO_CH_PRIORITY_MASK 0x000000E0 /* Channel priority mask */
290#define dmacHw_REG_CFG_LO_CH_PRIORITY_0 0x00000000 /* Channel priority 0 */
291#define dmacHw_REG_CFG_LO_CH_PRIORITY_1 0x00000020 /* Channel priority 1 */
292#define dmacHw_REG_CFG_LO_CH_PRIORITY_2 0x00000040 /* Channel priority 2 */
293#define dmacHw_REG_CFG_LO_CH_PRIORITY_3 0x00000060 /* Channel priority 3 */
294#define dmacHw_REG_CFG_LO_CH_PRIORITY_4 0x00000080 /* Channel priority 4 */
295#define dmacHw_REG_CFG_LO_CH_PRIORITY_5 0x000000A0 /* Channel priority 5 */
296#define dmacHw_REG_CFG_LO_CH_PRIORITY_6 0x000000C0 /* Channel priority 6 */
297#define dmacHw_REG_CFG_LO_CH_PRIORITY_7 0x000000E0 /* Channel priority 7 */
298
299#define dmacHw_REG_CFG_LO_CH_SUSPEND 0x00000100 /* Channel suspend */
300#define dmacHw_REG_CFG_LO_CH_FIFO_EMPTY 0x00000200 /* Channel FIFO empty */
301#define dmacHw_REG_CFG_LO_DST_CH_SW_HS 0x00000400 /* Destination channel SW handshaking */
302#define dmacHw_REG_CFG_LO_SRC_CH_SW_HS 0x00000800 /* Source channel SW handshaking */
303
304#define dmacHw_REG_CFG_LO_CH_LOCK_MASK 0x00003000 /* Channel locking mask */
305#define dmacHw_REG_CFG_LO_CH_LOCK_DMA 0x00000000 /* Channel lock over the entire DMA transfer operation */
306#define dmacHw_REG_CFG_LO_CH_LOCK_BLOCK 0x00001000 /* Channel lock over the block transfer operation */
307#define dmacHw_REG_CFG_LO_CH_LOCK_TRANS 0x00002000 /* Channel lock over the transaction */
308#define dmacHw_REG_CFG_LO_CH_LOCK_ENABLE 0x00010000 /* Channel lock enable */
309
310#define dmacHw_REG_CFG_LO_BUS_LOCK_MASK 0x0000C000 /* Bus locking mask */
311#define dmacHw_REG_CFG_LO_BUS_LOCK_DMA 0x00000000 /* Bus lock over the entire DMA transfer operation */
312#define dmacHw_REG_CFG_LO_BUS_LOCK_BLOCK 0x00004000 /* Bus lock over the block transfer operation */
313#define dmacHw_REG_CFG_LO_BUS_LOCK_TRANS 0x00008000 /* Bus lock over the transaction */
314#define dmacHw_REG_CFG_LO_BUS_LOCK_ENABLE 0x00020000 /* Bus lock enable */
315
316#define dmacHw_REG_CFG_LO_DST_HS_POLARITY_LOW 0x00040000 /* Destination channel handshaking signal polarity low */
317#define dmacHw_REG_CFG_LO_SRC_HS_POLARITY_LOW 0x00080000 /* Source channel handshaking signal polarity low */
318
319#define dmacHw_REG_CFG_LO_MAX_AMBA_BURST_LEN_MASK 0x3FF00000 /* Maximum AMBA burst length */
320
321#define dmacHw_REG_CFG_LO_AUTO_RELOAD_SRC 0x40000000 /* Source address auto reload */
322#define dmacHw_REG_CFG_LO_AUTO_RELOAD_DST 0x80000000 /* Destination address auto reload */
323
324/* Bit mask for REG_DMACx_CFG_HI */
325#define dmacHw_REG_CFG_HI_FC_DST_READY 0x00000001 /* Source transaction request is serviced when destination is ready */
326#define dmacHw_REG_CFG_HI_FIFO_ENOUGH 0x00000002 /* Initiate burst transaction when enough data in available in FIFO */
327
328#define dmacHw_REG_CFG_HI_AHB_HPROT_MASK 0x0000001C /* AHB protection mask */
329#define dmacHw_REG_CFG_HI_AHB_HPROT_1 0x00000004 /* AHB protection 1 */
330#define dmacHw_REG_CFG_HI_AHB_HPROT_2 0x00000008 /* AHB protection 2 */
331#define dmacHw_REG_CFG_HI_AHB_HPROT_3 0x00000010 /* AHB protection 3 */
332
333#define dmacHw_REG_CFG_HI_UPDATE_DST_STAT 0x00000020 /* Destination status update enable */
334#define dmacHw_REG_CFG_HI_UPDATE_SRC_STAT 0x00000040 /* Source status update enable */
335
336#define dmacHw_REG_CFG_HI_SRC_PERI_INTF_MASK 0x00000780 /* Source peripheral hardware interface mask */
337#define dmacHw_REG_CFG_HI_DST_PERI_INTF_MASK 0x00007800 /* Destination peripheral hardware interface mask */
338
339/* DMA Configuration Parameters */
340#define dmacHw_REG_COMP_PARAM_NUM_CHANNELS 0x00000700 /* Number of channels */
341#define dmacHw_REG_COMP_PARAM_NUM_INTERFACE 0x00001800 /* Number of master interface */
342#define dmacHw_REG_COMP_PARAM_MAX_BLK_SIZE 0x0000000f /* Maximum brust size */
343#define dmacHw_REG_COMP_PARAM_DATA_WIDTH 0x00006000 /* Data transfer width */
344
345/* Define GET/SET macros to program the registers */
346#define dmacHw_SET_SAR(module, channel, addr) (dmacHw_REG_SAR((module), (channel)) = (uint32_t) (addr))
347#define dmacHw_SET_DAR(module, channel, addr) (dmacHw_REG_DAR((module), (channel)) = (uint32_t) (addr))
348#define dmacHw_SET_LLP(module, channel, ptr) (dmacHw_REG_LLP((module), (channel)) = (uint32_t) (ptr))
349
350#define dmacHw_GET_SSTAT(module, channel) (dmacHw_REG_SSTAT((module), (channel)))
351#define dmacHw_GET_DSTAT(module, channel) (dmacHw_REG_DSTAT((module), (channel)))
352
353#define dmacHw_SET_SSTATAR(module, channel, addr) (dmacHw_REG_SSTATAR((module), (channel)) = (uint32_t) (addr))
354#define dmacHw_SET_DSTATAR(module, channel, addr) (dmacHw_REG_DSTATAR((module), (channel)) = (uint32_t) (addr))
355
356#define dmacHw_SET_CONTROL_LO(module, channel, ctl) (dmacHw_REG_CTL_LO((module), (channel)) |= (ctl))
357#define dmacHw_RESET_CONTROL_LO(module, channel) (dmacHw_REG_CTL_LO((module), (channel)) = 0)
358#define dmacHw_GET_CONTROL_LO(module, channel) (dmacHw_REG_CTL_LO((module), (channel)))
359
360#define dmacHw_SET_CONTROL_HI(module, channel, ctl) (dmacHw_REG_CTL_HI((module), (channel)) |= (ctl))
361#define dmacHw_RESET_CONTROL_HI(module, channel) (dmacHw_REG_CTL_HI((module), (channel)) = 0)
362#define dmacHw_GET_CONTROL_HI(module, channel) (dmacHw_REG_CTL_HI((module), (channel)))
363
364#define dmacHw_GET_BLOCK_SIZE(module, channel) (dmacHw_REG_CTL_HI((module), (channel)) & dmacHw_REG_CTL_BLOCK_TS_MASK)
365#define dmacHw_DMA_COMPLETE(module, channel) (dmacHw_REG_CTL_HI((module), (channel)) & dmacHw_REG_CTL_DONE)
366
367#define dmacHw_SET_CONFIG_LO(module, channel, cfg) (dmacHw_REG_CFG_LO((module), (channel)) |= (cfg))
368#define dmacHw_RESET_CONFIG_LO(module, channel) (dmacHw_REG_CFG_LO((module), (channel)) = 0)
369#define dmacHw_GET_CONFIG_LO(module, channel) (dmacHw_REG_CFG_LO((module), (channel)))
370#define dmacHw_SET_AMBA_BUSRT_LEN(module, channel, len) (dmacHw_REG_CFG_LO((module), (channel)) = (dmacHw_REG_CFG_LO((module), (channel)) & ~(dmacHw_REG_CFG_LO_MAX_AMBA_BURST_LEN_MASK)) | (((len) << 20) & dmacHw_REG_CFG_LO_MAX_AMBA_BURST_LEN_MASK))
371#define dmacHw_SET_CHANNEL_PRIORITY(module, channel, prio) (dmacHw_REG_CFG_LO((module), (channel)) = (dmacHw_REG_CFG_LO((module), (channel)) & ~(dmacHw_REG_CFG_LO_CH_PRIORITY_MASK)) | (prio))
372#define dmacHw_SET_AHB_HPROT(module, channel, protect) (dmacHw_REG_CFG_HI(module, channel) = (dmacHw_REG_CFG_HI((module), (channel)) & ~(dmacHw_REG_CFG_HI_AHB_HPROT_MASK)) | (protect))
373
374#define dmacHw_SET_CONFIG_HI(module, channel, cfg) (dmacHw_REG_CFG_HI((module), (channel)) |= (cfg))
375#define dmacHw_RESET_CONFIG_HI(module, channel) (dmacHw_REG_CFG_HI((module), (channel)) = 0)
376#define dmacHw_GET_CONFIG_HI(module, channel) (dmacHw_REG_CFG_HI((module), (channel)))
377#define dmacHw_SET_SRC_PERI_INTF(module, channel, intf) (dmacHw_REG_CFG_HI((module), (channel)) = (dmacHw_REG_CFG_HI((module), (channel)) & ~(dmacHw_REG_CFG_HI_SRC_PERI_INTF_MASK)) | (((intf) << 7) & dmacHw_REG_CFG_HI_SRC_PERI_INTF_MASK))
378#define dmacHw_SRC_PERI_INTF(intf) (((intf) << 7) & dmacHw_REG_CFG_HI_SRC_PERI_INTF_MASK)
379#define dmacHw_SET_DST_PERI_INTF(module, channel, intf) (dmacHw_REG_CFG_HI((module), (channel)) = (dmacHw_REG_CFG_HI((module), (channel)) & ~(dmacHw_REG_CFG_HI_DST_PERI_INTF_MASK)) | (((intf) << 11) & dmacHw_REG_CFG_HI_DST_PERI_INTF_MASK))
380#define dmacHw_DST_PERI_INTF(intf) (((intf) << 11) & dmacHw_REG_CFG_HI_DST_PERI_INTF_MASK)
381
382#define dmacHw_DMA_START(module, channel) (dmacHw_REG_MISC_CH_ENABLE((module)) = (0x00000001 << ((channel) + 8)) | (0x00000001 << (channel)))
383#define dmacHw_DMA_STOP(module, channel) (dmacHw_REG_MISC_CH_ENABLE((module)) = (0x00000001 << ((channel) + 8)))
384#define dmacHw_DMA_ENABLE(module) (dmacHw_REG_MISC_CFG((module)) = 1)
385#define dmacHw_DMA_DISABLE(module) (dmacHw_REG_MISC_CFG((module)) = 0)
386
387#define dmacHw_TRAN_INT_ENABLE(module, channel) (dmacHw_REG_INT_MASK_TRAN((module)) = (0x00000001 << ((channel) + 8)) | (0x00000001 << (channel)))
388#define dmacHw_BLOCK_INT_ENABLE(module, channel) (dmacHw_REG_INT_MASK_BLOCK((module)) = (0x00000001 << ((channel) + 8)) | (0x00000001 << (channel)))
389#define dmacHw_ERROR_INT_ENABLE(module, channel) (dmacHw_REG_INT_MASK_ERROR((module)) = (0x00000001 << ((channel) + 8)) | (0x00000001 << (channel)))
390
391#define dmacHw_TRAN_INT_DISABLE(module, channel) (dmacHw_REG_INT_MASK_TRAN((module)) = (0x00000001 << ((channel) + 8)))
392#define dmacHw_BLOCK_INT_DISABLE(module, channel) (dmacHw_REG_INT_MASK_BLOCK((module)) = (0x00000001 << ((channel) + 8)))
393#define dmacHw_ERROR_INT_DISABLE(module, channel) (dmacHw_REG_INT_MASK_ERROR((module)) = (0x00000001 << ((channel) + 8)))
394#define dmacHw_STRAN_INT_DISABLE(module, channel) (dmacHw_REG_INT_MASK_STRAN((module)) = (0x00000001 << ((channel) + 8)))
395#define dmacHw_DTRAN_INT_DISABLE(module, channel) (dmacHw_REG_INT_MASK_DTRAN((module)) = (0x00000001 << ((channel) + 8)))
396
397#define dmacHw_TRAN_INT_CLEAR(module, channel) (dmacHw_REG_INT_CLEAR_TRAN((module)) = (0x00000001 << (channel)))
398#define dmacHw_BLOCK_INT_CLEAR(module, channel) (dmacHw_REG_INT_CLEAR_BLOCK((module)) = (0x00000001 << (channel)))
399#define dmacHw_ERROR_INT_CLEAR(module, channel) (dmacHw_REG_INT_CLEAR_ERROR((module)) = (0x00000001 << (channel)))
400
401#define dmacHw_GET_NUM_CHANNEL(module) (((dmacHw_REG_MISC_COMP_PARAM1_HI((module)) & dmacHw_REG_COMP_PARAM_NUM_CHANNELS) >> 8) + 1)
402#define dmacHw_GET_NUM_INTERFACE(module) (((dmacHw_REG_MISC_COMP_PARAM1_HI((module)) & dmacHw_REG_COMP_PARAM_NUM_INTERFACE) >> 11) + 1)
403#define dmacHw_GET_MAX_BLOCK_SIZE(module, channel) ((dmacHw_REG_MISC_COMP_PARAM1_LO((module)) >> (4 * (channel))) & dmacHw_REG_COMP_PARAM_MAX_BLK_SIZE)
404#define dmacHw_GET_CHANNEL_DATA_WIDTH(module, channel) ((dmacHw_REG_MISC_COMP_PARAM1_HI((module)) & dmacHw_REG_COMP_PARAM_DATA_WIDTH) >> 13)
405
406#endif /* _DMACHW_REG_H */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h b/arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h
deleted file mode 100644
index cfa91bed9d3..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h
+++ /dev/null
@@ -1,73 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15
16#ifndef CSP_HW_CFG_H
17#define CSP_HW_CFG_H
18
19/* ---- Include Files ---------------------------------------------------- */
20
21#include <cfg_global.h>
22#include <mach/csp/cap_inline.h>
23
24#if defined(__KERNEL__)
25#include <mach/memory_settings.h>
26#else
27#include <hw_cfg.h>
28#endif
29
30/* Some items that can be defined externally, but will be set to default values */
31/* if they are not defined. */
32/* HW_CFG_PLL_SPREAD_SPECTRUM_DISABLE Default undefined and SS is enabled. */
33/* HW_CFG_SDRAM_CAS_LATENCY 5 Default 5, Values [3..6] */
34/* HW_CFG_SDRAM_CHIP_SELECT_CNT 1 Default 1, Vaules [1..2] */
35/* HW_CFG_SDRAM_SPEED_GRADE 667 Default 667, Values [400,533,667,800] */
36/* HW_CFG_SDRAM_WIDTH_BITS 16 Default 16, Vaules [8,16] */
37/* HW_CFG_SDRAM_ADDR_BRC Default undefined and Row-Bank-Col (RBC) addressing used. Define to use Bank-Row-Col (BRC). */
38/* HW_CFG_SDRAM_CLK_ASYNC Default undefined and DDR clock is synchronous with AXI BUS clock. Define for ASYNC mode. */
39
40#if defined(CFG_GLOBAL_CHIP)
41 #if (CFG_GLOBAL_CHIP == FPGA11107)
42 #define HW_CFG_BUS_CLK_HZ 5000000
43 #define HW_CFG_DDR_CTLR_CLK_HZ 10000000
44 #define HW_CFG_DDR_PHY_OMIT
45 #define HW_CFG_UART_CLK_HZ 7500000
46 #else
47 #define HW_CFG_PLL_VCO_HZ 2000000000
48 #define HW_CFG_PLL2_VCO_HZ 1800000000
49 #define HW_CFG_ARM_CLK_HZ CAP_HW_CFG_ARM_CLK_HZ
50 #define HW_CFG_BUS_CLK_HZ 166666666
51 #define HW_CFG_DDR_CTLR_CLK_HZ 333333333
52 #define HW_CFG_DDR_PHY_CLK_HZ (2 * HW_CFG_DDR_CTLR_CLK_HZ)
53 #define HW_CFG_UART_CLK_HZ 142857142
54 #define HW_CFG_VPM_CLK_HZ CAP_HW_CFG_VPM_CLK_HZ
55 #endif
56#else
57 #define HW_CFG_PLL_VCO_HZ 1800000000
58 #define HW_CFG_PLL2_VCO_HZ 1800000000
59 #define HW_CFG_ARM_CLK_HZ 450000000
60 #define HW_CFG_BUS_CLK_HZ 150000000
61 #define HW_CFG_DDR_CTLR_CLK_HZ 300000000
62 #define HW_CFG_DDR_PHY_CLK_HZ (2 * HW_CFG_DDR_CTLR_CLK_HZ)
63 #define HW_CFG_UART_CLK_HZ 150000000
64 #define HW_CFG_VPM_CLK_HZ 300000000
65#endif
66
67/* ---- Public Constants and Types --------------------------------------- */
68/* ---- Public Variable Externs ------------------------------------------ */
69/* ---- Public Function Prototypes --------------------------------------- */
70
71
72#endif /* CSP_HW_CFG_H */
73
diff --git a/arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h b/arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h
deleted file mode 100644
index 0aeb6a6fe7f..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h
+++ /dev/null
@@ -1,246 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file intcHw_reg.h
18*
19* @brief platform specific interrupt controller bit assignments
20*
21* @note
22* None
23*/
24/****************************************************************************/
25
26#ifndef _INTCHW_REG_H
27#define _INTCHW_REG_H
28
29/* ---- Include Files ---------------------------------------------------- */
30#include <csp/stdint.h>
31#include <csp/reg.h>
32#include <mach/csp/mm_io.h>
33
34/* ---- Public Constants and Types --------------------------------------- */
35
36#define INTCHW_NUM_IRQ_PER_INTC 32 /* Maximum number of interrupt controllers */
37#define INTCHW_NUM_INTC 3
38
39/* Defines for interrupt controllers. This simplifies and cleans up the function calls. */
40#define INTCHW_INTC0 ((void *)MM_IO_BASE_INTC0)
41#define INTCHW_INTC1 ((void *)MM_IO_BASE_INTC1)
42#define INTCHW_SINTC ((void *)MM_IO_BASE_SINTC)
43
44/* INTC0 - interrupt controller 0 */
45#define INTCHW_INTC0_PIF_BITNUM 31 /* Peripheral interface interrupt */
46#define INTCHW_INTC0_CLCD_BITNUM 30 /* LCD Controller interrupt */
47#define INTCHW_INTC0_GE_BITNUM 29 /* Graphic engine interrupt */
48#define INTCHW_INTC0_APM_BITNUM 28 /* Audio process module interrupt */
49#define INTCHW_INTC0_ESW_BITNUM 27 /* Ethernet switch interrupt */
50#define INTCHW_INTC0_SPIH_BITNUM 26 /* SPI host interrupt */
51#define INTCHW_INTC0_TIMER3_BITNUM 25 /* Timer3 interrupt */
52#define INTCHW_INTC0_TIMER2_BITNUM 24 /* Timer2 interrupt */
53#define INTCHW_INTC0_TIMER1_BITNUM 23 /* Timer1 interrupt */
54#define INTCHW_INTC0_TIMER0_BITNUM 22 /* Timer0 interrupt */
55#define INTCHW_INTC0_SDIOH1_BITNUM 21 /* SDIO1 host interrupt */
56#define INTCHW_INTC0_SDIOH0_BITNUM 20 /* SDIO0 host interrupt */
57#define INTCHW_INTC0_USBD_BITNUM 19 /* USB device interrupt */
58#define INTCHW_INTC0_USBH1_BITNUM 18 /* USB1 host interrupt */
59#define INTCHW_INTC0_USBHD2_BITNUM 17 /* USB host2/device2 interrupt */
60#define INTCHW_INTC0_VPM_BITNUM 16 /* Voice process module interrupt */
61#define INTCHW_INTC0_DMA1C7_BITNUM 15 /* DMA1 channel 7 interrupt */
62#define INTCHW_INTC0_DMA1C6_BITNUM 14 /* DMA1 channel 6 interrupt */
63#define INTCHW_INTC0_DMA1C5_BITNUM 13 /* DMA1 channel 5 interrupt */
64#define INTCHW_INTC0_DMA1C4_BITNUM 12 /* DMA1 channel 4 interrupt */
65#define INTCHW_INTC0_DMA1C3_BITNUM 11 /* DMA1 channel 3 interrupt */
66#define INTCHW_INTC0_DMA1C2_BITNUM 10 /* DMA1 channel 2 interrupt */
67#define INTCHW_INTC0_DMA1C1_BITNUM 9 /* DMA1 channel 1 interrupt */
68#define INTCHW_INTC0_DMA1C0_BITNUM 8 /* DMA1 channel 0 interrupt */
69#define INTCHW_INTC0_DMA0C7_BITNUM 7 /* DMA0 channel 7 interrupt */
70#define INTCHW_INTC0_DMA0C6_BITNUM 6 /* DMA0 channel 6 interrupt */
71#define INTCHW_INTC0_DMA0C5_BITNUM 5 /* DMA0 channel 5 interrupt */
72#define INTCHW_INTC0_DMA0C4_BITNUM 4 /* DMA0 channel 4 interrupt */
73#define INTCHW_INTC0_DMA0C3_BITNUM 3 /* DMA0 channel 3 interrupt */
74#define INTCHW_INTC0_DMA0C2_BITNUM 2 /* DMA0 channel 2 interrupt */
75#define INTCHW_INTC0_DMA0C1_BITNUM 1 /* DMA0 channel 1 interrupt */
76#define INTCHW_INTC0_DMA0C0_BITNUM 0 /* DMA0 channel 0 interrupt */
77
78#define INTCHW_INTC0_PIF (1<<INTCHW_INTC0_PIF_BITNUM)
79#define INTCHW_INTC0_CLCD (1<<INTCHW_INTC0_CLCD_BITNUM)
80#define INTCHW_INTC0_GE (1<<INTCHW_INTC0_GE_BITNUM)
81#define INTCHW_INTC0_APM (1<<INTCHW_INTC0_APM_BITNUM)
82#define INTCHW_INTC0_ESW (1<<INTCHW_INTC0_ESW_BITNUM)
83#define INTCHW_INTC0_SPIH (1<<INTCHW_INTC0_SPIH_BITNUM)
84#define INTCHW_INTC0_TIMER3 (1<<INTCHW_INTC0_TIMER3_BITNUM)
85#define INTCHW_INTC0_TIMER2 (1<<INTCHW_INTC0_TIMER2_BITNUM)
86#define INTCHW_INTC0_TIMER1 (1<<INTCHW_INTC0_TIMER1_BITNUM)
87#define INTCHW_INTC0_TIMER0 (1<<INTCHW_INTC0_TIMER0_BITNUM)
88#define INTCHW_INTC0_SDIOH1 (1<<INTCHW_INTC0_SDIOH1_BITNUM)
89#define INTCHW_INTC0_SDIOH0 (1<<INTCHW_INTC0_SDIOH0_BITNUM)
90#define INTCHW_INTC0_USBD (1<<INTCHW_INTC0_USBD_BITNUM)
91#define INTCHW_INTC0_USBH1 (1<<INTCHW_INTC0_USBH1_BITNUM)
92#define INTCHW_INTC0_USBHD2 (1<<INTCHW_INTC0_USBHD2_BITNUM)
93#define INTCHW_INTC0_VPM (1<<INTCHW_INTC0_VPM_BITNUM)
94#define INTCHW_INTC0_DMA1C7 (1<<INTCHW_INTC0_DMA1C7_BITNUM)
95#define INTCHW_INTC0_DMA1C6 (1<<INTCHW_INTC0_DMA1C6_BITNUM)
96#define INTCHW_INTC0_DMA1C5 (1<<INTCHW_INTC0_DMA1C5_BITNUM)
97#define INTCHW_INTC0_DMA1C4 (1<<INTCHW_INTC0_DMA1C4_BITNUM)
98#define INTCHW_INTC0_DMA1C3 (1<<INTCHW_INTC0_DMA1C3_BITNUM)
99#define INTCHW_INTC0_DMA1C2 (1<<INTCHW_INTC0_DMA1C2_BITNUM)
100#define INTCHW_INTC0_DMA1C1 (1<<INTCHW_INTC0_DMA1C1_BITNUM)
101#define INTCHW_INTC0_DMA1C0 (1<<INTCHW_INTC0_DMA1C0_BITNUM)
102#define INTCHW_INTC0_DMA0C7 (1<<INTCHW_INTC0_DMA0C7_BITNUM)
103#define INTCHW_INTC0_DMA0C6 (1<<INTCHW_INTC0_DMA0C6_BITNUM)
104#define INTCHW_INTC0_DMA0C5 (1<<INTCHW_INTC0_DMA0C5_BITNUM)
105#define INTCHW_INTC0_DMA0C4 (1<<INTCHW_INTC0_DMA0C4_BITNUM)
106#define INTCHW_INTC0_DMA0C3 (1<<INTCHW_INTC0_DMA0C3_BITNUM)
107#define INTCHW_INTC0_DMA0C2 (1<<INTCHW_INTC0_DMA0C2_BITNUM)
108#define INTCHW_INTC0_DMA0C1 (1<<INTCHW_INTC0_DMA0C1_BITNUM)
109#define INTCHW_INTC0_DMA0C0 (1<<INTCHW_INTC0_DMA0C0_BITNUM)
110
111/* INTC1 - interrupt controller 1 */
112#define INTCHW_INTC1_DDRVPMP_BITNUM 27 /* DDR and VPM PLL clock phase relationship interrupt (Not for A0) */
113#define INTCHW_INTC1_DDRVPMT_BITNUM 26 /* DDR and VPM HW phase align timeout interrupt (Not for A0) */
114#define INTCHW_INTC1_DDRP_BITNUM 26 /* DDR and PLL clock phase relationship interrupt (For A0 only)) */
115#define INTCHW_INTC1_RTC2_BITNUM 25 /* Real time clock tamper interrupt */
116#define INTCHW_INTC1_VDEC_BITNUM 24 /* Hantro Video Decoder interrupt */
117/* Bits 13-23 are non-secure versions of the corresponding secure bits in SINTC bits 0-10. */
118#define INTCHW_INTC1_SPUM_BITNUM 23 /* Secure process module interrupt */
119#define INTCHW_INTC1_RTC1_BITNUM 22 /* Real time clock one-shot interrupt */
120#define INTCHW_INTC1_RTC0_BITNUM 21 /* Real time clock periodic interrupt */
121#define INTCHW_INTC1_RNG_BITNUM 20 /* Random number generator interrupt */
122#define INTCHW_INTC1_FMPU_BITNUM 19 /* Flash memory parition unit interrupt */
123#define INTCHW_INTC1_VMPU_BITNUM 18 /* VRAM memory partition interrupt */
124#define INTCHW_INTC1_DMPU_BITNUM 17 /* DDR2 memory partition interrupt */
125#define INTCHW_INTC1_KEYC_BITNUM 16 /* Key pad controller interrupt */
126#define INTCHW_INTC1_TSC_BITNUM 15 /* Touch screen controller interrupt */
127#define INTCHW_INTC1_UART0_BITNUM 14 /* UART 0 */
128#define INTCHW_INTC1_WDOG_BITNUM 13 /* Watchdog timer interrupt */
129
130#define INTCHW_INTC1_UART1_BITNUM 12 /* UART 1 */
131#define INTCHW_INTC1_PMUIRQ_BITNUM 11 /* ARM performance monitor interrupt */
132#define INTCHW_INTC1_COMMRX_BITNUM 10 /* ARM DDC receive interrupt */
133#define INTCHW_INTC1_COMMTX_BITNUM 9 /* ARM DDC transmit interrupt */
134#define INTCHW_INTC1_FLASHC_BITNUM 8 /* Flash controller interrupt */
135#define INTCHW_INTC1_GPHY_BITNUM 7 /* Gigabit Phy interrupt */
136#define INTCHW_INTC1_SPIS_BITNUM 6 /* SPI slave interrupt */
137#define INTCHW_INTC1_I2CS_BITNUM 5 /* I2C slave interrupt */
138#define INTCHW_INTC1_I2CH_BITNUM 4 /* I2C host interrupt */
139#define INTCHW_INTC1_I2S1_BITNUM 3 /* I2S1 interrupt */
140#define INTCHW_INTC1_I2S0_BITNUM 2 /* I2S0 interrupt */
141#define INTCHW_INTC1_GPIO1_BITNUM 1 /* GPIO bit 64//32 combined interrupt */
142#define INTCHW_INTC1_GPIO0_BITNUM 0 /* GPIO bit 31//0 combined interrupt */
143
144#define INTCHW_INTC1_DDRVPMT (1<<INTCHW_INTC1_DDRVPMT_BITNUM)
145#define INTCHW_INTC1_DDRVPMP (1<<INTCHW_INTC1_DDRVPMP_BITNUM)
146#define INTCHW_INTC1_DDRP (1<<INTCHW_INTC1_DDRP_BITNUM)
147#define INTCHW_INTC1_VDEC (1<<INTCHW_INTC1_VDEC_BITNUM)
148#define INTCHW_INTC1_SPUM (1<<INTCHW_INTC1_SPUM_BITNUM)
149#define INTCHW_INTC1_RTC2 (1<<INTCHW_INTC1_RTC2_BITNUM)
150#define INTCHW_INTC1_RTC1 (1<<INTCHW_INTC1_RTC1_BITNUM)
151#define INTCHW_INTC1_RTC0 (1<<INTCHW_INTC1_RTC0_BITNUM)
152#define INTCHW_INTC1_RNG (1<<INTCHW_INTC1_RNG_BITNUM)
153#define INTCHW_INTC1_FMPU (1<<INTCHW_INTC1_FMPU_BITNUM)
154#define INTCHW_INTC1_IMPU (1<<INTCHW_INTC1_IMPU_BITNUM)
155#define INTCHW_INTC1_DMPU (1<<INTCHW_INTC1_DMPU_BITNUM)
156#define INTCHW_INTC1_KEYC (1<<INTCHW_INTC1_KEYC_BITNUM)
157#define INTCHW_INTC1_TSC (1<<INTCHW_INTC1_TSC_BITNUM)
158#define INTCHW_INTC1_UART0 (1<<INTCHW_INTC1_UART0_BITNUM)
159#define INTCHW_INTC1_WDOG (1<<INTCHW_INTC1_WDOG_BITNUM)
160#define INTCHW_INTC1_UART1 (1<<INTCHW_INTC1_UART1_BITNUM)
161#define INTCHW_INTC1_PMUIRQ (1<<INTCHW_INTC1_PMUIRQ_BITNUM)
162#define INTCHW_INTC1_COMMRX (1<<INTCHW_INTC1_COMMRX_BITNUM)
163#define INTCHW_INTC1_COMMTX (1<<INTCHW_INTC1_COMMTX_BITNUM)
164#define INTCHW_INTC1_FLASHC (1<<INTCHW_INTC1_FLASHC_BITNUM)
165#define INTCHW_INTC1_GPHY (1<<INTCHW_INTC1_GPHY_BITNUM)
166#define INTCHW_INTC1_SPIS (1<<INTCHW_INTC1_SPIS_BITNUM)
167#define INTCHW_INTC1_I2CS (1<<INTCHW_INTC1_I2CS_BITNUM)
168#define INTCHW_INTC1_I2CH (1<<INTCHW_INTC1_I2CH_BITNUM)
169#define INTCHW_INTC1_I2S1 (1<<INTCHW_INTC1_I2S1_BITNUM)
170#define INTCHW_INTC1_I2S0 (1<<INTCHW_INTC1_I2S0_BITNUM)
171#define INTCHW_INTC1_GPIO1 (1<<INTCHW_INTC1_GPIO1_BITNUM)
172#define INTCHW_INTC1_GPIO0 (1<<INTCHW_INTC1_GPIO0_BITNUM)
173
174/* SINTC secure int controller */
175#define INTCHW_SINTC_RTC2_BITNUM 15 /* Real time clock tamper interrupt */
176#define INTCHW_SINTC_TIMER3_BITNUM 14 /* Secure timer3 interrupt */
177#define INTCHW_SINTC_TIMER2_BITNUM 13 /* Secure timer2 interrupt */
178#define INTCHW_SINTC_TIMER1_BITNUM 12 /* Secure timer1 interrupt */
179#define INTCHW_SINTC_TIMER0_BITNUM 11 /* Secure timer0 interrupt */
180#define INTCHW_SINTC_SPUM_BITNUM 10 /* Secure process module interrupt */
181#define INTCHW_SINTC_RTC1_BITNUM 9 /* Real time clock one-shot interrupt */
182#define INTCHW_SINTC_RTC0_BITNUM 8 /* Real time clock periodic interrupt */
183#define INTCHW_SINTC_RNG_BITNUM 7 /* Random number generator interrupt */
184#define INTCHW_SINTC_FMPU_BITNUM 6 /* Flash memory parition unit interrupt */
185#define INTCHW_SINTC_VMPU_BITNUM 5 /* VRAM memory partition interrupt */
186#define INTCHW_SINTC_DMPU_BITNUM 4 /* DDR2 memory partition interrupt */
187#define INTCHW_SINTC_KEYC_BITNUM 3 /* Key pad controller interrupt */
188#define INTCHW_SINTC_TSC_BITNUM 2 /* Touch screen controller interrupt */
189#define INTCHW_SINTC_UART0_BITNUM 1 /* UART0 interrupt */
190#define INTCHW_SINTC_WDOG_BITNUM 0 /* Watchdog timer interrupt */
191
192#define INTCHW_SINTC_TIMER3 (1<<INTCHW_SINTC_TIMER3_BITNUM)
193#define INTCHW_SINTC_TIMER2 (1<<INTCHW_SINTC_TIMER2_BITNUM)
194#define INTCHW_SINTC_TIMER1 (1<<INTCHW_SINTC_TIMER1_BITNUM)
195#define INTCHW_SINTC_TIMER0 (1<<INTCHW_SINTC_TIMER0_BITNUM)
196#define INTCHW_SINTC_SPUM (1<<INTCHW_SINTC_SPUM_BITNUM)
197#define INTCHW_SINTC_RTC2 (1<<INTCHW_SINTC_RTC2_BITNUM)
198#define INTCHW_SINTC_RTC1 (1<<INTCHW_SINTC_RTC1_BITNUM)
199#define INTCHW_SINTC_RTC0 (1<<INTCHW_SINTC_RTC0_BITNUM)
200#define INTCHW_SINTC_RNG (1<<INTCHW_SINTC_RNG_BITNUM)
201#define INTCHW_SINTC_FMPU (1<<INTCHW_SINTC_FMPU_BITNUM)
202#define INTCHW_SINTC_IMPU (1<<INTCHW_SINTC_IMPU_BITNUM)
203#define INTCHW_SINTC_DMPU (1<<INTCHW_SINTC_DMPU_BITNUM)
204#define INTCHW_SINTC_KEYC (1<<INTCHW_SINTC_KEYC_BITNUM)
205#define INTCHW_SINTC_TSC (1<<INTCHW_SINTC_TSC_BITNUM)
206#define INTCHW_SINTC_UART0 (1<<INTCHW_SINTC_UART0_BITNUM)
207#define INTCHW_SINTC_WDOG (1<<INTCHW_SINTC_WDOG_BITNUM)
208
209/* PL192 Vectored Interrupt Controller (VIC) layout */
210#define INTCHW_IRQSTATUS 0x00 /* IRQ status register */
211#define INTCHW_FIQSTATUS 0x04 /* FIQ status register */
212#define INTCHW_RAWINTR 0x08 /* Raw Interrupt Status register */
213#define INTCHW_INTSELECT 0x0c /* Interrupt Select Register */
214#define INTCHW_INTENABLE 0x10 /* Interrupt Enable Register */
215#define INTCHW_INTENCLEAR 0x14 /* Interrupt Enable Clear Register */
216#define INTCHW_SOFTINT 0x18 /* Soft Interrupt Register */
217#define INTCHW_SOFTINTCLEAR 0x1c /* Soft Interrupt Clear Register */
218#define INTCHW_PROTECTION 0x20 /* Protection Enable Register */
219#define INTCHW_SWPRIOMASK 0x24 /* Software Priority Mask Register */
220#define INTCHW_PRIODAISY 0x28 /* Priority Daisy Chain Register */
221#define INTCHW_VECTADDR0 0x100 /* Vector Address Registers */
222#define INTCHW_VECTPRIO0 0x200 /* Vector Priority Registers 0-31 */
223#define INTCHW_ADDRESS 0xf00 /* Vector Address Register 0-31 */
224#define INTCHW_PID 0xfe0 /* Peripheral ID Register 0-3 */
225#define INTCHW_PCELLID 0xff0 /* PrimeCell ID Register 0-3 */
226
227/* Example Usage: intcHw_irq_enable(INTCHW_INTC0, INTCHW_INTC0_TIMER0); */
228/* intcHw_irq_clear(INTCHW_INTC0, INTCHW_INTC0_TIMER0); */
229/* uint32_t bits = intcHw_irq_status(INTCHW_INTC0); */
230/* uint32_t bits = intcHw_irq_raw_status(INTCHW_INTC0); */
231
232/* ---- Public Variable Externs ------------------------------------------ */
233/* ---- Public Function Prototypes --------------------------------------- */
234/* Clear one or more IRQ interrupts. */
235static inline void intcHw_irq_disable(void *basep, uint32_t mask)
236{
237 __REG32(basep + INTCHW_INTENCLEAR) = mask;
238}
239
240/* Enables one or more IRQ interrupts. */
241static inline void intcHw_irq_enable(void *basep, uint32_t mask)
242{
243 __REG32(basep + INTCHW_INTENABLE) = mask;
244}
245
246#endif /* _INTCHW_REG_H */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/mm_addr.h b/arch/arm/mach-bcmring/include/mach/csp/mm_addr.h
deleted file mode 100644
index ad58cf87337..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/mm_addr.h
+++ /dev/null
@@ -1,101 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file mm_addr.h
18*
19* @brief Memory Map address definitions
20*
21* @note
22* None
23*/
24/****************************************************************************/
25
26#ifndef _MM_ADDR_H
27#define _MM_ADDR_H
28
29/* ---- Include Files ---------------------------------------------------- */
30
31#if !defined(CSP_SIMULATION)
32#include <cfg_global.h>
33#endif
34
35/* ---- Public Constants and Types --------------------------------------- */
36
37/* Memory Map address definitions */
38
39#define MM_ADDR_DDR 0x00000000
40
41#define MM_ADDR_IO_VPM_EXTMEM_RSVD 0x0F000000 /* 16 MB - Reserved external memory for VPM use */
42
43#define MM_ADDR_IO_FLASHC 0x20000000
44#define MM_ADDR_IO_BROM 0x30000000
45#define MM_ADDR_IO_ARAM 0x30100000 /* 64 KB - extra cycle latency - WS switch */
46#define MM_ADDR_IO_DMA0 0x30200000
47#define MM_ADDR_IO_DMA1 0x30300000
48#define MM_ADDR_IO_ESW 0x30400000
49#define MM_ADDR_IO_CLCD 0x30500000
50#define MM_ADDR_IO_PIF 0x30580000
51#define MM_ADDR_IO_APM 0x30600000
52#define MM_ADDR_IO_SPUM 0x30700000
53#define MM_ADDR_IO_VPM_PROG 0x30800000
54#define MM_ADDR_IO_VPM_DATA 0x30A00000
55#define MM_ADDR_IO_VRAM 0x40000000 /* 64 KB - security block in front of it */
56#define MM_ADDR_IO_CHIPC 0x80000000
57#define MM_ADDR_IO_UMI 0x80001000
58#define MM_ADDR_IO_NAND 0x80001800
59#define MM_ADDR_IO_LEDM 0x80002000
60#define MM_ADDR_IO_PWM 0x80002040
61#define MM_ADDR_IO_VINTC 0x80003000
62#define MM_ADDR_IO_GPIO0 0x80004000
63#define MM_ADDR_IO_GPIO1 0x80004800
64#define MM_ADDR_IO_I2CS 0x80005000
65#define MM_ADDR_IO_SPIS 0x80006000
66#define MM_ADDR_IO_HPM 0x80007400
67#define MM_ADDR_IO_HPM_REMAP 0x80007800
68#define MM_ADDR_IO_TZPC 0x80008000
69#define MM_ADDR_IO_MPU 0x80009000
70#define MM_ADDR_IO_SPUMP 0x8000a000
71#define MM_ADDR_IO_PKA 0x8000b000
72#define MM_ADDR_IO_RNG 0x8000c000
73#define MM_ADDR_IO_KEYC 0x8000d000
74#define MM_ADDR_IO_BBL 0x8000e000
75#define MM_ADDR_IO_OTP 0x8000f000
76#define MM_ADDR_IO_I2S0 0x80010000
77#define MM_ADDR_IO_I2S1 0x80011000
78#define MM_ADDR_IO_UARTA 0x80012000
79#define MM_ADDR_IO_UARTB 0x80013000
80#define MM_ADDR_IO_I2CH 0x80014020
81#define MM_ADDR_IO_SPIH 0x80015000
82#define MM_ADDR_IO_TSC 0x80016000
83#define MM_ADDR_IO_TMR 0x80017000
84#define MM_ADDR_IO_WATCHDOG 0x80017800
85#define MM_ADDR_IO_ETM 0x80018000
86#define MM_ADDR_IO_DDRC 0x80019000
87#define MM_ADDR_IO_SINTC 0x80100000
88#define MM_ADDR_IO_INTC0 0x80200000
89#define MM_ADDR_IO_INTC1 0x80201000
90#define MM_ADDR_IO_GE 0x80300000
91#define MM_ADDR_IO_USB_CTLR0 0x80400000
92#define MM_ADDR_IO_USB_CTLR1 0x80410000
93#define MM_ADDR_IO_USB_PHY 0x80420000
94#define MM_ADDR_IO_SDIOH0 0x80500000
95#define MM_ADDR_IO_SDIOH1 0x80600000
96#define MM_ADDR_IO_VDEC 0x80700000
97
98/* ---- Public Variable Externs ------------------------------------------ */
99/* ---- Public Function Prototypes --------------------------------------- */
100
101#endif /* _MM_ADDR_H */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/mm_io.h b/arch/arm/mach-bcmring/include/mach/csp/mm_io.h
deleted file mode 100644
index de92ec6a01a..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/mm_io.h
+++ /dev/null
@@ -1,147 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file mm_io.h
18*
19* @brief Memory Map I/O definitions
20*
21* @note
22* None
23*/
24/****************************************************************************/
25
26#ifndef _MM_IO_H
27#define _MM_IO_H
28
29/* ---- Include Files ---------------------------------------------------- */
30#include <mach/csp/mm_addr.h>
31
32#if !defined(CSP_SIMULATION)
33#include <cfg_global.h>
34#endif
35
36/* ---- Public Constants and Types --------------------------------------- */
37
38#if defined(CONFIG_MMU)
39
40/* This macro is referenced in <mach/io.h>
41 * Phys to Virtual 0xNyxxxxxx => 0xFNxxxxxx
42 * This macro is referenced in <asm/arch/io.h>
43 *
44 * Assume VPM address is the last x MB of memory. For VPM, map to
45 * 0xf0000000 and up.
46 */
47
48#ifndef MM_IO_PHYS_TO_VIRT
49#ifdef __ASSEMBLY__
50#define MM_IO_PHYS_TO_VIRT(phys) (0xF0000000 | (((phys) >> 4) & 0x0F000000) | ((phys) & 0xFFFFFF))
51#else
52#define MM_IO_PHYS_TO_VIRT(phys) (((phys) == MM_ADDR_IO_VPM_EXTMEM_RSVD) ? 0xF0000000 : \
53 (0xF0000000 | (((phys) >> 4) & 0x0F000000) | ((phys) & 0xFFFFFF)))
54#endif
55#endif
56
57/* Virtual to Physical 0xFNxxxxxx => 0xN0xxxxxx */
58
59#ifndef MM_IO_VIRT_TO_PHYS
60#ifdef __ASSEMBLY__
61#define MM_IO_VIRT_TO_PHYS(virt) ((((virt) & 0x0F000000) << 4) | ((virt) & 0xFFFFFF))
62#else
63#define MM_IO_VIRT_TO_PHYS(virt) (((virt) == 0xF0000000) ? MM_ADDR_IO_VPM_EXTMEM_RSVD : \
64 ((((virt) & 0x0F000000) << 4) | ((virt) & 0xFFFFFF)))
65#endif
66#endif
67
68#else
69
70#ifndef MM_IO_PHYS_TO_VIRT
71#define MM_IO_PHYS_TO_VIRT(phys) (phys)
72#endif
73
74#ifndef MM_IO_VIRT_TO_PHYS
75#define MM_IO_VIRT_TO_PHYS(virt) (virt)
76#endif
77
78#endif
79
80/* Registers in 0xExxxxxxx that should be moved to 0xFxxxxxxx */
81#define MM_IO_BASE_FLASHC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_FLASHC)
82#define MM_IO_BASE_NAND MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_NAND)
83#define MM_IO_BASE_UMI MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_UMI)
84
85#define MM_IO_START MM_ADDR_IO_FLASHC /* Physical beginning of IO mapped memory */
86#define MM_IO_BASE MM_IO_BASE_FLASHC /* Virtual beginning of IO mapped memory */
87
88#define MM_IO_BASE_BROM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_BROM)
89#define MM_IO_BASE_ARAM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_ARAM)
90#define MM_IO_BASE_DMA0 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_DMA0)
91#define MM_IO_BASE_DMA1 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_DMA1)
92#define MM_IO_BASE_ESW MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_ESW)
93#define MM_IO_BASE_CLCD MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_CLCD)
94#define MM_IO_BASE_PIF MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_PIF)
95#define MM_IO_BASE_APM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_APM)
96#define MM_IO_BASE_SPUM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SPUM)
97#define MM_IO_BASE_VPM_PROG MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_VPM_PROG)
98#define MM_IO_BASE_VPM_DATA MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_VPM_DATA)
99
100#define MM_IO_BASE_VRAM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_VRAM)
101
102#define MM_IO_BASE_CHIPC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_CHIPC)
103#define MM_IO_BASE_DDRC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_DDRC)
104#define MM_IO_BASE_LEDM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_LEDM)
105#define MM_IO_BASE_PWM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_PWM)
106#define MM_IO_BASE_VINTC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_VINTC)
107#define MM_IO_BASE_GPIO0 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_GPIO0)
108#define MM_IO_BASE_GPIO1 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_GPIO1)
109#define MM_IO_BASE_TMR MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_TMR)
110#define MM_IO_BASE_WATCHDOG MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_WATCHDOG)
111#define MM_IO_BASE_ETM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_ETM)
112#define MM_IO_BASE_HPM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_HPM)
113#define MM_IO_BASE_HPM_REMAP MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_HPM_REMAP)
114#define MM_IO_BASE_TZPC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_TZPC)
115#define MM_IO_BASE_MPU MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_MPU)
116#define MM_IO_BASE_SPUMP MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SPUMP)
117#define MM_IO_BASE_PKA MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_PKA)
118#define MM_IO_BASE_RNG MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_RNG)
119#define MM_IO_BASE_KEYC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_KEYC)
120#define MM_IO_BASE_BBL MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_BBL)
121#define MM_IO_BASE_OTP MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_OTP)
122#define MM_IO_BASE_I2S0 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_I2S0)
123#define MM_IO_BASE_I2S1 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_I2S1)
124#define MM_IO_BASE_UARTA MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_UARTA)
125#define MM_IO_BASE_UARTB MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_UARTB)
126#define MM_IO_BASE_I2CH MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_I2CH)
127#define MM_IO_BASE_SPIH MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SPIH)
128#define MM_IO_BASE_TSC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_TSC)
129#define MM_IO_BASE_I2CS MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_I2CS)
130#define MM_IO_BASE_SPIS MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SPIS)
131#define MM_IO_BASE_SINTC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SINTC)
132#define MM_IO_BASE_INTC0 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_INTC0)
133#define MM_IO_BASE_INTC1 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_INTC1)
134#define MM_IO_BASE_GE MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_GE)
135#define MM_IO_BASE_USB_CTLR0 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_USB_CTLR0)
136#define MM_IO_BASE_USB_CTLR1 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_USB_CTLR1)
137#define MM_IO_BASE_USB_PHY MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_USB_PHY)
138#define MM_IO_BASE_SDIOH0 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SDIOH0)
139#define MM_IO_BASE_SDIOH1 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SDIOH1)
140#define MM_IO_BASE_VDEC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_VDEC)
141
142#define MM_IO_BASE_VPM_EXTMEM_RSVD MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_VPM_EXTMEM_RSVD)
143
144/* ---- Public Variable Externs ------------------------------------------ */
145/* ---- Public Function Prototypes --------------------------------------- */
146
147#endif /* _MM_IO_H */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/secHw_def.h b/arch/arm/mach-bcmring/include/mach/csp/secHw_def.h
deleted file mode 100644
index d15f5f3ec2d..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/secHw_def.h
+++ /dev/null
@@ -1,100 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file secHw_def.h
18*
19* @brief Definitions for configuring/testing secure blocks
20*
21* @note
22* None
23*/
24/****************************************************************************/
25
26#ifndef SECHW_DEF_H
27#define SECHW_DEF_H
28
29#include <mach/csp/mm_io.h>
30
31/* Bit mask for various secure device */
32#define secHw_BLK_MASK_CHIP_CONTROL 0x00000001
33#define secHw_BLK_MASK_KEY_SCAN 0x00000002
34#define secHw_BLK_MASK_TOUCH_SCREEN 0x00000004
35#define secHw_BLK_MASK_UART0 0x00000008
36#define secHw_BLK_MASK_UART1 0x00000010
37#define secHw_BLK_MASK_WATCHDOG 0x00000020
38#define secHw_BLK_MASK_SPUM 0x00000040
39#define secHw_BLK_MASK_DDR2 0x00000080
40#define secHw_BLK_MASK_EXT_MEM 0x00000100
41#define secHw_BLK_MASK_ESW 0x00000200
42#define secHw_BLK_MASK_SPU 0x00010000
43#define secHw_BLK_MASK_PKA 0x00020000
44#define secHw_BLK_MASK_RNG 0x00040000
45#define secHw_BLK_MASK_RTC 0x00080000
46#define secHw_BLK_MASK_OTP 0x00100000
47#define secHw_BLK_MASK_BOOT 0x00200000
48#define secHw_BLK_MASK_MPU 0x00400000
49#define secHw_BLK_MASK_TZCTRL 0x00800000
50#define secHw_BLK_MASK_INTR 0x01000000
51
52/* Trustzone register set */
53typedef struct {
54 volatile uint32_t status; /* read only - reflects status of writes of 2 write registers */
55 volatile uint32_t setUnsecure; /* write only. reads back as 0 */
56 volatile uint32_t setSecure; /* write only. reads back as 0 */
57} secHw_TZREG_t;
58
59/* There are 2 register sets. The first is for the lower 16 bits, the 2nd */
60/* is for the higher 16 bits. */
61
62typedef enum {
63 secHw_IDX_LS = 0,
64 secHw_IDX_MS = 1,
65 secHw_IDX_NUM
66} secHw_IDX_e;
67
68typedef struct {
69 volatile secHw_TZREG_t reg[secHw_IDX_NUM];
70} secHw_REGS_t;
71
72/****************************************************************************/
73/**
74* @brief Configures a device as a secure device
75*
76*/
77/****************************************************************************/
78static inline void secHw_setSecure(uint32_t mask /* mask of type secHw_BLK_MASK_XXXXXX */
79 );
80
81/****************************************************************************/
82/**
83* @brief Configures a device as a non-secure device
84*
85*/
86/****************************************************************************/
87static inline void secHw_setUnsecure(uint32_t mask /* mask of type secHw_BLK_MASK_XXXXXX */
88 );
89
90/****************************************************************************/
91/**
92* @brief Get the trustzone status for all components. 1 = non-secure, 0 = secure
93*
94*/
95/****************************************************************************/
96static inline uint32_t secHw_getStatus(void);
97
98#include <mach/csp/secHw_inline.h>
99
100#endif /* SECHW_DEF_H */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/secHw_inline.h b/arch/arm/mach-bcmring/include/mach/csp/secHw_inline.h
deleted file mode 100644
index 9cd6a032ab7..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/secHw_inline.h
+++ /dev/null
@@ -1,79 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file secHw_inline.h
18*
19* @brief Definitions for configuring/testing secure blocks
20*
21* @note
22* None
23*/
24/****************************************************************************/
25
26#ifndef SECHW_INLINE_H
27#define SECHW_INLINE_H
28
29/****************************************************************************/
30/**
31* @brief Configures a device as a secure device
32*
33*/
34/****************************************************************************/
35static inline void secHw_setSecure(uint32_t mask /* mask of type secHw_BLK_MASK_XXXXXX */
36 ) {
37 secHw_REGS_t *regp = (secHw_REGS_t *) MM_IO_BASE_TZPC;
38
39 if (mask & 0x0000FFFF) {
40 regp->reg[secHw_IDX_LS].setSecure = mask & 0x0000FFFF;
41 }
42
43 if (mask & 0xFFFF0000) {
44 regp->reg[secHw_IDX_MS].setSecure = mask >> 16;
45 }
46}
47
48/****************************************************************************/
49/**
50* @brief Configures a device as a non-secure device
51*
52*/
53/****************************************************************************/
54static inline void secHw_setUnsecure(uint32_t mask /* mask of type secHw_BLK_MASK_XXXXXX */
55 ) {
56 secHw_REGS_t *regp = (secHw_REGS_t *) MM_IO_BASE_TZPC;
57
58 if (mask & 0x0000FFFF) {
59 regp->reg[secHw_IDX_LS].setUnsecure = mask & 0x0000FFFF;
60 }
61 if (mask & 0xFFFF0000) {
62 regp->reg[secHw_IDX_MS].setUnsecure = mask >> 16;
63 }
64}
65
66/****************************************************************************/
67/**
68* @brief Get the trustzone status for all components. 1 = non-secure, 0 = secure
69*
70*/
71/****************************************************************************/
72static inline uint32_t secHw_getStatus(void)
73{
74 secHw_REGS_t *regp = (secHw_REGS_t *) MM_IO_BASE_TZPC;
75
76 return (regp->reg[1].status << 16) + regp->reg[0].status;
77}
78
79#endif /* SECHW_INLINE_H */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/tmrHw_reg.h b/arch/arm/mach-bcmring/include/mach/csp/tmrHw_reg.h
deleted file mode 100644
index 3080ac7239a..00000000000
--- a/arch/arm/mach-bcmring/include/mach/csp/tmrHw_reg.h
+++ /dev/null
@@ -1,82 +0,0 @@
1/*****************************************************************************
2* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file tmrHw_reg.h
18*
19* @brief Definitions for low level Timer registers
20*
21*/
22/****************************************************************************/
23#ifndef _TMRHW_REG_H
24#define _TMRHW_REG_H
25
26#include <mach/csp/mm_io.h>
27#include <mach/csp/hw_cfg.h>
28/* Base address */
29#define tmrHw_MODULE_BASE_ADDR MM_IO_BASE_TMR
30
31/*
32This platform has four different timers running at different clock speed
33
34Timer one (Timer ID 0) runs at 25 MHz
35Timer two (Timer ID 1) runs at 25 MHz
36Timer three (Timer ID 2) runs at 150 MHz
37Timer four (Timer ID 3) runs at 150 MHz
38*/
39#define tmrHw_LOW_FREQUENCY_MHZ 25 /* Always 25MHz from XTAL */
40#define tmrHw_LOW_FREQUENCY_HZ 25000000
41
42#if defined(CFG_GLOBAL_CHIP) && (CFG_GLOBAL_CHIP == FPGA11107)
43#define tmrHw_HIGH_FREQUENCY_MHZ 150 /* Always 150MHz for FPGA */
44#define tmrHw_HIGH_FREQUENCY_HZ 150000000
45#else
46#define tmrHw_HIGH_FREQUENCY_HZ HW_CFG_BUS_CLK_HZ
47#define tmrHw_HIGH_FREQUENCY_MHZ (HW_CFG_BUS_CLK_HZ / 1000000)
48#endif
49
50#define tmrHw_LOW_RESOLUTION_CLOCK tmrHw_LOW_FREQUENCY_HZ
51#define tmrHw_HIGH_RESOLUTION_CLOCK tmrHw_HIGH_FREQUENCY_HZ
52#define tmrHw_MAX_COUNT (0xFFFFFFFF) /* maximum number of count a timer can count */
53#define tmrHw_TIMER_NUM_COUNT (4) /* Number of timer module supported */
54
55typedef struct {
56 uint32_t LoadValue; /* Load value for timer */
57 uint32_t CurrentValue; /* Current value for timer */
58 uint32_t Control; /* Control register */
59 uint32_t InterruptClear; /* Interrupt clear register */
60 uint32_t RawInterruptStatus; /* Raw interrupt status */
61 uint32_t InterruptStatus; /* Masked interrupt status */
62 uint32_t BackgroundLoad; /* Background load value */
63 uint32_t padding; /* Padding register */
64} tmrHw_REG_t;
65
66/* Control bot masks */
67#define tmrHw_CONTROL_TIMER_ENABLE 0x00000080
68#define tmrHw_CONTROL_PERIODIC 0x00000040
69#define tmrHw_CONTROL_INTERRUPT_ENABLE 0x00000020
70#define tmrHw_CONTROL_PRESCALE_MASK 0x0000000C
71#define tmrHw_CONTROL_PRESCALE_1 0x00000000
72#define tmrHw_CONTROL_PRESCALE_16 0x00000004
73#define tmrHw_CONTROL_PRESCALE_256 0x00000008
74#define tmrHw_CONTROL_32BIT 0x00000002
75#define tmrHw_CONTROL_ONESHOT 0x00000001
76#define tmrHw_CONTROL_FREE_RUNNING 0x00000000
77
78#define tmrHw_CONTROL_MODE_MASK (tmrHw_CONTROL_PERIODIC | tmrHw_CONTROL_ONESHOT)
79
80#define pTmrHw ((volatile tmrHw_REG_t *)tmrHw_MODULE_BASE_ADDR)
81
82#endif /* _TMRHW_REG_H */
diff --git a/arch/arm/mach-bcmring/include/mach/dma.h b/arch/arm/mach-bcmring/include/mach/dma.h
deleted file mode 100644
index 72543781207..00000000000
--- a/arch/arm/mach-bcmring/include/mach/dma.h
+++ /dev/null
@@ -1,630 +0,0 @@
1/*****************************************************************************
2* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/****************************************************************************/
16/**
17* @file dma.h
18*
19* @brief API definitions for the linux DMA interface.
20*/
21/****************************************************************************/
22
23#if !defined(ASM_ARM_ARCH_BCMRING_DMA_H)
24#define ASM_ARM_ARCH_BCMRING_DMA_H
25
26/* ---- Include Files ---------------------------------------------------- */
27
28#include <linux/kernel.h>
29#include <linux/semaphore.h>
30#include <csp/dmacHw.h>
31#include <mach/timer.h>
32
33/* ---- Constants and Types ---------------------------------------------- */
34
35/* If DMA_DEBUG_TRACK_RESERVATION is set to a non-zero value, then the filename */
36/* and line number of the reservation request will be recorded in the channel table */
37
38#define DMA_DEBUG_TRACK_RESERVATION 1
39
40#define DMA_NUM_CONTROLLERS 2
41#define DMA_NUM_CHANNELS 8 /* per controller */
42
43typedef enum {
44 DMA_DEVICE_MEM_TO_MEM, /* For memory to memory transfers */
45 DMA_DEVICE_I2S0_DEV_TO_MEM,
46 DMA_DEVICE_I2S0_MEM_TO_DEV,
47 DMA_DEVICE_I2S1_DEV_TO_MEM,
48 DMA_DEVICE_I2S1_MEM_TO_DEV,
49 DMA_DEVICE_APM_CODEC_A_DEV_TO_MEM,
50 DMA_DEVICE_APM_CODEC_A_MEM_TO_DEV,
51 DMA_DEVICE_APM_CODEC_B_DEV_TO_MEM,
52 DMA_DEVICE_APM_CODEC_B_MEM_TO_DEV,
53 DMA_DEVICE_APM_CODEC_C_DEV_TO_MEM, /* Additional mic input for beam-forming */
54 DMA_DEVICE_APM_PCM0_DEV_TO_MEM,
55 DMA_DEVICE_APM_PCM0_MEM_TO_DEV,
56 DMA_DEVICE_APM_PCM1_DEV_TO_MEM,
57 DMA_DEVICE_APM_PCM1_MEM_TO_DEV,
58 DMA_DEVICE_SPUM_DEV_TO_MEM,
59 DMA_DEVICE_SPUM_MEM_TO_DEV,
60 DMA_DEVICE_SPIH_DEV_TO_MEM,
61 DMA_DEVICE_SPIH_MEM_TO_DEV,
62 DMA_DEVICE_UART_A_DEV_TO_MEM,
63 DMA_DEVICE_UART_A_MEM_TO_DEV,
64 DMA_DEVICE_UART_B_DEV_TO_MEM,
65 DMA_DEVICE_UART_B_MEM_TO_DEV,
66 DMA_DEVICE_PIF_MEM_TO_DEV,
67 DMA_DEVICE_PIF_DEV_TO_MEM,
68 DMA_DEVICE_ESW_DEV_TO_MEM,
69 DMA_DEVICE_ESW_MEM_TO_DEV,
70 DMA_DEVICE_VPM_MEM_TO_MEM,
71 DMA_DEVICE_CLCD_MEM_TO_MEM,
72 DMA_DEVICE_NAND_MEM_TO_MEM,
73 DMA_DEVICE_MEM_TO_VRAM,
74 DMA_DEVICE_VRAM_TO_MEM,
75
76 /* Add new entries before this line. */
77
78 DMA_NUM_DEVICE_ENTRIES,
79 DMA_DEVICE_NONE = 0xff, /* Special value to indicate that no device is currently assigned. */
80
81} DMA_Device_t;
82
83/****************************************************************************
84*
85* The DMA_Handle_t is the primary object used by callers of the API.
86*
87*****************************************************************************/
88
89#define DMA_INVALID_HANDLE ((DMA_Handle_t) -1)
90
91typedef int DMA_Handle_t;
92
93/****************************************************************************
94*
95* The DMA_DescriptorRing_t contains a ring of descriptors which is used
96* to point to regions of memory.
97*
98*****************************************************************************/
99
100typedef struct {
101 void *virtAddr; /* Virtual Address of the descriptor ring */
102 dma_addr_t physAddr; /* Physical address of the descriptor ring */
103 int descriptorsAllocated; /* Number of descriptors allocated in the descriptor ring */
104 size_t bytesAllocated; /* Number of bytes allocated in the descriptor ring */
105
106} DMA_DescriptorRing_t;
107
108/****************************************************************************
109*
110* The DMA_DeviceAttribute_t contains information which describes a
111* particular DMA device (or peripheral).
112*
113* It is anticipated that the arrary of DMA_DeviceAttribute_t's will be
114* statically initialized.
115*
116*****************************************************************************/
117
118/* The device handler is called whenever a DMA operation completes. The reaon */
119/* for it to be called will be a bitmask with one or more of the following bits */
120/* set. */
121
122#define DMA_HANDLER_REASON_BLOCK_COMPLETE dmacHw_INTERRUPT_STATUS_BLOCK
123#define DMA_HANDLER_REASON_TRANSFER_COMPLETE dmacHw_INTERRUPT_STATUS_TRANS
124#define DMA_HANDLER_REASON_ERROR dmacHw_INTERRUPT_STATUS_ERROR
125
126typedef void (*DMA_DeviceHandler_t) (DMA_Device_t dev, int reason,
127 void *userData);
128
129#define DMA_DEVICE_FLAG_ON_DMA0 0x00000001
130#define DMA_DEVICE_FLAG_ON_DMA1 0x00000002
131#define DMA_DEVICE_FLAG_PORT_PER_DMAC 0x00000004 /* If set, it means that the port used on DMAC0 is different from the port used on DMAC1 */
132#define DMA_DEVICE_FLAG_ALLOC_DMA1_FIRST 0x00000008 /* If set, allocate from DMA1 before allocating from DMA0 */
133#define DMA_DEVICE_FLAG_IS_DEDICATED 0x00000100
134#define DMA_DEVICE_FLAG_NO_ISR 0x00000200
135#define DMA_DEVICE_FLAG_ALLOW_LARGE_FIFO 0x00000400
136#define DMA_DEVICE_FLAG_IN_USE 0x00000800 /* If set, device is in use on a channel */
137
138/* Note: Some DMA devices can be used from multiple DMA Controllers. The bitmask is used to */
139/* determine which DMA controllers a given device can be used from, and the interface */
140/* array determeines the actual interface number to use for a given controller. */
141
142typedef struct {
143 uint32_t flags; /* Bitmask of DMA_DEVICE_FLAG_xxx constants */
144 uint8_t dedicatedController; /* Controller number to use if DMA_DEVICE_FLAG_IS_DEDICATED is set. */
145 uint8_t dedicatedChannel; /* Channel number to use if DMA_DEVICE_FLAG_IS_DEDICATED is set. */
146 const char *name; /* Will show up in the /proc entry */
147
148 uint32_t dmacPort[DMA_NUM_CONTROLLERS]; /* Specifies the port number when DMA_DEVICE_FLAG_PORT_PER_DMAC flag is set */
149
150 dmacHw_CONFIG_t config; /* Configuration to use when DMA'ing using this device */
151
152 void *userData; /* Passed to the devHandler */
153 DMA_DeviceHandler_t devHandler; /* Called when DMA operations finish. */
154
155 timer_tick_count_t transferStartTime; /* Time the current transfer was started */
156
157 /* The following statistical information will be collected and presented in a proc entry. */
158 /* Note: With a contiuous bandwidth of 1 Gb/sec, it would take 584 years to overflow */
159 /* a 64 bit counter. */
160
161 uint64_t numTransfers; /* Number of DMA transfers performed */
162 uint64_t transferTicks; /* Total time spent doing DMA transfers (measured in timer_tick_count_t's) */
163 uint64_t transferBytes; /* Total bytes transferred */
164 uint32_t timesBlocked; /* Number of times a channel was unavailable */
165 uint32_t numBytes; /* Last transfer size */
166
167 /* It's not possible to free memory which is allocated for the descriptors from within */
168 /* the ISR. So make the presumption that a given device will tend to use the */
169 /* same sized buffers over and over again, and we keep them around. */
170
171 DMA_DescriptorRing_t ring; /* Ring of descriptors allocated for this device */
172
173 /* We stash away some of the information from the previous transfer. If back-to-back */
174 /* transfers are performed from the same buffer, then we don't have to keep re-initializing */
175 /* the descriptor buffers. */
176
177 uint32_t prevNumBytes;
178 dma_addr_t prevSrcData;
179 dma_addr_t prevDstData;
180
181} DMA_DeviceAttribute_t;
182
183/****************************************************************************
184*
185* DMA_Channel_t, DMA_Controller_t, and DMA_State_t are really internal
186* data structures and don't belong in this header file, but are included
187* merely for discussion.
188*
189* By the time this is implemented, these structures will be moved out into
190* the appropriate C source file instead.
191*
192*****************************************************************************/
193
194/****************************************************************************
195*
196* The DMA_Channel_t contains state information about each DMA channel. Some
197* of the channels are dedicated. Non-dedicated channels are shared
198* amongst the other devices.
199*
200*****************************************************************************/
201
202#define DMA_CHANNEL_FLAG_IN_USE 0x00000001
203#define DMA_CHANNEL_FLAG_IS_DEDICATED 0x00000002
204#define DMA_CHANNEL_FLAG_NO_ISR 0x00000004
205#define DMA_CHANNEL_FLAG_LARGE_FIFO 0x00000008
206
207typedef struct {
208 uint32_t flags; /* bitmask of DMA_CHANNEL_FLAG_xxx constants */
209 DMA_Device_t devType; /* Device this channel is currently reserved for */
210 DMA_Device_t lastDevType; /* Device type that used this previously */
211 char name[20]; /* Name passed onto request_irq */
212
213#if (DMA_DEBUG_TRACK_RESERVATION)
214 const char *fileName; /* Place where channel reservation took place */
215 int lineNum; /* Place where channel reservation took place */
216#endif
217 dmacHw_HANDLE_t dmacHwHandle; /* low level channel handle. */
218
219} DMA_Channel_t;
220
221/****************************************************************************
222*
223* The DMA_Controller_t contains state information about each DMA controller.
224*
225* The freeChannelQ is stored in the controller data structure rather than
226* the channel data structure since several of the devices are accessible
227* from multiple controllers, and there is no way to know which controller
228* will become available first.
229*
230*****************************************************************************/
231
232typedef struct {
233 DMA_Channel_t channel[DMA_NUM_CHANNELS];
234
235} DMA_Controller_t;
236
237/****************************************************************************
238*
239* The DMA_Global_t contains all of the global state information used by
240* the DMA code.
241*
242* Callers which need to allocate a shared channel will be queued up
243* on the freeChannelQ until a channel becomes available.
244*
245*****************************************************************************/
246
247typedef struct {
248 struct semaphore lock; /* acquired when manipulating table entries */
249 wait_queue_head_t freeChannelQ;
250
251 DMA_Controller_t controller[DMA_NUM_CONTROLLERS];
252
253} DMA_Global_t;
254
255/* ---- Variable Externs ------------------------------------------------- */
256
257extern DMA_DeviceAttribute_t DMA_gDeviceAttribute[DMA_NUM_DEVICE_ENTRIES];
258
259/* ---- Function Prototypes ---------------------------------------------- */
260
261#if defined(__KERNEL__)
262
263/****************************************************************************/
264/**
265* Initializes the DMA module.
266*
267* @return
268* 0 - Success
269* < 0 - Error
270*/
271/****************************************************************************/
272
273int dma_init(void);
274
275#if (DMA_DEBUG_TRACK_RESERVATION)
276DMA_Handle_t dma_request_channel_dbg(DMA_Device_t dev, const char *fileName,
277 int lineNum);
278#define dma_request_channel(dev) dma_request_channel_dbg(dev, __FILE__, __LINE__)
279#else
280
281/****************************************************************************/
282/**
283* Reserves a channel for use with @a dev. If the device is setup to use
284* a shared channel, then this function will block until a free channel
285* becomes available.
286*
287* @return
288* >= 0 - A valid DMA Handle.
289* -EBUSY - Device is currently being used.
290* -ENODEV - Device handed in is invalid.
291*/
292/****************************************************************************/
293
294DMA_Handle_t dma_request_channel(DMA_Device_t dev /* Device to use with the allocated channel. */
295 );
296#endif
297
298/****************************************************************************/
299/**
300* Frees a previously allocated DMA Handle.
301*
302* @return
303* 0 - DMA Handle was released successfully.
304* -EINVAL - Invalid DMA handle
305*/
306/****************************************************************************/
307
308int dma_free_channel(DMA_Handle_t channel /* DMA handle. */
309 );
310
311/****************************************************************************/
312/**
313* Determines if a given device has been configured as using a shared
314* channel.
315*
316* @return boolean
317* 0 Device uses a dedicated channel
318* non-zero Device uses a shared channel
319*/
320/****************************************************************************/
321
322int dma_device_is_channel_shared(DMA_Device_t dev /* Device to check. */
323 );
324
325/****************************************************************************/
326/**
327* Allocates memory to hold a descriptor ring. The descriptor ring then
328* needs to be populated by making one or more calls to
329* dna_add_descriptors.
330*
331* The returned descriptor ring will be automatically initialized.
332*
333* @return
334* 0 Descriptor ring was allocated successfully
335* -ENOMEM Unable to allocate memory for the desired number of descriptors.
336*/
337/****************************************************************************/
338
339int dma_alloc_descriptor_ring(DMA_DescriptorRing_t *ring, /* Descriptor ring to populate */
340 int numDescriptors /* Number of descriptors that need to be allocated. */
341 );
342
343/****************************************************************************/
344/**
345* Releases the memory which was previously allocated for a descriptor ring.
346*/
347/****************************************************************************/
348
349void dma_free_descriptor_ring(DMA_DescriptorRing_t *ring /* Descriptor to release */
350 );
351
352/****************************************************************************/
353/**
354* Initializes a descriptor ring, so that descriptors can be added to it.
355* Once a descriptor ring has been allocated, it may be reinitialized for
356* use with additional/different regions of memory.
357*
358* Note that if 7 descriptors are allocated, it's perfectly acceptable to
359* initialize the ring with a smaller number of descriptors. The amount
360* of memory allocated for the descriptor ring will not be reduced, and
361* the descriptor ring may be reinitialized later
362*
363* @return
364* 0 Descriptor ring was initialized successfully
365* -ENOMEM The descriptor which was passed in has insufficient space
366* to hold the desired number of descriptors.
367*/
368/****************************************************************************/
369
370int dma_init_descriptor_ring(DMA_DescriptorRing_t *ring, /* Descriptor ring to initialize */
371 int numDescriptors /* Number of descriptors to initialize. */
372 );
373
374/****************************************************************************/
375/**
376* Determines the number of descriptors which would be required for a
377* transfer of the indicated memory region.
378*
379* This function also needs to know which DMA device this transfer will
380* be destined for, so that the appropriate DMA configuration can be retrieved.
381* DMA parameters such as transfer width, and whether this is a memory-to-memory
382* or memory-to-peripheral, etc can all affect the actual number of descriptors
383* required.
384*
385* @return
386* > 0 Returns the number of descriptors required for the indicated transfer
387* -EINVAL Invalid device type for this kind of transfer
388* (i.e. the device is _MEM_TO_DEV and not _DEV_TO_MEM)
389* -ENOMEM Memory exhausted
390*/
391/****************************************************************************/
392
393int dma_calculate_descriptor_count(DMA_Device_t device, /* DMA Device that this will be associated with */
394 dma_addr_t srcData, /* Place to get data to write to device */
395 dma_addr_t dstData, /* Pointer to device data address */
396 size_t numBytes /* Number of bytes to transfer to the device */
397 );
398
399/****************************************************************************/
400/**
401* Adds a region of memory to the descriptor ring. Note that it may take
402* multiple descriptors for each region of memory. It is the callers
403* responsibility to allocate a sufficiently large descriptor ring.
404*
405* @return
406* 0 Descriptors were added successfully
407* -EINVAL Invalid device type for this kind of transfer
408* (i.e. the device is _MEM_TO_DEV and not _DEV_TO_MEM)
409* -ENOMEM Memory exhausted
410*/
411/****************************************************************************/
412
413int dma_add_descriptors(DMA_DescriptorRing_t *ring, /* Descriptor ring to add descriptors to */
414 DMA_Device_t device, /* DMA Device that descriptors are for */
415 dma_addr_t srcData, /* Place to get data (memory or device) */
416 dma_addr_t dstData, /* Place to put data (memory or device) */
417 size_t numBytes /* Number of bytes to transfer to the device */
418 );
419
420/****************************************************************************/
421/**
422* Sets the descriptor ring associated with a device.
423*
424* Once set, the descriptor ring will be associated with the device, even
425* across channel request/free calls. Passing in a NULL descriptor ring
426* will release any descriptor ring currently associated with the device.
427*
428* Note: If you call dma_transfer, or one of the other dma_alloc_ functions
429* the descriptor ring may be released and reallocated.
430*
431* Note: This function will release the descriptor memory for any current
432* descriptor ring associated with this device.
433*/
434/****************************************************************************/
435
436int dma_set_device_descriptor_ring(DMA_Device_t device, /* Device to update the descriptor ring for. */
437 DMA_DescriptorRing_t *ring /* Descriptor ring to add descriptors to */
438 );
439
440/****************************************************************************/
441/**
442* Retrieves the descriptor ring associated with a device.
443*/
444/****************************************************************************/
445
446int dma_get_device_descriptor_ring(DMA_Device_t device, /* Device to retrieve the descriptor ring for. */
447 DMA_DescriptorRing_t *ring /* Place to store retrieved ring */
448 );
449
450/****************************************************************************/
451/**
452* Allocates buffers for the descriptors. This is normally done automatically
453* but needs to be done explicitly when initiating a dma from interrupt
454* context.
455*
456* @return
457* 0 Descriptors were allocated successfully
458* -EINVAL Invalid device type for this kind of transfer
459* (i.e. the device is _MEM_TO_DEV and not _DEV_TO_MEM)
460* -ENOMEM Memory exhausted
461*/
462/****************************************************************************/
463
464int dma_alloc_descriptors(DMA_Handle_t handle, /* DMA Handle */
465 dmacHw_TRANSFER_TYPE_e transferType, /* Type of transfer being performed */
466 dma_addr_t srcData, /* Place to get data to write to device */
467 dma_addr_t dstData, /* Pointer to device data address */
468 size_t numBytes /* Number of bytes to transfer to the device */
469 );
470
471/****************************************************************************/
472/**
473* Allocates and sets up descriptors for a double buffered circular buffer.
474*
475* This is primarily intended to be used for things like the ingress samples
476* from a microphone.
477*
478* @return
479* > 0 Number of descriptors actually allocated.
480* -EINVAL Invalid device type for this kind of transfer
481* (i.e. the device is _MEM_TO_DEV and not _DEV_TO_MEM)
482* -ENOMEM Memory exhausted
483*/
484/****************************************************************************/
485
486int dma_alloc_double_dst_descriptors(DMA_Handle_t handle, /* DMA Handle */
487 dma_addr_t srcData, /* Physical address of source data */
488 dma_addr_t dstData1, /* Physical address of first destination buffer */
489 dma_addr_t dstData2, /* Physical address of second destination buffer */
490 size_t numBytes /* Number of bytes in each destination buffer */
491 );
492
493/****************************************************************************/
494/**
495* Initiates a transfer when the descriptors have already been setup.
496*
497* This is a special case, and normally, the dma_transfer_xxx functions should
498* be used.
499*
500* @return
501* 0 Transfer was started successfully
502* -ENODEV Invalid handle
503*/
504/****************************************************************************/
505
506int dma_start_transfer(DMA_Handle_t handle);
507
508/****************************************************************************/
509/**
510* Stops a previously started DMA transfer.
511*
512* @return
513* 0 Transfer was stopped successfully
514* -ENODEV Invalid handle
515*/
516/****************************************************************************/
517
518int dma_stop_transfer(DMA_Handle_t handle);
519
520/****************************************************************************/
521/**
522* Waits for a DMA to complete by polling. This function is only intended
523* to be used for testing. Interrupts should be used for most DMA operations.
524*/
525/****************************************************************************/
526
527int dma_wait_transfer_done(DMA_Handle_t handle);
528
529/****************************************************************************/
530/**
531* Initiates a DMA transfer
532*
533* @return
534* 0 Transfer was started successfully
535* -EINVAL Invalid device type for this kind of transfer
536* (i.e. the device is _MEM_TO_DEV and not _DEV_TO_MEM)
537*/
538/****************************************************************************/
539
540int dma_transfer(DMA_Handle_t handle, /* DMA Handle */
541 dmacHw_TRANSFER_TYPE_e transferType, /* Type of transfer being performed */
542 dma_addr_t srcData, /* Place to get data to write to device */
543 dma_addr_t dstData, /* Pointer to device data address */
544 size_t numBytes /* Number of bytes to transfer to the device */
545 );
546
547/****************************************************************************/
548/**
549* Initiates a transfer from memory to a device.
550*
551* @return
552* 0 Transfer was started successfully
553* -EINVAL Invalid device type for this kind of transfer
554* (i.e. the device is _DEV_TO_MEM and not _MEM_TO_DEV)
555*/
556/****************************************************************************/
557
558static inline int dma_transfer_to_device(DMA_Handle_t handle, /* DMA Handle */
559 dma_addr_t srcData, /* Place to get data to write to device (physical address) */
560 dma_addr_t dstData, /* Pointer to device data address (physical address) */
561 size_t numBytes /* Number of bytes to transfer to the device */
562 ) {
563 return dma_transfer(handle,
564 dmacHw_TRANSFER_TYPE_MEM_TO_PERIPHERAL,
565 srcData, dstData, numBytes);
566}
567
568/****************************************************************************/
569/**
570* Initiates a transfer from a device to memory.
571*
572* @return
573* 0 Transfer was started successfully
574* -EINVAL Invalid device type for this kind of transfer
575* (i.e. the device is _MEM_TO_DEV and not _DEV_TO_MEM)
576*/
577/****************************************************************************/
578
579static inline int dma_transfer_from_device(DMA_Handle_t handle, /* DMA Handle */
580 dma_addr_t srcData, /* Pointer to the device data address (physical address) */
581 dma_addr_t dstData, /* Place to store data retrieved from the device (physical address) */
582 size_t numBytes /* Number of bytes to retrieve from the device */
583 ) {
584 return dma_transfer(handle,
585 dmacHw_TRANSFER_TYPE_PERIPHERAL_TO_MEM,
586 srcData, dstData, numBytes);
587}
588
589/****************************************************************************/
590/**
591* Initiates a memory to memory transfer.
592*
593* @return
594* 0 Transfer was started successfully
595* -EINVAL Invalid device type for this kind of transfer
596* (i.e. the device wasn't DMA_DEVICE_MEM_TO_MEM)
597*/
598/****************************************************************************/
599
600static inline int dma_transfer_mem_to_mem(DMA_Handle_t handle, /* DMA Handle */
601 dma_addr_t srcData, /* Place to transfer data from (physical address) */
602 dma_addr_t dstData, /* Place to transfer data to (physical address) */
603 size_t numBytes /* Number of bytes to transfer */
604 ) {
605 return dma_transfer(handle,
606 dmacHw_TRANSFER_TYPE_MEM_TO_MEM,
607 srcData, dstData, numBytes);
608}
609
610/****************************************************************************/
611/**
612* Set the callback function which will be called when a transfer completes.
613* If a NULL callback function is set, then no callback will occur.
614*
615* @note @a devHandler will be called from IRQ context.
616*
617* @return
618* 0 - Success
619* -ENODEV - Device handed in is invalid.
620*/
621/****************************************************************************/
622
623int dma_set_device_handler(DMA_Device_t dev, /* Device to set the callback for. */
624 DMA_DeviceHandler_t devHandler, /* Function to call when the DMA completes */
625 void *userData /* Pointer which will be passed to devHandler. */
626 );
627
628#endif
629
630#endif /* ASM_ARM_ARCH_BCMRING_DMA_H */
diff --git a/arch/arm/mach-bcmring/include/mach/entry-macro.S b/arch/arm/mach-bcmring/include/mach/entry-macro.S
deleted file mode 100644
index 2f316f0e6e6..00000000000
--- a/arch/arm/mach-bcmring/include/mach/entry-macro.S
+++ /dev/null
@@ -1,76 +0,0 @@
1/*****************************************************************************
2* Copyright 2006 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/*
16 *
17 * Low-level IRQ helper macros for BCMRing-based platforms
18 *
19 */
20#include <mach/irqs.h>
21#include <mach/hardware.h>
22#include <mach/csp/mm_io.h>
23
24 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
25 ldr \base, =(MM_IO_BASE_INTC0)
26 ldr \irqstat, [\base, #0] @ get status
27 ldr \irqnr, [\base, #0x10] @ mask with enable register
28 ands \irqstat, \irqstat, \irqnr
29 mov \irqnr, #IRQ_INTC0_START
30 cmp \irqstat, #0
31 bne 1001f
32
33 ldr \base, =(MM_IO_BASE_INTC1)
34 ldr \irqstat, [\base, #0] @ get status
35 ldr \irqnr, [\base, #0x10] @ mask with enable register
36 ands \irqstat, \irqstat, \irqnr
37 mov \irqnr, #IRQ_INTC1_START
38 cmp \irqstat, #0
39 bne 1001f
40
41 ldr \base, =(MM_IO_BASE_SINTC)
42 ldr \irqstat, [\base, #0] @ get status
43 ldr \irqnr, [\base, #0x10] @ mask with enable register
44 ands \irqstat, \irqstat, \irqnr
45 mov \irqnr, #0xffffffff @ code meaning no interrupt bits set
46 cmp \irqstat, #0
47 beq 1002f
48
49 mov \irqnr, #IRQ_SINTC_START @ something is set, so fixup return value
50
511001:
52 movs \tmp, \irqstat, lsl #16
53 movne \irqstat, \tmp
54 addeq \irqnr, \irqnr, #16
55
56 movs \tmp, \irqstat, lsl #8
57 movne \irqstat, \tmp
58 addeq \irqnr, \irqnr, #8
59
60 movs \tmp, \irqstat, lsl #4
61 movne \irqstat, \tmp
62 addeq \irqnr, \irqnr, #4
63
64 movs \tmp, \irqstat, lsl #2
65 movne \irqstat, \tmp
66 addeq \irqnr, \irqnr, #2
67
68 movs \tmp, \irqstat, lsl #1
69 addeq \irqnr, \irqnr, #1
70 orrs \base, \base, #1
71
721002: @ irqnr will be set to 0xffffffff if no irq bits are set
73 .endm
74
75 .macro get_irqnr_preamble, base, tmp
76 .endm
diff --git a/arch/arm/mach-bcmring/include/mach/hardware.h b/arch/arm/mach-bcmring/include/mach/hardware.h
deleted file mode 100644
index 6ae20a649a9..00000000000
--- a/arch/arm/mach-bcmring/include/mach/hardware.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 *
3 * This file contains the hardware definitions of the BCMRing.
4 *
5 * Copyright (C) 1999 ARM Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef __ASM_ARCH_HARDWARE_H
22#define __ASM_ARCH_HARDWARE_H
23
24#include <asm/sizes.h>
25#include <cfg_global.h>
26#include <mach/csp/mm_io.h>
27
28/* Hardware addresses of major areas.
29 * *_START is the physical address
30 * *_SIZE is the size of the region
31 * *_BASE is the virtual address
32 */
33#define RAM_START PHYS_OFFSET
34
35#define RAM_SIZE (CFG_GLOBAL_RAM_SIZE-CFG_GLOBAL_RAM_SIZE_RESERVED)
36#define RAM_BASE PAGE_OFFSET
37
38/* Macros to make managing spinlocks a bit more controlled in terms of naming. */
39/* See reg_gpio.h, reg_irq.h, arch.c, gpio.c for example usage. */
40#if defined(__KERNEL__)
41#define HW_DECLARE_SPINLOCK(name) DEFINE_SPINLOCK(bcmring_##name##_reg_lock);
42#define HW_EXTERN_SPINLOCK(name) extern spinlock_t bcmring_##name##_reg_lock;
43#define HW_IRQ_SAVE(name, val) spin_lock_irqsave(&bcmring_##name##_reg_lock, (val))
44#define HW_IRQ_RESTORE(name, val) spin_unlock_irqrestore(&bcmring_##name##_reg_lock, (val))
45#else
46#define HW_DECLARE_SPINLOCK(name)
47#define HW_EXTERN_SPINLOCK(name)
48#define HW_IRQ_SAVE(name, val) {(void)(name); (void)(val); }
49#define HW_IRQ_RESTORE(name, val) {(void)(name); (void)(val); }
50#endif
51
52#ifndef HW_IO_PHYS_TO_VIRT
53#define HW_IO_PHYS_TO_VIRT MM_IO_PHYS_TO_VIRT
54#endif
55#define HW_IO_VIRT_TO_PHYS MM_IO_VIRT_TO_PHYS
56
57#endif
diff --git a/arch/arm/mach-bcmring/include/mach/irqs.h b/arch/arm/mach-bcmring/include/mach/irqs.h
deleted file mode 100644
index b279b825d4a..00000000000
--- a/arch/arm/mach-bcmring/include/mach/irqs.h
+++ /dev/null
@@ -1,132 +0,0 @@
1/*
2 * Copyright (C) 2007 Broadcom
3 * Copyright (C) 1999 ARM Limited
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#if !defined(ARCH_BCMRING_IRQS_H)
21#define ARCH_BCMRING_IRQS_H
22
23/* INTC0 - interrupt controller 0 */
24#define IRQ_INTC0_START 0
25#define IRQ_DMA0C0 0 /* DMA0 channel 0 interrupt */
26#define IRQ_DMA0C1 1 /* DMA0 channel 1 interrupt */
27#define IRQ_DMA0C2 2 /* DMA0 channel 2 interrupt */
28#define IRQ_DMA0C3 3 /* DMA0 channel 3 interrupt */
29#define IRQ_DMA0C4 4 /* DMA0 channel 4 interrupt */
30#define IRQ_DMA0C5 5 /* DMA0 channel 5 interrupt */
31#define IRQ_DMA0C6 6 /* DMA0 channel 6 interrupt */
32#define IRQ_DMA0C7 7 /* DMA0 channel 7 interrupt */
33#define IRQ_DMA1C0 8 /* DMA1 channel 0 interrupt */
34#define IRQ_DMA1C1 9 /* DMA1 channel 1 interrupt */
35#define IRQ_DMA1C2 10 /* DMA1 channel 2 interrupt */
36#define IRQ_DMA1C3 11 /* DMA1 channel 3 interrupt */
37#define IRQ_DMA1C4 12 /* DMA1 channel 4 interrupt */
38#define IRQ_DMA1C5 13 /* DMA1 channel 5 interrupt */
39#define IRQ_DMA1C6 14 /* DMA1 channel 6 interrupt */
40#define IRQ_DMA1C7 15 /* DMA1 channel 7 interrupt */
41#define IRQ_VPM 16 /* Voice process module interrupt */
42#define IRQ_USBHD2 17 /* USB host2/device2 interrupt */
43#define IRQ_USBH1 18 /* USB1 host interrupt */
44#define IRQ_USBD 19 /* USB device interrupt */
45#define IRQ_SDIOH0 20 /* SDIO0 host interrupt */
46#define IRQ_SDIOH1 21 /* SDIO1 host interrupt */
47#define IRQ_TIMER0 22 /* Timer0 interrupt */
48#define IRQ_TIMER1 23 /* Timer1 interrupt */
49#define IRQ_TIMER2 24 /* Timer2 interrupt */
50#define IRQ_TIMER3 25 /* Timer3 interrupt */
51#define IRQ_SPIH 26 /* SPI host interrupt */
52#define IRQ_ESW 27 /* Ethernet switch interrupt */
53#define IRQ_APM 28 /* Audio process module interrupt */
54#define IRQ_GE 29 /* Graphic engine interrupt */
55#define IRQ_CLCD 30 /* LCD Controller interrupt */
56#define IRQ_PIF 31 /* Peripheral interface interrupt */
57#define IRQ_INTC0_END 31
58
59/* INTC1 - interrupt controller 1 */
60#define IRQ_INTC1_START 32
61#define IRQ_GPIO0 32 /* 0 GPIO bit 31//0 combined interrupt */
62#define IRQ_GPIO1 33 /* 1 GPIO bit 64//32 combined interrupt */
63#define IRQ_I2S0 34 /* 2 I2S0 interrupt */
64#define IRQ_I2S1 35 /* 3 I2S1 interrupt */
65#define IRQ_I2CH 36 /* 4 I2C host interrupt */
66#define IRQ_I2CS 37 /* 5 I2C slave interrupt */
67#define IRQ_SPIS 38 /* 6 SPI slave interrupt */
68#define IRQ_GPHY 39 /* 7 Gigabit Phy interrupt */
69#define IRQ_FLASHC 40 /* 8 Flash controller interrupt */
70#define IRQ_COMMTX 41 /* 9 ARM DDC transmit interrupt */
71#define IRQ_COMMRX 42 /* 10 ARM DDC receive interrupt */
72#define IRQ_PMUIRQ 43 /* 11 ARM performance monitor interrupt */
73#define IRQ_UARTB 44 /* 12 UARTB */
74#define IRQ_WATCHDOG 45 /* 13 Watchdog timer interrupt */
75#define IRQ_UARTA 46 /* 14 UARTA */
76#define IRQ_TSC 47 /* 15 Touch screen controller interrupt */
77#define IRQ_KEYC 48 /* 16 Key pad controller interrupt */
78#define IRQ_DMPU 49 /* 17 DDR2 memory partition interrupt */
79#define IRQ_VMPU 50 /* 18 VRAM memory partition interrupt */
80#define IRQ_FMPU 51 /* 19 Flash memory parition unit interrupt */
81#define IRQ_RNG 52 /* 20 Random number generator interrupt */
82#define IRQ_RTC0 53 /* 21 Real time clock periodic interrupt */
83#define IRQ_RTC1 54 /* 22 Real time clock one-shot interrupt */
84#define IRQ_SPUM 55 /* 23 Secure process module interrupt */
85#define IRQ_VDEC 56 /* 24 Hantro video decoder interrupt */
86#define IRQ_RTC2 57 /* 25 Real time clock tamper interrupt */
87#define IRQ_DDRP 58 /* 26 DDR Panic interrupt */
88#define IRQ_INTC1_END 58
89
90/* SINTC secure int controller */
91#define IRQ_SINTC_START 59
92#define IRQ_SEC_WATCHDOG 59 /* 0 Watchdog timer interrupt */
93#define IRQ_SEC_UARTA 60 /* 1 UARTA interrupt */
94#define IRQ_SEC_TSC 61 /* 2 Touch screen controller interrupt */
95#define IRQ_SEC_KEYC 62 /* 3 Key pad controller interrupt */
96#define IRQ_SEC_DMPU 63 /* 4 DDR2 memory partition interrupt */
97#define IRQ_SEC_VMPU 64 /* 5 VRAM memory partition interrupt */
98#define IRQ_SEC_FMPU 65 /* 6 Flash memory parition unit interrupt */
99#define IRQ_SEC_RNG 66 /* 7 Random number generator interrupt */
100#define IRQ_SEC_RTC0 67 /* 8 Real time clock periodic interrupt */
101#define IRQ_SEC_RTC1 68 /* 9 Real time clock one-shot interrupt */
102#define IRQ_SEC_SPUM 69 /* 10 Secure process module interrupt */
103#define IRQ_SEC_TIMER0 70 /* 11 Secure timer0 interrupt */
104#define IRQ_SEC_TIMER1 71 /* 12 Secure timer1 interrupt */
105#define IRQ_SEC_TIMER2 72 /* 13 Secure timer2 interrupt */
106#define IRQ_SEC_TIMER3 73 /* 14 Secure timer3 interrupt */
107#define IRQ_SEC_RTC2 74 /* 15 Real time clock tamper interrupt */
108
109#define IRQ_SINTC_END 74
110
111/* Note: there are 3 INTC registers of 32 bits each. So internal IRQs could go from 0-95 */
112/* Since IRQs are typically viewed in decimal, we start the gpio based IRQs off at 100 */
113/* to make the mapping easy for humans to decipher. */
114
115#define IRQ_GPIO_0 100
116
117#define NUM_INTERNAL_IRQS (IRQ_SINTC_END+1)
118
119/* I couldn't get the gpioHw_reg.h file to be included cleanly, so I hardcoded it */
120/* define NUM_GPIO_IRQS GPIOHW_TOTAL_NUM_PINS */
121#define NUM_GPIO_IRQS 62
122
123#define NR_IRQS (IRQ_GPIO_0 + NUM_GPIO_IRQS)
124
125#define IRQ_UNKNOWN -1
126
127/* Tune these bits to preclude noisy or unsupported interrupt sources as required. */
128#define IRQ_INTC0_VALID_MASK 0xffffffff
129#define IRQ_INTC1_VALID_MASK 0x07ffffff
130#define IRQ_SINTC_VALID_MASK 0x0000ffff
131
132#endif /* ARCH_BCMRING_IRQS_H */
diff --git a/arch/arm/mach-bcmring/include/mach/memory_settings.h b/arch/arm/mach-bcmring/include/mach/memory_settings.h
deleted file mode 100644
index ce5cd16f2ac..00000000000
--- a/arch/arm/mach-bcmring/include/mach/memory_settings.h
+++ /dev/null
@@ -1,67 +0,0 @@
1/*****************************************************************************
2* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#ifndef MEMORY_SETTINGS_H
16#define MEMORY_SETTINGS_H
17
18/* ---- Include Files ---------------------------------------- */
19/* ---- Constants and Types ---------------------------------- */
20
21/* Memory devices */
22/* NAND Flash timing for 166 MHz setting */
23#define HW_CFG_NAND_tBTA (5 << 16) /* Bus turnaround cycle (n) 0-7 (30 ns) */
24#define HW_CFG_NAND_tWP (4 << 11) /* Write pulse width cycle (n+1) 0-31 (25 ns) */
25#define HW_CFG_NAND_tWR (1 << 9) /* Write recovery cycle (n+1) 0-3 (10 ns) */
26#define HW_CFG_NAND_tAS (0 << 7) /* Write address setup cycle (n+1) 0-3 ( 0 ns) */
27#define HW_CFG_NAND_tOE (3 << 5) /* Output enable delay cycle (n) 0-3 (15 ns) */
28#define HW_CFG_NAND_tRC (7 << 0) /* Read access cycle (n+2) 0-31 (50 ns) */
29
30#define HW_CFG_NAND_TCR (HW_CFG_NAND_tBTA \
31 | HW_CFG_NAND_tWP \
32 | HW_CFG_NAND_tWR \
33 | HW_CFG_NAND_tAS \
34 | HW_CFG_NAND_tOE \
35 | HW_CFG_NAND_tRC)
36
37/* NOR Flash timing for 166 MHz setting */
38#define HW_CFG_NOR_TPRC_TWLC (0 << 19) /* Page read access cycle / Burst write latency (n+2 / n+1) (max 25ns) */
39#define HW_CFG_NOR_TBTA (0 << 16) /* Bus turnaround cycle (n) (DNA) */
40#define HW_CFG_NOR_TWP (6 << 11) /* Write pulse width cycle (n+1) (35ns) */
41#define HW_CFG_NOR_TWR (0 << 9) /* Write recovery cycle (n+1) (0ns) */
42#define HW_CFG_NOR_TAS (0 << 7) /* Write address setup cycle (n+1) (0ns) */
43#define HW_CFG_NOR_TOE (0 << 5) /* Output enable delay cycle (n) (max 25ns) */
44#define HW_CFG_NOR_TRC_TLC (0x10 << 0) /* Read access cycle / Burst read latency (n+2 / n+1) (100ns) */
45
46#define HW_CFG_FLASH0_TCR (HW_CFG_NOR_TPRC_TWLC \
47 | HW_CFG_NOR_TBTA \
48 | HW_CFG_NOR_TWP \
49 | HW_CFG_NOR_TWR \
50 | HW_CFG_NOR_TAS \
51 | HW_CFG_NOR_TOE \
52 | HW_CFG_NOR_TRC_TLC)
53
54#define HW_CFG_FLASH1_TCR HW_CFG_FLASH0_TCR
55#define HW_CFG_FLASH2_TCR HW_CFG_FLASH0_TCR
56
57/* SDRAM Settings */
58/* #define HW_CFG_SDRAM_CAS_LATENCY 5 Default 5, Values [3..6] */
59/* #define HW_CFG_SDRAM_CHIP_SELECT_CNT 1 Default 1, Vaules [1..2] */
60/* #define HW_CFG_SDRAM_SPEED_GRADE 667 Default 667, Values [400,533,667,800] */
61/* #define HW_CFG_SDRAM_WIDTH_BITS 16 Default 16, Vaules [8,16] */
62#define HW_CFG_SDRAM_SIZE_BYTES 0x10000000 /* Total memory, not per device size */
63
64/* ---- Variable Externs ------------------------------------- */
65/* ---- Function Prototypes ---------------------------------- */
66
67#endif /* MEMORY_SETTINGS_H */
diff --git a/arch/arm/mach-bcmring/include/mach/reg_nand.h b/arch/arm/mach-bcmring/include/mach/reg_nand.h
deleted file mode 100644
index 387376ffb56..00000000000
--- a/arch/arm/mach-bcmring/include/mach/reg_nand.h
+++ /dev/null
@@ -1,66 +0,0 @@
1/*****************************************************************************
2* Copyright 2001 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/*
16*
17*****************************************************************************
18*
19* REG_NAND.h
20*
21* PURPOSE:
22*
23* This file contains definitions for the nand registers:
24*
25* NOTES:
26*
27*****************************************************************************/
28
29#if !defined(__ASM_ARCH_REG_NAND_H)
30#define __ASM_ARCH_REG_NAND_H
31
32/* ---- Include Files ---------------------------------------------------- */
33#include <csp/reg.h>
34#include <mach/reg_umi.h>
35
36/* ---- Constants and Types ---------------------------------------------- */
37
38#define HW_NAND_BASE MM_IO_BASE_NAND /* NAND Flash */
39
40/* DMA accesses by the bootstrap need hard nonvirtual addresses */
41#define REG_NAND_CMD __REG16(HW_NAND_BASE + 0)
42#define REG_NAND_ADDR __REG16(HW_NAND_BASE + 4)
43
44#define REG_NAND_PHYS_DATA16 (HW_NAND_BASE + 8)
45#define REG_NAND_PHYS_DATA8 (HW_NAND_BASE + 8)
46#define REG_NAND_DATA16 __REG16(REG_NAND_PHYS_DATA16)
47#define REG_NAND_DATA8 __REG8(REG_NAND_PHYS_DATA8)
48
49/* use appropriate offset to make sure it start at the 1K boundary */
50#define REG_NAND_PHYS_DATA_DMA (HW_NAND_BASE + 0x400)
51#define REG_NAND_DATA_DMA __REG32(REG_NAND_PHYS_DATA_DMA)
52
53/* Linux DMA requires physical address of the data register */
54#define REG_NAND_DATA16_PADDR HW_IO_VIRT_TO_PHYS(REG_NAND_PHYS_DATA16)
55#define REG_NAND_DATA8_PADDR HW_IO_VIRT_TO_PHYS(REG_NAND_PHYS_DATA8)
56#define REG_NAND_DATA_PADDR HW_IO_VIRT_TO_PHYS(REG_NAND_PHYS_DATA_DMA)
57
58#define NAND_BUS_16BIT() (0)
59#define NAND_BUS_8BIT() (!NAND_BUS_16BIT())
60
61/* Register offsets */
62#define REG_NAND_CMD_OFFSET (0)
63#define REG_NAND_ADDR_OFFSET (4)
64#define REG_NAND_DATA8_OFFSET (8)
65
66#endif
diff --git a/arch/arm/mach-bcmring/include/mach/reg_umi.h b/arch/arm/mach-bcmring/include/mach/reg_umi.h
deleted file mode 100644
index 0992842caa7..00000000000
--- a/arch/arm/mach-bcmring/include/mach/reg_umi.h
+++ /dev/null
@@ -1,237 +0,0 @@
1/*****************************************************************************
2* Copyright 2005 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/*
16*
17*****************************************************************************
18*
19* REG_UMI.h
20*
21* PURPOSE:
22*
23* This file contains definitions for the nand registers:
24*
25* NOTES:
26*
27*****************************************************************************/
28
29#if !defined(__ASM_ARCH_REG_UMI_H)
30#define __ASM_ARCH_REG_UMI_H
31
32/* ---- Include Files ---------------------------------------------------- */
33#include <csp/reg.h>
34#include <mach/csp/mm_io.h>
35
36/* ---- Constants and Types ---------------------------------------------- */
37
38/* Unified Memory Interface Ctrl Register */
39#define HW_UMI_BASE MM_IO_BASE_UMI
40
41/* Flash bank 0 timing and control register */
42#define REG_UMI_FLASH0_TCR __REG32(HW_UMI_BASE + 0x00)
43/* Flash bank 1 timing and control register */
44#define REG_UMI_FLASH1_TCR __REG32(HW_UMI_BASE + 0x04)
45/* Flash bank 2 timing and control register */
46#define REG_UMI_FLASH2_TCR __REG32(HW_UMI_BASE + 0x08)
47/* MMD interface and control register */
48#define REG_UMI_MMD_ICR __REG32(HW_UMI_BASE + 0x0c)
49/* NAND timing and control register */
50#define REG_UMI_NAND_TCR __REG32(HW_UMI_BASE + 0x18)
51/* NAND ready/chip select register */
52#define REG_UMI_NAND_RCSR __REG32(HW_UMI_BASE + 0x1c)
53/* NAND ECC control & status register */
54#define REG_UMI_NAND_ECC_CSR __REG32(HW_UMI_BASE + 0x20)
55/* NAND ECC data register XXB2B1B0 */
56#define REG_UMI_NAND_ECC_DATA __REG32(HW_UMI_BASE + 0x24)
57/* BCH ECC Parameter N */
58#define REG_UMI_BCH_N __REG32(HW_UMI_BASE + 0x40)
59/* BCH ECC Parameter T */
60#define REG_UMI_BCH_K __REG32(HW_UMI_BASE + 0x44)
61/* BCH ECC Parameter K */
62#define REG_UMI_BCH_T __REG32(HW_UMI_BASE + 0x48)
63/* BCH ECC Contro Status */
64#define REG_UMI_BCH_CTRL_STATUS __REG32(HW_UMI_BASE + 0x4C)
65/* BCH WR ECC 31:0 */
66#define REG_UMI_BCH_WR_ECC_0 __REG32(HW_UMI_BASE + 0x50)
67/* BCH WR ECC 63:32 */
68#define REG_UMI_BCH_WR_ECC_1 __REG32(HW_UMI_BASE + 0x54)
69/* BCH WR ECC 95:64 */
70#define REG_UMI_BCH_WR_ECC_2 __REG32(HW_UMI_BASE + 0x58)
71/* BCH WR ECC 127:96 */
72#define REG_UMI_BCH_WR_ECC_3 __REG32(HW_UMI_BASE + 0x5c)
73/* BCH WR ECC 155:128 */
74#define REG_UMI_BCH_WR_ECC_4 __REG32(HW_UMI_BASE + 0x60)
75/* BCH Read Error Location 1,0 */
76#define REG_UMI_BCH_RD_ERR_LOC_1_0 __REG32(HW_UMI_BASE + 0x64)
77/* BCH Read Error Location 3,2 */
78#define REG_UMI_BCH_RD_ERR_LOC_3_2 __REG32(HW_UMI_BASE + 0x68)
79/* BCH Read Error Location 5,4 */
80#define REG_UMI_BCH_RD_ERR_LOC_5_4 __REG32(HW_UMI_BASE + 0x6c)
81/* BCH Read Error Location 7,6 */
82#define REG_UMI_BCH_RD_ERR_LOC_7_6 __REG32(HW_UMI_BASE + 0x70)
83/* BCH Read Error Location 9,8 */
84#define REG_UMI_BCH_RD_ERR_LOC_9_8 __REG32(HW_UMI_BASE + 0x74)
85/* BCH Read Error Location 11,10 */
86#define REG_UMI_BCH_RD_ERR_LOC_B_A __REG32(HW_UMI_BASE + 0x78)
87
88/* REG_UMI_FLASH0/1/2_TCR, REG_UMI_SRAM0/1_TCR bits */
89/* Enable wait pin during burst write or read */
90#define REG_UMI_TCR_WAITEN 0x80000000
91/* Enable mem ctrlr to work with ext mem of lower freq than AHB clk */
92#define REG_UMI_TCR_LOWFREQ 0x40000000
93/* 1=synch write, 0=async write */
94#define REG_UMI_TCR_MEMTYPE_SYNCWRITE 0x20000000
95/* 1=synch read, 0=async read */
96#define REG_UMI_TCR_MEMTYPE_SYNCREAD 0x10000000
97/* 1=page mode read, 0=normal mode read */
98#define REG_UMI_TCR_MEMTYPE_PAGEREAD 0x08000000
99/* page size/burst size (wrap only) */
100#define REG_UMI_TCR_MEMTYPE_PGSZ_MASK 0x07000000
101/* 4 word */
102#define REG_UMI_TCR_MEMTYPE_PGSZ_4 0x00000000
103/* 8 word */
104#define REG_UMI_TCR_MEMTYPE_PGSZ_8 0x01000000
105/* 16 word */
106#define REG_UMI_TCR_MEMTYPE_PGSZ_16 0x02000000
107/* 32 word */
108#define REG_UMI_TCR_MEMTYPE_PGSZ_32 0x03000000
109/* 64 word */
110#define REG_UMI_TCR_MEMTYPE_PGSZ_64 0x04000000
111/* 128 word */
112#define REG_UMI_TCR_MEMTYPE_PGSZ_128 0x05000000
113/* 256 word */
114#define REG_UMI_TCR_MEMTYPE_PGSZ_256 0x06000000
115/* 512 word */
116#define REG_UMI_TCR_MEMTYPE_PGSZ_512 0x07000000
117/* Page read access cycle / Burst write latency (n+2 / n+1) */
118#define REG_UMI_TCR_TPRC_TWLC_MASK 0x00f80000
119/* Bus turnaround cycle (n) */
120#define REG_UMI_TCR_TBTA_MASK 0x00070000
121/* Write pulse width cycle (n+1) */
122#define REG_UMI_TCR_TWP_MASK 0x0000f800
123/* Write recovery cycle (n+1) */
124#define REG_UMI_TCR_TWR_MASK 0x00000600
125/* Write address setup cycle (n+1) */
126#define REG_UMI_TCR_TAS_MASK 0x00000180
127/* Output enable delay cycle (n) */
128#define REG_UMI_TCR_TOE_MASK 0x00000060
129/* Read access cycle / Burst read latency (n+2 / n+1) */
130#define REG_UMI_TCR_TRC_TLC_MASK 0x0000001f
131
132/* REG_UMI_MMD_ICR bits */
133/* Flash write protection pin control */
134#define REG_UMI_MMD_ICR_FLASH_WP 0x8000
135/* Extend hold time for sram0, sram1 csn (39 MHz operation) */
136#define REG_UMI_MMD_ICR_XHCS 0x4000
137/* Enable SDRAM 2 interface control */
138#define REG_UMI_MMD_ICR_SDRAM2EN 0x2000
139/* Enable merge of flash banks 0/1 to 512 MBit bank */
140#define REG_UMI_MMD_ICR_INST512 0x1000
141/* Enable merge of flash banks 1/2 to 512 MBit bank */
142#define REG_UMI_MMD_ICR_DATA512 0x0800
143/* Enable SDRAM interface control */
144#define REG_UMI_MMD_ICR_SDRAMEN 0x0400
145/* Polarity of busy state of Burst Wait Signal */
146#define REG_UMI_MMD_ICR_WAITPOL 0x0200
147/* Enable burst clock stopped when not accessing external burst flash/sram */
148#define REG_UMI_MMD_ICR_BCLKSTOP 0x0100
149/* Enable the peri1_csn to replace flash1_csn in 512 Mb flash mode */
150#define REG_UMI_MMD_ICR_PERI1EN 0x0080
151/* Enable the peri2_csn to replace sdram_csn */
152#define REG_UMI_MMD_ICR_PERI2EN 0x0040
153/* Enable the peri3_csn to replace sdram2_csn */
154#define REG_UMI_MMD_ICR_PERI3EN 0x0020
155/* Enable sram bank1 for H/W controlled MRS */
156#define REG_UMI_MMD_ICR_MRSB1 0x0010
157/* Enable sram bank0 for H/W controlled MRS */
158#define REG_UMI_MMD_ICR_MRSB0 0x0008
159/* Polarity for assert3ed state of H/W controlled MRS */
160#define REG_UMI_MMD_ICR_MRSPOL 0x0004
161/* 0: S/W controllable ZZ/MRS/CRE/P-Mode pin */
162/* 1: H/W controlled ZZ/MRS/CRE/P-Mode, same timing as CS */
163#define REG_UMI_MMD_ICR_MRSMODE 0x0002
164/* MRS state for S/W controlled mode */
165#define REG_UMI_MMD_ICR_MRSSTATE 0x0001
166
167/* REG_UMI_NAND_TCR bits */
168/* Enable software to control CS */
169#define REG_UMI_NAND_TCR_CS_SWCTRL 0x80000000
170/* 16-bit nand wordsize if set */
171#define REG_UMI_NAND_TCR_WORD16 0x40000000
172/* Bus turnaround cycle (n) */
173#define REG_UMI_NAND_TCR_TBTA_MASK 0x00070000
174/* Write pulse width cycle (n+1) */
175#define REG_UMI_NAND_TCR_TWP_MASK 0x0000f800
176/* Write recovery cycle (n+1) */
177#define REG_UMI_NAND_TCR_TWR_MASK 0x00000600
178/* Write address setup cycle (n+1) */
179#define REG_UMI_NAND_TCR_TAS_MASK 0x00000180
180/* Output enable delay cycle (n) */
181#define REG_UMI_NAND_TCR_TOE_MASK 0x00000060
182/* Read access cycle (n+2) */
183#define REG_UMI_NAND_TCR_TRC_TLC_MASK 0x0000001f
184
185/* REG_UMI_NAND_RCSR bits */
186/* Status: Ready=1, Busy=0 */
187#define REG_UMI_NAND_RCSR_RDY 0x02
188/* Keep CS asserted during operation */
189#define REG_UMI_NAND_RCSR_CS_ASSERTED 0x01
190
191/* REG_UMI_NAND_ECC_CSR bits */
192/* Interrupt status - read-only */
193#define REG_UMI_NAND_ECC_CSR_NANDINT 0x80000000
194/* Read: Status of ECC done, Write: clear ECC interrupt */
195#define REG_UMI_NAND_ECC_CSR_ECCINT_RAW 0x00800000
196/* Read: Status of R/B, Write: clear R/B interrupt */
197#define REG_UMI_NAND_ECC_CSR_RBINT_RAW 0x00400000
198/* 1 = Enable ECC Interrupt */
199#define REG_UMI_NAND_ECC_CSR_ECCINT_ENABLE 0x00008000
200/* 1 = Assert interrupt at rising edge of R/B_ */
201#define REG_UMI_NAND_ECC_CSR_RBINT_ENABLE 0x00004000
202/* Calculate ECC by 0=512 bytes, 1=256 bytes */
203#define REG_UMI_NAND_ECC_CSR_256BYTE 0x00000080
204/* Enable ECC in hardware */
205#define REG_UMI_NAND_ECC_CSR_ECC_ENABLE 0x00000001
206
207/* REG_UMI_BCH_CTRL_STATUS bits */
208/* Shift to Indicate Number of correctable errors detected */
209#define REG_UMI_BCH_CTRL_STATUS_NB_CORR_ERROR_SHIFT 20
210/* Indicate Number of correctable errors detected */
211#define REG_UMI_BCH_CTRL_STATUS_NB_CORR_ERROR 0x00F00000
212/* Indicate Errors detected during read but uncorrectable */
213#define REG_UMI_BCH_CTRL_STATUS_UNCORR_ERR 0x00080000
214/* Indicate Errors detected during read and are correctable */
215#define REG_UMI_BCH_CTRL_STATUS_CORR_ERR 0x00040000
216/* Flag indicates BCH's ECC status of read process are valid */
217#define REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID 0x00020000
218/* Flag indicates BCH's ECC status of write process are valid */
219#define REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID 0x00010000
220/* Pause ECC calculation */
221#define REG_UMI_BCH_CTRL_STATUS_PAUSE_ECC_DEC 0x00000010
222/* Enable Interrupt */
223#define REG_UMI_BCH_CTRL_STATUS_INT_EN 0x00000004
224/* Enable ECC during read */
225#define REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN 0x00000002
226/* Enable ECC during write */
227#define REG_UMI_BCH_CTRL_STATUS_ECC_WR_EN 0x00000001
228/* Mask for location */
229#define REG_UMI_BCH_ERR_LOC_MASK 0x00001FFF
230/* location within a byte */
231#define REG_UMI_BCH_ERR_LOC_BYTE 0x00000007
232/* location within a word */
233#define REG_UMI_BCH_ERR_LOC_WORD 0x00000018
234/* location within a page (512 byte) */
235#define REG_UMI_BCH_ERR_LOC_PAGE 0x00001FE0
236#define REG_UMI_BCH_ERR_LOC_ADDR(index) (__REG32(HW_UMI_BASE + 0x64 + (index / 2)*4) >> ((index % 2) * 16))
237#endif
diff --git a/arch/arm/mach-bcmring/include/mach/timer.h b/arch/arm/mach-bcmring/include/mach/timer.h
deleted file mode 100644
index 5a94bbb032b..00000000000
--- a/arch/arm/mach-bcmring/include/mach/timer.h
+++ /dev/null
@@ -1,77 +0,0 @@
1/*****************************************************************************
2* Copyright 2004 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15/*
16*
17*****************************************************************************
18*
19* timer.h
20*
21* PURPOSE:
22*
23*
24*
25* NOTES:
26*
27*****************************************************************************/
28
29#if !defined(BCM_LINUX_TIMER_H)
30#define BCM_LINUX_TIMER_H
31
32#if defined(__KERNEL__)
33
34/* ---- Include Files ---------------------------------------------------- */
35/* ---- Constants and Types ---------------------------------------------- */
36
37typedef unsigned int timer_tick_count_t;
38typedef unsigned int timer_tick_rate_t;
39typedef unsigned int timer_msec_t;
40
41/* ---- Variable Externs ------------------------------------------------- */
42/* ---- Function Prototypes ---------------------------------------------- */
43
44/****************************************************************************
45*
46* timer_get_tick_count
47*
48*
49***************************************************************************/
50timer_tick_count_t timer_get_tick_count(void);
51
52/****************************************************************************
53*
54* timer_get_tick_rate
55*
56*
57***************************************************************************/
58timer_tick_rate_t timer_get_tick_rate(void);
59
60/****************************************************************************
61*
62* timer_get_msec
63*
64*
65***************************************************************************/
66timer_msec_t timer_get_msec(void);
67
68/****************************************************************************
69*
70* timer_ticks_to_msec
71*
72*
73***************************************************************************/
74timer_msec_t timer_ticks_to_msec(timer_tick_count_t ticks);
75
76#endif /* __KERNEL__ */
77#endif /* BCM_LINUX_TIMER_H */
diff --git a/arch/arm/mach-bcmring/include/mach/timex.h b/arch/arm/mach-bcmring/include/mach/timex.h
deleted file mode 100644
index 40d033ec589..00000000000
--- a/arch/arm/mach-bcmring/include/mach/timex.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 *
3 * Integrator architecture timex specifications
4 *
5 * Copyright (C) 1999 ARM Limited
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 * Specifies the number of ticks per second
24 */
25#define CLOCK_TICK_RATE 100000 /* REG_SMT_TICKS_PER_SEC */
diff --git a/arch/arm/mach-bcmring/include/mach/uncompress.h b/arch/arm/mach-bcmring/include/mach/uncompress.h
deleted file mode 100644
index 9c9821b7797..00000000000
--- a/arch/arm/mach-bcmring/include/mach/uncompress.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*****************************************************************************
2* Copyright 2005 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14#include <mach/csp/mm_addr.h>
15
16#define BCMRING_UART_0_DR (*(volatile unsigned int *)MM_ADDR_IO_UARTA)
17#define BCMRING_UART_0_FR (*(volatile unsigned int *)(MM_ADDR_IO_UARTA + 0x18))
18/*
19 * This does not append a newline
20 */
21static inline void putc(int c)
22{
23 /* Send out UARTA */
24 while (BCMRING_UART_0_FR & (1 << 5))
25 ;
26
27 BCMRING_UART_0_DR = c;
28}
29
30
31static inline void flush(void)
32{
33 /* Wait for the tx fifo to be empty */
34 while ((BCMRING_UART_0_FR & (1 << 7)) == 0)
35 ;
36
37 /* Wait for the final character to be sent on the txd line */
38 while (BCMRING_UART_0_FR & (1 << 3))
39 ;
40}
41
42#define arch_decomp_setup()
43#define arch_decomp_wdog()
diff --git a/arch/arm/mach-bcmring/irq.c b/arch/arm/mach-bcmring/irq.c
deleted file mode 100644
index 437fa683bcb..00000000000
--- a/arch/arm/mach-bcmring/irq.c
+++ /dev/null
@@ -1,126 +0,0 @@
1/*
2 *
3 * Copyright (C) 1999 ARM Limited
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#include <linux/init.h>
20#include <linux/stddef.h>
21#include <linux/list.h>
22#include <linux/timer.h>
23#include <linux/io.h>
24
25#include <mach/hardware.h>
26#include <asm/irq.h>
27
28#include <asm/mach/irq.h>
29#include <mach/csp/intcHw_reg.h>
30#include <mach/csp/mm_io.h>
31
32static void bcmring_mask_irq0(struct irq_data *d)
33{
34 writel(1 << (d->irq - IRQ_INTC0_START),
35 MM_IO_BASE_INTC0 + INTCHW_INTENCLEAR);
36}
37
38static void bcmring_unmask_irq0(struct irq_data *d)
39{
40 writel(1 << (d->irq - IRQ_INTC0_START),
41 MM_IO_BASE_INTC0 + INTCHW_INTENABLE);
42}
43
44static void bcmring_mask_irq1(struct irq_data *d)
45{
46 writel(1 << (d->irq - IRQ_INTC1_START),
47 MM_IO_BASE_INTC1 + INTCHW_INTENCLEAR);
48}
49
50static void bcmring_unmask_irq1(struct irq_data *d)
51{
52 writel(1 << (d->irq - IRQ_INTC1_START),
53 MM_IO_BASE_INTC1 + INTCHW_INTENABLE);
54}
55
56static void bcmring_mask_irq2(struct irq_data *d)
57{
58 writel(1 << (d->irq - IRQ_SINTC_START),
59 MM_IO_BASE_SINTC + INTCHW_INTENCLEAR);
60}
61
62static void bcmring_unmask_irq2(struct irq_data *d)
63{
64 writel(1 << (d->irq - IRQ_SINTC_START),
65 MM_IO_BASE_SINTC + INTCHW_INTENABLE);
66}
67
68static struct irq_chip bcmring_irq0_chip = {
69 .name = "ARM-INTC0",
70 .irq_ack = bcmring_mask_irq0,
71 .irq_mask = bcmring_mask_irq0, /* mask a specific interrupt, blocking its delivery. */
72 .irq_unmask = bcmring_unmask_irq0, /* unmaks an interrupt */
73};
74
75static struct irq_chip bcmring_irq1_chip = {
76 .name = "ARM-INTC1",
77 .irq_ack = bcmring_mask_irq1,
78 .irq_mask = bcmring_mask_irq1,
79 .irq_unmask = bcmring_unmask_irq1,
80};
81
82static struct irq_chip bcmring_irq2_chip = {
83 .name = "ARM-SINTC",
84 .irq_ack = bcmring_mask_irq2,
85 .irq_mask = bcmring_mask_irq2,
86 .irq_unmask = bcmring_unmask_irq2,
87};
88
89static void vic_init(void __iomem *base, struct irq_chip *chip,
90 unsigned int irq_start, unsigned int vic_sources)
91{
92 unsigned int i;
93 for (i = 0; i < 32; i++) {
94 unsigned int irq = irq_start + i;
95 irq_set_chip(irq, chip);
96 irq_set_chip_data(irq, base);
97
98 if (vic_sources & (1 << i)) {
99 irq_set_handler(irq, handle_level_irq);
100 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
101 }
102 }
103 writel(0, base + INTCHW_INTSELECT);
104 writel(0, base + INTCHW_INTENABLE);
105 writel(~0, base + INTCHW_INTENCLEAR);
106 writel(0, base + INTCHW_IRQSTATUS);
107 writel(~0, base + INTCHW_SOFTINTCLEAR);
108}
109
110void __init bcmring_init_irq(void)
111{
112 vic_init((void __iomem *)MM_IO_BASE_INTC0, &bcmring_irq0_chip,
113 IRQ_INTC0_START, IRQ_INTC0_VALID_MASK);
114 vic_init((void __iomem *)MM_IO_BASE_INTC1, &bcmring_irq1_chip,
115 IRQ_INTC1_START, IRQ_INTC1_VALID_MASK);
116 vic_init((void __iomem *)MM_IO_BASE_SINTC, &bcmring_irq2_chip,
117 IRQ_SINTC_START, IRQ_SINTC_VALID_MASK);
118
119 /* special cases */
120 if (INTCHW_INTC1_GPIO0 & IRQ_INTC1_VALID_MASK) {
121 irq_set_handler(IRQ_GPIO0, handle_simple_irq);
122 }
123 if (INTCHW_INTC1_GPIO1 & IRQ_INTC1_VALID_MASK) {
124 irq_set_handler(IRQ_GPIO1, handle_simple_irq);
125 }
126}
diff --git a/arch/arm/mach-bcmring/mm.c b/arch/arm/mach-bcmring/mm.c
deleted file mode 100644
index 1adec78ec94..00000000000
--- a/arch/arm/mach-bcmring/mm.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#include <linux/platform_device.h>
16#include <linux/dma-mapping.h>
17#include <asm/page.h>
18#include <asm/mach/map.h>
19
20#include <mach/hardware.h>
21#include <mach/csp/mm_io.h>
22
23#define IO_DESC(va, sz) { .virtual = va, \
24 .pfn = __phys_to_pfn(HW_IO_VIRT_TO_PHYS(va)), \
25 .length = sz, \
26 .type = MT_DEVICE }
27
28#define MEM_DESC(va, sz) { .virtual = va, \
29 .pfn = __phys_to_pfn(HW_IO_VIRT_TO_PHYS(va)), \
30 .length = sz, \
31 .type = MT_MEMORY }
32
33static struct map_desc bcmring_io_desc[] __initdata = {
34 IO_DESC(MM_IO_BASE_NAND, SZ_64K), /* phys:0x28000000-0x28000FFF virt:0xE8000000-0xE8000FFF size:0x00010000 */
35 IO_DESC(MM_IO_BASE_UMI, SZ_64K), /* phys:0x2C000000-0x2C000FFF virt:0xEC000000-0xEC000FFF size:0x00010000 */
36
37 IO_DESC(MM_IO_BASE_BROM, SZ_64K), /* phys:0x30000000-0x3000FFFF virt:0xF3000000-0xF300FFFF size:0x00010000 */
38 MEM_DESC(MM_IO_BASE_ARAM, SZ_1M), /* phys:0x31000000-0x31FFFFFF virt:0xF3100000-0xF31FFFFF size:0x01000000 */
39 IO_DESC(MM_IO_BASE_DMA0, SZ_1M), /* phys:0x32000000-0x32FFFFFF virt:0xF3200000-0xF32FFFFF size:0x01000000 */
40 IO_DESC(MM_IO_BASE_DMA1, SZ_1M), /* phys:0x33000000-0x33FFFFFF virt:0xF3300000-0xF33FFFFF size:0x01000000 */
41 IO_DESC(MM_IO_BASE_ESW, SZ_1M), /* phys:0x34000000-0x34FFFFFF virt:0xF3400000-0xF34FFFFF size:0x01000000 */
42 IO_DESC(MM_IO_BASE_CLCD, SZ_1M), /* phys:0x35000000-0x35FFFFFF virt:0xF3500000-0xF35FFFFF size:0x01000000 */
43 IO_DESC(MM_IO_BASE_APM, SZ_1M), /* phys:0x36000000-0x36FFFFFF virt:0xF3600000-0xF36FFFFF size:0x01000000 */
44 IO_DESC(MM_IO_BASE_SPUM, SZ_1M), /* phys:0x37000000-0x37FFFFFF virt:0xF3700000-0xF37FFFFF size:0x01000000 */
45 IO_DESC(MM_IO_BASE_VPM_PROG, SZ_1M), /* phys:0x38000000-0x38FFFFFF virt:0xF3800000-0xF38FFFFF size:0x01000000 */
46 IO_DESC(MM_IO_BASE_VPM_DATA, SZ_1M), /* phys:0x3A000000-0x3AFFFFFF virt:0xF3A00000-0xF3AFFFFF size:0x01000000 */
47
48 IO_DESC(MM_IO_BASE_VRAM, SZ_64K), /* phys:0x40000000-0x4000FFFF virt:0xF4000000-0xF400FFFF size:0x00010000 */
49 IO_DESC(MM_IO_BASE_CHIPC, SZ_16M), /* phys:0x80000000-0x80FFFFFF virt:0xF8000000-0xF8FFFFFF size:0x01000000 */
50 IO_DESC(MM_IO_BASE_VPM_EXTMEM_RSVD,
51 SZ_16M), /* phys:0x0F000000-0x0FFFFFFF virt:0xF0000000-0xF0FFFFFF size:0x01000000 */
52};
53
54void __init bcmring_map_io(void)
55{
56
57 iotable_init(bcmring_io_desc, ARRAY_SIZE(bcmring_io_desc));
58 /* Maximum DMA memory allowed is 14M */
59 init_consistent_dma_size(14 << 20);
60}
diff --git a/arch/arm/mach-bcmring/timer.c b/arch/arm/mach-bcmring/timer.c
deleted file mode 100644
index af9c3d7e2a0..00000000000
--- a/arch/arm/mach-bcmring/timer.c
+++ /dev/null
@@ -1,61 +0,0 @@
1/*****************************************************************************
2* Copyright 2003 - 2008 Broadcom Corporation. All rights reserved.
3*
4* Unless you and Broadcom execute a separate written software license
5* agreement governing use of this software, this software is licensed to you
6* under the terms of the GNU General Public License version 2, available at
7* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8*
9* Notwithstanding the above, under no circumstances may you combine this
10* software in any way with any other Broadcom software provided under a
11* license other than the GPL, without Broadcom's express prior written
12* consent.
13*****************************************************************************/
14
15#include <linux/types.h>
16#include <linux/module.h>
17#include <csp/tmrHw.h>
18
19#include <mach/timer.h>
20/* The core.c file initializes timers 1 and 3 as a linux clocksource. */
21/* The real time clock should probably be the real linux clocksource. */
22/* In the meantime, this file should agree with core.c as to the */
23/* profiling timer. If the clocksource is moved to rtc later, then */
24/* we can init the profiling timer here instead. */
25
26/* Timer 1 provides 25MHz resolution syncrhonized to scheduling and APM timing */
27/* Timer 3 provides bus freqeuncy sychronized to ACLK, but spread spectrum will */
28/* affect synchronization with scheduling and APM timing. */
29
30#define PROF_TIMER 1
31
32timer_tick_rate_t timer_get_tick_rate(void)
33{
34 return tmrHw_getCountRate(PROF_TIMER);
35}
36
37timer_tick_count_t timer_get_tick_count(void)
38{
39 return tmrHw_GetCurrentCount(PROF_TIMER); /* change downcounter to upcounter */
40}
41
42timer_msec_t timer_ticks_to_msec(timer_tick_count_t ticks)
43{
44 static int tickRateMsec;
45
46 if (tickRateMsec == 0) {
47 tickRateMsec = timer_get_tick_rate() / 1000;
48 }
49
50 return ticks / tickRateMsec;
51}
52
53timer_msec_t timer_get_msec(void)
54{
55 return timer_ticks_to_msec(timer_get_tick_count());
56}
57
58EXPORT_SYMBOL(timer_get_tick_count);
59EXPORT_SYMBOL(timer_ticks_to_msec);
60EXPORT_SYMBOL(timer_get_tick_rate);
61EXPORT_SYMBOL(timer_get_msec);
diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
index ea036d62158..263242da2cb 100644
--- a/arch/arm/mach-clps711x/Kconfig
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -16,12 +16,6 @@ config ARCH_CDB89712
16 The board includes 2 serial ports, Ethernet, IRDA, and expansion 16 The board includes 2 serial ports, Ethernet, IRDA, and expansion
17 headers. It comes with 16 MB SDRAM and 8 MB flash ROM. 17 headers. It comes with 16 MB SDRAM and 8 MB flash ROM.
18 18
19config ARCH_CEIVA
20 bool "CEIVA"
21 help
22 Say Y here if you intend to run this kernel on the Ceiva/Polaroid
23 PhotoMax Digital Picture Frame.
24
25config ARCH_CLEP7312 19config ARCH_CLEP7312
26 bool "CLEP7312" 20 bool "CLEP7312"
27 help 21 help
@@ -29,9 +23,9 @@ config ARCH_CLEP7312
29 23
30config ARCH_EDB7211 24config ARCH_EDB7211
31 bool "EDB7211" 25 bool "EDB7211"
32 select ISA
33 select ARCH_SPARSEMEM_ENABLE
34 select ARCH_SELECT_MEMORY_MODEL 26 select ARCH_SELECT_MEMORY_MODEL
27 select ARCH_SPARSEMEM_ENABLE
28 select ISA
35 help 29 help
36 Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211 30 Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211
37 evaluation board. 31 evaluation board.
diff --git a/arch/arm/mach-clps711x/Makefile b/arch/arm/mach-clps711x/Makefile
index f2f0256232e..6da6940b365 100644
--- a/arch/arm/mach-clps711x/Makefile
+++ b/arch/arm/mach-clps711x/Makefile
@@ -9,12 +9,9 @@ obj-m :=
9obj-n := 9obj-n :=
10obj- := 10obj- :=
11 11
12obj-$(CONFIG_ARCH_CEIVA) += ceiva.o
13obj-$(CONFIG_ARCH_AUTCPU12) += autcpu12.o 12obj-$(CONFIG_ARCH_AUTCPU12) += autcpu12.o
14obj-$(CONFIG_ARCH_CDB89712) += cdb89712.o 13obj-$(CONFIG_ARCH_CDB89712) += cdb89712.o
15obj-$(CONFIG_ARCH_CLEP7312) += clep7312.o 14obj-$(CONFIG_ARCH_CLEP7312) += clep7312.o
16obj-$(CONFIG_ARCH_EDB7211) += edb7211-arch.o edb7211-mm.o 15obj-$(CONFIG_ARCH_EDB7211) += edb7211-arch.o edb7211-mm.o
17obj-$(CONFIG_ARCH_FORTUNET) += fortunet.o 16obj-$(CONFIG_ARCH_FORTUNET) += fortunet.o
18obj-$(CONFIG_ARCH_P720T) += p720t.o 17obj-$(CONFIG_ARCH_P720T) += p720t.o
19leds-$(CONFIG_ARCH_P720T) += p720t-leds.o
20obj-$(CONFIG_LEDS) += $(leds-y)
diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c
index 3fb79a1d0bd..32871918bb6 100644
--- a/arch/arm/mach-clps711x/autcpu12.c
+++ b/arch/arm/mach-clps711x/autcpu12.c
@@ -23,6 +23,8 @@
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/mm.h> 24#include <linux/mm.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/ioport.h>
27#include <linux/platform_device.h>
26 28
27#include <mach/hardware.h> 29#include <mach/hardware.h>
28#include <asm/sizes.h> 30#include <asm/sizes.h>
@@ -62,9 +64,26 @@ void __init autcpu12_map_io(void)
62 iotable_init(autcpu12_io_desc, ARRAY_SIZE(autcpu12_io_desc)); 64 iotable_init(autcpu12_io_desc, ARRAY_SIZE(autcpu12_io_desc));
63} 65}
64 66
67static struct resource autcpu12_nvram_resource[] __initdata = {
68 DEFINE_RES_MEM_NAMED(AUTCPU12_PHYS_NVRAM, SZ_128K, "SRAM"),
69};
70
71static struct platform_device autcpu12_nvram_pdev __initdata = {
72 .name = "autcpu12_nvram",
73 .id = -1,
74 .resource = autcpu12_nvram_resource,
75 .num_resources = ARRAY_SIZE(autcpu12_nvram_resource),
76};
77
78static void __init autcpu12_init(void)
79{
80 platform_device_register(&autcpu12_nvram_pdev);
81}
82
65MACHINE_START(AUTCPU12, "autronix autcpu12") 83MACHINE_START(AUTCPU12, "autronix autcpu12")
66 /* Maintainer: Thomas Gleixner */ 84 /* Maintainer: Thomas Gleixner */
67 .atag_offset = 0x20000, 85 .atag_offset = 0x20000,
86 .init_machine = autcpu12_init,
68 .map_io = autcpu12_map_io, 87 .map_io = autcpu12_map_io,
69 .init_irq = clps711x_init_irq, 88 .init_irq = clps711x_init_irq,
70 .timer = &clps711x_timer, 89 .timer = &clps711x_timer,
diff --git a/arch/arm/mach-clps711x/ceiva.c b/arch/arm/mach-clps711x/ceiva.c
deleted file mode 100644
index a70147e347a..00000000000
--- a/arch/arm/mach-clps711x/ceiva.c
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2 * linux/arch/arm/mach-clps711x/arch-ceiva.c
3 *
4 * Copyright (C) 2002, Rob Scott <rscott@mtrob.fdns.net>
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#include <linux/init.h>
21#include <linux/types.h>
22#include <linux/string.h>
23
24#include <asm/setup.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28#include <linux/kernel.h>
29
30#include <mach/hardware.h>
31#include <asm/page.h>
32#include <asm/pgtable.h>
33#include <asm/sizes.h>
34
35#include <asm/mach/map.h>
36
37#include "common.h"
38
39static struct map_desc ceiva_io_desc[] __initdata = {
40 /* SED1355 controlled video RAM & registers */
41 {
42 .virtual = CEIVA_VIRT_SED1355,
43 .pfn = __phys_to_pfn(CEIVA_PHYS_SED1355),
44 .length = SZ_2M,
45 .type = MT_DEVICE
46 }
47};
48
49
50static void __init ceiva_map_io(void)
51{
52 clps711x_map_io();
53 iotable_init(ceiva_io_desc, ARRAY_SIZE(ceiva_io_desc));
54}
55
56
57MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame")
58 /* Maintainer: Rob Scott */
59 .atag_offset = 0x100,
60 .map_io = ceiva_map_io,
61 .init_irq = clps711x_init_irq,
62 .timer = &clps711x_timer,
63 .restart = clps711x_restart,
64MACHINE_END
diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c
index f15293bd797..509243d89a3 100644
--- a/arch/arm/mach-clps711x/common.c
+++ b/arch/arm/mach-clps711x/common.c
@@ -19,24 +19,25 @@
19 * along with this program; if not, write to the Free Software 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 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 21 */
22#include <linux/kernel.h> 22#include <linux/io.h>
23#include <linux/mm.h>
24#include <linux/init.h> 23#include <linux/init.h>
25#include <linux/interrupt.h> 24#include <linux/interrupt.h>
26#include <linux/io.h>
27#include <linux/irq.h> 25#include <linux/irq.h>
28#include <linux/sched.h> 26#include <linux/clk.h>
27#include <linux/clkdev.h>
28#include <linux/clk-provider.h>
29 29
30#include <asm/sizes.h> 30#include <asm/sizes.h>
31#include <mach/hardware.h>
32#include <asm/irq.h>
33#include <asm/leds.h>
34#include <asm/pgtable.h>
35#include <asm/page.h>
36#include <asm/mach/map.h> 31#include <asm/mach/map.h>
37#include <asm/mach/time.h> 32#include <asm/mach/time.h>
38#include <asm/system_misc.h> 33#include <asm/system_misc.h>
39 34
35#include <mach/hardware.h>
36
37static struct clk *clk_pll, *clk_bus, *clk_uart, *clk_timerl, *clk_timerh,
38 *clk_tint, *clk_spi;
39static unsigned long latch;
40
40/* 41/*
41 * This maps the generic CLPS711x registers 42 * This maps the generic CLPS711x registers
42 */ 43 */
@@ -166,8 +167,8 @@ void __init clps711x_init_irq(void)
166static unsigned long clps711x_gettimeoffset(void) 167static unsigned long clps711x_gettimeoffset(void)
167{ 168{
168 unsigned long hwticks; 169 unsigned long hwticks;
169 hwticks = LATCH - (clps_readl(TC2D) & 0xffff); /* since last underflow */ 170 hwticks = latch - (clps_readl(TC2D) & 0xffff);
170 return (hwticks * (tick_nsec / 1000)) / LATCH; 171 return (hwticks * (tick_nsec / 1000)) / latch;
171} 172}
172 173
173/* 174/*
@@ -185,15 +186,71 @@ static struct irqaction clps711x_timer_irq = {
185 .handler = p720t_timer_interrupt, 186 .handler = p720t_timer_interrupt,
186}; 187};
187 188
189static void add_fixed_clk(struct clk *clk, const char *name, int rate)
190{
191 clk = clk_register_fixed_rate(NULL, name, NULL, CLK_IS_ROOT, rate);
192 clk_register_clkdev(clk, name, NULL);
193}
194
188static void __init clps711x_timer_init(void) 195static void __init clps711x_timer_init(void)
189{ 196{
190 unsigned int syscon; 197 int osc, ext, pll, cpu, bus, timl, timh, uart, spi;
198 u32 tmp;
199
200 osc = 3686400;
201 ext = 13000000;
202
203 tmp = clps_readl(PLLR) >> 24;
204 if (tmp)
205 pll = (osc * tmp) / 2;
206 else
207 pll = 73728000; /* Default value */
208
209 tmp = clps_readl(SYSFLG2);
210 if (tmp & SYSFLG2_CKMODE) {
211 cpu = ext;
212 bus = cpu;
213 spi = 135400;
214 } else {
215 cpu = pll;
216 if (cpu >= 36864000)
217 bus = cpu / 2;
218 else
219 bus = 36864000 / 2;
220 spi = cpu / 576;
221 }
222
223 uart = bus / 10;
224
225 if (tmp & SYSFLG2_CKMODE) {
226 tmp = clps_readl(SYSCON2);
227 if (tmp & SYSCON2_OSTB)
228 timh = ext / 26;
229 else
230 timh = 541440;
231 } else
232 timh = cpu / 144;
233
234 timl = timh / 256;
235
236 /* All clocks are fixed */
237 add_fixed_clk(clk_pll, "pll", pll);
238 add_fixed_clk(clk_bus, "bus", bus);
239 add_fixed_clk(clk_uart, "uart", uart);
240 add_fixed_clk(clk_timerl, "timer_lf", timl);
241 add_fixed_clk(clk_timerh, "timer_hf", timh);
242 add_fixed_clk(clk_tint, "tint", 64);
243 add_fixed_clk(clk_spi, "spi", spi);
244
245 pr_info("CPU frequency set at %i Hz.\n", cpu);
246
247 latch = (timh + HZ / 2) / HZ;
191 248
192 syscon = clps_readl(SYSCON1); 249 tmp = clps_readl(SYSCON1);
193 syscon |= SYSCON1_TC2S | SYSCON1_TC2M; 250 tmp |= SYSCON1_TC2S | SYSCON1_TC2M;
194 clps_writel(syscon, SYSCON1); 251 clps_writel(tmp, SYSCON1);
195 252
196 clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */ 253 clps_writel(latch - 1, TC2D);
197 254
198 setup_irq(IRQ_TC2OI, &clps711x_timer_irq); 255 setup_irq(IRQ_TC2OI, &clps711x_timer_irq);
199} 256}
diff --git a/arch/arm/mach-clps711x/include/mach/clps711x.h b/arch/arm/mach-clps711x/include/mach/clps711x.h
index 1dd806f2847..c82e21ca49c 100644
--- a/arch/arm/mach-clps711x/include/mach/clps711x.h
+++ b/arch/arm/mach-clps711x/include/mach/clps711x.h
@@ -31,8 +31,8 @@
31#define PBDDR (0x0041) 31#define PBDDR (0x0041)
32#define PCDDR (0x0042) 32#define PCDDR (0x0042)
33#define PDDDR (0x0043) 33#define PDDDR (0x0043)
34#define PEDR (0x0080) 34#define PEDR (0x0083)
35#define PEDDR (0x00c0) 35#define PEDDR (0x00c3)
36#define SYSCON1 (0x0100) 36#define SYSCON1 (0x0100)
37#define SYSFLG1 (0x0140) 37#define SYSFLG1 (0x0140)
38#define MEMCFG1 (0x0180) 38#define MEMCFG1 (0x0180)
@@ -77,7 +77,7 @@
77#define KBDEOI (0x1700) 77#define KBDEOI (0x1700)
78 78
79#define DAIR (0x2000) 79#define DAIR (0x2000)
80#define DAIR0 (0x2040) 80#define DAIDR0 (0x2040)
81#define DAIDR1 (0x2080) 81#define DAIDR1 (0x2080)
82#define DAIDR2 (0x20c0) 82#define DAIDR2 (0x20c0)
83#define DAISR (0x2100) 83#define DAISR (0x2100)
@@ -191,8 +191,7 @@
191#define UBRLCR_WRDLEN8 (3 << 17) 191#define UBRLCR_WRDLEN8 (3 << 17)
192#define UBRLCR_WRDLEN_MASK (3 << 17) 192#define UBRLCR_WRDLEN_MASK (3 << 17)
193 193
194#define SYNCIO_FRMLEN(x) (((x) & 0x3f) << 7) 194#define SYNCIO_FRMLEN(x) (((x) & 0x1f) << 8)
195#define SYNCIO_CFGLEN(x) ((x) & 0x7f)
196#define SYNCIO_SMCKEN (1 << 13) 195#define SYNCIO_SMCKEN (1 << 13)
197#define SYNCIO_TXFRMEN (1 << 14) 196#define SYNCIO_TXFRMEN (1 << 14)
198 197
diff --git a/arch/arm/mach-clps711x/include/mach/debug-macro.S b/arch/arm/mach-clps711x/include/mach/debug-macro.S
index 118b3d93057..cb3684f8dae 100644
--- a/arch/arm/mach-clps711x/include/mach/debug-macro.S
+++ b/arch/arm/mach-clps711x/include/mach/debug-macro.S
@@ -28,17 +28,11 @@
28 .endm 28 .endm
29 29
30 .macro waituart,rd,rx 30 .macro waituart,rd,rx
311001: ldr \rd, [\rx, #0x0140] @ SYSFLGx
32 tst \rd, #1 << 11 @ UBUSYx
33 bne 1001b
34 .endm 31 .endm
35 32
36 .macro busyuart,rd,rx 33 .macro busyuart,rd,rx
37 tst \rx, #0x1000 @ UART2 does not have CTS here
38 bne 1002f
391001: ldr \rd, [\rx, #0x0140] @ SYSFLGx 341001: ldr \rd, [\rx, #0x0140] @ SYSFLGx
40 tst \rd, #1 << 8 @ CTS 35 tst \rd, #1 << 11 @ UBUSYx
41 bne 1001b 36 bne 1001b
421002:
43 .endm 37 .endm
44 38
diff --git a/arch/arm/mach-clps711x/include/mach/hardware.h b/arch/arm/mach-clps711x/include/mach/hardware.h
index 13a64fcd7dd..8497775d6ee 100644
--- a/arch/arm/mach-clps711x/include/mach/hardware.h
+++ b/arch/arm/mach-clps711x/include/mach/hardware.h
@@ -116,7 +116,6 @@
116 116
117#endif /* CONFIG_ARCH_EDB7211 */ 117#endif /* CONFIG_ARCH_EDB7211 */
118 118
119
120/* 119/*
121 * Relevant bits in port D, which controls power to the various parts of 120 * Relevant bits in port D, which controls power to the various parts of
122 * the LCD on the EDB7211. 121 * the LCD on the EDB7211.
@@ -125,51 +124,4 @@
125#define EDB_PD2_LCDEN (1<<2) 124#define EDB_PD2_LCDEN (1<<2)
126#define EDB_PD3_LCDBL (1<<3) 125#define EDB_PD3_LCDBL (1<<3)
127 126
128
129#if defined (CONFIG_ARCH_CEIVA)
130
131/*
132 * The two flash banks are wired to chip selects 0 and 1. This is the mapping
133 * for them.
134 *
135 * nCS0 and nCS1 are at 0x70000000 and 0x60000000, respectively, when running
136 * in jumpered boot mode.
137 */
138#define CEIVA_PHYS_FLASH1 CS0_PHYS_BASE /* physical */
139#define CEIVA_PHYS_FLASH2 CS1_PHYS_BASE /* physical */
140
141#define CEIVA_VIRT_FLASH1 (0xfa000000) /* virtual */
142#define CEIVA_VIRT_FLASH2 (0xfb000000) /* virtual */
143
144#define CEIVA_FLASH_SIZE 0x100000
145#define CEIVA_FLASH_WIDTH 2
146
147/*
148 * SED1355 LCD controller
149 */
150#define CEIVA_PHYS_SED1355 CS2_PHYS_BASE
151#define CEIVA_VIRT_SED1355 (0xfc000000)
152
153/*
154 * Relevant bits in port D, which controls power to the various parts of
155 * the LCD on the Ceiva Photo Max, and reset to the LCD controller.
156 */
157
158// Reset line to SED1355 (must be high to operate)
159#define CEIVA_PD1_LCDRST (1<<1)
160// LCD panel enable (set to one, to enable LCD)
161#define CEIVA_PD4_LCDEN (1<<4)
162// Backlight (set to one, to turn on backlight
163#define CEIVA_PD5_LCDBL (1<<5)
164
165/*
166 * Relevant bits in port B, which report the status of the buttons.
167 */
168
169// White button
170#define CEIVA_PB4_WHT_BTN (1<<4)
171// Black button
172#define CEIVA_PB0_BLK_BTN (1<<0)
173#endif // #if defined (CONFIG_ARCH_CEIVA)
174
175#endif 127#endif
diff --git a/arch/arm/mach-clps711x/include/mach/timex.h b/arch/arm/mach-clps711x/include/mach/timex.h
index ac8823ccff9..de6fd192d1c 100644
--- a/arch/arm/mach-clps711x/include/mach/timex.h
+++ b/arch/arm/mach-clps711x/include/mach/timex.h
@@ -1,23 +1,2 @@
1/* 1/* Bogus value */
2 * arch/arm/mach-clps711x/include/mach/timex.h
3 *
4 * Prospector 720T architecture timex specifications
5 *
6 * Copyright (C) 2000 Deep Blue Solutions Ltd.
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#define CLOCK_TICK_RATE 512000 2#define CLOCK_TICK_RATE 512000
diff --git a/arch/arm/mach-clps711x/p720t-leds.c b/arch/arm/mach-clps711x/p720t-leds.c
deleted file mode 100644
index bbc449fbe14..00000000000
--- a/arch/arm/mach-clps711x/p720t-leds.c
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * linux/arch/arm/mach-clps711x/leds.c
3 *
4 * Integrator LED control routines
5 *
6 * Copyright (C) 2000 Deep Blue Solutions Ltd
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#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/io.h>
25
26#include <mach/hardware.h>
27#include <asm/leds.h>
28#include <asm/mach-types.h>
29
30static void p720t_leds_event(led_event_t ledevt)
31{
32 unsigned long flags;
33 u32 pddr;
34
35 local_irq_save(flags);
36 switch(ledevt) {
37 case led_idle_start:
38 break;
39
40 case led_idle_end:
41 break;
42
43 case led_timer:
44 pddr = clps_readb(PDDR);
45 clps_writeb(pddr ^ 1, PDDR);
46 break;
47
48 default:
49 break;
50 }
51
52 local_irq_restore(flags);
53}
54
55static int __init leds_init(void)
56{
57 if (machine_is_p720t())
58 leds_event = p720t_leds_event;
59
60 return 0;
61}
62
63arch_initcall(leds_init);
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
index f266d90b9ef..b752b586fc2 100644
--- a/arch/arm/mach-clps711x/p720t.c
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -23,6 +23,8 @@
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/mm.h> 24#include <linux/mm.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/slab.h>
27#include <linux/leds.h>
26 28
27#include <mach/hardware.h> 29#include <mach/hardware.h>
28#include <asm/pgtable.h> 30#include <asm/pgtable.h>
@@ -34,6 +36,8 @@
34#include <asm/mach/map.h> 36#include <asm/mach/map.h>
35#include <mach/syspld.h> 37#include <mach/syspld.h>
36 38
39#include <asm/hardware/clps7111.h>
40
37#include "common.h" 41#include "common.h"
38 42
39/* 43/*
@@ -107,6 +111,64 @@ static void __init p720t_init_early(void)
107 } 111 }
108} 112}
109 113
114/*
115 * LED controled by CPLD
116 */
117#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
118static void p720t_led_set(struct led_classdev *cdev,
119 enum led_brightness b)
120{
121 u8 reg = clps_readb(PDDR);
122
123 if (b != LED_OFF)
124 reg |= 0x1;
125 else
126 reg &= ~0x1;
127
128 clps_writeb(reg, PDDR);
129}
130
131static enum led_brightness p720t_led_get(struct led_classdev *cdev)
132{
133 u8 reg = clps_readb(PDDR);
134
135 return (reg & 0x1) ? LED_FULL : LED_OFF;
136}
137
138static int __init p720t_leds_init(void)
139{
140
141 struct led_classdev *cdev;
142 int ret;
143
144 if (!machine_is_p720t())
145 return -ENODEV;
146
147 cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
148 if (!cdev)
149 return -ENOMEM;
150
151 cdev->name = "p720t:0";
152 cdev->brightness_set = p720t_led_set;
153 cdev->brightness_get = p720t_led_get;
154 cdev->default_trigger = "heartbeat";
155
156 ret = led_classdev_register(NULL, cdev);
157 if (ret < 0) {
158 kfree(cdev);
159 return ret;
160 }
161
162 return 0;
163}
164
165/*
166 * Since we may have triggers on any subsystem, defer registration
167 * until after subsystem_init.
168 */
169fs_initcall(p720t_leds_init);
170#endif
171
110MACHINE_START(P720T, "ARM-Prospector720T") 172MACHINE_START(P720T, "ARM-Prospector720T")
111 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 173 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
112 .atag_offset = 0x100, 174 .atag_offset = 0x100,
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index ab99c3c3b75..f8eecb95941 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -4,12 +4,12 @@ config AINTC
4 bool 4 bool
5 5
6config CP_INTC 6config CP_INTC
7 select IRQ_DOMAIN
8 bool 7 bool
8 select IRQ_DOMAIN
9 9
10config ARCH_DAVINCI_DMx 10config ARCH_DAVINCI_DMx
11 select CPU_ARM926T
12 bool 11 bool
12 select CPU_ARM926T
13 13
14menu "TI DaVinci Implementations" 14menu "TI DaVinci Implementations"
15 15
@@ -32,19 +32,19 @@ config ARCH_DAVINCI_DM646x
32 32
33config ARCH_DAVINCI_DA830 33config ARCH_DAVINCI_DA830
34 bool "DA830/OMAP-L137/AM17x based system" 34 bool "DA830/OMAP-L137/AM17x based system"
35 select CP_INTC
36 select ARCH_DAVINCI_DA8XX 35 select ARCH_DAVINCI_DA8XX
37 select CPU_DCACHE_WRITETHROUGH # needed on silicon revs 1.0, 1.1 36 select CPU_DCACHE_WRITETHROUGH # needed on silicon revs 1.0, 1.1
37 select CP_INTC
38 38
39config ARCH_DAVINCI_DA850 39config ARCH_DAVINCI_DA850
40 bool "DA850/OMAP-L138/AM18x based system" 40 bool "DA850/OMAP-L138/AM18x based system"
41 select CP_INTC
42 select ARCH_DAVINCI_DA8XX 41 select ARCH_DAVINCI_DA8XX
43 select ARCH_HAS_CPUFREQ 42 select ARCH_HAS_CPUFREQ
43 select CP_INTC
44 44
45config ARCH_DAVINCI_DA8XX 45config ARCH_DAVINCI_DA8XX
46 select CPU_ARM926T
47 bool 46 bool
47 select CPU_ARM926T
48 48
49config ARCH_DAVINCI_DM365 49config ARCH_DAVINCI_DM365
50 bool "DaVinci 365 based system" 50 bool "DaVinci 365 based system"
@@ -52,9 +52,9 @@ config ARCH_DAVINCI_DM365
52 select ARCH_DAVINCI_DMx 52 select ARCH_DAVINCI_DMx
53 53
54config ARCH_DAVINCI_TNETV107X 54config ARCH_DAVINCI_TNETV107X
55 bool "TNETV107X based system"
55 select CPU_V6 56 select CPU_V6
56 select CP_INTC 57 select CP_INTC
57 bool "TNETV107X based system"
58 58
59comment "DaVinci Board Type" 59comment "DaVinci Board Type"
60 60
@@ -103,9 +103,9 @@ config MACH_DAVINCI_DM6467_EVM
103 bool "TI DM6467 EVM" 103 bool "TI DM6467 EVM"
104 default ARCH_DAVINCI_DM646x 104 default ARCH_DAVINCI_DM646x
105 depends on ARCH_DAVINCI_DM646x 105 depends on ARCH_DAVINCI_DM646x
106 select MACH_DAVINCI_DM6467TEVM
107 select EEPROM_AT24 106 select EEPROM_AT24
108 select I2C 107 select I2C
108 select MACH_DAVINCI_DM6467TEVM
109 help 109 help
110 Configure this option to specify the whether the board used 110 Configure this option to specify the whether the board used
111 for development is a DM6467 EVM 111 for development is a DM6467 EVM
@@ -127,8 +127,8 @@ config MACH_DAVINCI_DA830_EVM
127 bool "TI DA830/OMAP-L137/AM17x Reference Platform" 127 bool "TI DA830/OMAP-L137/AM17x Reference Platform"
128 default ARCH_DAVINCI_DA830 128 default ARCH_DAVINCI_DA830
129 depends on ARCH_DAVINCI_DA830 129 depends on ARCH_DAVINCI_DA830
130 select GPIO_PCF857X
131 select EEPROM_AT24 130 select EEPROM_AT24
131 select GPIO_PCF857X
132 select I2C 132 select I2C
133 help 133 help
134 Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module. 134 Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module.
@@ -186,6 +186,13 @@ config DA850_UI_RMII
186 NOTE: Please take care while choosing this option, MII PHY will 186 NOTE: Please take care while choosing this option, MII PHY will
187 not be functional if RMII mode is selected. 187 not be functional if RMII mode is selected.
188 188
189config DA850_UI_SD_VIDEO_PORT
190 bool "Video Port Interface"
191 help
192 Say Y if you want to use Video Port Interface (VPIF) on the
193 DA850/OMAP-L138 EVM. The Video decoders/encoders are found on the
194 UI daughter card that is supplied with the EVM.
195
189endchoice 196endchoice
190 197
191config DA850_WL12XX 198config DA850_WL12XX
diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c
index 1ce70a91f2e..f091a9010c2 100644
--- a/arch/arm/mach-davinci/aemif.c
+++ b/arch/arm/mach-davinci/aemif.c
@@ -15,7 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/time.h> 16#include <linux/time.h>
17 17
18#include <mach/aemif.h> 18#include <linux/platform_data/mtd-davinci-aemif.h>
19 19
20/* Timing value configuration */ 20/* Timing value configuration */
21 21
diff --git a/arch/arm/mach-davinci/asp.h b/arch/arm/mach-davinci/asp.h
new file mode 100644
index 00000000000..d9b2acd1239
--- /dev/null
+++ b/arch/arm/mach-davinci/asp.h
@@ -0,0 +1,49 @@
1/*
2 * TI DaVinci Audio definitions
3 */
4#ifndef __ASM_ARCH_DAVINCI_ASP_H
5#define __ASM_ARCH_DAVINCI_ASP_H
6
7/* Bases of dm644x and dm355 register banks */
8#define DAVINCI_ASP0_BASE 0x01E02000
9#define DAVINCI_ASP1_BASE 0x01E04000
10
11/* Bases of dm365 register banks */
12#define DAVINCI_DM365_ASP0_BASE 0x01D02000
13
14/* Bases of dm646x register banks */
15#define DAVINCI_DM646X_MCASP0_REG_BASE 0x01D01000
16#define DAVINCI_DM646X_MCASP1_REG_BASE 0x01D01800
17
18/* Bases of da850/da830 McASP0 register banks */
19#define DAVINCI_DA8XX_MCASP0_REG_BASE 0x01D00000
20
21/* Bases of da830 McASP1 register banks */
22#define DAVINCI_DA830_MCASP1_REG_BASE 0x01D04000
23
24/* EDMA channels of dm644x and dm355 */
25#define DAVINCI_DMA_ASP0_TX 2
26#define DAVINCI_DMA_ASP0_RX 3
27#define DAVINCI_DMA_ASP1_TX 8
28#define DAVINCI_DMA_ASP1_RX 9
29
30/* EDMA channels of dm646x */
31#define DAVINCI_DM646X_DMA_MCASP0_AXEVT0 6
32#define DAVINCI_DM646X_DMA_MCASP0_AREVT0 9
33#define DAVINCI_DM646X_DMA_MCASP1_AXEVT1 12
34
35/* EDMA channels of da850/da830 McASP0 */
36#define DAVINCI_DA8XX_DMA_MCASP0_AREVT 0
37#define DAVINCI_DA8XX_DMA_MCASP0_AXEVT 1
38
39/* EDMA channels of da830 McASP1 */
40#define DAVINCI_DA830_DMA_MCASP1_AREVT 2
41#define DAVINCI_DA830_DMA_MCASP1_AXEVT 3
42
43/* Interrupts */
44#define DAVINCI_ASP0_RX_INT IRQ_MBRINT
45#define DAVINCI_ASP0_TX_INT IRQ_MBXINT
46#define DAVINCI_ASP1_RX_INT IRQ_MBRINT
47#define DAVINCI_ASP1_TX_INT IRQ_MBXINT
48
49#endif /* __ASM_ARCH_DAVINCI_ASP_H */
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index 0031864e7f1..95b5e102ceb 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -28,11 +28,11 @@
28 28
29#include <mach/cp_intc.h> 29#include <mach/cp_intc.h>
30#include <mach/mux.h> 30#include <mach/mux.h>
31#include <mach/nand.h> 31#include <linux/platform_data/mtd-davinci.h>
32#include <mach/da8xx.h> 32#include <mach/da8xx.h>
33#include <mach/usb.h> 33#include <linux/platform_data/usb-davinci.h>
34#include <mach/aemif.h> 34#include <linux/platform_data/mtd-davinci-aemif.h>
35#include <mach/spi.h> 35#include <linux/platform_data/spi-davinci.h>
36 36
37#define DA830_EVM_PHY_ID "" 37#define DA830_EVM_PHY_ID ""
38/* 38/*
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 0149fb453be..32ee3f89596 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -40,10 +40,13 @@
40 40
41#include <mach/cp_intc.h> 41#include <mach/cp_intc.h>
42#include <mach/da8xx.h> 42#include <mach/da8xx.h>
43#include <mach/nand.h> 43#include <linux/platform_data/mtd-davinci.h>
44#include <mach/mux.h> 44#include <mach/mux.h>
45#include <mach/aemif.h> 45#include <linux/platform_data/mtd-davinci-aemif.h>
46#include <mach/spi.h> 46#include <linux/platform_data/spi-davinci.h>
47
48#include <media/tvp514x.h>
49#include <media/adv7343.h>
47 50
48#define DA850_EVM_PHY_ID "davinci_mdio-0:00" 51#define DA850_EVM_PHY_ID "davinci_mdio-0:00"
49#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8) 52#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
@@ -452,6 +455,15 @@ static void da850_evm_ui_keys_init(unsigned gpio)
452 } 455 }
453} 456}
454 457
458#ifdef CONFIG_DA850_UI_SD_VIDEO_PORT
459static inline void da850_evm_setup_video_port(int video_sel)
460{
461 gpio_set_value_cansleep(video_sel, 0);
462}
463#else
464static inline void da850_evm_setup_video_port(int video_sel) { }
465#endif
466
455static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio, 467static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
456 unsigned ngpio, void *c) 468 unsigned ngpio, void *c)
457{ 469{
@@ -497,6 +509,8 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
497 509
498 da850_evm_setup_emac_rmii(sel_a); 510 da850_evm_setup_emac_rmii(sel_a);
499 511
512 da850_evm_setup_video_port(sel_c);
513
500 return 0; 514 return 0;
501 515
502exp_setup_keys_fail: 516exp_setup_keys_fail:
@@ -1149,6 +1163,169 @@ static __init int da850_evm_init_cpufreq(void)
1149static __init int da850_evm_init_cpufreq(void) { return 0; } 1163static __init int da850_evm_init_cpufreq(void) { return 0; }
1150#endif 1164#endif
1151 1165
1166#if defined(CONFIG_DA850_UI_SD_VIDEO_PORT)
1167
1168#define TVP5147_CH0 "tvp514x-0"
1169#define TVP5147_CH1 "tvp514x-1"
1170
1171/* VPIF capture configuration */
1172static struct tvp514x_platform_data tvp5146_pdata = {
1173 .clk_polarity = 0,
1174 .hs_polarity = 1,
1175 .vs_polarity = 1,
1176};
1177
1178#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
1179
1180static const struct vpif_input da850_ch0_inputs[] = {
1181 {
1182 .input = {
1183 .index = 0,
1184 .name = "Composite",
1185 .type = V4L2_INPUT_TYPE_CAMERA,
1186 .capabilities = V4L2_IN_CAP_STD,
1187 .std = TVP514X_STD_ALL,
1188 },
1189 .input_route = INPUT_CVBS_VI2B,
1190 .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
1191 .subdev_name = TVP5147_CH0,
1192 },
1193};
1194
1195static const struct vpif_input da850_ch1_inputs[] = {
1196 {
1197 .input = {
1198 .index = 0,
1199 .name = "S-Video",
1200 .type = V4L2_INPUT_TYPE_CAMERA,
1201 .capabilities = V4L2_IN_CAP_STD,
1202 .std = TVP514X_STD_ALL,
1203 },
1204 .input_route = INPUT_SVIDEO_VI2C_VI1C,
1205 .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
1206 .subdev_name = TVP5147_CH1,
1207 },
1208};
1209
1210static struct vpif_subdev_info da850_vpif_capture_sdev_info[] = {
1211 {
1212 .name = TVP5147_CH0,
1213 .board_info = {
1214 I2C_BOARD_INFO("tvp5146", 0x5d),
1215 .platform_data = &tvp5146_pdata,
1216 },
1217 },
1218 {
1219 .name = TVP5147_CH1,
1220 .board_info = {
1221 I2C_BOARD_INFO("tvp5146", 0x5c),
1222 .platform_data = &tvp5146_pdata,
1223 },
1224 },
1225};
1226
1227static struct vpif_capture_config da850_vpif_capture_config = {
1228 .subdev_info = da850_vpif_capture_sdev_info,
1229 .subdev_count = ARRAY_SIZE(da850_vpif_capture_sdev_info),
1230 .chan_config[0] = {
1231 .inputs = da850_ch0_inputs,
1232 .input_count = ARRAY_SIZE(da850_ch0_inputs),
1233 .vpif_if = {
1234 .if_type = VPIF_IF_BT656,
1235 .hd_pol = 1,
1236 .vd_pol = 1,
1237 .fid_pol = 0,
1238 },
1239 },
1240 .chan_config[1] = {
1241 .inputs = da850_ch1_inputs,
1242 .input_count = ARRAY_SIZE(da850_ch1_inputs),
1243 .vpif_if = {
1244 .if_type = VPIF_IF_BT656,
1245 .hd_pol = 1,
1246 .vd_pol = 1,
1247 .fid_pol = 0,
1248 },
1249 },
1250 .card_name = "DA850/OMAP-L138 Video Capture",
1251};
1252
1253/* VPIF display configuration */
1254static struct vpif_subdev_info da850_vpif_subdev[] = {
1255 {
1256 .name = "adv7343",
1257 .board_info = {
1258 I2C_BOARD_INFO("adv7343", 0x2a),
1259 },
1260 },
1261};
1262
1263static const struct vpif_output da850_ch0_outputs[] = {
1264 {
1265 .output = {
1266 .index = 0,
1267 .name = "Composite",
1268 .type = V4L2_OUTPUT_TYPE_ANALOG,
1269 .capabilities = V4L2_OUT_CAP_STD,
1270 .std = V4L2_STD_ALL,
1271 },
1272 .subdev_name = "adv7343",
1273 .output_route = ADV7343_COMPOSITE_ID,
1274 },
1275 {
1276 .output = {
1277 .index = 1,
1278 .name = "S-Video",
1279 .type = V4L2_OUTPUT_TYPE_ANALOG,
1280 .capabilities = V4L2_OUT_CAP_STD,
1281 .std = V4L2_STD_ALL,
1282 },
1283 .subdev_name = "adv7343",
1284 .output_route = ADV7343_SVIDEO_ID,
1285 },
1286};
1287
1288static struct vpif_display_config da850_vpif_display_config = {
1289 .subdevinfo = da850_vpif_subdev,
1290 .subdev_count = ARRAY_SIZE(da850_vpif_subdev),
1291 .chan_config[0] = {
1292 .outputs = da850_ch0_outputs,
1293 .output_count = ARRAY_SIZE(da850_ch0_outputs),
1294 },
1295 .card_name = "DA850/OMAP-L138 Video Display",
1296};
1297
1298static __init void da850_vpif_init(void)
1299{
1300 int ret;
1301
1302 ret = da850_register_vpif();
1303 if (ret)
1304 pr_warn("da850_evm_init: VPIF setup failed: %d\n", ret);
1305
1306 ret = davinci_cfg_reg_list(da850_vpif_capture_pins);
1307 if (ret)
1308 pr_warn("da850_evm_init: VPIF capture mux setup failed: %d\n",
1309 ret);
1310
1311 ret = da850_register_vpif_capture(&da850_vpif_capture_config);
1312 if (ret)
1313 pr_warn("da850_evm_init: VPIF capture setup failed: %d\n", ret);
1314
1315 ret = davinci_cfg_reg_list(da850_vpif_display_pins);
1316 if (ret)
1317 pr_warn("da850_evm_init: VPIF display mux setup failed: %d\n",
1318 ret);
1319
1320 ret = da850_register_vpif_display(&da850_vpif_display_config);
1321 if (ret)
1322 pr_warn("da850_evm_init: VPIF display setup failed: %d\n", ret);
1323}
1324
1325#else
1326static __init void da850_vpif_init(void) {}
1327#endif
1328
1152#ifdef CONFIG_DA850_WL12XX 1329#ifdef CONFIG_DA850_WL12XX
1153 1330
1154static void wl12xx_set_power(int index, bool power_on) 1331static void wl12xx_set_power(int index, bool power_on)
@@ -1375,6 +1552,8 @@ static __init void da850_evm_init(void)
1375 pr_warning("da850_evm_init: suspend registration failed: %d\n", 1552 pr_warning("da850_evm_init: suspend registration failed: %d\n",
1376 ret); 1553 ret);
1377 1554
1555 da850_vpif_init();
1556
1378 ret = da8xx_register_spi(1, da850evm_spi_info, 1557 ret = da8xx_register_spi(1, da850evm_spi_info,
1379 ARRAY_SIZE(da850evm_spi_info)); 1558 ARRAY_SIZE(da850evm_spi_info));
1380 if (ret) 1559 if (ret)
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 1c7b1f46a8f..88ebea89abd 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -26,11 +26,11 @@
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28 28
29#include <mach/i2c.h> 29#include <linux/platform_data/i2c-davinci.h>
30#include <mach/serial.h> 30#include <mach/serial.h>
31#include <mach/nand.h> 31#include <linux/platform_data/mtd-davinci.h>
32#include <mach/mmc.h> 32#include <linux/platform_data/mmc-davinci.h>
33#include <mach/usb.h> 33#include <linux/platform_data/usb-davinci.h>
34 34
35#include "davinci.h" 35#include "davinci.h"
36 36
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 8e7703213b0..2f88103c645 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -23,11 +23,11 @@
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25 25
26#include <mach/i2c.h> 26#include <linux/platform_data/i2c-davinci.h>
27#include <mach/serial.h> 27#include <mach/serial.h>
28#include <mach/nand.h> 28#include <linux/platform_data/mtd-davinci.h>
29#include <mach/mmc.h> 29#include <linux/platform_data/mmc-davinci.h>
30#include <mach/usb.h> 30#include <linux/platform_data/usb-davinci.h>
31 31
32#include "davinci.h" 32#include "davinci.h"
33 33
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 688a9c556dc..1b4a8adcfdc 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -33,11 +33,11 @@
33 33
34#include <mach/mux.h> 34#include <mach/mux.h>
35#include <mach/common.h> 35#include <mach/common.h>
36#include <mach/i2c.h> 36#include <linux/platform_data/i2c-davinci.h>
37#include <mach/serial.h> 37#include <mach/serial.h>
38#include <mach/mmc.h> 38#include <linux/platform_data/mmc-davinci.h>
39#include <mach/nand.h> 39#include <linux/platform_data/mtd-davinci.h>
40#include <mach/keyscan.h> 40#include <linux/platform_data/keyscan-davinci.h>
41 41
42#include <media/tvp514x.h> 42#include <media/tvp514x.h>
43 43
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index d34ed55912b..f22572cee49 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -23,6 +23,7 @@
23#include <linux/phy.h> 23#include <linux/phy.h>
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/videodev2.h> 25#include <linux/videodev2.h>
26#include <linux/v4l2-dv-timings.h>
26#include <linux/export.h> 27#include <linux/export.h>
27 28
28#include <media/tvp514x.h> 29#include <media/tvp514x.h>
@@ -31,13 +32,13 @@
31#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
32 33
33#include <mach/common.h> 34#include <mach/common.h>
34#include <mach/i2c.h> 35#include <linux/platform_data/i2c-davinci.h>
35#include <mach/serial.h> 36#include <mach/serial.h>
36#include <mach/mux.h> 37#include <mach/mux.h>
37#include <mach/nand.h> 38#include <linux/platform_data/mtd-davinci.h>
38#include <mach/mmc.h> 39#include <linux/platform_data/mmc-davinci.h>
39#include <mach/usb.h> 40#include <linux/platform_data/usb-davinci.h>
40#include <mach/aemif.h> 41#include <linux/platform_data/mtd-davinci-aemif.h>
41 42
42#include "davinci.h" 43#include "davinci.h"
43 44
@@ -620,7 +621,7 @@ static struct vpbe_enc_mode_info dm644xevm_enc_std_timing[] = {
620 { 621 {
621 .name = "ntsc", 622 .name = "ntsc",
622 .timings_type = VPBE_ENC_STD, 623 .timings_type = VPBE_ENC_STD,
623 .timings = {V4L2_STD_525_60}, 624 .std_id = V4L2_STD_525_60,
624 .interlaced = 1, 625 .interlaced = 1,
625 .xres = 720, 626 .xres = 720,
626 .yres = 480, 627 .yres = 480,
@@ -632,7 +633,7 @@ static struct vpbe_enc_mode_info dm644xevm_enc_std_timing[] = {
632 { 633 {
633 .name = "pal", 634 .name = "pal",
634 .timings_type = VPBE_ENC_STD, 635 .timings_type = VPBE_ENC_STD,
635 .timings = {V4L2_STD_625_50}, 636 .std_id = V4L2_STD_625_50,
636 .interlaced = 1, 637 .interlaced = 1,
637 .xres = 720, 638 .xres = 720,
638 .yres = 576, 639 .yres = 576,
@@ -647,8 +648,8 @@ static struct vpbe_enc_mode_info dm644xevm_enc_std_timing[] = {
647static struct vpbe_enc_mode_info dm644xevm_enc_preset_timing[] = { 648static struct vpbe_enc_mode_info dm644xevm_enc_preset_timing[] = {
648 { 649 {
649 .name = "480p59_94", 650 .name = "480p59_94",
650 .timings_type = VPBE_ENC_DV_PRESET, 651 .timings_type = VPBE_ENC_CUSTOM_TIMINGS,
651 .timings = {V4L2_DV_480P59_94}, 652 .dv_timings = V4L2_DV_BT_CEA_720X480P59_94,
652 .interlaced = 0, 653 .interlaced = 0,
653 .xres = 720, 654 .xres = 720,
654 .yres = 480, 655 .yres = 480,
@@ -659,8 +660,8 @@ static struct vpbe_enc_mode_info dm644xevm_enc_preset_timing[] = {
659 }, 660 },
660 { 661 {
661 .name = "576p50", 662 .name = "576p50",
662 .timings_type = VPBE_ENC_DV_PRESET, 663 .timings_type = VPBE_ENC_CUSTOM_TIMINGS,
663 .timings = {V4L2_DV_576P50}, 664 .dv_timings = V4L2_DV_BT_CEA_720X576P50,
664 .interlaced = 0, 665 .interlaced = 0,
665 .xres = 720, 666 .xres = 720,
666 .yres = 576, 667 .yres = 576,
@@ -698,7 +699,7 @@ static struct vpbe_output dm644xevm_vpbe_outputs[] = {
698 .index = 1, 699 .index = 1,
699 .name = "Component", 700 .name = "Component",
700 .type = V4L2_OUTPUT_TYPE_ANALOG, 701 .type = V4L2_OUTPUT_TYPE_ANALOG,
701 .capabilities = V4L2_OUT_CAP_PRESETS, 702 .capabilities = V4L2_OUT_CAP_DV_TIMINGS,
702 }, 703 },
703 .subdev_name = VPBE_VENC_SUBDEV_NAME, 704 .subdev_name = VPBE_VENC_SUBDEV_NAME,
704 .default_mode = "480p59_94", 705 .default_mode = "480p59_94",
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 958679a20e1..1dbf85beed1 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -26,6 +26,7 @@
26#include <linux/i2c/pcf857x.h> 26#include <linux/i2c/pcf857x.h>
27 27
28#include <media/tvp514x.h> 28#include <media/tvp514x.h>
29#include <media/adv7343.h>
29 30
30#include <linux/mtd/mtd.h> 31#include <linux/mtd/mtd.h>
31#include <linux/mtd/nand.h> 32#include <linux/mtd/nand.h>
@@ -38,11 +39,11 @@
38 39
39#include <mach/common.h> 40#include <mach/common.h>
40#include <mach/serial.h> 41#include <mach/serial.h>
41#include <mach/i2c.h> 42#include <linux/platform_data/i2c-davinci.h>
42#include <mach/nand.h> 43#include <linux/platform_data/mtd-davinci.h>
43#include <mach/clock.h> 44#include <mach/clock.h>
44#include <mach/cdce949.h> 45#include <mach/cdce949.h>
45#include <mach/aemif.h> 46#include <linux/platform_data/mtd-davinci-aemif.h>
46 47
47#include "davinci.h" 48#include "davinci.h"
48#include "clock.h" 49#include "clock.h"
@@ -496,18 +497,49 @@ static struct vpif_subdev_info dm646x_vpif_subdev[] = {
496 }, 497 },
497}; 498};
498 499
499static const char *output[] = { 500static const struct vpif_output dm6467_ch0_outputs[] = {
500 "Composite", 501 {
501 "Component", 502 .output = {
502 "S-Video", 503 .index = 0,
504 .name = "Composite",
505 .type = V4L2_OUTPUT_TYPE_ANALOG,
506 .capabilities = V4L2_OUT_CAP_STD,
507 .std = V4L2_STD_ALL,
508 },
509 .subdev_name = "adv7343",
510 .output_route = ADV7343_COMPOSITE_ID,
511 },
512 {
513 .output = {
514 .index = 1,
515 .name = "Component",
516 .type = V4L2_OUTPUT_TYPE_ANALOG,
517 .capabilities = V4L2_OUT_CAP_CUSTOM_TIMINGS,
518 },
519 .subdev_name = "adv7343",
520 .output_route = ADV7343_COMPONENT_ID,
521 },
522 {
523 .output = {
524 .index = 2,
525 .name = "S-Video",
526 .type = V4L2_OUTPUT_TYPE_ANALOG,
527 .capabilities = V4L2_OUT_CAP_STD,
528 .std = V4L2_STD_ALL,
529 },
530 .subdev_name = "adv7343",
531 .output_route = ADV7343_SVIDEO_ID,
532 },
503}; 533};
504 534
505static struct vpif_display_config dm646x_vpif_display_config = { 535static struct vpif_display_config dm646x_vpif_display_config = {
506 .set_clock = set_vpif_clock, 536 .set_clock = set_vpif_clock,
507 .subdevinfo = dm646x_vpif_subdev, 537 .subdevinfo = dm646x_vpif_subdev,
508 .subdev_count = ARRAY_SIZE(dm646x_vpif_subdev), 538 .subdev_count = ARRAY_SIZE(dm646x_vpif_subdev),
509 .output = output, 539 .chan_config[0] = {
510 .output_count = ARRAY_SIZE(output), 540 .outputs = dm6467_ch0_outputs,
541 .output_count = ARRAY_SIZE(dm6467_ch0_outputs),
542 },
511 .card_name = "DM646x EVM", 543 .card_name = "DM646x EVM",
512}; 544};
513 545
@@ -601,15 +633,6 @@ static struct vpif_subdev_info vpif_capture_sdev_info[] = {
601 I2C_BOARD_INFO("tvp5146", 0x5d), 633 I2C_BOARD_INFO("tvp5146", 0x5d),
602 .platform_data = &tvp5146_pdata, 634 .platform_data = &tvp5146_pdata,
603 }, 635 },
604 .input = INPUT_CVBS_VI2B,
605 .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
606 .can_route = 1,
607 .vpif_if = {
608 .if_type = VPIF_IF_BT656,
609 .hd_pol = 1,
610 .vd_pol = 1,
611 .fid_pol = 0,
612 },
613 }, 636 },
614 { 637 {
615 .name = TVP5147_CH1, 638 .name = TVP5147_CH1,
@@ -617,15 +640,6 @@ static struct vpif_subdev_info vpif_capture_sdev_info[] = {
617 I2C_BOARD_INFO("tvp5146", 0x5c), 640 I2C_BOARD_INFO("tvp5146", 0x5c),
618 .platform_data = &tvp5146_pdata, 641 .platform_data = &tvp5146_pdata,
619 }, 642 },
620 .input = INPUT_SVIDEO_VI2C_VI1C,
621 .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
622 .can_route = 1,
623 .vpif_if = {
624 .if_type = VPIF_IF_BT656,
625 .hd_pol = 1,
626 .vd_pol = 1,
627 .fid_pol = 0,
628 },
629 }, 643 },
630}; 644};
631 645
@@ -635,9 +649,12 @@ static const struct vpif_input dm6467_ch0_inputs[] = {
635 .index = 0, 649 .index = 0,
636 .name = "Composite", 650 .name = "Composite",
637 .type = V4L2_INPUT_TYPE_CAMERA, 651 .type = V4L2_INPUT_TYPE_CAMERA,
652 .capabilities = V4L2_IN_CAP_STD,
638 .std = TVP514X_STD_ALL, 653 .std = TVP514X_STD_ALL,
639 }, 654 },
640 .subdev_name = TVP5147_CH0, 655 .subdev_name = TVP5147_CH0,
656 .input_route = INPUT_CVBS_VI2B,
657 .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
641 }, 658 },
642}; 659};
643 660
@@ -647,9 +664,12 @@ static const struct vpif_input dm6467_ch1_inputs[] = {
647 .index = 0, 664 .index = 0,
648 .name = "S-Video", 665 .name = "S-Video",
649 .type = V4L2_INPUT_TYPE_CAMERA, 666 .type = V4L2_INPUT_TYPE_CAMERA,
667 .capabilities = V4L2_IN_CAP_STD,
650 .std = TVP514X_STD_ALL, 668 .std = TVP514X_STD_ALL,
651 }, 669 },
652 .subdev_name = TVP5147_CH1, 670 .subdev_name = TVP5147_CH1,
671 .input_route = INPUT_SVIDEO_VI2C_VI1C,
672 .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
653 }, 673 },
654}; 674};
655 675
@@ -661,10 +681,22 @@ static struct vpif_capture_config dm646x_vpif_capture_cfg = {
661 .chan_config[0] = { 681 .chan_config[0] = {
662 .inputs = dm6467_ch0_inputs, 682 .inputs = dm6467_ch0_inputs,
663 .input_count = ARRAY_SIZE(dm6467_ch0_inputs), 683 .input_count = ARRAY_SIZE(dm6467_ch0_inputs),
684 .vpif_if = {
685 .if_type = VPIF_IF_BT656,
686 .hd_pol = 1,
687 .vd_pol = 1,
688 .fid_pol = 0,
689 },
664 }, 690 },
665 .chan_config[1] = { 691 .chan_config[1] = {
666 .inputs = dm6467_ch1_inputs, 692 .inputs = dm6467_ch1_inputs,
667 .input_count = ARRAY_SIZE(dm6467_ch1_inputs), 693 .input_count = ARRAY_SIZE(dm6467_ch1_inputs),
694 .vpif_if = {
695 .if_type = VPIF_IF_BT656,
696 .hd_pol = 1,
697 .vd_pol = 1,
698 .fid_pol = 0,
699 },
668 }, 700 },
669}; 701};
670 702
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index beecde3a1d2..43e4a0d663f 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -26,9 +26,9 @@
26#include <mach/common.h> 26#include <mach/common.h>
27#include <mach/cp_intc.h> 27#include <mach/cp_intc.h>
28#include <mach/da8xx.h> 28#include <mach/da8xx.h>
29#include <mach/nand.h> 29#include <linux/platform_data/mtd-davinci.h>
30#include <mach/mux.h> 30#include <mach/mux.h>
31#include <mach/spi.h> 31#include <linux/platform_data/spi-davinci.h>
32 32
33#define MITYOMAPL138_PHY_ID "" 33#define MITYOMAPL138_PHY_ID ""
34 34
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index f6b9fc70161..144bf31d68d 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -31,12 +31,12 @@
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32 32
33#include <mach/common.h> 33#include <mach/common.h>
34#include <mach/i2c.h> 34#include <linux/platform_data/i2c-davinci.h>
35#include <mach/serial.h> 35#include <mach/serial.h>
36#include <mach/mux.h> 36#include <mach/mux.h>
37#include <mach/nand.h> 37#include <linux/platform_data/mtd-davinci.h>
38#include <mach/mmc.h> 38#include <linux/platform_data/mmc-davinci.h>
39#include <mach/usb.h> 39#include <linux/platform_data/usb-davinci.h>
40 40
41#include "davinci.h" 41#include "davinci.h"
42 42
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index 9078acf94ba..6957787fa7f 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -36,10 +36,10 @@
36#include <asm/mach/flash.h> 36#include <asm/mach/flash.h>
37 37
38#include <mach/common.h> 38#include <mach/common.h>
39#include <mach/i2c.h> 39#include <linux/platform_data/i2c-davinci.h>
40#include <mach/serial.h> 40#include <mach/serial.h>
41#include <mach/mux.h> 41#include <mach/mux.h>
42#include <mach/usb.h> 42#include <linux/platform_data/usb-davinci.h>
43 43
44#include "davinci.h" 44#include "davinci.h"
45 45
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c
index ac4e003ad86..be3099733b1 100644
--- a/arch/arm/mach-davinci/board-tnetv107x-evm.c
+++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c
@@ -88,7 +88,7 @@ static struct davinci_mmc_config mmc_config = {
88 .version = MMC_CTLR_VERSION_1, 88 .version = MMC_CTLR_VERSION_1,
89}; 89};
90 90
91static const short sdio1_pins[] __initdata = { 91static const short sdio1_pins[] __initconst = {
92 TNETV107X_SDIO1_CLK_1, TNETV107X_SDIO1_CMD_1, 92 TNETV107X_SDIO1_CLK_1, TNETV107X_SDIO1_CMD_1,
93 TNETV107X_SDIO1_DATA0_1, TNETV107X_SDIO1_DATA1_1, 93 TNETV107X_SDIO1_DATA0_1, TNETV107X_SDIO1_DATA1_1,
94 TNETV107X_SDIO1_DATA2_1, TNETV107X_SDIO1_DATA3_1, 94 TNETV107X_SDIO1_DATA2_1, TNETV107X_SDIO1_DATA3_1,
@@ -96,12 +96,12 @@ static const short sdio1_pins[] __initdata = {
96 -1 96 -1
97}; 97};
98 98
99static const short uart1_pins[] __initdata = { 99static const short uart1_pins[] __initconst = {
100 TNETV107X_UART1_RD, TNETV107X_UART1_TD, 100 TNETV107X_UART1_RD, TNETV107X_UART1_TD,
101 -1 101 -1
102}; 102};
103 103
104static const short ssp_pins[] __initdata = { 104static const short ssp_pins[] __initconst = {
105 TNETV107X_SSP0_0, TNETV107X_SSP0_1, TNETV107X_SSP0_2, 105 TNETV107X_SSP0_0, TNETV107X_SSP0_1, TNETV107X_SSP0_2,
106 TNETV107X_SSP1_0, TNETV107X_SSP1_1, TNETV107X_SSP1_2, 106 TNETV107X_SSP1_0, TNETV107X_SSP1_1, TNETV107X_SSP1_2,
107 TNETV107X_SSP1_3, -1 107 TNETV107X_SSP1_3, -1
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index deee5c2da75..510648e0394 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -838,7 +838,7 @@ static const struct mux_config da830_pins[] = {
838#endif 838#endif
839}; 839};
840 840
841const short da830_emif25_pins[] __initdata = { 841const short da830_emif25_pins[] __initconst = {
842 DA830_EMA_D_0, DA830_EMA_D_1, DA830_EMA_D_2, DA830_EMA_D_3, 842 DA830_EMA_D_0, DA830_EMA_D_1, DA830_EMA_D_2, DA830_EMA_D_3,
843 DA830_EMA_D_4, DA830_EMA_D_5, DA830_EMA_D_6, DA830_EMA_D_7, 843 DA830_EMA_D_4, DA830_EMA_D_5, DA830_EMA_D_6, DA830_EMA_D_7,
844 DA830_EMA_D_8, DA830_EMA_D_9, DA830_EMA_D_10, DA830_EMA_D_11, 844 DA830_EMA_D_8, DA830_EMA_D_9, DA830_EMA_D_10, DA830_EMA_D_11,
@@ -853,19 +853,19 @@ const short da830_emif25_pins[] __initdata = {
853 -1 853 -1
854}; 854};
855 855
856const short da830_spi0_pins[] __initdata = { 856const short da830_spi0_pins[] __initconst = {
857 DA830_SPI0_SOMI_0, DA830_SPI0_SIMO_0, DA830_SPI0_CLK, DA830_NSPI0_ENA, 857 DA830_SPI0_SOMI_0, DA830_SPI0_SIMO_0, DA830_SPI0_CLK, DA830_NSPI0_ENA,
858 DA830_NSPI0_SCS_0, 858 DA830_NSPI0_SCS_0,
859 -1 859 -1
860}; 860};
861 861
862const short da830_spi1_pins[] __initdata = { 862const short da830_spi1_pins[] __initconst = {
863 DA830_SPI1_SOMI_0, DA830_SPI1_SIMO_0, DA830_SPI1_CLK, DA830_NSPI1_ENA, 863 DA830_SPI1_SOMI_0, DA830_SPI1_SIMO_0, DA830_SPI1_CLK, DA830_NSPI1_ENA,
864 DA830_NSPI1_SCS_0, 864 DA830_NSPI1_SCS_0,
865 -1 865 -1
866}; 866};
867 867
868const short da830_mmc_sd_pins[] __initdata = { 868const short da830_mmc_sd_pins[] __initconst = {
869 DA830_MMCSD_DAT_0, DA830_MMCSD_DAT_1, DA830_MMCSD_DAT_2, 869 DA830_MMCSD_DAT_0, DA830_MMCSD_DAT_1, DA830_MMCSD_DAT_2,
870 DA830_MMCSD_DAT_3, DA830_MMCSD_DAT_4, DA830_MMCSD_DAT_5, 870 DA830_MMCSD_DAT_3, DA830_MMCSD_DAT_4, DA830_MMCSD_DAT_5,
871 DA830_MMCSD_DAT_6, DA830_MMCSD_DAT_7, DA830_MMCSD_CLK, 871 DA830_MMCSD_DAT_6, DA830_MMCSD_DAT_7, DA830_MMCSD_CLK,
@@ -873,32 +873,32 @@ const short da830_mmc_sd_pins[] __initdata = {
873 -1 873 -1
874}; 874};
875 875
876const short da830_uart0_pins[] __initdata = { 876const short da830_uart0_pins[] __initconst = {
877 DA830_NUART0_CTS, DA830_NUART0_RTS, DA830_UART0_RXD, DA830_UART0_TXD, 877 DA830_NUART0_CTS, DA830_NUART0_RTS, DA830_UART0_RXD, DA830_UART0_TXD,
878 -1 878 -1
879}; 879};
880 880
881const short da830_uart1_pins[] __initdata = { 881const short da830_uart1_pins[] __initconst = {
882 DA830_UART1_RXD, DA830_UART1_TXD, 882 DA830_UART1_RXD, DA830_UART1_TXD,
883 -1 883 -1
884}; 884};
885 885
886const short da830_uart2_pins[] __initdata = { 886const short da830_uart2_pins[] __initconst = {
887 DA830_UART2_RXD, DA830_UART2_TXD, 887 DA830_UART2_RXD, DA830_UART2_TXD,
888 -1 888 -1
889}; 889};
890 890
891const short da830_usb20_pins[] __initdata = { 891const short da830_usb20_pins[] __initconst = {
892 DA830_USB0_DRVVBUS, DA830_USB_REFCLKIN, 892 DA830_USB0_DRVVBUS, DA830_USB_REFCLKIN,
893 -1 893 -1
894}; 894};
895 895
896const short da830_usb11_pins[] __initdata = { 896const short da830_usb11_pins[] __initconst = {
897 DA830_USB_REFCLKIN, 897 DA830_USB_REFCLKIN,
898 -1 898 -1
899}; 899};
900 900
901const short da830_uhpi_pins[] __initdata = { 901const short da830_uhpi_pins[] __initconst = {
902 DA830_UHPI_HD_0, DA830_UHPI_HD_1, DA830_UHPI_HD_2, DA830_UHPI_HD_3, 902 DA830_UHPI_HD_0, DA830_UHPI_HD_1, DA830_UHPI_HD_2, DA830_UHPI_HD_3,
903 DA830_UHPI_HD_4, DA830_UHPI_HD_5, DA830_UHPI_HD_6, DA830_UHPI_HD_7, 903 DA830_UHPI_HD_4, DA830_UHPI_HD_5, DA830_UHPI_HD_6, DA830_UHPI_HD_7,
904 DA830_UHPI_HD_8, DA830_UHPI_HD_9, DA830_UHPI_HD_10, DA830_UHPI_HD_11, 904 DA830_UHPI_HD_8, DA830_UHPI_HD_9, DA830_UHPI_HD_10, DA830_UHPI_HD_11,
@@ -909,14 +909,14 @@ const short da830_uhpi_pins[] __initdata = {
909 -1 909 -1
910}; 910};
911 911
912const short da830_cpgmac_pins[] __initdata = { 912const short da830_cpgmac_pins[] __initconst = {
913 DA830_RMII_TXD_0, DA830_RMII_TXD_1, DA830_RMII_TXEN, DA830_RMII_CRS_DV, 913 DA830_RMII_TXD_0, DA830_RMII_TXD_1, DA830_RMII_TXEN, DA830_RMII_CRS_DV,
914 DA830_RMII_RXD_0, DA830_RMII_RXD_1, DA830_RMII_RXER, DA830_MDIO_CLK, 914 DA830_RMII_RXD_0, DA830_RMII_RXD_1, DA830_RMII_RXER, DA830_MDIO_CLK,
915 DA830_MDIO_D, 915 DA830_MDIO_D,
916 -1 916 -1
917}; 917};
918 918
919const short da830_emif3c_pins[] __initdata = { 919const short da830_emif3c_pins[] __initconst = {
920 DA830_EMB_SDCKE, DA830_EMB_CLK_GLUE, DA830_EMB_CLK, DA830_NEMB_CS_0, 920 DA830_EMB_SDCKE, DA830_EMB_CLK_GLUE, DA830_EMB_CLK, DA830_NEMB_CS_0,
921 DA830_NEMB_CAS, DA830_NEMB_RAS, DA830_NEMB_WE, DA830_EMB_BA_1, 921 DA830_NEMB_CAS, DA830_NEMB_RAS, DA830_NEMB_WE, DA830_EMB_BA_1,
922 DA830_EMB_BA_0, DA830_EMB_A_0, DA830_EMB_A_1, DA830_EMB_A_2, 922 DA830_EMB_BA_0, DA830_EMB_A_0, DA830_EMB_A_1, DA830_EMB_A_2,
@@ -935,7 +935,7 @@ const short da830_emif3c_pins[] __initdata = {
935 -1 935 -1
936}; 936};
937 937
938const short da830_mcasp0_pins[] __initdata = { 938const short da830_mcasp0_pins[] __initconst = {
939 DA830_AHCLKX0, DA830_ACLKX0, DA830_AFSX0, 939 DA830_AHCLKX0, DA830_ACLKX0, DA830_AFSX0,
940 DA830_AHCLKR0, DA830_ACLKR0, DA830_AFSR0, DA830_AMUTE0, 940 DA830_AHCLKR0, DA830_ACLKR0, DA830_AFSR0, DA830_AMUTE0,
941 DA830_AXR0_0, DA830_AXR0_1, DA830_AXR0_2, DA830_AXR0_3, 941 DA830_AXR0_0, DA830_AXR0_1, DA830_AXR0_2, DA830_AXR0_3,
@@ -945,7 +945,7 @@ const short da830_mcasp0_pins[] __initdata = {
945 -1 945 -1
946}; 946};
947 947
948const short da830_mcasp1_pins[] __initdata = { 948const short da830_mcasp1_pins[] __initconst = {
949 DA830_AHCLKX1, DA830_ACLKX1, DA830_AFSX1, 949 DA830_AHCLKX1, DA830_ACLKX1, DA830_AFSX1,
950 DA830_AHCLKR1, DA830_ACLKR1, DA830_AFSR1, DA830_AMUTE1, 950 DA830_AHCLKR1, DA830_ACLKR1, DA830_AFSR1, DA830_AMUTE1,
951 DA830_AXR1_0, DA830_AXR1_1, DA830_AXR1_2, DA830_AXR1_3, 951 DA830_AXR1_0, DA830_AXR1_1, DA830_AXR1_2, DA830_AXR1_3,
@@ -954,24 +954,24 @@ const short da830_mcasp1_pins[] __initdata = {
954 -1 954 -1
955}; 955};
956 956
957const short da830_mcasp2_pins[] __initdata = { 957const short da830_mcasp2_pins[] __initconst = {
958 DA830_AHCLKX2, DA830_ACLKX2, DA830_AFSX2, 958 DA830_AHCLKX2, DA830_ACLKX2, DA830_AFSX2,
959 DA830_AHCLKR2, DA830_ACLKR2, DA830_AFSR2, DA830_AMUTE2, 959 DA830_AHCLKR2, DA830_ACLKR2, DA830_AFSR2, DA830_AMUTE2,
960 DA830_AXR2_0, DA830_AXR2_1, DA830_AXR2_2, DA830_AXR2_3, 960 DA830_AXR2_0, DA830_AXR2_1, DA830_AXR2_2, DA830_AXR2_3,
961 -1 961 -1
962}; 962};
963 963
964const short da830_i2c0_pins[] __initdata = { 964const short da830_i2c0_pins[] __initconst = {
965 DA830_I2C0_SDA, DA830_I2C0_SCL, 965 DA830_I2C0_SDA, DA830_I2C0_SCL,
966 -1 966 -1
967}; 967};
968 968
969const short da830_i2c1_pins[] __initdata = { 969const short da830_i2c1_pins[] __initconst = {
970 DA830_I2C1_SCL, DA830_I2C1_SDA, 970 DA830_I2C1_SCL, DA830_I2C1_SDA,
971 -1 971 -1
972}; 972};
973 973
974const short da830_lcdcntl_pins[] __initdata = { 974const short da830_lcdcntl_pins[] __initconst = {
975 DA830_LCD_D_0, DA830_LCD_D_1, DA830_LCD_D_2, DA830_LCD_D_3, 975 DA830_LCD_D_0, DA830_LCD_D_1, DA830_LCD_D_2, DA830_LCD_D_3,
976 DA830_LCD_D_4, DA830_LCD_D_5, DA830_LCD_D_6, DA830_LCD_D_7, 976 DA830_LCD_D_4, DA830_LCD_D_5, DA830_LCD_D_6, DA830_LCD_D_7,
977 DA830_LCD_D_8, DA830_LCD_D_9, DA830_LCD_D_10, DA830_LCD_D_11, 977 DA830_LCD_D_8, DA830_LCD_D_9, DA830_LCD_D_10, DA830_LCD_D_11,
@@ -981,34 +981,34 @@ const short da830_lcdcntl_pins[] __initdata = {
981 -1 981 -1
982}; 982};
983 983
984const short da830_pwm_pins[] __initdata = { 984const short da830_pwm_pins[] __initconst = {
985 DA830_ECAP0_APWM0, DA830_ECAP1_APWM1, DA830_EPWM0B, DA830_EPWM0A, 985 DA830_ECAP0_APWM0, DA830_ECAP1_APWM1, DA830_EPWM0B, DA830_EPWM0A,
986 DA830_EPWMSYNCI, DA830_EPWMSYNC0, DA830_ECAP2_APWM2, DA830_EHRPWMGLUETZ, 986 DA830_EPWMSYNCI, DA830_EPWMSYNC0, DA830_ECAP2_APWM2, DA830_EHRPWMGLUETZ,
987 DA830_EPWM2B, DA830_EPWM2A, DA830_EPWM1B, DA830_EPWM1A, 987 DA830_EPWM2B, DA830_EPWM2A, DA830_EPWM1B, DA830_EPWM1A,
988 -1 988 -1
989}; 989};
990 990
991const short da830_ecap0_pins[] __initdata = { 991const short da830_ecap0_pins[] __initconst = {
992 DA830_ECAP0_APWM0, 992 DA830_ECAP0_APWM0,
993 -1 993 -1
994}; 994};
995 995
996const short da830_ecap1_pins[] __initdata = { 996const short da830_ecap1_pins[] __initconst = {
997 DA830_ECAP1_APWM1, 997 DA830_ECAP1_APWM1,
998 -1 998 -1
999}; 999};
1000 1000
1001const short da830_ecap2_pins[] __initdata = { 1001const short da830_ecap2_pins[] __initconst = {
1002 DA830_ECAP2_APWM2, 1002 DA830_ECAP2_APWM2,
1003 -1 1003 -1
1004}; 1004};
1005 1005
1006const short da830_eqep0_pins[] __initdata = { 1006const short da830_eqep0_pins[] __initconst = {
1007 DA830_EQEP0I, DA830_EQEP0S, DA830_EQEP0A, DA830_EQEP0B, 1007 DA830_EQEP0I, DA830_EQEP0S, DA830_EQEP0A, DA830_EQEP0B,
1008 -1 1008 -1
1009}; 1009};
1010 1010
1011const short da830_eqep1_pins[] __initdata = { 1011const short da830_eqep1_pins[] __initconst = {
1012 DA830_EQEP1I, DA830_EQEP1S, DA830_EQEP1A, DA830_EQEP1B, 1012 DA830_EQEP1I, DA830_EQEP1S, DA830_EQEP1A, DA830_EQEP1B,
1013 -1 1013 -1
1014}; 1014};
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index b44dc844e15..b90c172d554 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -347,6 +347,13 @@ static struct clk spi1_clk = {
347 .flags = DA850_CLK_ASYNC3, 347 .flags = DA850_CLK_ASYNC3,
348}; 348};
349 349
350static struct clk vpif_clk = {
351 .name = "vpif",
352 .parent = &pll0_sysclk2,
353 .lpsc = DA850_LPSC1_VPIF,
354 .gpsc = 1,
355};
356
350static struct clk sata_clk = { 357static struct clk sata_clk = {
351 .name = "sata", 358 .name = "sata",
352 .parent = &pll0_sysclk2, 359 .parent = &pll0_sysclk2,
@@ -397,6 +404,7 @@ static struct clk_lookup da850_clks[] = {
397 CLK(NULL, "usb20", &usb20_clk), 404 CLK(NULL, "usb20", &usb20_clk),
398 CLK("spi_davinci.0", NULL, &spi0_clk), 405 CLK("spi_davinci.0", NULL, &spi0_clk),
399 CLK("spi_davinci.1", NULL, &spi1_clk), 406 CLK("spi_davinci.1", NULL, &spi1_clk),
407 CLK("vpif", NULL, &vpif_clk),
400 CLK("ahci", NULL, &sata_clk), 408 CLK("ahci", NULL, &sata_clk),
401 CLK(NULL, NULL, NULL), 409 CLK(NULL, NULL, NULL),
402}; 410};
@@ -573,20 +581,60 @@ static const struct mux_config da850_pins[] = {
573 MUX_CFG(DA850, GPIO6_10, 13, 20, 15, 8, false) 581 MUX_CFG(DA850, GPIO6_10, 13, 20, 15, 8, false)
574 MUX_CFG(DA850, GPIO6_13, 13, 8, 15, 8, false) 582 MUX_CFG(DA850, GPIO6_13, 13, 8, 15, 8, false)
575 MUX_CFG(DA850, RTC_ALARM, 0, 28, 15, 2, false) 583 MUX_CFG(DA850, RTC_ALARM, 0, 28, 15, 2, false)
584 /* VPIF Capture */
585 MUX_CFG(DA850, VPIF_DIN0, 15, 4, 15, 1, false)
586 MUX_CFG(DA850, VPIF_DIN1, 15, 0, 15, 1, false)
587 MUX_CFG(DA850, VPIF_DIN2, 14, 28, 15, 1, false)
588 MUX_CFG(DA850, VPIF_DIN3, 14, 24, 15, 1, false)
589 MUX_CFG(DA850, VPIF_DIN4, 14, 20, 15, 1, false)
590 MUX_CFG(DA850, VPIF_DIN5, 14, 16, 15, 1, false)
591 MUX_CFG(DA850, VPIF_DIN6, 14, 12, 15, 1, false)
592 MUX_CFG(DA850, VPIF_DIN7, 14, 8, 15, 1, false)
593 MUX_CFG(DA850, VPIF_DIN8, 16, 4, 15, 1, false)
594 MUX_CFG(DA850, VPIF_DIN9, 16, 0, 15, 1, false)
595 MUX_CFG(DA850, VPIF_DIN10, 15, 28, 15, 1, false)
596 MUX_CFG(DA850, VPIF_DIN11, 15, 24, 15, 1, false)
597 MUX_CFG(DA850, VPIF_DIN12, 15, 20, 15, 1, false)
598 MUX_CFG(DA850, VPIF_DIN13, 15, 16, 15, 1, false)
599 MUX_CFG(DA850, VPIF_DIN14, 15, 12, 15, 1, false)
600 MUX_CFG(DA850, VPIF_DIN15, 15, 8, 15, 1, false)
601 MUX_CFG(DA850, VPIF_CLKIN0, 14, 0, 15, 1, false)
602 MUX_CFG(DA850, VPIF_CLKIN1, 14, 4, 15, 1, false)
603 MUX_CFG(DA850, VPIF_CLKIN2, 19, 8, 15, 1, false)
604 MUX_CFG(DA850, VPIF_CLKIN3, 19, 16, 15, 1, false)
605 /* VPIF Display */
606 MUX_CFG(DA850, VPIF_DOUT0, 17, 4, 15, 1, false)
607 MUX_CFG(DA850, VPIF_DOUT1, 17, 0, 15, 1, false)
608 MUX_CFG(DA850, VPIF_DOUT2, 16, 28, 15, 1, false)
609 MUX_CFG(DA850, VPIF_DOUT3, 16, 24, 15, 1, false)
610 MUX_CFG(DA850, VPIF_DOUT4, 16, 20, 15, 1, false)
611 MUX_CFG(DA850, VPIF_DOUT5, 16, 16, 15, 1, false)
612 MUX_CFG(DA850, VPIF_DOUT6, 16, 12, 15, 1, false)
613 MUX_CFG(DA850, VPIF_DOUT7, 16, 8, 15, 1, false)
614 MUX_CFG(DA850, VPIF_DOUT8, 18, 4, 15, 1, false)
615 MUX_CFG(DA850, VPIF_DOUT9, 18, 0, 15, 1, false)
616 MUX_CFG(DA850, VPIF_DOUT10, 17, 28, 15, 1, false)
617 MUX_CFG(DA850, VPIF_DOUT11, 17, 24, 15, 1, false)
618 MUX_CFG(DA850, VPIF_DOUT12, 17, 20, 15, 1, false)
619 MUX_CFG(DA850, VPIF_DOUT13, 17, 16, 15, 1, false)
620 MUX_CFG(DA850, VPIF_DOUT14, 17, 12, 15, 1, false)
621 MUX_CFG(DA850, VPIF_DOUT15, 17, 8, 15, 1, false)
622 MUX_CFG(DA850, VPIF_CLKO2, 19, 12, 15, 1, false)
623 MUX_CFG(DA850, VPIF_CLKO3, 19, 20, 15, 1, false)
576#endif 624#endif
577}; 625};
578 626
579const short da850_i2c0_pins[] __initdata = { 627const short da850_i2c0_pins[] __initconst = {
580 DA850_I2C0_SDA, DA850_I2C0_SCL, 628 DA850_I2C0_SDA, DA850_I2C0_SCL,
581 -1 629 -1
582}; 630};
583 631
584const short da850_i2c1_pins[] __initdata = { 632const short da850_i2c1_pins[] __initconst = {
585 DA850_I2C1_SCL, DA850_I2C1_SDA, 633 DA850_I2C1_SCL, DA850_I2C1_SDA,
586 -1 634 -1
587}; 635};
588 636
589const short da850_lcdcntl_pins[] __initdata = { 637const short da850_lcdcntl_pins[] __initconst = {
590 DA850_LCD_D_0, DA850_LCD_D_1, DA850_LCD_D_2, DA850_LCD_D_3, 638 DA850_LCD_D_0, DA850_LCD_D_1, DA850_LCD_D_2, DA850_LCD_D_3,
591 DA850_LCD_D_4, DA850_LCD_D_5, DA850_LCD_D_6, DA850_LCD_D_7, 639 DA850_LCD_D_4, DA850_LCD_D_5, DA850_LCD_D_6, DA850_LCD_D_7,
592 DA850_LCD_D_8, DA850_LCD_D_9, DA850_LCD_D_10, DA850_LCD_D_11, 640 DA850_LCD_D_8, DA850_LCD_D_9, DA850_LCD_D_10, DA850_LCD_D_11,
@@ -595,6 +643,26 @@ const short da850_lcdcntl_pins[] __initdata = {
595 -1 643 -1
596}; 644};
597 645
646const short da850_vpif_capture_pins[] __initdata = {
647 DA850_VPIF_DIN0, DA850_VPIF_DIN1, DA850_VPIF_DIN2, DA850_VPIF_DIN3,
648 DA850_VPIF_DIN4, DA850_VPIF_DIN5, DA850_VPIF_DIN6, DA850_VPIF_DIN7,
649 DA850_VPIF_DIN8, DA850_VPIF_DIN9, DA850_VPIF_DIN10, DA850_VPIF_DIN11,
650 DA850_VPIF_DIN12, DA850_VPIF_DIN13, DA850_VPIF_DIN14, DA850_VPIF_DIN15,
651 DA850_VPIF_CLKIN0, DA850_VPIF_CLKIN1, DA850_VPIF_CLKIN2,
652 DA850_VPIF_CLKIN3,
653 -1
654};
655
656const short da850_vpif_display_pins[] __initdata = {
657 DA850_VPIF_DOUT0, DA850_VPIF_DOUT1, DA850_VPIF_DOUT2, DA850_VPIF_DOUT3,
658 DA850_VPIF_DOUT4, DA850_VPIF_DOUT5, DA850_VPIF_DOUT6, DA850_VPIF_DOUT7,
659 DA850_VPIF_DOUT8, DA850_VPIF_DOUT9, DA850_VPIF_DOUT10,
660 DA850_VPIF_DOUT11, DA850_VPIF_DOUT12, DA850_VPIF_DOUT13,
661 DA850_VPIF_DOUT14, DA850_VPIF_DOUT15, DA850_VPIF_CLKO2,
662 DA850_VPIF_CLKO3,
663 -1
664};
665
598/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */ 666/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
599static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = { 667static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = {
600 [IRQ_DA8XX_COMMTX] = 7, 668 [IRQ_DA8XX_COMMTX] = 7,
@@ -939,7 +1007,7 @@ static struct platform_device da850_cpufreq_device = {
939 1007
940unsigned int da850_max_speed = 300000; 1008unsigned int da850_max_speed = 300000;
941 1009
942int __init da850_register_cpufreq(char *async_clk) 1010int da850_register_cpufreq(char *async_clk)
943{ 1011{
944 int i; 1012 int i;
945 1013
@@ -1064,6 +1132,90 @@ no_ddrpll_mem:
1064 return ret; 1132 return ret;
1065} 1133}
1066 1134
1135/* VPIF resource, platform data */
1136static u64 da850_vpif_dma_mask = DMA_BIT_MASK(32);
1137
1138static struct resource da850_vpif_resource[] = {
1139 {
1140 .start = DA8XX_VPIF_BASE,
1141 .end = DA8XX_VPIF_BASE + 0xfff,
1142 .flags = IORESOURCE_MEM,
1143 }
1144};
1145
1146static struct platform_device da850_vpif_dev = {
1147 .name = "vpif",
1148 .id = -1,
1149 .dev = {
1150 .dma_mask = &da850_vpif_dma_mask,
1151 .coherent_dma_mask = DMA_BIT_MASK(32),
1152 },
1153 .resource = da850_vpif_resource,
1154 .num_resources = ARRAY_SIZE(da850_vpif_resource),
1155};
1156
1157static struct resource da850_vpif_display_resource[] = {
1158 {
1159 .start = IRQ_DA850_VPIFINT,
1160 .end = IRQ_DA850_VPIFINT,
1161 .flags = IORESOURCE_IRQ,
1162 },
1163};
1164
1165static struct platform_device da850_vpif_display_dev = {
1166 .name = "vpif_display",
1167 .id = -1,
1168 .dev = {
1169 .dma_mask = &da850_vpif_dma_mask,
1170 .coherent_dma_mask = DMA_BIT_MASK(32),
1171 },
1172 .resource = da850_vpif_display_resource,
1173 .num_resources = ARRAY_SIZE(da850_vpif_display_resource),
1174};
1175
1176static struct resource da850_vpif_capture_resource[] = {
1177 {
1178 .start = IRQ_DA850_VPIFINT,
1179 .end = IRQ_DA850_VPIFINT,
1180 .flags = IORESOURCE_IRQ,
1181 },
1182 {
1183 .start = IRQ_DA850_VPIFINT,
1184 .end = IRQ_DA850_VPIFINT,
1185 .flags = IORESOURCE_IRQ,
1186 },
1187};
1188
1189static struct platform_device da850_vpif_capture_dev = {
1190 .name = "vpif_capture",
1191 .id = -1,
1192 .dev = {
1193 .dma_mask = &da850_vpif_dma_mask,
1194 .coherent_dma_mask = DMA_BIT_MASK(32),
1195 },
1196 .resource = da850_vpif_capture_resource,
1197 .num_resources = ARRAY_SIZE(da850_vpif_capture_resource),
1198};
1199
1200int __init da850_register_vpif(void)
1201{
1202 return platform_device_register(&da850_vpif_dev);
1203}
1204
1205int __init da850_register_vpif_display(struct vpif_display_config
1206 *display_config)
1207{
1208 da850_vpif_display_dev.dev.platform_data = display_config;
1209 return platform_device_register(&da850_vpif_display_dev);
1210}
1211
1212int __init da850_register_vpif_capture(struct vpif_capture_config
1213 *capture_config)
1214{
1215 da850_vpif_capture_dev.dev.platform_data = capture_config;
1216 return platform_device_register(&da850_vpif_capture_dev);
1217}
1218
1067static struct davinci_soc_info davinci_soc_info_da850 = { 1219static struct davinci_soc_info davinci_soc_info_da850 = {
1068 .io_desc = da850_io_desc, 1220 .io_desc = da850_io_desc,
1069 .io_desc_num = ARRAY_SIZE(da850_io_desc), 1221 .io_desc_num = ARRAY_SIZE(da850_io_desc),
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
index 8db0fc6809d..12d544befcf 100644
--- a/arch/arm/mach-davinci/davinci.h
+++ b/arch/arm/mach-davinci/davinci.h
@@ -22,10 +22,10 @@
22#include <linux/davinci_emac.h> 22#include <linux/davinci_emac.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/spi/spi.h> 24#include <linux/spi/spi.h>
25 25#include <linux/platform_data/davinci_asp.h>
26#include <mach/asp.h> 26#include <linux/platform_data/keyscan-davinci.h>
27#include <mach/keyscan.h>
28#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/edma.h>
29 29
30#include <media/davinci/vpfe_capture.h> 30#include <media/davinci/vpfe_capture.h>
31#include <media/davinci/vpif_types.h> 31#include <media/davinci/vpif_types.h>
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 783eab6845c..bd2f72b414b 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -24,6 +24,7 @@
24#include <mach/cpuidle.h> 24#include <mach/cpuidle.h>
25 25
26#include "clock.h" 26#include "clock.h"
27#include "asp.h"
27 28
28#define DA8XX_TPCC_BASE 0x01c00000 29#define DA8XX_TPCC_BASE 0x01c00000
29#define DA8XX_TPTC0_BASE 0x01c08000 30#define DA8XX_TPTC0_BASE 0x01c08000
@@ -505,15 +506,8 @@ static struct platform_device da850_mcasp_device = {
505 .resource = da850_mcasp_resources, 506 .resource = da850_mcasp_resources,
506}; 507};
507 508
508static struct platform_device davinci_pcm_device = {
509 .name = "davinci-pcm-audio",
510 .id = -1,
511};
512
513void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata) 509void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata)
514{ 510{
515 platform_device_register(&davinci_pcm_device);
516
517 /* DA830/OMAP-L137 has 3 instances of McASP */ 511 /* DA830/OMAP-L137 has 3 instances of McASP */
518 if (cpu_is_davinci_da830() && id == 1) { 512 if (cpu_is_davinci_da830() && id == 1) {
519 da830_mcasp1_device.dev.platform_data = pdata; 513 da830_mcasp1_device.dev.platform_data = pdata;
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index d2f9666284a..4c48a36ee56 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -15,12 +15,12 @@
15#include <linux/io.h> 15#include <linux/io.h>
16 16
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <mach/i2c.h> 18#include <linux/platform_data/i2c-davinci.h>
19#include <mach/irqs.h> 19#include <mach/irqs.h>
20#include <mach/cputype.h> 20#include <mach/cputype.h>
21#include <mach/mux.h> 21#include <mach/mux.h>
22#include <mach/edma.h> 22#include <mach/edma.h>
23#include <mach/mmc.h> 23#include <linux/platform_data/mmc-davinci.h>
24#include <mach/time.h> 24#include <mach/time.h>
25 25
26#include "davinci.h" 26#include "davinci.h"
@@ -313,16 +313,6 @@ static void davinci_init_wdt(void)
313 313
314/*-------------------------------------------------------------------------*/ 314/*-------------------------------------------------------------------------*/
315 315
316static struct platform_device davinci_pcm_device = {
317 .name = "davinci-pcm-audio",
318 .id = -1,
319};
320
321static void davinci_init_pcm(void)
322{
323 platform_device_register(&davinci_pcm_device);
324}
325
326/*-------------------------------------------------------------------------*/ 316/*-------------------------------------------------------------------------*/
327 317
328struct davinci_timer_instance davinci_timer_instance[2] = { 318struct davinci_timer_instance davinci_timer_instance[2] = {
@@ -345,7 +335,6 @@ static int __init davinci_init_devices(void)
345 /* please keep these calls, and their implementations above, 335 /* please keep these calls, and their implementations above,
346 * in alphabetical order so they're easier to sort through. 336 * in alphabetical order so they're easier to sort through.
347 */ 337 */
348 davinci_init_pcm();
349 davinci_init_wdt(); 338 davinci_init_wdt();
350 339
351 return 0; 340 return 0;
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 678cd99b733..a255434908d 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -26,13 +26,13 @@
26#include <mach/time.h> 26#include <mach/time.h>
27#include <mach/serial.h> 27#include <mach/serial.h>
28#include <mach/common.h> 28#include <mach/common.h>
29#include <mach/asp.h> 29#include <linux/platform_data/spi-davinci.h>
30#include <mach/spi.h>
31#include <mach/gpio-davinci.h> 30#include <mach/gpio-davinci.h>
32 31
33#include "davinci.h" 32#include "davinci.h"
34#include "clock.h" 33#include "clock.h"
35#include "mux.h" 34#include "mux.h"
35#include "asp.h"
36 36
37#define DM355_UART2_BASE (IO_PHYS + 0x206000) 37#define DM355_UART2_BASE (IO_PHYS + 0x206000)
38 38
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index a50d49de188..b680c832e0b 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -29,14 +29,14 @@
29#include <mach/time.h> 29#include <mach/time.h>
30#include <mach/serial.h> 30#include <mach/serial.h>
31#include <mach/common.h> 31#include <mach/common.h>
32#include <mach/asp.h> 32#include <linux/platform_data/keyscan-davinci.h>
33#include <mach/keyscan.h> 33#include <linux/platform_data/spi-davinci.h>
34#include <mach/spi.h>
35#include <mach/gpio-davinci.h> 34#include <mach/gpio-davinci.h>
36 35
37#include "davinci.h" 36#include "davinci.h"
38#include "clock.h" 37#include "clock.h"
39#include "mux.h" 38#include "mux.h"
39#include "asp.h"
40 40
41#define DM365_REF_FREQ 24000000 /* 24 MHz on the DM365 EVM */ 41#define DM365_REF_FREQ 24000000 /* 24 MHz on the DM365 EVM */
42 42
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index c8b866657fc..cd0c8b1e1ec 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -23,12 +23,12 @@
23#include <mach/time.h> 23#include <mach/time.h>
24#include <mach/serial.h> 24#include <mach/serial.h>
25#include <mach/common.h> 25#include <mach/common.h>
26#include <mach/asp.h>
27#include <mach/gpio-davinci.h> 26#include <mach/gpio-davinci.h>
28 27
29#include "davinci.h" 28#include "davinci.h"
30#include "clock.h" 29#include "clock.h"
31#include "mux.h" 30#include "mux.h"
31#include "asp.h"
32 32
33/* 33/*
34 * Device specific clocks 34 * Device specific clocks
@@ -701,7 +701,7 @@ static struct resource dm644x_venc_resources[] = {
701#define DM644X_VPSS_DACCLKEN BIT(4) 701#define DM644X_VPSS_DACCLKEN BIT(4)
702 702
703static int dm644x_venc_setup_clock(enum vpbe_enc_timings_type type, 703static int dm644x_venc_setup_clock(enum vpbe_enc_timings_type type,
704 unsigned int mode) 704 unsigned int pclock)
705{ 705{
706 int ret = 0; 706 int ret = 0;
707 u32 v = DM644X_VPSS_VENCLKEN; 707 u32 v = DM644X_VPSS_VENCLKEN;
@@ -711,27 +711,18 @@ static int dm644x_venc_setup_clock(enum vpbe_enc_timings_type type,
711 v |= DM644X_VPSS_DACCLKEN; 711 v |= DM644X_VPSS_DACCLKEN;
712 writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL)); 712 writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
713 break; 713 break;
714 case VPBE_ENC_DV_PRESET: 714 case VPBE_ENC_CUSTOM_TIMINGS:
715 switch (mode) { 715 if (pclock <= 27000000) {
716 case V4L2_DV_480P59_94:
717 case V4L2_DV_576P50:
718 v |= DM644X_VPSS_MUXSEL_PLL2_MODE | 716 v |= DM644X_VPSS_MUXSEL_PLL2_MODE |
719 DM644X_VPSS_DACCLKEN; 717 DM644X_VPSS_DACCLKEN;
720 writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL)); 718 writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
721 break; 719 } else {
722 case V4L2_DV_720P60:
723 case V4L2_DV_1080I60:
724 case V4L2_DV_1080P30:
725 /* 720 /*
726 * For HD, use external clock source since 721 * For HD, use external clock source since
727 * HD requires higher clock rate 722 * HD requires higher clock rate
728 */ 723 */
729 v |= DM644X_VPSS_MUXSEL_VPBECLK_MODE; 724 v |= DM644X_VPSS_MUXSEL_VPBECLK_MODE;
730 writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL)); 725 writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
731 break;
732 default:
733 ret = -EINVAL;
734 break;
735 } 726 }
736 break; 727 break;
737 default: 728 default:
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 9eb87c1d1ed..97c0f8e555b 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -24,12 +24,12 @@
24#include <mach/time.h> 24#include <mach/time.h>
25#include <mach/serial.h> 25#include <mach/serial.h>
26#include <mach/common.h> 26#include <mach/common.h>
27#include <mach/asp.h>
28#include <mach/gpio-davinci.h> 27#include <mach/gpio-davinci.h>
29 28
30#include "davinci.h" 29#include "davinci.h"
31#include "clock.h" 30#include "clock.h"
32#include "mux.h" 31#include "mux.h"
32#include "asp.h"
33 33
34#define DAVINCI_VPIF_BASE (0x01C12000) 34#define DAVINCI_VPIF_BASE (0x01C12000)
35 35
diff --git a/arch/arm/mach-davinci/include/mach/aemif.h b/arch/arm/mach-davinci/include/mach/aemif.h
deleted file mode 100644
index 05b29344309..00000000000
--- a/arch/arm/mach-davinci/include/mach/aemif.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * TI DaVinci AEMIF support
3 *
4 * Copyright 2010 (C) Texas Instruments, Inc. http://www.ti.com/
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#ifndef _MACH_DAVINCI_AEMIF_H
11#define _MACH_DAVINCI_AEMIF_H
12
13#define NRCSR_OFFSET 0x00
14#define AWCCR_OFFSET 0x04
15#define A1CR_OFFSET 0x10
16
17#define ACR_ASIZE_MASK 0x3
18#define ACR_EW_MASK BIT(30)
19#define ACR_SS_MASK BIT(31)
20
21/* All timings in nanoseconds */
22struct davinci_aemif_timing {
23 u8 wsetup;
24 u8 wstrobe;
25 u8 whold;
26
27 u8 rsetup;
28 u8 rstrobe;
29 u8 rhold;
30
31 u8 ta;
32};
33
34int davinci_aemif_setup_timing(struct davinci_aemif_timing *t,
35 void __iomem *base, unsigned cs);
36#endif
diff --git a/arch/arm/mach-davinci/include/mach/asp.h b/arch/arm/mach-davinci/include/mach/asp.h
deleted file mode 100644
index 9aa240909a2..00000000000
--- a/arch/arm/mach-davinci/include/mach/asp.h
+++ /dev/null
@@ -1,137 +0,0 @@
1/*
2 * <mach/asp.h> - DaVinci Audio Serial Port support
3 */
4#ifndef __ASM_ARCH_DAVINCI_ASP_H
5#define __ASM_ARCH_DAVINCI_ASP_H
6
7#include <mach/irqs.h>
8#include <mach/edma.h>
9
10/* Bases of dm644x and dm355 register banks */
11#define DAVINCI_ASP0_BASE 0x01E02000
12#define DAVINCI_ASP1_BASE 0x01E04000
13
14/* Bases of dm365 register banks */
15#define DAVINCI_DM365_ASP0_BASE 0x01D02000
16
17/* Bases of dm646x register banks */
18#define DAVINCI_DM646X_MCASP0_REG_BASE 0x01D01000
19#define DAVINCI_DM646X_MCASP1_REG_BASE 0x01D01800
20
21/* Bases of da850/da830 McASP0 register banks */
22#define DAVINCI_DA8XX_MCASP0_REG_BASE 0x01D00000
23
24/* Bases of da830 McASP1 register banks */
25#define DAVINCI_DA830_MCASP1_REG_BASE 0x01D04000
26
27/* EDMA channels of dm644x and dm355 */
28#define DAVINCI_DMA_ASP0_TX 2
29#define DAVINCI_DMA_ASP0_RX 3
30#define DAVINCI_DMA_ASP1_TX 8
31#define DAVINCI_DMA_ASP1_RX 9
32
33/* EDMA channels of dm646x */
34#define DAVINCI_DM646X_DMA_MCASP0_AXEVT0 6
35#define DAVINCI_DM646X_DMA_MCASP0_AREVT0 9
36#define DAVINCI_DM646X_DMA_MCASP1_AXEVT1 12
37
38/* EDMA channels of da850/da830 McASP0 */
39#define DAVINCI_DA8XX_DMA_MCASP0_AREVT 0
40#define DAVINCI_DA8XX_DMA_MCASP0_AXEVT 1
41
42/* EDMA channels of da830 McASP1 */
43#define DAVINCI_DA830_DMA_MCASP1_AREVT 2
44#define DAVINCI_DA830_DMA_MCASP1_AXEVT 3
45
46/* Interrupts */
47#define DAVINCI_ASP0_RX_INT IRQ_MBRINT
48#define DAVINCI_ASP0_TX_INT IRQ_MBXINT
49#define DAVINCI_ASP1_RX_INT IRQ_MBRINT
50#define DAVINCI_ASP1_TX_INT IRQ_MBXINT
51
52struct snd_platform_data {
53 u32 tx_dma_offset;
54 u32 rx_dma_offset;
55 enum dma_event_q asp_chan_q; /* event queue number for ASP channel */
56 enum dma_event_q ram_chan_q; /* event queue number for RAM channel */
57 unsigned int codec_fmt;
58 /*
59 * Allowing this is more efficient and eliminates left and right swaps
60 * caused by underruns, but will swap the left and right channels
61 * when compared to previous behavior.
62 */
63 unsigned enable_channel_combine:1;
64 unsigned sram_size_playback;
65 unsigned sram_size_capture;
66
67 /*
68 * If McBSP peripheral gets the clock from an external pin,
69 * there are three chooses, that are MCBSP_CLKX, MCBSP_CLKR
70 * and MCBSP_CLKS.
71 * Depending on different hardware connections it is possible
72 * to use this setting to change the behaviour of McBSP
73 * driver. The dm365_clk_input_pin enum is available for dm365
74 */
75 int clk_input_pin;
76
77 /*
78 * This flag works when both clock and FS are outputs for the cpu
79 * and makes clock more accurate (FS is not symmetrical and the
80 * clock is very fast.
81 * The clock becoming faster is named
82 * i2s continuous serial clock (I2S_SCK) and it is an externally
83 * visible bit clock.
84 *
85 * first line : WordSelect
86 * second line : ContinuousSerialClock
87 * third line: SerialData
88 *
89 * SYMMETRICAL APPROACH:
90 * _______________________ LEFT
91 * _| RIGHT |______________________|
92 * _ _ _ _ _ _ _ _
93 * _| |_| |_ x16 _| |_| |_| |_| |_ x16 _| |_| |_
94 * _ _ _ _ _ _ _ _
95 * _/ \_/ \_ ... _/ \_/ \_/ \_/ \_ ... _/ \_/ \_
96 * \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
97 *
98 * ACCURATE CLOCK APPROACH:
99 * ______________ LEFT
100 * _| RIGHT |_______________________________|
101 * _ _ _ _ _ _ _ _ _
102 * _| |_ x16 _| |_| |_ x16 _| |_| |_| |_| |_| |_| |
103 * _ _ _ _ dummy cycles
104 * _/ \_ ... _/ \_/ \_ ... _/ \__________________
105 * \_/ \_/ \_/ \_/
106 *
107 */
108 bool i2s_accurate_sck;
109
110 /* McASP specific fields */
111 int tdm_slots;
112 u8 op_mode;
113 u8 num_serializer;
114 u8 *serial_dir;
115 u8 version;
116 u8 txnumevt;
117 u8 rxnumevt;
118};
119
120enum {
121 MCASP_VERSION_1 = 0, /* DM646x */
122 MCASP_VERSION_2, /* DA8xx/OMAPL1x */
123};
124
125enum dm365_clk_input_pin {
126 MCBSP_CLKR = 0, /* DM365 */
127 MCBSP_CLKS,
128};
129
130#define INACTIVE_MODE 0
131#define TX_MODE 1
132#define RX_MODE 2
133
134#define DAVINCI_MCASP_IIS_MODE 0
135#define DAVINCI_MCASP_DIT_MODE 1
136
137#endif /* __ASM_ARCH_DAVINCI_ASP_H */
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index a2f1f274f18..aaccdc4528f 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -16,15 +16,18 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/davinci_emac.h> 17#include <linux/davinci_emac.h>
18#include <linux/spi/spi.h> 18#include <linux/spi/spi.h>
19#include <linux/platform_data/davinci_asp.h>
20#include <linux/videodev2.h>
19 21
20#include <mach/serial.h> 22#include <mach/serial.h>
21#include <mach/edma.h> 23#include <mach/edma.h>
22#include <mach/i2c.h>
23#include <mach/asp.h>
24#include <mach/mmc.h>
25#include <mach/usb.h>
26#include <mach/pm.h> 24#include <mach/pm.h>
27#include <mach/spi.h> 25#include <linux/platform_data/i2c-davinci.h>
26#include <linux/platform_data/mmc-davinci.h>
27#include <linux/platform_data/usb-davinci.h>
28#include <linux/platform_data/spi-davinci.h>
29
30#include <media/davinci/vpif_types.h>
28 31
29extern void __iomem *da8xx_syscfg0_base; 32extern void __iomem *da8xx_syscfg0_base;
30extern void __iomem *da8xx_syscfg1_base; 33extern void __iomem *da8xx_syscfg1_base;
@@ -63,6 +66,7 @@ extern unsigned int da850_max_speed;
63#define DA8XX_PLL0_BASE 0x01c11000 66#define DA8XX_PLL0_BASE 0x01c11000
64#define DA8XX_TIMER64P0_BASE 0x01c20000 67#define DA8XX_TIMER64P0_BASE 0x01c20000
65#define DA8XX_TIMER64P1_BASE 0x01c21000 68#define DA8XX_TIMER64P1_BASE 0x01c21000
69#define DA8XX_VPIF_BASE 0x01e17000
66#define DA8XX_GPIO_BASE 0x01e26000 70#define DA8XX_GPIO_BASE 0x01e26000
67#define DA8XX_PSC1_BASE 0x01e27000 71#define DA8XX_PSC1_BASE 0x01e27000
68#define DA8XX_AEMIF_CS2_BASE 0x60000000 72#define DA8XX_AEMIF_CS2_BASE 0x60000000
@@ -92,6 +96,11 @@ int da8xx_register_cpuidle(void);
92void __iomem * __init da8xx_get_mem_ctlr(void); 96void __iomem * __init da8xx_get_mem_ctlr(void);
93int da850_register_pm(struct platform_device *pdev); 97int da850_register_pm(struct platform_device *pdev);
94int __init da850_register_sata(unsigned long refclkpn); 98int __init da850_register_sata(unsigned long refclkpn);
99int __init da850_register_vpif(void);
100int __init da850_register_vpif_display
101 (struct vpif_display_config *display_config);
102int __init da850_register_vpif_capture
103 (struct vpif_capture_config *capture_config);
95void da8xx_restart(char mode, const char *cmd); 104void da8xx_restart(char mode, const char *cmd);
96 105
97extern struct platform_device da8xx_serial_device; 106extern struct platform_device da8xx_serial_device;
@@ -126,6 +135,8 @@ extern const short da830_ecap1_pins[];
126extern const short da830_ecap2_pins[]; 135extern const short da830_ecap2_pins[];
127extern const short da830_eqep0_pins[]; 136extern const short da830_eqep0_pins[];
128extern const short da830_eqep1_pins[]; 137extern const short da830_eqep1_pins[];
138extern const short da850_vpif_capture_pins[];
139extern const short da850_vpif_display_pins[];
129 140
130extern const short da850_i2c0_pins[]; 141extern const short da850_i2c0_pins[];
131extern const short da850_i2c1_pins[]; 142extern const short da850_i2c1_pins[];
diff --git a/arch/arm/mach-davinci/include/mach/i2c.h b/arch/arm/mach-davinci/include/mach/i2c.h
deleted file mode 100644
index 2312d197dfb..00000000000
--- a/arch/arm/mach-davinci/include/mach/i2c.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * DaVinci I2C controller platform_device info
3 *
4 * Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com>
5 *
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10*/
11
12#ifndef __ASM_ARCH_I2C_H
13#define __ASM_ARCH_I2C_H
14
15/* All frequencies are expressed in kHz */
16struct davinci_i2c_platform_data {
17 unsigned int bus_freq; /* standard bus frequency (kHz) */
18 unsigned int bus_delay; /* post-transaction delay (usec) */
19 unsigned int sda_pin; /* GPIO pin ID to use for SDA */
20 unsigned int scl_pin; /* GPIO pin ID to use for SCL */
21};
22
23/* for board setup code */
24void davinci_init_i2c(struct davinci_i2c_platform_data *);
25
26#endif /* __ASM_ARCH_I2C_H */
diff --git a/arch/arm/mach-davinci/include/mach/keyscan.h b/arch/arm/mach-davinci/include/mach/keyscan.h
deleted file mode 100644
index 7a560e05bda..00000000000
--- a/arch/arm/mach-davinci/include/mach/keyscan.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * Copyright (C) 2009 Texas Instruments, Inc
3 *
4 * Author: Miguel Aguilar <miguel.aguilar@ridgerun.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 DAVINCI_KEYSCAN_H
22#define DAVINCI_KEYSCAN_H
23
24#include <linux/io.h>
25
26enum davinci_matrix_types {
27 DAVINCI_KEYSCAN_MATRIX_4X4,
28 DAVINCI_KEYSCAN_MATRIX_5X3,
29};
30
31struct davinci_ks_platform_data {
32 int (*device_enable)(struct device *dev);
33 unsigned short *keymap;
34 u32 keymapsize;
35 u8 rep:1;
36 u8 strobe;
37 u8 interval;
38 u8 matrix_type;
39};
40
41#endif
42
diff --git a/arch/arm/mach-davinci/include/mach/mmc.h b/arch/arm/mach-davinci/include/mach/mmc.h
deleted file mode 100644
index 5ba6b22ce33..00000000000
--- a/arch/arm/mach-davinci/include/mach/mmc.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * Board-specific MMC configuration
3 */
4
5#ifndef _DAVINCI_MMC_H
6#define _DAVINCI_MMC_H
7
8#include <linux/types.h>
9#include <linux/mmc/host.h>
10
11struct davinci_mmc_config {
12 /* get_cd()/get_wp() may sleep */
13 int (*get_cd)(int module);
14 int (*get_ro)(int module);
15
16 void (*set_power)(int module, bool on);
17
18 /* wires == 0 is equivalent to wires == 4 (4-bit parallel) */
19 u8 wires;
20
21 u32 max_freq;
22
23 /* any additional host capabilities: OR'd in to mmc->f_caps */
24 u32 caps;
25
26 /* Version of the MMC/SD controller */
27 u8 version;
28
29 /* Number of sg segments */
30 u8 nr_sg;
31};
32void davinci_setup_mmc(int module, struct davinci_mmc_config *config);
33
34enum {
35 MMC_CTLR_VERSION_1 = 0, /* DM644x and DM355 */
36 MMC_CTLR_VERSION_2, /* DA830 */
37};
38
39#endif
diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h
index a7e92fca32e..9e95b8a1edb 100644
--- a/arch/arm/mach-davinci/include/mach/mux.h
+++ b/arch/arm/mach-davinci/include/mach/mux.h
@@ -928,6 +928,48 @@ enum davinci_da850_index {
928 DA850_GPIO6_10, 928 DA850_GPIO6_10,
929 DA850_GPIO6_13, 929 DA850_GPIO6_13,
930 DA850_RTC_ALARM, 930 DA850_RTC_ALARM,
931
932 /* VPIF Capture */
933 DA850_VPIF_DIN0,
934 DA850_VPIF_DIN1,
935 DA850_VPIF_DIN2,
936 DA850_VPIF_DIN3,
937 DA850_VPIF_DIN4,
938 DA850_VPIF_DIN5,
939 DA850_VPIF_DIN6,
940 DA850_VPIF_DIN7,
941 DA850_VPIF_DIN8,
942 DA850_VPIF_DIN9,
943 DA850_VPIF_DIN10,
944 DA850_VPIF_DIN11,
945 DA850_VPIF_DIN12,
946 DA850_VPIF_DIN13,
947 DA850_VPIF_DIN14,
948 DA850_VPIF_DIN15,
949 DA850_VPIF_CLKIN0,
950 DA850_VPIF_CLKIN1,
951 DA850_VPIF_CLKIN2,
952 DA850_VPIF_CLKIN3,
953
954 /* VPIF Display */
955 DA850_VPIF_DOUT0,
956 DA850_VPIF_DOUT1,
957 DA850_VPIF_DOUT2,
958 DA850_VPIF_DOUT3,
959 DA850_VPIF_DOUT4,
960 DA850_VPIF_DOUT5,
961 DA850_VPIF_DOUT6,
962 DA850_VPIF_DOUT7,
963 DA850_VPIF_DOUT8,
964 DA850_VPIF_DOUT9,
965 DA850_VPIF_DOUT10,
966 DA850_VPIF_DOUT11,
967 DA850_VPIF_DOUT12,
968 DA850_VPIF_DOUT13,
969 DA850_VPIF_DOUT14,
970 DA850_VPIF_DOUT15,
971 DA850_VPIF_CLKO2,
972 DA850_VPIF_CLKO3,
931}; 973};
932 974
933enum davinci_tnetv107x_index { 975enum davinci_tnetv107x_index {
diff --git a/arch/arm/mach-davinci/include/mach/nand.h b/arch/arm/mach-davinci/include/mach/nand.h
deleted file mode 100644
index 1cf555aef89..00000000000
--- a/arch/arm/mach-davinci/include/mach/nand.h
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * mach-davinci/nand.h
3 *
4 * Copyright © 2006 Texas Instruments.
5 *
6 * Ported to 2.6.23 Copyright © 2008 by
7 * Sander Huijsen <Shuijsen@optelecom-nkf.com>
8 * Troy Kisky <troy.kisky@boundarydevices.com>
9 * Dirk Behme <Dirk.Behme@gmail.com>
10 *
11 * --------------------------------------------------------------------------
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 as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __ARCH_ARM_DAVINCI_NAND_H
29#define __ARCH_ARM_DAVINCI_NAND_H
30
31#include <linux/mtd/nand.h>
32
33#define NANDFCR_OFFSET 0x60
34#define NANDFSR_OFFSET 0x64
35#define NANDF1ECC_OFFSET 0x70
36
37/* 4-bit ECC syndrome registers */
38#define NAND_4BIT_ECC_LOAD_OFFSET 0xbc
39#define NAND_4BIT_ECC1_OFFSET 0xc0
40#define NAND_4BIT_ECC2_OFFSET 0xc4
41#define NAND_4BIT_ECC3_OFFSET 0xc8
42#define NAND_4BIT_ECC4_OFFSET 0xcc
43#define NAND_ERR_ADD1_OFFSET 0xd0
44#define NAND_ERR_ADD2_OFFSET 0xd4
45#define NAND_ERR_ERRVAL1_OFFSET 0xd8
46#define NAND_ERR_ERRVAL2_OFFSET 0xdc
47
48/* NOTE: boards don't need to use these address bits
49 * for ALE/CLE unless they support booting from NAND.
50 * They're used unless platform data overrides them.
51 */
52#define MASK_ALE 0x08
53#define MASK_CLE 0x10
54
55struct davinci_nand_pdata { /* platform_data */
56 uint32_t mask_ale;
57 uint32_t mask_cle;
58
59 /* for packages using two chipselects */
60 uint32_t mask_chipsel;
61
62 /* board's default static partition info */
63 struct mtd_partition *parts;
64 unsigned nr_parts;
65
66 /* none == NAND_ECC_NONE (strongly *not* advised!!)
67 * soft == NAND_ECC_SOFT
68 * else == NAND_ECC_HW, according to ecc_bits
69 *
70 * All DaVinci-family chips support 1-bit hardware ECC.
71 * Newer ones also support 4-bit ECC, but are awkward
72 * using it with large page chips.
73 */
74 nand_ecc_modes_t ecc_mode;
75 u8 ecc_bits;
76
77 /* e.g. NAND_BUSWIDTH_16 */
78 unsigned options;
79 /* e.g. NAND_BBT_USE_FLASH */
80 unsigned bbt_options;
81
82 /* Main and mirror bbt descriptor overrides */
83 struct nand_bbt_descr *bbt_td;
84 struct nand_bbt_descr *bbt_md;
85
86 /* Access timings */
87 struct davinci_aemif_timing *timing;
88};
89
90#endif /* __ARCH_ARM_DAVINCI_NAND_H */
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h
index 405318e35bf..40a0027838e 100644
--- a/arch/arm/mach-davinci/include/mach/psc.h
+++ b/arch/arm/mach-davinci/include/mach/psc.h
@@ -166,6 +166,7 @@
166#define DA830_LPSC1_McASP1 8 166#define DA830_LPSC1_McASP1 8
167#define DA850_LPSC1_SATA 8 167#define DA850_LPSC1_SATA 8
168#define DA830_LPSC1_McASP2 9 168#define DA830_LPSC1_McASP2 9
169#define DA850_LPSC1_VPIF 9
169#define DA8XX_LPSC1_SPI1 10 170#define DA8XX_LPSC1_SPI1 10
170#define DA8XX_LPSC1_I2C 11 171#define DA8XX_LPSC1_I2C 11
171#define DA8XX_LPSC1_UART1 12 172#define DA8XX_LPSC1_UART1 12
diff --git a/arch/arm/mach-davinci/include/mach/spi.h b/arch/arm/mach-davinci/include/mach/spi.h
deleted file mode 100644
index 7af305b3786..00000000000
--- a/arch/arm/mach-davinci/include/mach/spi.h
+++ /dev/null
@@ -1,89 +0,0 @@
1/*
2 * Copyright 2009 Texas Instruments.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#ifndef __ARCH_ARM_DAVINCI_SPI_H
20#define __ARCH_ARM_DAVINCI_SPI_H
21
22#include <mach/edma.h>
23
24#define SPI_INTERN_CS 0xFF
25
26enum {
27 SPI_VERSION_1, /* For DM355/DM365/DM6467 */
28 SPI_VERSION_2, /* For DA8xx */
29};
30
31/**
32 * davinci_spi_platform_data - Platform data for SPI master device on DaVinci
33 *
34 * @version: version of the SPI IP. Different DaVinci devices have slightly
35 * varying versions of the same IP.
36 * @num_chipselect: number of chipselects supported by this SPI master
37 * @intr_line: interrupt line used to connect the SPI IP to the ARM interrupt
38 * controller withn the SoC. Possible values are 0 and 1.
39 * @chip_sel: list of GPIOs which can act as chip-selects for the SPI.
40 * SPI_INTERN_CS denotes internal SPI chip-select. Not necessary
41 * to populate if all chip-selects are internal.
42 * @cshold_bug: set this to true if the SPI controller on your chip requires
43 * a write to CSHOLD bit in between transfers (like in DM355).
44 * @dma_event_q: DMA event queue to use if SPI_IO_TYPE_DMA is used for any
45 * device on the bus.
46 */
47struct davinci_spi_platform_data {
48 u8 version;
49 u8 num_chipselect;
50 u8 intr_line;
51 u8 *chip_sel;
52 bool cshold_bug;
53 enum dma_event_q dma_event_q;
54};
55
56/**
57 * davinci_spi_config - Per-chip-select configuration for SPI slave devices
58 *
59 * @wdelay: amount of delay between transmissions. Measured in number of
60 * SPI module clocks.
61 * @odd_parity: polarity of parity flag at the end of transmit data stream.
62 * 0 - odd parity, 1 - even parity.
63 * @parity_enable: enable transmission of parity at end of each transmit
64 * data stream.
65 * @io_type: type of IO transfer. Choose between polled, interrupt and DMA.
66 * @timer_disable: disable chip-select timers (setup and hold)
67 * @c2tdelay: chip-select setup time. Measured in number of SPI module clocks.
68 * @t2cdelay: chip-select hold time. Measured in number of SPI module clocks.
69 * @t2edelay: transmit data finished to SPI ENAn pin inactive time. Measured
70 * in number of SPI clocks.
71 * @c2edelay: chip-select active to SPI ENAn signal active time. Measured in
72 * number of SPI clocks.
73 */
74struct davinci_spi_config {
75 u8 wdelay;
76 u8 odd_parity;
77 u8 parity_enable;
78#define SPI_IO_TYPE_INTR 0
79#define SPI_IO_TYPE_POLL 1
80#define SPI_IO_TYPE_DMA 2
81 u8 io_type;
82 u8 timer_disable;
83 u8 c2tdelay;
84 u8 t2cdelay;
85 u8 t2edelay;
86 u8 c2edelay;
87};
88
89#endif /* __ARCH_ARM_DAVINCI_SPI_H */
diff --git a/arch/arm/mach-davinci/include/mach/tnetv107x.h b/arch/arm/mach-davinci/include/mach/tnetv107x.h
index 83e5926f3c4..1656a02e3ed 100644
--- a/arch/arm/mach-davinci/include/mach/tnetv107x.h
+++ b/arch/arm/mach-davinci/include/mach/tnetv107x.h
@@ -36,8 +36,8 @@
36#include <linux/input/matrix_keypad.h> 36#include <linux/input/matrix_keypad.h>
37#include <linux/mfd/ti_ssp.h> 37#include <linux/mfd/ti_ssp.h>
38 38
39#include <mach/mmc.h> 39#include <linux/platform_data/mmc-davinci.h>
40#include <mach/nand.h> 40#include <linux/platform_data/mtd-davinci.h>
41#include <mach/serial.h> 41#include <mach/serial.h>
42 42
43struct tnetv107x_device_info { 43struct tnetv107x_device_info {
diff --git a/arch/arm/mach-davinci/include/mach/usb.h b/arch/arm/mach-davinci/include/mach/usb.h
deleted file mode 100644
index e0bc4abe69c..00000000000
--- a/arch/arm/mach-davinci/include/mach/usb.h
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * USB related definitions
3 *
4 * Copyright (C) 2009 MontaVista Software, Inc. <source@mvista.com>
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#ifndef __ASM_ARCH_USB_H
12#define __ASM_ARCH_USB_H
13
14/* DA8xx CFGCHIP2 (USB 2.0 PHY Control) register bits */
15#define CFGCHIP2_PHYCLKGD (1 << 17)
16#define CFGCHIP2_VBUSSENSE (1 << 16)
17#define CFGCHIP2_RESET (1 << 15)
18#define CFGCHIP2_OTGMODE (3 << 13)
19#define CFGCHIP2_NO_OVERRIDE (0 << 13)
20#define CFGCHIP2_FORCE_HOST (1 << 13)
21#define CFGCHIP2_FORCE_DEVICE (2 << 13)
22#define CFGCHIP2_FORCE_HOST_VBUS_LOW (3 << 13)
23#define CFGCHIP2_USB1PHYCLKMUX (1 << 12)
24#define CFGCHIP2_USB2PHYCLKMUX (1 << 11)
25#define CFGCHIP2_PHYPWRDN (1 << 10)
26#define CFGCHIP2_OTGPWRDN (1 << 9)
27#define CFGCHIP2_DATPOL (1 << 8)
28#define CFGCHIP2_USB1SUSPENDM (1 << 7)
29#define CFGCHIP2_PHY_PLLON (1 << 6) /* override PLL suspend */
30#define CFGCHIP2_SESENDEN (1 << 5) /* Vsess_end comparator */
31#define CFGCHIP2_VBDTCTEN (1 << 4) /* Vbus comparator */
32#define CFGCHIP2_REFFREQ (0xf << 0)
33#define CFGCHIP2_REFFREQ_12MHZ (1 << 0)
34#define CFGCHIP2_REFFREQ_24MHZ (2 << 0)
35#define CFGCHIP2_REFFREQ_48MHZ (3 << 0)
36
37struct da8xx_ohci_root_hub;
38
39typedef void (*da8xx_ocic_handler_t)(struct da8xx_ohci_root_hub *hub,
40 unsigned port);
41
42/* Passed as the platform data to the OHCI driver */
43struct da8xx_ohci_root_hub {
44 /* Switch the port power on/off */
45 int (*set_power)(unsigned port, int on);
46 /* Read the port power status */
47 int (*get_power)(unsigned port);
48 /* Read the port over-current indicator */
49 int (*get_oci)(unsigned port);
50 /* Over-current indicator change notification (pass NULL to disable) */
51 int (*ocic_notify)(da8xx_ocic_handler_t handler);
52
53 /* Time from power on to power good (in 2 ms units) */
54 u8 potpgt;
55};
56
57void davinci_setup_usb(unsigned mA, unsigned potpgt_ms);
58
59#endif /* ifndef __ASM_ARCH_USB_H */
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
index 23d2b6d9fa6..f77b95336e2 100644
--- a/arch/arm/mach-davinci/usb.c
+++ b/arch/arm/mach-davinci/usb.c
@@ -10,7 +10,7 @@
10#include <mach/common.h> 10#include <mach/common.h>
11#include <mach/irqs.h> 11#include <mach/irqs.h>
12#include <mach/cputype.h> 12#include <mach/cputype.h>
13#include <mach/usb.h> 13#include <linux/platform_data/usb-davinci.h>
14 14
15#define DAVINCI_USB_OTG_BASE 0x01c64000 15#define DAVINCI_USB_OTG_BASE 0x01c64000
16 16
diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig
index dd937c526a4..00154e74ce6 100644
--- a/arch/arm/mach-dove/Kconfig
+++ b/arch/arm/mach-dove/Kconfig
@@ -15,6 +15,13 @@ config MACH_CM_A510
15 Say 'Y' here if you want your kernel to support the 15 Say 'Y' here if you want your kernel to support the
16 CompuLab CM-A510 Board. 16 CompuLab CM-A510 Board.
17 17
18config MACH_DOVE_DT
19 bool "Marvell Dove Flattened Device Tree"
20 select USE_OF
21 help
22 Say 'Y' here if you want your kernel to support the
23 Marvell Dove using flattened device tree.
24
18endmenu 25endmenu
19 26
20endif 27endif
diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile
index fa0f0185606..5e683baf96c 100644
--- a/arch/arm/mach-dove/Makefile
+++ b/arch/arm/mach-dove/Makefile
@@ -1,4 +1,4 @@
1obj-y += common.o addr-map.o irq.o pcie.o mpp.o 1obj-y += common.o addr-map.o irq.o mpp.o
2 2obj-$(CONFIG_PCI) += pcie.o
3obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o 3obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o
4obj-$(CONFIG_MACH_CM_A510) += cm-a510.o 4obj-$(CONFIG_MACH_CM_A510) += cm-a510.o
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 6321567d8ea..b37bef1d5ff 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -16,6 +16,8 @@
16#include <linux/clk-provider.h> 16#include <linux/clk-provider.h>
17#include <linux/ata_platform.h> 17#include <linux/ata_platform.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/of.h>
20#include <linux/of_platform.h>
19#include <asm/page.h> 21#include <asm/page.h>
20#include <asm/setup.h> 22#include <asm/setup.h>
21#include <asm/timex.h> 23#include <asm/timex.h>
@@ -24,41 +26,30 @@
24#include <asm/mach/time.h> 26#include <asm/mach/time.h>
25#include <asm/mach/pci.h> 27#include <asm/mach/pci.h>
26#include <mach/dove.h> 28#include <mach/dove.h>
29#include <mach/pm.h>
27#include <mach/bridge-regs.h> 30#include <mach/bridge-regs.h>
28#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
29#include <linux/irq.h> 32#include <linux/irq.h>
30#include <plat/time.h> 33#include <plat/time.h>
31#include <plat/ehci-orion.h> 34#include <linux/platform_data/usb-ehci-orion.h>
32#include <plat/common.h> 35#include <plat/common.h>
33#include <plat/addr-map.h> 36#include <plat/addr-map.h>
34#include "common.h" 37#include "common.h"
35 38
36static int get_tclk(void);
37
38/***************************************************************************** 39/*****************************************************************************
39 * I/O Address Mapping 40 * I/O Address Mapping
40 ****************************************************************************/ 41 ****************************************************************************/
41static struct map_desc dove_io_desc[] __initdata = { 42static struct map_desc dove_io_desc[] __initdata = {
42 { 43 {
43 .virtual = DOVE_SB_REGS_VIRT_BASE, 44 .virtual = (unsigned long) DOVE_SB_REGS_VIRT_BASE,
44 .pfn = __phys_to_pfn(DOVE_SB_REGS_PHYS_BASE), 45 .pfn = __phys_to_pfn(DOVE_SB_REGS_PHYS_BASE),
45 .length = DOVE_SB_REGS_SIZE, 46 .length = DOVE_SB_REGS_SIZE,
46 .type = MT_DEVICE, 47 .type = MT_DEVICE,
47 }, { 48 }, {
48 .virtual = DOVE_NB_REGS_VIRT_BASE, 49 .virtual = (unsigned long) DOVE_NB_REGS_VIRT_BASE,
49 .pfn = __phys_to_pfn(DOVE_NB_REGS_PHYS_BASE), 50 .pfn = __phys_to_pfn(DOVE_NB_REGS_PHYS_BASE),
50 .length = DOVE_NB_REGS_SIZE, 51 .length = DOVE_NB_REGS_SIZE,
51 .type = MT_DEVICE, 52 .type = MT_DEVICE,
52 }, {
53 .virtual = DOVE_PCIE0_IO_VIRT_BASE,
54 .pfn = __phys_to_pfn(DOVE_PCIE0_IO_PHYS_BASE),
55 .length = DOVE_PCIE0_IO_SIZE,
56 .type = MT_DEVICE,
57 }, {
58 .virtual = DOVE_PCIE1_IO_VIRT_BASE,
59 .pfn = __phys_to_pfn(DOVE_PCIE1_IO_PHYS_BASE),
60 .length = DOVE_PCIE1_IO_SIZE,
61 .type = MT_DEVICE,
62 }, 53 },
63}; 54};
64 55
@@ -70,14 +61,69 @@ void __init dove_map_io(void)
70/***************************************************************************** 61/*****************************************************************************
71 * CLK tree 62 * CLK tree
72 ****************************************************************************/ 63 ****************************************************************************/
64static int dove_tclk;
65
66static DEFINE_SPINLOCK(gating_lock);
73static struct clk *tclk; 67static struct clk *tclk;
74 68
75static void __init clk_init(void) 69static struct clk __init *dove_register_gate(const char *name,
70 const char *parent, u8 bit_idx)
76{ 71{
77 tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT, 72 return clk_register_gate(NULL, name, parent, 0,
78 get_tclk()); 73 (void __iomem *)CLOCK_GATING_CONTROL,
74 bit_idx, 0, &gating_lock);
75}
79 76
80 orion_clkdev_init(tclk); 77static void __init dove_clk_init(void)
78{
79 struct clk *usb0, *usb1, *sata, *pex0, *pex1, *sdio0, *sdio1;
80 struct clk *nand, *camera, *i2s0, *i2s1, *crypto, *ac97, *pdma;
81 struct clk *xor0, *xor1, *ge, *gephy;
82
83 tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT,
84 dove_tclk);
85
86 usb0 = dove_register_gate("usb0", "tclk", CLOCK_GATING_BIT_USB0);
87 usb1 = dove_register_gate("usb1", "tclk", CLOCK_GATING_BIT_USB1);
88 sata = dove_register_gate("sata", "tclk", CLOCK_GATING_BIT_SATA);
89 pex0 = dove_register_gate("pex0", "tclk", CLOCK_GATING_BIT_PCIE0);
90 pex1 = dove_register_gate("pex1", "tclk", CLOCK_GATING_BIT_PCIE1);
91 sdio0 = dove_register_gate("sdio0", "tclk", CLOCK_GATING_BIT_SDIO0);
92 sdio1 = dove_register_gate("sdio1", "tclk", CLOCK_GATING_BIT_SDIO1);
93 nand = dove_register_gate("nand", "tclk", CLOCK_GATING_BIT_NAND);
94 camera = dove_register_gate("camera", "tclk", CLOCK_GATING_BIT_CAMERA);
95 i2s0 = dove_register_gate("i2s0", "tclk", CLOCK_GATING_BIT_I2S0);
96 i2s1 = dove_register_gate("i2s1", "tclk", CLOCK_GATING_BIT_I2S1);
97 crypto = dove_register_gate("crypto", "tclk", CLOCK_GATING_BIT_CRYPTO);
98 ac97 = dove_register_gate("ac97", "tclk", CLOCK_GATING_BIT_AC97);
99 pdma = dove_register_gate("pdma", "tclk", CLOCK_GATING_BIT_PDMA);
100 xor0 = dove_register_gate("xor0", "tclk", CLOCK_GATING_BIT_XOR0);
101 xor1 = dove_register_gate("xor1", "tclk", CLOCK_GATING_BIT_XOR1);
102 gephy = dove_register_gate("gephy", "tclk", CLOCK_GATING_BIT_GIGA_PHY);
103 ge = dove_register_gate("ge", "gephy", CLOCK_GATING_BIT_GBE);
104
105 orion_clkdev_add(NULL, "orion_spi.0", tclk);
106 orion_clkdev_add(NULL, "orion_spi.1", tclk);
107 orion_clkdev_add(NULL, "orion_wdt", tclk);
108 orion_clkdev_add(NULL, "mv64xxx_i2c.0", tclk);
109
110 orion_clkdev_add(NULL, "orion-ehci.0", usb0);
111 orion_clkdev_add(NULL, "orion-ehci.1", usb1);
112 orion_clkdev_add(NULL, "mv643xx_eth.0", ge);
113 orion_clkdev_add("0", "sata_mv.0", sata);
114 orion_clkdev_add("0", "pcie", pex0);
115 orion_clkdev_add("1", "pcie", pex1);
116 orion_clkdev_add(NULL, "sdhci-dove.0", sdio0);
117 orion_clkdev_add(NULL, "sdhci-dove.1", sdio1);
118 orion_clkdev_add(NULL, "orion_nand", nand);
119 orion_clkdev_add(NULL, "cafe1000-ccic.0", camera);
120 orion_clkdev_add(NULL, "kirkwood-i2s.0", i2s0);
121 orion_clkdev_add(NULL, "kirkwood-i2s.1", i2s1);
122 orion_clkdev_add(NULL, "mv_crypto", crypto);
123 orion_clkdev_add(NULL, "dove-ac97", ac97);
124 orion_clkdev_add(NULL, "dove-pdma", pdma);
125 orion_clkdev_add(NULL, "mv_xor_shared.0", xor0);
126 orion_clkdev_add(NULL, "mv_xor_shared.1", xor1);
81} 127}
82 128
83/***************************************************************************** 129/*****************************************************************************
@@ -188,16 +234,16 @@ void __init dove_init_early(void)
188 orion_time_set_base(TIMER_VIRT_BASE); 234 orion_time_set_base(TIMER_VIRT_BASE);
189} 235}
190 236
191static int get_tclk(void) 237static int __init dove_find_tclk(void)
192{ 238{
193 /* use DOVE_RESET_SAMPLE_HI/LO to detect tclk */
194 return 166666667; 239 return 166666667;
195} 240}
196 241
197static void __init dove_timer_init(void) 242static void __init dove_timer_init(void)
198{ 243{
244 dove_tclk = dove_find_tclk();
199 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR, 245 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
200 IRQ_DOVE_BRIDGE, get_tclk()); 246 IRQ_DOVE_BRIDGE, dove_tclk);
201} 247}
202 248
203struct sys_timer dove_timer = { 249struct sys_timer dove_timer = {
@@ -205,6 +251,15 @@ struct sys_timer dove_timer = {
205}; 251};
206 252
207/***************************************************************************** 253/*****************************************************************************
254 * Cryptographic Engines and Security Accelerator (CESA)
255 ****************************************************************************/
256void __init dove_crypto_init(void)
257{
258 orion_crypto_init(DOVE_CRYPT_PHYS_BASE, DOVE_CESA_PHYS_BASE,
259 DOVE_CESA_SIZE, IRQ_DOVE_CRYPTO);
260}
261
262/*****************************************************************************
208 * XOR 0 263 * XOR 0
209 ****************************************************************************/ 264 ****************************************************************************/
210void __init dove_xor0_init(void) 265void __init dove_xor0_init(void)
@@ -285,16 +340,16 @@ void __init dove_sdio1_init(void)
285 340
286void __init dove_init(void) 341void __init dove_init(void)
287{ 342{
288 printk(KERN_INFO "Dove 88AP510 SoC, "); 343 pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
289 printk(KERN_INFO "TCLK = %dMHz\n", (get_tclk() + 499999) / 1000000); 344 (dove_tclk + 499999) / 1000000);
290 345
291#ifdef CONFIG_CACHE_TAUROS2 346#ifdef CONFIG_CACHE_TAUROS2
292 tauros2_init(); 347 tauros2_init(0);
293#endif 348#endif
294 dove_setup_cpu_mbus(); 349 dove_setup_cpu_mbus();
295 350
296 /* Setup root of clk tree */ 351 /* Setup root of clk tree */
297 clk_init(); 352 dove_clk_init();
298 353
299 /* internal devices that every board has */ 354 /* internal devices that every board has */
300 dove_rtc_init(); 355 dove_rtc_init();
@@ -317,3 +372,67 @@ void dove_restart(char mode, const char *cmd)
317 while (1) 372 while (1)
318 ; 373 ;
319} 374}
375
376#if defined(CONFIG_MACH_DOVE_DT)
377/*
378 * Auxdata required until real OF clock provider
379 */
380struct of_dev_auxdata dove_auxdata_lookup[] __initdata = {
381 OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
382 OF_DEV_AUXDATA("marvell,orion-spi", 0xf1014600, "orion_spi.1", NULL),
383 OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
384 OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
385 NULL),
386 OF_DEV_AUXDATA("marvell,orion-sata", 0xf10a0000, "sata_mv.0", NULL),
387 OF_DEV_AUXDATA("marvell,dove-sdhci", 0xf1092000, "sdhci-dove.0", NULL),
388 OF_DEV_AUXDATA("marvell,dove-sdhci", 0xf1090000, "sdhci-dove.1", NULL),
389 {},
390};
391
392static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
393 .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
394};
395
396static void __init dove_dt_init(void)
397{
398 pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
399 (dove_tclk + 499999) / 1000000);
400
401#ifdef CONFIG_CACHE_TAUROS2
402 tauros2_init();
403#endif
404 dove_setup_cpu_mbus();
405
406 /* Setup root of clk tree */
407 dove_clk_init();
408
409 /* Internal devices not ported to DT yet */
410 dove_rtc_init();
411 dove_xor0_init();
412 dove_xor1_init();
413
414 dove_ge00_init(&dove_dt_ge00_data);
415 dove_ehci0_init();
416 dove_ehci1_init();
417 dove_pcie_init(1, 1);
418 dove_crypto_init();
419
420 of_platform_populate(NULL, of_default_bus_match_table,
421 dove_auxdata_lookup, NULL);
422}
423
424static const char * const dove_dt_board_compat[] = {
425 "marvell,dove",
426 NULL
427};
428
429DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
430 .map_io = dove_map_io,
431 .init_early = dove_init_early,
432 .init_irq = orion_dt_init_irq,
433 .timer = &dove_timer,
434 .init_machine = dove_dt_init,
435 .restart = dove_restart,
436 .dt_compat = dove_dt_board_compat,
437MACHINE_END
438#endif
diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
index 6432a3ba864..1a233404b73 100644
--- a/arch/arm/mach-dove/common.h
+++ b/arch/arm/mach-dove/common.h
@@ -26,7 +26,11 @@ void dove_init_irq(void);
26void dove_setup_cpu_mbus(void); 26void dove_setup_cpu_mbus(void);
27void dove_ge00_init(struct mv643xx_eth_platform_data *eth_data); 27void dove_ge00_init(struct mv643xx_eth_platform_data *eth_data);
28void dove_sata_init(struct mv_sata_platform_data *sata_data); 28void dove_sata_init(struct mv_sata_platform_data *sata_data);
29#ifdef CONFIG_PCI
29void dove_pcie_init(int init_port0, int init_port1); 30void dove_pcie_init(int init_port0, int init_port1);
31#else
32static inline void dove_pcie_init(int init_port0, int init_port1) { }
33#endif
30void dove_ehci0_init(void); 34void dove_ehci0_init(void);
31void dove_ehci1_init(void); 35void dove_ehci1_init(void);
32void dove_uart0_init(void); 36void dove_uart0_init(void);
diff --git a/arch/arm/mach-dove/include/mach/bridge-regs.h b/arch/arm/mach-dove/include/mach/bridge-regs.h
index f953bb54aa9..99f259e8cf3 100644
--- a/arch/arm/mach-dove/include/mach/bridge-regs.h
+++ b/arch/arm/mach-dove/include/mach/bridge-regs.h
@@ -13,22 +13,22 @@
13 13
14#include <mach/dove.h> 14#include <mach/dove.h>
15 15
16#define CPU_CONFIG (BRIDGE_VIRT_BASE | 0x0000) 16#define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0000)
17 17
18#define CPU_CONTROL (BRIDGE_VIRT_BASE | 0x0104) 18#define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104)
19#define CPU_CTRL_PCIE0_LINK 0x00000001 19#define CPU_CTRL_PCIE0_LINK 0x00000001
20#define CPU_RESET 0x00000002 20#define CPU_RESET 0x00000002
21#define CPU_CTRL_PCIE1_LINK 0x00000008 21#define CPU_CTRL_PCIE1_LINK 0x00000008
22 22
23#define RSTOUTn_MASK (BRIDGE_VIRT_BASE | 0x0108) 23#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
24#define SOFT_RESET_OUT_EN 0x00000004 24#define SOFT_RESET_OUT_EN 0x00000004
25 25
26#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c) 26#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
27#define SOFT_RESET 0x00000001 27#define SOFT_RESET 0x00000001
28 28
29#define BRIDGE_INT_TIMER1_CLR (~0x0004) 29#define BRIDGE_INT_TIMER1_CLR (~0x0004)
30 30
31#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200) 31#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE + 0x0200)
32#define IRQ_CAUSE_LOW_OFF 0x0000 32#define IRQ_CAUSE_LOW_OFF 0x0000
33#define IRQ_MASK_LOW_OFF 0x0004 33#define IRQ_MASK_LOW_OFF 0x0004
34#define FIQ_MASK_LOW_OFF 0x0008 34#define FIQ_MASK_LOW_OFF 0x0008
@@ -47,9 +47,9 @@
47#define ENDPOINT_MASK_HIGH (IRQ_VIRT_BASE + ENDPOINT_MASK_HIGH_OFF) 47#define ENDPOINT_MASK_HIGH (IRQ_VIRT_BASE + ENDPOINT_MASK_HIGH_OFF)
48#define PCIE_INTERRUPT_MASK (IRQ_VIRT_BASE + PCIE_INTERRUPT_MASK_OFF) 48#define PCIE_INTERRUPT_MASK (IRQ_VIRT_BASE + PCIE_INTERRUPT_MASK_OFF)
49 49
50#define POWER_MANAGEMENT (BRIDGE_VIRT_BASE | 0x011c) 50#define POWER_MANAGEMENT (BRIDGE_VIRT_BASE + 0x011c)
51 51
52#define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0300) 52#define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE + 0x0300)
53#define TIMER_PHYS_BASE (BRIDGE_PHYS_BASE | 0x0300) 53#define TIMER_PHYS_BASE (BRIDGE_PHYS_BASE + 0x0300)
54 54
55#endif 55#endif
diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h
index d52b0ef313b..661725e3115 100644
--- a/arch/arm/mach-dove/include/mach/dove.h
+++ b/arch/arm/mach-dove/include/mach/dove.h
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#define DOVE_CESA_PHYS_BASE 0xc8000000 27#define DOVE_CESA_PHYS_BASE 0xc8000000
28#define DOVE_CESA_VIRT_BASE 0xfdb00000 28#define DOVE_CESA_VIRT_BASE IOMEM(0xfdb00000)
29#define DOVE_CESA_SIZE SZ_1M 29#define DOVE_CESA_SIZE SZ_1M
30 30
31#define DOVE_PCIE0_MEM_PHYS_BASE 0xe0000000 31#define DOVE_PCIE0_MEM_PHYS_BASE 0xe0000000
@@ -38,101 +38,99 @@
38#define DOVE_BOOTROM_SIZE SZ_128M 38#define DOVE_BOOTROM_SIZE SZ_128M
39 39
40#define DOVE_SCRATCHPAD_PHYS_BASE 0xf0000000 40#define DOVE_SCRATCHPAD_PHYS_BASE 0xf0000000
41#define DOVE_SCRATCHPAD_VIRT_BASE 0xfdd00000 41#define DOVE_SCRATCHPAD_VIRT_BASE IOMEM(0xfdd00000)
42#define DOVE_SCRATCHPAD_SIZE SZ_1M 42#define DOVE_SCRATCHPAD_SIZE SZ_1M
43 43
44#define DOVE_SB_REGS_PHYS_BASE 0xf1000000 44#define DOVE_SB_REGS_PHYS_BASE 0xf1000000
45#define DOVE_SB_REGS_VIRT_BASE 0xfde00000 45#define DOVE_SB_REGS_VIRT_BASE IOMEM(0xfde00000)
46#define DOVE_SB_REGS_SIZE SZ_8M 46#define DOVE_SB_REGS_SIZE SZ_8M
47 47
48#define DOVE_NB_REGS_PHYS_BASE 0xf1800000 48#define DOVE_NB_REGS_PHYS_BASE 0xf1800000
49#define DOVE_NB_REGS_VIRT_BASE 0xfe600000 49#define DOVE_NB_REGS_VIRT_BASE IOMEM(0xfe600000)
50#define DOVE_NB_REGS_SIZE SZ_8M 50#define DOVE_NB_REGS_SIZE SZ_8M
51 51
52#define DOVE_PCIE0_IO_PHYS_BASE 0xf2000000 52#define DOVE_PCIE0_IO_PHYS_BASE 0xf2000000
53#define DOVE_PCIE0_IO_VIRT_BASE 0xfee00000
54#define DOVE_PCIE0_IO_BUS_BASE 0x00000000 53#define DOVE_PCIE0_IO_BUS_BASE 0x00000000
55#define DOVE_PCIE0_IO_SIZE SZ_1M 54#define DOVE_PCIE0_IO_SIZE SZ_64K
56 55
57#define DOVE_PCIE1_IO_PHYS_BASE 0xf2100000 56#define DOVE_PCIE1_IO_PHYS_BASE 0xf2100000
58#define DOVE_PCIE1_IO_VIRT_BASE 0xfef00000 57#define DOVE_PCIE1_IO_BUS_BASE 0x00010000
59#define DOVE_PCIE1_IO_BUS_BASE 0x00100000 58#define DOVE_PCIE1_IO_SIZE SZ_64K
60#define DOVE_PCIE1_IO_SIZE SZ_1M
61 59
62/* 60/*
63 * Dove Core Registers Map 61 * Dove Core Registers Map
64 */ 62 */
65 63
66/* SPI, I2C, UART */ 64/* SPI, I2C, UART */
67#define DOVE_I2C_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x11000) 65#define DOVE_I2C_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x11000)
68#define DOVE_UART0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x12000) 66#define DOVE_UART0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x12000)
69#define DOVE_UART0_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x12000) 67#define DOVE_UART0_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x12000)
70#define DOVE_UART1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x12100) 68#define DOVE_UART1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x12100)
71#define DOVE_UART1_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x12100) 69#define DOVE_UART1_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x12100)
72#define DOVE_UART2_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x12200) 70#define DOVE_UART2_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x12200)
73#define DOVE_UART2_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x12200) 71#define DOVE_UART2_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x12200)
74#define DOVE_UART3_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x12300) 72#define DOVE_UART3_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x12300)
75#define DOVE_UART3_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x12300) 73#define DOVE_UART3_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x12300)
76#define DOVE_SPI0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x10600) 74#define DOVE_SPI0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x10600)
77#define DOVE_SPI1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x14600) 75#define DOVE_SPI1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x14600)
78 76
79/* North-South Bridge */ 77/* North-South Bridge */
80#define BRIDGE_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x20000) 78#define BRIDGE_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x20000)
81#define BRIDGE_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x20000) 79#define BRIDGE_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x20000)
82 80
83/* Cryptographic Engine */ 81/* Cryptographic Engine */
84#define DOVE_CRYPT_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x30000) 82#define DOVE_CRYPT_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x30000)
85 83
86/* PCIe 0 */ 84/* PCIe 0 */
87#define DOVE_PCIE0_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x40000) 85#define DOVE_PCIE0_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x40000)
88 86
89/* USB */ 87/* USB */
90#define DOVE_USB0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x50000) 88#define DOVE_USB0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x50000)
91#define DOVE_USB1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x51000) 89#define DOVE_USB1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x51000)
92 90
93/* XOR 0 Engine */ 91/* XOR 0 Engine */
94#define DOVE_XOR0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x60800) 92#define DOVE_XOR0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x60800)
95#define DOVE_XOR0_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x60800) 93#define DOVE_XOR0_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x60800)
96#define DOVE_XOR0_HIGH_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x60A00) 94#define DOVE_XOR0_HIGH_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x60A00)
97#define DOVE_XOR0_HIGH_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x60A00) 95#define DOVE_XOR0_HIGH_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x60A00)
98 96
99/* XOR 1 Engine */ 97/* XOR 1 Engine */
100#define DOVE_XOR1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x60900) 98#define DOVE_XOR1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x60900)
101#define DOVE_XOR1_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x60900) 99#define DOVE_XOR1_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x60900)
102#define DOVE_XOR1_HIGH_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x60B00) 100#define DOVE_XOR1_HIGH_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x60B00)
103#define DOVE_XOR1_HIGH_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x60B00) 101#define DOVE_XOR1_HIGH_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x60B00)
104 102
105/* Gigabit Ethernet */ 103/* Gigabit Ethernet */
106#define DOVE_GE00_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x70000) 104#define DOVE_GE00_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x70000)
107 105
108/* PCIe 1 */ 106/* PCIe 1 */
109#define DOVE_PCIE1_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x80000) 107#define DOVE_PCIE1_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x80000)
110 108
111/* CAFE */ 109/* CAFE */
112#define DOVE_SDIO0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x92000) 110#define DOVE_SDIO0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x92000)
113#define DOVE_SDIO1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x90000) 111#define DOVE_SDIO1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x90000)
114#define DOVE_CAM_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x94000) 112#define DOVE_CAM_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x94000)
115#define DOVE_CAFE_WIN_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x98000) 113#define DOVE_CAFE_WIN_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x98000)
116 114
117/* SATA */ 115/* SATA */
118#define DOVE_SATA_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xa0000) 116#define DOVE_SATA_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0xa0000)
119 117
120/* I2S/SPDIF */ 118/* I2S/SPDIF */
121#define DOVE_AUD0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xb0000) 119#define DOVE_AUD0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0xb0000)
122#define DOVE_AUD1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xb4000) 120#define DOVE_AUD1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0xb4000)
123 121
124/* NAND Flash Controller */ 122/* NAND Flash Controller */
125#define DOVE_NFC_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xc0000) 123#define DOVE_NFC_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0xc0000)
126 124
127/* MPP, GPIO, Reset Sampling */ 125/* MPP, GPIO, Reset Sampling */
128#define DOVE_MPP_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0200) 126#define DOVE_MPP_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0xd0200)
129#define DOVE_PMU_MPP_GENERAL_CTRL (DOVE_MPP_VIRT_BASE + 0x10) 127#define DOVE_PMU_MPP_GENERAL_CTRL (DOVE_MPP_VIRT_BASE + 0x10)
130#define DOVE_RESET_SAMPLE_LO (DOVE_MPP_VIRT_BASE | 0x014) 128#define DOVE_RESET_SAMPLE_LO (DOVE_MPP_VIRT_BASE + 0x014)
131#define DOVE_RESET_SAMPLE_HI (DOVE_MPP_VIRT_BASE | 0x018) 129#define DOVE_RESET_SAMPLE_HI (DOVE_MPP_VIRT_BASE + 0x018)
132#define DOVE_GPIO_LO_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0400) 130#define DOVE_GPIO_LO_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0xd0400)
133#define DOVE_GPIO_HI_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0420) 131#define DOVE_GPIO_HI_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0xd0420)
134#define DOVE_GPIO2_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe8400) 132#define DOVE_GPIO2_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0xe8400)
135#define DOVE_MPP_GENERAL_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe803c) 133#define DOVE_MPP_GENERAL_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0xe803c)
136#define DOVE_AU1_SPDIFO_GPIO_EN (1 << 1) 134#define DOVE_AU1_SPDIFO_GPIO_EN (1 << 1)
137#define DOVE_NAND_GPIO_EN (1 << 0) 135#define DOVE_NAND_GPIO_EN (1 << 0)
138#define DOVE_MPP_CTRL4_VIRT_BASE (DOVE_GPIO_LO_VIRT_BASE + 0x40) 136#define DOVE_MPP_CTRL4_VIRT_BASE (DOVE_GPIO_LO_VIRT_BASE + 0x40)
@@ -144,44 +142,44 @@
144#define DOVE_SD0_GPIO_SEL (1 << 0) 142#define DOVE_SD0_GPIO_SEL (1 << 0)
145 143
146/* Power Management */ 144/* Power Management */
147#define DOVE_PMU_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0000) 145#define DOVE_PMU_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0xd0000)
148#define DOVE_PMU_SIG_CTRL (DOVE_PMU_VIRT_BASE + 0x802c) 146#define DOVE_PMU_SIG_CTRL (DOVE_PMU_VIRT_BASE + 0x802c)
149 147
150/* Real Time Clock */ 148/* Real Time Clock */
151#define DOVE_RTC_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xd8500) 149#define DOVE_RTC_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0xd8500)
152 150
153/* AC97 */ 151/* AC97 */
154#define DOVE_AC97_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xe0000) 152#define DOVE_AC97_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0xe0000)
155#define DOVE_AC97_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe0000) 153#define DOVE_AC97_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0xe0000)
156 154
157/* Peripheral DMA */ 155/* Peripheral DMA */
158#define DOVE_PDMA_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xe4000) 156#define DOVE_PDMA_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0xe4000)
159#define DOVE_PDMA_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe4000) 157#define DOVE_PDMA_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0xe4000)
160 158
161#define DOVE_GLOBAL_CONFIG_1 (DOVE_SB_REGS_VIRT_BASE | 0xe802C) 159#define DOVE_GLOBAL_CONFIG_1 (DOVE_SB_REGS_VIRT_BASE + 0xe802C)
162#define DOVE_TWSI_ENABLE_OPTION1 (1 << 7) 160#define DOVE_TWSI_ENABLE_OPTION1 (1 << 7)
163#define DOVE_GLOBAL_CONFIG_2 (DOVE_SB_REGS_VIRT_BASE | 0xe8030) 161#define DOVE_GLOBAL_CONFIG_2 (DOVE_SB_REGS_VIRT_BASE + 0xe8030)
164#define DOVE_TWSI_ENABLE_OPTION2 (1 << 20) 162#define DOVE_TWSI_ENABLE_OPTION2 (1 << 20)
165#define DOVE_TWSI_ENABLE_OPTION3 (1 << 21) 163#define DOVE_TWSI_ENABLE_OPTION3 (1 << 21)
166#define DOVE_TWSI_OPTION3_GPIO (1 << 22) 164#define DOVE_TWSI_OPTION3_GPIO (1 << 22)
167#define DOVE_SSP_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xec000) 165#define DOVE_SSP_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0xec000)
168#define DOVE_SSP_CTRL_STATUS_1 (DOVE_SB_REGS_VIRT_BASE | 0xe8034) 166#define DOVE_SSP_CTRL_STATUS_1 (DOVE_SB_REGS_VIRT_BASE + 0xe8034)
169#define DOVE_SSP_ON_AU1 (1 << 0) 167#define DOVE_SSP_ON_AU1 (1 << 0)
170#define DOVE_SSP_CLOCK_ENABLE (1 << 1) 168#define DOVE_SSP_CLOCK_ENABLE (1 << 1)
171#define DOVE_SSP_BPB_CLOCK_SRC_SSP (1 << 11) 169#define DOVE_SSP_BPB_CLOCK_SRC_SSP (1 << 11)
172/* Memory Controller */ 170/* Memory Controller */
173#define DOVE_MC_VIRT_BASE (DOVE_NB_REGS_VIRT_BASE | 0x00000) 171#define DOVE_MC_VIRT_BASE (DOVE_NB_REGS_VIRT_BASE + 0x00000)
174 172
175/* LCD Controller */ 173/* LCD Controller */
176#define DOVE_LCD_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x10000) 174#define DOVE_LCD_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE + 0x10000)
177#define DOVE_LCD1_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x20000) 175#define DOVE_LCD1_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE + 0x20000)
178#define DOVE_LCD2_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x10000) 176#define DOVE_LCD2_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE + 0x10000)
179#define DOVE_LCD_DCON_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x30000) 177#define DOVE_LCD_DCON_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE + 0x30000)
180 178
181/* Graphic Engine */ 179/* Graphic Engine */
182#define DOVE_GPU_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x40000) 180#define DOVE_GPU_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE + 0x40000)
183 181
184/* Video Engine */ 182/* Video Engine */
185#define DOVE_VPU_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x400000) 183#define DOVE_VPU_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE + 0x400000)
186 184
187#endif 185#endif
diff --git a/arch/arm/mach-dove/include/mach/gpio.h b/arch/arm/mach-dove/include/mach/gpio.h
deleted file mode 100644
index e7e5101e35a..00000000000
--- a/arch/arm/mach-dove/include/mach/gpio.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/*
2 * arch/arm/mach-dove/include/mach/gpio.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#include <plat/gpio.h>
diff --git a/arch/arm/mach-dove/include/mach/io.h b/arch/arm/mach-dove/include/mach/io.h
deleted file mode 100644
index 29c8b85355a..00000000000
--- a/arch/arm/mach-dove/include/mach/io.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-dove/include/mach/io.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_IO_H
10#define __ASM_ARCH_IO_H
11
12#include "dove.h"
13
14#define IO_SPACE_LIMIT 0xffffffff
15
16#define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \
17 DOVE_PCIE0_IO_VIRT_BASE))
18
19#endif
diff --git a/arch/arm/mach-dove/include/mach/pm.h b/arch/arm/mach-dove/include/mach/pm.h
index 3ad9f946a9e..7bcd0dfce4b 100644
--- a/arch/arm/mach-dove/include/mach/pm.h
+++ b/arch/arm/mach-dove/include/mach/pm.h
@@ -13,24 +13,42 @@
13#include <mach/irqs.h> 13#include <mach/irqs.h>
14 14
15#define CLOCK_GATING_CONTROL (DOVE_PMU_VIRT_BASE + 0x38) 15#define CLOCK_GATING_CONTROL (DOVE_PMU_VIRT_BASE + 0x38)
16#define CLOCK_GATING_USB0_MASK (1 << 0) 16#define CLOCK_GATING_BIT_USB0 0
17#define CLOCK_GATING_USB1_MASK (1 << 1) 17#define CLOCK_GATING_BIT_USB1 1
18#define CLOCK_GATING_GBE_MASK (1 << 2) 18#define CLOCK_GATING_BIT_GBE 2
19#define CLOCK_GATING_SATA_MASK (1 << 3) 19#define CLOCK_GATING_BIT_SATA 3
20#define CLOCK_GATING_PCIE0_MASK (1 << 4) 20#define CLOCK_GATING_BIT_PCIE0 4
21#define CLOCK_GATING_PCIE1_MASK (1 << 5) 21#define CLOCK_GATING_BIT_PCIE1 5
22#define CLOCK_GATING_SDIO0_MASK (1 << 8) 22#define CLOCK_GATING_BIT_SDIO0 8
23#define CLOCK_GATING_SDIO1_MASK (1 << 9) 23#define CLOCK_GATING_BIT_SDIO1 9
24#define CLOCK_GATING_NAND_MASK (1 << 10) 24#define CLOCK_GATING_BIT_NAND 10
25#define CLOCK_GATING_CAMERA_MASK (1 << 11) 25#define CLOCK_GATING_BIT_CAMERA 11
26#define CLOCK_GATING_I2S0_MASK (1 << 12) 26#define CLOCK_GATING_BIT_I2S0 12
27#define CLOCK_GATING_I2S1_MASK (1 << 13) 27#define CLOCK_GATING_BIT_I2S1 13
28#define CLOCK_GATING_CRYPTO_MASK (1 << 15) 28#define CLOCK_GATING_BIT_CRYPTO 15
29#define CLOCK_GATING_AC97_MASK (1 << 21) 29#define CLOCK_GATING_BIT_AC97 21
30#define CLOCK_GATING_PDMA_MASK (1 << 22) 30#define CLOCK_GATING_BIT_PDMA 22
31#define CLOCK_GATING_XOR0_MASK (1 << 23) 31#define CLOCK_GATING_BIT_XOR0 23
32#define CLOCK_GATING_XOR1_MASK (1 << 24) 32#define CLOCK_GATING_BIT_XOR1 24
33#define CLOCK_GATING_GIGA_PHY_MASK (1 << 30) 33#define CLOCK_GATING_BIT_GIGA_PHY 30
34#define CLOCK_GATING_USB0_MASK (1 << CLOCK_GATING_BIT_USB0)
35#define CLOCK_GATING_USB1_MASK (1 << CLOCK_GATING_BIT_USB1)
36#define CLOCK_GATING_GBE_MASK (1 << CLOCK_GATING_BIT_GBE)
37#define CLOCK_GATING_SATA_MASK (1 << CLOCK_GATING_BIT_SATA)
38#define CLOCK_GATING_PCIE0_MASK (1 << CLOCK_GATING_BIT_PCIE0)
39#define CLOCK_GATING_PCIE1_MASK (1 << CLOCK_GATING_BIT_PCIE1)
40#define CLOCK_GATING_SDIO0_MASK (1 << CLOCK_GATING_BIT_SDIO0)
41#define CLOCK_GATING_SDIO1_MASK (1 << CLOCK_GATING_BIT_SDIO1)
42#define CLOCK_GATING_NAND_MASK (1 << CLOCK_GATING_BIT_NAND)
43#define CLOCK_GATING_CAMERA_MASK (1 << CLOCK_GATING_BIT_CAMERA)
44#define CLOCK_GATING_I2S0_MASK (1 << CLOCK_GATING_BIT_I2S0)
45#define CLOCK_GATING_I2S1_MASK (1 << CLOCK_GATING_BIT_I2S1)
46#define CLOCK_GATING_CRYPTO_MASK (1 << CLOCK_GATING_BIT_CRYPTO)
47#define CLOCK_GATING_AC97_MASK (1 << CLOCK_GATING_BIT_AC97)
48#define CLOCK_GATING_PDMA_MASK (1 << CLOCK_GATING_BIT_PDMA)
49#define CLOCK_GATING_XOR0_MASK (1 << CLOCK_GATING_BIT_XOR0)
50#define CLOCK_GATING_XOR1_MASK (1 << CLOCK_GATING_BIT_XOR1)
51#define CLOCK_GATING_GIGA_PHY_MASK (1 << CLOCK_GATING_BIT_GIGA_PHY)
34 52
35#define PMU_INTERRUPT_CAUSE (DOVE_PMU_VIRT_BASE + 0x50) 53#define PMU_INTERRUPT_CAUSE (DOVE_PMU_VIRT_BASE + 0x50)
36#define PMU_INTERRUPT_MASK (DOVE_PMU_VIRT_BASE + 0x54) 54#define PMU_INTERRUPT_MASK (DOVE_PMU_VIRT_BASE + 0x54)
diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c
index 9bc97a5baaa..087711524e8 100644
--- a/arch/arm/mach-dove/irq.c
+++ b/arch/arm/mach-dove/irq.c
@@ -18,6 +18,7 @@
18#include <asm/mach/irq.h> 18#include <asm/mach/irq.h>
19#include <mach/pm.h> 19#include <mach/pm.h>
20#include <mach/bridge-regs.h> 20#include <mach/bridge-regs.h>
21#include <plat/orion-gpio.h>
21#include "common.h" 22#include "common.h"
22 23
23static void pmu_irq_mask(struct irq_data *d) 24static void pmu_irq_mask(struct irq_data *d)
@@ -99,19 +100,19 @@ void __init dove_init_irq(void)
99{ 100{
100 int i; 101 int i;
101 102
102 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF)); 103 orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF);
103 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)); 104 orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF);
104 105
105 /* 106 /*
106 * Initialize gpiolib for GPIOs 0-71. 107 * Initialize gpiolib for GPIOs 0-71.
107 */ 108 */
108 orion_gpio_init(NULL, 0, 32, (void __iomem *)DOVE_GPIO_LO_VIRT_BASE, 0, 109 orion_gpio_init(NULL, 0, 32, DOVE_GPIO_LO_VIRT_BASE, 0,
109 IRQ_DOVE_GPIO_START, gpio0_irqs); 110 IRQ_DOVE_GPIO_START, gpio0_irqs);
110 111
111 orion_gpio_init(NULL, 32, 32, (void __iomem *)DOVE_GPIO_HI_VIRT_BASE, 0, 112 orion_gpio_init(NULL, 32, 32, DOVE_GPIO_HI_VIRT_BASE, 0,
112 IRQ_DOVE_GPIO_START + 32, gpio1_irqs); 113 IRQ_DOVE_GPIO_START + 32, gpio1_irqs);
113 114
114 orion_gpio_init(NULL, 64, 8, (void __iomem *)DOVE_GPIO2_VIRT_BASE, 0, 115 orion_gpio_init(NULL, 64, 8, DOVE_GPIO2_VIRT_BASE, 0,
115 IRQ_DOVE_GPIO_START + 64, gpio2_irqs); 116 IRQ_DOVE_GPIO_START + 64, gpio2_irqs);
116 117
117 /* 118 /*
diff --git a/arch/arm/mach-dove/mpp.c b/arch/arm/mach-dove/mpp.c
index 7f70afc26f9..60bd729a1ba 100644
--- a/arch/arm/mach-dove/mpp.c
+++ b/arch/arm/mach-dove/mpp.c
@@ -13,6 +13,7 @@
13#include <linux/io.h> 13#include <linux/io.h>
14#include <plat/mpp.h> 14#include <plat/mpp.h>
15#include <mach/dove.h> 15#include <mach/dove.h>
16#include <plat/orion-gpio.h>
16#include "mpp.h" 17#include "mpp.h"
17 18
18struct dove_mpp_grp { 19struct dove_mpp_grp {
diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c
index 47921b0cdc6..bb15b26041c 100644
--- a/arch/arm/mach-dove/pcie.c
+++ b/arch/arm/mach-dove/pcie.c
@@ -26,9 +26,8 @@ struct pcie_port {
26 u8 root_bus_nr; 26 u8 root_bus_nr;
27 void __iomem *base; 27 void __iomem *base;
28 spinlock_t conf_lock; 28 spinlock_t conf_lock;
29 char io_space_name[16];
30 char mem_space_name[16]; 29 char mem_space_name[16];
31 struct resource res[2]; 30 struct resource res;
32}; 31};
33 32
34static struct pcie_port pcie_port[2]; 33static struct pcie_port pcie_port[2];
@@ -53,24 +52,10 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys)
53 52
54 orion_pcie_setup(pp->base); 53 orion_pcie_setup(pp->base);
55 54
56 /* 55 if (pp->index == 0)
57 * IORESOURCE_IO 56 pci_ioremap_io(sys->busnr * SZ_64K, DOVE_PCIE0_IO_PHYS_BASE);
58 */ 57 else
59 snprintf(pp->io_space_name, sizeof(pp->io_space_name), 58 pci_ioremap_io(sys->busnr * SZ_64K, DOVE_PCIE1_IO_PHYS_BASE);
60 "PCIe %d I/O", pp->index);
61 pp->io_space_name[sizeof(pp->io_space_name) - 1] = 0;
62 pp->res[0].name = pp->io_space_name;
63 if (pp->index == 0) {
64 pp->res[0].start = DOVE_PCIE0_IO_PHYS_BASE;
65 pp->res[0].end = pp->res[0].start + DOVE_PCIE0_IO_SIZE - 1;
66 } else {
67 pp->res[0].start = DOVE_PCIE1_IO_PHYS_BASE;
68 pp->res[0].end = pp->res[0].start + DOVE_PCIE1_IO_SIZE - 1;
69 }
70 pp->res[0].flags = IORESOURCE_IO;
71 if (request_resource(&ioport_resource, &pp->res[0]))
72 panic("Request PCIe IO resource failed\n");
73 pci_add_resource_offset(&sys->resources, &pp->res[0], sys->io_offset);
74 59
75 /* 60 /*
76 * IORESOURCE_MEM 61 * IORESOURCE_MEM
@@ -78,18 +63,18 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys)
78 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), 63 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name),
79 "PCIe %d MEM", pp->index); 64 "PCIe %d MEM", pp->index);
80 pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0; 65 pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0;
81 pp->res[1].name = pp->mem_space_name; 66 pp->res.name = pp->mem_space_name;
82 if (pp->index == 0) { 67 if (pp->index == 0) {
83 pp->res[1].start = DOVE_PCIE0_MEM_PHYS_BASE; 68 pp->res.start = DOVE_PCIE0_MEM_PHYS_BASE;
84 pp->res[1].end = pp->res[1].start + DOVE_PCIE0_MEM_SIZE - 1; 69 pp->res.end = pp->res.start + DOVE_PCIE0_MEM_SIZE - 1;
85 } else { 70 } else {
86 pp->res[1].start = DOVE_PCIE1_MEM_PHYS_BASE; 71 pp->res.start = DOVE_PCIE1_MEM_PHYS_BASE;
87 pp->res[1].end = pp->res[1].start + DOVE_PCIE1_MEM_SIZE - 1; 72 pp->res.end = pp->res.start + DOVE_PCIE1_MEM_SIZE - 1;
88 } 73 }
89 pp->res[1].flags = IORESOURCE_MEM; 74 pp->res.flags = IORESOURCE_MEM;
90 if (request_resource(&iomem_resource, &pp->res[1])) 75 if (request_resource(&iomem_resource, &pp->res))
91 panic("Request PCIe Memory resource failed\n"); 76 panic("Request PCIe Memory resource failed\n");
92 pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset); 77 pci_add_resource_offset(&sys->resources, &pp->res, sys->mem_offset);
93 78
94 return 1; 79 return 1;
95} 80}
@@ -197,20 +182,20 @@ static struct hw_pci dove_pci __initdata = {
197 .map_irq = dove_pcie_map_irq, 182 .map_irq = dove_pcie_map_irq,
198}; 183};
199 184
200static void __init add_pcie_port(int index, unsigned long base) 185static void __init add_pcie_port(int index, void __iomem *base)
201{ 186{
202 printk(KERN_INFO "Dove PCIe port %d: ", index); 187 printk(KERN_INFO "Dove PCIe port %d: ", index);
203 188
204 if (orion_pcie_link_up((void __iomem *)base)) { 189 if (orion_pcie_link_up(base)) {
205 struct pcie_port *pp = &pcie_port[num_pcie_ports++]; 190 struct pcie_port *pp = &pcie_port[num_pcie_ports++];
206 191
207 printk(KERN_INFO "link up\n"); 192 printk(KERN_INFO "link up\n");
208 193
209 pp->index = index; 194 pp->index = index;
210 pp->root_bus_nr = -1; 195 pp->root_bus_nr = -1;
211 pp->base = (void __iomem *)base; 196 pp->base = base;
212 spin_lock_init(&pp->conf_lock); 197 spin_lock_init(&pp->conf_lock);
213 memset(pp->res, 0, sizeof(pp->res)); 198 memset(&pp->res, 0, sizeof(pp->res));
214 } else { 199 } else {
215 printk(KERN_INFO "link down, ignoring\n"); 200 printk(KERN_INFO "link down, ignoring\n");
216 } 201 }
diff --git a/arch/arm/mach-ebsa110/Makefile b/arch/arm/mach-ebsa110/Makefile
index 6520ac83580..935e4af01a2 100644
--- a/arch/arm/mach-ebsa110/Makefile
+++ b/arch/arm/mach-ebsa110/Makefile
@@ -4,9 +4,7 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := core.o io.o 7obj-y := core.o io.o leds.o
8obj-m := 8obj-m :=
9obj-n := 9obj-n :=
10obj- := 10obj- :=
11
12obj-$(CONFIG_LEDS) += leds.o
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c
index 6f8068692ed..f0fe6b5350e 100644
--- a/arch/arm/mach-ebsa110/core.c
+++ b/arch/arm/mach-ebsa110/core.c
@@ -74,22 +74,22 @@ static struct map_desc ebsa110_io_desc[] __initdata = {
74 * sparse external-decode ISAIO space 74 * sparse external-decode ISAIO space
75 */ 75 */
76 { /* IRQ_STAT/IRQ_MCLR */ 76 { /* IRQ_STAT/IRQ_MCLR */
77 .virtual = IRQ_STAT, 77 .virtual = (unsigned long)IRQ_STAT,
78 .pfn = __phys_to_pfn(TRICK4_PHYS), 78 .pfn = __phys_to_pfn(TRICK4_PHYS),
79 .length = TRICK4_SIZE, 79 .length = TRICK4_SIZE,
80 .type = MT_DEVICE 80 .type = MT_DEVICE
81 }, { /* IRQ_MASK/IRQ_MSET */ 81 }, { /* IRQ_MASK/IRQ_MSET */
82 .virtual = IRQ_MASK, 82 .virtual = (unsigned long)IRQ_MASK,
83 .pfn = __phys_to_pfn(TRICK3_PHYS), 83 .pfn = __phys_to_pfn(TRICK3_PHYS),
84 .length = TRICK3_SIZE, 84 .length = TRICK3_SIZE,
85 .type = MT_DEVICE 85 .type = MT_DEVICE
86 }, { /* SOFT_BASE */ 86 }, { /* SOFT_BASE */
87 .virtual = SOFT_BASE, 87 .virtual = (unsigned long)SOFT_BASE,
88 .pfn = __phys_to_pfn(TRICK1_PHYS), 88 .pfn = __phys_to_pfn(TRICK1_PHYS),
89 .length = TRICK1_SIZE, 89 .length = TRICK1_SIZE,
90 .type = MT_DEVICE 90 .type = MT_DEVICE
91 }, { /* PIT_BASE */ 91 }, { /* PIT_BASE */
92 .virtual = PIT_BASE, 92 .virtual = (unsigned long)PIT_BASE,
93 .pfn = __phys_to_pfn(TRICK0_PHYS), 93 .pfn = __phys_to_pfn(TRICK0_PHYS),
94 .length = TRICK0_SIZE, 94 .length = TRICK0_SIZE,
95 .type = MT_DEVICE 95 .type = MT_DEVICE
diff --git a/arch/arm/mach-ebsa110/core.h b/arch/arm/mach-ebsa110/core.h
index c93c9e43012..afe137ee172 100644
--- a/arch/arm/mach-ebsa110/core.h
+++ b/arch/arm/mach-ebsa110/core.h
@@ -31,11 +31,11 @@
31#define TRICK7_PHYS 0xf3c00000 31#define TRICK7_PHYS 0xf3c00000
32 32
33/* Virtual addresses */ 33/* Virtual addresses */
34#define PIT_BASE 0xfc000000 /* trick 0 */ 34#define PIT_BASE IOMEM(0xfc000000) /* trick 0 */
35#define SOFT_BASE 0xfd000000 /* trick 1 */ 35#define SOFT_BASE IOMEM(0xfd000000) /* trick 1 */
36#define IRQ_MASK 0xfe000000 /* trick 3 - read */ 36#define IRQ_MASK IOMEM(0xfe000000) /* trick 3 - read */
37#define IRQ_MSET 0xfe000000 /* trick 3 - write */ 37#define IRQ_MSET IOMEM(0xfe000000) /* trick 3 - write */
38#define IRQ_STAT 0xff000000 /* trick 4 - read */ 38#define IRQ_STAT IOMEM(0xff000000) /* trick 4 - read */
39#define IRQ_MCLR 0xff000000 /* trick 4 - write */ 39#define IRQ_MCLR IOMEM(0xff000000) /* trick 4 - write */
40 40
41#endif 41#endif
diff --git a/arch/arm/mach-ebsa110/leds.c b/arch/arm/mach-ebsa110/leds.c
index 99e14e36250..0398258c20c 100644
--- a/arch/arm/mach-ebsa110/leds.c
+++ b/arch/arm/mach-ebsa110/leds.c
@@ -1,52 +1,71 @@
1/* 1/*
2 * linux/arch/arm/mach-ebsa110/leds.c 2 * Driver for the LED found on the EBSA110 machine
3 * Based on Versatile and RealView machine LED code
3 * 4 *
4 * Copyright (C) 1998 Russell King 5 * License terms: GNU General Public License (GPL) version 2
5 * 6 * Author: Bryan Wu <bryan.wu@canonical.com>
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 * EBSA-110 LED control routines. We use the led as follows:
11 *
12 * - Red - toggles state every 50 timer interrupts
13 */ 7 */
14#include <linux/module.h> 8#include <linux/kernel.h>
15#include <linux/spinlock.h>
16#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/io.h>
11#include <linux/slab.h>
12#include <linux/leds.h>
17 13
18#include <mach/hardware.h>
19#include <asm/leds.h>
20#include <asm/mach-types.h> 14#include <asm/mach-types.h>
21 15
22#include "core.h" 16#include "core.h"
23 17
24static spinlock_t leds_lock; 18#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
25 19static void ebsa110_led_set(struct led_classdev *cdev,
26static void ebsa110_leds_event(led_event_t ledevt) 20 enum led_brightness b)
27{ 21{
28 unsigned long flags; 22 u8 reg = __raw_readb(SOFT_BASE);
29 23
30 spin_lock_irqsave(&leds_lock, flags); 24 if (b != LED_OFF)
25 reg |= 0x80;
26 else
27 reg &= ~0x80;
31 28
32 switch(ledevt) { 29 __raw_writeb(reg, SOFT_BASE);
33 case led_timer: 30}
34 *(volatile unsigned char *)SOFT_BASE ^= 128;
35 break;
36 31
37 default: 32static enum led_brightness ebsa110_led_get(struct led_classdev *cdev)
38 break; 33{
39 } 34 u8 reg = __raw_readb(SOFT_BASE);
40 35
41 spin_unlock_irqrestore(&leds_lock, flags); 36 return (reg & 0x80) ? LED_FULL : LED_OFF;
42} 37}
43 38
44static int __init leds_init(void) 39static int __init ebsa110_leds_init(void)
45{ 40{
46 if (machine_is_ebsa110()) 41
47 leds_event = ebsa110_leds_event; 42 struct led_classdev *cdev;
43 int ret;
44
45 if (!machine_is_ebsa110())
46 return -ENODEV;
47
48 cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
49 if (!cdev)
50 return -ENOMEM;
51
52 cdev->name = "ebsa110:0";
53 cdev->brightness_set = ebsa110_led_set;
54 cdev->brightness_get = ebsa110_led_get;
55 cdev->default_trigger = "heartbeat";
56
57 ret = led_classdev_register(NULL, cdev);
58 if (ret < 0) {
59 kfree(cdev);
60 return ret;
61 }
48 62
49 return 0; 63 return 0;
50} 64}
51 65
52__initcall(leds_init); 66/*
67 * Since we may have triggers on any subsystem, defer registration
68 * until after subsystem_init.
69 */
70fs_initcall(ebsa110_leds_init);
71#endif
diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c
index a472777e9eb..41383bf03d4 100644
--- a/arch/arm/mach-ep93xx/adssphere.c
+++ b/arch/arm/mach-ep93xx/adssphere.c
@@ -13,6 +13,7 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/sizes.h>
16 17
17#include <mach/hardware.h> 18#include <mach/hardware.h>
18 19
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 4afe52aaaff..e85bf17f2d2 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -36,9 +36,9 @@
36#include <linux/export.h> 36#include <linux/export.h>
37 37
38#include <mach/hardware.h> 38#include <mach/hardware.h>
39#include <mach/fb.h> 39#include <linux/platform_data/video-ep93xx.h>
40#include <mach/ep93xx_keypad.h> 40#include <linux/platform_data/keypad-ep93xx.h>
41#include <mach/ep93xx_spi.h> 41#include <linux/platform_data/spi-ep93xx.h>
42#include <mach/gpio-ep93xx.h> 42#include <mach/gpio-ep93xx.h>
43 43
44#include <asm/mach/map.h> 44#include <asm/mach/map.h>
diff --git a/arch/arm/mach-ep93xx/dma.c b/arch/arm/mach-ep93xx/dma.c
index 16976d7bdc8..d8bfd02f504 100644
--- a/arch/arm/mach-ep93xx/dma.c
+++ b/arch/arm/mach-ep93xx/dma.c
@@ -25,7 +25,7 @@
25#include <linux/kernel.h> 25#include <linux/kernel.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27 27
28#include <mach/dma.h> 28#include <linux/platform_data/dma-ep93xx.h>
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30 30
31#include "soc.h" 31#include "soc.h"
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index 337ab7cf4c1..b8f53d57a29 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -35,8 +35,8 @@
35#include <sound/cs4271.h> 35#include <sound/cs4271.h>
36 36
37#include <mach/hardware.h> 37#include <mach/hardware.h>
38#include <mach/fb.h> 38#include <linux/platform_data/video-ep93xx.h>
39#include <mach/ep93xx_spi.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> 42#include <asm/hardware/vic.h>
diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c
index 437c3411115..7fd705b5efe 100644
--- a/arch/arm/mach-ep93xx/gesbc9312.c
+++ b/arch/arm/mach-ep93xx/gesbc9312.c
@@ -13,6 +13,7 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/sizes.h>
16 17
17#include <mach/hardware.h> 18#include <mach/hardware.h>
18 19
diff --git a/arch/arm/mach-ep93xx/include/mach/dma.h b/arch/arm/mach-ep93xx/include/mach/dma.h
deleted file mode 100644
index e82c642fa53..00000000000
--- a/arch/arm/mach-ep93xx/include/mach/dma.h
+++ /dev/null
@@ -1,93 +0,0 @@
1#ifndef __ASM_ARCH_DMA_H
2#define __ASM_ARCH_DMA_H
3
4#include <linux/types.h>
5#include <linux/dmaengine.h>
6#include <linux/dma-mapping.h>
7
8/*
9 * M2P channels.
10 *
11 * Note that these values are also directly used for setting the PPALLOC
12 * register.
13 */
14#define EP93XX_DMA_I2S1 0
15#define EP93XX_DMA_I2S2 1
16#define EP93XX_DMA_AAC1 2
17#define EP93XX_DMA_AAC2 3
18#define EP93XX_DMA_AAC3 4
19#define EP93XX_DMA_I2S3 5
20#define EP93XX_DMA_UART1 6
21#define EP93XX_DMA_UART2 7
22#define EP93XX_DMA_UART3 8
23#define EP93XX_DMA_IRDA 9
24/* M2M channels */
25#define EP93XX_DMA_SSP 10
26#define EP93XX_DMA_IDE 11
27
28/**
29 * struct ep93xx_dma_data - configuration data for the EP93xx dmaengine
30 * @port: peripheral which is requesting the channel
31 * @direction: TX/RX channel
32 * @name: optional name for the channel, this is displayed in /proc/interrupts
33 *
34 * This information is passed as private channel parameter in a filter
35 * function. Note that this is only needed for slave/cyclic channels. For
36 * memcpy channels %NULL data should be passed.
37 */
38struct ep93xx_dma_data {
39 int port;
40 enum dma_transfer_direction direction;
41 const char *name;
42};
43
44/**
45 * struct ep93xx_dma_chan_data - platform specific data for a DMA channel
46 * @name: name of the channel, used for getting the right clock for the channel
47 * @base: mapped registers
48 * @irq: interrupt number used by this channel
49 */
50struct ep93xx_dma_chan_data {
51 const char *name;
52 void __iomem *base;
53 int irq;
54};
55
56/**
57 * struct ep93xx_dma_platform_data - platform data for the dmaengine driver
58 * @channels: array of channels which are passed to the driver
59 * @num_channels: number of channels in the array
60 *
61 * This structure is passed to the DMA engine driver via platform data. For
62 * M2P channels, contract is that even channels are for TX and odd for RX.
63 * There is no requirement for the M2M channels.
64 */
65struct ep93xx_dma_platform_data {
66 struct ep93xx_dma_chan_data *channels;
67 size_t num_channels;
68};
69
70static inline bool ep93xx_dma_chan_is_m2p(struct dma_chan *chan)
71{
72 return !strcmp(dev_name(chan->device->dev), "ep93xx-dma-m2p");
73}
74
75/**
76 * ep93xx_dma_chan_direction - returns direction the channel can be used
77 * @chan: channel
78 *
79 * This function can be used in filter functions to find out whether the
80 * channel supports given DMA direction. Only M2P channels have such
81 * limitation, for M2M channels the direction is configurable.
82 */
83static inline enum dma_transfer_direction
84ep93xx_dma_chan_direction(struct dma_chan *chan)
85{
86 if (!ep93xx_dma_chan_is_m2p(chan))
87 return DMA_NONE;
88
89 /* even channels are for TX, odd for RX */
90 return (chan->chan_id % 2 == 0) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
91}
92
93#endif /* __ASM_ARCH_DMA_H */
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h b/arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h
deleted file mode 100644
index 1e2f4e97f42..00000000000
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h
3 */
4
5#ifndef __ASM_ARCH_EP93XX_KEYPAD_H
6#define __ASM_ARCH_EP93XX_KEYPAD_H
7
8struct matrix_keymap_data;
9
10/* flags for the ep93xx_keypad driver */
11#define EP93XX_KEYPAD_DISABLE_3_KEY (1<<0) /* disable 3-key reset */
12#define EP93XX_KEYPAD_DIAG_MODE (1<<1) /* diagnostic mode */
13#define EP93XX_KEYPAD_BACK_DRIVE (1<<2) /* back driving mode */
14#define EP93XX_KEYPAD_TEST_MODE (1<<3) /* scan only column 0 */
15#define EP93XX_KEYPAD_KDIV (1<<4) /* 1/4 clock or 1/16 clock */
16#define EP93XX_KEYPAD_AUTOREPEAT (1<<5) /* enable key autorepeat */
17
18/**
19 * struct ep93xx_keypad_platform_data - platform specific device structure
20 * @keymap_data: pointer to &matrix_keymap_data
21 * @debounce: debounce start count; terminal count is 0xff
22 * @prescale: row/column counter pre-scaler load value
23 * @flags: see above
24 */
25struct ep93xx_keypad_platform_data {
26 struct matrix_keymap_data *keymap_data;
27 unsigned int debounce;
28 unsigned int prescale;
29 unsigned int flags;
30};
31
32#define EP93XX_MATRIX_ROWS (8)
33#define EP93XX_MATRIX_COLS (8)
34
35#endif /* __ASM_ARCH_EP93XX_KEYPAD_H */
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx_spi.h b/arch/arm/mach-ep93xx/include/mach/ep93xx_spi.h
deleted file mode 100644
index 9bb63ac13f0..00000000000
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx_spi.h
+++ /dev/null
@@ -1,29 +0,0 @@
1#ifndef __ASM_MACH_EP93XX_SPI_H
2#define __ASM_MACH_EP93XX_SPI_H
3
4struct spi_device;
5
6/**
7 * struct ep93xx_spi_info - EP93xx specific SPI descriptor
8 * @num_chipselect: number of chip selects on this board, must be
9 * at least one
10 * @use_dma: use DMA for the transfers
11 */
12struct ep93xx_spi_info {
13 int num_chipselect;
14 bool use_dma;
15};
16
17/**
18 * struct ep93xx_spi_chip_ops - operation callbacks for SPI slave device
19 * @setup: setup the chip select mechanism
20 * @cleanup: cleanup the chip select mechanism
21 * @cs_control: control the device chip select
22 */
23struct ep93xx_spi_chip_ops {
24 int (*setup)(struct spi_device *spi);
25 void (*cleanup)(struct spi_device *spi);
26 void (*cs_control)(struct spi_device *spi, int value);
27};
28
29#endif /* __ASM_MACH_EP93XX_SPI_H */
diff --git a/arch/arm/mach-ep93xx/include/mach/fb.h b/arch/arm/mach-ep93xx/include/mach/fb.h
deleted file mode 100644
index d5ae11d7c45..00000000000
--- a/arch/arm/mach-ep93xx/include/mach/fb.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/include/mach/fb.h
3 */
4
5#ifndef __ASM_ARCH_EP93XXFB_H
6#define __ASM_ARCH_EP93XXFB_H
7
8struct platform_device;
9struct fb_videomode;
10struct fb_info;
11
12#define EP93XXFB_USE_MODEDB 0
13
14/* VideoAttributes flags */
15#define EP93XXFB_STATE_MACHINE_ENABLE (1 << 0)
16#define EP93XXFB_PIXEL_CLOCK_ENABLE (1 << 1)
17#define EP93XXFB_VSYNC_ENABLE (1 << 2)
18#define EP93XXFB_PIXEL_DATA_ENABLE (1 << 3)
19#define EP93XXFB_COMPOSITE_SYNC (1 << 4)
20#define EP93XXFB_SYNC_VERT_HIGH (1 << 5)
21#define EP93XXFB_SYNC_HORIZ_HIGH (1 << 6)
22#define EP93XXFB_SYNC_BLANK_HIGH (1 << 7)
23#define EP93XXFB_PCLK_FALLING (1 << 8)
24#define EP93XXFB_ENABLE_AC (1 << 9)
25#define EP93XXFB_ENABLE_LCD (1 << 10)
26#define EP93XXFB_ENABLE_CCIR (1 << 12)
27#define EP93XXFB_USE_PARALLEL_INTERFACE (1 << 13)
28#define EP93XXFB_ENABLE_INTERRUPT (1 << 14)
29#define EP93XXFB_USB_INTERLACE (1 << 16)
30#define EP93XXFB_USE_EQUALIZATION (1 << 17)
31#define EP93XXFB_USE_DOUBLE_HORZ (1 << 18)
32#define EP93XXFB_USE_DOUBLE_VERT (1 << 19)
33#define EP93XXFB_USE_BLANK_PIXEL (1 << 20)
34#define EP93XXFB_USE_SDCSN0 (0 << 21)
35#define EP93XXFB_USE_SDCSN1 (1 << 21)
36#define EP93XXFB_USE_SDCSN2 (2 << 21)
37#define EP93XXFB_USE_SDCSN3 (3 << 21)
38
39#define EP93XXFB_ENABLE (EP93XXFB_STATE_MACHINE_ENABLE | \
40 EP93XXFB_PIXEL_CLOCK_ENABLE | \
41 EP93XXFB_VSYNC_ENABLE | \
42 EP93XXFB_PIXEL_DATA_ENABLE)
43
44struct ep93xxfb_mach_info {
45 unsigned int num_modes;
46 const struct fb_videomode *modes;
47 const struct fb_videomode *default_mode;
48 int bpp;
49 unsigned int flags;
50
51 int (*setup)(struct platform_device *pdev);
52 void (*teardown)(struct platform_device *pdev);
53 void (*blank)(int blank_mode, struct fb_info *info);
54};
55
56#endif /* __ASM_ARCH_EP93XXFB_H */
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c
index 33dc0791741..0eb3f17a6fa 100644
--- a/arch/arm/mach-ep93xx/simone.c
+++ b/arch/arm/mach-ep93xx/simone.c
@@ -22,7 +22,7 @@
22#include <linux/i2c-gpio.h> 22#include <linux/i2c-gpio.h>
23 23
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <mach/fb.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> 28#include <asm/hardware/vic.h>
diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c
index 01abd3516a7..50043eef1cf 100644
--- a/arch/arm/mach-ep93xx/snappercl15.c
+++ b/arch/arm/mach-ep93xx/snappercl15.c
@@ -28,7 +28,7 @@
28#include <linux/mtd/nand.h> 28#include <linux/mtd/nand.h>
29 29
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <mach/fb.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> 34#include <asm/hardware/vic.h>
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 75cab2d7ec7..3c4c233391d 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -21,7 +21,6 @@
21#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/ts72xx.h>
25 24
26#include <asm/hardware/vic.h> 25#include <asm/hardware/vic.h>
27#include <asm/mach-types.h> 26#include <asm/mach-types.h>
@@ -29,30 +28,31 @@
29#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
30 29
31#include "soc.h" 30#include "soc.h"
31#include "ts72xx.h"
32 32
33static struct map_desc ts72xx_io_desc[] __initdata = { 33static struct map_desc ts72xx_io_desc[] __initdata = {
34 { 34 {
35 .virtual = TS72XX_MODEL_VIRT_BASE, 35 .virtual = (unsigned long)TS72XX_MODEL_VIRT_BASE,
36 .pfn = __phys_to_pfn(TS72XX_MODEL_PHYS_BASE), 36 .pfn = __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
37 .length = TS72XX_MODEL_SIZE, 37 .length = TS72XX_MODEL_SIZE,
38 .type = MT_DEVICE, 38 .type = MT_DEVICE,
39 }, { 39 }, {
40 .virtual = TS72XX_OPTIONS_VIRT_BASE, 40 .virtual = (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
41 .pfn = __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE), 41 .pfn = __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
42 .length = TS72XX_OPTIONS_SIZE, 42 .length = TS72XX_OPTIONS_SIZE,
43 .type = MT_DEVICE, 43 .type = MT_DEVICE,
44 }, { 44 }, {
45 .virtual = TS72XX_OPTIONS2_VIRT_BASE, 45 .virtual = (unsigned long)TS72XX_OPTIONS2_VIRT_BASE,
46 .pfn = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE), 46 .pfn = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE),
47 .length = TS72XX_OPTIONS2_SIZE, 47 .length = TS72XX_OPTIONS2_SIZE,
48 .type = MT_DEVICE, 48 .type = MT_DEVICE,
49 }, { 49 }, {
50 .virtual = TS72XX_RTC_INDEX_VIRT_BASE, 50 .virtual = (unsigned long)TS72XX_RTC_INDEX_VIRT_BASE,
51 .pfn = __phys_to_pfn(TS72XX_RTC_INDEX_PHYS_BASE), 51 .pfn = __phys_to_pfn(TS72XX_RTC_INDEX_PHYS_BASE),
52 .length = TS72XX_RTC_INDEX_SIZE, 52 .length = TS72XX_RTC_INDEX_SIZE,
53 .type = MT_DEVICE, 53 .type = MT_DEVICE,
54 }, { 54 }, {
55 .virtual = TS72XX_RTC_DATA_VIRT_BASE, 55 .virtual = (unsigned long)TS72XX_RTC_DATA_VIRT_BASE,
56 .pfn = __phys_to_pfn(TS72XX_RTC_DATA_PHYS_BASE), 56 .pfn = __phys_to_pfn(TS72XX_RTC_DATA_PHYS_BASE),
57 .length = TS72XX_RTC_DATA_SIZE, 57 .length = TS72XX_RTC_DATA_SIZE,
58 .type = MT_DEVICE, 58 .type = MT_DEVICE,
diff --git a/arch/arm/mach-ep93xx/include/mach/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index f1397a13e76..071feaa30ad 100644
--- a/arch/arm/mach-ep93xx/include/mach/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16#define TS72XX_MODEL_PHYS_BASE 0x22000000 16#define TS72XX_MODEL_PHYS_BASE 0x22000000
17#define TS72XX_MODEL_VIRT_BASE 0xfebff000 17#define TS72XX_MODEL_VIRT_BASE IOMEM(0xfebff000)
18#define TS72XX_MODEL_SIZE 0x00001000 18#define TS72XX_MODEL_SIZE 0x00001000
19 19
20#define TS72XX_MODEL_TS7200 0x00 20#define TS72XX_MODEL_TS7200 0x00
@@ -26,7 +26,7 @@
26 26
27 27
28#define TS72XX_OPTIONS_PHYS_BASE 0x22400000 28#define TS72XX_OPTIONS_PHYS_BASE 0x22400000
29#define TS72XX_OPTIONS_VIRT_BASE 0xfebfe000 29#define TS72XX_OPTIONS_VIRT_BASE IOMEM(0xfebfe000)
30#define TS72XX_OPTIONS_SIZE 0x00001000 30#define TS72XX_OPTIONS_SIZE 0x00001000
31 31
32#define TS72XX_OPTIONS_COM2_RS485 0x02 32#define TS72XX_OPTIONS_COM2_RS485 0x02
@@ -34,18 +34,18 @@
34 34
35 35
36#define TS72XX_OPTIONS2_PHYS_BASE 0x22800000 36#define TS72XX_OPTIONS2_PHYS_BASE 0x22800000
37#define TS72XX_OPTIONS2_VIRT_BASE 0xfebfd000 37#define TS72XX_OPTIONS2_VIRT_BASE IOMEM(0xfebfd000)
38#define TS72XX_OPTIONS2_SIZE 0x00001000 38#define TS72XX_OPTIONS2_SIZE 0x00001000
39 39
40#define TS72XX_OPTIONS2_TS9420 0x04 40#define TS72XX_OPTIONS2_TS9420 0x04
41#define TS72XX_OPTIONS2_TS9420_BOOT 0x02 41#define TS72XX_OPTIONS2_TS9420_BOOT 0x02
42 42
43 43
44#define TS72XX_RTC_INDEX_VIRT_BASE 0xfebf9000 44#define TS72XX_RTC_INDEX_VIRT_BASE IOMEM(0xfebf9000)
45#define TS72XX_RTC_INDEX_PHYS_BASE 0x10800000 45#define TS72XX_RTC_INDEX_PHYS_BASE 0x10800000
46#define TS72XX_RTC_INDEX_SIZE 0x00001000 46#define TS72XX_RTC_INDEX_SIZE 0x00001000
47 47
48#define TS72XX_RTC_DATA_VIRT_BASE 0xfebf8000 48#define TS72XX_RTC_DATA_VIRT_BASE IOMEM(0xfebf8000)
49#define TS72XX_RTC_DATA_PHYS_BASE 0x11700000 49#define TS72XX_RTC_DATA_PHYS_BASE 0x11700000
50#define TS72XX_RTC_DATA_SIZE 0x00001000 50#define TS72XX_RTC_DATA_SIZE 0x00001000
51 51
diff --git a/arch/arm/mach-ep93xx/vision_ep9307.c b/arch/arm/mach-ep93xx/vision_ep9307.c
index 2905a4929bd..ba92e25e301 100644
--- a/arch/arm/mach-ep93xx/vision_ep9307.c
+++ b/arch/arm/mach-ep93xx/vision_ep9307.c
@@ -30,8 +30,8 @@
30#include <linux/mmc/host.h> 30#include <linux/mmc/host.h>
31 31
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <mach/fb.h> 33#include <linux/platform_data/video-ep93xx.h>
34#include <mach/ep93xx_spi.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> 37#include <asm/hardware/vic.h>
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index b5b4c8c9db1..da55107033d 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -31,11 +31,11 @@ config CPU_EXYNOS4210
31 bool "SAMSUNG EXYNOS4210" 31 bool "SAMSUNG EXYNOS4210"
32 default y 32 default y
33 depends on ARCH_EXYNOS4 33 depends on ARCH_EXYNOS4
34 select SAMSUNG_DMADEV
35 select ARM_CPU_SUSPEND if PM 34 select ARM_CPU_SUSPEND if PM
35 select PM_GENERIC_DOMAINS
36 select S5P_PM if PM 36 select S5P_PM if PM
37 select S5P_SLEEP if PM 37 select S5P_SLEEP if PM
38 select PM_GENERIC_DOMAINS 38 select SAMSUNG_DMADEV
39 help 39 help
40 Enable EXYNOS4210 CPU support 40 Enable EXYNOS4210 CPU support
41 41
@@ -43,9 +43,9 @@ config SOC_EXYNOS4212
43 bool "SAMSUNG EXYNOS4212" 43 bool "SAMSUNG EXYNOS4212"
44 default y 44 default y
45 depends on ARCH_EXYNOS4 45 depends on ARCH_EXYNOS4
46 select SAMSUNG_DMADEV
47 select S5P_PM if PM 46 select S5P_PM if PM
48 select S5P_SLEEP if PM 47 select S5P_SLEEP if PM
48 select SAMSUNG_DMADEV
49 help 49 help
50 Enable EXYNOS4212 SoC support 50 Enable EXYNOS4212 SoC support
51 51
@@ -61,9 +61,9 @@ config SOC_EXYNOS5250
61 bool "SAMSUNG EXYNOS5250" 61 bool "SAMSUNG EXYNOS5250"
62 default y 62 default y
63 depends on ARCH_EXYNOS5 63 depends on ARCH_EXYNOS5
64 select SAMSUNG_DMADEV
65 select S5P_PM if PM 64 select S5P_PM if PM
66 select S5P_SLEEP if PM 65 select S5P_SLEEP if PM
66 select SAMSUNG_DMADEV
67 help 67 help
68 Enable EXYNOS5250 SoC support 68 Enable EXYNOS5250 SoC support
69 69
@@ -189,70 +189,71 @@ config MACH_SMDKC210
189config MACH_SMDKV310 189config MACH_SMDKV310
190 bool "SMDKV310" 190 bool "SMDKV310"
191 select CPU_EXYNOS4210 191 select CPU_EXYNOS4210
192 select S5P_DEV_FIMD0 192 select EXYNOS4_DEV_AHCI
193 select EXYNOS4_DEV_USB_OHCI
194 select EXYNOS4_SETUP_FIMD0
195 select EXYNOS4_SETUP_I2C1
196 select EXYNOS4_SETUP_KEYPAD
197 select EXYNOS4_SETUP_SDHCI
198 select EXYNOS4_SETUP_USB_PHY
199 select EXYNOS_DEV_DMA
200 select EXYNOS_DEV_DRM
201 select EXYNOS_DEV_SYSMMU
202 select S3C24XX_PWM
203 select S3C_DEV_HSMMC
204 select S3C_DEV_HSMMC1
205 select S3C_DEV_HSMMC2
206 select S3C_DEV_HSMMC3
207 select S3C_DEV_I2C1
193 select S3C_DEV_RTC 208 select S3C_DEV_RTC
209 select S3C_DEV_USB_HSOTG
194 select S3C_DEV_WDT 210 select S3C_DEV_WDT
195 select S3C_DEV_I2C1
196 select S5P_DEV_FIMC0 211 select S5P_DEV_FIMC0
197 select S5P_DEV_FIMC1 212 select S5P_DEV_FIMC1
198 select S5P_DEV_FIMC2 213 select S5P_DEV_FIMC2
199 select S5P_DEV_FIMC3 214 select S5P_DEV_FIMC3
215 select S5P_DEV_FIMD0
200 select S5P_DEV_G2D 216 select S5P_DEV_G2D
201 select S5P_DEV_I2C_HDMIPHY 217 select S5P_DEV_I2C_HDMIPHY
202 select S5P_DEV_JPEG 218 select S5P_DEV_JPEG
203 select S5P_DEV_MFC 219 select S5P_DEV_MFC
204 select S5P_DEV_TV 220 select S5P_DEV_TV
205 select S5P_DEV_USB_EHCI 221 select S5P_DEV_USB_EHCI
206 select S3C_DEV_HSMMC
207 select S3C_DEV_HSMMC1
208 select S3C_DEV_HSMMC2
209 select S3C_DEV_HSMMC3
210 select S3C_DEV_USB_HSOTG
211 select SAMSUNG_DEV_BACKLIGHT 222 select SAMSUNG_DEV_BACKLIGHT
212 select EXYNOS_DEV_DRM
213 select EXYNOS_DEV_SYSMMU
214 select EXYNOS4_DEV_AHCI
215 select SAMSUNG_DEV_KEYPAD 223 select SAMSUNG_DEV_KEYPAD
216 select EXYNOS_DEV_DMA
217 select SAMSUNG_DEV_PWM 224 select SAMSUNG_DEV_PWM
218 select EXYNOS4_DEV_USB_OHCI
219 select EXYNOS4_SETUP_FIMD0
220 select EXYNOS4_SETUP_I2C1
221 select EXYNOS4_SETUP_KEYPAD
222 select EXYNOS4_SETUP_SDHCI
223 select EXYNOS4_SETUP_USB_PHY
224 help 225 help
225 Machine support for Samsung SMDKV310 226 Machine support for Samsung SMDKV310
226 227
227config MACH_ARMLEX4210 228config MACH_ARMLEX4210
228 bool "ARMLEX4210" 229 bool "ARMLEX4210"
229 select CPU_EXYNOS4210 230 select CPU_EXYNOS4210
230 select S3C_DEV_RTC 231 select EXYNOS4_DEV_AHCI
231 select S3C_DEV_WDT 232 select EXYNOS4_SETUP_SDHCI
233 select EXYNOS_DEV_DMA
232 select S3C_DEV_HSMMC 234 select S3C_DEV_HSMMC
233 select S3C_DEV_HSMMC2 235 select S3C_DEV_HSMMC2
234 select S3C_DEV_HSMMC3 236 select S3C_DEV_HSMMC3
235 select EXYNOS4_DEV_AHCI 237 select S3C_DEV_RTC
236 select EXYNOS_DEV_DMA 238 select S3C_DEV_WDT
237 select EXYNOS4_SETUP_SDHCI
238 help 239 help
239 Machine support for Samsung ARMLEX4210 based on EXYNOS4210 240 Machine support for Samsung ARMLEX4210 based on EXYNOS4210
240 241
241config MACH_UNIVERSAL_C210 242config MACH_UNIVERSAL_C210
242 bool "Mobile UNIVERSAL_C210 Board" 243 bool "Mobile UNIVERSAL_C210 Board"
243 select CPU_EXYNOS4210
244 select S5P_HRT
245 select CLKSRC_MMIO 244 select CLKSRC_MMIO
245 select CPU_EXYNOS4210
246 select EXYNOS4_SETUP_FIMC
247 select EXYNOS4_SETUP_FIMD0
248 select EXYNOS4_SETUP_I2C1
249 select EXYNOS4_SETUP_I2C3
250 select EXYNOS4_SETUP_I2C5
251 select EXYNOS4_SETUP_SDHCI
252 select EXYNOS4_SETUP_USB_PHY
253 select EXYNOS_DEV_DMA
254 select EXYNOS_DEV_DRM
255 select EXYNOS_DEV_SYSMMU
246 select HAVE_SCHED_CLOCK 256 select HAVE_SCHED_CLOCK
247 select S5P_GPIO_INT
248 select S5P_DEV_FIMC0
249 select S5P_DEV_FIMC1
250 select S5P_DEV_FIMC2
251 select S5P_DEV_FIMC3
252 select S5P_DEV_G2D
253 select S5P_DEV_CSIS0
254 select S5P_DEV_JPEG
255 select S5P_DEV_FIMD0
256 select S3C_DEV_HSMMC 257 select S3C_DEV_HSMMC
257 select S3C_DEV_HSMMC2 258 select S3C_DEV_HSMMC2
258 select S3C_DEV_HSMMC3 259 select S3C_DEV_HSMMC3
@@ -260,21 +261,21 @@ config MACH_UNIVERSAL_C210
260 select S3C_DEV_I2C3 261 select S3C_DEV_I2C3
261 select S3C_DEV_I2C5 262 select S3C_DEV_I2C5
262 select S3C_DEV_USB_HSOTG 263 select S3C_DEV_USB_HSOTG
264 select S5P_DEV_CSIS0
265 select S5P_DEV_FIMC0
266 select S5P_DEV_FIMC1
267 select S5P_DEV_FIMC2
268 select S5P_DEV_FIMC3
269 select S5P_DEV_FIMD0
270 select S5P_DEV_G2D
263 select S5P_DEV_I2C_HDMIPHY 271 select S5P_DEV_I2C_HDMIPHY
272 select S5P_DEV_JPEG
264 select S5P_DEV_MFC 273 select S5P_DEV_MFC
265 select S5P_DEV_ONENAND 274 select S5P_DEV_ONENAND
266 select S5P_DEV_TV 275 select S5P_DEV_TV
267 select EXYNOS_DEV_SYSMMU 276 select S5P_GPIO_INT
268 select EXYNOS_DEV_DMA 277 select S5P_HRT
269 select EXYNOS_DEV_DRM
270 select EXYNOS4_SETUP_FIMD0
271 select EXYNOS4_SETUP_I2C1
272 select EXYNOS4_SETUP_I2C3
273 select EXYNOS4_SETUP_I2C5
274 select EXYNOS4_SETUP_SDHCI
275 select EXYNOS4_SETUP_FIMC
276 select S5P_SETUP_MIPIPHY 278 select S5P_SETUP_MIPIPHY
277 select EXYNOS4_SETUP_USB_PHY
278 help 279 help
279 Machine support for Samsung Mobile Universal S5PC210 Reference 280 Machine support for Samsung Mobile Universal S5PC210 Reference
280 Board. 281 Board.
@@ -282,10 +283,16 @@ config MACH_UNIVERSAL_C210
282config MACH_NURI 283config MACH_NURI
283 bool "Mobile NURI Board" 284 bool "Mobile NURI Board"
284 select CPU_EXYNOS4210 285 select CPU_EXYNOS4210
285 select S5P_GPIO_INT 286 select EXYNOS4_SETUP_FIMC
286 select S3C_DEV_WDT 287 select EXYNOS4_SETUP_FIMD0
287 select S3C_DEV_RTC 288 select EXYNOS4_SETUP_I2C1
288 select S5P_DEV_FIMD0 289 select EXYNOS4_SETUP_I2C3
290 select EXYNOS4_SETUP_I2C5
291 select EXYNOS4_SETUP_I2C6
292 select EXYNOS4_SETUP_SDHCI
293 select EXYNOS4_SETUP_USB_PHY
294 select EXYNOS_DEV_DMA
295 select EXYNOS_DEV_DRM
289 select S3C_DEV_HSMMC 296 select S3C_DEV_HSMMC
290 select S3C_DEV_HSMMC2 297 select S3C_DEV_HSMMC2
291 select S3C_DEV_HSMMC3 298 select S3C_DEV_HSMMC3
@@ -293,41 +300,42 @@ config MACH_NURI
293 select S3C_DEV_I2C3 300 select S3C_DEV_I2C3
294 select S3C_DEV_I2C5 301 select S3C_DEV_I2C5
295 select S3C_DEV_I2C6 302 select S3C_DEV_I2C6
303 select S3C_DEV_RTC
296 select S3C_DEV_USB_HSOTG 304 select S3C_DEV_USB_HSOTG
305 select S3C_DEV_WDT
297 select S5P_DEV_CSIS0 306 select S5P_DEV_CSIS0
298 select S5P_DEV_JPEG
299 select S5P_DEV_FIMC0 307 select S5P_DEV_FIMC0
300 select S5P_DEV_FIMC1 308 select S5P_DEV_FIMC1
301 select S5P_DEV_FIMC2 309 select S5P_DEV_FIMC2
302 select S5P_DEV_FIMC3 310 select S5P_DEV_FIMC3
311 select S5P_DEV_FIMD0
303 select S5P_DEV_G2D 312 select S5P_DEV_G2D
313 select S5P_DEV_JPEG
304 select S5P_DEV_MFC 314 select S5P_DEV_MFC
305 select S5P_DEV_USB_EHCI 315 select S5P_DEV_USB_EHCI
316 select S5P_GPIO_INT
306 select S5P_SETUP_MIPIPHY 317 select S5P_SETUP_MIPIPHY
307 select EXYNOS_DEV_DMA
308 select EXYNOS_DEV_DRM
309 select EXYNOS4_SETUP_FIMC
310 select EXYNOS4_SETUP_FIMD0
311 select EXYNOS4_SETUP_I2C1
312 select EXYNOS4_SETUP_I2C3
313 select EXYNOS4_SETUP_I2C5
314 select EXYNOS4_SETUP_I2C6
315 select EXYNOS4_SETUP_SDHCI
316 select EXYNOS4_SETUP_USB_PHY
317 select S5P_SETUP_MIPIPHY
318 select SAMSUNG_DEV_PWM
319 select SAMSUNG_DEV_ADC 318 select SAMSUNG_DEV_ADC
319 select SAMSUNG_DEV_PWM
320 help 320 help
321 Machine support for Samsung Mobile NURI Board. 321 Machine support for Samsung Mobile NURI Board.
322 322
323config MACH_ORIGEN 323config MACH_ORIGEN
324 bool "ORIGEN" 324 bool "ORIGEN"
325 select CPU_EXYNOS4210 325 select CPU_EXYNOS4210
326 select S3C_DEV_RTC 326 select EXYNOS4_DEV_USB_OHCI
327 select S3C_DEV_WDT 327 select EXYNOS4_SETUP_FIMD0
328 select EXYNOS4_SETUP_SDHCI
329 select EXYNOS4_SETUP_USB_PHY
330 select EXYNOS_DEV_DMA
331 select EXYNOS_DEV_DRM
332 select EXYNOS_DEV_SYSMMU
333 select S3C24XX_PWM
328 select S3C_DEV_HSMMC 334 select S3C_DEV_HSMMC
329 select S3C_DEV_HSMMC2 335 select S3C_DEV_HSMMC2
336 select S3C_DEV_RTC
330 select S3C_DEV_USB_HSOTG 337 select S3C_DEV_USB_HSOTG
338 select S3C_DEV_WDT
331 select S5P_DEV_FIMC0 339 select S5P_DEV_FIMC0
332 select S5P_DEV_FIMC1 340 select S5P_DEV_FIMC1
333 select S5P_DEV_FIMC2 341 select S5P_DEV_FIMC2
@@ -341,13 +349,6 @@ config MACH_ORIGEN
341 select S5P_DEV_USB_EHCI 349 select S5P_DEV_USB_EHCI
342 select SAMSUNG_DEV_BACKLIGHT 350 select SAMSUNG_DEV_BACKLIGHT
343 select SAMSUNG_DEV_PWM 351 select SAMSUNG_DEV_PWM
344 select EXYNOS_DEV_DRM
345 select EXYNOS_DEV_SYSMMU
346 select EXYNOS_DEV_DMA
347 select EXYNOS4_DEV_USB_OHCI
348 select EXYNOS4_SETUP_FIMD0
349 select EXYNOS4_SETUP_SDHCI
350 select EXYNOS4_SETUP_USB_PHY
351 help 352 help
352 Machine support for ORIGEN based on Samsung EXYNOS4210 353 Machine support for ORIGEN based on Samsung EXYNOS4210
353 354
@@ -355,7 +356,17 @@ comment "EXYNOS4212 Boards"
355 356
356config MACH_SMDK4212 357config MACH_SMDK4212
357 bool "SMDK4212" 358 bool "SMDK4212"
358 select SOC_EXYNOS4212 359 select EXYNOS4_SETUP_FIMD0
360 select EXYNOS4_SETUP_I2C1
361 select EXYNOS4_SETUP_I2C3
362 select EXYNOS4_SETUP_I2C7
363 select EXYNOS4_SETUP_KEYPAD
364 select EXYNOS4_SETUP_SDHCI
365 select EXYNOS4_SETUP_USB_PHY
366 select EXYNOS_DEV_DMA
367 select EXYNOS_DEV_DRM
368 select EXYNOS_DEV_SYSMMU
369 select S3C24XX_PWM
359 select S3C_DEV_HSMMC2 370 select S3C_DEV_HSMMC2
360 select S3C_DEV_HSMMC3 371 select S3C_DEV_HSMMC3
361 select S3C_DEV_I2C1 372 select S3C_DEV_I2C1
@@ -373,16 +384,7 @@ config MACH_SMDK4212
373 select SAMSUNG_DEV_BACKLIGHT 384 select SAMSUNG_DEV_BACKLIGHT
374 select SAMSUNG_DEV_KEYPAD 385 select SAMSUNG_DEV_KEYPAD
375 select SAMSUNG_DEV_PWM 386 select SAMSUNG_DEV_PWM
376 select EXYNOS_DEV_SYSMMU 387 select SOC_EXYNOS4212
377 select EXYNOS_DEV_DMA
378 select EXYNOS_DEV_DRM
379 select EXYNOS4_SETUP_FIMD0
380 select EXYNOS4_SETUP_I2C1
381 select EXYNOS4_SETUP_I2C3
382 select EXYNOS4_SETUP_I2C7
383 select EXYNOS4_SETUP_KEYPAD
384 select EXYNOS4_SETUP_SDHCI
385 select EXYNOS4_SETUP_USB_PHY
386 help 388 help
387 Machine support for Samsung SMDK4212 389 Machine support for Samsung SMDK4212
388 390
@@ -390,8 +392,8 @@ comment "EXYNOS4412 Boards"
390 392
391config MACH_SMDK4412 393config MACH_SMDK4412
392 bool "SMDK4412" 394 bool "SMDK4412"
393 select SOC_EXYNOS4412
394 select MACH_SMDK4212 395 select MACH_SMDK4212
396 select SOC_EXYNOS4412
395 help 397 help
396 Machine support for Samsung SMDK4412 398 Machine support for Samsung SMDK4412
397endif 399endif
@@ -401,10 +403,12 @@ comment "Flattened Device Tree based board for EXYNOS SoCs"
401config MACH_EXYNOS4_DT 403config MACH_EXYNOS4_DT
402 bool "Samsung Exynos4 Machine using device tree" 404 bool "Samsung Exynos4 Machine using device tree"
403 depends on ARCH_EXYNOS4 405 depends on ARCH_EXYNOS4
404 select CPU_EXYNOS4210
405 select USE_OF
406 select ARM_AMBA 406 select ARM_AMBA
407 select CPU_EXYNOS4210
407 select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD 408 select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
409 select PINCTRL
410 select PINCTRL_EXYNOS4
411 select USE_OF
408 help 412 help
409 Machine support for Samsung Exynos4 machine with device tree enabled. 413 Machine support for Samsung Exynos4 machine with device tree enabled.
410 Select this if a fdt blob is available for the Exynos4 SoC based board. 414 Select this if a fdt blob is available for the Exynos4 SoC based board.
@@ -414,12 +418,12 @@ config MACH_EXYNOS4_DT
414config MACH_EXYNOS5_DT 418config MACH_EXYNOS5_DT
415 bool "SAMSUNG EXYNOS5 Machine using device tree" 419 bool "SAMSUNG EXYNOS5 Machine using device tree"
416 depends on ARCH_EXYNOS5 420 depends on ARCH_EXYNOS5
421 select ARM_AMBA
417 select SOC_EXYNOS5250 422 select SOC_EXYNOS5250
418 select USE_OF 423 select USE_OF
419 select ARM_AMBA
420 help 424 help
421 Machine support for Samsung Exynos4 machine with device tree enabled. 425 Machine support for Samsung EXYNOS5 machine with device tree enabled.
422 Select this if a fdt blob is available for the EXYNOS4 SoC based board. 426 Select this if a fdt blob is available for the EXYNOS5 SoC based board.
423 427
424if ARCH_EXYNOS4 428if ARCH_EXYNOS4
425 429
diff --git a/arch/arm/mach-exynos/Makefile.boot b/arch/arm/mach-exynos/Makefile.boot
index 31bd181b051..b9862e22bf1 100644
--- a/arch/arm/mach-exynos/Makefile.boot
+++ b/arch/arm/mach-exynos/Makefile.boot
@@ -1,5 +1,2 @@
1 zreladdr-y += 0x40008000 1 zreladdr-y += 0x40008000
2params_phys-y := 0x40000100 2params_phys-y := 0x40000100
3
4dtb-$(CONFIG_MACH_EXYNOS4_DT) += exynos4210-origen.dtb exynos4210-smdkv310.dtb
5dtb-$(CONFIG_MACH_EXYNOS5_DT) += exynos5250-smdk5250.dtb
diff --git a/arch/arm/mach-exynos/clock-exynos4.c b/arch/arm/mach-exynos/clock-exynos4.c
index 2f51293c187..6a45c9a9abe 100644
--- a/arch/arm/mach-exynos/clock-exynos4.c
+++ b/arch/arm/mach-exynos/clock-exynos4.c
@@ -501,6 +501,10 @@ static struct clk exynos4_init_clocks_off[] = {
501 .enable = exynos4_clk_ip_cam_ctrl, 501 .enable = exynos4_clk_ip_cam_ctrl,
502 .ctrlbit = (1 << 3), 502 .ctrlbit = (1 << 3),
503 }, { 503 }, {
504 .name = "tsi",
505 .enable = exynos4_clk_ip_fsys_ctrl,
506 .ctrlbit = (1 << 4),
507 }, {
504 .name = "hsmmc", 508 .name = "hsmmc",
505 .devname = "exynos4-sdhci.0", 509 .devname = "exynos4-sdhci.0",
506 .parent = &exynos4_clk_aclk_133.clk, 510 .parent = &exynos4_clk_aclk_133.clk,
@@ -530,6 +534,14 @@ static struct clk exynos4_init_clocks_off[] = {
530 .enable = exynos4_clk_ip_fsys_ctrl, 534 .enable = exynos4_clk_ip_fsys_ctrl,
531 .ctrlbit = (1 << 9), 535 .ctrlbit = (1 << 9),
532 }, { 536 }, {
537 .name = "onenand",
538 .enable = exynos4_clk_ip_fsys_ctrl,
539 .ctrlbit = (1 << 15),
540 }, {
541 .name = "nfcon",
542 .enable = exynos4_clk_ip_fsys_ctrl,
543 .ctrlbit = (1 << 16),
544 }, {
533 .name = "dac", 545 .name = "dac",
534 .devname = "s5p-sdo", 546 .devname = "s5p-sdo",
535 .enable = exynos4_clk_ip_tv_ctrl, 547 .enable = exynos4_clk_ip_tv_ctrl,
@@ -615,6 +627,25 @@ static struct clk exynos4_init_clocks_off[] = {
615 .enable = exynos4_clk_ip_peril_ctrl, 627 .enable = exynos4_clk_ip_peril_ctrl,
616 .ctrlbit = (1 << 21), 628 .ctrlbit = (1 << 21),
617 }, { 629 }, {
630 .name = "pcm",
631 .devname = "samsung-pcm.1",
632 .enable = exynos4_clk_ip_peril_ctrl,
633 .ctrlbit = (1 << 22),
634 }, {
635 .name = "pcm",
636 .devname = "samsung-pcm.2",
637 .enable = exynos4_clk_ip_peril_ctrl,
638 .ctrlbit = (1 << 23),
639 }, {
640 .name = "slimbus",
641 .enable = exynos4_clk_ip_peril_ctrl,
642 .ctrlbit = (1 << 25),
643 }, {
644 .name = "spdif",
645 .devname = "samsung-spdif",
646 .enable = exynos4_clk_ip_peril_ctrl,
647 .ctrlbit = (1 << 26),
648 }, {
618 .name = "ac97", 649 .name = "ac97",
619 .devname = "samsung-ac97", 650 .devname = "samsung-ac97",
620 .enable = exynos4_clk_ip_peril_ctrl, 651 .enable = exynos4_clk_ip_peril_ctrl,
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c
index 774533c6706..c44ca1ee1b8 100644
--- a/arch/arm/mach-exynos/clock-exynos5.c
+++ b/arch/arm/mach-exynos/clock-exynos5.c
@@ -166,11 +166,6 @@ static int exynos5_clk_ip_gen_ctrl(struct clk *clk, int enable)
166 return s5p_gatectrl(EXYNOS5_CLKGATE_IP_GEN, clk, enable); 166 return s5p_gatectrl(EXYNOS5_CLKGATE_IP_GEN, clk, enable);
167} 167}
168 168
169static int exynos5_clk_ip_gps_ctrl(struct clk *clk, int enable)
170{
171 return s5p_gatectrl(EXYNOS5_CLKGATE_IP_GPS, clk, enable);
172}
173
174static int exynos5_clk_ip_mfc_ctrl(struct clk *clk, int enable) 169static int exynos5_clk_ip_mfc_ctrl(struct clk *clk, int enable)
175{ 170{
176 return s5p_gatectrl(EXYNOS5_CLKGATE_IP_MFC, clk, enable); 171 return s5p_gatectrl(EXYNOS5_CLKGATE_IP_MFC, clk, enable);
@@ -552,6 +547,68 @@ static struct clksrc_clk exynos5_clk_aclk_66 = {
552 .reg_div = { .reg = EXYNOS5_CLKDIV_TOP0, .shift = 0, .size = 3 }, 547 .reg_div = { .reg = EXYNOS5_CLKDIV_TOP0, .shift = 0, .size = 3 },
553}; 548};
554 549
550static struct clksrc_clk exynos5_clk_mout_aclk_300_gscl_mid = {
551 .clk = {
552 .name = "mout_aclk_300_gscl_mid",
553 },
554 .sources = &exynos5_clkset_aclk,
555 .reg_src = { .reg = EXYNOS5_CLKSRC_TOP0, .shift = 24, .size = 1 },
556};
557
558static struct clk *exynos5_clkset_aclk_300_mid1_list[] = {
559 [0] = &exynos5_clk_sclk_vpll.clk,
560 [1] = &exynos5_clk_mout_cpll.clk,
561};
562
563static struct clksrc_sources exynos5_clkset_aclk_300_gscl_mid1 = {
564 .sources = exynos5_clkset_aclk_300_mid1_list,
565 .nr_sources = ARRAY_SIZE(exynos5_clkset_aclk_300_mid1_list),
566};
567
568static struct clksrc_clk exynos5_clk_mout_aclk_300_gscl_mid1 = {
569 .clk = {
570 .name = "mout_aclk_300_gscl_mid1",
571 },
572 .sources = &exynos5_clkset_aclk_300_gscl_mid1,
573 .reg_src = { .reg = EXYNOS5_CLKSRC_TOP1, .shift = 12, .size = 1 },
574};
575
576static struct clk *exynos5_clkset_aclk_300_gscl_list[] = {
577 [0] = &exynos5_clk_mout_aclk_300_gscl_mid.clk,
578 [1] = &exynos5_clk_mout_aclk_300_gscl_mid1.clk,
579};
580
581static struct clksrc_sources exynos5_clkset_aclk_300_gscl = {
582 .sources = exynos5_clkset_aclk_300_gscl_list,
583 .nr_sources = ARRAY_SIZE(exynos5_clkset_aclk_300_gscl_list),
584};
585
586static struct clksrc_clk exynos5_clk_mout_aclk_300_gscl = {
587 .clk = {
588 .name = "mout_aclk_300_gscl",
589 },
590 .sources = &exynos5_clkset_aclk_300_gscl,
591 .reg_src = { .reg = EXYNOS5_CLKSRC_TOP0, .shift = 25, .size = 1 },
592};
593
594static struct clk *exynos5_clk_src_gscl_300_list[] = {
595 [0] = &clk_ext_xtal_mux,
596 [1] = &exynos5_clk_mout_aclk_300_gscl.clk,
597};
598
599static struct clksrc_sources exynos5_clk_src_gscl_300 = {
600 .sources = exynos5_clk_src_gscl_300_list,
601 .nr_sources = ARRAY_SIZE(exynos5_clk_src_gscl_300_list),
602};
603
604static struct clksrc_clk exynos5_clk_aclk_300_gscl = {
605 .clk = {
606 .name = "aclk_300_gscl",
607 },
608 .sources = &exynos5_clk_src_gscl_300,
609 .reg_src = { .reg = EXYNOS5_CLKSRC_TOP3, .shift = 10, .size = 1 },
610};
611
555static struct clk exynos5_init_clocks_off[] = { 612static struct clk exynos5_init_clocks_off[] = {
556 { 613 {
557 .name = "timers", 614 .name = "timers",
@@ -569,35 +626,30 @@ static struct clk exynos5_init_clocks_off[] = {
569 .enable = exynos5_clk_ip_peris_ctrl, 626 .enable = exynos5_clk_ip_peris_ctrl,
570 .ctrlbit = (1 << 19), 627 .ctrlbit = (1 << 19),
571 }, { 628 }, {
572 .name = "hsmmc", 629 .name = "biu", /* bus interface unit clock */
573 .devname = "exynos4-sdhci.0", 630 .devname = "dw_mmc.0",
574 .parent = &exynos5_clk_aclk_200.clk, 631 .parent = &exynos5_clk_aclk_200.clk,
575 .enable = exynos5_clk_ip_fsys_ctrl, 632 .enable = exynos5_clk_ip_fsys_ctrl,
576 .ctrlbit = (1 << 12), 633 .ctrlbit = (1 << 12),
577 }, { 634 }, {
578 .name = "hsmmc", 635 .name = "biu",
579 .devname = "exynos4-sdhci.1", 636 .devname = "dw_mmc.1",
580 .parent = &exynos5_clk_aclk_200.clk, 637 .parent = &exynos5_clk_aclk_200.clk,
581 .enable = exynos5_clk_ip_fsys_ctrl, 638 .enable = exynos5_clk_ip_fsys_ctrl,
582 .ctrlbit = (1 << 13), 639 .ctrlbit = (1 << 13),
583 }, { 640 }, {
584 .name = "hsmmc", 641 .name = "biu",
585 .devname = "exynos4-sdhci.2", 642 .devname = "dw_mmc.2",
586 .parent = &exynos5_clk_aclk_200.clk, 643 .parent = &exynos5_clk_aclk_200.clk,
587 .enable = exynos5_clk_ip_fsys_ctrl, 644 .enable = exynos5_clk_ip_fsys_ctrl,
588 .ctrlbit = (1 << 14), 645 .ctrlbit = (1 << 14),
589 }, { 646 }, {
590 .name = "hsmmc", 647 .name = "biu",
591 .devname = "exynos4-sdhci.3", 648 .devname = "dw_mmc.3",
592 .parent = &exynos5_clk_aclk_200.clk, 649 .parent = &exynos5_clk_aclk_200.clk,
593 .enable = exynos5_clk_ip_fsys_ctrl, 650 .enable = exynos5_clk_ip_fsys_ctrl,
594 .ctrlbit = (1 << 15), 651 .ctrlbit = (1 << 15),
595 }, { 652 }, {
596 .name = "dwmci",
597 .parent = &exynos5_clk_aclk_200.clk,
598 .enable = exynos5_clk_ip_fsys_ctrl,
599 .ctrlbit = (1 << 16),
600 }, {
601 .name = "sata", 653 .name = "sata",
602 .devname = "ahci", 654 .devname = "ahci",
603 .enable = exynos5_clk_ip_fsys_ctrl, 655 .enable = exynos5_clk_ip_fsys_ctrl,
@@ -672,10 +724,6 @@ static struct clk exynos5_init_clocks_off[] = {
672 .enable = exynos5_clk_ip_fsys_ctrl, 724 .enable = exynos5_clk_ip_fsys_ctrl,
673 .ctrlbit = (1 << 7), 725 .ctrlbit = (1 << 7),
674 }, { 726 }, {
675 .name = "gps",
676 .enable = exynos5_clk_ip_gps_ctrl,
677 .ctrlbit = ((1 << 3) | (1 << 2) | (1 << 0)),
678 }, {
679 .name = "nfcon", 727 .name = "nfcon",
680 .enable = exynos5_clk_ip_fsys_ctrl, 728 .enable = exynos5_clk_ip_fsys_ctrl,
681 .ctrlbit = (1 << 22), 729 .ctrlbit = (1 << 22),
@@ -764,6 +812,26 @@ static struct clk exynos5_init_clocks_off[] = {
764 .enable = exynos5_clk_ip_peric_ctrl, 812 .enable = exynos5_clk_ip_peric_ctrl,
765 .ctrlbit = (1 << 18), 813 .ctrlbit = (1 << 18),
766 }, { 814 }, {
815 .name = "gscl",
816 .devname = "exynos-gsc.0",
817 .enable = exynos5_clk_ip_gscl_ctrl,
818 .ctrlbit = (1 << 0),
819 }, {
820 .name = "gscl",
821 .devname = "exynos-gsc.1",
822 .enable = exynos5_clk_ip_gscl_ctrl,
823 .ctrlbit = (1 << 1),
824 }, {
825 .name = "gscl",
826 .devname = "exynos-gsc.2",
827 .enable = exynos5_clk_ip_gscl_ctrl,
828 .ctrlbit = (1 << 2),
829 }, {
830 .name = "gscl",
831 .devname = "exynos-gsc.3",
832 .enable = exynos5_clk_ip_gscl_ctrl,
833 .ctrlbit = (1 << 3),
834 }, {
767 .name = SYSMMU_CLOCK_NAME, 835 .name = SYSMMU_CLOCK_NAME,
768 .devname = SYSMMU_CLOCK_DEVNAME(mfc_l, 0), 836 .devname = SYSMMU_CLOCK_DEVNAME(mfc_l, 0),
769 .enable = &exynos5_clk_ip_mfc_ctrl, 837 .enable = &exynos5_clk_ip_mfc_ctrl,
@@ -891,6 +959,13 @@ static struct clk exynos5_clk_mdma1 = {
891 .ctrlbit = (1 << 4), 959 .ctrlbit = (1 << 4),
892}; 960};
893 961
962static struct clk exynos5_clk_fimd1 = {
963 .name = "fimd",
964 .devname = "exynos5-fb.1",
965 .enable = exynos5_clk_ip_disp1_ctrl,
966 .ctrlbit = (1 << 0),
967};
968
894struct clk *exynos5_clkset_group_list[] = { 969struct clk *exynos5_clkset_group_list[] = {
895 [0] = &clk_ext_xtal_mux, 970 [0] = &clk_ext_xtal_mux,
896 [1] = NULL, 971 [1] = NULL,
@@ -1015,8 +1090,8 @@ static struct clksrc_clk exynos5_clk_sclk_uart3 = {
1015 1090
1016static struct clksrc_clk exynos5_clk_sclk_mmc0 = { 1091static struct clksrc_clk exynos5_clk_sclk_mmc0 = {
1017 .clk = { 1092 .clk = {
1018 .name = "sclk_mmc", 1093 .name = "ciu", /* card interface unit clock */
1019 .devname = "exynos4-sdhci.0", 1094 .devname = "dw_mmc.0",
1020 .parent = &exynos5_clk_dout_mmc0.clk, 1095 .parent = &exynos5_clk_dout_mmc0.clk,
1021 .enable = exynos5_clksrc_mask_fsys_ctrl, 1096 .enable = exynos5_clksrc_mask_fsys_ctrl,
1022 .ctrlbit = (1 << 0), 1097 .ctrlbit = (1 << 0),
@@ -1026,8 +1101,8 @@ static struct clksrc_clk exynos5_clk_sclk_mmc0 = {
1026 1101
1027static struct clksrc_clk exynos5_clk_sclk_mmc1 = { 1102static struct clksrc_clk exynos5_clk_sclk_mmc1 = {
1028 .clk = { 1103 .clk = {
1029 .name = "sclk_mmc", 1104 .name = "ciu",
1030 .devname = "exynos4-sdhci.1", 1105 .devname = "dw_mmc.1",
1031 .parent = &exynos5_clk_dout_mmc1.clk, 1106 .parent = &exynos5_clk_dout_mmc1.clk,
1032 .enable = exynos5_clksrc_mask_fsys_ctrl, 1107 .enable = exynos5_clksrc_mask_fsys_ctrl,
1033 .ctrlbit = (1 << 4), 1108 .ctrlbit = (1 << 4),
@@ -1037,8 +1112,8 @@ static struct clksrc_clk exynos5_clk_sclk_mmc1 = {
1037 1112
1038static struct clksrc_clk exynos5_clk_sclk_mmc2 = { 1113static struct clksrc_clk exynos5_clk_sclk_mmc2 = {
1039 .clk = { 1114 .clk = {
1040 .name = "sclk_mmc", 1115 .name = "ciu",
1041 .devname = "exynos4-sdhci.2", 1116 .devname = "dw_mmc.2",
1042 .parent = &exynos5_clk_dout_mmc2.clk, 1117 .parent = &exynos5_clk_dout_mmc2.clk,
1043 .enable = exynos5_clksrc_mask_fsys_ctrl, 1118 .enable = exynos5_clksrc_mask_fsys_ctrl,
1044 .ctrlbit = (1 << 8), 1119 .ctrlbit = (1 << 8),
@@ -1048,8 +1123,8 @@ static struct clksrc_clk exynos5_clk_sclk_mmc2 = {
1048 1123
1049static struct clksrc_clk exynos5_clk_sclk_mmc3 = { 1124static struct clksrc_clk exynos5_clk_sclk_mmc3 = {
1050 .clk = { 1125 .clk = {
1051 .name = "sclk_mmc", 1126 .name = "ciu",
1052 .devname = "exynos4-sdhci.3", 1127 .devname = "dw_mmc.3",
1053 .parent = &exynos5_clk_dout_mmc3.clk, 1128 .parent = &exynos5_clk_dout_mmc3.clk,
1054 .enable = exynos5_clksrc_mask_fsys_ctrl, 1129 .enable = exynos5_clksrc_mask_fsys_ctrl,
1055 .ctrlbit = (1 << 12), 1130 .ctrlbit = (1 << 12),
@@ -1120,27 +1195,21 @@ static struct clksrc_clk exynos5_clk_sclk_spi2 = {
1120 .reg_div = { .reg = EXYNOS5_CLKDIV_PERIC2, .shift = 8, .size = 8 }, 1195 .reg_div = { .reg = EXYNOS5_CLKDIV_PERIC2, .shift = 8, .size = 8 },
1121}; 1196};
1122 1197
1198struct clksrc_clk exynos5_clk_sclk_fimd1 = {
1199 .clk = {
1200 .name = "sclk_fimd",
1201 .devname = "exynos5-fb.1",
1202 .enable = exynos5_clksrc_mask_disp1_0_ctrl,
1203 .ctrlbit = (1 << 0),
1204 },
1205 .sources = &exynos5_clkset_group,
1206 .reg_src = { .reg = EXYNOS5_CLKSRC_DISP1_0, .shift = 0, .size = 4 },
1207 .reg_div = { .reg = EXYNOS5_CLKDIV_DISP1_0, .shift = 0, .size = 4 },
1208};
1209
1123static struct clksrc_clk exynos5_clksrcs[] = { 1210static struct clksrc_clk exynos5_clksrcs[] = {
1124 { 1211 {
1125 .clk = { 1212 .clk = {
1126 .name = "sclk_dwmci",
1127 .parent = &exynos5_clk_dout_mmc4.clk,
1128 .enable = exynos5_clksrc_mask_fsys_ctrl,
1129 .ctrlbit = (1 << 16),
1130 },
1131 .reg_div = { .reg = EXYNOS5_CLKDIV_FSYS3, .shift = 8, .size = 8 },
1132 }, {
1133 .clk = {
1134 .name = "sclk_fimd",
1135 .devname = "s3cfb.1",
1136 .enable = exynos5_clksrc_mask_disp1_0_ctrl,
1137 .ctrlbit = (1 << 0),
1138 },
1139 .sources = &exynos5_clkset_group,
1140 .reg_src = { .reg = EXYNOS5_CLKSRC_DISP1_0, .shift = 0, .size = 4 },
1141 .reg_div = { .reg = EXYNOS5_CLKDIV_DISP1_0, .shift = 0, .size = 4 },
1142 }, {
1143 .clk = {
1144 .name = "aclk_266_gscl", 1213 .name = "aclk_266_gscl",
1145 }, 1214 },
1146 .sources = &clk_src_gscl_266, 1215 .sources = &clk_src_gscl_266,
@@ -1225,6 +1294,10 @@ static struct clksrc_clk *exynos5_sysclks[] = {
1225 &exynos5_clk_aclk_266, 1294 &exynos5_clk_aclk_266,
1226 &exynos5_clk_aclk_200, 1295 &exynos5_clk_aclk_200,
1227 &exynos5_clk_aclk_166, 1296 &exynos5_clk_aclk_166,
1297 &exynos5_clk_aclk_300_gscl,
1298 &exynos5_clk_mout_aclk_300_gscl,
1299 &exynos5_clk_mout_aclk_300_gscl_mid,
1300 &exynos5_clk_mout_aclk_300_gscl_mid1,
1228 &exynos5_clk_aclk_66_pre, 1301 &exynos5_clk_aclk_66_pre,
1229 &exynos5_clk_aclk_66, 1302 &exynos5_clk_aclk_66,
1230 &exynos5_clk_dout_mmc0, 1303 &exynos5_clk_dout_mmc0,
@@ -1240,12 +1313,14 @@ static struct clksrc_clk *exynos5_sysclks[] = {
1240 &exynos5_clk_mdout_spi0, 1313 &exynos5_clk_mdout_spi0,
1241 &exynos5_clk_mdout_spi1, 1314 &exynos5_clk_mdout_spi1,
1242 &exynos5_clk_mdout_spi2, 1315 &exynos5_clk_mdout_spi2,
1316 &exynos5_clk_sclk_fimd1,
1243}; 1317};
1244 1318
1245static struct clk *exynos5_clk_cdev[] = { 1319static struct clk *exynos5_clk_cdev[] = {
1246 &exynos5_clk_pdma0, 1320 &exynos5_clk_pdma0,
1247 &exynos5_clk_pdma1, 1321 &exynos5_clk_pdma1,
1248 &exynos5_clk_mdma1, 1322 &exynos5_clk_mdma1,
1323 &exynos5_clk_fimd1,
1249}; 1324};
1250 1325
1251static struct clksrc_clk *exynos5_clksrc_cdev[] = { 1326static struct clksrc_clk *exynos5_clksrc_cdev[] = {
@@ -1274,6 +1349,7 @@ static struct clk_lookup exynos5_clk_lookup[] = {
1274 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos5_clk_pdma0), 1349 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos5_clk_pdma0),
1275 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos5_clk_pdma1), 1350 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos5_clk_pdma1),
1276 CLKDEV_INIT("dma-pl330.2", "apb_pclk", &exynos5_clk_mdma1), 1351 CLKDEV_INIT("dma-pl330.2", "apb_pclk", &exynos5_clk_mdma1),
1352 CLKDEV_INIT("exynos5-fb.1", "lcd", &exynos5_clk_fimd1),
1277}; 1353};
1278 1354
1279static unsigned long exynos5_epll_get_rate(struct clk *clk) 1355static unsigned long exynos5_epll_get_rate(struct clk *clk)
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 4eb39cdf75e..715b690e500 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -980,6 +980,32 @@ static int __init exynos_init_irq_eint(void)
980{ 980{
981 int irq; 981 int irq;
982 982
983#ifdef CONFIG_PINCTRL_SAMSUNG
984 /*
985 * The Samsung pinctrl driver provides an integrated gpio/pinmux/pinconf
986 * functionality along with support for external gpio and wakeup
987 * interrupts. If the samsung pinctrl driver is enabled and includes
988 * the wakeup interrupt support, then the setting up external wakeup
989 * interrupts here can be skipped. This check here is temporary to
990 * allow exynos4 platforms that do not use Samsung pinctrl driver to
991 * co-exist with platforms that do. When all of the Samsung Exynos4
992 * platforms switch over to using the pinctrl driver, the wakeup
993 * interrupt support code here can be completely removed.
994 */
995 struct device_node *pctrl_np, *wkup_np;
996 const char *pctrl_compat = "samsung,pinctrl-exynos4210";
997 const char *wkup_compat = "samsung,exynos4210-wakeup-eint";
998
999 for_each_compatible_node(pctrl_np, NULL, pctrl_compat) {
1000 if (of_device_is_available(pctrl_np)) {
1001 wkup_np = of_find_compatible_node(pctrl_np, NULL,
1002 wkup_compat);
1003 if (wkup_np)
1004 return -ENODEV;
1005 }
1006 }
1007#endif
1008
983 if (soc_is_exynos5250()) 1009 if (soc_is_exynos5250())
984 exynos_eint_base = ioremap(EXYNOS5_PA_GPIO1, SZ_4K); 1010 exynos_eint_base = ioremap(EXYNOS5_PA_GPIO1, SZ_4K);
985 else 1011 else
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index aed2eeb0651..dac146df79a 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -14,6 +14,7 @@
14 14
15extern struct sys_timer exynos4_timer; 15extern struct sys_timer exynos4_timer;
16 16
17struct map_desc;
17void exynos_init_io(struct map_desc *mach_desc, int size); 18void exynos_init_io(struct map_desc *mach_desc, int size);
18void exynos4_init_irq(void); 19void exynos4_init_irq(void);
19void exynos5_init_irq(void); 20void exynos5_init_irq(void);
@@ -59,4 +60,8 @@ void exynos4212_register_clocks(void);
59#define exynos4212_register_clocks() 60#define exynos4212_register_clocks()
60#endif 61#endif
61 62
63extern struct smp_operations exynos_smp_ops;
64
65extern void exynos_cpu_die(unsigned int cpu);
66
62#endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ 67#endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */
diff --git a/arch/arm/mach-exynos/dev-audio.c b/arch/arm/mach-exynos/dev-audio.c
index b33a5b67b54..ae321c7cb15 100644
--- a/arch/arm/mach-exynos/dev-audio.c
+++ b/arch/arm/mach-exynos/dev-audio.c
@@ -16,7 +16,7 @@
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17 17
18#include <plat/gpio-cfg.h> 18#include <plat/gpio-cfg.h>
19#include <plat/audio.h> 19#include <linux/platform_data/asoc-s3c.h>
20 20
21#include <mach/map.h> 21#include <mach/map.h>
22#include <mach/dma.h> 22#include <mach/dma.h>
diff --git a/arch/arm/mach-exynos/dev-ohci.c b/arch/arm/mach-exynos/dev-ohci.c
index b8e75300c77..14ed7951a2c 100644
--- a/arch/arm/mach-exynos/dev-ohci.c
+++ b/arch/arm/mach-exynos/dev-ohci.c
@@ -15,7 +15,7 @@
15 15
16#include <mach/irqs.h> 16#include <mach/irqs.h>
17#include <mach/map.h> 17#include <mach/map.h>
18#include <mach/ohci.h> 18#include <linux/platform_data/usb-exynos.h>
19 19
20#include <plat/devs.h> 20#include <plat/devs.h>
21#include <plat/usb-phy.h> 21#include <plat/usb-phy.h>
diff --git a/arch/arm/mach-exynos/dma.c b/arch/arm/mach-exynos/dma.c
index f60b66dbcf8..21d568b3b14 100644
--- a/arch/arm/mach-exynos/dma.c
+++ b/arch/arm/mach-exynos/dma.c
@@ -303,10 +303,12 @@ static int __init exynos_dma_init(void)
303 303
304 dma_cap_set(DMA_SLAVE, exynos_pdma0_pdata.cap_mask); 304 dma_cap_set(DMA_SLAVE, exynos_pdma0_pdata.cap_mask);
305 dma_cap_set(DMA_CYCLIC, exynos_pdma0_pdata.cap_mask); 305 dma_cap_set(DMA_CYCLIC, exynos_pdma0_pdata.cap_mask);
306 dma_cap_set(DMA_PRIVATE, exynos_pdma0_pdata.cap_mask);
306 amba_device_register(&exynos_pdma0_device, &iomem_resource); 307 amba_device_register(&exynos_pdma0_device, &iomem_resource);
307 308
308 dma_cap_set(DMA_SLAVE, exynos_pdma1_pdata.cap_mask); 309 dma_cap_set(DMA_SLAVE, exynos_pdma1_pdata.cap_mask);
309 dma_cap_set(DMA_CYCLIC, exynos_pdma1_pdata.cap_mask); 310 dma_cap_set(DMA_CYCLIC, exynos_pdma1_pdata.cap_mask);
311 dma_cap_set(DMA_PRIVATE, exynos_pdma1_pdata.cap_mask);
310 amba_device_register(&exynos_pdma1_device, &iomem_resource); 312 amba_device_register(&exynos_pdma1_device, &iomem_resource);
311 313
312 dma_cap_set(DMA_MEMCPY, exynos_mdma1_pdata.cap_mask); 314 dma_cap_set(DMA_MEMCPY, exynos_mdma1_pdata.cap_mask);
diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c
index 9c17a0a4385..f4d7dd20cda 100644
--- a/arch/arm/mach-exynos/hotplug.c
+++ b/arch/arm/mach-exynos/hotplug.c
@@ -21,7 +21,7 @@
21 21
22#include <mach/regs-pmu.h> 22#include <mach/regs-pmu.h>
23 23
24extern volatile int pen_release; 24#include "common.h"
25 25
26static inline void cpu_enter_lowpower(void) 26static inline void cpu_enter_lowpower(void)
27{ 27{
@@ -95,17 +95,12 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
95 } 95 }
96} 96}
97 97
98int platform_cpu_kill(unsigned int cpu)
99{
100 return 1;
101}
102
103/* 98/*
104 * platform-specific code to shutdown a CPU 99 * platform-specific code to shutdown a CPU
105 * 100 *
106 * Called with IRQs disabled 101 * Called with IRQs disabled
107 */ 102 */
108void platform_cpu_die(unsigned int cpu) 103void __ref exynos_cpu_die(unsigned int cpu)
109{ 104{
110 int spurious = 0; 105 int spurious = 0;
111 106
@@ -124,12 +119,3 @@ void platform_cpu_die(unsigned int cpu)
124 if (spurious) 119 if (spurious)
125 pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); 120 pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
126} 121}
127
128int platform_cpu_disable(unsigned int cpu)
129{
130 /*
131 * we don't allow CPU 0 to be shutdown (it is still too special
132 * e.g. clock tick interrupts)
133 */
134 return cpu == 0 ? -EPERM : 0;
135}
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index c72b675b3e4..8480849affb 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -89,7 +89,7 @@
89#define EXYNOS4_PA_L2CC 0x10502000 89#define EXYNOS4_PA_L2CC 0x10502000
90 90
91#define EXYNOS4_PA_MDMA0 0x10810000 91#define EXYNOS4_PA_MDMA0 0x10810000
92#define EXYNOS4_PA_MDMA1 0x12840000 92#define EXYNOS4_PA_MDMA1 0x12850000
93#define EXYNOS4_PA_PDMA0 0x12680000 93#define EXYNOS4_PA_PDMA0 0x12680000
94#define EXYNOS4_PA_PDMA1 0x12690000 94#define EXYNOS4_PA_PDMA1 0x12690000
95#define EXYNOS5_PA_MDMA0 0x10800000 95#define EXYNOS5_PA_MDMA0 0x10800000
@@ -121,6 +121,11 @@
121#define EXYNOS4_PA_SYSMMU_MFC_L 0x13620000 121#define EXYNOS4_PA_SYSMMU_MFC_L 0x13620000
122#define EXYNOS4_PA_SYSMMU_MFC_R 0x13630000 122#define EXYNOS4_PA_SYSMMU_MFC_R 0x13630000
123 123
124#define EXYNOS5_PA_GSC0 0x13E00000
125#define EXYNOS5_PA_GSC1 0x13E10000
126#define EXYNOS5_PA_GSC2 0x13E20000
127#define EXYNOS5_PA_GSC3 0x13E30000
128
124#define EXYNOS5_PA_SYSMMU_MDMA1 0x10A40000 129#define EXYNOS5_PA_SYSMMU_MDMA1 0x10A40000
125#define EXYNOS5_PA_SYSMMU_SSS 0x10A50000 130#define EXYNOS5_PA_SYSMMU_SSS 0x10A50000
126#define EXYNOS5_PA_SYSMMU_2D 0x10A60000 131#define EXYNOS5_PA_SYSMMU_2D 0x10A60000
@@ -131,7 +136,6 @@
131#define EXYNOS5_PA_SYSMMU_JPEG 0x11F20000 136#define EXYNOS5_PA_SYSMMU_JPEG 0x11F20000
132#define EXYNOS5_PA_SYSMMU_IOP 0x12360000 137#define EXYNOS5_PA_SYSMMU_IOP 0x12360000
133#define EXYNOS5_PA_SYSMMU_RTIC 0x12370000 138#define EXYNOS5_PA_SYSMMU_RTIC 0x12370000
134#define EXYNOS5_PA_SYSMMU_GPS 0x12630000
135#define EXYNOS5_PA_SYSMMU_ISP 0x13260000 139#define EXYNOS5_PA_SYSMMU_ISP 0x13260000
136#define EXYNOS5_PA_SYSMMU_DRC 0x12370000 140#define EXYNOS5_PA_SYSMMU_DRC 0x12370000
137#define EXYNOS5_PA_SYSMMU_SCALERC 0x13280000 141#define EXYNOS5_PA_SYSMMU_SCALERC 0x13280000
@@ -173,6 +177,10 @@
173 177
174#define EXYNOS4_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000)) 178#define EXYNOS4_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000))
175#define EXYNOS4_PA_DWMCI 0x12550000 179#define EXYNOS4_PA_DWMCI 0x12550000
180#define EXYNOS5_PA_DWMCI0 0x12200000
181#define EXYNOS5_PA_DWMCI1 0x12210000
182#define EXYNOS5_PA_DWMCI2 0x12220000
183#define EXYNOS5_PA_DWMCI3 0x12230000
176 184
177#define EXYNOS4_PA_HSOTG 0x12480000 185#define EXYNOS4_PA_HSOTG 0x12480000
178#define EXYNOS4_PA_USB_HSPHY 0x125B0000 186#define EXYNOS4_PA_USB_HSPHY 0x125B0000
diff --git a/arch/arm/mach-exynos/include/mach/ohci.h b/arch/arm/mach-exynos/include/mach/ohci.h
deleted file mode 100644
index c256c595be5..00000000000
--- a/arch/arm/mach-exynos/include/mach/ohci.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co.Ltd
3 * http://www.samsung.com/
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __MACH_EXYNOS_OHCI_H
12#define __MACH_EXYNOS_OHCI_H
13
14struct exynos4_ohci_platdata {
15 int (*phy_init)(struct platform_device *pdev, int type);
16 int (*phy_exit)(struct platform_device *pdev, int type);
17};
18
19extern void exynos4_ohci_set_platdata(struct exynos4_ohci_platdata *pd);
20
21#endif /* __MACH_EXYNOS_OHCI_H */
diff --git a/arch/arm/mach-exynos/include/mach/sysmmu.h b/arch/arm/mach-exynos/include/mach/sysmmu.h
index 998daf2add9..88a4543b000 100644
--- a/arch/arm/mach-exynos/include/mach/sysmmu.h
+++ b/arch/arm/mach-exynos/include/mach/sysmmu.h
@@ -58,7 +58,7 @@ static inline void platform_set_sysmmu(
58#endif 58#endif
59 59
60#else /* !CONFIG_EXYNOS_DEV_SYSMMU */ 60#else /* !CONFIG_EXYNOS_DEV_SYSMMU */
61#define platform_set_sysmmu(dev, sysmmu) do { } while (0) 61#define platform_set_sysmmu(sysmmu, dev) do { } while (0)
62#endif 62#endif
63 63
64#define SYSMMU_CLOCK_DEVNAME(ipname, id) (SYSMMU_DEVNAME_BASE "." #id) 64#define SYSMMU_CLOCK_DEVNAME(ipname, id) (SYSMMU_DEVNAME_BASE "." #id)
diff --git a/arch/arm/mach-exynos/mach-armlex4210.c b/arch/arm/mach-exynos/mach-armlex4210.c
index 5a3daa0168d..3f37a5e8a1f 100644
--- a/arch/arm/mach-exynos/mach-armlex4210.c
+++ b/arch/arm/mach-exynos/mach-armlex4210.c
@@ -199,6 +199,7 @@ static void __init armlex4210_machine_init(void)
199MACHINE_START(ARMLEX4210, "ARMLEX4210") 199MACHINE_START(ARMLEX4210, "ARMLEX4210")
200 /* Maintainer: Alim Akhtar <alim.akhtar@samsung.com> */ 200 /* Maintainer: Alim Akhtar <alim.akhtar@samsung.com> */
201 .atag_offset = 0x100, 201 .atag_offset = 0x100,
202 .smp = smp_ops(exynos_smp_ops),
202 .init_irq = exynos4_init_irq, 203 .init_irq = exynos4_init_irq,
203 .map_io = armlex4210_map_io, 204 .map_io = armlex4210_map_io,
204 .handle_irq = gic_handle_irq, 205 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c
index b2b5d5faa74..e58d786faf7 100644
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Samsung's Exynos4210 flattened device tree enabled machine 2 * Samsung's EXYNOS4 flattened device tree enabled machine
3 * 3 *
4 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 4 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com 5 * http://www.samsung.com
@@ -36,7 +36,7 @@
36 * at some point, the drivers should be capable of parsing all the platform 36 * at some point, the drivers should be capable of parsing all the platform
37 * data from the device tree. 37 * data from the device tree.
38 */ 38 */
39static const struct of_dev_auxdata exynos4210_auxdata_lookup[] __initconst = { 39static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = {
40 OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART0, 40 OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART0,
41 "exynos4210-uart.0", NULL), 41 "exynos4210-uart.0", NULL),
42 OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART1, 42 OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART1,
@@ -55,6 +55,20 @@ static const struct of_dev_auxdata exynos4210_auxdata_lookup[] __initconst = {
55 "exynos4-sdhci.3", NULL), 55 "exynos4-sdhci.3", NULL),
56 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(0), 56 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(0),
57 "s3c2440-i2c.0", NULL), 57 "s3c2440-i2c.0", NULL),
58 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(1),
59 "s3c2440-i2c.1", NULL),
60 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(2),
61 "s3c2440-i2c.2", NULL),
62 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(3),
63 "s3c2440-i2c.3", NULL),
64 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(4),
65 "s3c2440-i2c.4", NULL),
66 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(5),
67 "s3c2440-i2c.5", NULL),
68 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(6),
69 "s3c2440-i2c.6", NULL),
70 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(7),
71 "s3c2440-i2c.7", NULL),
58 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS4_PA_SPI0, 72 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS4_PA_SPI0,
59 "exynos4210-spi.0", NULL), 73 "exynos4210-spi.0", NULL),
60 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS4_PA_SPI1, 74 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS4_PA_SPI1,
@@ -66,19 +80,19 @@ static const struct of_dev_auxdata exynos4210_auxdata_lookup[] __initconst = {
66 {}, 80 {},
67}; 81};
68 82
69static void __init exynos4210_dt_map_io(void) 83static void __init exynos4_dt_map_io(void)
70{ 84{
71 exynos_init_io(NULL, 0); 85 exynos_init_io(NULL, 0);
72 s3c24xx_init_clocks(24000000); 86 s3c24xx_init_clocks(24000000);
73} 87}
74 88
75static void __init exynos4210_dt_machine_init(void) 89static void __init exynos4_dt_machine_init(void)
76{ 90{
77 of_platform_populate(NULL, of_default_bus_match_table, 91 of_platform_populate(NULL, of_default_bus_match_table,
78 exynos4210_auxdata_lookup, NULL); 92 exynos4_auxdata_lookup, NULL);
79} 93}
80 94
81static char const *exynos4210_dt_compat[] __initdata = { 95static char const *exynos4_dt_compat[] __initdata = {
82 "samsung,exynos4210", 96 "samsung,exynos4210",
83 NULL 97 NULL
84}; 98};
@@ -86,11 +100,11 @@ static char const *exynos4210_dt_compat[] __initdata = {
86DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") 100DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
87 /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */ 101 /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */
88 .init_irq = exynos4_init_irq, 102 .init_irq = exynos4_init_irq,
89 .map_io = exynos4210_dt_map_io, 103 .map_io = exynos4_dt_map_io,
90 .handle_irq = gic_handle_irq, 104 .handle_irq = gic_handle_irq,
91 .init_machine = exynos4210_dt_machine_init, 105 .init_machine = exynos4_dt_machine_init,
92 .init_late = exynos_init_late, 106 .init_late = exynos_init_late,
93 .timer = &exynos4_timer, 107 .timer = &exynos4_timer,
94 .dt_compat = exynos4210_dt_compat, 108 .dt_compat = exynos4_dt_compat,
95 .restart = exynos4_restart, 109 .restart = exynos4_restart,
96MACHINE_END 110MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
index ef770bc2318..db1cd8eacf2 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -47,6 +47,14 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
47 "s3c2440-i2c.0", NULL), 47 "s3c2440-i2c.0", NULL),
48 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(1), 48 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(1),
49 "s3c2440-i2c.1", NULL), 49 "s3c2440-i2c.1", NULL),
50 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI0,
51 "dw_mmc.0", NULL),
52 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI1,
53 "dw_mmc.1", NULL),
54 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI2,
55 "dw_mmc.2", NULL),
56 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI3,
57 "dw_mmc.3", NULL),
50 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS5_PA_SPI0, 58 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS5_PA_SPI0,
51 "exynos4210-spi.0", NULL), 59 "exynos4210-spi.0", NULL),
52 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS5_PA_SPI1, 60 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS5_PA_SPI1,
@@ -56,6 +64,14 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
56 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA0, "dma-pl330.0", NULL), 64 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA0, "dma-pl330.0", NULL),
57 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA1, "dma-pl330.1", NULL), 65 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA1, "dma-pl330.1", NULL),
58 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_MDMA1, "dma-pl330.2", NULL), 66 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_MDMA1, "dma-pl330.2", NULL),
67 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC0,
68 "exynos-gsc.0", NULL),
69 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC1,
70 "exynos-gsc.1", NULL),
71 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC2,
72 "exynos-gsc.2", NULL),
73 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3,
74 "exynos-gsc.3", NULL),
59 {}, 75 {},
60}; 76};
61 77
@@ -79,6 +95,7 @@ static char const *exynos5250_dt_compat[] __initdata = {
79DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") 95DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
80 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 96 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
81 .init_irq = exynos5_init_irq, 97 .init_irq = exynos5_init_irq,
98 .smp = smp_ops(exynos_smp_ops),
82 .map_io = exynos5250_dt_map_io, 99 .map_io = exynos5250_dt_map_io,
83 .handle_irq = gic_handle_irq, 100 .handle_irq = gic_handle_irq,
84 .init_machine = exynos5250_dt_machine_init, 101 .init_machine = exynos5250_dt_machine_init,
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index ea785fcaf6c..c05d7aa8403 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -29,6 +29,7 @@
29#include <drm/exynos_drm.h> 29#include <drm/exynos_drm.h>
30 30
31#include <video/platform_lcd.h> 31#include <video/platform_lcd.h>
32#include <video/samsung_fimd.h>
32#include <media/m5mols.h> 33#include <media/m5mols.h>
33#include <media/s5k6aa.h> 34#include <media/s5k6aa.h>
34#include <media/s5p_fimc.h> 35#include <media/s5p_fimc.h>
@@ -39,20 +40,19 @@
39#include <asm/mach-types.h> 40#include <asm/mach-types.h>
40 41
41#include <plat/adc.h> 42#include <plat/adc.h>
42#include <plat/regs-fb-v4.h>
43#include <plat/regs-serial.h> 43#include <plat/regs-serial.h>
44#include <plat/cpu.h> 44#include <plat/cpu.h>
45#include <plat/devs.h> 45#include <plat/devs.h>
46#include <plat/fb.h> 46#include <plat/fb.h>
47#include <plat/sdhci.h> 47#include <plat/sdhci.h>
48#include <plat/ehci.h> 48#include <linux/platform_data/usb-ehci-s5p.h>
49#include <plat/clock.h> 49#include <plat/clock.h>
50#include <plat/gpio-cfg.h> 50#include <plat/gpio-cfg.h>
51#include <plat/iic.h> 51#include <linux/platform_data/i2c-s3c2410.h>
52#include <plat/mfc.h> 52#include <plat/mfc.h>
53#include <plat/fimc-core.h> 53#include <plat/fimc-core.h>
54#include <plat/camport.h> 54#include <plat/camport.h>
55#include <plat/mipi_csis.h> 55#include <linux/platform_data/mipi-csis.h>
56 56
57#include <mach/map.h> 57#include <mach/map.h>
58 58
@@ -378,10 +378,10 @@ static struct regulator_consumer_supply __initdata max8997_ldo1_[] = {
378}; 378};
379static struct regulator_consumer_supply __initdata max8997_ldo3_[] = { 379static struct regulator_consumer_supply __initdata max8997_ldo3_[] = {
380 REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"), /* USB */ 380 REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"), /* USB */
381 REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), /* MIPI */ 381 REGULATOR_SUPPLY("vddcore", "s5p-mipi-csis.0"), /* MIPI */
382}; 382};
383static struct regulator_consumer_supply __initdata max8997_ldo4_[] = { 383static struct regulator_consumer_supply __initdata max8997_ldo4_[] = {
384 REGULATOR_SUPPLY("vdd18", "s5p-mipi-csis.0"), /* MIPI */ 384 REGULATOR_SUPPLY("vddio", "s5p-mipi-csis.0"), /* MIPI */
385}; 385};
386static struct regulator_consumer_supply __initdata max8997_ldo5_[] = { 386static struct regulator_consumer_supply __initdata max8997_ldo5_[] = {
387 REGULATOR_SUPPLY("vhsic", "modemctl"), /* MODEM */ 387 REGULATOR_SUPPLY("vhsic", "modemctl"), /* MODEM */
@@ -1180,9 +1180,7 @@ static struct platform_device cam_8m_12v_fixed_rdev = {
1180static struct s5p_platform_mipi_csis mipi_csis_platdata = { 1180static struct s5p_platform_mipi_csis mipi_csis_platdata = {
1181 .clk_rate = 166000000UL, 1181 .clk_rate = 166000000UL,
1182 .lanes = 2, 1182 .lanes = 2,
1183 .alignment = 32,
1184 .hs_settle = 12, 1183 .hs_settle = 12,
1185 .phy_enable = s5p_csis_phy_enable,
1186}; 1184};
1187 1185
1188#define GPIO_CAM_MEGA_RST EXYNOS4_GPY3(7) /* ISP_RESET */ 1186#define GPIO_CAM_MEGA_RST EXYNOS4_GPY3(7) /* ISP_RESET */
@@ -1226,7 +1224,6 @@ static struct s5p_fimc_isp_info nuri_camera_sensors[] = {
1226 .bus_type = FIMC_MIPI_CSI2, 1224 .bus_type = FIMC_MIPI_CSI2,
1227 .board_info = &m5mols_board_info, 1225 .board_info = &m5mols_board_info,
1228 .clk_frequency = 24000000UL, 1226 .clk_frequency = 24000000UL,
1229 .csi_data_align = 32,
1230 }, 1227 },
1231}; 1228};
1232 1229
@@ -1383,6 +1380,7 @@ static void __init nuri_machine_init(void)
1383MACHINE_START(NURI, "NURI") 1380MACHINE_START(NURI, "NURI")
1384 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ 1381 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
1385 .atag_offset = 0x100, 1382 .atag_offset = 0x100,
1383 .smp = smp_ops(exynos_smp_ops),
1386 .init_irq = exynos4_init_irq, 1384 .init_irq = exynos4_init_irq,
1387 .map_io = nuri_map_io, 1385 .map_io = nuri_map_io,
1388 .handle_irq = gic_handle_irq, 1386 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
index 4e574c24581..9adf491674e 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -15,6 +15,7 @@
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/input.h> 17#include <linux/input.h>
18#include <linux/pwm.h>
18#include <linux/pwm_backlight.h> 19#include <linux/pwm_backlight.h>
19#include <linux/gpio_keys.h> 20#include <linux/gpio_keys.h>
20#include <linux/i2c.h> 21#include <linux/i2c.h>
@@ -29,14 +30,14 @@
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
30 31
31#include <video/platform_lcd.h> 32#include <video/platform_lcd.h>
33#include <video/samsung_fimd.h>
32 34
33#include <plat/regs-serial.h> 35#include <plat/regs-serial.h>
34#include <plat/regs-fb-v4.h>
35#include <plat/cpu.h> 36#include <plat/cpu.h>
36#include <plat/devs.h> 37#include <plat/devs.h>
37#include <plat/sdhci.h> 38#include <plat/sdhci.h>
38#include <plat/iic.h> 39#include <linux/platform_data/i2c-s3c2410.h>
39#include <plat/ehci.h> 40#include <linux/platform_data/usb-ehci-s5p.h>
40#include <plat/clock.h> 41#include <plat/clock.h>
41#include <plat/gpio-cfg.h> 42#include <plat/gpio-cfg.h>
42#include <plat/backlight.h> 43#include <plat/backlight.h>
@@ -44,7 +45,7 @@
44#include <plat/mfc.h> 45#include <plat/mfc.h>
45#include <plat/hdmi.h> 46#include <plat/hdmi.h>
46 47
47#include <mach/ohci.h> 48#include <linux/platform_data/usb-exynos.h>
48#include <mach/map.h> 49#include <mach/map.h>
49 50
50#include <drm/exynos_drm.h> 51#include <drm/exynos_drm.h>
@@ -96,12 +97,12 @@ static struct s3c2410_uartcfg origen_uartcfgs[] __initdata = {
96}; 97};
97 98
98static struct regulator_consumer_supply __initdata ldo3_consumer[] = { 99static struct regulator_consumer_supply __initdata ldo3_consumer[] = {
99 REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), /* MIPI */ 100 REGULATOR_SUPPLY("vddcore", "s5p-mipi-csis.0"), /* MIPI */
100 REGULATOR_SUPPLY("vdd", "exynos4-hdmi"), /* HDMI */ 101 REGULATOR_SUPPLY("vdd", "exynos4-hdmi"), /* HDMI */
101 REGULATOR_SUPPLY("vdd_pll", "exynos4-hdmi"), /* HDMI */ 102 REGULATOR_SUPPLY("vdd_pll", "exynos4-hdmi"), /* HDMI */
102}; 103};
103static struct regulator_consumer_supply __initdata ldo6_consumer[] = { 104static struct regulator_consumer_supply __initdata ldo6_consumer[] = {
104 REGULATOR_SUPPLY("vdd18", "s5p-mipi-csis.0"), /* MIPI */ 105 REGULATOR_SUPPLY("vddio", "s5p-mipi-csis.0"), /* MIPI */
105}; 106};
106static struct regulator_consumer_supply __initdata ldo7_consumer[] = { 107static struct regulator_consumer_supply __initdata ldo7_consumer[] = {
107 REGULATOR_SUPPLY("avdd", "alc5625"), /* Realtek ALC5625 */ 108 REGULATOR_SUPPLY("avdd", "alc5625"), /* Realtek ALC5625 */
@@ -614,6 +615,10 @@ static struct platform_device origen_lcd_hv070wsa = {
614 .dev.platform_data = &origen_lcd_hv070wsa_data, 615 .dev.platform_data = &origen_lcd_hv070wsa_data,
615}; 616};
616 617
618static struct pwm_lookup origen_pwm_lookup[] = {
619 PWM_LOOKUP("s3c24xx-pwm.0", 0, "pwm-backlight.0", NULL),
620};
621
617#ifdef CONFIG_DRM_EXYNOS 622#ifdef CONFIG_DRM_EXYNOS
618static struct exynos_drm_fimd_pdata drm_fimd_pdata = { 623static struct exynos_drm_fimd_pdata drm_fimd_pdata = {
619 .panel = { 624 .panel = {
@@ -798,6 +803,7 @@ static void __init origen_machine_init(void)
798 803
799 platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices)); 804 platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices));
800 805
806 pwm_add_table(origen_pwm_lookup, ARRAY_SIZE(origen_pwm_lookup));
801 samsung_bl_set(&origen_bl_gpio_info, &origen_bl_data); 807 samsung_bl_set(&origen_bl_gpio_info, &origen_bl_data);
802 808
803 origen_bt_setup(); 809 origen_bt_setup();
@@ -806,6 +812,7 @@ static void __init origen_machine_init(void)
806MACHINE_START(ORIGEN, "ORIGEN") 812MACHINE_START(ORIGEN, "ORIGEN")
807 /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */ 813 /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */
808 .atag_offset = 0x100, 814 .atag_offset = 0x100,
815 .smp = smp_ops(exynos_smp_ops),
809 .init_irq = exynos4_init_irq, 816 .init_irq = exynos4_init_irq,
810 .map_io = origen_map_io, 817 .map_io = origen_map_io,
811 .handle_irq = gic_handle_irq, 818 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c
index b26beb13ebe..730f1ac6592 100644
--- a/arch/arm/mach-exynos/mach-smdk4x12.c
+++ b/arch/arm/mach-exynos/mach-smdk4x12.c
@@ -17,6 +17,7 @@
17#include <linux/mfd/max8997.h> 17#include <linux/mfd/max8997.h>
18#include <linux/mmc/host.h> 18#include <linux/mmc/host.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/pwm.h>
20#include <linux/pwm_backlight.h> 21#include <linux/pwm_backlight.h>
21#include <linux/regulator/machine.h> 22#include <linux/regulator/machine.h>
22#include <linux/serial_core.h> 23#include <linux/serial_core.h>
@@ -26,16 +27,16 @@
26#include <asm/hardware/gic.h> 27#include <asm/hardware/gic.h>
27#include <asm/mach-types.h> 28#include <asm/mach-types.h>
28 29
30#include <video/samsung_fimd.h>
29#include <plat/backlight.h> 31#include <plat/backlight.h>
30#include <plat/clock.h> 32#include <plat/clock.h>
31#include <plat/cpu.h> 33#include <plat/cpu.h>
32#include <plat/devs.h> 34#include <plat/devs.h>
33#include <plat/fb.h> 35#include <plat/fb.h>
34#include <plat/gpio-cfg.h> 36#include <plat/gpio-cfg.h>
35#include <plat/iic.h> 37#include <linux/platform_data/i2c-s3c2410.h>
36#include <plat/keypad.h> 38#include <plat/keypad.h>
37#include <plat/mfc.h> 39#include <plat/mfc.h>
38#include <plat/regs-fb.h>
39#include <plat/regs-serial.h> 40#include <plat/regs-serial.h>
40#include <plat/sdhci.h> 41#include <plat/sdhci.h>
41 42
@@ -222,6 +223,10 @@ static struct platform_pwm_backlight_data smdk4x12_bl_data = {
222 .pwm_period_ns = 1000, 223 .pwm_period_ns = 1000,
223}; 224};
224 225
226static struct pwm_lookup smdk4x12_pwm_lookup[] = {
227 PWM_LOOKUP("s3c24xx-pwm.1", 0, "pwm-backlight.0", NULL),
228};
229
225static uint32_t smdk4x12_keymap[] __initdata = { 230static uint32_t smdk4x12_keymap[] __initdata = {
226 /* KEY(row, col, keycode) */ 231 /* KEY(row, col, keycode) */
227 KEY(1, 3, KEY_1), KEY(1, 4, KEY_2), KEY(1, 5, KEY_3), 232 KEY(1, 3, KEY_1), KEY(1, 4, KEY_2), KEY(1, 5, KEY_3),
@@ -349,6 +354,7 @@ static void __init smdk4x12_machine_init(void)
349 ARRAY_SIZE(smdk4x12_i2c_devs7)); 354 ARRAY_SIZE(smdk4x12_i2c_devs7));
350 355
351 samsung_bl_set(&smdk4x12_bl_gpio_info, &smdk4x12_bl_data); 356 samsung_bl_set(&smdk4x12_bl_gpio_info, &smdk4x12_bl_data);
357 pwm_add_table(smdk4x12_pwm_lookup, ARRAY_SIZE(smdk4x12_pwm_lookup));
352 358
353 samsung_keypad_set_platdata(&smdk4x12_keypad_data); 359 samsung_keypad_set_platdata(&smdk4x12_keypad_data);
354 360
@@ -370,6 +376,7 @@ static void __init smdk4x12_machine_init(void)
370MACHINE_START(SMDK4212, "SMDK4212") 376MACHINE_START(SMDK4212, "SMDK4212")
371 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 377 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
372 .atag_offset = 0x100, 378 .atag_offset = 0x100,
379 .smp = smp_ops(exynos_smp_ops),
373 .init_irq = exynos4_init_irq, 380 .init_irq = exynos4_init_irq,
374 .map_io = smdk4x12_map_io, 381 .map_io = smdk4x12_map_io,
375 .handle_irq = gic_handle_irq, 382 .handle_irq = gic_handle_irq,
@@ -383,6 +390,7 @@ MACHINE_START(SMDK4412, "SMDK4412")
383 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 390 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
384 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */ 391 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
385 .atag_offset = 0x100, 392 .atag_offset = 0x100,
393 .smp = smp_ops(exynos_smp_ops),
386 .init_irq = exynos4_init_irq, 394 .init_irq = exynos4_init_irq,
387 .map_io = smdk4x12_map_io, 395 .map_io = smdk4x12_map_io,
388 .handle_irq = gic_handle_irq, 396 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c
index 73f2bce097e..ee4fb1a9cb7 100644
--- a/arch/arm/mach-exynos/mach-smdkv310.c
+++ b/arch/arm/mach-exynos/mach-smdkv310.c
@@ -18,6 +18,7 @@
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/i2c.h> 19#include <linux/i2c.h>
20#include <linux/input.h> 20#include <linux/input.h>
21#include <linux/pwm.h>
21#include <linux/pwm_backlight.h> 22#include <linux/pwm_backlight.h>
22#include <linux/platform_data/s3c-hsotg.h> 23#include <linux/platform_data/s3c-hsotg.h>
23 24
@@ -26,24 +27,24 @@
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
27 28
28#include <video/platform_lcd.h> 29#include <video/platform_lcd.h>
30#include <video/samsung_fimd.h>
29#include <plat/regs-serial.h> 31#include <plat/regs-serial.h>
30#include <plat/regs-srom.h> 32#include <plat/regs-srom.h>
31#include <plat/regs-fb-v4.h>
32#include <plat/cpu.h> 33#include <plat/cpu.h>
33#include <plat/devs.h> 34#include <plat/devs.h>
34#include <plat/fb.h> 35#include <plat/fb.h>
35#include <plat/keypad.h> 36#include <plat/keypad.h>
36#include <plat/sdhci.h> 37#include <plat/sdhci.h>
37#include <plat/iic.h> 38#include <linux/platform_data/i2c-s3c2410.h>
38#include <plat/gpio-cfg.h> 39#include <plat/gpio-cfg.h>
39#include <plat/backlight.h> 40#include <plat/backlight.h>
40#include <plat/mfc.h> 41#include <plat/mfc.h>
41#include <plat/ehci.h> 42#include <linux/platform_data/usb-ehci-s5p.h>
42#include <plat/clock.h> 43#include <plat/clock.h>
43#include <plat/hdmi.h> 44#include <plat/hdmi.h>
44 45
45#include <mach/map.h> 46#include <mach/map.h>
46#include <mach/ohci.h> 47#include <linux/platform_data/usb-exynos.h>
47 48
48#include <drm/exynos_drm.h> 49#include <drm/exynos_drm.h>
49#include "common.h" 50#include "common.h"
@@ -360,6 +361,10 @@ static struct i2c_board_info hdmiphy_info = {
360 I2C_BOARD_INFO("hdmiphy-exynos4210", 0x38), 361 I2C_BOARD_INFO("hdmiphy-exynos4210", 0x38),
361}; 362};
362 363
364static struct pwm_lookup smdkv310_pwm_lookup[] = {
365 PWM_LOOKUP("s3c24xx-pwm.1", 0, "pwm-backlight.0", NULL),
366};
367
363static void s5p_tv_setup(void) 368static void s5p_tv_setup(void)
364{ 369{
365 /* direct HPD to HDMI chip */ 370 /* direct HPD to HDMI chip */
@@ -399,6 +404,8 @@ static void __init smdkv310_machine_init(void)
399 samsung_keypad_set_platdata(&smdkv310_keypad_data); 404 samsung_keypad_set_platdata(&smdkv310_keypad_data);
400 405
401 samsung_bl_set(&smdkv310_bl_gpio_info, &smdkv310_bl_data); 406 samsung_bl_set(&smdkv310_bl_gpio_info, &smdkv310_bl_data);
407 pwm_add_table(smdkv310_pwm_lookup, ARRAY_SIZE(smdkv310_pwm_lookup));
408
402#ifdef CONFIG_DRM_EXYNOS 409#ifdef CONFIG_DRM_EXYNOS
403 s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata; 410 s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata;
404 exynos4_fimd0_gpio_setup_24bpp(); 411 exynos4_fimd0_gpio_setup_24bpp();
@@ -417,6 +424,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
417 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 424 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
418 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */ 425 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
419 .atag_offset = 0x100, 426 .atag_offset = 0x100,
427 .smp = smp_ops(exynos_smp_ops),
420 .init_irq = exynos4_init_irq, 428 .init_irq = exynos4_init_irq,
421 .map_io = smdkv310_map_io, 429 .map_io = smdkv310_map_io,
422 .handle_irq = gic_handle_irq, 430 .handle_irq = gic_handle_irq,
@@ -429,6 +437,7 @@ MACHINE_END
429MACHINE_START(SMDKC210, "SMDKC210") 437MACHINE_START(SMDKC210, "SMDKC210")
430 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 438 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
431 .atag_offset = 0x100, 439 .atag_offset = 0x100,
440 .smp = smp_ops(exynos_smp_ops),
432 .init_irq = exynos4_init_irq, 441 .init_irq = exynos4_init_irq,
433 .map_io = smdkv310_map_io, 442 .map_io = smdkv310_map_io,
434 .handle_irq = gic_handle_irq, 443 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index 4d1f40d44ed..ebc9dd339a3 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -30,20 +30,20 @@
30#include <asm/hardware/gic.h> 30#include <asm/hardware/gic.h>
31#include <asm/mach-types.h> 31#include <asm/mach-types.h>
32 32
33#include <video/samsung_fimd.h>
33#include <plat/regs-serial.h> 34#include <plat/regs-serial.h>
34#include <plat/clock.h> 35#include <plat/clock.h>
35#include <plat/cpu.h> 36#include <plat/cpu.h>
36#include <plat/devs.h> 37#include <plat/devs.h>
37#include <plat/iic.h> 38#include <linux/platform_data/i2c-s3c2410.h>
38#include <plat/gpio-cfg.h> 39#include <plat/gpio-cfg.h>
39#include <plat/fb.h> 40#include <plat/fb.h>
40#include <plat/mfc.h> 41#include <plat/mfc.h>
41#include <plat/sdhci.h> 42#include <plat/sdhci.h>
42#include <plat/regs-fb-v4.h>
43#include <plat/fimc-core.h> 43#include <plat/fimc-core.h>
44#include <plat/s5p-time.h> 44#include <plat/s5p-time.h>
45#include <plat/camport.h> 45#include <plat/camport.h>
46#include <plat/mipi_csis.h> 46#include <linux/platform_data/mipi-csis.h>
47 47
48#include <mach/map.h> 48#include <mach/map.h>
49 49
@@ -209,7 +209,7 @@ static struct regulator_consumer_supply lp3974_ldo3_consumer[] = {
209 REGULATOR_SUPPLY("vusb_a", "s3c-hsotg"), 209 REGULATOR_SUPPLY("vusb_a", "s3c-hsotg"),
210 REGULATOR_SUPPLY("vdd", "exynos4-hdmi"), 210 REGULATOR_SUPPLY("vdd", "exynos4-hdmi"),
211 REGULATOR_SUPPLY("vdd_pll", "exynos4-hdmi"), 211 REGULATOR_SUPPLY("vdd_pll", "exynos4-hdmi"),
212 REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), 212 REGULATOR_SUPPLY("vddcore", "s5p-mipi-csis.0"),
213}; 213};
214 214
215static struct regulator_init_data lp3974_ldo3_data = { 215static struct regulator_init_data lp3974_ldo3_data = {
@@ -273,7 +273,7 @@ static struct regulator_init_data lp3974_ldo6_data = {
273}; 273};
274 274
275static struct regulator_consumer_supply lp3974_ldo7_consumer[] = { 275static struct regulator_consumer_supply lp3974_ldo7_consumer[] = {
276 REGULATOR_SUPPLY("vdd18", "s5p-mipi-csis.0"), 276 REGULATOR_SUPPLY("vddio", "s5p-mipi-csis.0"),
277}; 277};
278 278
279static struct regulator_init_data lp3974_ldo7_data = { 279static struct regulator_init_data lp3974_ldo7_data = {
@@ -942,9 +942,7 @@ static struct platform_device cam_s_if_fixed_reg_dev = {
942static struct s5p_platform_mipi_csis mipi_csis_platdata = { 942static struct s5p_platform_mipi_csis mipi_csis_platdata = {
943 .clk_rate = 166000000UL, 943 .clk_rate = 166000000UL,
944 .lanes = 2, 944 .lanes = 2,
945 .alignment = 32,
946 .hs_settle = 12, 945 .hs_settle = 12,
947 .phy_enable = s5p_csis_phy_enable,
948}; 946};
949 947
950#define GPIO_CAM_LEVEL_EN(n) EXYNOS4_GPE4(n + 3) 948#define GPIO_CAM_LEVEL_EN(n) EXYNOS4_GPE4(n + 3)
@@ -1008,7 +1006,6 @@ static struct s5p_fimc_isp_info universal_camera_sensors[] = {
1008 .board_info = &m5mols_board_info, 1006 .board_info = &m5mols_board_info,
1009 .i2c_bus_num = 0, 1007 .i2c_bus_num = 0,
1010 .clk_frequency = 24000000UL, 1008 .clk_frequency = 24000000UL,
1011 .csi_data_align = 32,
1012 }, 1009 },
1013}; 1010};
1014 1011
@@ -1155,6 +1152,7 @@ static void __init universal_machine_init(void)
1155MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") 1152MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
1156 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ 1153 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
1157 .atag_offset = 0x100, 1154 .atag_offset = 0x100,
1155 .smp = smp_ops(exynos_smp_ops),
1158 .init_irq = exynos4_init_irq, 1156 .init_irq = exynos4_init_irq,
1159 .map_io = universal_map_io, 1157 .map_io = universal_map_io,
1160 .handle_irq = gic_handle_irq, 1158 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 36c3984aaa4..f93d820ecab 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -32,19 +32,14 @@
32 32
33#include <plat/cpu.h> 33#include <plat/cpu.h>
34 34
35#include "common.h"
36
35extern void exynos4_secondary_startup(void); 37extern void exynos4_secondary_startup(void);
36 38
37#define CPU1_BOOT_REG (samsung_rev() == EXYNOS4210_REV_1_1 ? \ 39#define CPU1_BOOT_REG (samsung_rev() == EXYNOS4210_REV_1_1 ? \
38 S5P_INFORM5 : S5P_VA_SYSRAM) 40 S5P_INFORM5 : S5P_VA_SYSRAM)
39 41
40/* 42/*
41 * control for which core is the next to come out of the secondary
42 * boot "holding pen"
43 */
44
45volatile int __cpuinitdata pen_release = -1;
46
47/*
48 * Write pen_release in a way that is guaranteed to be visible to all 43 * Write pen_release in a way that is guaranteed to be visible to all
49 * observers, irrespective of whether they're taking part in coherency 44 * observers, irrespective of whether they're taking part in coherency
50 * or not. This is necessary for the hotplug code to work reliably. 45 * or not. This is necessary for the hotplug code to work reliably.
@@ -64,7 +59,7 @@ static void __iomem *scu_base_addr(void)
64 59
65static DEFINE_SPINLOCK(boot_lock); 60static DEFINE_SPINLOCK(boot_lock);
66 61
67void __cpuinit platform_secondary_init(unsigned int cpu) 62static void __cpuinit exynos_secondary_init(unsigned int cpu)
68{ 63{
69 /* 64 /*
70 * if any interrupts are already enabled for the primary 65 * if any interrupts are already enabled for the primary
@@ -86,7 +81,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
86 spin_unlock(&boot_lock); 81 spin_unlock(&boot_lock);
87} 82}
88 83
89int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 84static int __cpuinit exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
90{ 85{
91 unsigned long timeout; 86 unsigned long timeout;
92 87
@@ -139,7 +134,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
139 134
140 __raw_writel(virt_to_phys(exynos4_secondary_startup), 135 __raw_writel(virt_to_phys(exynos4_secondary_startup),
141 CPU1_BOOT_REG); 136 CPU1_BOOT_REG);
142 gic_raise_softirq(cpumask_of(cpu), 1); 137 gic_raise_softirq(cpumask_of(cpu), 0);
143 138
144 if (pen_release == -1) 139 if (pen_release == -1)
145 break; 140 break;
@@ -161,7 +156,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
161 * which may be present or become present in the system. 156 * which may be present or become present in the system.
162 */ 157 */
163 158
164void __init smp_init_cpus(void) 159static void __init exynos_smp_init_cpus(void)
165{ 160{
166 void __iomem *scu_base = scu_base_addr(); 161 void __iomem *scu_base = scu_base_addr();
167 unsigned int i, ncores; 162 unsigned int i, ncores;
@@ -184,7 +179,7 @@ void __init smp_init_cpus(void)
184 set_smp_cross_call(gic_raise_softirq); 179 set_smp_cross_call(gic_raise_softirq);
185} 180}
186 181
187void __init platform_smp_prepare_cpus(unsigned int max_cpus) 182static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)
188{ 183{
189 if (!soc_is_exynos5250()) 184 if (!soc_is_exynos5250())
190 scu_enable(scu_base_addr()); 185 scu_enable(scu_base_addr());
@@ -198,3 +193,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
198 __raw_writel(virt_to_phys(exynos4_secondary_startup), 193 __raw_writel(virt_to_phys(exynos4_secondary_startup),
199 CPU1_BOOT_REG); 194 CPU1_BOOT_REG);
200} 195}
196
197struct smp_operations exynos_smp_ops __initdata = {
198 .smp_init_cpus = exynos_smp_init_cpus,
199 .smp_prepare_cpus = exynos_smp_prepare_cpus,
200 .smp_secondary_init = exynos_secondary_init,
201 .smp_boot_secondary = exynos_boot_secondary,
202#ifdef CONFIG_HOTPLUG_CPU
203 .cpu_die = exynos_cpu_die,
204#endif
205};
diff --git a/arch/arm/mach-exynos/setup-fimd0.c b/arch/arm/mach-exynos/setup-fimd0.c
index 07a6dbeecdd..5665bb4e980 100644
--- a/arch/arm/mach-exynos/setup-fimd0.c
+++ b/arch/arm/mach-exynos/setup-fimd0.c
@@ -13,8 +13,8 @@
13#include <linux/fb.h> 13#include <linux/fb.h>
14#include <linux/gpio.h> 14#include <linux/gpio.h>
15 15
16#include <video/samsung_fimd.h>
16#include <plat/gpio-cfg.h> 17#include <plat/gpio-cfg.h>
17#include <plat/regs-fb-v4.h>
18 18
19#include <mach/map.h> 19#include <mach/map.h>
20 20
diff --git a/arch/arm/mach-exynos/setup-i2c0.c b/arch/arm/mach-exynos/setup-i2c0.c
index b90d94c17f7..5700f23629f 100644
--- a/arch/arm/mach-exynos/setup-i2c0.c
+++ b/arch/arm/mach-exynos/setup-i2c0.c
@@ -14,7 +14,7 @@
14struct platform_device; /* don't need the contents */ 14struct platform_device; /* don't need the contents */
15 15
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <plat/iic.h> 17#include <linux/platform_data/i2c-s3c2410.h>
18#include <plat/gpio-cfg.h> 18#include <plat/gpio-cfg.h>
19#include <plat/cpu.h> 19#include <plat/cpu.h>
20 20
diff --git a/arch/arm/mach-exynos/setup-i2c1.c b/arch/arm/mach-exynos/setup-i2c1.c
index fd7235a43f6..8d2279cc85d 100644
--- a/arch/arm/mach-exynos/setup-i2c1.c
+++ b/arch/arm/mach-exynos/setup-i2c1.c
@@ -13,7 +13,7 @@
13struct platform_device; /* don't need the contents */ 13struct platform_device; /* don't need the contents */
14 14
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <plat/iic.h> 16#include <linux/platform_data/i2c-s3c2410.h>
17#include <plat/gpio-cfg.h> 17#include <plat/gpio-cfg.h>
18 18
19void s3c_i2c1_cfg_gpio(struct platform_device *dev) 19void s3c_i2c1_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-exynos/setup-i2c2.c b/arch/arm/mach-exynos/setup-i2c2.c
index 2694b19e8b3..0ed62fc42a7 100644
--- a/arch/arm/mach-exynos/setup-i2c2.c
+++ b/arch/arm/mach-exynos/setup-i2c2.c
@@ -13,7 +13,7 @@
13struct platform_device; /* don't need the contents */ 13struct platform_device; /* don't need the contents */
14 14
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <plat/iic.h> 16#include <linux/platform_data/i2c-s3c2410.h>
17#include <plat/gpio-cfg.h> 17#include <plat/gpio-cfg.h>
18 18
19void s3c_i2c2_cfg_gpio(struct platform_device *dev) 19void s3c_i2c2_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-exynos/setup-i2c3.c b/arch/arm/mach-exynos/setup-i2c3.c
index 379bd306993..7787fd26076 100644
--- a/arch/arm/mach-exynos/setup-i2c3.c
+++ b/arch/arm/mach-exynos/setup-i2c3.c
@@ -13,7 +13,7 @@
13struct platform_device; /* don't need the contents */ 13struct platform_device; /* don't need the contents */
14 14
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <plat/iic.h> 16#include <linux/platform_data/i2c-s3c2410.h>
17#include <plat/gpio-cfg.h> 17#include <plat/gpio-cfg.h>
18 18
19void s3c_i2c3_cfg_gpio(struct platform_device *dev) 19void s3c_i2c3_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-exynos/setup-i2c4.c b/arch/arm/mach-exynos/setup-i2c4.c
index 9f3c04855b7..edc847f8982 100644
--- a/arch/arm/mach-exynos/setup-i2c4.c
+++ b/arch/arm/mach-exynos/setup-i2c4.c
@@ -13,7 +13,7 @@
13struct platform_device; /* don't need the contents */ 13struct platform_device; /* don't need the contents */
14 14
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <plat/iic.h> 16#include <linux/platform_data/i2c-s3c2410.h>
17#include <plat/gpio-cfg.h> 17#include <plat/gpio-cfg.h>
18 18
19void s3c_i2c4_cfg_gpio(struct platform_device *dev) 19void s3c_i2c4_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-exynos/setup-i2c5.c b/arch/arm/mach-exynos/setup-i2c5.c
index 77e1a1e57c7..d88af7f7595 100644
--- a/arch/arm/mach-exynos/setup-i2c5.c
+++ b/arch/arm/mach-exynos/setup-i2c5.c
@@ -13,7 +13,7 @@
13struct platform_device; /* don't need the contents */ 13struct platform_device; /* don't need the contents */
14 14
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <plat/iic.h> 16#include <linux/platform_data/i2c-s3c2410.h>
17#include <plat/gpio-cfg.h> 17#include <plat/gpio-cfg.h>
18 18
19void s3c_i2c5_cfg_gpio(struct platform_device *dev) 19void s3c_i2c5_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-exynos/setup-i2c6.c b/arch/arm/mach-exynos/setup-i2c6.c
index 284d12b7af0..c590286c9d3 100644
--- a/arch/arm/mach-exynos/setup-i2c6.c
+++ b/arch/arm/mach-exynos/setup-i2c6.c
@@ -13,7 +13,7 @@
13struct platform_device; /* don't need the contents */ 13struct platform_device; /* don't need the contents */
14 14
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <plat/iic.h> 16#include <linux/platform_data/i2c-s3c2410.h>
17#include <plat/gpio-cfg.h> 17#include <plat/gpio-cfg.h>
18 18
19void s3c_i2c6_cfg_gpio(struct platform_device *dev) 19void s3c_i2c6_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-exynos/setup-i2c7.c b/arch/arm/mach-exynos/setup-i2c7.c
index b7611ee359a..1bba75568a5 100644
--- a/arch/arm/mach-exynos/setup-i2c7.c
+++ b/arch/arm/mach-exynos/setup-i2c7.c
@@ -13,7 +13,7 @@
13struct platform_device; /* don't need the contents */ 13struct platform_device; /* don't need the contents */
14 14
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <plat/iic.h> 16#include <linux/platform_data/i2c-s3c2410.h>
17#include <plat/gpio-cfg.h> 17#include <plat/gpio-cfg.h>
18 18
19void s3c_i2c7_cfg_gpio(struct platform_device *dev) 19void s3c_i2c7_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig
index f643ef819da..abda5a18a66 100644
--- a/arch/arm/mach-footbridge/Kconfig
+++ b/arch/arm/mach-footbridge/Kconfig
@@ -91,7 +91,7 @@ config FOOTBRIDGE_ADDIN
91 91
92# EBSA285 board in either host or addin mode 92# EBSA285 board in either host or addin mode
93config ARCH_EBSA285 93config ARCH_EBSA285
94 select ARCH_MAY_HAVE_PC_FDC
95 bool 94 bool
95 select ARCH_MAY_HAVE_PC_FDC
96 96
97endif 97endif
diff --git a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile
index 3afb1b25946..0b64dd430d6 100644
--- a/arch/arm/mach-footbridge/Makefile
+++ b/arch/arm/mach-footbridge/Makefile
@@ -14,15 +14,11 @@ pci-$(CONFIG_ARCH_EBSA285_HOST) += ebsa285-pci.o
14pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o 14pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o
15pci-$(CONFIG_ARCH_PERSONAL_SERVER) += personal-pci.o 15pci-$(CONFIG_ARCH_PERSONAL_SERVER) += personal-pci.o
16 16
17leds-$(CONFIG_ARCH_EBSA285) += ebsa285-leds.o
18leds-$(CONFIG_ARCH_NETWINDER) += netwinder-leds.o
19
20obj-$(CONFIG_ARCH_CATS) += cats-hw.o isa-timer.o 17obj-$(CONFIG_ARCH_CATS) += cats-hw.o isa-timer.o
21obj-$(CONFIG_ARCH_EBSA285) += ebsa285.o dc21285-timer.o 18obj-$(CONFIG_ARCH_EBSA285) += ebsa285.o dc21285-timer.o
22obj-$(CONFIG_ARCH_NETWINDER) += netwinder-hw.o isa-timer.o 19obj-$(CONFIG_ARCH_NETWINDER) += netwinder-hw.o isa-timer.o
23obj-$(CONFIG_ARCH_PERSONAL_SERVER) += personal.o dc21285-timer.o 20obj-$(CONFIG_ARCH_PERSONAL_SERVER) += personal.o dc21285-timer.o
24 21
25obj-$(CONFIG_PCI) +=$(pci-y) 22obj-$(CONFIG_PCI) +=$(pci-y)
26obj-$(CONFIG_LEDS) +=$(leds-y)
27 23
28obj-$(CONFIG_ISA) += isa.o isa-rtc.o 24obj-$(CONFIG_ISA) += isa.o isa-rtc.o
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c
index 3e6aaa6361d..a42b369bc43 100644
--- a/arch/arm/mach-footbridge/common.c
+++ b/arch/arm/mach-footbridge/common.c
@@ -15,7 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18 18
19#include <asm/pgtable.h> 19#include <asm/pgtable.h>
20#include <asm/page.h> 20#include <asm/page.h>
21#include <asm/irq.h> 21#include <asm/irq.h>
@@ -26,6 +26,7 @@
26 26
27#include <asm/mach/irq.h> 27#include <asm/mach/irq.h>
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <asm/mach/pci.h>
29 30
30#include "common.h" 31#include "common.h"
31 32
@@ -175,11 +176,6 @@ static struct map_desc ebsa285_host_io_desc[] __initdata = {
175 .pfn = __phys_to_pfn(DC21285_PCI_IACK), 176 .pfn = __phys_to_pfn(DC21285_PCI_IACK),
176 .length = PCIIACK_SIZE, 177 .length = PCIIACK_SIZE,
177 .type = MT_DEVICE, 178 .type = MT_DEVICE,
178 }, {
179 .virtual = PCIO_BASE,
180 .pfn = __phys_to_pfn(DC21285_PCI_IO),
181 .length = PCIO_SIZE,
182 .type = MT_DEVICE,
183 }, 179 },
184#endif 180#endif
185}; 181};
@@ -196,8 +192,10 @@ void __init footbridge_map_io(void)
196 * Now, work out what we've got to map in addition on this 192 * Now, work out what we've got to map in addition on this
197 * platform. 193 * platform.
198 */ 194 */
199 if (footbridge_cfn_mode()) 195 if (footbridge_cfn_mode()) {
200 iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc)); 196 iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc));
197 pci_map_io_early(__phys_to_pfn(DC21285_PCI_IO));
198 }
201} 199}
202 200
203void footbridge_restart(char mode, const char *cmd) 201void footbridge_restart(char mode, const char *cmd)
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
index 9d62e338102..a7cd2cf5e08 100644
--- a/arch/arm/mach-footbridge/dc21285.c
+++ b/arch/arm/mach-footbridge/dc21285.c
@@ -276,8 +276,8 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys)
276 276
277 sys->mem_offset = DC21285_PCI_MEM; 277 sys->mem_offset = DC21285_PCI_MEM;
278 278
279 pci_add_resource_offset(&sys->resources, 279 pci_ioremap_io(0, DC21285_PCI_IO);
280 &ioport_resource, sys->io_offset); 280
281 pci_add_resource_offset(&sys->resources, &res[0], sys->mem_offset); 281 pci_add_resource_offset(&sys->resources, &res[0], sys->mem_offset);
282 pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); 282 pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset);
283 283
@@ -298,7 +298,7 @@ void __init dc21285_preinit(void)
298 mem_size = (unsigned int)high_memory - PAGE_OFFSET; 298 mem_size = (unsigned int)high_memory - PAGE_OFFSET;
299 for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1) 299 for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1)
300 if (mem_mask >= mem_size) 300 if (mem_mask >= mem_size)
301 break; 301 break;
302 302
303 /* 303 /*
304 * These registers need to be set up whether we're the 304 * These registers need to be set up whether we're the
@@ -350,14 +350,6 @@ void __init dc21285_preinit(void)
350 "PCI data parity", NULL); 350 "PCI data parity", NULL);
351 351
352 if (cfn_mode) { 352 if (cfn_mode) {
353 static struct resource csrio;
354
355 csrio.flags = IORESOURCE_IO;
356 csrio.name = "Footbridge";
357
358 allocate_resource(&ioport_resource, &csrio, 128,
359 0xff00, 0xffff, 128, NULL, NULL);
360
361 /* 353 /*
362 * Map our SDRAM at a known address in PCI space, just in case 354 * Map our SDRAM at a known address in PCI space, just in case
363 * the firmware had other ideas. Using a nonzero base is 355 * the firmware had other ideas. Using a nonzero base is
@@ -365,7 +357,7 @@ void __init dc21285_preinit(void)
365 * in the range 0x000a0000 to 0x000c0000. (eg, S3 cards). 357 * in the range 0x000a0000 to 0x000c0000. (eg, S3 cards).
366 */ 358 */
367 *CSR_PCICSRBASE = 0xf4000000; 359 *CSR_PCICSRBASE = 0xf4000000;
368 *CSR_PCICSRIOBASE = csrio.start; 360 *CSR_PCICSRIOBASE = 0;
369 *CSR_PCISDRAMBASE = __virt_to_bus(PAGE_OFFSET); 361 *CSR_PCISDRAMBASE = __virt_to_bus(PAGE_OFFSET);
370 *CSR_PCIROMBASE = 0; 362 *CSR_PCIROMBASE = 0;
371 *CSR_PCICMD = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | 363 *CSR_PCICMD = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
diff --git a/arch/arm/mach-footbridge/ebsa285-leds.c b/arch/arm/mach-footbridge/ebsa285-leds.c
deleted file mode 100644
index 5bd266754b9..00000000000
--- a/arch/arm/mach-footbridge/ebsa285-leds.c
+++ /dev/null
@@ -1,138 +0,0 @@
1/*
2 * linux/arch/arm/mach-footbridge/ebsa285-leds.c
3 *
4 * Copyright (C) 1998-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 * EBSA-285 control routines.
10 *
11 * The EBSA-285 uses the leds as follows:
12 * - Green - toggles state every 50 timer interrupts
13 * - Amber - On if system is not idle
14 * - Red - currently unused
15 *
16 * Changelog:
17 * 02-05-1999 RMK Various cleanups
18 */
19#include <linux/module.h>
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/spinlock.h>
23
24#include <mach/hardware.h>
25#include <asm/leds.h>
26#include <asm/mach-types.h>
27
28#define LED_STATE_ENABLED 1
29#define LED_STATE_CLAIMED 2
30static char led_state;
31static char hw_led_state;
32
33static DEFINE_SPINLOCK(leds_lock);
34
35static void ebsa285_leds_event(led_event_t evt)
36{
37 unsigned long flags;
38
39 spin_lock_irqsave(&leds_lock, flags);
40
41 switch (evt) {
42 case led_start:
43 hw_led_state = XBUS_LED_RED | XBUS_LED_GREEN;
44#ifndef CONFIG_LEDS_CPU
45 hw_led_state |= XBUS_LED_AMBER;
46#endif
47 led_state |= LED_STATE_ENABLED;
48 break;
49
50 case led_stop:
51 led_state &= ~LED_STATE_ENABLED;
52 break;
53
54 case led_claim:
55 led_state |= LED_STATE_CLAIMED;
56 hw_led_state = XBUS_LED_RED | XBUS_LED_GREEN | XBUS_LED_AMBER;
57 break;
58
59 case led_release:
60 led_state &= ~LED_STATE_CLAIMED;
61 hw_led_state = XBUS_LED_RED | XBUS_LED_GREEN | XBUS_LED_AMBER;
62 break;
63
64#ifdef CONFIG_LEDS_TIMER
65 case led_timer:
66 if (!(led_state & LED_STATE_CLAIMED))
67 hw_led_state ^= XBUS_LED_GREEN;
68 break;
69#endif
70
71#ifdef CONFIG_LEDS_CPU
72 case led_idle_start:
73 if (!(led_state & LED_STATE_CLAIMED))
74 hw_led_state |= XBUS_LED_AMBER;
75 break;
76
77 case led_idle_end:
78 if (!(led_state & LED_STATE_CLAIMED))
79 hw_led_state &= ~XBUS_LED_AMBER;
80 break;
81#endif
82
83 case led_halted:
84 if (!(led_state & LED_STATE_CLAIMED))
85 hw_led_state &= ~XBUS_LED_RED;
86 break;
87
88 case led_green_on:
89 if (led_state & LED_STATE_CLAIMED)
90 hw_led_state &= ~XBUS_LED_GREEN;
91 break;
92
93 case led_green_off:
94 if (led_state & LED_STATE_CLAIMED)
95 hw_led_state |= XBUS_LED_GREEN;
96 break;
97
98 case led_amber_on:
99 if (led_state & LED_STATE_CLAIMED)
100 hw_led_state &= ~XBUS_LED_AMBER;
101 break;
102
103 case led_amber_off:
104 if (led_state & LED_STATE_CLAIMED)
105 hw_led_state |= XBUS_LED_AMBER;
106 break;
107
108 case led_red_on:
109 if (led_state & LED_STATE_CLAIMED)
110 hw_led_state &= ~XBUS_LED_RED;
111 break;
112
113 case led_red_off:
114 if (led_state & LED_STATE_CLAIMED)
115 hw_led_state |= XBUS_LED_RED;
116 break;
117
118 default:
119 break;
120 }
121
122 if (led_state & LED_STATE_ENABLED)
123 *XBUS_LEDS = hw_led_state;
124
125 spin_unlock_irqrestore(&leds_lock, flags);
126}
127
128static int __init leds_init(void)
129{
130 if (machine_is_ebsa285())
131 leds_event = ebsa285_leds_event;
132
133 leds_event(led_start);
134
135 return 0;
136}
137
138__initcall(leds_init);
diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c
index 27716a7e5fc..b09551ef89c 100644
--- a/arch/arm/mach-footbridge/ebsa285.c
+++ b/arch/arm/mach-footbridge/ebsa285.c
@@ -5,6 +5,8 @@
5 */ 5 */
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/spinlock.h> 7#include <linux/spinlock.h>
8#include <linux/slab.h>
9#include <linux/leds.h>
8 10
9#include <asm/hardware/dec21285.h> 11#include <asm/hardware/dec21285.h>
10#include <asm/mach-types.h> 12#include <asm/mach-types.h>
@@ -13,6 +15,85 @@
13 15
14#include "common.h" 16#include "common.h"
15 17
18/* LEDs */
19#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
20struct ebsa285_led {
21 struct led_classdev cdev;
22 u8 mask;
23};
24
25/*
26 * The triggers lines up below will only be used if the
27 * LED triggers are compiled in.
28 */
29static const struct {
30 const char *name;
31 const char *trigger;
32} ebsa285_leds[] = {
33 { "ebsa285:amber", "heartbeat", },
34 { "ebsa285:green", "cpu0", },
35 { "ebsa285:red",},
36};
37
38static void ebsa285_led_set(struct led_classdev *cdev,
39 enum led_brightness b)
40{
41 struct ebsa285_led *led = container_of(cdev,
42 struct ebsa285_led, cdev);
43
44 if (b != LED_OFF)
45 *XBUS_LEDS |= led->mask;
46 else
47 *XBUS_LEDS &= ~led->mask;
48}
49
50static enum led_brightness ebsa285_led_get(struct led_classdev *cdev)
51{
52 struct ebsa285_led *led = container_of(cdev,
53 struct ebsa285_led, cdev);
54
55 return (*XBUS_LEDS & led->mask) ? LED_FULL : LED_OFF;
56}
57
58static int __init ebsa285_leds_init(void)
59{
60 int i;
61
62 if (machine_is_ebsa285())
63 return -ENODEV;
64
65 /* 3 LEDS All ON */
66 *XBUS_LEDS |= XBUS_LED_AMBER | XBUS_LED_GREEN | XBUS_LED_RED;
67
68 for (i = 0; i < ARRAY_SIZE(ebsa285_leds); i++) {
69 struct ebsa285_led *led;
70
71 led = kzalloc(sizeof(*led), GFP_KERNEL);
72 if (!led)
73 break;
74
75 led->cdev.name = ebsa285_leds[i].name;
76 led->cdev.brightness_set = ebsa285_led_set;
77 led->cdev.brightness_get = ebsa285_led_get;
78 led->cdev.default_trigger = ebsa285_leds[i].trigger;
79 led->mask = BIT(i);
80
81 if (led_classdev_register(NULL, &led->cdev) < 0) {
82 kfree(led);
83 break;
84 }
85 }
86
87 return 0;
88}
89
90/*
91 * Since we may have triggers on any subsystem, defer registration
92 * until after subsystem_init.
93 */
94fs_initcall(ebsa285_leds_init);
95#endif
96
16MACHINE_START(EBSA285, "EBSA285") 97MACHINE_START(EBSA285, "EBSA285")
17 /* Maintainer: Russell King */ 98 /* Maintainer: Russell King */
18 .atag_offset = 0x100, 99 .atag_offset = 0x100,
diff --git a/arch/arm/mach-footbridge/include/mach/debug-macro.S b/arch/arm/mach-footbridge/include/mach/debug-macro.S
index e5acde25ffc..c169f0c99b2 100644
--- a/arch/arm/mach-footbridge/include/mach/debug-macro.S
+++ b/arch/arm/mach-footbridge/include/mach/debug-macro.S
@@ -17,7 +17,8 @@
17 /* For NetWinder debugging */ 17 /* For NetWinder debugging */
18 .macro addruart, rp, rv, tmp 18 .macro addruart, rp, rv, tmp
19 mov \rp, #0x000003f8 19 mov \rp, #0x000003f8
20 orr \rv, \rp, #0xff000000 @ virtual 20 orr \rv, \rp, #0xfe000000 @ virtual
21 orr \rv, \rv, #0x00e00000 @ virtual
21 orr \rp, \rp, #0x7c000000 @ physical 22 orr \rp, \rp, #0x7c000000 @ physical
22 .endm 23 .endm
23 24
diff --git a/arch/arm/mach-footbridge/include/mach/io.h b/arch/arm/mach-footbridge/include/mach/io.h
index aba531eebbc..aba46388cc0 100644
--- a/arch/arm/mach-footbridge/include/mach/io.h
+++ b/arch/arm/mach-footbridge/include/mach/io.h
@@ -14,18 +14,10 @@
14#ifndef __ASM_ARM_ARCH_IO_H 14#ifndef __ASM_ARM_ARCH_IO_H
15#define __ASM_ARM_ARCH_IO_H 15#define __ASM_ARM_ARCH_IO_H
16 16
17#ifdef CONFIG_MMU
18#define MMU_IO(a, b) (a)
19#else
20#define MMU_IO(a, b) (b)
21#endif
22
23#define PCIO_SIZE 0x00100000
24#define PCIO_BASE MMU_IO(0xff000000, 0x7c000000)
25
26/* 17/*
27 * Translation of various region addresses to virtual addresses 18 * Translation of various i/o addresses to host addresses for !CONFIG_MMU
28 */ 19 */
20#define PCIO_BASE 0x7c000000
29#define __io(a) ((void __iomem *)(PCIO_BASE + (a))) 21#define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
30 22
31#endif 23#endif
diff --git a/arch/arm/mach-footbridge/include/mach/irqs.h b/arch/arm/mach-footbridge/include/mach/irqs.h
index 400551e43e4..61c714c4920 100644
--- a/arch/arm/mach-footbridge/include/mach/irqs.h
+++ b/arch/arm/mach-footbridge/include/mach/irqs.h
@@ -89,8 +89,6 @@
89#define IRQ_NETWINDER_VGA _ISA_IRQ(11) 89#define IRQ_NETWINDER_VGA _ISA_IRQ(11)
90#define IRQ_NETWINDER_SOUND _ISA_IRQ(12) 90#define IRQ_NETWINDER_SOUND _ISA_IRQ(12)
91 91
92#undef RTC_IRQ
93#define RTC_IRQ IRQ_ISA_RTC_ALARM
94#define I8042_KBD_IRQ IRQ_ISA_KEYBOARD 92#define I8042_KBD_IRQ IRQ_ISA_KEYBOARD
95#define I8042_AUX_IRQ (machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE) 93#define I8042_AUX_IRQ (machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)
96#define IRQ_FLOPPYDISK IRQ_ISA_FLOPPY 94#define IRQ_FLOPPYDISK IRQ_ISA_FLOPPY
diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c
index cac9f67e7da..d2d14339c6c 100644
--- a/arch/arm/mach-footbridge/netwinder-hw.c
+++ b/arch/arm/mach-footbridge/netwinder-hw.c
@@ -12,9 +12,10 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/io.h> 13#include <linux/io.h>
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/slab.h>
16#include <linux/leds.h>
15 17
16#include <asm/hardware/dec21285.h> 18#include <asm/hardware/dec21285.h>
17#include <asm/leds.h>
18#include <asm/mach-types.h> 19#include <asm/mach-types.h>
19#include <asm/setup.h> 20#include <asm/setup.h>
20#include <asm/system_misc.h> 21#include <asm/system_misc.h>
@@ -27,13 +28,6 @@
27#define GP1_IO_BASE 0x338 28#define GP1_IO_BASE 0x338
28#define GP2_IO_BASE 0x33a 29#define GP2_IO_BASE 0x33a
29 30
30
31#ifdef CONFIG_LEDS
32#define DEFAULT_LEDS 0
33#else
34#define DEFAULT_LEDS GPIO_GREEN_LED
35#endif
36
37/* 31/*
38 * Winbond WB83977F accessibility stuff 32 * Winbond WB83977F accessibility stuff
39 */ 33 */
@@ -611,15 +605,9 @@ static void __init rwa010_init(void)
611static int __init nw_hw_init(void) 605static int __init nw_hw_init(void)
612{ 606{
613 if (machine_is_netwinder()) { 607 if (machine_is_netwinder()) {
614 unsigned long flags;
615
616 wb977_init(); 608 wb977_init();
617 cpld_init(); 609 cpld_init();
618 rwa010_init(); 610 rwa010_init();
619
620 raw_spin_lock_irqsave(&nw_gpio_lock, flags);
621 nw_gpio_modify_op(GPIO_RED_LED|GPIO_GREEN_LED, DEFAULT_LEDS);
622 raw_spin_unlock_irqrestore(&nw_gpio_lock, flags);
623 } 611 }
624 return 0; 612 return 0;
625} 613}
@@ -672,6 +660,102 @@ static void netwinder_restart(char mode, const char *cmd)
672 } 660 }
673} 661}
674 662
663/* LEDs */
664#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
665struct netwinder_led {
666 struct led_classdev cdev;
667 u8 mask;
668};
669
670/*
671 * The triggers lines up below will only be used if the
672 * LED triggers are compiled in.
673 */
674static const struct {
675 const char *name;
676 const char *trigger;
677} netwinder_leds[] = {
678 { "netwinder:green", "heartbeat", },
679 { "netwinder:red", "cpu0", },
680};
681
682/*
683 * The LED control in Netwinder is reversed:
684 * - setting bit means turn off LED
685 * - clearing bit means turn on LED
686 */
687static void netwinder_led_set(struct led_classdev *cdev,
688 enum led_brightness b)
689{
690 struct netwinder_led *led = container_of(cdev,
691 struct netwinder_led, cdev);
692 unsigned long flags;
693 u32 reg;
694
695 spin_lock_irqsave(&nw_gpio_lock, flags);
696 reg = nw_gpio_read();
697 if (b != LED_OFF)
698 reg &= ~led->mask;
699 else
700 reg |= led->mask;
701 nw_gpio_modify_op(led->mask, reg);
702 spin_unlock_irqrestore(&nw_gpio_lock, flags);
703}
704
705static enum led_brightness netwinder_led_get(struct led_classdev *cdev)
706{
707 struct netwinder_led *led = container_of(cdev,
708 struct netwinder_led, cdev);
709 unsigned long flags;
710 u32 reg;
711
712 spin_lock_irqsave(&nw_gpio_lock, flags);
713 reg = nw_gpio_read();
714 spin_unlock_irqrestore(&nw_gpio_lock, flags);
715
716 return (reg & led->mask) ? LED_OFF : LED_FULL;
717}
718
719static int __init netwinder_leds_init(void)
720{
721 int i;
722
723 if (!machine_is_netwinder())
724 return -ENODEV;
725
726 for (i = 0; i < ARRAY_SIZE(netwinder_leds); i++) {
727 struct netwinder_led *led;
728
729 led = kzalloc(sizeof(*led), GFP_KERNEL);
730 if (!led)
731 break;
732
733 led->cdev.name = netwinder_leds[i].name;
734 led->cdev.brightness_set = netwinder_led_set;
735 led->cdev.brightness_get = netwinder_led_get;
736 led->cdev.default_trigger = netwinder_leds[i].trigger;
737
738 if (i == 0)
739 led->mask = GPIO_GREEN_LED;
740 else
741 led->mask = GPIO_RED_LED;
742
743 if (led_classdev_register(NULL, &led->cdev) < 0) {
744 kfree(led);
745 break;
746 }
747 }
748
749 return 0;
750}
751
752/*
753 * Since we may have triggers on any subsystem, defer registration
754 * until after subsystem_init.
755 */
756fs_initcall(netwinder_leds_init);
757#endif
758
675MACHINE_START(NETWINDER, "Rebel-NetWinder") 759MACHINE_START(NETWINDER, "Rebel-NetWinder")
676 /* Maintainer: Russell King/Rebel.com */ 760 /* Maintainer: Russell King/Rebel.com */
677 .atag_offset = 0x100, 761 .atag_offset = 0x100,
diff --git a/arch/arm/mach-footbridge/netwinder-leds.c b/arch/arm/mach-footbridge/netwinder-leds.c
deleted file mode 100644
index 5a2bd89cbdc..00000000000
--- a/arch/arm/mach-footbridge/netwinder-leds.c
+++ /dev/null
@@ -1,138 +0,0 @@
1/*
2 * linux/arch/arm/mach-footbridge/netwinder-leds.c
3 *
4 * Copyright (C) 1998-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * NetWinder LED control routines.
11 *
12 * The Netwinder uses the leds as follows:
13 * - Green - toggles state every 50 timer interrupts
14 * - Red - On if the system is not idle
15 *
16 * Changelog:
17 * 02-05-1999 RMK Various cleanups
18 */
19#include <linux/module.h>
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/spinlock.h>
23
24#include <mach/hardware.h>
25#include <asm/leds.h>
26#include <asm/mach-types.h>
27
28#define LED_STATE_ENABLED 1
29#define LED_STATE_CLAIMED 2
30static char led_state;
31static char hw_led_state;
32
33static DEFINE_RAW_SPINLOCK(leds_lock);
34
35static void netwinder_leds_event(led_event_t evt)
36{
37 unsigned long flags;
38
39 raw_spin_lock_irqsave(&leds_lock, flags);
40
41 switch (evt) {
42 case led_start:
43 led_state |= LED_STATE_ENABLED;
44 hw_led_state = GPIO_GREEN_LED;
45 break;
46
47 case led_stop:
48 led_state &= ~LED_STATE_ENABLED;
49 break;
50
51 case led_claim:
52 led_state |= LED_STATE_CLAIMED;
53 hw_led_state = 0;
54 break;
55
56 case led_release:
57 led_state &= ~LED_STATE_CLAIMED;
58 hw_led_state = 0;
59 break;
60
61#ifdef CONFIG_LEDS_TIMER
62 case led_timer:
63 if (!(led_state & LED_STATE_CLAIMED))
64 hw_led_state ^= GPIO_GREEN_LED;
65 break;
66#endif
67
68#ifdef CONFIG_LEDS_CPU
69 case led_idle_start:
70 if (!(led_state & LED_STATE_CLAIMED))
71 hw_led_state &= ~GPIO_RED_LED;
72 break;
73
74 case led_idle_end:
75 if (!(led_state & LED_STATE_CLAIMED))
76 hw_led_state |= GPIO_RED_LED;
77 break;
78#endif
79
80 case led_halted:
81 if (!(led_state & LED_STATE_CLAIMED))
82 hw_led_state |= GPIO_RED_LED;
83 break;
84
85 case led_green_on:
86 if (led_state & LED_STATE_CLAIMED)
87 hw_led_state |= GPIO_GREEN_LED;
88 break;
89
90 case led_green_off:
91 if (led_state & LED_STATE_CLAIMED)
92 hw_led_state &= ~GPIO_GREEN_LED;
93 break;
94
95 case led_amber_on:
96 if (led_state & LED_STATE_CLAIMED)
97 hw_led_state |= GPIO_GREEN_LED | GPIO_RED_LED;
98 break;
99
100 case led_amber_off:
101 if (led_state & LED_STATE_CLAIMED)
102 hw_led_state &= ~(GPIO_GREEN_LED | GPIO_RED_LED);
103 break;
104
105 case led_red_on:
106 if (led_state & LED_STATE_CLAIMED)
107 hw_led_state |= GPIO_RED_LED;
108 break;
109
110 case led_red_off:
111 if (led_state & LED_STATE_CLAIMED)
112 hw_led_state &= ~GPIO_RED_LED;
113 break;
114
115 default:
116 break;
117 }
118
119 raw_spin_unlock_irqrestore(&leds_lock, flags);
120
121 if (led_state & LED_STATE_ENABLED) {
122 raw_spin_lock_irqsave(&nw_gpio_lock, flags);
123 nw_gpio_modify_op(GPIO_RED_LED | GPIO_GREEN_LED, hw_led_state);
124 raw_spin_unlock_irqrestore(&nw_gpio_lock, flags);
125 }
126}
127
128static int __init leds_init(void)
129{
130 if (machine_is_netwinder())
131 leds_event = netwinder_leds_event;
132
133 leds_event(led_start);
134
135 return 0;
136}
137
138__initcall(leds_init);
diff --git a/arch/arm/mach-h720x/Kconfig b/arch/arm/mach-h720x/Kconfig
index abf356c0234..6bb755bcb6f 100644
--- a/arch/arm/mach-h720x/Kconfig
+++ b/arch/arm/mach-h720x/Kconfig
@@ -12,9 +12,9 @@ config ARCH_H7201
12 12
13config ARCH_H7202 13config ARCH_H7202
14 bool "hms30c7202" 14 bool "hms30c7202"
15 depends on ARCH_H720X
15 select CPU_H7202 16 select CPU_H7202
16 select ZONE_DMA 17 select ZONE_DMA
17 depends on ARCH_H720X
18 help 18 help
19 Say Y here if you are using the Hynix HMS30C7202 Reference Board 19 Say Y here if you are using the Hynix HMS30C7202 Reference Board
20 20
diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
new file mode 100644
index 00000000000..0e1d0a42a3e
--- /dev/null
+++ b/arch/arm/mach-highbank/Kconfig
@@ -0,0 +1,15 @@
1config ARCH_HIGHBANK
2 bool "Calxeda ECX-1000 (Highbank)" if ARCH_MULTI_V7
3 select ARCH_WANT_OPTIONAL_GPIOLIB
4 select ARM_AMBA
5 select ARM_GIC
6 select ARM_TIMER_SP804
7 select CACHE_L2X0
8 select CLKDEV_LOOKUP
9 select COMMON_CLK
10 select CPU_V7
11 select GENERIC_CLOCKEVENTS
12 select HAVE_ARM_SCU
13 select HAVE_SMP
14 select SPARSE_IRQ
15 select USE_OF
diff --git a/arch/arm/mach-highbank/Makefile.boot b/arch/arm/mach-highbank/Makefile.boot
deleted file mode 100644
index dae9661a768..00000000000
--- a/arch/arm/mach-highbank/Makefile.boot
+++ /dev/null
@@ -1 +0,0 @@
1zreladdr-y := 0x00008000
diff --git a/arch/arm/mach-highbank/core.h b/arch/arm/mach-highbank/core.h
index 141ed517182..286ec82a4f6 100644
--- a/arch/arm/mach-highbank/core.h
+++ b/arch/arm/mach-highbank/core.h
@@ -8,4 +8,13 @@ extern void highbank_lluart_map_io(void);
8static inline void highbank_lluart_map_io(void) {} 8static inline void highbank_lluart_map_io(void) {}
9#endif 9#endif
10 10
11#ifdef CONFIG_PM_SLEEP
12extern void highbank_pm_init(void);
13#else
14static inline void highbank_pm_init(void) {}
15#endif
16
11extern void highbank_smc1(int fn, int arg); 17extern void highbank_smc1(int fn, int arg);
18extern void highbank_cpu_die(unsigned int cpu);
19
20extern struct smp_operations highbank_smp_ops;
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index d75b0a78d88..40e36a50304 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -15,6 +15,7 @@
15 */ 15 */
16#include <linux/clk.h> 16#include <linux/clk.h>
17#include <linux/clkdev.h> 17#include <linux/clkdev.h>
18#include <linux/dma-mapping.h>
18#include <linux/io.h> 19#include <linux/io.h>
19#include <linux/irq.h> 20#include <linux/irq.h>
20#include <linux/irqdomain.h> 21#include <linux/irqdomain.h>
@@ -23,6 +24,7 @@
23#include <linux/of_platform.h> 24#include <linux/of_platform.h>
24#include <linux/of_address.h> 25#include <linux/of_address.h>
25#include <linux/smp.h> 26#include <linux/smp.h>
27#include <linux/amba/bus.h>
26 28
27#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
28#include <asm/smp_plat.h> 30#include <asm/smp_plat.h>
@@ -149,9 +151,60 @@ static void highbank_power_off(void)
149 cpu_do_idle(); 151 cpu_do_idle();
150} 152}
151 153
154static int highbank_platform_notifier(struct notifier_block *nb,
155 unsigned long event, void *__dev)
156{
157 struct resource *res;
158 int reg = -1;
159 struct device *dev = __dev;
160
161 if (event != BUS_NOTIFY_ADD_DEVICE)
162 return NOTIFY_DONE;
163
164 if (of_device_is_compatible(dev->of_node, "calxeda,hb-ahci"))
165 reg = 0xc;
166 else if (of_device_is_compatible(dev->of_node, "calxeda,hb-sdhci"))
167 reg = 0x18;
168 else if (of_device_is_compatible(dev->of_node, "arm,pl330"))
169 reg = 0x20;
170 else if (of_device_is_compatible(dev->of_node, "calxeda,hb-xgmac")) {
171 res = platform_get_resource(to_platform_device(dev),
172 IORESOURCE_MEM, 0);
173 if (res) {
174 if (res->start == 0xfff50000)
175 reg = 0;
176 else if (res->start == 0xfff51000)
177 reg = 4;
178 }
179 }
180
181 if (reg < 0)
182 return NOTIFY_DONE;
183
184 if (of_property_read_bool(dev->of_node, "dma-coherent")) {
185 writel(0xff31, sregs_base + reg);
186 set_dma_ops(dev, &arm_coherent_dma_ops);
187 } else
188 writel(0, sregs_base + reg);
189
190 return NOTIFY_OK;
191}
192
193static struct notifier_block highbank_amba_nb = {
194 .notifier_call = highbank_platform_notifier,
195};
196
197static struct notifier_block highbank_platform_nb = {
198 .notifier_call = highbank_platform_notifier,
199};
200
152static void __init highbank_init(void) 201static void __init highbank_init(void)
153{ 202{
154 pm_power_off = highbank_power_off; 203 pm_power_off = highbank_power_off;
204 highbank_pm_init();
205
206 bus_register_notifier(&platform_bus_type, &highbank_platform_nb);
207 bus_register_notifier(&amba_bustype, &highbank_amba_nb);
155 208
156 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 209 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
157} 210}
@@ -162,6 +215,7 @@ static const char *highbank_match[] __initconst = {
162}; 215};
163 216
164DT_MACHINE_START(HIGHBANK, "Highbank") 217DT_MACHINE_START(HIGHBANK, "Highbank")
218 .smp = smp_ops(highbank_smp_ops),
165 .map_io = highbank_map_io, 219 .map_io = highbank_map_io,
166 .init_irq = highbank_init_irq, 220 .init_irq = highbank_init_irq,
167 .timer = &highbank_timer, 221 .timer = &highbank_timer,
diff --git a/arch/arm/mach-highbank/hotplug.c b/arch/arm/mach-highbank/hotplug.c
index 977cebbea58..2c1b8c3c8e4 100644
--- a/arch/arm/mach-highbank/hotplug.c
+++ b/arch/arm/mach-highbank/hotplug.c
@@ -24,16 +24,11 @@
24 24
25extern void secondary_startup(void); 25extern void secondary_startup(void);
26 26
27int platform_cpu_kill(unsigned int cpu)
28{
29 return 1;
30}
31
32/* 27/*
33 * platform-specific code to shutdown a CPU 28 * platform-specific code to shutdown a CPU
34 * 29 *
35 */ 30 */
36void platform_cpu_die(unsigned int cpu) 31void __ref highbank_cpu_die(unsigned int cpu)
37{ 32{
38 flush_cache_all(); 33 flush_cache_all();
39 34
@@ -45,12 +40,3 @@ void platform_cpu_die(unsigned int cpu)
45 /* We should never return from idle */ 40 /* We should never return from idle */
46 panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu); 41 panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu);
47} 42}
48
49int platform_cpu_disable(unsigned int cpu)
50{
51 /*
52 * CPU0 should not be shut down via hotplug. cpu_idle can WFI
53 * or a proper shutdown or hibernate should be used.
54 */
55 return cpu == 0 ? -EPERM : 0;
56}
diff --git a/arch/arm/mach-highbank/include/mach/gpio.h b/arch/arm/mach-highbank/include/mach/gpio.h
deleted file mode 100644
index 40a8c178f10..00000000000
--- a/arch/arm/mach-highbank/include/mach/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/mach-highbank/include/mach/timex.h b/arch/arm/mach-highbank/include/mach/timex.h
deleted file mode 100644
index 88dac7a55a9..00000000000
--- a/arch/arm/mach-highbank/include/mach/timex.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __MACH_TIMEX_H
2#define __MACH_TIMEX_H
3
4#define CLOCK_TICK_RATE 1000000
5
6#endif
diff --git a/arch/arm/mach-highbank/include/mach/uncompress.h b/arch/arm/mach-highbank/include/mach/uncompress.h
deleted file mode 100644
index bbe20e69632..00000000000
--- a/arch/arm/mach-highbank/include/mach/uncompress.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef __MACH_UNCOMPRESS_H
2#define __MACH_UNCOMPRESS_H
3
4#define putc(c)
5#define flush()
6#define arch_decomp_setup()
7#define arch_decomp_wdog()
8
9#endif
diff --git a/arch/arm/mach-highbank/platsmp.c b/arch/arm/mach-highbank/platsmp.c
index d01364c72b4..fa9560ec6e7 100644
--- a/arch/arm/mach-highbank/platsmp.c
+++ b/arch/arm/mach-highbank/platsmp.c
@@ -25,12 +25,12 @@
25 25
26extern void secondary_startup(void); 26extern void secondary_startup(void);
27 27
28void __cpuinit platform_secondary_init(unsigned int cpu) 28static void __cpuinit highbank_secondary_init(unsigned int cpu)
29{ 29{
30 gic_secondary_init(0); 30 gic_secondary_init(0);
31} 31}
32 32
33int __cpuinit 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 gic_raise_softirq(cpumask_of(cpu), 0); 35 gic_raise_softirq(cpumask_of(cpu), 0);
36 return 0; 36 return 0;
@@ -40,7 +40,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
40 * Initialise the CPU possible map early - this describes the CPUs 40 * Initialise the CPU possible map early - this describes the CPUs
41 * which may be present or become present in the system. 41 * which may be present or become present in the system.
42 */ 42 */
43void __init smp_init_cpus(void) 43static void __init highbank_smp_init_cpus(void)
44{ 44{
45 unsigned int i, ncores; 45 unsigned int i, ncores;
46 46
@@ -61,7 +61,7 @@ void __init smp_init_cpus(void)
61 set_smp_cross_call(gic_raise_softirq); 61 set_smp_cross_call(gic_raise_softirq);
62} 62}
63 63
64void __init platform_smp_prepare_cpus(unsigned int max_cpus) 64static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)
65{ 65{
66 int i; 66 int i;
67 67
@@ -76,3 +76,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
76 for (i = 1; i < max_cpus; i++) 76 for (i = 1; i < max_cpus; i++)
77 highbank_set_cpu_jump(i, secondary_startup); 77 highbank_set_cpu_jump(i, secondary_startup);
78} 78}
79
80struct smp_operations highbank_smp_ops __initdata = {
81 .smp_init_cpus = highbank_smp_init_cpus,
82 .smp_prepare_cpus = highbank_smp_prepare_cpus,
83 .smp_secondary_init = highbank_secondary_init,
84 .smp_boot_secondary = highbank_boot_secondary,
85#ifdef CONFIG_HOTPLUG_CPU
86 .cpu_die = highbank_cpu_die,
87#endif
88};
diff --git a/arch/arm/mach-highbank/pm.c b/arch/arm/mach-highbank/pm.c
index 33b3beb8998..de866f21331 100644
--- a/arch/arm/mach-highbank/pm.c
+++ b/arch/arm/mach-highbank/pm.c
@@ -47,9 +47,7 @@ static const struct platform_suspend_ops highbank_pm_ops = {
47 .valid = suspend_valid_only_mem, 47 .valid = suspend_valid_only_mem,
48}; 48};
49 49
50static int __init highbank_pm_init(void) 50void __init highbank_pm_init(void)
51{ 51{
52 suspend_set_ops(&highbank_pm_ops); 52 suspend_set_ops(&highbank_pm_ops);
53 return 0;
54} 53}
55module_init(highbank_pm_init);
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index afd542ad6f9..8d276584650 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -41,73 +41,68 @@ config SOC_IMX1
41 41
42config SOC_IMX21 42config SOC_IMX21
43 bool 43 bool
44 select MACH_MX21
45 select CPU_ARM926T
46 select COMMON_CLK 44 select COMMON_CLK
45 select CPU_ARM926T
47 select IMX_HAVE_IOMUX_V1 46 select IMX_HAVE_IOMUX_V1
47 select MACH_MX21
48 select MXC_AVIC 48 select MXC_AVIC
49 49
50config SOC_IMX25 50config SOC_IMX25
51 bool 51 bool
52 select ARCH_MX25 52 select ARCH_MX25
53 select ARCH_MXC_IOMUX_V3
53 select COMMON_CLK 54 select COMMON_CLK
54 select CPU_ARM926T 55 select CPU_ARM926T
55 select HAVE_CAN_FLEXCAN if CAN 56 select HAVE_CAN_FLEXCAN if CAN
56 select ARCH_MXC_IOMUX_V3
57 select MXC_AVIC 57 select MXC_AVIC
58 58
59config SOC_IMX27 59config SOC_IMX27
60 bool 60 bool
61 select MACH_MX27
62 select CPU_ARM926T
63 select COMMON_CLK 61 select COMMON_CLK
62 select CPU_ARM926T
64 select IMX_HAVE_IOMUX_V1 63 select IMX_HAVE_IOMUX_V1
64 select MACH_MX27
65 select MXC_AVIC 65 select MXC_AVIC
66 66
67config SOC_IMX31 67config SOC_IMX31
68 bool 68 bool
69 select COMMON_CLK
69 select CPU_V6 70 select CPU_V6
70 select IMX_HAVE_PLATFORM_MXC_RNGA 71 select IMX_HAVE_PLATFORM_MXC_RNGA
71 select MXC_AVIC 72 select MXC_AVIC
72 select COMMON_CLK
73 select SMP_ON_UP if SMP 73 select SMP_ON_UP if SMP
74 74
75config SOC_IMX35 75config SOC_IMX35
76 bool 76 bool
77 select CPU_V6K
78 select ARCH_MXC_IOMUX_V3 77 select ARCH_MXC_IOMUX_V3
79 select COMMON_CLK 78 select COMMON_CLK
79 select CPU_V6K
80 select HAVE_CAN_FLEXCAN if CAN
80 select HAVE_EPIT 81 select HAVE_EPIT
81 select MXC_AVIC 82 select MXC_AVIC
82 select SMP_ON_UP if SMP 83 select SMP_ON_UP if SMP
83 select HAVE_CAN_FLEXCAN if CAN
84 84
85config SOC_IMX5 85config SOC_IMX5
86 select CPU_V7 86 bool
87 select MXC_TZIC
88 select COMMON_CLK
89 select ARCH_MXC_IOMUX_V3
90 select ARCH_HAS_CPUFREQ 87 select ARCH_HAS_CPUFREQ
91 select ARCH_MX5 88 select ARCH_MX5
92 bool 89 select ARCH_MXC_IOMUX_V3
90 select COMMON_CLK
91 select CPU_V7
92 select MXC_TZIC
93 93
94config SOC_IMX50 94config SOC_IMX50
95 bool 95 bool
96 select SOC_IMX5
97 select ARCH_MX50 96 select ARCH_MX50
97 select SOC_IMX5
98 98
99config SOC_IMX51 99config SOC_IMX51
100 bool 100 bool
101 select SOC_IMX5
102 select ARCH_MX5 101 select ARCH_MX5
103 select ARCH_MX51 102 select ARCH_MX51
104 103 select PINCTRL
105config SOC_IMX53 104 select PINCTRL_IMX51
106 bool
107 select SOC_IMX5 105 select SOC_IMX5
108 select ARCH_MX5
109 select ARCH_MX53
110 select HAVE_CAN_FLEXCAN if CAN
111 106
112if ARCH_IMX_V4_V5 107if ARCH_IMX_V4_V5
113 108
@@ -117,10 +112,10 @@ config MACH_MXLADS
117 112
118config ARCH_MX1ADS 113config ARCH_MX1ADS
119 bool "MX1ADS platform" 114 bool "MX1ADS platform"
120 select MACH_MXLADS
121 select SOC_IMX1
122 select IMX_HAVE_PLATFORM_IMX_I2C 115 select IMX_HAVE_PLATFORM_IMX_I2C
123 select IMX_HAVE_PLATFORM_IMX_UART 116 select IMX_HAVE_PLATFORM_IMX_UART
117 select MACH_MXLADS
118 select SOC_IMX1
124 help 119 help
125 Say Y here if you are using Motorola MX1ADS/MXLADS boards 120 Say Y here if you are using Motorola MX1ADS/MXLADS boards
126 121
@@ -132,9 +127,9 @@ config MACH_SCB9328
132 127
133config MACH_APF9328 128config MACH_APF9328
134 bool "APF9328" 129 bool "APF9328"
135 select SOC_IMX1
136 select IMX_HAVE_PLATFORM_IMX_I2C 130 select IMX_HAVE_PLATFORM_IMX_I2C
137 select IMX_HAVE_PLATFORM_IMX_UART 131 select IMX_HAVE_PLATFORM_IMX_UART
132 select SOC_IMX1
138 help 133 help
139 Say Yes here if you are using the Armadeus APF9328 development board 134 Say Yes here if you are using the Armadeus APF9328 development board
140 135
@@ -142,11 +137,11 @@ comment "MX21 platforms:"
142 137
143config MACH_MX21ADS 138config MACH_MX21ADS
144 bool "MX21ADS platform" 139 bool "MX21ADS platform"
145 select SOC_IMX21
146 select IMX_HAVE_PLATFORM_IMX_FB 140 select IMX_HAVE_PLATFORM_IMX_FB
147 select IMX_HAVE_PLATFORM_IMX_UART 141 select IMX_HAVE_PLATFORM_IMX_UART
148 select IMX_HAVE_PLATFORM_MXC_MMC 142 select IMX_HAVE_PLATFORM_MXC_MMC
149 select IMX_HAVE_PLATFORM_MXC_NAND 143 select IMX_HAVE_PLATFORM_MXC_NAND
144 select SOC_IMX21
150 help 145 help
151 Include support for MX21ADS platform. This includes specific 146 Include support for MX21ADS platform. This includes specific
152 configurations for the board and its peripherals. 147 configurations for the board and its peripherals.
@@ -155,22 +150,21 @@ comment "MX25 platforms:"
155 150
156config MACH_MX25_3DS 151config MACH_MX25_3DS
157 bool "Support MX25PDK (3DS) Platform" 152 bool "Support MX25PDK (3DS) Platform"
158 select SOC_IMX25
159 select IMX_HAVE_PLATFORM_FLEXCAN 153 select IMX_HAVE_PLATFORM_FLEXCAN
160 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 154 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
161 select IMX_HAVE_PLATFORM_IMX2_WDT 155 select IMX_HAVE_PLATFORM_IMX2_WDT
162 select IMX_HAVE_PLATFORM_IMXDI_RTC 156 select IMX_HAVE_PLATFORM_IMXDI_RTC
163 select IMX_HAVE_PLATFORM_IMX_I2C
164 select IMX_HAVE_PLATFORM_IMX_FB 157 select IMX_HAVE_PLATFORM_IMX_FB
158 select IMX_HAVE_PLATFORM_IMX_I2C
165 select IMX_HAVE_PLATFORM_IMX_KEYPAD 159 select IMX_HAVE_PLATFORM_IMX_KEYPAD
166 select IMX_HAVE_PLATFORM_IMX_UART 160 select IMX_HAVE_PLATFORM_IMX_UART
167 select IMX_HAVE_PLATFORM_MXC_EHCI 161 select IMX_HAVE_PLATFORM_MXC_EHCI
168 select IMX_HAVE_PLATFORM_MXC_NAND 162 select IMX_HAVE_PLATFORM_MXC_NAND
169 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 163 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
164 select SOC_IMX25
170 165
171config MACH_EUKREA_CPUIMX25SD 166config MACH_EUKREA_CPUIMX25SD
172 bool "Support Eukrea CPUIMX25 Platform" 167 bool "Support Eukrea CPUIMX25 Platform"
173 select SOC_IMX25
174 select IMX_HAVE_PLATFORM_FLEXCAN 168 select IMX_HAVE_PLATFORM_FLEXCAN
175 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 169 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
176 select IMX_HAVE_PLATFORM_IMX2_WDT 170 select IMX_HAVE_PLATFORM_IMX2_WDT
@@ -182,6 +176,7 @@ config MACH_EUKREA_CPUIMX25SD
182 select IMX_HAVE_PLATFORM_MXC_NAND 176 select IMX_HAVE_PLATFORM_MXC_NAND
183 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 177 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
184 select MXC_ULPI if USB_ULPI 178 select MXC_ULPI if USB_ULPI
179 select SOC_IMX25
185 180
186choice 181choice
187 prompt "Baseboard" 182 prompt "Baseboard"
@@ -204,20 +199,19 @@ comment "MX27 platforms:"
204 199
205config MACH_MX27ADS 200config MACH_MX27ADS
206 bool "MX27ADS platform" 201 bool "MX27ADS platform"
207 select SOC_IMX27
208 select IMX_HAVE_PLATFORM_IMX_FB 202 select IMX_HAVE_PLATFORM_IMX_FB
209 select IMX_HAVE_PLATFORM_IMX_I2C 203 select IMX_HAVE_PLATFORM_IMX_I2C
210 select IMX_HAVE_PLATFORM_IMX_UART 204 select IMX_HAVE_PLATFORM_IMX_UART
211 select IMX_HAVE_PLATFORM_MXC_MMC 205 select IMX_HAVE_PLATFORM_MXC_MMC
212 select IMX_HAVE_PLATFORM_MXC_NAND 206 select IMX_HAVE_PLATFORM_MXC_NAND
213 select IMX_HAVE_PLATFORM_MXC_W1 207 select IMX_HAVE_PLATFORM_MXC_W1
208 select SOC_IMX27
214 help 209 help
215 Include support for MX27ADS platform. This includes specific 210 Include support for MX27ADS platform. This includes specific
216 configurations for the board and its peripherals. 211 configurations for the board and its peripherals.
217 212
218config MACH_PCM038 213config MACH_PCM038
219 bool "Phytec phyCORE-i.MX27 CPU module (pcm038)" 214 bool "Phytec phyCORE-i.MX27 CPU module (pcm038)"
220 select SOC_IMX27
221 select IMX_HAVE_PLATFORM_IMX2_WDT 215 select IMX_HAVE_PLATFORM_IMX2_WDT
222 select IMX_HAVE_PLATFORM_IMX_I2C 216 select IMX_HAVE_PLATFORM_IMX_I2C
223 select IMX_HAVE_PLATFORM_IMX_UART 217 select IMX_HAVE_PLATFORM_IMX_UART
@@ -226,6 +220,7 @@ config MACH_PCM038
226 select IMX_HAVE_PLATFORM_MXC_W1 220 select IMX_HAVE_PLATFORM_MXC_W1
227 select IMX_HAVE_PLATFORM_SPI_IMX 221 select IMX_HAVE_PLATFORM_SPI_IMX
228 select MXC_ULPI if USB_ULPI 222 select MXC_ULPI if USB_ULPI
223 select SOC_IMX27
229 help 224 help
230 Include support for phyCORE-i.MX27 (aka pcm038) platform. This 225 Include support for phyCORE-i.MX27 (aka pcm038) platform. This
231 includes specific configurations for the module and its peripherals. 226 includes specific configurations for the module and its peripherals.
@@ -247,7 +242,6 @@ endchoice
247 242
248config MACH_CPUIMX27 243config MACH_CPUIMX27
249 bool "Eukrea CPUIMX27 module" 244 bool "Eukrea CPUIMX27 module"
250 select SOC_IMX27
251 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 245 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
252 select IMX_HAVE_PLATFORM_IMX2_WDT 246 select IMX_HAVE_PLATFORM_IMX2_WDT
253 select IMX_HAVE_PLATFORM_IMX_I2C 247 select IMX_HAVE_PLATFORM_IMX_I2C
@@ -256,6 +250,7 @@ config MACH_CPUIMX27
256 select IMX_HAVE_PLATFORM_MXC_NAND 250 select IMX_HAVE_PLATFORM_MXC_NAND
257 select IMX_HAVE_PLATFORM_MXC_W1 251 select IMX_HAVE_PLATFORM_MXC_W1
258 select MXC_ULPI if USB_ULPI 252 select MXC_ULPI if USB_ULPI
253 select SOC_IMX27
259 help 254 help
260 Include support for Eukrea CPUIMX27 platform. This includes 255 Include support for Eukrea CPUIMX27 platform. This includes
261 specific configurations for the module and its peripherals. 256 specific configurations for the module and its peripherals.
@@ -297,12 +292,12 @@ endchoice
297 292
298config MACH_MX27_3DS 293config MACH_MX27_3DS
299 bool "MX27PDK platform" 294 bool "MX27PDK platform"
300 select SOC_IMX27
301 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 295 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
302 select IMX_HAVE_PLATFORM_IMX2_WDT 296 select IMX_HAVE_PLATFORM_IMX2_WDT
303 select IMX_HAVE_PLATFORM_IMX_FB 297 select IMX_HAVE_PLATFORM_IMX_FB
304 select IMX_HAVE_PLATFORM_IMX_I2C 298 select IMX_HAVE_PLATFORM_IMX_I2C
305 select IMX_HAVE_PLATFORM_IMX_KEYPAD 299 select IMX_HAVE_PLATFORM_IMX_KEYPAD
300 select IMX_HAVE_PLATFORM_IMX_SSI
306 select IMX_HAVE_PLATFORM_IMX_UART 301 select IMX_HAVE_PLATFORM_IMX_UART
307 select IMX_HAVE_PLATFORM_MX2_CAMERA 302 select IMX_HAVE_PLATFORM_MX2_CAMERA
308 select IMX_HAVE_PLATFORM_MXC_EHCI 303 select IMX_HAVE_PLATFORM_MXC_EHCI
@@ -310,13 +305,13 @@ config MACH_MX27_3DS
310 select IMX_HAVE_PLATFORM_SPI_IMX 305 select IMX_HAVE_PLATFORM_SPI_IMX
311 select MXC_DEBUG_BOARD 306 select MXC_DEBUG_BOARD
312 select MXC_ULPI if USB_ULPI 307 select MXC_ULPI if USB_ULPI
308 select SOC_IMX27
313 help 309 help
314 Include support for MX27PDK platform. This includes specific 310 Include support for MX27PDK platform. This includes specific
315 configurations for the board and its peripherals. 311 configurations for the board and its peripherals.
316 312
317config MACH_IMX27_VISSTRIM_M10 313config MACH_IMX27_VISSTRIM_M10
318 bool "Vista Silicon i.MX27 Visstrim_m10" 314 bool "Vista Silicon i.MX27 Visstrim_m10"
319 select SOC_IMX27
320 select IMX_HAVE_PLATFORM_GPIO_KEYS 315 select IMX_HAVE_PLATFORM_GPIO_KEYS
321 select IMX_HAVE_PLATFORM_IMX_I2C 316 select IMX_HAVE_PLATFORM_IMX_I2C
322 select IMX_HAVE_PLATFORM_IMX_SSI 317 select IMX_HAVE_PLATFORM_IMX_SSI
@@ -325,6 +320,7 @@ config MACH_IMX27_VISSTRIM_M10
325 select IMX_HAVE_PLATFORM_MXC_EHCI 320 select IMX_HAVE_PLATFORM_MXC_EHCI
326 select IMX_HAVE_PLATFORM_MXC_MMC 321 select IMX_HAVE_PLATFORM_MXC_MMC
327 select LEDS_GPIO_REGISTER 322 select LEDS_GPIO_REGISTER
323 select SOC_IMX27
328 help 324 help
329 Include support for Visstrim_m10 platform and its different variants. 325 Include support for Visstrim_m10 platform and its different variants.
330 This includes specific configurations for the board and its 326 This includes specific configurations for the board and its
@@ -332,16 +328,15 @@ config MACH_IMX27_VISSTRIM_M10
332 328
333config MACH_IMX27LITE 329config MACH_IMX27LITE
334 bool "LogicPD MX27 LITEKIT platform" 330 bool "LogicPD MX27 LITEKIT platform"
335 select SOC_IMX27
336 select IMX_HAVE_PLATFORM_IMX_UART
337 select IMX_HAVE_PLATFORM_IMX_SSI 331 select IMX_HAVE_PLATFORM_IMX_SSI
332 select IMX_HAVE_PLATFORM_IMX_UART
333 select SOC_IMX27
338 help 334 help
339 Include support for MX27 LITEKIT platform. This includes specific 335 Include support for MX27 LITEKIT platform. This includes specific
340 configurations for the board and its peripherals. 336 configurations for the board and its peripherals.
341 337
342config MACH_PCA100 338config MACH_PCA100
343 bool "Phytec phyCARD-s (pca100)" 339 bool "Phytec phyCARD-s (pca100)"
344 select SOC_IMX27
345 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 340 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
346 select IMX_HAVE_PLATFORM_IMX2_WDT 341 select IMX_HAVE_PLATFORM_IMX2_WDT
347 select IMX_HAVE_PLATFORM_IMX_FB 342 select IMX_HAVE_PLATFORM_IMX_FB
@@ -354,27 +349,28 @@ config MACH_PCA100
354 select IMX_HAVE_PLATFORM_MXC_W1 349 select IMX_HAVE_PLATFORM_MXC_W1
355 select IMX_HAVE_PLATFORM_SPI_IMX 350 select IMX_HAVE_PLATFORM_SPI_IMX
356 select MXC_ULPI if USB_ULPI 351 select MXC_ULPI if USB_ULPI
352 select SOC_IMX27
357 help 353 help
358 Include support for phyCARD-s (aka pca100) platform. This 354 Include support for phyCARD-s (aka pca100) platform. This
359 includes specific configurations for the module and its peripherals. 355 includes specific configurations for the module and its peripherals.
360 356
361config MACH_MXT_TD60 357config MACH_MXT_TD60
362 bool "Maxtrack i-MXT TD60" 358 bool "Maxtrack i-MXT TD60"
363 select SOC_IMX27
364 select IMX_HAVE_PLATFORM_IMX_FB 359 select IMX_HAVE_PLATFORM_IMX_FB
365 select IMX_HAVE_PLATFORM_IMX_I2C 360 select IMX_HAVE_PLATFORM_IMX_I2C
366 select IMX_HAVE_PLATFORM_IMX_UART 361 select IMX_HAVE_PLATFORM_IMX_UART
367 select IMX_HAVE_PLATFORM_MXC_MMC 362 select IMX_HAVE_PLATFORM_MXC_MMC
368 select IMX_HAVE_PLATFORM_MXC_NAND 363 select IMX_HAVE_PLATFORM_MXC_NAND
364 select SOC_IMX27
369 help 365 help
370 Include support for i-MXT (aka td60) platform. This 366 Include support for i-MXT (aka td60) platform. This
371 includes specific configurations for the module and its peripherals. 367 includes specific configurations for the module and its peripherals.
372 368
373config MACH_IMX27IPCAM 369config MACH_IMX27IPCAM
374 bool "IMX27 IPCAM platform" 370 bool "IMX27 IPCAM platform"
375 select SOC_IMX27
376 select IMX_HAVE_PLATFORM_IMX2_WDT 371 select IMX_HAVE_PLATFORM_IMX2_WDT
377 select IMX_HAVE_PLATFORM_IMX_UART 372 select IMX_HAVE_PLATFORM_IMX_UART
373 select SOC_IMX27
378 help 374 help
379 Include support for IMX27 IPCAM platform. This includes specific 375 Include support for IMX27 IPCAM platform. This includes specific
380 configurations for the board and its peripherals. 376 configurations for the board and its peripherals.
@@ -394,11 +390,11 @@ comment "MX31 platforms:"
394 390
395config MACH_MX31ADS 391config MACH_MX31ADS
396 bool "Support MX31ADS platforms" 392 bool "Support MX31ADS platforms"
397 select SOC_IMX31 393 default y
398 select IMX_HAVE_PLATFORM_IMX_I2C 394 select IMX_HAVE_PLATFORM_IMX_I2C
399 select IMX_HAVE_PLATFORM_IMX_SSI 395 select IMX_HAVE_PLATFORM_IMX_SSI
400 select IMX_HAVE_PLATFORM_IMX_UART 396 select IMX_HAVE_PLATFORM_IMX_UART
401 default y 397 select SOC_IMX31
402 help 398 help
403 Include support for MX31ADS platform. This includes specific 399 Include support for MX31ADS platform. This includes specific
404 configurations for the board and its peripherals. 400 configurations for the board and its peripherals.
@@ -416,21 +412,19 @@ config MACH_MX31ADS_WM1133_EV1
416 412
417config MACH_MX31LILLY 413config MACH_MX31LILLY
418 bool "Support MX31 LILLY-1131 platforms (INCO startec)" 414 bool "Support MX31 LILLY-1131 platforms (INCO startec)"
419 select SOC_IMX31
420 select IMX_HAVE_PLATFORM_IMX_UART 415 select IMX_HAVE_PLATFORM_IMX_UART
421 select IMX_HAVE_PLATFORM_IPU_CORE 416 select IMX_HAVE_PLATFORM_IPU_CORE
422 select IMX_HAVE_PLATFORM_MXC_EHCI 417 select IMX_HAVE_PLATFORM_MXC_EHCI
423 select IMX_HAVE_PLATFORM_MXC_MMC 418 select IMX_HAVE_PLATFORM_MXC_MMC
424 select IMX_HAVE_PLATFORM_SPI_IMX 419 select IMX_HAVE_PLATFORM_SPI_IMX
425 select MXC_ULPI if USB_ULPI 420 select MXC_ULPI if USB_ULPI
421 select SOC_IMX31
426 help 422 help
427 Include support for mx31 based LILLY1131 modules. This includes 423 Include support for mx31 based LILLY1131 modules. This includes
428 specific configurations for the board and its peripherals. 424 specific configurations for the board and its peripherals.
429 425
430config MACH_MX31LITE 426config MACH_MX31LITE
431 bool "Support MX31 LITEKIT (LogicPD)" 427 bool "Support MX31 LITEKIT (LogicPD)"
432 select SOC_IMX31
433 select MXC_ULPI if USB_ULPI
434 select IMX_HAVE_PLATFORM_IMX2_WDT 428 select IMX_HAVE_PLATFORM_IMX2_WDT
435 select IMX_HAVE_PLATFORM_IMX_UART 429 select IMX_HAVE_PLATFORM_IMX_UART
436 select IMX_HAVE_PLATFORM_MXC_EHCI 430 select IMX_HAVE_PLATFORM_MXC_EHCI
@@ -439,13 +433,14 @@ config MACH_MX31LITE
439 select IMX_HAVE_PLATFORM_MXC_RTC 433 select IMX_HAVE_PLATFORM_MXC_RTC
440 select IMX_HAVE_PLATFORM_SPI_IMX 434 select IMX_HAVE_PLATFORM_SPI_IMX
441 select LEDS_GPIO_REGISTER 435 select LEDS_GPIO_REGISTER
436 select MXC_ULPI if USB_ULPI
437 select SOC_IMX31
442 help 438 help
443 Include support for MX31 LITEKIT platform. This includes specific 439 Include support for MX31 LITEKIT platform. This includes specific
444 configurations for the board and its peripherals. 440 configurations for the board and its peripherals.
445 441
446config MACH_PCM037 442config MACH_PCM037
447 bool "Support Phytec pcm037 (i.MX31) platforms" 443 bool "Support Phytec pcm037 (i.MX31) platforms"
448 select SOC_IMX31
449 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 444 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
450 select IMX_HAVE_PLATFORM_IMX2_WDT 445 select IMX_HAVE_PLATFORM_IMX2_WDT
451 select IMX_HAVE_PLATFORM_IMX_I2C 446 select IMX_HAVE_PLATFORM_IMX_I2C
@@ -456,6 +451,7 @@ config MACH_PCM037
456 select IMX_HAVE_PLATFORM_MXC_NAND 451 select IMX_HAVE_PLATFORM_MXC_NAND
457 select IMX_HAVE_PLATFORM_MXC_W1 452 select IMX_HAVE_PLATFORM_MXC_W1
458 select MXC_ULPI if USB_ULPI 453 select MXC_ULPI if USB_ULPI
454 select SOC_IMX31
459 help 455 help
460 Include support for Phytec pcm037 platform. This includes 456 Include support for Phytec pcm037 platform. This includes
461 specific configurations for the board and its peripherals. 457 specific configurations for the board and its peripherals.
@@ -472,8 +468,6 @@ config MACH_PCM037_EET
472 468
473config MACH_MX31_3DS 469config MACH_MX31_3DS
474 bool "Support MX31PDK (3DS)" 470 bool "Support MX31PDK (3DS)"
475 select SOC_IMX31
476 select MXC_DEBUG_BOARD
477 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 471 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
478 select IMX_HAVE_PLATFORM_IMX2_WDT 472 select IMX_HAVE_PLATFORM_IMX2_WDT
479 select IMX_HAVE_PLATFORM_IMX_I2C 473 select IMX_HAVE_PLATFORM_IMX_I2C
@@ -485,7 +479,9 @@ config MACH_MX31_3DS
485 select IMX_HAVE_PLATFORM_MXC_MMC 479 select IMX_HAVE_PLATFORM_MXC_MMC
486 select IMX_HAVE_PLATFORM_MXC_NAND 480 select IMX_HAVE_PLATFORM_MXC_NAND
487 select IMX_HAVE_PLATFORM_SPI_IMX 481 select IMX_HAVE_PLATFORM_SPI_IMX
482 select MXC_DEBUG_BOARD
488 select MXC_ULPI if USB_ULPI 483 select MXC_ULPI if USB_ULPI
484 select SOC_IMX31
489 help 485 help
490 Include support for MX31PDK (3DS) platform. This includes specific 486 Include support for MX31PDK (3DS) platform. This includes specific
491 configurations for the board and its peripherals. 487 configurations for the board and its peripherals.
@@ -501,7 +497,6 @@ config MACH_MX31_3DS_MXC_NAND_USE_BBT
501 497
502config MACH_MX31MOBOARD 498config MACH_MX31MOBOARD
503 bool "Support mx31moboard platforms (EPFL Mobots group)" 499 bool "Support mx31moboard platforms (EPFL Mobots group)"
504 select SOC_IMX31
505 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 500 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
506 select IMX_HAVE_PLATFORM_IMX2_WDT 501 select IMX_HAVE_PLATFORM_IMX2_WDT
507 select IMX_HAVE_PLATFORM_IMX_I2C 502 select IMX_HAVE_PLATFORM_IMX_I2C
@@ -513,22 +508,22 @@ config MACH_MX31MOBOARD
513 select IMX_HAVE_PLATFORM_SPI_IMX 508 select IMX_HAVE_PLATFORM_SPI_IMX
514 select LEDS_GPIO_REGISTER 509 select LEDS_GPIO_REGISTER
515 select MXC_ULPI if USB_ULPI 510 select MXC_ULPI if USB_ULPI
511 select SOC_IMX31
516 help 512 help
517 Include support for mx31moboard platform. This includes specific 513 Include support for mx31moboard platform. This includes specific
518 configurations for the board and its peripherals. 514 configurations for the board and its peripherals.
519 515
520config MACH_QONG 516config MACH_QONG
521 bool "Support Dave/DENX QongEVB-LITE platform" 517 bool "Support Dave/DENX QongEVB-LITE platform"
522 select SOC_IMX31
523 select IMX_HAVE_PLATFORM_IMX_UART
524 select IMX_HAVE_PLATFORM_IMX2_WDT 518 select IMX_HAVE_PLATFORM_IMX2_WDT
519 select IMX_HAVE_PLATFORM_IMX_UART
520 select SOC_IMX31
525 help 521 help
526 Include support for Dave/DENX QongEVB-LITE platform. This includes 522 Include support for Dave/DENX QongEVB-LITE platform. This includes
527 specific configurations for the board and its peripherals. 523 specific configurations for the board and its peripherals.
528 524
529config MACH_ARMADILLO5X0 525config MACH_ARMADILLO5X0
530 bool "Support Atmark Armadillo-500 Development Base Board" 526 bool "Support Atmark Armadillo-500 Development Base Board"
531 select SOC_IMX31
532 select IMX_HAVE_PLATFORM_GPIO_KEYS 527 select IMX_HAVE_PLATFORM_GPIO_KEYS
533 select IMX_HAVE_PLATFORM_IMX_I2C 528 select IMX_HAVE_PLATFORM_IMX_I2C
534 select IMX_HAVE_PLATFORM_IMX_UART 529 select IMX_HAVE_PLATFORM_IMX_UART
@@ -537,23 +532,24 @@ config MACH_ARMADILLO5X0
537 select IMX_HAVE_PLATFORM_MXC_MMC 532 select IMX_HAVE_PLATFORM_MXC_MMC
538 select IMX_HAVE_PLATFORM_MXC_NAND 533 select IMX_HAVE_PLATFORM_MXC_NAND
539 select MXC_ULPI if USB_ULPI 534 select MXC_ULPI if USB_ULPI
535 select SOC_IMX31
540 help 536 help
541 Include support for Atmark Armadillo-500 platform. This includes 537 Include support for Atmark Armadillo-500 platform. This includes
542 specific configurations for the board and its peripherals. 538 specific configurations for the board and its peripherals.
543 539
544config MACH_KZM_ARM11_01 540config MACH_KZM_ARM11_01
545 bool "Support KZM-ARM11-01(Kyoto Microcomputer)" 541 bool "Support KZM-ARM11-01(Kyoto Microcomputer)"
546 select SOC_IMX31
547 select IMX_HAVE_PLATFORM_IMX_UART 542 select IMX_HAVE_PLATFORM_IMX_UART
543 select SOC_IMX31
548 help 544 help
549 Include support for KZM-ARM11-01. This includes specific 545 Include support for KZM-ARM11-01. This includes specific
550 configurations for the board and its peripherals. 546 configurations for the board and its peripherals.
551 547
552config MACH_BUG 548config MACH_BUG
553 bool "Support Buglabs BUGBase platform" 549 bool "Support Buglabs BUGBase platform"
554 select SOC_IMX31
555 select IMX_HAVE_PLATFORM_IMX_UART
556 default y 550 default y
551 select IMX_HAVE_PLATFORM_IMX_UART
552 select SOC_IMX31
557 help 553 help
558 Include support for BUGBase 1.3 platform. This includes specific 554 Include support for BUGBase 1.3 platform. This includes specific
559 configurations for the board and its peripherals. 555 configurations for the board and its peripherals.
@@ -561,7 +557,6 @@ config MACH_BUG
561config MACH_IMX31_DT 557config MACH_IMX31_DT
562 bool "Support i.MX31 platforms from device tree" 558 bool "Support i.MX31 platforms from device tree"
563 select SOC_IMX31 559 select SOC_IMX31
564 select USE_OF
565 help 560 help
566 Include support for Freescale i.MX31 based platforms 561 Include support for Freescale i.MX31 based platforms
567 using the device tree for discovery. 562 using the device tree for discovery.
@@ -570,7 +565,6 @@ comment "MX35 platforms:"
570 565
571config MACH_PCM043 566config MACH_PCM043
572 bool "Support Phytec pcm043 (i.MX35) platforms" 567 bool "Support Phytec pcm043 (i.MX35) platforms"
573 select SOC_IMX35
574 select IMX_HAVE_PLATFORM_FLEXCAN 568 select IMX_HAVE_PLATFORM_FLEXCAN
575 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 569 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
576 select IMX_HAVE_PLATFORM_IMX2_WDT 570 select IMX_HAVE_PLATFORM_IMX2_WDT
@@ -582,14 +576,13 @@ config MACH_PCM043
582 select IMX_HAVE_PLATFORM_MXC_NAND 576 select IMX_HAVE_PLATFORM_MXC_NAND
583 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 577 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
584 select MXC_ULPI if USB_ULPI 578 select MXC_ULPI if USB_ULPI
579 select SOC_IMX35
585 help 580 help
586 Include support for Phytec pcm043 platform. This includes 581 Include support for Phytec pcm043 platform. This includes
587 specific configurations for the board and its peripherals. 582 specific configurations for the board and its peripherals.
588 583
589config MACH_MX35_3DS 584config MACH_MX35_3DS
590 bool "Support MX35PDK platform" 585 bool "Support MX35PDK platform"
591 select SOC_IMX35
592 select MXC_DEBUG_BOARD
593 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 586 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
594 select IMX_HAVE_PLATFORM_IMX2_WDT 587 select IMX_HAVE_PLATFORM_IMX2_WDT
595 select IMX_HAVE_PLATFORM_IMX_FB 588 select IMX_HAVE_PLATFORM_IMX_FB
@@ -600,13 +593,14 @@ config MACH_MX35_3DS
600 select IMX_HAVE_PLATFORM_MXC_NAND 593 select IMX_HAVE_PLATFORM_MXC_NAND
601 select IMX_HAVE_PLATFORM_MXC_RTC 594 select IMX_HAVE_PLATFORM_MXC_RTC
602 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 595 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
596 select MXC_DEBUG_BOARD
597 select SOC_IMX35
603 help 598 help
604 Include support for MX35PDK platform. This includes specific 599 Include support for MX35PDK platform. This includes specific
605 configurations for the board and its peripherals. 600 configurations for the board and its peripherals.
606 601
607config MACH_EUKREA_CPUIMX35SD 602config MACH_EUKREA_CPUIMX35SD
608 bool "Support Eukrea CPUIMX35 Platform" 603 bool "Support Eukrea CPUIMX35 Platform"
609 select SOC_IMX35
610 select IMX_HAVE_PLATFORM_FLEXCAN 604 select IMX_HAVE_PLATFORM_FLEXCAN
611 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 605 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
612 select IMX_HAVE_PLATFORM_IMX2_WDT 606 select IMX_HAVE_PLATFORM_IMX2_WDT
@@ -616,6 +610,7 @@ config MACH_EUKREA_CPUIMX35SD
616 select IMX_HAVE_PLATFORM_MXC_NAND 610 select IMX_HAVE_PLATFORM_MXC_NAND
617 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 611 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
618 select MXC_ULPI if USB_ULPI 612 select MXC_ULPI if USB_ULPI
613 select SOC_IMX35
619 help 614 help
620 Include support for Eukrea CPUIMX35 platform. This includes 615 Include support for Eukrea CPUIMX35 platform. This includes
621 specific configurations for the board and its peripherals. 616 specific configurations for the board and its peripherals.
@@ -640,16 +635,16 @@ endchoice
640 635
641config MACH_VPR200 636config MACH_VPR200
642 bool "Support VPR200 platform" 637 bool "Support VPR200 platform"
643 select SOC_IMX35
644 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 638 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
645 select IMX_HAVE_PLATFORM_GPIO_KEYS 639 select IMX_HAVE_PLATFORM_GPIO_KEYS
646 select IMX_HAVE_PLATFORM_IMX2_WDT 640 select IMX_HAVE_PLATFORM_IMX2_WDT
647 select IMX_HAVE_PLATFORM_IMX_UART
648 select IMX_HAVE_PLATFORM_IMX_I2C 641 select IMX_HAVE_PLATFORM_IMX_I2C
642 select IMX_HAVE_PLATFORM_IMX_UART
649 select IMX_HAVE_PLATFORM_IPU_CORE 643 select IMX_HAVE_PLATFORM_IPU_CORE
650 select IMX_HAVE_PLATFORM_MXC_EHCI 644 select IMX_HAVE_PLATFORM_MXC_EHCI
651 select IMX_HAVE_PLATFORM_MXC_NAND 645 select IMX_HAVE_PLATFORM_MXC_NAND
652 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 646 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
647 select SOC_IMX35
653 help 648 help
654 Include support for VPR200 platform. This includes specific 649 Include support for VPR200 platform. This includes specific
655 configurations for the board and its peripherals. 650 configurations for the board and its peripherals.
@@ -659,11 +654,11 @@ comment "i.MX5 platforms:"
659config MACH_MX50_RDP 654config MACH_MX50_RDP
660 bool "Support MX50 reference design platform" 655 bool "Support MX50 reference design platform"
661 depends on BROKEN 656 depends on BROKEN
662 select SOC_IMX50
663 select IMX_HAVE_PLATFORM_IMX_I2C 657 select IMX_HAVE_PLATFORM_IMX_I2C
664 select IMX_HAVE_PLATFORM_IMX_UART 658 select IMX_HAVE_PLATFORM_IMX_UART
665 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 659 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
666 select IMX_HAVE_PLATFORM_SPI_IMX 660 select IMX_HAVE_PLATFORM_SPI_IMX
661 select SOC_IMX50
667 help 662 help
668 Include support for MX50 reference design platform (RDP) board. This 663 Include support for MX50 reference design platform (RDP) board. This
669 includes specific configurations for the board and its peripherals. 664 includes specific configurations for the board and its peripherals.
@@ -672,15 +667,14 @@ comment "i.MX51 machines:"
672 667
673config MACH_IMX51_DT 668config MACH_IMX51_DT
674 bool "Support i.MX51 platforms from device tree" 669 bool "Support i.MX51 platforms from device tree"
675 select SOC_IMX51
676 select MACH_MX51_BABBAGE 670 select MACH_MX51_BABBAGE
671 select SOC_IMX51
677 help 672 help
678 Include support for Freescale i.MX51 based platforms 673 Include support for Freescale i.MX51 based platforms
679 using the device tree for discovery 674 using the device tree for discovery
680 675
681config MACH_MX51_BABBAGE 676config MACH_MX51_BABBAGE
682 bool "Support MX51 BABBAGE platforms" 677 bool "Support MX51 BABBAGE platforms"
683 select SOC_IMX51
684 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 678 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
685 select IMX_HAVE_PLATFORM_IMX2_WDT 679 select IMX_HAVE_PLATFORM_IMX2_WDT
686 select IMX_HAVE_PLATFORM_IMX_I2C 680 select IMX_HAVE_PLATFORM_IMX_I2C
@@ -688,6 +682,7 @@ config MACH_MX51_BABBAGE
688 select IMX_HAVE_PLATFORM_MXC_EHCI 682 select IMX_HAVE_PLATFORM_MXC_EHCI
689 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 683 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
690 select IMX_HAVE_PLATFORM_SPI_IMX 684 select IMX_HAVE_PLATFORM_SPI_IMX
685 select SOC_IMX51
691 help 686 help
692 Include support for MX51 Babbage platform, also known as MX51EVK in 687 Include support for MX51 Babbage platform, also known as MX51EVK in
693 u-boot. This includes specific configurations for the board and its 688 u-boot. This includes specific configurations for the board and its
@@ -695,27 +690,27 @@ config MACH_MX51_BABBAGE
695 690
696config MACH_MX51_3DS 691config MACH_MX51_3DS
697 bool "Support MX51PDK (3DS)" 692 bool "Support MX51PDK (3DS)"
698 select SOC_IMX51
699 select IMX_HAVE_PLATFORM_IMX2_WDT 693 select IMX_HAVE_PLATFORM_IMX2_WDT
700 select IMX_HAVE_PLATFORM_IMX_KEYPAD 694 select IMX_HAVE_PLATFORM_IMX_KEYPAD
701 select IMX_HAVE_PLATFORM_IMX_UART 695 select IMX_HAVE_PLATFORM_IMX_UART
702 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 696 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
703 select IMX_HAVE_PLATFORM_SPI_IMX 697 select IMX_HAVE_PLATFORM_SPI_IMX
704 select MXC_DEBUG_BOARD 698 select MXC_DEBUG_BOARD
699 select SOC_IMX51
705 help 700 help
706 Include support for MX51PDK (3DS) platform. This includes specific 701 Include support for MX51PDK (3DS) platform. This includes specific
707 configurations for the board and its peripherals. 702 configurations for the board and its peripherals.
708 703
709config MACH_EUKREA_CPUIMX51SD 704config MACH_EUKREA_CPUIMX51SD
710 bool "Support Eukrea CPUIMX51SD module" 705 bool "Support Eukrea CPUIMX51SD module"
711 select SOC_IMX51
712 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 706 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
707 select IMX_HAVE_PLATFORM_IMX2_WDT
713 select IMX_HAVE_PLATFORM_IMX_I2C 708 select IMX_HAVE_PLATFORM_IMX_I2C
714 select IMX_HAVE_PLATFORM_IMX_UART 709 select IMX_HAVE_PLATFORM_IMX_UART
715 select IMX_HAVE_PLATFORM_IMX2_WDT
716 select IMX_HAVE_PLATFORM_MXC_EHCI 710 select IMX_HAVE_PLATFORM_MXC_EHCI
717 select IMX_HAVE_PLATFORM_MXC_NAND 711 select IMX_HAVE_PLATFORM_MXC_NAND
718 select IMX_HAVE_PLATFORM_SPI_IMX 712 select IMX_HAVE_PLATFORM_SPI_IMX
713 select SOC_IMX51
719 help 714 help
720 Include support for Eukrea CPUIMX51SD platform. This includes 715 Include support for Eukrea CPUIMX51SD platform. This includes
721 specific configurations for the module and its peripherals. 716 specific configurations for the module and its peripherals.
@@ -737,95 +732,19 @@ config MACH_EUKREA_MBIMXSD51_BASEBOARD
737 732
738endchoice 733endchoice
739 734
740config MX51_EFIKA_COMMON 735comment "Device tree only"
741 bool
742 select SOC_IMX51
743 select IMX_HAVE_PLATFORM_IMX_UART
744 select IMX_HAVE_PLATFORM_MXC_EHCI
745 select IMX_HAVE_PLATFORM_PATA_IMX
746 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
747 select IMX_HAVE_PLATFORM_SPI_IMX
748 select MXC_ULPI if USB_ULPI
749
750config MACH_MX51_EFIKAMX
751 bool "Support MX51 Genesi Efika MX nettop"
752 select LEDS_GPIO_REGISTER
753 select MX51_EFIKA_COMMON
754 help
755 Include support for Genesi Efika MX nettop. This includes specific
756 configurations for the board and its peripherals.
757
758config MACH_MX51_EFIKASB
759 bool "Support MX51 Genesi Efika Smartbook"
760 select LEDS_GPIO_REGISTER
761 select MX51_EFIKA_COMMON
762 help
763 Include support for Genesi Efika Smartbook. This includes specific
764 configurations for the board and its peripherals.
765
766comment "i.MX53 machines:"
767
768config MACH_IMX53_DT
769 bool "Support i.MX53 platforms from device tree"
770 select SOC_IMX53
771 select MACH_MX53_ARD
772 select MACH_MX53_EVK
773 select MACH_MX53_LOCO
774 select MACH_MX53_SMD
775 help
776 Include support for Freescale i.MX53 based platforms
777 using the device tree for discovery
778 736
779config MACH_MX53_EVK 737config SOC_IMX53
780 bool "Support MX53 EVK platforms" 738 bool "i.MX53 support"
781 select SOC_IMX53 739 select ARCH_MX5
782 select IMX_HAVE_PLATFORM_IMX2_WDT 740 select ARCH_MX53
783 select IMX_HAVE_PLATFORM_IMX_UART 741 select HAVE_CAN_FLEXCAN if CAN
784 select IMX_HAVE_PLATFORM_IMX_I2C 742 select PINCTRL
785 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 743 select PINCTRL_IMX53
786 select IMX_HAVE_PLATFORM_SPI_IMX 744 select SOC_IMX5
787 select LEDS_GPIO_REGISTER
788 help
789 Include support for MX53 EVK platform. This includes specific
790 configurations for the board and its peripherals.
791
792config MACH_MX53_SMD
793 bool "Support MX53 SMD platforms"
794 select SOC_IMX53
795 select IMX_HAVE_PLATFORM_IMX2_WDT
796 select IMX_HAVE_PLATFORM_IMX_I2C
797 select IMX_HAVE_PLATFORM_IMX_UART
798 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
799 help
800 Include support for MX53 SMD platform. This includes specific
801 configurations for the board and its peripherals.
802
803config MACH_MX53_LOCO
804 bool "Support MX53 LOCO platforms"
805 select SOC_IMX53
806 select IMX_HAVE_PLATFORM_IMX2_WDT
807 select IMX_HAVE_PLATFORM_IMX_I2C
808 select IMX_HAVE_PLATFORM_IMX_UART
809 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
810 select IMX_HAVE_PLATFORM_GPIO_KEYS
811 select LEDS_GPIO_REGISTER
812 help
813 Include support for MX53 LOCO platform. This includes specific
814 configurations for the board and its peripherals.
815 745
816config MACH_MX53_ARD
817 bool "Support MX53 ARD platforms"
818 select SOC_IMX53
819 select IMX_HAVE_PLATFORM_IMX2_WDT
820 select IMX_HAVE_PLATFORM_IMX_I2C
821 select IMX_HAVE_PLATFORM_IMX_UART
822 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
823 select IMX_HAVE_PLATFORM_GPIO_KEYS
824 help 746 help
825 Include support for MX53 ARD platform. This includes specific 747 This enables support for Freescale i.MX53 processor.
826 configurations for the board and its peripherals.
827
828comment "i.MX6 family:"
829 748
830config SOC_IMX6Q 749config SOC_IMX6Q
831 bool "i.MX6 Quad support" 750 bool "i.MX6 Quad support"
@@ -839,7 +758,7 @@ config SOC_IMX6Q
839 select HAVE_IMX_MMDC 758 select HAVE_IMX_MMDC
840 select HAVE_IMX_SRC 759 select HAVE_IMX_SRC
841 select HAVE_SMP 760 select HAVE_SMP
842 select MFD_ANATOP 761 select MFD_SYSCON
843 select PINCTRL 762 select PINCTRL
844 select PINCTRL_IMX6Q 763 select PINCTRL_IMX6Q
845 764
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index d004d37ad9d..895754aeb4f 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -13,7 +13,7 @@ imx5-pm-$(CONFIG_PM) += pm-imx5.o
13obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clk-imx51-imx53.o ehci-imx5.o $(imx5-pm-y) cpu_op-mx51.o 13obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clk-imx51-imx53.o ehci-imx5.o $(imx5-pm-y) cpu_op-mx51.o
14 14
15obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \ 15obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \
16 clk-pfd.o clk-busy.o 16 clk-pfd.o clk-busy.o clk.o
17 17
18# Support for CMOS sensor interface 18# Support for CMOS sensor interface
19obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o 19obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o
@@ -83,16 +83,9 @@ endif
83# i.MX5 based machines 83# i.MX5 based machines
84obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o 84obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o
85obj-$(CONFIG_MACH_MX51_3DS) += mach-mx51_3ds.o 85obj-$(CONFIG_MACH_MX51_3DS) += mach-mx51_3ds.o
86obj-$(CONFIG_MACH_MX53_EVK) += mach-mx53_evk.o
87obj-$(CONFIG_MACH_MX53_SMD) += mach-mx53_smd.o
88obj-$(CONFIG_MACH_MX53_LOCO) += mach-mx53_loco.o
89obj-$(CONFIG_MACH_MX53_ARD) += mach-mx53_ard.o
90obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += mach-cpuimx51sd.o 86obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += mach-cpuimx51sd.o
91obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd51-baseboard.o 87obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd51-baseboard.o
92obj-$(CONFIG_MX51_EFIKA_COMMON) += mx51_efika.o
93obj-$(CONFIG_MACH_MX51_EFIKAMX) += mach-mx51_efikamx.o
94obj-$(CONFIG_MACH_MX51_EFIKASB) += mach-mx51_efikasb.o
95obj-$(CONFIG_MACH_MX50_RDP) += mach-mx50_rdp.o 88obj-$(CONFIG_MACH_MX50_RDP) += mach-mx50_rdp.o
96 89
97obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o 90obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o
98obj-$(CONFIG_MACH_IMX53_DT) += imx53-dt.o 91obj-$(CONFIG_SOC_IMX53) += mach-imx53.o
diff --git a/arch/arm/mach-imx/Makefile.boot b/arch/arm/mach-imx/Makefile.boot
index 05541cf4a87..b27815de847 100644
--- a/arch/arm/mach-imx/Makefile.boot
+++ b/arch/arm/mach-imx/Makefile.boot
@@ -37,10 +37,3 @@ initrd_phys-$(CONFIG_SOC_IMX53) := 0x70800000
37zreladdr-$(CONFIG_SOC_IMX6Q) += 0x10008000 37zreladdr-$(CONFIG_SOC_IMX6Q) += 0x10008000
38params_phys-$(CONFIG_SOC_IMX6Q) := 0x10000100 38params_phys-$(CONFIG_SOC_IMX6Q) := 0x10000100
39initrd_phys-$(CONFIG_SOC_IMX6Q) := 0x10800000 39initrd_phys-$(CONFIG_SOC_IMX6Q) := 0x10800000
40
41dtb-$(CONFIG_MACH_IMX51_DT) += imx51-babbage.dtb
42dtb-$(CONFIG_MACH_IMX53_DT) += imx53-ard.dtb imx53-evk.dtb \
43 imx53-qsb.dtb imx53-smd.dtb
44dtb-$(CONFIG_SOC_IMX6Q) += imx6q-arm2.dtb \
45 imx6q-sabrelite.dtb \
46 imx6q-sabresd.dtb \
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c
index ea13e61bd5f..cf65148bc51 100644
--- a/arch/arm/mach-imx/clk-imx21.c
+++ b/arch/arm/mach-imx/clk-imx21.c
@@ -23,7 +23,6 @@
23#include <linux/clk-provider.h> 23#include <linux/clk-provider.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/clkdev.h>
27#include <linux/err.h> 26#include <linux/err.h>
28 27
29#include <mach/hardware.h> 28#include <mach/hardware.h>
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index fdd8cc87c9f..d20d4795f4e 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -222,10 +222,8 @@ int __init mx25_clocks_init(void)
222 clk_register_clkdev(clk[lcdc_ipg], "ipg", "imx-fb.0"); 222 clk_register_clkdev(clk[lcdc_ipg], "ipg", "imx-fb.0");
223 clk_register_clkdev(clk[lcdc_ahb], "ahb", "imx-fb.0"); 223 clk_register_clkdev(clk[lcdc_ahb], "ahb", "imx-fb.0");
224 clk_register_clkdev(clk[wdt_ipg], NULL, "imx2-wdt.0"); 224 clk_register_clkdev(clk[wdt_ipg], NULL, "imx2-wdt.0");
225 clk_register_clkdev(clk[ssi1_ipg_per], "per", "imx-ssi.0"); 225 clk_register_clkdev(clk[ssi1_ipg], NULL, "imx-ssi.0");
226 clk_register_clkdev(clk[ssi1_ipg], "ipg", "imx-ssi.0"); 226 clk_register_clkdev(clk[ssi2_ipg], NULL, "imx-ssi.1");
227 clk_register_clkdev(clk[ssi2_ipg_per], "per", "imx-ssi.1");
228 clk_register_clkdev(clk[ssi2_ipg], "ipg", "imx-ssi.1");
229 clk_register_clkdev(clk[esdhc1_ipg_per], "per", "sdhci-esdhc-imx25.0"); 227 clk_register_clkdev(clk[esdhc1_ipg_per], "per", "sdhci-esdhc-imx25.0");
230 clk_register_clkdev(clk[esdhc1_ipg], "ipg", "sdhci-esdhc-imx25.0"); 228 clk_register_clkdev(clk[esdhc1_ipg], "ipg", "sdhci-esdhc-imx25.0");
231 clk_register_clkdev(clk[esdhc1_ahb], "ahb", "sdhci-esdhc-imx25.0"); 229 clk_register_clkdev(clk[esdhc1_ahb], "ahb", "sdhci-esdhc-imx25.0");
@@ -243,6 +241,6 @@ int __init mx25_clocks_init(void)
243 clk_register_clkdev(clk[sdma_ahb], "ahb", "imx35-sdma"); 241 clk_register_clkdev(clk[sdma_ahb], "ahb", "imx35-sdma");
244 clk_register_clkdev(clk[iim_ipg], "iim", NULL); 242 clk_register_clkdev(clk[iim_ipg], "iim", NULL);
245 243
246 mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); 244 mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), MX25_INT_GPT1);
247 return 0; 245 return 0;
248} 246}
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index f69ca468004..3b6b640eed2 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -239,8 +239,8 @@ int __init mx27_clocks_init(unsigned long fref)
239 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0"); 239 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0");
240 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1"); 240 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1");
241 clk_register_clkdev(clk[nfc_baud_gate], NULL, "mxc_nand.0"); 241 clk_register_clkdev(clk[nfc_baud_gate], NULL, "mxc_nand.0");
242 clk_register_clkdev(clk[vpu_baud_gate], "per", "imx-vpu"); 242 clk_register_clkdev(clk[vpu_baud_gate], "per", "coda-imx27.0");
243 clk_register_clkdev(clk[vpu_ahb_gate], "ahb", "imx-vpu"); 243 clk_register_clkdev(clk[vpu_ahb_gate], "ahb", "coda-imx27.0");
244 clk_register_clkdev(clk[dma_ahb_gate], "ahb", "imx-dma"); 244 clk_register_clkdev(clk[dma_ahb_gate], "ahb", "imx-dma");
245 clk_register_clkdev(clk[dma_ipg_gate], "ipg", "imx-dma"); 245 clk_register_clkdev(clk[dma_ipg_gate], "ipg", "imx-dma");
246 clk_register_clkdev(clk[fec_ipg_gate], "ipg", "imx27-fec.0"); 246 clk_register_clkdev(clk[fec_ipg_gate], "ipg", "imx27-fec.0");
diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c
index c6422fb10ba..177259b523c 100644
--- a/arch/arm/mach-imx/clk-imx35.c
+++ b/arch/arm/mach-imx/clk-imx35.c
@@ -62,8 +62,8 @@ enum mx35_clks {
62 kpp_gate, mlb_gate, mshc_gate, owire_gate, pwm_gate, rngc_gate, 62 kpp_gate, mlb_gate, mshc_gate, owire_gate, pwm_gate, rngc_gate,
63 rtc_gate, rtic_gate, scc_gate, sdma_gate, spba_gate, spdif_gate, 63 rtc_gate, rtic_gate, scc_gate, sdma_gate, spba_gate, spdif_gate,
64 ssi1_gate, ssi2_gate, uart1_gate, uart2_gate, uart3_gate, usbotg_gate, 64 ssi1_gate, ssi2_gate, uart1_gate, uart2_gate, uart3_gate, usbotg_gate,
65 wdog_gate, max_gate, admux_gate, csi_gate, iim_gate, gpu2d_gate, 65 wdog_gate, max_gate, admux_gate, csi_gate, csi_div, csi_sel, iim_gate,
66 clk_max 66 gpu2d_gate, clk_max
67}; 67};
68 68
69static struct clk *clk[clk_max]; 69static struct clk *clk[clk_max];
@@ -142,6 +142,9 @@ int __init mx35_clocks_init()
142 142
143 clk[nfc_div] = imx_clk_divider("nfc_div", "ahb", base + MX35_CCM_PDR4, 28, 4); 143 clk[nfc_div] = imx_clk_divider("nfc_div", "ahb", base + MX35_CCM_PDR4, 28, 4);
144 144
145 clk[csi_sel] = imx_clk_mux("csi_sel", base + MX35_CCM_PDR2, 7, 1, std_sel, ARRAY_SIZE(std_sel));
146 clk[csi_div] = imx_clk_divider("csi_div", "csi_sel", base + MX35_CCM_PDR2, 16, 6);
147
145 clk[asrc_gate] = imx_clk_gate2("asrc_gate", "ipg", base + MX35_CCM_CGR0, 0); 148 clk[asrc_gate] = imx_clk_gate2("asrc_gate", "ipg", base + MX35_CCM_CGR0, 0);
146 clk[pata_gate] = imx_clk_gate2("pata_gate", "ipg", base + MX35_CCM_CGR0, 2); 149 clk[pata_gate] = imx_clk_gate2("pata_gate", "ipg", base + MX35_CCM_CGR0, 2);
147 clk[audmux_gate] = imx_clk_gate2("audmux_gate", "ipg", base + MX35_CCM_CGR0, 4); 150 clk[audmux_gate] = imx_clk_gate2("audmux_gate", "ipg", base + MX35_CCM_CGR0, 4);
@@ -192,7 +195,7 @@ int __init mx35_clocks_init()
192 clk[max_gate] = imx_clk_gate2("max_gate", "dummy", base + MX35_CCM_CGR2, 26); 195 clk[max_gate] = imx_clk_gate2("max_gate", "dummy", base + MX35_CCM_CGR2, 26);
193 clk[admux_gate] = imx_clk_gate2("admux_gate", "ipg", base + MX35_CCM_CGR2, 30); 196 clk[admux_gate] = imx_clk_gate2("admux_gate", "ipg", base + MX35_CCM_CGR2, 30);
194 197
195 clk[csi_gate] = imx_clk_gate2("csi_gate", "ipg", base + MX35_CCM_CGR3, 0); 198 clk[csi_gate] = imx_clk_gate2("csi_gate", "csi_div", base + MX35_CCM_CGR3, 0);
196 clk[iim_gate] = imx_clk_gate2("iim_gate", "ipg", base + MX35_CCM_CGR3, 2); 199 clk[iim_gate] = imx_clk_gate2("iim_gate", "ipg", base + MX35_CCM_CGR3, 2);
197 clk[gpu2d_gate] = imx_clk_gate2("gpu2d_gate", "ahb", base + MX35_CCM_CGR3, 4); 200 clk[gpu2d_gate] = imx_clk_gate2("gpu2d_gate", "ahb", base + MX35_CCM_CGR3, 4);
198 201
@@ -228,12 +231,11 @@ int __init mx35_clocks_init()
228 clk_register_clkdev(clk[i2c3_gate], NULL, "imx-i2c.2"); 231 clk_register_clkdev(clk[i2c3_gate], NULL, "imx-i2c.2");
229 clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core"); 232 clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core");
230 clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb"); 233 clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb");
234 clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad");
231 clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1"); 235 clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1");
232 clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma"); 236 clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma");
233 clk_register_clkdev(clk[ipg], "ipg", "imx-ssi.0"); 237 clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0");
234 clk_register_clkdev(clk[ssi1_div_post], "per", "imx-ssi.0"); 238 clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1");
235 clk_register_clkdev(clk[ipg], "ipg", "imx-ssi.1");
236 clk_register_clkdev(clk[ssi2_div_post], "per", "imx-ssi.1");
237 /* i.mx35 has the i.mx21 type uart */ 239 /* i.mx35 has the i.mx21 type uart */
238 clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0"); 240 clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0");
239 clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0"); 241 clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0");
@@ -255,6 +257,7 @@ int __init mx35_clocks_init()
255 clk_register_clkdev(clk[usbotg_gate], "ahb", "fsl-usb2-udc"); 257 clk_register_clkdev(clk[usbotg_gate], "ahb", "fsl-usb2-udc");
256 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0"); 258 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
257 clk_register_clkdev(clk[nfc_div], NULL, "mxc_nand.0"); 259 clk_register_clkdev(clk[nfc_div], NULL, "mxc_nand.0");
260 clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
258 261
259 clk_prepare_enable(clk[spba_gate]); 262 clk_prepare_enable(clk[spba_gate]);
260 clk_prepare_enable(clk[gpio1_gate]); 263 clk_prepare_enable(clk[gpio1_gate]);
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index 4bdcaa97bd9..a0bf84803ea 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -39,16 +39,17 @@ static const char *ssi_ext2_com_sels[] = { "ssi_ext2_podf", "ssi2_root_gate", };
39static const char *emi_slow_sel[] = { "main_bus", "ahb", }; 39static const char *emi_slow_sel[] = { "main_bus", "ahb", };
40static const char *usb_phy_sel_str[] = { "osc", "usb_phy_podf", }; 40static const char *usb_phy_sel_str[] = { "osc", "usb_phy_podf", };
41static const char *mx51_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "tve_di", }; 41static const char *mx51_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "tve_di", };
42static const char *mx53_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "di_pll4_podf", "dummy", "ldb_di0", }; 42static const char *mx53_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "di_pll4_podf", "dummy", "ldb_di0_gate", };
43static const char *mx53_ldb_di0_sel[] = { "pll3_sw", "pll4_sw", }; 43static const char *mx53_ldb_di0_sel[] = { "pll3_sw", "pll4_sw", };
44static const char *mx51_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "ipp_di1", }; 44static const char *mx51_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "ipp_di1", };
45static const char *mx53_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "ipp_di1", "ldb_di1", }; 45static const char *mx53_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "ipp_di1", "ldb_di1_gate", };
46static const char *mx53_ldb_di1_sel[] = { "pll3_sw", "pll4_sw", }; 46static const char *mx53_ldb_di1_sel[] = { "pll3_sw", "pll4_sw", };
47static const char *mx51_tve_ext_sel[] = { "osc", "ckih1", }; 47static const char *mx51_tve_ext_sel[] = { "osc", "ckih1", };
48static const char *mx53_tve_ext_sel[] = { "pll4_sw", "ckih1", }; 48static const char *mx53_tve_ext_sel[] = { "pll4_sw", "ckih1", };
49static const char *tve_sel[] = { "tve_pred", "tve_ext_sel", }; 49static const char *tve_sel[] = { "tve_pred", "tve_ext_sel", };
50static const char *ipu_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb", }; 50static const char *ipu_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb", };
51static const char *vpu_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb", }; 51static const char *vpu_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb", };
52static const char *mx53_can_sel[] = { "ipg", "ckih1", "ckih2", "lp_apm", };
52 53
53enum imx5_clks { 54enum imx5_clks {
54 dummy, ckil, osc, ckih1, ckih2, ahb, ipg, axi_a, axi_b, uart_pred, 55 dummy, ckil, osc, ckih1, ckih2, ahb, ipg, axi_a, axi_b, uart_pred,
@@ -82,6 +83,7 @@ enum imx5_clks {
82 ssi_ext1_podf, ssi_ext2_pred, ssi_ext2_podf, ssi1_root_gate, 83 ssi_ext1_podf, ssi_ext2_pred, ssi_ext2_podf, ssi1_root_gate,
83 ssi2_root_gate, ssi3_root_gate, ssi_ext1_gate, ssi_ext2_gate, 84 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, 85 epit1_ipg_gate, epit1_hf_gate, epit2_ipg_gate, epit2_hf_gate,
86 can_sel, can1_serial_gate, can1_ipg_gate,
85 clk_max 87 clk_max
86}; 88};
87 89
@@ -367,6 +369,7 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
367 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "83fcc000.ssi"); 369 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "83fcc000.ssi");
368 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "70014000.ssi"); 370 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "70014000.ssi");
369 clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "83fe8000.ssi"); 371 clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "83fe8000.ssi");
372 clk_register_clkdev(clk[nfc_gate], NULL, "83fdb000.nand");
370 373
371 /* set the usboh3 parent to pll2_sw */ 374 /* set the usboh3 parent to pll2_sw */
372 clk_set_parent(clk[usboh3_sel], clk[pll2_sw]); 375 clk_set_parent(clk[usboh3_sel], clk[pll2_sw]);
@@ -421,8 +424,12 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
421 clk[esdhc4_per_gate] = imx_clk_gate2("esdhc4_per_gate", "esdhc_d_sel", MXC_CCM_CCGR3, 14); 424 clk[esdhc4_per_gate] = imx_clk_gate2("esdhc4_per_gate", "esdhc_d_sel", MXC_CCM_CCGR3, 14);
422 clk[usb_phy1_gate] = imx_clk_gate2("usb_phy1_gate", "usb_phy_sel", MXC_CCM_CCGR4, 10); 425 clk[usb_phy1_gate] = imx_clk_gate2("usb_phy1_gate", "usb_phy_sel", MXC_CCM_CCGR4, 10);
423 clk[usb_phy2_gate] = imx_clk_gate2("usb_phy2_gate", "usb_phy_sel", MXC_CCM_CCGR4, 12); 426 clk[usb_phy2_gate] = imx_clk_gate2("usb_phy2_gate", "usb_phy_sel", MXC_CCM_CCGR4, 12);
424 clk[can2_serial_gate] = imx_clk_gate2("can2_serial_gate", "ipg", MXC_CCM_CCGR4, 6); 427 clk[can_sel] = imx_clk_mux("can_sel", MXC_CCM_CSCMR2, 6, 2,
425 clk[can2_ipg_gate] = imx_clk_gate2("can2_ipg_gate", "ipg", MXC_CCM_CCGR4, 8); 428 mx53_can_sel, ARRAY_SIZE(mx53_can_sel));
429 clk[can1_serial_gate] = imx_clk_gate2("can1_serial_gate", "can_sel", MXC_CCM_CCGR6, 22);
430 clk[can1_ipg_gate] = imx_clk_gate2("can1_ipg_gate", "ipg", MXC_CCM_CCGR6, 20);
431 clk[can2_serial_gate] = imx_clk_gate2("can2_serial_gate", "can_sel", MXC_CCM_CCGR4, 8);
432 clk[can2_ipg_gate] = imx_clk_gate2("can2_ipg_gate", "ipg", MXC_CCM_CCGR4, 6);
426 clk[i2c3_gate] = imx_clk_gate2("i2c3_gate", "per_root", MXC_CCM_CCGR1, 22); 433 clk[i2c3_gate] = imx_clk_gate2("i2c3_gate", "per_root", MXC_CCM_CCGR1, 22);
427 434
428 for (i = 0; i < ARRAY_SIZE(clk); i++) 435 for (i = 0; i < ARRAY_SIZE(clk); i++)
@@ -455,6 +462,11 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
455 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "63fcc000.ssi"); 462 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "63fcc000.ssi");
456 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "50014000.ssi"); 463 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "50014000.ssi");
457 clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "63fd0000.ssi"); 464 clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "63fd0000.ssi");
465 clk_register_clkdev(clk[nfc_gate], NULL, "63fdb000.nand");
466 clk_register_clkdev(clk[can1_ipg_gate], "ipg", "53fc8000.can");
467 clk_register_clkdev(clk[can1_serial_gate], "per", "53fc8000.can");
468 clk_register_clkdev(clk[can2_ipg_gate], "ipg", "53fcc000.can");
469 clk_register_clkdev(clk[can2_serial_gate], "per", "53fcc000.can");
458 470
459 /* set SDHC root clock to 200MHZ*/ 471 /* set SDHC root clock to 200MHZ*/
460 clk_set_rate(clk[esdhc_a_podf], 200000000); 472 clk_set_rate(clk[esdhc_a_podf], 200000000);
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 4233d9e3531..3ec242f3341 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -157,6 +157,7 @@ enum mx6q_clks {
157}; 157};
158 158
159static struct clk *clk[clk_max]; 159static struct clk *clk[clk_max];
160static struct clk_onecell_data clk_data;
160 161
161static enum mx6q_clks const clks_init_on[] __initconst = { 162static enum mx6q_clks const clks_init_on[] __initconst = {
162 mmdc_ch0_axi, rom, 163 mmdc_ch0_axi, rom,
@@ -394,52 +395,24 @@ int __init mx6q_clocks_init(void)
394 pr_err("i.MX6q clk %d: register failed with %ld\n", 395 pr_err("i.MX6q clk %d: register failed with %ld\n",
395 i, PTR_ERR(clk[i])); 396 i, PTR_ERR(clk[i]));
396 397
398 clk_data.clks = clk;
399 clk_data.clk_num = ARRAY_SIZE(clk);
400 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
401
397 clk_register_clkdev(clk[gpt_ipg], "ipg", "imx-gpt.0"); 402 clk_register_clkdev(clk[gpt_ipg], "ipg", "imx-gpt.0");
398 clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0"); 403 clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0");
399 clk_register_clkdev(clk[twd], NULL, "smp_twd"); 404 clk_register_clkdev(clk[twd], NULL, "smp_twd");
400 clk_register_clkdev(clk[apbh_dma], NULL, "110000.dma-apbh");
401 clk_register_clkdev(clk[per1_bch], "per1_bch", "112000.gpmi-nand");
402 clk_register_clkdev(clk[gpmi_bch_apb], "gpmi_bch_apb", "112000.gpmi-nand");
403 clk_register_clkdev(clk[gpmi_bch], "gpmi_bch", "112000.gpmi-nand");
404 clk_register_clkdev(clk[gpmi_apb], "gpmi_apb", "112000.gpmi-nand");
405 clk_register_clkdev(clk[gpmi_io], "gpmi_io", "112000.gpmi-nand");
406 clk_register_clkdev(clk[usboh3], NULL, "2184000.usb");
407 clk_register_clkdev(clk[usboh3], NULL, "2184200.usb");
408 clk_register_clkdev(clk[usboh3], NULL, "2184400.usb");
409 clk_register_clkdev(clk[usboh3], NULL, "2184600.usb");
410 clk_register_clkdev(clk[usbphy1], NULL, "20c9000.usbphy");
411 clk_register_clkdev(clk[usbphy2], NULL, "20ca000.usbphy");
412 clk_register_clkdev(clk[uart_serial], "per", "2020000.serial");
413 clk_register_clkdev(clk[uart_ipg], "ipg", "2020000.serial");
414 clk_register_clkdev(clk[uart_serial], "per", "21e8000.serial");
415 clk_register_clkdev(clk[uart_ipg], "ipg", "21e8000.serial");
416 clk_register_clkdev(clk[uart_serial], "per", "21ec000.serial");
417 clk_register_clkdev(clk[uart_ipg], "ipg", "21ec000.serial");
418 clk_register_clkdev(clk[uart_serial], "per", "21f0000.serial");
419 clk_register_clkdev(clk[uart_ipg], "ipg", "21f0000.serial");
420 clk_register_clkdev(clk[uart_serial], "per", "21f4000.serial");
421 clk_register_clkdev(clk[uart_ipg], "ipg", "21f4000.serial");
422 clk_register_clkdev(clk[enet], NULL, "2188000.ethernet");
423 clk_register_clkdev(clk[usdhc1], NULL, "2190000.usdhc");
424 clk_register_clkdev(clk[usdhc2], NULL, "2194000.usdhc");
425 clk_register_clkdev(clk[usdhc3], NULL, "2198000.usdhc");
426 clk_register_clkdev(clk[usdhc4], NULL, "219c000.usdhc");
427 clk_register_clkdev(clk[i2c1], NULL, "21a0000.i2c");
428 clk_register_clkdev(clk[i2c2], NULL, "21a4000.i2c");
429 clk_register_clkdev(clk[i2c3], NULL, "21a8000.i2c");
430 clk_register_clkdev(clk[ecspi1], NULL, "2008000.ecspi");
431 clk_register_clkdev(clk[ecspi2], NULL, "200c000.ecspi");
432 clk_register_clkdev(clk[ecspi3], NULL, "2010000.ecspi");
433 clk_register_clkdev(clk[ecspi4], NULL, "2014000.ecspi");
434 clk_register_clkdev(clk[ecspi5], NULL, "2018000.ecspi");
435 clk_register_clkdev(clk[sdma], NULL, "20ec000.sdma");
436 clk_register_clkdev(clk[dummy], NULL, "20bc000.wdog");
437 clk_register_clkdev(clk[dummy], NULL, "20c0000.wdog");
438 clk_register_clkdev(clk[ssi1_ipg], NULL, "2028000.ssi");
439 clk_register_clkdev(clk[cko1_sel], "cko1_sel", NULL); 405 clk_register_clkdev(clk[cko1_sel], "cko1_sel", NULL);
440 clk_register_clkdev(clk[ahb], "ahb", NULL); 406 clk_register_clkdev(clk[ahb], "ahb", NULL);
441 clk_register_clkdev(clk[cko1], "cko1", NULL); 407 clk_register_clkdev(clk[cko1], "cko1", NULL);
442 408
409 /*
410 * The gpmi needs 100MHz frequency in the EDO/Sync mode,
411 * We can not get the 100MHz from the pll2_pfd0_352m.
412 * So choose pll2_pfd2_396m as enfc_sel's parent.
413 */
414 clk_set_parent(clk[enfc_sel], clk[pll2_pfd2_396m]);
415
443 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) 416 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
444 clk_prepare_enable(clk[clks_init_on[i]]); 417 clk_prepare_enable(clk[clks_init_on[i]]);
445 418
diff --git a/arch/arm/mach-imx/clk-pllv1.c b/arch/arm/mach-imx/clk-pllv1.c
index 2d856f9ccf5..02be7317891 100644
--- a/arch/arm/mach-imx/clk-pllv1.c
+++ b/arch/arm/mach-imx/clk-pllv1.c
@@ -6,7 +6,7 @@
6#include <linux/err.h> 6#include <linux/err.h>
7#include <mach/common.h> 7#include <mach/common.h>
8#include <mach/hardware.h> 8#include <mach/hardware.h>
9#include <mach/clock.h> 9
10#include "clk.h" 10#include "clk.h"
11 11
12/** 12/**
@@ -29,8 +29,53 @@ static unsigned long clk_pllv1_recalc_rate(struct clk_hw *hw,
29 unsigned long parent_rate) 29 unsigned long parent_rate)
30{ 30{
31 struct clk_pllv1 *pll = to_clk_pllv1(hw); 31 struct clk_pllv1 *pll = to_clk_pllv1(hw);
32 long long ll;
33 int mfn_abs;
34 unsigned int mfi, mfn, mfd, pd;
35 u32 reg;
36 unsigned long rate;
37
38 reg = readl(pll->base);
39
40 /*
41 * Get the resulting clock rate from a PLL register value and the input
42 * frequency. PLLs with this register layout can be found on i.MX1,
43 * i.MX21, i.MX27 and i,MX31
44 *
45 * mfi + mfn / (mfd + 1)
46 * f = 2 * f_ref * --------------------
47 * pd + 1
48 */
49
50 mfi = (reg >> 10) & 0xf;
51 mfn = reg & 0x3ff;
52 mfd = (reg >> 16) & 0x3ff;
53 pd = (reg >> 26) & 0xf;
54
55 mfi = mfi <= 5 ? 5 : mfi;
56
57 mfn_abs = mfn;
58
59 /*
60 * On all i.MXs except i.MX1 and i.MX21 mfn is a 10bit
61 * 2's complements number
62 */
63 if (!cpu_is_mx1() && !cpu_is_mx21() && mfn >= 0x200)
64 mfn_abs = 0x400 - mfn;
65
66 rate = parent_rate * 2;
67 rate /= pd + 1;
68
69 ll = (unsigned long long)rate * mfn_abs;
70
71 do_div(ll, mfd + 1);
72
73 if (!cpu_is_mx1() && !cpu_is_mx21() && mfn >= 0x200)
74 ll = -ll;
75
76 ll = (rate * mfi) + ll;
32 77
33 return mxc_decode_pll(readl(pll->base), parent_rate); 78 return ll;
34} 79}
35 80
36struct clk_ops clk_pllv1_ops = { 81struct clk_ops clk_pllv1_ops = {
diff --git a/arch/arm/mach-imx/clk.c b/arch/arm/mach-imx/clk.c
new file mode 100644
index 00000000000..f5e8be8e7f1
--- /dev/null
+++ b/arch/arm/mach-imx/clk.c
@@ -0,0 +1,3 @@
1#include <linux/spinlock.h>
2
3DEFINE_SPINLOCK(imx_ccm_lock);
diff --git a/arch/arm/mach-imx/clk.h b/arch/arm/mach-imx/clk.h
index 1bf64fe2523..5f2d8acca25 100644
--- a/arch/arm/mach-imx/clk.h
+++ b/arch/arm/mach-imx/clk.h
@@ -3,7 +3,8 @@
3 3
4#include <linux/spinlock.h> 4#include <linux/spinlock.h>
5#include <linux/clk-provider.h> 5#include <linux/clk-provider.h>
6#include <mach/clock.h> 6
7extern spinlock_t imx_ccm_lock;
7 8
8struct clk *imx_clk_pllv1(const char *name, const char *parent, 9struct clk *imx_clk_pllv1(const char *name, const char *parent,
9 void __iomem *base); 10 void __iomem *base);
diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h
index 436c5720fe6..04822932cdd 100644
--- a/arch/arm/mach-imx/devices-imx27.h
+++ b/arch/arm/mach-imx/devices-imx27.h
@@ -17,6 +17,10 @@ extern const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data;
17#define imx27_add_fsl_usb2_udc(pdata) \ 17#define imx27_add_fsl_usb2_udc(pdata) \
18 imx_add_fsl_usb2_udc(&imx27_fsl_usb2_udc_data, pdata) 18 imx_add_fsl_usb2_udc(&imx27_fsl_usb2_udc_data, pdata)
19 19
20extern const struct imx_imx27_coda_data imx27_coda_data;
21#define imx27_add_coda() \
22 imx_add_imx27_coda(&imx27_coda_data)
23
20extern const struct imx_imx2_wdt_data imx27_imx2_wdt_data; 24extern const struct imx_imx2_wdt_data imx27_imx2_wdt_data;
21#define imx27_add_imx2_wdt() \ 25#define imx27_add_imx2_wdt() \
22 imx_add_imx2_wdt(&imx27_imx2_wdt_data) 26 imx_add_imx2_wdt(&imx27_imx2_wdt_data)
diff --git a/arch/arm/mach-imx/devices-imx53.h b/arch/arm/mach-imx/devices-imx53.h
deleted file mode 100644
index 77e0db96c44..00000000000
--- a/arch/arm/mach-imx/devices-imx53.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * Copyright (C) 2010 Yong Shen. <Yong.Shen@linaro.org>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8#include <mach/mx53.h>
9#include <mach/devices-common.h>
10
11extern const struct imx_fec_data imx53_fec_data;
12#define imx53_add_fec(pdata) \
13 imx_add_fec(&imx53_fec_data, pdata)
14
15extern const struct imx_imx_uart_1irq_data imx53_imx_uart_data[];
16#define imx53_add_imx_uart(id, pdata) \
17 imx_add_imx_uart_1irq(&imx53_imx_uart_data[id], pdata)
18
19
20extern const struct imx_imx_i2c_data imx53_imx_i2c_data[];
21#define imx53_add_imx_i2c(id, pdata) \
22 imx_add_imx_i2c(&imx53_imx_i2c_data[id], pdata)
23
24extern const struct imx_sdhci_esdhc_imx_data imx53_sdhci_esdhc_imx_data[];
25#define imx53_add_sdhci_esdhc_imx(id, pdata) \
26 imx_add_sdhci_esdhc_imx(&imx53_sdhci_esdhc_imx_data[id], pdata)
27
28extern const struct imx_spi_imx_data imx53_ecspi_data[];
29#define imx53_add_ecspi(id, pdata) \
30 imx_add_spi_imx(&imx53_ecspi_data[id], pdata)
31
32extern const struct imx_imx2_wdt_data imx53_imx2_wdt_data[];
33#define imx53_add_imx2_wdt(id) \
34 imx_add_imx2_wdt(&imx53_imx2_wdt_data[id])
35
36extern const struct imx_imx_ssi_data imx53_imx_ssi_data[];
37#define imx53_add_imx_ssi(id, pdata) \
38 imx_add_imx_ssi(&imx53_imx_ssi_data[id], pdata)
39
40extern const struct imx_imx_keypad_data imx53_imx_keypad_data;
41#define imx53_add_imx_keypad(pdata) \
42 imx_add_imx_keypad(&imx53_imx_keypad_data, pdata)
43
44extern const struct imx_pata_imx_data imx53_pata_imx_data;
45#define imx53_add_pata_imx() \
46 imx_add_pata_imx(&imx53_pata_imx_data)
47
48extern struct platform_device *__init imx53_add_ahci_imx(void);
diff --git a/arch/arm/mach-imx/efika.h b/arch/arm/mach-imx/efika.h
deleted file mode 100644
index 014aa985faa..00000000000
--- a/arch/arm/mach-imx/efika.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef _EFIKA_H
2#define _EFIKA_H
3
4#define EFIKA_WLAN_EN IMX_GPIO_NR(2, 16)
5#define EFIKA_WLAN_RESET IMX_GPIO_NR(2, 10)
6#define EFIKA_USB_PHY_RESET IMX_GPIO_NR(2, 9)
7
8void __init efika_board_common_init(void);
9
10#endif
diff --git a/arch/arm/mach-imx/ehci-imx25.c b/arch/arm/mach-imx/ehci-imx25.c
index 05bb41d9972..412c583a24b 100644
--- a/arch/arm/mach-imx/ehci-imx25.c
+++ b/arch/arm/mach-imx/ehci-imx25.c
@@ -17,7 +17,7 @@
17#include <linux/io.h> 17#include <linux/io.h>
18 18
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h> 20#include <linux/platform_data/usb-ehci-mxc.h>
21 21
22#define USBCTRL_OTGBASE_OFFSET 0x600 22#define USBCTRL_OTGBASE_OFFSET 0x600
23 23
diff --git a/arch/arm/mach-imx/ehci-imx27.c b/arch/arm/mach-imx/ehci-imx27.c
index fa69419eabd..cd6e1f81508 100644
--- a/arch/arm/mach-imx/ehci-imx27.c
+++ b/arch/arm/mach-imx/ehci-imx27.c
@@ -17,7 +17,7 @@
17#include <linux/io.h> 17#include <linux/io.h>
18 18
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h> 20#include <linux/platform_data/usb-ehci-mxc.h>
21 21
22#define USBCTRL_OTGBASE_OFFSET 0x600 22#define USBCTRL_OTGBASE_OFFSET 0x600
23 23
diff --git a/arch/arm/mach-imx/ehci-imx31.c b/arch/arm/mach-imx/ehci-imx31.c
index faad0f15ac7..9a880c78af3 100644
--- a/arch/arm/mach-imx/ehci-imx31.c
+++ b/arch/arm/mach-imx/ehci-imx31.c
@@ -17,7 +17,7 @@
17#include <linux/io.h> 17#include <linux/io.h>
18 18
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h> 20#include <linux/platform_data/usb-ehci-mxc.h>
21 21
22#define USBCTRL_OTGBASE_OFFSET 0x600 22#define USBCTRL_OTGBASE_OFFSET 0x600
23 23
diff --git a/arch/arm/mach-imx/ehci-imx35.c b/arch/arm/mach-imx/ehci-imx35.c
index 73574c30cf5..779e16eb65c 100644
--- a/arch/arm/mach-imx/ehci-imx35.c
+++ b/arch/arm/mach-imx/ehci-imx35.c
@@ -17,7 +17,7 @@
17#include <linux/io.h> 17#include <linux/io.h>
18 18
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h> 20#include <linux/platform_data/usb-ehci-mxc.h>
21 21
22#define USBCTRL_OTGBASE_OFFSET 0x600 22#define USBCTRL_OTGBASE_OFFSET 0x600
23 23
diff --git a/arch/arm/mach-imx/ehci-imx5.c b/arch/arm/mach-imx/ehci-imx5.c
index a6a4afb0ad6..cf8d00e5cce 100644
--- a/arch/arm/mach-imx/ehci-imx5.c
+++ b/arch/arm/mach-imx/ehci-imx5.c
@@ -17,7 +17,7 @@
17#include <linux/io.h> 17#include <linux/io.h>
18 18
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h> 20#include <linux/platform_data/usb-ehci-mxc.h>
21 21
22#define MXC_OTG_OFFSET 0 22#define MXC_OTG_OFFSET 0
23#define MXC_H1_OFFSET 0x200 23#define MXC_H1_OFFSET 0x200
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
index fd3177f9e79..98aef571b9f 100644
--- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
@@ -348,4 +348,5 @@ void __init eukrea_mbimx27_baseboard_init(void)
348 imx27_add_imx_keypad(&eukrea_mbimx27_keymap_data); 348 imx27_add_imx_keypad(&eukrea_mbimx27_keymap_data);
349 349
350 gpio_led_register_device(-1, &eukrea_mbimx27_gpio_led_info); 350 gpio_led_register_device(-1, &eukrea_mbimx27_gpio_led_info);
351 imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0);
351} 352}
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
index dfd2da87c2d..0b84666792f 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
@@ -306,4 +306,5 @@ void __init eukrea_mbimxsd25_baseboard_init(void)
306 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 306 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
307 gpio_led_register_device(-1, &eukrea_mbimxsd_led_info); 307 gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
308 imx_add_gpio_keys(&eukrea_mbimxsd_button_data); 308 imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
309 imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0);
309} 310}
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
index 6e9dd12a696..c6532a007d4 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
@@ -315,4 +315,5 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
315 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 315 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
316 gpio_led_register_device(-1, &eukrea_mbimxsd_led_info); 316 gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
317 imx_add_gpio_keys(&eukrea_mbimxsd_button_data); 317 imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
318 imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0);
318} 319}
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
index 96a24b73dc2..8b0de30d7a3 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
@@ -228,4 +228,5 @@ void __init eukrea_mbimxsd51_baseboard_init(void)
228 228
229 gpio_led_register_device(-1, &eukrea_mbimxsd51_led_info); 229 gpio_led_register_device(-1, &eukrea_mbimxsd51_led_info);
230 imx_add_gpio_keys(&eukrea_mbimxsd51_button_data); 230 imx_add_gpio_keys(&eukrea_mbimxsd51_button_data);
231 imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0);
231} 232}
diff --git a/arch/arm/mach-imx/hotplug.c b/arch/arm/mach-imx/hotplug.c
index f8f7437c83b..b07b778dc9a 100644
--- a/arch/arm/mach-imx/hotplug.c
+++ b/arch/arm/mach-imx/hotplug.c
@@ -15,11 +15,6 @@
15#include <asm/cp15.h> 15#include <asm/cp15.h>
16#include <mach/common.h> 16#include <mach/common.h>
17 17
18int platform_cpu_kill(unsigned int cpu)
19{
20 return 1;
21}
22
23static inline void cpu_enter_lowpower(void) 18static inline void cpu_enter_lowpower(void)
24{ 19{
25 unsigned int v; 20 unsigned int v;
@@ -47,7 +42,7 @@ static inline void cpu_enter_lowpower(void)
47 * 42 *
48 * Called with IRQs disabled 43 * Called with IRQs disabled
49 */ 44 */
50void platform_cpu_die(unsigned int cpu) 45void imx_cpu_die(unsigned int cpu)
51{ 46{
52 cpu_enter_lowpower(); 47 cpu_enter_lowpower();
53 imx_enable_cpu(cpu, false); 48 imx_enable_cpu(cpu, false);
@@ -56,12 +51,3 @@ void platform_cpu_die(unsigned int cpu)
56 while (1) 51 while (1)
57 ; 52 ;
58} 53}
59
60int platform_cpu_disable(unsigned int cpu)
61{
62 /*
63 * we don't allow CPU 0 to be shutdown (it is still too special
64 * e.g. clock tick interrupts)
65 */
66 return cpu == 0 ? -EPERM : 0;
67}
diff --git a/arch/arm/mach-imx/imx51-dt.c b/arch/arm/mach-imx/imx51-dt.c
index d4067fe3635..f233b4bb234 100644
--- a/arch/arm/mach-imx/imx51-dt.c
+++ b/arch/arm/mach-imx/imx51-dt.c
@@ -13,7 +13,6 @@
13#include <linux/irq.h> 13#include <linux/irq.h>
14#include <linux/of_irq.h> 14#include <linux/of_irq.h>
15#include <linux/of_platform.h> 15#include <linux/of_platform.h>
16#include <linux/pinctrl/machine.h>
17#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
18#include <asm/mach/time.h> 17#include <asm/mach/time.h>
19#include <mach/common.h> 18#include <mach/common.h>
@@ -44,27 +43,8 @@ static const struct of_dev_auxdata imx51_auxdata_lookup[] __initconst = {
44 { /* sentinel */ } 43 { /* sentinel */ }
45}; 44};
46 45
47static const struct of_device_id imx51_iomuxc_of_match[] __initconst = {
48 { .compatible = "fsl,imx51-iomuxc-babbage", .data = imx51_babbage_common_init, },
49 { /* sentinel */ }
50};
51
52static void __init imx51_dt_init(void) 46static void __init imx51_dt_init(void)
53{ 47{
54 struct device_node *node;
55 const struct of_device_id *of_id;
56 void (*func)(void);
57
58 pinctrl_provide_dummies();
59
60 node = of_find_matching_node(NULL, imx51_iomuxc_of_match);
61 if (node) {
62 of_id = of_match_node(imx51_iomuxc_of_match, node);
63 func = of_id->data;
64 func();
65 of_node_put(node);
66 }
67
68 of_platform_populate(NULL, of_default_bus_match_table, 48 of_platform_populate(NULL, of_default_bus_match_table,
69 imx51_auxdata_lookup, NULL); 49 imx51_auxdata_lookup, NULL);
70} 50}
@@ -79,7 +59,6 @@ static struct sys_timer imx51_timer = {
79}; 59};
80 60
81static const char *imx51_dt_board_compat[] __initdata = { 61static const char *imx51_dt_board_compat[] __initdata = {
82 "fsl,imx51-babbage",
83 "fsl,imx51", 62 "fsl,imx51",
84 NULL 63 NULL
85}; 64};
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index 2c6ab3273f9..5985ed1b8c9 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
@@ -526,7 +526,8 @@ static void __init armadillo5x0_init(void)
526 imx31_add_mxc_nand(&armadillo5x0_nand_board_info); 526 imx31_add_mxc_nand(&armadillo5x0_nand_board_info);
527 527
528 /* set NAND page size to 2k if not configured via boot mode pins */ 528 /* set NAND page size to 2k if not configured via boot mode pins */
529 __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); 529 __raw_writel(__raw_readl(mx3_ccm_base + MXC_CCM_RCSR) |
530 (1 << 30), mx3_ccm_base + MXC_CCM_RCSR);
530 531
531 /* RTC */ 532 /* RTC */
532 /* Get RTC IRQ and register the chip */ 533 /* Get RTC IRQ and register the chip */
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index f264ddddd47..141756f00ae 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -32,13 +32,14 @@
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/dma-mapping.h> 33#include <linux/dma-mapping.h>
34#include <linux/leds.h> 34#include <linux/leds.h>
35#include <linux/memblock.h> 35#include <linux/platform_data/asoc-mx27vis.h>
36#include <media/soc_camera.h> 36#include <media/soc_camera.h>
37#include <sound/tlv320aic32x4.h> 37#include <sound/tlv320aic32x4.h>
38#include <asm/mach-types.h> 38#include <asm/mach-types.h>
39#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
40#include <asm/mach/time.h> 40#include <asm/mach/time.h>
41#include <asm/system_info.h> 41#include <asm/system_info.h>
42#include <asm/memblock.h>
42#include <mach/common.h> 43#include <mach/common.h>
43#include <mach/hardware.h> 44#include <mach/hardware.h>
44#include <mach/iomux-mx27.h> 45#include <mach/iomux-mx27.h>
@@ -58,6 +59,11 @@
58#define EXPBOARD_BIT1 (GPIO_PORTD + 27) 59#define EXPBOARD_BIT1 (GPIO_PORTD + 27)
59#define EXPBOARD_BIT0 (GPIO_PORTD + 28) 60#define EXPBOARD_BIT0 (GPIO_PORTD + 28)
60 61
62#define AMP_GAIN_0 (GPIO_PORTF + 9)
63#define AMP_GAIN_1 (GPIO_PORTF + 8)
64#define AMP_MUTE_SDL (GPIO_PORTE + 5)
65#define AMP_MUTE_SDR (GPIO_PORTF + 7)
66
61static const int visstrim_m10_pins[] __initconst = { 67static const int visstrim_m10_pins[] __initconst = {
62 /* UART1 (console) */ 68 /* UART1 (console) */
63 PE12_PF_UART1_TXD, 69 PE12_PF_UART1_TXD,
@@ -139,6 +145,11 @@ static const int visstrim_m10_pins[] __initconst = {
139 EXPBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 145 EXPBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
140 EXPBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 146 EXPBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
141 EXPBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, 147 EXPBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
148 /* Audio AMP control */
149 AMP_GAIN_0 | GPIO_GPIO | GPIO_OUT,
150 AMP_GAIN_1 | GPIO_GPIO | GPIO_OUT,
151 AMP_MUTE_SDL | GPIO_GPIO | GPIO_OUT,
152 AMP_MUTE_SDR | GPIO_GPIO | GPIO_OUT,
142}; 153};
143 154
144static struct gpio visstrim_m10_version_gpios[] = { 155static struct gpio visstrim_m10_version_gpios[] = {
@@ -166,6 +177,26 @@ static const struct gpio visstrim_m10_gpios[] __initconst = {
166 .flags = GPIOF_DIR_OUT | GPIOF_INIT_LOW, 177 .flags = GPIOF_DIR_OUT | GPIOF_INIT_LOW,
167 .label = "usbotg_cs", 178 .label = "usbotg_cs",
168 }, 179 },
180 {
181 .gpio = AMP_GAIN_0,
182 .flags = GPIOF_DIR_OUT,
183 .label = "amp-gain-0",
184 },
185 {
186 .gpio = AMP_GAIN_1,
187 .flags = GPIOF_DIR_OUT,
188 .label = "amp-gain-1",
189 },
190 {
191 .gpio = AMP_MUTE_SDL,
192 .flags = GPIOF_DIR_OUT,
193 .label = "amp-mute-sdl",
194 },
195 {
196 .gpio = AMP_MUTE_SDR,
197 .flags = GPIOF_DIR_OUT,
198 .label = "amp-mute-sdr",
199 },
169}; 200};
170 201
171/* Camera */ 202/* Camera */
@@ -233,10 +264,8 @@ static void __init visstrim_camera_init(void)
233static void __init visstrim_reserve(void) 264static void __init visstrim_reserve(void)
234{ 265{
235 /* reserve 4 MiB for mx2-camera */ 266 /* reserve 4 MiB for mx2-camera */
236 mx2_camera_base = memblock_alloc(MX2_CAMERA_BUF_SIZE, 267 mx2_camera_base = arm_memblock_steal(3 * MX2_CAMERA_BUF_SIZE,
237 MX2_CAMERA_BUF_SIZE); 268 MX2_CAMERA_BUF_SIZE);
238 memblock_free(mx2_camera_base, MX2_CAMERA_BUF_SIZE);
239 memblock_remove(mx2_camera_base, MX2_CAMERA_BUF_SIZE);
240} 269}
241 270
242/* GPIOs used as events for applications */ 271/* GPIOs used as events for applications */
@@ -405,6 +434,55 @@ static const struct imx_ssi_platform_data visstrim_m10_ssi_pdata __initconst = {
405 .flags = IMX_SSI_DMA | IMX_SSI_SYN, 434 .flags = IMX_SSI_DMA | IMX_SSI_SYN,
406}; 435};
407 436
437/* coda */
438
439static void __init visstrim_coda_init(void)
440{
441 struct platform_device *pdev;
442 int dma;
443
444 pdev = imx27_add_coda();
445 dma = dma_declare_coherent_memory(&pdev->dev,
446 mx2_camera_base + MX2_CAMERA_BUF_SIZE,
447 mx2_camera_base + MX2_CAMERA_BUF_SIZE,
448 MX2_CAMERA_BUF_SIZE,
449 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
450 if (!(dma & DMA_MEMORY_MAP))
451 return;
452}
453
454/* DMA deinterlace */
455static struct platform_device visstrim_deinterlace = {
456 .name = "m2m-deinterlace",
457 .id = 0,
458};
459
460static void __init visstrim_deinterlace_init(void)
461{
462 int ret = -ENOMEM;
463 struct platform_device *pdev = &visstrim_deinterlace;
464 int dma;
465
466 ret = platform_device_register(pdev);
467
468 dma = dma_declare_coherent_memory(&pdev->dev,
469 mx2_camera_base + 2 * MX2_CAMERA_BUF_SIZE,
470 mx2_camera_base + 2 * MX2_CAMERA_BUF_SIZE,
471 MX2_CAMERA_BUF_SIZE,
472 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
473 if (!(dma & DMA_MEMORY_MAP))
474 return;
475}
476
477
478/* Audio */
479static const struct snd_mx27vis_platform_data snd_mx27vis_pdata __initconst = {
480 .amp_gain0_gpio = AMP_GAIN_0,
481 .amp_gain1_gpio = AMP_GAIN_1,
482 .amp_mutel_gpio = AMP_MUTE_SDL,
483 .amp_muter_gpio = AMP_MUTE_SDR,
484};
485
408static void __init visstrim_m10_revision(void) 486static void __init visstrim_m10_revision(void)
409{ 487{
410 int exp_version = 0; 488 int exp_version = 0;
@@ -463,11 +541,14 @@ static void __init visstrim_m10_board_init(void)
463 imx27_add_fec(NULL); 541 imx27_add_fec(NULL);
464 imx_add_gpio_keys(&visstrim_gpio_keys_platform_data); 542 imx_add_gpio_keys(&visstrim_gpio_keys_platform_data);
465 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 543 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
466 imx_add_platform_device("mx27vis", 0, NULL, 0, NULL, 0); 544 imx_add_platform_device("mx27vis", 0, NULL, 0, &snd_mx27vis_pdata,
545 sizeof(snd_mx27vis_pdata));
467 platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0, 546 platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0,
468 &iclink_tvp5150, sizeof(iclink_tvp5150)); 547 &iclink_tvp5150, sizeof(iclink_tvp5150));
469 gpio_led_register_device(0, &visstrim_m10_led_data); 548 gpio_led_register_device(0, &visstrim_m10_led_data);
549 visstrim_deinterlace_init();
470 visstrim_camera_init(); 550 visstrim_camera_init();
551 visstrim_coda_init();
471} 552}
472 553
473static void __init visstrim_m10_timer_init(void) 554static void __init visstrim_m10_timer_init(void)
diff --git a/arch/arm/mach-imx/imx53-dt.c b/arch/arm/mach-imx/mach-imx53.c
index 1b7a2fc3659..29711e95579 100644
--- a/arch/arm/mach-imx/imx53-dt.c
+++ b/arch/arm/mach-imx/mach-imx53.c
@@ -17,7 +17,6 @@
17#include <linux/irq.h> 17#include <linux/irq.h>
18#include <linux/of_irq.h> 18#include <linux/of_irq.h>
19#include <linux/of_platform.h> 19#include <linux/of_platform.h>
20#include <linux/pinctrl/machine.h>
21#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
22#include <asm/mach/time.h> 21#include <asm/mach/time.h>
23#include <mach/common.h> 22#include <mach/common.h>
@@ -51,14 +50,6 @@ static const struct of_dev_auxdata imx53_auxdata_lookup[] __initconst = {
51 { /* sentinel */ } 50 { /* sentinel */ }
52}; 51};
53 52
54static const struct of_device_id imx53_iomuxc_of_match[] __initconst = {
55 { .compatible = "fsl,imx53-iomuxc-ard", .data = imx53_ard_common_init, },
56 { .compatible = "fsl,imx53-iomuxc-evk", .data = imx53_evk_common_init, },
57 { .compatible = "fsl,imx53-iomuxc-qsb", .data = imx53_qsb_common_init, },
58 { .compatible = "fsl,imx53-iomuxc-smd", .data = imx53_smd_common_init, },
59 { /* sentinel */ }
60};
61
62static void __init imx53_qsb_init(void) 53static void __init imx53_qsb_init(void)
63{ 54{
64 struct clk *clk; 55 struct clk *clk;
@@ -74,20 +65,6 @@ static void __init imx53_qsb_init(void)
74 65
75static void __init imx53_dt_init(void) 66static void __init imx53_dt_init(void)
76{ 67{
77 struct device_node *node;
78 const struct of_device_id *of_id;
79 void (*func)(void);
80
81 pinctrl_provide_dummies();
82
83 node = of_find_matching_node(NULL, imx53_iomuxc_of_match);
84 if (node) {
85 of_id = of_match_node(imx53_iomuxc_of_match, node);
86 func = of_id->data;
87 func();
88 of_node_put(node);
89 }
90
91 if (of_machine_is_compatible("fsl,imx53-qsb")) 68 if (of_machine_is_compatible("fsl,imx53-qsb"))
92 imx53_qsb_init(); 69 imx53_qsb_init();
93 70
@@ -105,10 +82,6 @@ static struct sys_timer imx53_timer = {
105}; 82};
106 83
107static const char *imx53_dt_board_compat[] __initdata = { 84static const char *imx53_dt_board_compat[] __initdata = {
108 "fsl,imx53-ard",
109 "fsl,imx53-evk",
110 "fsl,imx53-qsb",
111 "fsl,imx53-smd",
112 "fsl,imx53", 85 "fsl,imx53",
113 NULL 86 NULL
114}; 87};
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 045b3f6a387..47c91f7185d 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -22,10 +22,10 @@
22#include <linux/of_address.h> 22#include <linux/of_address.h>
23#include <linux/of_irq.h> 23#include <linux/of_irq.h>
24#include <linux/of_platform.h> 24#include <linux/of_platform.h>
25#include <linux/pinctrl/machine.h>
26#include <linux/phy.h> 25#include <linux/phy.h>
26#include <linux/regmap.h>
27#include <linux/micrel_phy.h> 27#include <linux/micrel_phy.h>
28#include <linux/mfd/anatop.h> 28#include <linux/mfd/syscon.h>
29#include <asm/cpuidle.h> 29#include <asm/cpuidle.h>
30#include <asm/smp_twd.h> 30#include <asm/smp_twd.h>
31#include <asm/hardware/cache-l2x0.h> 31#include <asm/hardware/cache-l2x0.h>
@@ -100,7 +100,6 @@ static void __init imx6q_sabrelite_cko1_setup(void)
100 clk_set_parent(cko1_sel, ahb); 100 clk_set_parent(cko1_sel, ahb);
101 rate = clk_round_rate(cko1, 16000000); 101 rate = clk_round_rate(cko1, 16000000);
102 clk_set_rate(cko1, rate); 102 clk_set_rate(cko1, rate);
103 clk_register_clkdev(cko1, NULL, "0-000a");
104put_clk: 103put_clk:
105 if (!IS_ERR(cko1_sel)) 104 if (!IS_ERR(cko1_sel))
106 clk_put(cko1_sel); 105 clk_put(cko1_sel);
@@ -120,20 +119,7 @@ static void __init imx6q_sabrelite_init(void)
120 119
121static void __init imx6q_usb_init(void) 120static void __init imx6q_usb_init(void)
122{ 121{
123 struct device_node *np; 122 struct regmap *anatop;
124 struct platform_device *pdev = NULL;
125 struct anatop *adata = NULL;
126
127 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop");
128 if (np)
129 pdev = of_find_device_by_node(np);
130 if (pdev)
131 adata = platform_get_drvdata(pdev);
132 if (!adata) {
133 if (np)
134 of_node_put(np);
135 return;
136 }
137 123
138#define HW_ANADIG_USB1_CHRG_DETECT 0x000001b0 124#define HW_ANADIG_USB1_CHRG_DETECT 0x000001b0
139#define HW_ANADIG_USB2_CHRG_DETECT 0x00000210 125#define HW_ANADIG_USB2_CHRG_DETECT 0x00000210
@@ -141,30 +127,25 @@ static void __init imx6q_usb_init(void)
141#define BM_ANADIG_USB_CHRG_DETECT_EN_B 0x00100000 127#define BM_ANADIG_USB_CHRG_DETECT_EN_B 0x00100000
142#define BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B 0x00080000 128#define BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B 0x00080000
143 129
144 /* 130 anatop = syscon_regmap_lookup_by_compatible("fsl,imx6q-anatop");
145 * The external charger detector needs to be disabled, 131 if (!IS_ERR(anatop)) {
146 * or the signal at DP will be poor 132 /*
147 */ 133 * The external charger detector needs to be disabled,
148 anatop_write_reg(adata, HW_ANADIG_USB1_CHRG_DETECT, 134 * or the signal at DP will be poor
149 BM_ANADIG_USB_CHRG_DETECT_EN_B 135 */
150 | BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B, 136 regmap_write(anatop, HW_ANADIG_USB1_CHRG_DETECT,
151 ~0); 137 BM_ANADIG_USB_CHRG_DETECT_EN_B
152 anatop_write_reg(adata, HW_ANADIG_USB2_CHRG_DETECT, 138 | BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B);
153 BM_ANADIG_USB_CHRG_DETECT_EN_B | 139 regmap_write(anatop, HW_ANADIG_USB2_CHRG_DETECT,
154 BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B, 140 BM_ANADIG_USB_CHRG_DETECT_EN_B |
155 ~0); 141 BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B);
156 142 } else {
157 of_node_put(np); 143 pr_warn("failed to find fsl,imx6q-anatop regmap\n");
144 }
158} 145}
159 146
160static void __init imx6q_init_machine(void) 147static void __init imx6q_init_machine(void)
161{ 148{
162 /*
163 * This should be removed when all imx6q boards have pinctrl
164 * states for devices defined in device tree.
165 */
166 pinctrl_provide_dummies();
167
168 if (of_machine_is_compatible("fsl,imx6q-sabrelite")) 149 if (of_machine_is_compatible("fsl,imx6q-sabrelite"))
169 imx6q_sabrelite_init(); 150 imx6q_sabrelite_init();
170 151
@@ -218,14 +199,12 @@ static struct sys_timer imx6q_timer = {
218}; 199};
219 200
220static const char *imx6q_dt_compat[] __initdata = { 201static const char *imx6q_dt_compat[] __initdata = {
221 "fsl,imx6q-arm2",
222 "fsl,imx6q-sabrelite",
223 "fsl,imx6q-sabresd",
224 "fsl,imx6q", 202 "fsl,imx6q",
225 NULL, 203 NULL,
226}; 204};
227 205
228DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)") 206DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)")
207 .smp = smp_ops(imx_smp_ops),
229 .map_io = imx6q_map_io, 208 .map_io = imx6q_map_io,
230 .init_irq = imx6q_init_irq, 209 .init_irq = imx6q_init_irq,
231 .handle_irq = imx6q_handle_irq, 210 .handle_irq = imx6q_handle_irq,
diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c
index 5d08533ab2c..0330078ff78 100644
--- a/arch/arm/mach-imx/mach-kzm_arm11_01.c
+++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c
@@ -36,7 +36,6 @@
36#include <asm/mach/map.h> 36#include <asm/mach/map.h>
37#include <asm/mach/time.h> 37#include <asm/mach/time.h>
38 38
39#include <mach/clock.h>
40#include <mach/common.h> 39#include <mach/common.h>
41#include <mach/hardware.h> 40#include <mach/hardware.h>
42#include <mach/iomux-mx3.h> 41#include <mach/iomux-mx3.h>
@@ -259,13 +258,13 @@ static void __init kzm_board_init(void)
259 */ 258 */
260static struct map_desc kzm_io_desc[] __initdata = { 259static struct map_desc kzm_io_desc[] __initdata = {
261 { 260 {
262 .virtual = MX31_CS4_BASE_ADDR_VIRT, 261 .virtual = (unsigned long)MX31_CS4_BASE_ADDR_VIRT,
263 .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR), 262 .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR),
264 .length = MX31_CS4_SIZE, 263 .length = MX31_CS4_SIZE,
265 .type = MT_DEVICE 264 .type = MT_DEVICE
266 }, 265 },
267 { 266 {
268 .virtual = MX31_CS5_BASE_ADDR_VIRT, 267 .virtual = (unsigned long)MX31_CS5_BASE_ADDR_VIRT,
269 .pfn = __phys_to_pfn(MX31_CS5_BASE_ADDR), 268 .pfn = __phys_to_pfn(MX31_CS5_BASE_ADDR),
270 .length = MX31_CS5_SIZE, 269 .length = MX31_CS5_SIZE,
271 .type = MT_DEVICE 270 .type = MT_DEVICE
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 58c24c1a7ab..05996f39005 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -158,6 +158,11 @@ static const int mx27pdk_pins[] __initconst = {
158 PB21_PF_CSI_HSYNC, 158 PB21_PF_CSI_HSYNC,
159 CSI_PWRDWN | GPIO_GPIO | GPIO_OUT, 159 CSI_PWRDWN | GPIO_GPIO | GPIO_OUT,
160 CSI_RESET | GPIO_GPIO | GPIO_OUT, 160 CSI_RESET | GPIO_GPIO | GPIO_OUT,
161 /* SSI4 */
162 PC16_PF_SSI4_FS,
163 PC17_PF_SSI4_RXD,
164 PC18_PF_SSI4_TXD,
165 PC19_PF_SSI4_CLK,
161}; 166};
162 167
163static struct gpio mx27_3ds_camera_gpios[] = { 168static struct gpio mx27_3ds_camera_gpios[] = {
@@ -329,13 +334,24 @@ static struct mc13xxx_regulator_init_data mx27_3ds_regulators[] = {
329}; 334};
330 335
331/* MC13783 */ 336/* MC13783 */
337static struct mc13xxx_codec_platform_data mx27_3ds_codec = {
338 .dac_ssi_port = MC13783_SSI1_PORT,
339 .adc_ssi_port = MC13783_SSI1_PORT,
340};
341
332static struct mc13xxx_platform_data mc13783_pdata = { 342static struct mc13xxx_platform_data mc13783_pdata = {
333 .regulators = { 343 .regulators = {
334 .regulators = mx27_3ds_regulators, 344 .regulators = mx27_3ds_regulators,
335 .num_regulators = ARRAY_SIZE(mx27_3ds_regulators), 345 .num_regulators = ARRAY_SIZE(mx27_3ds_regulators),
336 346
337 }, 347 },
338 .flags = MC13XXX_USE_TOUCHSCREEN | MC13XXX_USE_RTC, 348 .flags = MC13XXX_USE_TOUCHSCREEN | MC13XXX_USE_RTC |
349 MC13XXX_USE_CODEC,
350 .codec = &mx27_3ds_codec,
351};
352
353static struct imx_ssi_platform_data mx27_3ds_ssi_pdata = {
354 .flags = IMX_SSI_DMA | IMX_SSI_NET,
339}; 355};
340 356
341/* SPI */ 357/* SPI */
@@ -512,6 +528,9 @@ static void __init mx27pdk_init(void)
512 } 528 }
513 529
514 imx27_add_mx2_camera(&mx27_3ds_cam_pdata); 530 imx27_add_mx2_camera(&mx27_3ds_cam_pdata);
531 imx27_add_imx_ssi(0, &mx27_3ds_ssi_pdata);
532
533 imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0);
515} 534}
516 535
517static void __init mx27pdk_timer_init(void) 536static void __init mx27pdk_timer_init(void)
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index d37f4809c55..e774b07f48d 100644
--- a/arch/arm/mach-imx/mach-mx31ads.c
+++ b/arch/arm/mach-imx/mach-mx31ads.c
@@ -540,7 +540,7 @@ static void __init mxc_init_audio(void)
540 */ 540 */
541static struct map_desc mx31ads_io_desc[] __initdata = { 541static struct map_desc mx31ads_io_desc[] __initdata = {
542 { 542 {
543 .virtual = MX31_CS4_BASE_ADDR_VIRT, 543 .virtual = (unsigned long)MX31_CS4_BASE_ADDR_VIRT,
544 .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR), 544 .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR),
545 .length = CS4_CS8900_MMIO_START, 545 .length = CS4_CS8900_MMIO_START,
546 .type = MT_DEVICE 546 .type = MT_DEVICE
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
index c8785b39eae..ef57cff5abf 100644
--- a/arch/arm/mach-imx/mach-mx31lite.c
+++ b/arch/arm/mach-imx/mach-mx31lite.c
@@ -207,7 +207,7 @@ static struct platform_device physmap_flash_device = {
207 */ 207 */
208static struct map_desc mx31lite_io_desc[] __initdata = { 208static struct map_desc mx31lite_io_desc[] __initdata = {
209 { 209 {
210 .virtual = MX31_CS4_BASE_ADDR_VIRT, 210 .virtual = (unsigned long)MX31_CS4_BASE_ADDR_VIRT,
211 .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR), 211 .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR),
212 .length = MX31_CS4_SIZE, 212 .length = MX31_CS4_SIZE,
213 .type = MT_DEVICE 213 .type = MT_DEVICE
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index d46290b288e..459e754ef8c 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -47,7 +47,7 @@
47#include <mach/hardware.h> 47#include <mach/hardware.h>
48#include <mach/iomux-mx3.h> 48#include <mach/iomux-mx3.h>
49#include <mach/ulpi.h> 49#include <mach/ulpi.h>
50#include <mach/ssi.h> 50#include <linux/platform_data/asoc-imx-ssi.h>
51 51
52#include "devices-imx31.h" 52#include "devices-imx31.h"
53 53
diff --git a/arch/arm/mach-imx/mach-mx51_efikamx.c b/arch/arm/mach-imx/mach-mx51_efikamx.c
deleted file mode 100644
index 8d09c0126ca..00000000000
--- a/arch/arm/mach-imx/mach-mx51_efikamx.c
+++ /dev/null
@@ -1,300 +0,0 @@
1/*
2 * Copyright (C) 2010 Linaro Limited
3 *
4 * based on code from the following
5 * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
6 * Copyright 2009-2010 Pegatron Corporation. All Rights Reserved.
7 * Copyright 2009-2010 Genesi USA, Inc. All Rights Reserved.
8 *
9 * The code contained herein is licensed under the GNU General Public
10 * License. You may obtain a copy of the GNU General Public License
11 * Version 2 or later at the following locations:
12 *
13 * http://www.opensource.org/licenses/gpl-license.html
14 * http://www.gnu.org/copyleft/gpl.html
15 */
16
17#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/i2c.h>
20#include <linux/gpio.h>
21#include <linux/leds.h>
22#include <linux/input.h>
23#include <linux/delay.h>
24#include <linux/io.h>
25#include <linux/spi/flash.h>
26#include <linux/spi/spi.h>
27#include <linux/mfd/mc13892.h>
28#include <linux/regulator/machine.h>
29#include <linux/regulator/consumer.h>
30
31#include <mach/common.h>
32#include <mach/hardware.h>
33#include <mach/iomux-mx51.h>
34
35#include <asm/setup.h>
36#include <asm/system_info.h>
37#include <asm/mach-types.h>
38#include <asm/mach/arch.h>
39#include <asm/mach/time.h>
40
41#include "devices-imx51.h"
42#include "efika.h"
43
44#define EFIKAMX_PCBID0 IMX_GPIO_NR(3, 16)
45#define EFIKAMX_PCBID1 IMX_GPIO_NR(3, 17)
46#define EFIKAMX_PCBID2 IMX_GPIO_NR(3, 11)
47
48#define EFIKAMX_BLUE_LED IMX_GPIO_NR(3, 13)
49#define EFIKAMX_GREEN_LED IMX_GPIO_NR(3, 14)
50#define EFIKAMX_RED_LED IMX_GPIO_NR(3, 15)
51
52#define EFIKAMX_POWER_KEY IMX_GPIO_NR(2, 31)
53
54/* board 1.1 doesn't have same reset gpio */
55#define EFIKAMX_RESET1_1 IMX_GPIO_NR(3, 2)
56#define EFIKAMX_RESET IMX_GPIO_NR(1, 4)
57
58#define EFIKAMX_POWEROFF IMX_GPIO_NR(4, 13)
59
60#define EFIKAMX_PMIC IMX_GPIO_NR(1, 6)
61
62/* the pci ids pin have pull up. they're driven low according to board id */
63#define MX51_PAD_PCBID0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, PAD_CTL_PUS_100K_UP)
64#define MX51_PAD_PCBID1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, PAD_CTL_PUS_100K_UP)
65#define MX51_PAD_PCBID2 IOMUX_PAD(0x504, 0x128, 3, 0x0, 0, PAD_CTL_PUS_100K_UP)
66#define MX51_PAD_PWRKEY IOMUX_PAD(0x48c, 0x0f8, 1, 0x0, 0, PAD_CTL_PUS_100K_UP | PAD_CTL_PKE)
67
68static iomux_v3_cfg_t mx51efikamx_pads[] = {
69 /* board id */
70 MX51_PAD_PCBID0,
71 MX51_PAD_PCBID1,
72 MX51_PAD_PCBID2,
73
74 /* leds */
75 MX51_PAD_CSI1_D9__GPIO3_13,
76 MX51_PAD_CSI1_VSYNC__GPIO3_14,
77 MX51_PAD_CSI1_HSYNC__GPIO3_15,
78
79 /* power key */
80 MX51_PAD_PWRKEY,
81
82 /* reset */
83 MX51_PAD_DI1_PIN13__GPIO3_2,
84 MX51_PAD_GPIO1_4__GPIO1_4,
85
86 /* power off */
87 MX51_PAD_CSI2_VSYNC__GPIO4_13,
88};
89
90/* PCBID2 PCBID1 PCBID0 STATE
91 1 1 1 ER1:rev1.1
92 1 1 0 ER2:rev1.2
93 1 0 1 ER3:rev1.3
94 1 0 0 ER4:rev1.4
95*/
96static void __init mx51_efikamx_board_id(void)
97{
98 int id;
99
100 /* things are taking time to settle */
101 msleep(150);
102
103 gpio_request(EFIKAMX_PCBID0, "pcbid0");
104 gpio_direction_input(EFIKAMX_PCBID0);
105 gpio_request(EFIKAMX_PCBID1, "pcbid1");
106 gpio_direction_input(EFIKAMX_PCBID1);
107 gpio_request(EFIKAMX_PCBID2, "pcbid2");
108 gpio_direction_input(EFIKAMX_PCBID2);
109
110 id = gpio_get_value(EFIKAMX_PCBID0) ? 1 : 0;
111 id |= (gpio_get_value(EFIKAMX_PCBID1) ? 1 : 0) << 1;
112 id |= (gpio_get_value(EFIKAMX_PCBID2) ? 1 : 0) << 2;
113
114 switch (id) {
115 case 7:
116 system_rev = 0x11;
117 break;
118 case 6:
119 system_rev = 0x12;
120 break;
121 case 5:
122 system_rev = 0x13;
123 break;
124 case 4:
125 system_rev = 0x14;
126 break;
127 default:
128 system_rev = 0x10;
129 break;
130 }
131
132 if ((system_rev == 0x10)
133 || (system_rev == 0x12)
134 || (system_rev == 0x14)) {
135 printk(KERN_WARNING
136 "EfikaMX: Unsupported board revision 1.%u!\n",
137 system_rev & 0xf);
138 }
139}
140
141static struct gpio_led mx51_efikamx_leds[] __initdata = {
142 {
143 .name = "efikamx:green",
144 .default_trigger = "default-on",
145 .gpio = EFIKAMX_GREEN_LED,
146 },
147 {
148 .name = "efikamx:red",
149 .default_trigger = "ide-disk",
150 .gpio = EFIKAMX_RED_LED,
151 },
152 {
153 .name = "efikamx:blue",
154 .default_trigger = "mmc0",
155 .gpio = EFIKAMX_BLUE_LED,
156 },
157};
158
159static const struct gpio_led_platform_data
160 mx51_efikamx_leds_data __initconst = {
161 .leds = mx51_efikamx_leds,
162 .num_leds = ARRAY_SIZE(mx51_efikamx_leds),
163};
164
165static struct esdhc_platform_data sd_pdata = {
166 .cd_type = ESDHC_CD_CONTROLLER,
167 .wp_type = ESDHC_WP_CONTROLLER,
168};
169
170static struct gpio_keys_button mx51_efikamx_powerkey[] = {
171 {
172 .code = KEY_POWER,
173 .gpio = EFIKAMX_POWER_KEY,
174 .type = EV_PWR,
175 .desc = "Power Button (CM)",
176 .wakeup = 1,
177 .debounce_interval = 10, /* ms */
178 },
179};
180
181static const struct gpio_keys_platform_data mx51_efikamx_powerkey_data __initconst = {
182 .buttons = mx51_efikamx_powerkey,
183 .nbuttons = ARRAY_SIZE(mx51_efikamx_powerkey),
184};
185
186static void mx51_efikamx_restart(char mode, const char *cmd)
187{
188 if (system_rev == 0x11)
189 gpio_direction_output(EFIKAMX_RESET1_1, 0);
190 else
191 gpio_direction_output(EFIKAMX_RESET, 0);
192}
193
194static struct regulator *pwgt1, *pwgt2, *coincell;
195
196static void mx51_efikamx_power_off(void)
197{
198 if (!IS_ERR(coincell))
199 regulator_disable(coincell);
200
201 if (!IS_ERR(pwgt1) && !IS_ERR(pwgt2)) {
202 regulator_disable(pwgt2);
203 regulator_disable(pwgt1);
204 }
205 gpio_direction_output(EFIKAMX_POWEROFF, 1);
206}
207
208static int __init mx51_efikamx_power_init(void)
209{
210 pwgt1 = regulator_get(NULL, "pwgt1");
211 pwgt2 = regulator_get(NULL, "pwgt2");
212 if (!IS_ERR(pwgt1) && !IS_ERR(pwgt2)) {
213 regulator_enable(pwgt1);
214 regulator_enable(pwgt2);
215 }
216 gpio_request(EFIKAMX_POWEROFF, "poweroff");
217 pm_power_off = mx51_efikamx_power_off;
218
219 /* enable coincell charger. maybe need a small power driver ? */
220 coincell = regulator_get(NULL, "coincell");
221 if (!IS_ERR(coincell)) {
222 regulator_set_voltage(coincell, 3000000, 3000000);
223 regulator_enable(coincell);
224 }
225
226 regulator_has_full_constraints();
227
228 return 0;
229}
230
231static void __init mx51_efikamx_init_late(void)
232{
233 imx51_init_late();
234 mx51_efikamx_power_init();
235}
236
237static void __init mx51_efikamx_init(void)
238{
239 imx51_soc_init();
240
241 mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads,
242 ARRAY_SIZE(mx51efikamx_pads));
243 efika_board_common_init();
244
245 mx51_efikamx_board_id();
246
247 /* on < 1.2 boards both SD controllers are used */
248 if (system_rev < 0x12) {
249 imx51_add_sdhci_esdhc_imx(0, NULL);
250 imx51_add_sdhci_esdhc_imx(1, &sd_pdata);
251 mx51_efikamx_leds[2].default_trigger = "mmc1";
252 } else
253 imx51_add_sdhci_esdhc_imx(0, &sd_pdata);
254
255 gpio_led_register_device(-1, &mx51_efikamx_leds_data);
256 imx_add_gpio_keys(&mx51_efikamx_powerkey_data);
257
258 if (system_rev == 0x11) {
259 gpio_request(EFIKAMX_RESET1_1, "reset");
260 gpio_direction_output(EFIKAMX_RESET1_1, 1);
261 } else {
262 gpio_request(EFIKAMX_RESET, "reset");
263 gpio_direction_output(EFIKAMX_RESET, 1);
264 }
265
266 /*
267 * enable wifi by default only on mx
268 * sb and mx have same wlan pin but the value to enable it are
269 * different :/
270 */
271 gpio_request(EFIKA_WLAN_EN, "wlan_en");
272 gpio_direction_output(EFIKA_WLAN_EN, 0);
273 msleep(10);
274
275 gpio_request(EFIKA_WLAN_RESET, "wlan_rst");
276 gpio_direction_output(EFIKA_WLAN_RESET, 0);
277 msleep(10);
278 gpio_set_value(EFIKA_WLAN_RESET, 1);
279}
280
281static void __init mx51_efikamx_timer_init(void)
282{
283 mx51_clocks_init(32768, 24000000, 22579200, 24576000);
284}
285
286static struct sys_timer mx51_efikamx_timer = {
287 .init = mx51_efikamx_timer_init,
288};
289
290MACHINE_START(MX51_EFIKAMX, "Genesi Efika MX (Smarttop)")
291 .atag_offset = 0x100,
292 .map_io = mx51_map_io,
293 .init_early = imx51_init_early,
294 .init_irq = mx51_init_irq,
295 .handle_irq = imx51_handle_irq,
296 .timer = &mx51_efikamx_timer,
297 .init_machine = mx51_efikamx_init,
298 .init_late = mx51_efikamx_init_late,
299 .restart = mx51_efikamx_restart,
300MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx51_efikasb.c b/arch/arm/mach-imx/mach-mx51_efikasb.c
deleted file mode 100644
index fdbd181b97e..00000000000
--- a/arch/arm/mach-imx/mach-mx51_efikasb.c
+++ /dev/null
@@ -1,296 +0,0 @@
1/*
2 * Copyright (C) Arnaud Patard <arnaud.patard@rtp-net.org>
3 *
4 * based on code from the following
5 * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
6 * Copyright 2009-2010 Pegatron Corporation. All Rights Reserved.
7 * Copyright 2009-2010 Genesi USA, Inc. All Rights Reserved.
8 *
9 * The code contained herein is licensed under the GNU General Public
10 * License. You may obtain a copy of the GNU General Public License
11 * Version 2 or later at the following locations:
12 *
13 * http://www.opensource.org/licenses/gpl-license.html
14 * http://www.gnu.org/copyleft/gpl.html
15 */
16
17#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/i2c.h>
20#include <linux/gpio.h>
21#include <linux/leds.h>
22#include <linux/input.h>
23#include <linux/delay.h>
24#include <linux/io.h>
25#include <linux/spi/flash.h>
26#include <linux/spi/spi.h>
27#include <linux/mfd/mc13892.h>
28#include <linux/regulator/machine.h>
29#include <linux/regulator/consumer.h>
30#include <linux/usb/otg.h>
31#include <linux/usb/ulpi.h>
32#include <mach/ulpi.h>
33
34#include <mach/common.h>
35#include <mach/hardware.h>
36#include <mach/iomux-mx51.h>
37
38#include <asm/setup.h>
39#include <asm/system_info.h>
40#include <asm/mach-types.h>
41#include <asm/mach/arch.h>
42#include <asm/mach/time.h>
43
44#include "devices-imx51.h"
45#include "efika.h"
46
47#define EFIKASB_USBH2_STP IMX_GPIO_NR(2, 20)
48#define EFIKASB_GREEN_LED IMX_GPIO_NR(1, 3)
49#define EFIKASB_WHITE_LED IMX_GPIO_NR(2, 25)
50#define EFIKASB_PCBID0 IMX_GPIO_NR(2, 28)
51#define EFIKASB_PCBID1 IMX_GPIO_NR(2, 29)
52#define EFIKASB_PWRKEY IMX_GPIO_NR(2, 31)
53#define EFIKASB_LID IMX_GPIO_NR(3, 14)
54#define EFIKASB_POWEROFF IMX_GPIO_NR(4, 13)
55#define EFIKASB_RFKILL IMX_GPIO_NR(3, 1)
56
57#define MX51_PAD_PWRKEY IOMUX_PAD(0x48c, 0x0f8, 1, 0x0, 0, PAD_CTL_PUS_100K_UP | PAD_CTL_PKE)
58#define MX51_PAD_SD1_CD IOMUX_PAD(0x47c, 0x0e8, 1, __NA_, 0, MX51_ESDHC_PAD_CTRL)
59
60static iomux_v3_cfg_t mx51efikasb_pads[] = {
61 /* USB HOST2 */
62 MX51_PAD_EIM_D16__USBH2_DATA0,
63 MX51_PAD_EIM_D17__USBH2_DATA1,
64 MX51_PAD_EIM_D18__USBH2_DATA2,
65 MX51_PAD_EIM_D19__USBH2_DATA3,
66 MX51_PAD_EIM_D20__USBH2_DATA4,
67 MX51_PAD_EIM_D21__USBH2_DATA5,
68 MX51_PAD_EIM_D22__USBH2_DATA6,
69 MX51_PAD_EIM_D23__USBH2_DATA7,
70 MX51_PAD_EIM_A24__USBH2_CLK,
71 MX51_PAD_EIM_A25__USBH2_DIR,
72 MX51_PAD_EIM_A26__USBH2_STP,
73 MX51_PAD_EIM_A27__USBH2_NXT,
74
75 /* leds */
76 MX51_PAD_EIM_CS0__GPIO2_25,
77 MX51_PAD_GPIO1_3__GPIO1_3,
78
79 /* pcb id */
80 MX51_PAD_EIM_CS3__GPIO2_28,
81 MX51_PAD_EIM_CS4__GPIO2_29,
82
83 /* lid */
84 MX51_PAD_CSI1_VSYNC__GPIO3_14,
85
86 /* power key*/
87 MX51_PAD_PWRKEY,
88
89 /* wifi/bt button */
90 MX51_PAD_DI1_PIN12__GPIO3_1,
91
92 /* power off */
93 MX51_PAD_CSI2_VSYNC__GPIO4_13,
94
95 /* wdog reset */
96 MX51_PAD_GPIO1_4__WDOG1_WDOG_B,
97
98 /* BT */
99 MX51_PAD_EIM_A17__GPIO2_11,
100
101 MX51_PAD_SD1_CD,
102};
103
104static int initialize_usbh2_port(struct platform_device *pdev)
105{
106 iomux_v3_cfg_t usbh2stp = MX51_PAD_EIM_A26__USBH2_STP;
107 iomux_v3_cfg_t usbh2gpio = MX51_PAD_EIM_A26__GPIO2_20;
108
109 mxc_iomux_v3_setup_pad(usbh2gpio);
110 gpio_request(EFIKASB_USBH2_STP, "usbh2_stp");
111 gpio_direction_output(EFIKASB_USBH2_STP, 0);
112 msleep(1);
113 gpio_set_value(EFIKASB_USBH2_STP, 1);
114 msleep(1);
115
116 gpio_free(EFIKASB_USBH2_STP);
117 mxc_iomux_v3_setup_pad(usbh2stp);
118
119 mdelay(10);
120
121 return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_ITC_NO_THRESHOLD);
122}
123
124static struct mxc_usbh_platform_data usbh2_config __initdata = {
125 .init = initialize_usbh2_port,
126 .portsc = MXC_EHCI_MODE_ULPI,
127};
128
129static void __init mx51_efikasb_usb(void)
130{
131 usbh2_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
132 ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND);
133 if (usbh2_config.otg)
134 imx51_add_mxc_ehci_hs(2, &usbh2_config);
135}
136
137static const struct gpio_led mx51_efikasb_leds[] __initconst = {
138 {
139 .name = "efikasb:green",
140 .default_trigger = "default-on",
141 .gpio = EFIKASB_GREEN_LED,
142 .active_low = 1,
143 },
144 {
145 .name = "efikasb:white",
146 .default_trigger = "caps",
147 .gpio = EFIKASB_WHITE_LED,
148 },
149};
150
151static const struct gpio_led_platform_data
152 mx51_efikasb_leds_data __initconst = {
153 .leds = mx51_efikasb_leds,
154 .num_leds = ARRAY_SIZE(mx51_efikasb_leds),
155};
156
157static struct gpio_keys_button mx51_efikasb_keys[] = {
158 {
159 .code = KEY_POWER,
160 .gpio = EFIKASB_PWRKEY,
161 .type = EV_KEY,
162 .desc = "Power Button",
163 .wakeup = 1,
164 .active_low = 1,
165 },
166 {
167 .code = SW_LID,
168 .gpio = EFIKASB_LID,
169 .type = EV_SW,
170 .desc = "Lid Switch",
171 .active_low = 1,
172 },
173 {
174 .code = KEY_RFKILL,
175 .gpio = EFIKASB_RFKILL,
176 .type = EV_KEY,
177 .desc = "rfkill",
178 .active_low = 1,
179 },
180};
181
182static const struct gpio_keys_platform_data mx51_efikasb_keys_data __initconst = {
183 .buttons = mx51_efikasb_keys,
184 .nbuttons = ARRAY_SIZE(mx51_efikasb_keys),
185};
186
187static struct esdhc_platform_data sd0_pdata = {
188#define EFIKASB_SD1_CD IMX_GPIO_NR(2, 27)
189 .cd_gpio = EFIKASB_SD1_CD,
190 .cd_type = ESDHC_CD_GPIO,
191 .wp_type = ESDHC_WP_CONTROLLER,
192};
193
194static struct esdhc_platform_data sd1_pdata = {
195 .cd_type = ESDHC_CD_CONTROLLER,
196 .wp_type = ESDHC_WP_CONTROLLER,
197};
198
199static struct regulator *pwgt1, *pwgt2;
200
201static void mx51_efikasb_power_off(void)
202{
203 gpio_set_value(EFIKA_USB_PHY_RESET, 0);
204
205 if (!IS_ERR(pwgt1) && !IS_ERR(pwgt2)) {
206 regulator_disable(pwgt2);
207 regulator_disable(pwgt1);
208 }
209 gpio_direction_output(EFIKASB_POWEROFF, 1);
210}
211
212static int __init mx51_efikasb_power_init(void)
213{
214 pwgt1 = regulator_get(NULL, "pwgt1");
215 pwgt2 = regulator_get(NULL, "pwgt2");
216 if (!IS_ERR(pwgt1) && !IS_ERR(pwgt2)) {
217 regulator_enable(pwgt1);
218 regulator_enable(pwgt2);
219 }
220 gpio_request(EFIKASB_POWEROFF, "poweroff");
221 pm_power_off = mx51_efikasb_power_off;
222
223 regulator_has_full_constraints();
224
225 return 0;
226}
227
228static void __init mx51_efikasb_init_late(void)
229{
230 imx51_init_late();
231 mx51_efikasb_power_init();
232}
233
234/* 01 R1.3 board
235 10 R2.0 board */
236static void __init mx51_efikasb_board_id(void)
237{
238 int id;
239
240 gpio_request(EFIKASB_PCBID0, "pcb id0");
241 gpio_direction_input(EFIKASB_PCBID0);
242 gpio_request(EFIKASB_PCBID1, "pcb id1");
243 gpio_direction_input(EFIKASB_PCBID1);
244
245 id = gpio_get_value(EFIKASB_PCBID0) ? 1 : 0;
246 id |= (gpio_get_value(EFIKASB_PCBID1) ? 1 : 0) << 1;
247
248 switch (id) {
249 default:
250 break;
251 case 1:
252 system_rev = 0x13;
253 break;
254 case 2:
255 system_rev = 0x20;
256 break;
257 }
258}
259
260static void __init efikasb_board_init(void)
261{
262 imx51_soc_init();
263
264 mxc_iomux_v3_setup_multiple_pads(mx51efikasb_pads,
265 ARRAY_SIZE(mx51efikasb_pads));
266 efika_board_common_init();
267
268 mx51_efikasb_board_id();
269 mx51_efikasb_usb();
270 imx51_add_sdhci_esdhc_imx(0, &sd0_pdata);
271 imx51_add_sdhci_esdhc_imx(1, &sd1_pdata);
272
273 gpio_led_register_device(-1, &mx51_efikasb_leds_data);
274 imx_add_gpio_keys(&mx51_efikasb_keys_data);
275}
276
277static void __init mx51_efikasb_timer_init(void)
278{
279 mx51_clocks_init(32768, 24000000, 22579200, 24576000);
280}
281
282static struct sys_timer mx51_efikasb_timer = {
283 .init = mx51_efikasb_timer_init,
284};
285
286MACHINE_START(MX51_EFIKASB, "Genesi Efika MX (Smartbook)")
287 .atag_offset = 0x100,
288 .map_io = mx51_map_io,
289 .init_early = imx51_init_early,
290 .init_irq = mx51_init_irq,
291 .handle_irq = imx51_handle_irq,
292 .init_machine = efikasb_board_init,
293 .init_late = mx51_efikasb_init_late,
294 .timer = &mx51_efikasb_timer,
295 .restart = mxc_restart,
296MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx53_ard.c b/arch/arm/mach-imx/mach-mx53_ard.c
deleted file mode 100644
index 6c28e65f424..00000000000
--- a/arch/arm/mach-imx/mach-mx53_ard.c
+++ /dev/null
@@ -1,272 +0,0 @@
1/*
2 * Copyright (C) 2011 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/clk.h>
23#include <linux/delay.h>
24#include <linux/gpio.h>
25#include <linux/smsc911x.h>
26#include <linux/regulator/machine.h>
27#include <linux/regulator/fixed.h>
28
29#include <mach/common.h>
30#include <mach/hardware.h>
31#include <mach/iomux-mx53.h>
32
33#include <asm/mach-types.h>
34#include <asm/mach/arch.h>
35#include <asm/mach/time.h>
36
37#include "devices-imx53.h"
38
39#define ARD_ETHERNET_INT_B IMX_GPIO_NR(2, 31)
40#define ARD_SD1_CD IMX_GPIO_NR(1, 1)
41#define ARD_SD1_WP IMX_GPIO_NR(1, 9)
42#define ARD_I2CPORTEXP_B IMX_GPIO_NR(2, 3)
43#define ARD_VOLUMEDOWN IMX_GPIO_NR(4, 0)
44#define ARD_HOME IMX_GPIO_NR(5, 10)
45#define ARD_BACK IMX_GPIO_NR(5, 11)
46#define ARD_PROG IMX_GPIO_NR(5, 12)
47#define ARD_VOLUMEUP IMX_GPIO_NR(5, 13)
48
49static iomux_v3_cfg_t mx53_ard_pads[] = {
50 /* UART1 */
51 MX53_PAD_PATA_DIOW__UART1_TXD_MUX,
52 MX53_PAD_PATA_DMACK__UART1_RXD_MUX,
53 /* WEIM for CS1 */
54 MX53_PAD_EIM_EB3__GPIO2_31, /* ETHERNET_INT_B */
55 MX53_PAD_EIM_D16__EMI_WEIM_D_16,
56 MX53_PAD_EIM_D17__EMI_WEIM_D_17,
57 MX53_PAD_EIM_D18__EMI_WEIM_D_18,
58 MX53_PAD_EIM_D19__EMI_WEIM_D_19,
59 MX53_PAD_EIM_D20__EMI_WEIM_D_20,
60 MX53_PAD_EIM_D21__EMI_WEIM_D_21,
61 MX53_PAD_EIM_D22__EMI_WEIM_D_22,
62 MX53_PAD_EIM_D23__EMI_WEIM_D_23,
63 MX53_PAD_EIM_D24__EMI_WEIM_D_24,
64 MX53_PAD_EIM_D25__EMI_WEIM_D_25,
65 MX53_PAD_EIM_D26__EMI_WEIM_D_26,
66 MX53_PAD_EIM_D27__EMI_WEIM_D_27,
67 MX53_PAD_EIM_D28__EMI_WEIM_D_28,
68 MX53_PAD_EIM_D29__EMI_WEIM_D_29,
69 MX53_PAD_EIM_D30__EMI_WEIM_D_30,
70 MX53_PAD_EIM_D31__EMI_WEIM_D_31,
71 MX53_PAD_EIM_DA0__EMI_NAND_WEIM_DA_0,
72 MX53_PAD_EIM_DA1__EMI_NAND_WEIM_DA_1,
73 MX53_PAD_EIM_DA2__EMI_NAND_WEIM_DA_2,
74 MX53_PAD_EIM_DA3__EMI_NAND_WEIM_DA_3,
75 MX53_PAD_EIM_DA4__EMI_NAND_WEIM_DA_4,
76 MX53_PAD_EIM_DA5__EMI_NAND_WEIM_DA_5,
77 MX53_PAD_EIM_DA6__EMI_NAND_WEIM_DA_6,
78 MX53_PAD_EIM_OE__EMI_WEIM_OE,
79 MX53_PAD_EIM_RW__EMI_WEIM_RW,
80 MX53_PAD_EIM_CS1__EMI_WEIM_CS_1,
81 /* SDHC1 */
82 MX53_PAD_SD1_CMD__ESDHC1_CMD,
83 MX53_PAD_SD1_CLK__ESDHC1_CLK,
84 MX53_PAD_SD1_DATA0__ESDHC1_DAT0,
85 MX53_PAD_SD1_DATA1__ESDHC1_DAT1,
86 MX53_PAD_SD1_DATA2__ESDHC1_DAT2,
87 MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
88 MX53_PAD_PATA_DATA8__ESDHC1_DAT4,
89 MX53_PAD_PATA_DATA9__ESDHC1_DAT5,
90 MX53_PAD_PATA_DATA10__ESDHC1_DAT6,
91 MX53_PAD_PATA_DATA11__ESDHC1_DAT7,
92 MX53_PAD_GPIO_1__GPIO1_1,
93 MX53_PAD_GPIO_9__GPIO1_9,
94 /* I2C2 */
95 MX53_PAD_EIM_EB2__I2C2_SCL,
96 MX53_PAD_KEY_ROW3__I2C2_SDA,
97 /* I2C3 */
98 MX53_PAD_GPIO_3__I2C3_SCL,
99 MX53_PAD_GPIO_16__I2C3_SDA,
100 /* GPIO */
101 MX53_PAD_DISP0_DAT16__GPIO5_10, /* home */
102 MX53_PAD_DISP0_DAT17__GPIO5_11, /* back */
103 MX53_PAD_DISP0_DAT18__GPIO5_12, /* prog */
104 MX53_PAD_DISP0_DAT19__GPIO5_13, /* vol up */
105 MX53_PAD_GPIO_10__GPIO4_0, /* vol down */
106};
107
108#define GPIO_BUTTON(gpio_num, ev_code, act_low, descr, wake) \
109{ \
110 .gpio = gpio_num, \
111 .type = EV_KEY, \
112 .code = ev_code, \
113 .active_low = act_low, \
114 .desc = "btn " descr, \
115 .wakeup = wake, \
116}
117
118static struct gpio_keys_button ard_buttons[] = {
119 GPIO_BUTTON(ARD_HOME, KEY_HOME, 1, "home", 0),
120 GPIO_BUTTON(ARD_BACK, KEY_BACK, 1, "back", 0),
121 GPIO_BUTTON(ARD_PROG, KEY_PROGRAM, 1, "program", 0),
122 GPIO_BUTTON(ARD_VOLUMEUP, KEY_VOLUMEUP, 1, "volume-up", 0),
123 GPIO_BUTTON(ARD_VOLUMEDOWN, KEY_VOLUMEDOWN, 1, "volume-down", 0),
124};
125
126static const struct gpio_keys_platform_data ard_button_data __initconst = {
127 .buttons = ard_buttons,
128 .nbuttons = ARRAY_SIZE(ard_buttons),
129};
130
131static struct resource ard_smsc911x_resources[] = {
132 {
133 .start = MX53_CS1_64MB_BASE_ADDR,
134 .end = MX53_CS1_64MB_BASE_ADDR + SZ_32M - 1,
135 .flags = IORESOURCE_MEM,
136 },
137 {
138 /* irq number is run-time assigned */
139 .flags = IORESOURCE_IRQ,
140 },
141};
142
143struct smsc911x_platform_config ard_smsc911x_config = {
144 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
145 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
146 .flags = SMSC911X_USE_32BIT,
147};
148
149static struct platform_device ard_smsc_lan9220_device = {
150 .name = "smsc911x",
151 .id = -1,
152 .num_resources = ARRAY_SIZE(ard_smsc911x_resources),
153 .resource = ard_smsc911x_resources,
154 .dev = {
155 .platform_data = &ard_smsc911x_config,
156 },
157};
158
159static const struct esdhc_platform_data mx53_ard_sd1_data __initconst = {
160 .cd_gpio = ARD_SD1_CD,
161 .wp_gpio = ARD_SD1_WP,
162};
163
164static struct imxi2c_platform_data mx53_ard_i2c2_data = {
165 .bitrate = 50000,
166};
167
168static struct imxi2c_platform_data mx53_ard_i2c3_data = {
169 .bitrate = 400000,
170};
171
172static void __init mx53_ard_io_init(void)
173{
174 gpio_request(ARD_ETHERNET_INT_B, "eth-int-b");
175 gpio_direction_input(ARD_ETHERNET_INT_B);
176
177 gpio_request(ARD_I2CPORTEXP_B, "i2cptexp-rst");
178 gpio_direction_output(ARD_I2CPORTEXP_B, 1);
179}
180
181/* Config CS1 settings for ethernet controller */
182static int weim_cs_config(void)
183{
184 u32 reg;
185 void __iomem *weim_base, *iomuxc_base;
186
187 weim_base = ioremap(MX53_WEIM_BASE_ADDR, SZ_4K);
188 if (!weim_base)
189 return -ENOMEM;
190
191 iomuxc_base = ioremap(MX53_IOMUXC_BASE_ADDR, SZ_4K);
192 if (!iomuxc_base) {
193 iounmap(weim_base);
194 return -ENOMEM;
195 }
196
197 /* CS1 timings for LAN9220 */
198 writel(0x20001, (weim_base + 0x18));
199 writel(0x0, (weim_base + 0x1C));
200 writel(0x16000202, (weim_base + 0x20));
201 writel(0x00000002, (weim_base + 0x24));
202 writel(0x16002082, (weim_base + 0x28));
203 writel(0x00000000, (weim_base + 0x2C));
204 writel(0x00000000, (weim_base + 0x90));
205
206 /* specify 64 MB on CS1 and CS0 on GPR1 */
207 reg = readl(iomuxc_base + 0x4);
208 reg &= ~0x3F;
209 reg |= 0x1B;
210 writel(reg, (iomuxc_base + 0x4));
211
212 iounmap(iomuxc_base);
213 iounmap(weim_base);
214
215 return 0;
216}
217
218static struct regulator_consumer_supply dummy_supplies[] = {
219 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
220 REGULATOR_SUPPLY("vddvario", "smsc911x"),
221};
222
223void __init imx53_ard_common_init(void)
224{
225 mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads,
226 ARRAY_SIZE(mx53_ard_pads));
227 weim_cs_config();
228}
229
230static struct platform_device *devices[] __initdata = {
231 &ard_smsc_lan9220_device,
232};
233
234static void __init mx53_ard_board_init(void)
235{
236 imx53_soc_init();
237 imx53_add_imx_uart(0, NULL);
238
239 imx53_ard_common_init();
240 mx53_ard_io_init();
241 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
242 ard_smsc911x_resources[1].start = gpio_to_irq(ARD_ETHERNET_INT_B);
243 ard_smsc911x_resources[1].end = gpio_to_irq(ARD_ETHERNET_INT_B);
244 platform_add_devices(devices, ARRAY_SIZE(devices));
245
246 imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data);
247 imx53_add_imx2_wdt(0);
248 imx53_add_imx_i2c(1, &mx53_ard_i2c2_data);
249 imx53_add_imx_i2c(2, &mx53_ard_i2c3_data);
250 imx_add_gpio_keys(&ard_button_data);
251 imx53_add_ahci_imx();
252}
253
254static void __init mx53_ard_timer_init(void)
255{
256 mx53_clocks_init(32768, 24000000, 22579200, 0);
257}
258
259static struct sys_timer mx53_ard_timer = {
260 .init = mx53_ard_timer_init,
261};
262
263MACHINE_START(MX53_ARD, "Freescale MX53 ARD Board")
264 .map_io = mx53_map_io,
265 .init_early = imx53_init_early,
266 .init_irq = mx53_init_irq,
267 .handle_irq = imx53_handle_irq,
268 .timer = &mx53_ard_timer,
269 .init_machine = mx53_ard_board_init,
270 .init_late = imx53_init_late,
271 .restart = mxc_restart,
272MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx53_evk.c b/arch/arm/mach-imx/mach-mx53_evk.c
deleted file mode 100644
index 09fe2197b49..00000000000
--- a/arch/arm/mach-imx/mach-mx53_evk.c
+++ /dev/null
@@ -1,179 +0,0 @@
1/*
2 * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2010 Yong Shen. <Yong.Shen@linaro.org>
4 */
5
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 along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21
22#include <linux/init.h>
23#include <linux/clk.h>
24#include <linux/delay.h>
25#include <linux/gpio.h>
26#include <linux/spi/flash.h>
27#include <linux/spi/spi.h>
28#include <mach/common.h>
29#include <mach/hardware.h>
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/time.h>
33#include <mach/iomux-mx53.h>
34
35#define MX53_EVK_FEC_PHY_RST IMX_GPIO_NR(7, 6)
36#define EVK_ECSPI1_CS0 IMX_GPIO_NR(2, 30)
37#define EVK_ECSPI1_CS1 IMX_GPIO_NR(3, 19)
38#define MX53EVK_LED IMX_GPIO_NR(7, 7)
39
40#include "devices-imx53.h"
41
42static iomux_v3_cfg_t mx53_evk_pads[] = {
43 MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
44 MX53_PAD_CSI0_DAT11__UART1_RXD_MUX,
45
46 MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX,
47 MX53_PAD_PATA_DMARQ__UART2_TXD_MUX,
48 MX53_PAD_PATA_DIOR__UART2_RTS,
49 MX53_PAD_PATA_INTRQ__UART2_CTS,
50
51 MX53_PAD_PATA_CS_0__UART3_TXD_MUX,
52 MX53_PAD_PATA_CS_1__UART3_RXD_MUX,
53
54 MX53_PAD_EIM_D16__ECSPI1_SCLK,
55 MX53_PAD_EIM_D17__ECSPI1_MISO,
56 MX53_PAD_EIM_D18__ECSPI1_MOSI,
57
58 /* ecspi chip select lines */
59 MX53_PAD_EIM_EB2__GPIO2_30,
60 MX53_PAD_EIM_D19__GPIO3_19,
61 /* LED */
62 MX53_PAD_PATA_DA_1__GPIO7_7,
63};
64
65static const struct imxuart_platform_data mx53_evk_uart_pdata __initconst = {
66 .flags = IMXUART_HAVE_RTSCTS,
67};
68
69static const struct gpio_led mx53evk_leds[] __initconst = {
70 {
71 .name = "green",
72 .default_trigger = "heartbeat",
73 .gpio = MX53EVK_LED,
74 },
75};
76
77static const struct gpio_led_platform_data mx53evk_leds_data __initconst = {
78 .leds = mx53evk_leds,
79 .num_leds = ARRAY_SIZE(mx53evk_leds),
80};
81
82static inline void mx53_evk_init_uart(void)
83{
84 imx53_add_imx_uart(0, NULL);
85 imx53_add_imx_uart(1, &mx53_evk_uart_pdata);
86 imx53_add_imx_uart(2, NULL);
87}
88
89static const struct imxi2c_platform_data mx53_evk_i2c_data __initconst = {
90 .bitrate = 100000,
91};
92
93static inline void mx53_evk_fec_reset(void)
94{
95 int ret;
96
97 /* reset FEC PHY */
98 ret = gpio_request_one(MX53_EVK_FEC_PHY_RST, GPIOF_OUT_INIT_LOW,
99 "fec-phy-reset");
100 if (ret) {
101 printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret);
102 return;
103 }
104 msleep(1);
105 gpio_set_value(MX53_EVK_FEC_PHY_RST, 1);
106}
107
108static const struct fec_platform_data mx53_evk_fec_pdata __initconst = {
109 .phy = PHY_INTERFACE_MODE_RMII,
110};
111
112static struct spi_board_info mx53_evk_spi_board_info[] __initdata = {
113 {
114 .modalias = "mtd_dataflash",
115 .max_speed_hz = 25000000,
116 .bus_num = 0,
117 .chip_select = 1,
118 .mode = SPI_MODE_0,
119 .platform_data = NULL,
120 },
121};
122
123static int mx53_evk_spi_cs[] = {
124 EVK_ECSPI1_CS0,
125 EVK_ECSPI1_CS1,
126};
127
128static const struct spi_imx_master mx53_evk_spi_data __initconst = {
129 .chipselect = mx53_evk_spi_cs,
130 .num_chipselect = ARRAY_SIZE(mx53_evk_spi_cs),
131};
132
133void __init imx53_evk_common_init(void)
134{
135 mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads,
136 ARRAY_SIZE(mx53_evk_pads));
137}
138
139static void __init mx53_evk_board_init(void)
140{
141 imx53_soc_init();
142 imx53_evk_common_init();
143
144 mx53_evk_init_uart();
145 mx53_evk_fec_reset();
146 imx53_add_fec(&mx53_evk_fec_pdata);
147
148 imx53_add_imx_i2c(0, &mx53_evk_i2c_data);
149 imx53_add_imx_i2c(1, &mx53_evk_i2c_data);
150
151 imx53_add_sdhci_esdhc_imx(0, NULL);
152 imx53_add_sdhci_esdhc_imx(1, NULL);
153
154 spi_register_board_info(mx53_evk_spi_board_info,
155 ARRAY_SIZE(mx53_evk_spi_board_info));
156 imx53_add_ecspi(0, &mx53_evk_spi_data);
157 imx53_add_imx2_wdt(0);
158 gpio_led_register_device(-1, &mx53evk_leds_data);
159}
160
161static void __init mx53_evk_timer_init(void)
162{
163 mx53_clocks_init(32768, 24000000, 22579200, 0);
164}
165
166static struct sys_timer mx53_evk_timer = {
167 .init = mx53_evk_timer_init,
168};
169
170MACHINE_START(MX53_EVK, "Freescale MX53 EVK Board")
171 .map_io = mx53_map_io,
172 .init_early = imx53_init_early,
173 .init_irq = mx53_init_irq,
174 .handle_irq = imx53_handle_irq,
175 .timer = &mx53_evk_timer,
176 .init_machine = mx53_evk_board_init,
177 .init_late = imx53_init_late,
178 .restart = mxc_restart,
179MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx53_loco.c b/arch/arm/mach-imx/mach-mx53_loco.c
deleted file mode 100644
index 8abe23c1d3c..00000000000
--- a/arch/arm/mach-imx/mach-mx53_loco.c
+++ /dev/null
@@ -1,321 +0,0 @@
1/*
2 * Copyright (C) 2011 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/clk.h>
23#include <linux/delay.h>
24#include <linux/gpio.h>
25#include <linux/i2c.h>
26
27#include <mach/common.h>
28#include <mach/hardware.h>
29#include <mach/iomux-mx53.h>
30
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33#include <asm/mach/time.h>
34
35#include "devices-imx53.h"
36
37#define MX53_LOCO_POWER IMX_GPIO_NR(1, 8)
38#define MX53_LOCO_UI1 IMX_GPIO_NR(2, 14)
39#define MX53_LOCO_UI2 IMX_GPIO_NR(2, 15)
40#define LOCO_FEC_PHY_RST IMX_GPIO_NR(7, 6)
41#define LOCO_LED IMX_GPIO_NR(7, 7)
42#define LOCO_SD3_CD IMX_GPIO_NR(3, 11)
43#define LOCO_SD3_WP IMX_GPIO_NR(3, 12)
44#define LOCO_SD1_CD IMX_GPIO_NR(3, 13)
45#define LOCO_ACCEL_EN IMX_GPIO_NR(6, 14)
46
47static iomux_v3_cfg_t mx53_loco_pads[] = {
48 /* FEC */
49 MX53_PAD_FEC_MDC__FEC_MDC,
50 MX53_PAD_FEC_MDIO__FEC_MDIO,
51 MX53_PAD_FEC_REF_CLK__FEC_TX_CLK,
52 MX53_PAD_FEC_RX_ER__FEC_RX_ER,
53 MX53_PAD_FEC_CRS_DV__FEC_RX_DV,
54 MX53_PAD_FEC_RXD1__FEC_RDATA_1,
55 MX53_PAD_FEC_RXD0__FEC_RDATA_0,
56 MX53_PAD_FEC_TX_EN__FEC_TX_EN,
57 MX53_PAD_FEC_TXD1__FEC_TDATA_1,
58 MX53_PAD_FEC_TXD0__FEC_TDATA_0,
59 /* FEC_nRST */
60 MX53_PAD_PATA_DA_0__GPIO7_6,
61 /* FEC_nINT */
62 MX53_PAD_PATA_DATA4__GPIO2_4,
63 /* AUDMUX5 */
64 MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC,
65 MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD,
66 MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS,
67 MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD,
68 /* I2C1 */
69 MX53_PAD_CSI0_DAT8__I2C1_SDA,
70 MX53_PAD_CSI0_DAT9__I2C1_SCL,
71 MX53_PAD_NANDF_CS1__GPIO6_14, /* Accelerometer Enable */
72 /* I2C2 */
73 MX53_PAD_KEY_COL3__I2C2_SCL,
74 MX53_PAD_KEY_ROW3__I2C2_SDA,
75 /* SD1 */
76 MX53_PAD_SD1_CMD__ESDHC1_CMD,
77 MX53_PAD_SD1_CLK__ESDHC1_CLK,
78 MX53_PAD_SD1_DATA0__ESDHC1_DAT0,
79 MX53_PAD_SD1_DATA1__ESDHC1_DAT1,
80 MX53_PAD_SD1_DATA2__ESDHC1_DAT2,
81 MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
82 /* SD1_CD */
83 MX53_PAD_EIM_DA13__GPIO3_13,
84 /* SD3 */
85 MX53_PAD_PATA_DATA8__ESDHC3_DAT0,
86 MX53_PAD_PATA_DATA9__ESDHC3_DAT1,
87 MX53_PAD_PATA_DATA10__ESDHC3_DAT2,
88 MX53_PAD_PATA_DATA11__ESDHC3_DAT3,
89 MX53_PAD_PATA_DATA0__ESDHC3_DAT4,
90 MX53_PAD_PATA_DATA1__ESDHC3_DAT5,
91 MX53_PAD_PATA_DATA2__ESDHC3_DAT6,
92 MX53_PAD_PATA_DATA3__ESDHC3_DAT7,
93 MX53_PAD_PATA_IORDY__ESDHC3_CLK,
94 MX53_PAD_PATA_RESET_B__ESDHC3_CMD,
95 /* SD3_CD */
96 MX53_PAD_EIM_DA11__GPIO3_11,
97 /* SD3_WP */
98 MX53_PAD_EIM_DA12__GPIO3_12,
99 /* VGA */
100 MX53_PAD_EIM_OE__IPU_DI1_PIN7,
101 MX53_PAD_EIM_RW__IPU_DI1_PIN8,
102 /* DISPLB */
103 MX53_PAD_EIM_D20__IPU_SER_DISP0_CS,
104 MX53_PAD_EIM_D21__IPU_DISPB0_SER_CLK,
105 MX53_PAD_EIM_D22__IPU_DISPB0_SER_DIN,
106 MX53_PAD_EIM_D23__IPU_DI0_D0_CS,
107 /* DISP0_POWER_EN */
108 MX53_PAD_EIM_D24__GPIO3_24,
109 /* DISP0 DET INT */
110 MX53_PAD_EIM_D31__GPIO3_31,
111 /* LVDS */
112 MX53_PAD_LVDS0_TX3_P__LDB_LVDS0_TX3,
113 MX53_PAD_LVDS0_CLK_P__LDB_LVDS0_CLK,
114 MX53_PAD_LVDS0_TX2_P__LDB_LVDS0_TX2,
115 MX53_PAD_LVDS0_TX1_P__LDB_LVDS0_TX1,
116 MX53_PAD_LVDS0_TX0_P__LDB_LVDS0_TX0,
117 MX53_PAD_LVDS1_TX3_P__LDB_LVDS1_TX3,
118 MX53_PAD_LVDS1_TX2_P__LDB_LVDS1_TX2,
119 MX53_PAD_LVDS1_CLK_P__LDB_LVDS1_CLK,
120 MX53_PAD_LVDS1_TX1_P__LDB_LVDS1_TX1,
121 MX53_PAD_LVDS1_TX0_P__LDB_LVDS1_TX0,
122 /* I2C1 */
123 MX53_PAD_CSI0_DAT8__I2C1_SDA,
124 MX53_PAD_CSI0_DAT9__I2C1_SCL,
125 /* UART1 */
126 MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
127 MX53_PAD_CSI0_DAT11__UART1_RXD_MUX,
128 /* CSI0 */
129 MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12,
130 MX53_PAD_CSI0_DAT13__IPU_CSI0_D_13,
131 MX53_PAD_CSI0_DAT14__IPU_CSI0_D_14,
132 MX53_PAD_CSI0_DAT15__IPU_CSI0_D_15,
133 MX53_PAD_CSI0_DAT16__IPU_CSI0_D_16,
134 MX53_PAD_CSI0_DAT17__IPU_CSI0_D_17,
135 MX53_PAD_CSI0_DAT18__IPU_CSI0_D_18,
136 MX53_PAD_CSI0_DAT19__IPU_CSI0_D_19,
137 MX53_PAD_CSI0_VSYNC__IPU_CSI0_VSYNC,
138 MX53_PAD_CSI0_MCLK__IPU_CSI0_HSYNC,
139 MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK,
140 /* DISPLAY */
141 MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK,
142 MX53_PAD_DI0_PIN15__IPU_DI0_PIN15,
143 MX53_PAD_DI0_PIN2__IPU_DI0_PIN2,
144 MX53_PAD_DI0_PIN3__IPU_DI0_PIN3,
145 MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0,
146 MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1,
147 MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2,
148 MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3,
149 MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4,
150 MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5,
151 MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6,
152 MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7,
153 MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8,
154 MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9,
155 MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10,
156 MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11,
157 MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12,
158 MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13,
159 MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14,
160 MX53_PAD_DISP0_DAT15__IPU_DISP0_DAT_15,
161 MX53_PAD_DISP0_DAT16__IPU_DISP0_DAT_16,
162 MX53_PAD_DISP0_DAT17__IPU_DISP0_DAT_17,
163 MX53_PAD_DISP0_DAT18__IPU_DISP0_DAT_18,
164 MX53_PAD_DISP0_DAT19__IPU_DISP0_DAT_19,
165 MX53_PAD_DISP0_DAT20__IPU_DISP0_DAT_20,
166 MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21,
167 MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22,
168 MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23,
169 /* Audio CLK*/
170 MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK,
171 /* PWM */
172 MX53_PAD_GPIO_1__PWM2_PWMO,
173 /* SPDIF */
174 MX53_PAD_GPIO_7__SPDIF_PLOCK,
175 MX53_PAD_GPIO_17__SPDIF_OUT1,
176 /* GPIO */
177 MX53_PAD_PATA_DA_1__GPIO7_7, /* LED */
178 MX53_PAD_PATA_DA_2__GPIO7_8,
179 MX53_PAD_PATA_DATA5__GPIO2_5,
180 MX53_PAD_PATA_DATA6__GPIO2_6,
181 MX53_PAD_PATA_DATA14__GPIO2_14,
182 MX53_PAD_PATA_DATA15__GPIO2_15,
183 MX53_PAD_PATA_INTRQ__GPIO7_2,
184 MX53_PAD_EIM_WAIT__GPIO5_0,
185 MX53_PAD_NANDF_WP_B__GPIO6_9,
186 MX53_PAD_NANDF_RB0__GPIO6_10,
187 MX53_PAD_NANDF_CS1__GPIO6_14,
188 MX53_PAD_NANDF_CS2__GPIO6_15,
189 MX53_PAD_NANDF_CS3__GPIO6_16,
190 MX53_PAD_GPIO_5__GPIO1_5,
191 MX53_PAD_GPIO_16__GPIO7_11,
192 MX53_PAD_GPIO_8__GPIO1_8,
193};
194
195#define GPIO_BUTTON(gpio_num, ev_code, act_low, descr, wake) \
196{ \
197 .gpio = gpio_num, \
198 .type = EV_KEY, \
199 .code = ev_code, \
200 .active_low = act_low, \
201 .desc = "btn " descr, \
202 .wakeup = wake, \
203}
204
205static struct gpio_keys_button loco_buttons[] = {
206 GPIO_BUTTON(MX53_LOCO_POWER, KEY_POWER, 1, "power", 0),
207 GPIO_BUTTON(MX53_LOCO_UI1, KEY_VOLUMEUP, 1, "volume-up", 0),
208 GPIO_BUTTON(MX53_LOCO_UI2, KEY_VOLUMEDOWN, 1, "volume-down", 0),
209};
210
211static const struct gpio_keys_platform_data loco_button_data __initconst = {
212 .buttons = loco_buttons,
213 .nbuttons = ARRAY_SIZE(loco_buttons),
214};
215
216static const struct esdhc_platform_data mx53_loco_sd1_data __initconst = {
217 .cd_gpio = LOCO_SD1_CD,
218 .cd_type = ESDHC_CD_GPIO,
219 .wp_type = ESDHC_WP_NONE,
220};
221
222static const struct esdhc_platform_data mx53_loco_sd3_data __initconst = {
223 .cd_gpio = LOCO_SD3_CD,
224 .wp_gpio = LOCO_SD3_WP,
225 .cd_type = ESDHC_CD_GPIO,
226 .wp_type = ESDHC_WP_GPIO,
227};
228
229static inline void mx53_loco_fec_reset(void)
230{
231 int ret;
232
233 /* reset FEC PHY */
234 ret = gpio_request(LOCO_FEC_PHY_RST, "fec-phy-reset");
235 if (ret) {
236 printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret);
237 return;
238 }
239 gpio_direction_output(LOCO_FEC_PHY_RST, 0);
240 msleep(1);
241 gpio_set_value(LOCO_FEC_PHY_RST, 1);
242}
243
244static const struct fec_platform_data mx53_loco_fec_data __initconst = {
245 .phy = PHY_INTERFACE_MODE_RMII,
246};
247
248static const struct imxi2c_platform_data mx53_loco_i2c_data __initconst = {
249 .bitrate = 100000,
250};
251
252static const struct gpio_led mx53loco_leds[] __initconst = {
253 {
254 .name = "green",
255 .default_trigger = "heartbeat",
256 .gpio = LOCO_LED,
257 },
258};
259
260static const struct gpio_led_platform_data mx53loco_leds_data __initconst = {
261 .leds = mx53loco_leds,
262 .num_leds = ARRAY_SIZE(mx53loco_leds),
263};
264
265void __init imx53_qsb_common_init(void)
266{
267 mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
268 ARRAY_SIZE(mx53_loco_pads));
269}
270
271static struct i2c_board_info mx53loco_i2c_devices[] = {
272 {
273 I2C_BOARD_INFO("mma8450", 0x1C),
274 },
275};
276
277static void __init mx53_loco_board_init(void)
278{
279 int ret;
280 imx53_soc_init();
281 imx53_qsb_common_init();
282
283 imx53_add_imx_uart(0, NULL);
284 mx53_loco_fec_reset();
285 imx53_add_fec(&mx53_loco_fec_data);
286 imx53_add_imx2_wdt(0);
287
288 ret = gpio_request_one(LOCO_ACCEL_EN, GPIOF_OUT_INIT_HIGH, "accel_en");
289 if (ret)
290 pr_err("Cannot request ACCEL_EN pin: %d\n", ret);
291
292 i2c_register_board_info(0, mx53loco_i2c_devices,
293 ARRAY_SIZE(mx53loco_i2c_devices));
294 imx53_add_imx_i2c(0, &mx53_loco_i2c_data);
295 imx53_add_imx_i2c(1, &mx53_loco_i2c_data);
296 imx53_add_sdhci_esdhc_imx(0, &mx53_loco_sd1_data);
297 imx53_add_sdhci_esdhc_imx(2, &mx53_loco_sd3_data);
298 imx_add_gpio_keys(&loco_button_data);
299 gpio_led_register_device(-1, &mx53loco_leds_data);
300 imx53_add_ahci_imx();
301}
302
303static void __init mx53_loco_timer_init(void)
304{
305 mx53_clocks_init(32768, 24000000, 0, 0);
306}
307
308static struct sys_timer mx53_loco_timer = {
309 .init = mx53_loco_timer_init,
310};
311
312MACHINE_START(MX53_LOCO, "Freescale MX53 LOCO Board")
313 .map_io = mx53_map_io,
314 .init_early = imx53_init_early,
315 .init_irq = mx53_init_irq,
316 .handle_irq = imx53_handle_irq,
317 .timer = &mx53_loco_timer,
318 .init_machine = mx53_loco_board_init,
319 .init_late = imx53_init_late,
320 .restart = mxc_restart,
321MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx53_smd.c b/arch/arm/mach-imx/mach-mx53_smd.c
deleted file mode 100644
index b15d6a6d3b6..00000000000
--- a/arch/arm/mach-imx/mach-mx53_smd.c
+++ /dev/null
@@ -1,168 +0,0 @@
1/*
2 * Copyright (C) 2011 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/clk.h>
23#include <linux/delay.h>
24#include <linux/gpio.h>
25
26#include <mach/common.h>
27#include <mach/hardware.h>
28#include <mach/iomux-mx53.h>
29
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/time.h>
33
34#include "devices-imx53.h"
35
36#define SMD_FEC_PHY_RST IMX_GPIO_NR(7, 6)
37#define MX53_SMD_SATA_PWR_EN IMX_GPIO_NR(3, 3)
38
39static iomux_v3_cfg_t mx53_smd_pads[] = {
40 MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
41 MX53_PAD_CSI0_DAT11__UART1_RXD_MUX,
42
43 MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX,
44 MX53_PAD_PATA_DMARQ__UART2_TXD_MUX,
45
46 MX53_PAD_PATA_CS_0__UART3_TXD_MUX,
47 MX53_PAD_PATA_CS_1__UART3_RXD_MUX,
48 MX53_PAD_PATA_DA_1__UART3_CTS,
49 MX53_PAD_PATA_DA_2__UART3_RTS,
50 /* I2C1 */
51 MX53_PAD_CSI0_DAT8__I2C1_SDA,
52 MX53_PAD_CSI0_DAT9__I2C1_SCL,
53 /* SD1 */
54 MX53_PAD_SD1_CMD__ESDHC1_CMD,
55 MX53_PAD_SD1_CLK__ESDHC1_CLK,
56 MX53_PAD_SD1_DATA0__ESDHC1_DAT0,
57 MX53_PAD_SD1_DATA1__ESDHC1_DAT1,
58 MX53_PAD_SD1_DATA2__ESDHC1_DAT2,
59 MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
60 /* SD2 */
61 MX53_PAD_SD2_CMD__ESDHC2_CMD,
62 MX53_PAD_SD2_CLK__ESDHC2_CLK,
63 MX53_PAD_SD2_DATA0__ESDHC2_DAT0,
64 MX53_PAD_SD2_DATA1__ESDHC2_DAT1,
65 MX53_PAD_SD2_DATA2__ESDHC2_DAT2,
66 MX53_PAD_SD2_DATA3__ESDHC2_DAT3,
67 /* SD3 */
68 MX53_PAD_PATA_DATA8__ESDHC3_DAT0,
69 MX53_PAD_PATA_DATA9__ESDHC3_DAT1,
70 MX53_PAD_PATA_DATA10__ESDHC3_DAT2,
71 MX53_PAD_PATA_DATA11__ESDHC3_DAT3,
72 MX53_PAD_PATA_DATA0__ESDHC3_DAT4,
73 MX53_PAD_PATA_DATA1__ESDHC3_DAT5,
74 MX53_PAD_PATA_DATA2__ESDHC3_DAT6,
75 MX53_PAD_PATA_DATA3__ESDHC3_DAT7,
76 MX53_PAD_PATA_IORDY__ESDHC3_CLK,
77 MX53_PAD_PATA_RESET_B__ESDHC3_CMD,
78};
79
80static const struct imxuart_platform_data mx53_smd_uart_data __initconst = {
81 .flags = IMXUART_HAVE_RTSCTS,
82};
83
84static inline void mx53_smd_init_uart(void)
85{
86 imx53_add_imx_uart(0, NULL);
87 imx53_add_imx_uart(1, NULL);
88 imx53_add_imx_uart(2, &mx53_smd_uart_data);
89}
90
91static inline void mx53_smd_fec_reset(void)
92{
93 int ret;
94
95 /* reset FEC PHY */
96 ret = gpio_request(SMD_FEC_PHY_RST, "fec-phy-reset");
97 if (ret) {
98 printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret);
99 return;
100 }
101 gpio_direction_output(SMD_FEC_PHY_RST, 0);
102 msleep(1);
103 gpio_set_value(SMD_FEC_PHY_RST, 1);
104}
105
106static const struct fec_platform_data mx53_smd_fec_data __initconst = {
107 .phy = PHY_INTERFACE_MODE_RMII,
108};
109
110static const struct imxi2c_platform_data mx53_smd_i2c_data __initconst = {
111 .bitrate = 100000,
112};
113
114static inline void mx53_smd_ahci_pwr_on(void)
115{
116 int ret;
117
118 /* Enable SATA PWR */
119 ret = gpio_request_one(MX53_SMD_SATA_PWR_EN,
120 GPIOF_DIR_OUT | GPIOF_INIT_HIGH, "ahci-sata-pwr");
121 if (ret) {
122 pr_err("failed to enable SATA_PWR_EN: %d\n", ret);
123 return;
124 }
125}
126
127void __init imx53_smd_common_init(void)
128{
129 mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads,
130 ARRAY_SIZE(mx53_smd_pads));
131}
132
133static void __init mx53_smd_board_init(void)
134{
135 imx53_soc_init();
136 imx53_smd_common_init();
137
138 mx53_smd_init_uart();
139 mx53_smd_fec_reset();
140 imx53_add_fec(&mx53_smd_fec_data);
141 imx53_add_imx2_wdt(0);
142 imx53_add_imx_i2c(0, &mx53_smd_i2c_data);
143 imx53_add_sdhci_esdhc_imx(0, NULL);
144 imx53_add_sdhci_esdhc_imx(1, NULL);
145 imx53_add_sdhci_esdhc_imx(2, NULL);
146 mx53_smd_ahci_pwr_on();
147 imx53_add_ahci_imx();
148}
149
150static void __init mx53_smd_timer_init(void)
151{
152 mx53_clocks_init(32768, 24000000, 22579200, 0);
153}
154
155static struct sys_timer mx53_smd_timer = {
156 .init = mx53_smd_timer_init,
157};
158
159MACHINE_START(MX53_SMD, "Freescale MX53 SMD Board")
160 .map_io = mx53_map_io,
161 .init_early = imx53_init_early,
162 .init_irq = mx53_init_irq,
163 .handle_irq = imx53_handle_irq,
164 .timer = &mx53_smd_timer,
165 .init_machine = mx53_smd_board_init,
166 .init_late = imx53_init_late,
167 .restart = mxc_restart,
168MACHINE_END
diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c
index 52d8f534be1..acb0aadb425 100644
--- a/arch/arm/mach-imx/mm-imx5.c
+++ b/arch/arm/mach-imx/mm-imx5.c
@@ -128,25 +128,6 @@ static struct sdma_platform_data imx51_sdma_pdata __initdata = {
128 .script_addrs = &imx51_sdma_script, 128 .script_addrs = &imx51_sdma_script,
129}; 129};
130 130
131static struct sdma_script_start_addrs imx53_sdma_script __initdata = {
132 .ap_2_ap_addr = 642,
133 .app_2_mcu_addr = 683,
134 .mcu_2_app_addr = 747,
135 .uart_2_mcu_addr = 817,
136 .shp_2_mcu_addr = 891,
137 .mcu_2_shp_addr = 960,
138 .uartsh_2_mcu_addr = 1032,
139 .spdif_2_mcu_addr = 1100,
140 .mcu_2_spdif_addr = 1134,
141 .firi_2_mcu_addr = 1193,
142 .mcu_2_firi_addr = 1290,
143};
144
145static struct sdma_platform_data imx53_sdma_pdata __initdata = {
146 .fw_name = "sdma-imx53.bin",
147 .script_addrs = &imx53_sdma_script,
148};
149
150static const struct resource imx50_audmux_res[] __initconst = { 131static const struct resource imx50_audmux_res[] __initconst = {
151 DEFINE_RES_MEM(MX50_AUDMUX_BASE_ADDR, SZ_16K), 132 DEFINE_RES_MEM(MX50_AUDMUX_BASE_ADDR, SZ_16K),
152}; 133};
@@ -155,10 +136,6 @@ static const struct resource imx51_audmux_res[] __initconst = {
155 DEFINE_RES_MEM(MX51_AUDMUX_BASE_ADDR, SZ_16K), 136 DEFINE_RES_MEM(MX51_AUDMUX_BASE_ADDR, SZ_16K),
156}; 137};
157 138
158static const struct resource imx53_audmux_res[] __initconst = {
159 DEFINE_RES_MEM(MX53_AUDMUX_BASE_ADDR, SZ_16K),
160};
161
162void __init imx50_soc_init(void) 139void __init imx50_soc_init(void)
163{ 140{
164 /* i.mx50 has the i.mx35 type gpio */ 141 /* i.mx50 has the i.mx35 type gpio */
@@ -196,30 +173,6 @@ void __init imx51_soc_init(void)
196 ARRAY_SIZE(imx51_audmux_res)); 173 ARRAY_SIZE(imx51_audmux_res));
197} 174}
198 175
199void __init imx53_soc_init(void)
200{
201 /* i.mx53 has the i.mx35 type gpio */
202 mxc_register_gpio("imx35-gpio", 0, MX53_GPIO1_BASE_ADDR, SZ_16K, MX53_INT_GPIO1_LOW, MX53_INT_GPIO1_HIGH);
203 mxc_register_gpio("imx35-gpio", 1, MX53_GPIO2_BASE_ADDR, SZ_16K, MX53_INT_GPIO2_LOW, MX53_INT_GPIO2_HIGH);
204 mxc_register_gpio("imx35-gpio", 2, MX53_GPIO3_BASE_ADDR, SZ_16K, MX53_INT_GPIO3_LOW, MX53_INT_GPIO3_HIGH);
205 mxc_register_gpio("imx35-gpio", 3, MX53_GPIO4_BASE_ADDR, SZ_16K, MX53_INT_GPIO4_LOW, MX53_INT_GPIO4_HIGH);
206 mxc_register_gpio("imx35-gpio", 4, MX53_GPIO5_BASE_ADDR, SZ_16K, MX53_INT_GPIO5_LOW, MX53_INT_GPIO5_HIGH);
207 mxc_register_gpio("imx35-gpio", 5, MX53_GPIO6_BASE_ADDR, SZ_16K, MX53_INT_GPIO6_LOW, MX53_INT_GPIO6_HIGH);
208 mxc_register_gpio("imx35-gpio", 6, MX53_GPIO7_BASE_ADDR, SZ_16K, MX53_INT_GPIO7_LOW, MX53_INT_GPIO7_HIGH);
209
210 pinctrl_provide_dummies();
211 /* i.mx53 has the i.mx35 type sdma */
212 imx_add_imx_sdma("imx35-sdma", MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata);
213
214 /* Setup AIPS registers */
215 imx_set_aips(MX53_IO_ADDRESS(MX53_AIPS1_BASE_ADDR));
216 imx_set_aips(MX53_IO_ADDRESS(MX53_AIPS2_BASE_ADDR));
217
218 /* i.mx53 has the i.mx31 type audmux */
219 platform_device_register_simple("imx31-audmux", 0, imx53_audmux_res,
220 ARRAY_SIZE(imx53_audmux_res));
221}
222
223void __init imx51_init_late(void) 176void __init imx51_init_late(void)
224{ 177{
225 mx51_neon_fixup(); 178 mx51_neon_fixup();
diff --git a/arch/arm/mach-imx/mx1-camera-fiq-ksym.c b/arch/arm/mach-imx/mx1-camera-fiq-ksym.c
index b09ee12a4ff..fb38436ca67 100644
--- a/arch/arm/mach-imx/mx1-camera-fiq-ksym.c
+++ b/arch/arm/mach-imx/mx1-camera-fiq-ksym.c
@@ -11,7 +11,7 @@
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <linux/module.h> 12#include <linux/module.h>
13 13
14#include <mach/mx1_camera.h> 14#include <linux/platform_data/camera-mx1.h>
15 15
16/* IMX camera FIQ handler */ 16/* IMX camera FIQ handler */
17EXPORT_SYMBOL(mx1_camera_sof_fiq_start); 17EXPORT_SYMBOL(mx1_camera_sof_fiq_start);
diff --git a/arch/arm/mach-imx/mx51_efika.c b/arch/arm/mach-imx/mx51_efika.c
deleted file mode 100644
index ee870c49bc6..00000000000
--- a/arch/arm/mach-imx/mx51_efika.c
+++ /dev/null
@@ -1,633 +0,0 @@
1/*
2 * based on code from the following
3 * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
4 * Copyright 2009-2010 Pegatron Corporation. All Rights Reserved.
5 * Copyright 2009-2010 Genesi USA, Inc. All Rights Reserved.
6 *
7 * The code contained herein is licensed under the GNU General Public
8 * License. You may obtain a copy of the GNU General Public License
9 * Version 2 or later at the following locations:
10 *
11 * http://www.opensource.org/licenses/gpl-license.html
12 * http://www.gnu.org/copyleft/gpl.html
13 */
14
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/i2c.h>
18#include <linux/gpio.h>
19#include <linux/leds.h>
20#include <linux/input.h>
21#include <linux/delay.h>
22#include <linux/io.h>
23#include <linux/spi/flash.h>
24#include <linux/spi/spi.h>
25#include <linux/mfd/mc13892.h>
26#include <linux/regulator/machine.h>
27#include <linux/regulator/consumer.h>
28
29#include <mach/common.h>
30#include <mach/hardware.h>
31#include <mach/iomux-mx51.h>
32
33#include <linux/usb/otg.h>
34#include <linux/usb/ulpi.h>
35#include <mach/ulpi.h>
36
37#include <asm/setup.h>
38#include <asm/mach-types.h>
39#include <asm/mach/arch.h>
40#include <asm/mach/time.h>
41
42#include "devices-imx51.h"
43#include "efika.h"
44#include "cpu_op-mx51.h"
45
46#define MX51_USB_CTRL_1_OFFSET 0x10
47#define MX51_USB_CTRL_UH1_EXT_CLK_EN (1 << 25)
48#define MX51_USB_PLL_DIV_19_2_MHZ 0x01
49
50#define EFIKAMX_USB_HUB_RESET IMX_GPIO_NR(1, 5)
51#define EFIKAMX_USBH1_STP IMX_GPIO_NR(1, 27)
52
53#define EFIKAMX_SPI_CS0 IMX_GPIO_NR(4, 24)
54#define EFIKAMX_SPI_CS1 IMX_GPIO_NR(4, 25)
55
56#define EFIKAMX_PMIC IMX_GPIO_NR(1, 6)
57
58static iomux_v3_cfg_t mx51efika_pads[] = {
59 /* UART1 */
60 MX51_PAD_UART1_RXD__UART1_RXD,
61 MX51_PAD_UART1_TXD__UART1_TXD,
62 MX51_PAD_UART1_RTS__UART1_RTS,
63 MX51_PAD_UART1_CTS__UART1_CTS,
64
65 /* SD 1 */
66 MX51_PAD_SD1_CMD__SD1_CMD,
67 MX51_PAD_SD1_CLK__SD1_CLK,
68 MX51_PAD_SD1_DATA0__SD1_DATA0,
69 MX51_PAD_SD1_DATA1__SD1_DATA1,
70 MX51_PAD_SD1_DATA2__SD1_DATA2,
71 MX51_PAD_SD1_DATA3__SD1_DATA3,
72
73 /* SD 2 */
74 MX51_PAD_SD2_CMD__SD2_CMD,
75 MX51_PAD_SD2_CLK__SD2_CLK,
76 MX51_PAD_SD2_DATA0__SD2_DATA0,
77 MX51_PAD_SD2_DATA1__SD2_DATA1,
78 MX51_PAD_SD2_DATA2__SD2_DATA2,
79 MX51_PAD_SD2_DATA3__SD2_DATA3,
80
81 /* SD/MMC WP/CD */
82 MX51_PAD_GPIO1_0__SD1_CD,
83 MX51_PAD_GPIO1_1__SD1_WP,
84 MX51_PAD_GPIO1_7__SD2_WP,
85 MX51_PAD_GPIO1_8__SD2_CD,
86
87 /* spi */
88 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI,
89 MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
90 MX51_PAD_CSPI1_SS0__GPIO4_24,
91 MX51_PAD_CSPI1_SS1__GPIO4_25,
92 MX51_PAD_CSPI1_RDY__ECSPI1_RDY,
93 MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
94 MX51_PAD_GPIO1_6__GPIO1_6,
95
96 /* USB HOST1 */
97 MX51_PAD_USBH1_CLK__USBH1_CLK,
98 MX51_PAD_USBH1_DIR__USBH1_DIR,
99 MX51_PAD_USBH1_NXT__USBH1_NXT,
100 MX51_PAD_USBH1_DATA0__USBH1_DATA0,
101 MX51_PAD_USBH1_DATA1__USBH1_DATA1,
102 MX51_PAD_USBH1_DATA2__USBH1_DATA2,
103 MX51_PAD_USBH1_DATA3__USBH1_DATA3,
104 MX51_PAD_USBH1_DATA4__USBH1_DATA4,
105 MX51_PAD_USBH1_DATA5__USBH1_DATA5,
106 MX51_PAD_USBH1_DATA6__USBH1_DATA6,
107 MX51_PAD_USBH1_DATA7__USBH1_DATA7,
108
109 /* USB HUB RESET */
110 MX51_PAD_GPIO1_5__GPIO1_5,
111
112 /* WLAN */
113 MX51_PAD_EIM_A22__GPIO2_16,
114 MX51_PAD_EIM_A16__GPIO2_10,
115
116 /* USB PHY RESET */
117 MX51_PAD_EIM_D27__GPIO2_9,
118};
119
120/* Serial ports */
121static const struct imxuart_platform_data uart_pdata = {
122 .flags = IMXUART_HAVE_RTSCTS,
123};
124
125/* This function is board specific as the bit mask for the plldiv will also
126 * be different for other Freescale SoCs, thus a common bitmask is not
127 * possible and cannot get place in /plat-mxc/ehci.c.
128 */
129static int initialize_otg_port(struct platform_device *pdev)
130{
131 u32 v;
132 void __iomem *usb_base;
133 void __iomem *usbother_base;
134 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
135 if (!usb_base)
136 return -ENOMEM;
137 usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET);
138
139 /* Set the PHY clock to 19.2MHz */
140 v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
141 v &= ~MX5_USB_UTMI_PHYCTRL1_PLLDIV_MASK;
142 v |= MX51_USB_PLL_DIV_19_2_MHZ;
143 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
144 iounmap(usb_base);
145
146 mdelay(10);
147
148 return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY);
149}
150
151static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
152 .init = initialize_otg_port,
153 .portsc = MXC_EHCI_UTMI_16BIT,
154};
155
156static int initialize_usbh1_port(struct platform_device *pdev)
157{
158 iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP;
159 iomux_v3_cfg_t usbh1gpio = MX51_PAD_USBH1_STP__GPIO1_27;
160 u32 v;
161 void __iomem *usb_base;
162 void __iomem *socregs_base;
163
164 mxc_iomux_v3_setup_pad(usbh1gpio);
165 gpio_request(EFIKAMX_USBH1_STP, "usbh1_stp");
166 gpio_direction_output(EFIKAMX_USBH1_STP, 0);
167 msleep(1);
168 gpio_set_value(EFIKAMX_USBH1_STP, 1);
169 msleep(1);
170
171 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
172 socregs_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET);
173
174 /* The clock for the USBH1 ULPI port will come externally */
175 /* from the PHY. */
176 v = __raw_readl(socregs_base + MX51_USB_CTRL_1_OFFSET);
177 __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN,
178 socregs_base + MX51_USB_CTRL_1_OFFSET);
179
180 iounmap(usb_base);
181
182 gpio_free(EFIKAMX_USBH1_STP);
183 mxc_iomux_v3_setup_pad(usbh1stp);
184
185 mdelay(10);
186
187 return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_ITC_NO_THRESHOLD);
188}
189
190static struct mxc_usbh_platform_data usbh1_config __initdata = {
191 .init = initialize_usbh1_port,
192 .portsc = MXC_EHCI_MODE_ULPI,
193};
194
195static void mx51_efika_hubreset(void)
196{
197 gpio_request(EFIKAMX_USB_HUB_RESET, "usb_hub_rst");
198 gpio_direction_output(EFIKAMX_USB_HUB_RESET, 1);
199 msleep(1);
200 gpio_set_value(EFIKAMX_USB_HUB_RESET, 0);
201 msleep(1);
202 gpio_set_value(EFIKAMX_USB_HUB_RESET, 1);
203}
204
205static void __init mx51_efika_usb(void)
206{
207 mx51_efika_hubreset();
208
209 /* pulling it low, means no USB at all... */
210 gpio_request(EFIKA_USB_PHY_RESET, "usb_phy_reset");
211 gpio_direction_output(EFIKA_USB_PHY_RESET, 0);
212 msleep(1);
213 gpio_set_value(EFIKA_USB_PHY_RESET, 1);
214
215 usbh1_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
216 ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND);
217
218 imx51_add_mxc_ehci_otg(&dr_utmi_config);
219 if (usbh1_config.otg)
220 imx51_add_mxc_ehci_hs(1, &usbh1_config);
221}
222
223static struct mtd_partition mx51_efika_spi_nor_partitions[] = {
224 {
225 .name = "u-boot",
226 .offset = 0,
227 .size = SZ_256K,
228 },
229 {
230 .name = "config",
231 .offset = MTDPART_OFS_APPEND,
232 .size = SZ_64K,
233 },
234};
235
236static struct flash_platform_data mx51_efika_spi_flash_data = {
237 .name = "spi_flash",
238 .parts = mx51_efika_spi_nor_partitions,
239 .nr_parts = ARRAY_SIZE(mx51_efika_spi_nor_partitions),
240 .type = "sst25vf032b",
241};
242
243static struct regulator_consumer_supply sw1_consumers[] = {
244 {
245 .supply = "cpu_vcc",
246 }
247};
248
249static struct regulator_consumer_supply vdig_consumers[] = {
250 /* sgtl5000 */
251 REGULATOR_SUPPLY("VDDA", "1-000a"),
252 REGULATOR_SUPPLY("VDDD", "1-000a"),
253};
254
255static struct regulator_consumer_supply vvideo_consumers[] = {
256 /* sgtl5000 */
257 REGULATOR_SUPPLY("VDDIO", "1-000a"),
258};
259
260static struct regulator_consumer_supply vsd_consumers[] = {
261 REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx51.0"),
262 REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx51.1"),
263};
264
265static struct regulator_consumer_supply pwgt1_consumer[] = {
266 {
267 .supply = "pwgt1",
268 }
269};
270
271static struct regulator_consumer_supply pwgt2_consumer[] = {
272 {
273 .supply = "pwgt2",
274 }
275};
276
277static struct regulator_consumer_supply coincell_consumer[] = {
278 {
279 .supply = "coincell",
280 }
281};
282
283static struct regulator_init_data sw1_init = {
284 .constraints = {
285 .name = "SW1",
286 .min_uV = 600000,
287 .max_uV = 1375000,
288 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
289 .valid_modes_mask = 0,
290 .always_on = 1,
291 .boot_on = 1,
292 .state_mem = {
293 .uV = 850000,
294 .mode = REGULATOR_MODE_NORMAL,
295 .enabled = 1,
296 },
297 },
298 .num_consumer_supplies = ARRAY_SIZE(sw1_consumers),
299 .consumer_supplies = sw1_consumers,
300};
301
302static struct regulator_init_data sw2_init = {
303 .constraints = {
304 .name = "SW2",
305 .min_uV = 900000,
306 .max_uV = 1850000,
307 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
308 .always_on = 1,
309 .boot_on = 1,
310 .state_mem = {
311 .uV = 950000,
312 .mode = REGULATOR_MODE_NORMAL,
313 .enabled = 1,
314 },
315 }
316};
317
318static struct regulator_init_data sw3_init = {
319 .constraints = {
320 .name = "SW3",
321 .min_uV = 1100000,
322 .max_uV = 1850000,
323 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
324 .always_on = 1,
325 .boot_on = 1,
326 }
327};
328
329static struct regulator_init_data sw4_init = {
330 .constraints = {
331 .name = "SW4",
332 .min_uV = 1100000,
333 .max_uV = 1850000,
334 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
335 .always_on = 1,
336 .boot_on = 1,
337 }
338};
339
340static struct regulator_init_data viohi_init = {
341 .constraints = {
342 .name = "VIOHI",
343 .boot_on = 1,
344 .always_on = 1,
345 }
346};
347
348static struct regulator_init_data vusb_init = {
349 .constraints = {
350 .name = "VUSB",
351 .boot_on = 1,
352 .always_on = 1,
353 }
354};
355
356static struct regulator_init_data swbst_init = {
357 .constraints = {
358 .name = "SWBST",
359 }
360};
361
362static struct regulator_init_data vdig_init = {
363 .constraints = {
364 .name = "VDIG",
365 .min_uV = 1050000,
366 .max_uV = 1800000,
367 .valid_ops_mask =
368 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
369 .boot_on = 1,
370 .always_on = 1,
371 },
372 .num_consumer_supplies = ARRAY_SIZE(vdig_consumers),
373 .consumer_supplies = vdig_consumers,
374};
375
376static struct regulator_init_data vpll_init = {
377 .constraints = {
378 .name = "VPLL",
379 .min_uV = 1050000,
380 .max_uV = 1800000,
381 .valid_ops_mask =
382 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
383 .boot_on = 1,
384 .always_on = 1,
385 }
386};
387
388static struct regulator_init_data vusb2_init = {
389 .constraints = {
390 .name = "VUSB2",
391 .min_uV = 2400000,
392 .max_uV = 2775000,
393 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
394 .boot_on = 1,
395 .always_on = 1,
396 }
397};
398
399static struct regulator_init_data vvideo_init = {
400 .constraints = {
401 .name = "VVIDEO",
402 .min_uV = 2775000,
403 .max_uV = 2775000,
404 .valid_ops_mask =
405 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
406 .boot_on = 1,
407 .apply_uV = 1,
408 },
409 .num_consumer_supplies = ARRAY_SIZE(vvideo_consumers),
410 .consumer_supplies = vvideo_consumers,
411};
412
413static struct regulator_init_data vaudio_init = {
414 .constraints = {
415 .name = "VAUDIO",
416 .min_uV = 2300000,
417 .max_uV = 3000000,
418 .valid_ops_mask =
419 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
420 .boot_on = 1,
421 }
422};
423
424static struct regulator_init_data vsd_init = {
425 .constraints = {
426 .name = "VSD",
427 .min_uV = 1800000,
428 .max_uV = 3150000,
429 .valid_ops_mask =
430 REGULATOR_CHANGE_VOLTAGE,
431 .boot_on = 1,
432 },
433 .num_consumer_supplies = ARRAY_SIZE(vsd_consumers),
434 .consumer_supplies = vsd_consumers,
435};
436
437static struct regulator_init_data vcam_init = {
438 .constraints = {
439 .name = "VCAM",
440 .min_uV = 2500000,
441 .max_uV = 3000000,
442 .valid_ops_mask =
443 REGULATOR_CHANGE_VOLTAGE |
444 REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
445 .valid_modes_mask = REGULATOR_MODE_FAST | REGULATOR_MODE_NORMAL,
446 .boot_on = 1,
447 }
448};
449
450static struct regulator_init_data vgen1_init = {
451 .constraints = {
452 .name = "VGEN1",
453 .min_uV = 1200000,
454 .max_uV = 3150000,
455 .valid_ops_mask =
456 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
457 .boot_on = 1,
458 .always_on = 1,
459 }
460};
461
462static struct regulator_init_data vgen2_init = {
463 .constraints = {
464 .name = "VGEN2",
465 .min_uV = 1200000,
466 .max_uV = 3150000,
467 .valid_ops_mask =
468 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
469 .boot_on = 1,
470 .always_on = 1,
471 }
472};
473
474static struct regulator_init_data vgen3_init = {
475 .constraints = {
476 .name = "VGEN3",
477 .min_uV = 1800000,
478 .max_uV = 2900000,
479 .valid_ops_mask =
480 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
481 .boot_on = 1,
482 .always_on = 1,
483 }
484};
485
486static struct regulator_init_data gpo1_init = {
487 .constraints = {
488 .name = "GPO1",
489 }
490};
491
492static struct regulator_init_data gpo2_init = {
493 .constraints = {
494 .name = "GPO2",
495 }
496};
497
498static struct regulator_init_data gpo3_init = {
499 .constraints = {
500 .name = "GPO3",
501 }
502};
503
504static struct regulator_init_data gpo4_init = {
505 .constraints = {
506 .name = "GPO4",
507 }
508};
509
510static struct regulator_init_data pwgt1_init = {
511 .constraints = {
512 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
513 .boot_on = 1,
514 },
515 .num_consumer_supplies = ARRAY_SIZE(pwgt1_consumer),
516 .consumer_supplies = pwgt1_consumer,
517};
518
519static struct regulator_init_data pwgt2_init = {
520 .constraints = {
521 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
522 .boot_on = 1,
523 },
524 .num_consumer_supplies = ARRAY_SIZE(pwgt2_consumer),
525 .consumer_supplies = pwgt2_consumer,
526};
527
528static struct regulator_init_data vcoincell_init = {
529 .constraints = {
530 .name = "COINCELL",
531 .min_uV = 3000000,
532 .max_uV = 3000000,
533 .valid_ops_mask =
534 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
535 },
536 .num_consumer_supplies = ARRAY_SIZE(coincell_consumer),
537 .consumer_supplies = coincell_consumer,
538};
539
540static struct mc13xxx_regulator_init_data mx51_efika_regulators[] = {
541 { .id = MC13892_SW1, .init_data = &sw1_init },
542 { .id = MC13892_SW2, .init_data = &sw2_init },
543 { .id = MC13892_SW3, .init_data = &sw3_init },
544 { .id = MC13892_SW4, .init_data = &sw4_init },
545 { .id = MC13892_SWBST, .init_data = &swbst_init },
546 { .id = MC13892_VIOHI, .init_data = &viohi_init },
547 { .id = MC13892_VPLL, .init_data = &vpll_init },
548 { .id = MC13892_VDIG, .init_data = &vdig_init },
549 { .id = MC13892_VSD, .init_data = &vsd_init },
550 { .id = MC13892_VUSB2, .init_data = &vusb2_init },
551 { .id = MC13892_VVIDEO, .init_data = &vvideo_init },
552 { .id = MC13892_VAUDIO, .init_data = &vaudio_init },
553 { .id = MC13892_VCAM, .init_data = &vcam_init },
554 { .id = MC13892_VGEN1, .init_data = &vgen1_init },
555 { .id = MC13892_VGEN2, .init_data = &vgen2_init },
556 { .id = MC13892_VGEN3, .init_data = &vgen3_init },
557 { .id = MC13892_VUSB, .init_data = &vusb_init },
558 { .id = MC13892_GPO1, .init_data = &gpo1_init },
559 { .id = MC13892_GPO2, .init_data = &gpo2_init },
560 { .id = MC13892_GPO3, .init_data = &gpo3_init },
561 { .id = MC13892_GPO4, .init_data = &gpo4_init },
562 { .id = MC13892_PWGT1SPI, .init_data = &pwgt1_init },
563 { .id = MC13892_PWGT2SPI, .init_data = &pwgt2_init },
564 { .id = MC13892_VCOINCELL, .init_data = &vcoincell_init },
565};
566
567static struct mc13xxx_platform_data mx51_efika_mc13892_data = {
568 .flags = MC13XXX_USE_RTC,
569 .regulators = {
570 .num_regulators = ARRAY_SIZE(mx51_efika_regulators),
571 .regulators = mx51_efika_regulators,
572 },
573};
574
575static struct spi_board_info mx51_efika_spi_board_info[] __initdata = {
576 {
577 .modalias = "m25p80",
578 .max_speed_hz = 25000000,
579 .bus_num = 0,
580 .chip_select = 1,
581 .platform_data = &mx51_efika_spi_flash_data,
582 .irq = -1,
583 },
584 {
585 .modalias = "mc13892",
586 .max_speed_hz = 1000000,
587 .bus_num = 0,
588 .chip_select = 0,
589 .platform_data = &mx51_efika_mc13892_data,
590 /* irq number is run-time assigned */
591 },
592};
593
594static int mx51_efika_spi_cs[] = {
595 EFIKAMX_SPI_CS0,
596 EFIKAMX_SPI_CS1,
597};
598
599static const struct spi_imx_master mx51_efika_spi_pdata __initconst = {
600 .chipselect = mx51_efika_spi_cs,
601 .num_chipselect = ARRAY_SIZE(mx51_efika_spi_cs),
602};
603
604void __init efika_board_common_init(void)
605{
606 mxc_iomux_v3_setup_multiple_pads(mx51efika_pads,
607 ARRAY_SIZE(mx51efika_pads));
608 imx51_add_imx_uart(0, &uart_pdata);
609 mx51_efika_usb();
610
611 /* FIXME: comes from original code. check this. */
612 if (mx51_revision() < IMX_CHIP_REVISION_2_0)
613 sw2_init.constraints.state_mem.uV = 1100000;
614 else if (mx51_revision() == IMX_CHIP_REVISION_2_0) {
615 sw2_init.constraints.state_mem.uV = 1250000;
616 sw1_init.constraints.state_mem.uV = 1000000;
617 }
618 if (machine_is_mx51_efikasb())
619 vgen1_init.constraints.max_uV = 1200000;
620
621 gpio_request(EFIKAMX_PMIC, "pmic irq");
622 gpio_direction_input(EFIKAMX_PMIC);
623 mx51_efika_spi_board_info[1].irq = gpio_to_irq(EFIKAMX_PMIC);
624 spi_register_board_info(mx51_efika_spi_board_info,
625 ARRAY_SIZE(mx51_efika_spi_board_info));
626 imx51_add_ecspi(0, &mx51_efika_spi_pdata);
627
628 imx51_add_pata_imx();
629
630#if defined(CONFIG_CPU_FREQ_IMX)
631 get_cpu_op = mx51_get_cpu_op;
632#endif
633}
diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c
index ab98c6fec9e..2ac43e1a2df 100644
--- a/arch/arm/mach-imx/platsmp.c
+++ b/arch/arm/mach-imx/platsmp.c
@@ -41,7 +41,7 @@ void __init imx_scu_map_io(void)
41 scu_base = IMX_IO_ADDRESS(base); 41 scu_base = IMX_IO_ADDRESS(base);
42} 42}
43 43
44void __cpuinit platform_secondary_init(unsigned int cpu) 44static void __cpuinit imx_secondary_init(unsigned int cpu)
45{ 45{
46 /* 46 /*
47 * if any interrupts are already enabled for the primary 47 * if any interrupts are already enabled for the primary
@@ -51,7 +51,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
51 gic_secondary_init(0); 51 gic_secondary_init(0);
52} 52}
53 53
54int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 54static int __cpuinit imx_boot_secondary(unsigned int cpu, struct task_struct *idle)
55{ 55{
56 imx_set_cpu_jump(cpu, v7_secondary_startup); 56 imx_set_cpu_jump(cpu, v7_secondary_startup);
57 imx_enable_cpu(cpu, true); 57 imx_enable_cpu(cpu, true);
@@ -62,7 +62,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
62 * Initialise the CPU possible map early - this describes the CPUs 62 * Initialise the CPU possible map early - this describes the CPUs
63 * which may be present or become present in the system. 63 * which may be present or become present in the system.
64 */ 64 */
65void __init smp_init_cpus(void) 65static void __init imx_smp_init_cpus(void)
66{ 66{
67 int i, ncores; 67 int i, ncores;
68 68
@@ -79,7 +79,17 @@ void imx_smp_prepare(void)
79 scu_enable(scu_base); 79 scu_enable(scu_base);
80} 80}
81 81
82void __init platform_smp_prepare_cpus(unsigned int max_cpus) 82static void __init imx_smp_prepare_cpus(unsigned int max_cpus)
83{ 83{
84 imx_smp_prepare(); 84 imx_smp_prepare();
85} 85}
86
87struct smp_operations imx_smp_ops __initdata = {
88 .smp_init_cpus = imx_smp_init_cpus,
89 .smp_prepare_cpus = imx_smp_prepare_cpus,
90 .smp_secondary_init = imx_secondary_init,
91 .smp_boot_secondary = imx_boot_secondary,
92#ifdef CONFIG_HOTPLUG_CPU
93 .cpu_die = imx_cpu_die,
94#endif
95};
diff --git a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile
index ebeef966e1f..5521d18bf19 100644
--- a/arch/arm/mach-integrator/Makefile
+++ b/arch/arm/mach-integrator/Makefile
@@ -4,11 +4,10 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := core.o lm.o 7obj-y := core.o lm.o leds.o
8obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o 8obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o
9obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o 9obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o
10 10
11obj-$(CONFIG_LEDS) += leds.o
12obj-$(CONFIG_PCI) += pci_v3.o pci.o 11obj-$(CONFIG_PCI) += pci_v3.o pci.o
13obj-$(CONFIG_CPU_FREQ_INTEGRATOR) += cpu.o 12obj-$(CONFIG_CPU_FREQ_INTEGRATOR) += cpu.o
14obj-$(CONFIG_INTEGRATOR_IMPD1) += impd1.o 13obj-$(CONFIG_INTEGRATOR_IMPD1) += impd1.o
diff --git a/arch/arm/mach-integrator/common.h b/arch/arm/mach-integrator/common.h
index 899561d8db2..c3ff21b5ea2 100644
--- a/arch/arm/mach-integrator/common.h
+++ b/arch/arm/mach-integrator/common.h
@@ -1,3 +1,6 @@
1#include <linux/amba/serial.h>
2extern struct amba_pl010_data integrator_uart_data;
1void integrator_init_early(void); 3void integrator_init_early(void);
4int integrator_init(bool is_cp);
2void integrator_reserve(void); 5void integrator_reserve(void);
3void integrator_restart(char, const char *); 6void integrator_restart(char, const char *);
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 3fa6c51390d..ea22a17246d 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -28,12 +28,13 @@
28#include <mach/cm.h> 28#include <mach/cm.h>
29#include <mach/irqs.h> 29#include <mach/irqs.h>
30 30
31#include <asm/leds.h>
32#include <asm/mach-types.h> 31#include <asm/mach-types.h>
33#include <asm/mach/time.h> 32#include <asm/mach/time.h>
34#include <asm/pgtable.h> 33#include <asm/pgtable.h>
35 34
36static struct amba_pl010_data integrator_uart_data; 35#include "common.h"
36
37#ifdef CONFIG_ATAGS
37 38
38#define INTEGRATOR_RTC_IRQ { IRQ_RTCINT } 39#define INTEGRATOR_RTC_IRQ { IRQ_RTCINT }
39#define INTEGRATOR_UART0_IRQ { IRQ_UARTINT0 } 40#define INTEGRATOR_UART0_IRQ { IRQ_UARTINT0 }
@@ -61,7 +62,7 @@ static struct amba_device *amba_devs[] __initdata = {
61 &kmi1_device, 62 &kmi1_device,
62}; 63};
63 64
64static int __init integrator_init(void) 65int __init integrator_init(bool is_cp)
65{ 66{
66 int i; 67 int i;
67 68
@@ -70,7 +71,7 @@ static int __init integrator_init(void)
70 * 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.
71 * 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.
72 */ 73 */
73 if (machine_is_integrator()) { 74 if (!is_cp) {
74 rtc_device.periphid = 0x00041030; 75 rtc_device.periphid = 0x00041030;
75 uart0_device.periphid = 0x00041010; 76 uart0_device.periphid = 0x00041010;
76 uart1_device.periphid = 0x00041010; 77 uart1_device.periphid = 0x00041010;
@@ -86,7 +87,7 @@ static int __init integrator_init(void)
86 return 0; 87 return 0;
87} 88}
88 89
89arch_initcall(integrator_init); 90#endif
90 91
91/* 92/*
92 * On the Integrator platform, the port RTS and DTR are provided by 93 * On the Integrator platform, the port RTS and DTR are provided by
@@ -95,17 +96,20 @@ arch_initcall(integrator_init);
95 * UART0 7 6 96 * UART0 7 6
96 * UART1 5 4 97 * UART1 5 4
97 */ 98 */
98#define SC_CTRLC IO_ADDRESS(INTEGRATOR_SC_CTRLC) 99#define SC_CTRLC __io_address(INTEGRATOR_SC_CTRLC)
99#define SC_CTRLS IO_ADDRESS(INTEGRATOR_SC_CTRLS) 100#define SC_CTRLS __io_address(INTEGRATOR_SC_CTRLS)
100 101
101static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl) 102static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl)
102{ 103{
103 unsigned int ctrls = 0, ctrlc = 0, rts_mask, dtr_mask; 104 unsigned int ctrls = 0, ctrlc = 0, rts_mask, dtr_mask;
105 u32 phybase = dev->res.start;
104 106
105 if (dev == &uart0_device) { 107 if (phybase == INTEGRATOR_UART0_BASE) {
108 /* UART0 */
106 rts_mask = 1 << 4; 109 rts_mask = 1 << 4;
107 dtr_mask = 1 << 5; 110 dtr_mask = 1 << 5;
108 } else { 111 } else {
112 /* UART1 */
109 rts_mask = 1 << 6; 113 rts_mask = 1 << 6;
110 dtr_mask = 1 << 7; 114 dtr_mask = 1 << 7;
111 } 115 }
@@ -124,12 +128,10 @@ static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *bas
124 __raw_writel(ctrlc, SC_CTRLC); 128 __raw_writel(ctrlc, SC_CTRLC);
125} 129}
126 130
127static struct amba_pl010_data integrator_uart_data = { 131struct amba_pl010_data integrator_uart_data = {
128 .set_mctrl = integrator_uart_set_mctrl, 132 .set_mctrl = integrator_uart_set_mctrl,
129}; 133};
130 134
131#define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_CTRL)
132
133static DEFINE_RAW_SPINLOCK(cm_lock); 135static DEFINE_RAW_SPINLOCK(cm_lock);
134 136
135/** 137/**
diff --git a/arch/arm/mach-integrator/cpu.c b/arch/arm/mach-integrator/cpu.c
index fbb45777989..590c192cdf4 100644
--- a/arch/arm/mach-integrator/cpu.c
+++ b/arch/arm/mach-integrator/cpu.c
@@ -25,10 +25,10 @@
25 25
26static struct cpufreq_driver integrator_driver; 26static struct cpufreq_driver integrator_driver;
27 27
28#define CM_ID IO_ADDRESS(INTEGRATOR_HDR_ID) 28#define CM_ID __io_address(INTEGRATOR_HDR_ID)
29#define CM_OSC IO_ADDRESS(INTEGRATOR_HDR_OSC) 29#define CM_OSC __io_address(INTEGRATOR_HDR_OSC)
30#define CM_STAT IO_ADDRESS(INTEGRATOR_HDR_STAT) 30#define CM_STAT __io_address(INTEGRATOR_HDR_STAT)
31#define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK) 31#define CM_LOCK __io_address(INTEGRATOR_HDR_LOCK)
32 32
33static const struct icst_params lclk_params = { 33static const struct icst_params lclk_params = {
34 .ref = 24000000, 34 .ref = 24000000,
diff --git a/arch/arm/mach-integrator/include/mach/cm.h b/arch/arm/mach-integrator/include/mach/cm.h
index 445d57adb04..202e6a57f10 100644
--- a/arch/arm/mach-integrator/include/mach/cm.h
+++ b/arch/arm/mach-integrator/include/mach/cm.h
@@ -3,6 +3,8 @@
3 */ 3 */
4void cm_control(u32, u32); 4void cm_control(u32, u32);
5 5
6#define CM_CTRL __io_address(INTEGRATOR_HDR_CTRL)
7
6#define CM_CTRL_LED (1 << 0) 8#define CM_CTRL_LED (1 << 0)
7#define CM_CTRL_nMBDET (1 << 1) 9#define CM_CTRL_nMBDET (1 << 1)
8#define CM_CTRL_REMAP (1 << 2) 10#define CM_CTRL_REMAP (1 << 2)
diff --git a/arch/arm/mach-integrator/include/mach/io.h b/arch/arm/mach-integrator/include/mach/io.h
deleted file mode 100644
index 8de70de3dd0..00000000000
--- a/arch/arm/mach-integrator/include/mach/io.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * arch/arm/mach-integrator/include/mach/io.h
3 *
4 * Copyright (C) 1999 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22
23/*
24 * WARNING: this has to mirror definitions in platform.h
25 */
26#define PCI_MEMORY_VADDR 0xe8000000
27#define PCI_CONFIG_VADDR 0xec000000
28#define PCI_V3_VADDR 0xed000000
29#define PCI_IO_VADDR 0xee000000
30
31#define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a)))
32
33#endif
diff --git a/arch/arm/mach-integrator/include/mach/platform.h b/arch/arm/mach-integrator/include/mach/platform.h
index ec467baade0..efeac5d0bc9 100644
--- a/arch/arm/mach-integrator/include/mach/platform.h
+++ b/arch/arm/mach-integrator/include/mach/platform.h
@@ -324,6 +324,10 @@
324 */ 324 */
325#define PHYS_PCI_V3_BASE 0x62000000 325#define PHYS_PCI_V3_BASE 0x62000000
326 326
327#define PCI_MEMORY_VADDR IOMEM(0xe8000000)
328#define PCI_CONFIG_VADDR IOMEM(0xec000000)
329#define PCI_V3_VADDR IOMEM(0xed000000)
330
327/* ------------------------------------------------------------------------ 331/* ------------------------------------------------------------------------
328 * Integrator Interrupt Controllers 332 * Integrator Interrupt Controllers
329 * ------------------------------------------------------------------------ 333 * ------------------------------------------------------------------------
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 3b2267529f5..e6617c134fa 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -34,6 +34,9 @@
34#include <linux/mtd/physmap.h> 34#include <linux/mtd/physmap.h>
35#include <linux/clk.h> 35#include <linux/clk.h>
36#include <linux/platform_data/clk-integrator.h> 36#include <linux/platform_data/clk-integrator.h>
37#include <linux/of_irq.h>
38#include <linux/of_address.h>
39#include <linux/of_platform.h>
37#include <video/vga.h> 40#include <video/vga.h>
38 41
39#include <mach/hardware.h> 42#include <mach/hardware.h>
@@ -50,6 +53,7 @@
50#include <asm/mach/arch.h> 53#include <asm/mach/arch.h>
51#include <asm/mach/irq.h> 54#include <asm/mach/irq.h>
52#include <asm/mach/map.h> 55#include <asm/mach/map.h>
56#include <asm/mach/pci.h>
53#include <asm/mach/time.h> 57#include <asm/mach/time.h>
54 58
55#include <plat/fpga-irq.h> 59#include <plat/fpga-irq.h>
@@ -73,7 +77,7 @@
73 * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M) 77 * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M)
74 * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M) 78 * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M)
75 * ed000000 62000000 PCI V3 regs PHYS_PCI_V3_BASE (max 64k) 79 * ed000000 62000000 PCI V3 regs PHYS_PCI_V3_BASE (max 64k)
76 * ee000000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M) 80 * fee00000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M)
77 * ef000000 Cache flush 81 * ef000000 Cache flush
78 * f1000000 10000000 Core module registers 82 * f1000000 10000000 Core module registers
79 * f1100000 11000000 System controller registers 83 * f1100000 11000000 System controller registers
@@ -133,49 +137,28 @@ static struct map_desc ap_io_desc[] __initdata = {
133 .length = SZ_4K, 137 .length = SZ_4K,
134 .type = MT_DEVICE 138 .type = MT_DEVICE
135 }, { 139 }, {
136 .virtual = PCI_MEMORY_VADDR, 140 .virtual = (unsigned long)PCI_MEMORY_VADDR,
137 .pfn = __phys_to_pfn(PHYS_PCI_MEM_BASE), 141 .pfn = __phys_to_pfn(PHYS_PCI_MEM_BASE),
138 .length = SZ_16M, 142 .length = SZ_16M,
139 .type = MT_DEVICE 143 .type = MT_DEVICE
140 }, { 144 }, {
141 .virtual = PCI_CONFIG_VADDR, 145 .virtual = (unsigned long)PCI_CONFIG_VADDR,
142 .pfn = __phys_to_pfn(PHYS_PCI_CONFIG_BASE), 146 .pfn = __phys_to_pfn(PHYS_PCI_CONFIG_BASE),
143 .length = SZ_16M, 147 .length = SZ_16M,
144 .type = MT_DEVICE 148 .type = MT_DEVICE
145 }, { 149 }, {
146 .virtual = PCI_V3_VADDR, 150 .virtual = (unsigned long)PCI_V3_VADDR,
147 .pfn = __phys_to_pfn(PHYS_PCI_V3_BASE), 151 .pfn = __phys_to_pfn(PHYS_PCI_V3_BASE),
148 .length = SZ_64K, 152 .length = SZ_64K,
149 .type = MT_DEVICE 153 .type = MT_DEVICE
150 }, {
151 .virtual = PCI_IO_VADDR,
152 .pfn = __phys_to_pfn(PHYS_PCI_IO_BASE),
153 .length = SZ_64K,
154 .type = MT_DEVICE
155 } 154 }
156}; 155};
157 156
158static void __init ap_map_io(void) 157static void __init ap_map_io(void)
159{ 158{
160 iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc)); 159 iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc));
161 vga_base = PCI_MEMORY_VADDR; 160 vga_base = (unsigned long)PCI_MEMORY_VADDR;
162} 161 pci_map_io_early(__phys_to_pfn(PHYS_PCI_IO_BASE));
163
164#define INTEGRATOR_SC_VALID_INT 0x003fffff
165
166static void __init ap_init_irq(void)
167{
168 /* Disable all interrupts initially. */
169 /* Do the core module ones */
170 writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR);
171
172 /* do the header card stuff next */
173 writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR);
174 writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR);
175
176 fpga_irq_init(VA_IC_BASE, "SC", IRQ_PIC_START,
177 -1, INTEGRATOR_SC_VALID_INT, NULL);
178 integrator_clk_init(false);
179} 162}
180 163
181#ifdef CONFIG_PM 164#ifdef CONFIG_PM
@@ -270,56 +253,12 @@ static struct physmap_flash_data ap_flash_data = {
270 .set_vpp = ap_flash_set_vpp, 253 .set_vpp = ap_flash_set_vpp,
271}; 254};
272 255
273static struct resource cfi_flash_resource = {
274 .start = INTEGRATOR_FLASH_BASE,
275 .end = INTEGRATOR_FLASH_BASE + INTEGRATOR_FLASH_SIZE - 1,
276 .flags = IORESOURCE_MEM,
277};
278
279static struct platform_device cfi_flash_device = {
280 .name = "physmap-flash",
281 .id = 0,
282 .dev = {
283 .platform_data = &ap_flash_data,
284 },
285 .num_resources = 1,
286 .resource = &cfi_flash_resource,
287};
288
289static void __init ap_init(void)
290{
291 unsigned long sc_dec;
292 int i;
293
294 platform_device_register(&cfi_flash_device);
295
296 sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET);
297 for (i = 0; i < 4; i++) {
298 struct lm_device *lmdev;
299
300 if ((sc_dec & (16 << i)) == 0)
301 continue;
302
303 lmdev = kzalloc(sizeof(struct lm_device), GFP_KERNEL);
304 if (!lmdev)
305 continue;
306
307 lmdev->resource.start = 0xc0000000 + 0x10000000 * i;
308 lmdev->resource.end = lmdev->resource.start + 0x0fffffff;
309 lmdev->resource.flags = IORESOURCE_MEM;
310 lmdev->irq = IRQ_AP_EXPINT0 + i;
311 lmdev->id = i;
312
313 lm_device_register(lmdev);
314 }
315}
316
317/* 256/*
318 * Where is the timer (VA)? 257 * Where is the timer (VA)?
319 */ 258 */
320#define TIMER0_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER0_BASE) 259#define TIMER0_VA_BASE __io_address(INTEGRATOR_TIMER0_BASE)
321#define TIMER1_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER1_BASE) 260#define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE)
322#define TIMER2_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER2_BASE) 261#define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE)
323 262
324static unsigned long timer_reload; 263static unsigned long timer_reload;
325 264
@@ -328,9 +267,9 @@ static u32 notrace integrator_read_sched_clock(void)
328 return -readl((void __iomem *) TIMER2_VA_BASE + TIMER_VALUE); 267 return -readl((void __iomem *) TIMER2_VA_BASE + TIMER_VALUE);
329} 268}
330 269
331static void integrator_clocksource_init(unsigned long inrate) 270static void integrator_clocksource_init(unsigned long inrate,
271 void __iomem *base)
332{ 272{
333 void __iomem *base = (void __iomem *)TIMER2_VA_BASE;
334 u32 ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC; 273 u32 ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC;
335 unsigned long rate = inrate; 274 unsigned long rate = inrate;
336 275
@@ -347,7 +286,7 @@ static void integrator_clocksource_init(unsigned long inrate)
347 setup_sched_clock(integrator_read_sched_clock, 16, rate); 286 setup_sched_clock(integrator_read_sched_clock, 16, rate);
348} 287}
349 288
350static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE; 289static void __iomem * clkevt_base;
351 290
352/* 291/*
353 * IRQ handler for the timer 292 * IRQ handler for the timer
@@ -419,11 +358,13 @@ static struct irqaction integrator_timer_irq = {
419 .dev_id = &integrator_clockevent, 358 .dev_id = &integrator_clockevent,
420}; 359};
421 360
422static void integrator_clockevent_init(unsigned long inrate) 361static void integrator_clockevent_init(unsigned long inrate,
362 void __iomem *base, int irq)
423{ 363{
424 unsigned long rate = inrate; 364 unsigned long rate = inrate;
425 unsigned int ctrl = 0; 365 unsigned int ctrl = 0;
426 366
367 clkevt_base = base;
427 /* Calculate and program a divisor */ 368 /* Calculate and program a divisor */
428 if (rate > 0x100000 * HZ) { 369 if (rate > 0x100000 * HZ) {
429 rate /= 256; 370 rate /= 256;
@@ -435,7 +376,7 @@ static void integrator_clockevent_init(unsigned long inrate)
435 timer_reload = rate / HZ; 376 timer_reload = rate / HZ;
436 writel(ctrl, clkevt_base + TIMER_CTRL); 377 writel(ctrl, clkevt_base + TIMER_CTRL);
437 378
438 setup_irq(IRQ_TIMERINT1, &integrator_timer_irq); 379 setup_irq(irq, &integrator_timer_irq);
439 clockevents_config_and_register(&integrator_clockevent, 380 clockevents_config_and_register(&integrator_clockevent,
440 rate, 381 rate,
441 1, 382 1,
@@ -446,9 +387,153 @@ void __init ap_init_early(void)
446{ 387{
447} 388}
448 389
390#ifdef CONFIG_OF
391
392static void __init ap_init_timer_of(void)
393{
394 struct device_node *node;
395 const char *path;
396 void __iomem *base;
397 int err;
398 int irq;
399 struct clk *clk;
400 unsigned long rate;
401
402 clk = clk_get_sys("ap_timer", NULL);
403 BUG_ON(IS_ERR(clk));
404 clk_prepare_enable(clk);
405 rate = clk_get_rate(clk);
406
407 err = of_property_read_string(of_aliases,
408 "arm,timer-primary", &path);
409 if (WARN_ON(err))
410 return;
411 node = of_find_node_by_path(path);
412 base = of_iomap(node, 0);
413 if (WARN_ON(!base))
414 return;
415 writel(0, base + TIMER_CTRL);
416 integrator_clocksource_init(rate, base);
417
418 err = of_property_read_string(of_aliases,
419 "arm,timer-secondary", &path);
420 if (WARN_ON(err))
421 return;
422 node = of_find_node_by_path(path);
423 base = of_iomap(node, 0);
424 if (WARN_ON(!base))
425 return;
426 irq = irq_of_parse_and_map(node, 0);
427 writel(0, base + TIMER_CTRL);
428 integrator_clockevent_init(rate, base, irq);
429}
430
431static struct sys_timer ap_of_timer = {
432 .init = ap_init_timer_of,
433};
434
435static const struct of_device_id fpga_irq_of_match[] __initconst = {
436 { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
437 { /* Sentinel */ }
438};
439
440static void __init ap_init_irq_of(void)
441{
442 /* disable core module IRQs */
443 writel(0xffffffffU, VA_CMIC_BASE + IRQ_ENABLE_CLEAR);
444 of_irq_init(fpga_irq_of_match);
445 integrator_clk_init(false);
446}
447
448/* For the Device Tree, add in the UART callbacks as AUXDATA */
449static struct of_dev_auxdata ap_auxdata_lookup[] __initdata = {
450 OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_RTC_BASE,
451 "rtc", NULL),
452 OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART0_BASE,
453 "uart0", &integrator_uart_data),
454 OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART1_BASE,
455 "uart1", &integrator_uart_data),
456 OF_DEV_AUXDATA("arm,primecell", KMI0_BASE,
457 "kmi0", NULL),
458 OF_DEV_AUXDATA("arm,primecell", KMI1_BASE,
459 "kmi1", NULL),
460 OF_DEV_AUXDATA("cfi-flash", INTEGRATOR_FLASH_BASE,
461 "physmap-flash", &ap_flash_data),
462 { /* sentinel */ },
463};
464
465static void __init ap_init_of(void)
466{
467 unsigned long sc_dec;
468 int i;
469
470 of_platform_populate(NULL, of_default_bus_match_table,
471 ap_auxdata_lookup, NULL);
472
473 sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET);
474 for (i = 0; i < 4; i++) {
475 struct lm_device *lmdev;
476
477 if ((sc_dec & (16 << i)) == 0)
478 continue;
479
480 lmdev = kzalloc(sizeof(struct lm_device), GFP_KERNEL);
481 if (!lmdev)
482 continue;
483
484 lmdev->resource.start = 0xc0000000 + 0x10000000 * i;
485 lmdev->resource.end = lmdev->resource.start + 0x0fffffff;
486 lmdev->resource.flags = IORESOURCE_MEM;
487 lmdev->irq = IRQ_AP_EXPINT0 + i;
488 lmdev->id = i;
489
490 lm_device_register(lmdev);
491 }
492}
493
494static const char * ap_dt_board_compat[] = {
495 "arm,integrator-ap",
496 NULL,
497};
498
499DT_MACHINE_START(INTEGRATOR_AP_DT, "ARM Integrator/AP (Device Tree)")
500 .reserve = integrator_reserve,
501 .map_io = ap_map_io,
502 .nr_irqs = NR_IRQS_INTEGRATOR_AP,
503 .init_early = ap_init_early,
504 .init_irq = ap_init_irq_of,
505 .handle_irq = fpga_handle_irq,
506 .timer = &ap_of_timer,
507 .init_machine = ap_init_of,
508 .restart = integrator_restart,
509 .dt_compat = ap_dt_board_compat,
510MACHINE_END
511
512#endif
513
514#ifdef CONFIG_ATAGS
515
449/* 516/*
450 * Set up timer(s). 517 * This is where non-devicetree initialization code is collected and stashed
518 * for eventual deletion.
451 */ 519 */
520
521static struct resource cfi_flash_resource = {
522 .start = INTEGRATOR_FLASH_BASE,
523 .end = INTEGRATOR_FLASH_BASE + INTEGRATOR_FLASH_SIZE - 1,
524 .flags = IORESOURCE_MEM,
525};
526
527static struct platform_device cfi_flash_device = {
528 .name = "physmap-flash",
529 .id = 0,
530 .dev = {
531 .platform_data = &ap_flash_data,
532 },
533 .num_resources = 1,
534 .resource = &cfi_flash_resource,
535};
536
452static void __init ap_init_timer(void) 537static void __init ap_init_timer(void)
453{ 538{
454 struct clk *clk; 539 struct clk *clk;
@@ -463,14 +548,62 @@ static void __init ap_init_timer(void)
463 writel(0, TIMER1_VA_BASE + TIMER_CTRL); 548 writel(0, TIMER1_VA_BASE + TIMER_CTRL);
464 writel(0, TIMER2_VA_BASE + TIMER_CTRL); 549 writel(0, TIMER2_VA_BASE + TIMER_CTRL);
465 550
466 integrator_clocksource_init(rate); 551 integrator_clocksource_init(rate, (void __iomem *)TIMER2_VA_BASE);
467 integrator_clockevent_init(rate); 552 integrator_clockevent_init(rate, (void __iomem *)TIMER1_VA_BASE,
553 IRQ_TIMERINT1);
468} 554}
469 555
470static struct sys_timer ap_timer = { 556static struct sys_timer ap_timer = {
471 .init = ap_init_timer, 557 .init = ap_init_timer,
472}; 558};
473 559
560#define INTEGRATOR_SC_VALID_INT 0x003fffff
561
562static void __init ap_init_irq(void)
563{
564 /* Disable all interrupts initially. */
565 /* Do the core module ones */
566 writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR);
567
568 /* do the header card stuff next */
569 writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR);
570 writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR);
571
572 fpga_irq_init(VA_IC_BASE, "SC", IRQ_PIC_START,
573 -1, INTEGRATOR_SC_VALID_INT, NULL);
574 integrator_clk_init(false);
575}
576
577static void __init ap_init(void)
578{
579 unsigned long sc_dec;
580 int i;
581
582 platform_device_register(&cfi_flash_device);
583
584 sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET);
585 for (i = 0; i < 4; i++) {
586 struct lm_device *lmdev;
587
588 if ((sc_dec & (16 << i)) == 0)
589 continue;
590
591 lmdev = kzalloc(sizeof(struct lm_device), GFP_KERNEL);
592 if (!lmdev)
593 continue;
594
595 lmdev->resource.start = 0xc0000000 + 0x10000000 * i;
596 lmdev->resource.end = lmdev->resource.start + 0x0fffffff;
597 lmdev->resource.flags = IORESOURCE_MEM;
598 lmdev->irq = IRQ_AP_EXPINT0 + i;
599 lmdev->id = i;
600
601 lm_device_register(lmdev);
602 }
603
604 integrator_init(false);
605}
606
474MACHINE_START(INTEGRATOR, "ARM-Integrator") 607MACHINE_START(INTEGRATOR, "ARM-Integrator")
475 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 608 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
476 .atag_offset = 0x100, 609 .atag_offset = 0x100,
@@ -484,3 +617,5 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator")
484 .init_machine = ap_init, 617 .init_machine = ap_init,
485 .restart = integrator_restart, 618 .restart = integrator_restart,
486MACHINE_END 619MACHINE_END
620
621#endif
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 82d5c837cc7..5b08e8e4cc8 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -23,6 +23,9 @@
23#include <linux/gfp.h> 23#include <linux/gfp.h>
24#include <linux/mtd/physmap.h> 24#include <linux/mtd/physmap.h>
25#include <linux/platform_data/clk-integrator.h> 25#include <linux/platform_data/clk-integrator.h>
26#include <linux/of_irq.h>
27#include <linux/of_address.h>
28#include <linux/of_platform.h>
26 29
27#include <mach/hardware.h> 30#include <mach/hardware.h>
28#include <mach/platform.h> 31#include <mach/platform.h>
@@ -49,17 +52,10 @@
49#include "common.h" 52#include "common.h"
50 53
51#define INTCP_PA_FLASH_BASE 0x24000000 54#define INTCP_PA_FLASH_BASE 0x24000000
52#define INTCP_FLASH_SIZE SZ_32M
53 55
54#define INTCP_PA_CLCD_BASE 0xc0000000 56#define INTCP_PA_CLCD_BASE 0xc0000000
55 57
56#define INTCP_VA_CIC_BASE __io_address(INTEGRATOR_HDR_BASE + 0x40) 58#define INTCP_VA_CTRL_BASE __io_address(INTEGRATOR_CP_CTL_BASE)
57#define INTCP_VA_PIC_BASE __io_address(INTEGRATOR_IC_BASE)
58#define INTCP_VA_SIC_BASE __io_address(INTEGRATOR_CP_SIC_BASE)
59
60#define INTCP_ETH_SIZE 0x10
61
62#define INTCP_VA_CTRL_BASE IO_ADDRESS(INTEGRATOR_CP_CTL_BASE)
63#define INTCP_FLASHPROG 0x04 59#define INTCP_FLASHPROG 0x04
64#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) 60#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0)
65#define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1) 61#define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1)
@@ -143,37 +139,6 @@ static void __init intcp_map_io(void)
143 iotable_init(intcp_io_desc, ARRAY_SIZE(intcp_io_desc)); 139 iotable_init(intcp_io_desc, ARRAY_SIZE(intcp_io_desc));
144} 140}
145 141
146static void __init intcp_init_irq(void)
147{
148 u32 pic_mask, cic_mask, sic_mask;
149
150 /* These masks are for the HW IRQ registers */
151 pic_mask = ~((~0u) << (11 - IRQ_PIC_START));
152 pic_mask |= (~((~0u) << (29 - 22))) << 22;
153 cic_mask = ~((~0u) << (1 + IRQ_CIC_END - IRQ_CIC_START));
154 sic_mask = ~((~0u) << (1 + IRQ_SIC_END - IRQ_SIC_START));
155
156 /*
157 * Disable all interrupt sources
158 */
159 writel(0xffffffff, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR);
160 writel(0xffffffff, INTCP_VA_PIC_BASE + FIQ_ENABLE_CLEAR);
161 writel(0xffffffff, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR);
162 writel(0xffffffff, INTCP_VA_CIC_BASE + FIQ_ENABLE_CLEAR);
163 writel(sic_mask, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR);
164 writel(sic_mask, INTCP_VA_SIC_BASE + FIQ_ENABLE_CLEAR);
165
166 fpga_irq_init(INTCP_VA_PIC_BASE, "PIC", IRQ_PIC_START,
167 -1, pic_mask, NULL);
168
169 fpga_irq_init(INTCP_VA_CIC_BASE, "CIC", IRQ_CIC_START,
170 -1, cic_mask, NULL);
171
172 fpga_irq_init(INTCP_VA_SIC_BASE, "SIC", IRQ_SIC_START,
173 IRQ_CP_CPPLDINT, sic_mask, NULL);
174 integrator_clk_init(true);
175}
176
177/* 142/*
178 * Flash handling. 143 * Flash handling.
179 */ 144 */
@@ -216,47 +181,6 @@ static struct physmap_flash_data intcp_flash_data = {
216 .set_vpp = intcp_flash_set_vpp, 181 .set_vpp = intcp_flash_set_vpp,
217}; 182};
218 183
219static struct resource intcp_flash_resource = {
220 .start = INTCP_PA_FLASH_BASE,
221 .end = INTCP_PA_FLASH_BASE + INTCP_FLASH_SIZE - 1,
222 .flags = IORESOURCE_MEM,
223};
224
225static struct platform_device intcp_flash_device = {
226 .name = "physmap-flash",
227 .id = 0,
228 .dev = {
229 .platform_data = &intcp_flash_data,
230 },
231 .num_resources = 1,
232 .resource = &intcp_flash_resource,
233};
234
235static struct resource smc91x_resources[] = {
236 [0] = {
237 .start = INTEGRATOR_CP_ETH_BASE,
238 .end = INTEGRATOR_CP_ETH_BASE + INTCP_ETH_SIZE - 1,
239 .flags = IORESOURCE_MEM,
240 },
241 [1] = {
242 .start = IRQ_CP_ETHINT,
243 .end = IRQ_CP_ETHINT,
244 .flags = IORESOURCE_IRQ,
245 },
246};
247
248static struct platform_device smc91x_device = {
249 .name = "smc91x",
250 .id = 0,
251 .num_resources = ARRAY_SIZE(smc91x_resources),
252 .resource = smc91x_resources,
253};
254
255static struct platform_device *intcp_devs[] __initdata = {
256 &intcp_flash_device,
257 &smc91x_device,
258};
259
260/* 184/*
261 * It seems that the card insertion interrupt remains active after 185 * It seems that the card insertion interrupt remains active after
262 * we've acknowledged it. We therefore ignore the interrupt, and 186 * we've acknowledged it. We therefore ignore the interrupt, and
@@ -265,8 +189,8 @@ static struct platform_device *intcp_devs[] __initdata = {
265 */ 189 */
266static unsigned int mmc_status(struct device *dev) 190static unsigned int mmc_status(struct device *dev)
267{ 191{
268 unsigned int status = readl(IO_ADDRESS(0xca000000 + 4)); 192 unsigned int status = readl(__io_address(0xca000000 + 4));
269 writel(8, IO_ADDRESS(INTEGRATOR_CP_CTL_BASE + 8)); 193 writel(8, __io_address(INTEGRATOR_CP_CTL_BASE + 8));
270 194
271 return status & 8; 195 return status & 8;
272} 196}
@@ -278,16 +202,6 @@ static struct mmci_platform_data mmc_data = {
278 .gpio_cd = -1, 202 .gpio_cd = -1,
279}; 203};
280 204
281#define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 }
282#define INTEGRATOR_CP_AACI_IRQS { IRQ_CP_AACIINT }
283
284static AMBA_APB_DEVICE(mmc, "mmci", 0, INTEGRATOR_CP_MMC_BASE,
285 INTEGRATOR_CP_MMC_IRQS, &mmc_data);
286
287static AMBA_APB_DEVICE(aaci, "aaci", 0, INTEGRATOR_CP_AACI_BASE,
288 INTEGRATOR_CP_AACI_IRQS, NULL);
289
290
291/* 205/*
292 * CLCD support 206 * CLCD support
293 */ 207 */
@@ -338,15 +252,6 @@ static struct clcd_board clcd_data = {
338 .remove = versatile_clcd_remove_dma, 252 .remove = versatile_clcd_remove_dma,
339}; 253};
340 254
341static AMBA_AHB_DEVICE(clcd, "clcd", 0, INTCP_PA_CLCD_BASE,
342 { IRQ_CP_CLCDCINT }, &clcd_data);
343
344static struct amba_device *amba_devs[] __initdata = {
345 &mmc_device,
346 &aaci_device,
347 &clcd_device,
348};
349
350#define REFCOUNTER (__io_address(INTEGRATOR_HDR_BASE) + 0x28) 255#define REFCOUNTER (__io_address(INTEGRATOR_HDR_BASE) + 0x28)
351 256
352static void __init intcp_init_early(void) 257static void __init intcp_init_early(void)
@@ -356,16 +261,193 @@ static void __init intcp_init_early(void)
356#endif 261#endif
357} 262}
358 263
359static void __init intcp_init(void) 264#ifdef CONFIG_OF
265
266static void __init intcp_timer_init_of(void)
360{ 267{
361 int i; 268 struct device_node *node;
269 const char *path;
270 void __iomem *base;
271 int err;
272 int irq;
273
274 err = of_property_read_string(of_aliases,
275 "arm,timer-primary", &path);
276 if (WARN_ON(err))
277 return;
278 node = of_find_node_by_path(path);
279 base = of_iomap(node, 0);
280 if (WARN_ON(!base))
281 return;
282 writel(0, base + TIMER_CTRL);
283 sp804_clocksource_init(base, node->name);
284
285 err = of_property_read_string(of_aliases,
286 "arm,timer-secondary", &path);
287 if (WARN_ON(err))
288 return;
289 node = of_find_node_by_path(path);
290 base = of_iomap(node, 0);
291 if (WARN_ON(!base))
292 return;
293 irq = irq_of_parse_and_map(node, 0);
294 writel(0, base + TIMER_CTRL);
295 sp804_clockevents_init(base, irq, node->name);
296}
362 297
363 platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs)); 298static struct sys_timer cp_of_timer = {
299 .init = intcp_timer_init_of,
300};
364 301
365 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 302static const struct of_device_id fpga_irq_of_match[] __initconst = {
366 struct amba_device *d = amba_devs[i]; 303 { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
367 amba_device_register(d, &iomem_resource); 304 { /* Sentinel */ }
368 } 305};
306
307static void __init intcp_init_irq_of(void)
308{
309 of_irq_init(fpga_irq_of_match);
310 integrator_clk_init(true);
311}
312
313/*
314 * For the Device Tree, add in the UART, MMC and CLCD specifics as AUXDATA
315 * and enforce the bus names since these are used for clock lookups.
316 */
317static struct of_dev_auxdata intcp_auxdata_lookup[] __initdata = {
318 OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_RTC_BASE,
319 "rtc", NULL),
320 OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART0_BASE,
321 "uart0", &integrator_uart_data),
322 OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART1_BASE,
323 "uart1", &integrator_uart_data),
324 OF_DEV_AUXDATA("arm,primecell", KMI0_BASE,
325 "kmi0", NULL),
326 OF_DEV_AUXDATA("arm,primecell", KMI1_BASE,
327 "kmi1", NULL),
328 OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_CP_MMC_BASE,
329 "mmci", &mmc_data),
330 OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_CP_AACI_BASE,
331 "aaci", &mmc_data),
332 OF_DEV_AUXDATA("arm,primecell", INTCP_PA_CLCD_BASE,
333 "clcd", &clcd_data),
334 OF_DEV_AUXDATA("cfi-flash", INTCP_PA_FLASH_BASE,
335 "physmap-flash", &intcp_flash_data),
336 { /* sentinel */ },
337};
338
339static void __init intcp_init_of(void)
340{
341 of_platform_populate(NULL, of_default_bus_match_table,
342 intcp_auxdata_lookup, NULL);
343}
344
345static const char * intcp_dt_board_compat[] = {
346 "arm,integrator-cp",
347 NULL,
348};
349
350DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)")
351 .reserve = integrator_reserve,
352 .map_io = intcp_map_io,
353 .nr_irqs = NR_IRQS_INTEGRATOR_CP,
354 .init_early = intcp_init_early,
355 .init_irq = intcp_init_irq_of,
356 .handle_irq = fpga_handle_irq,
357 .timer = &cp_of_timer,
358 .init_machine = intcp_init_of,
359 .restart = integrator_restart,
360 .dt_compat = intcp_dt_board_compat,
361MACHINE_END
362
363#endif
364
365#ifdef CONFIG_ATAGS
366
367/*
368 * This is where non-devicetree initialization code is collected and stashed
369 * for eventual deletion.
370 */
371
372#define INTCP_FLASH_SIZE SZ_32M
373
374static struct resource intcp_flash_resource = {
375 .start = INTCP_PA_FLASH_BASE,
376 .end = INTCP_PA_FLASH_BASE + INTCP_FLASH_SIZE - 1,
377 .flags = IORESOURCE_MEM,
378};
379
380static struct platform_device intcp_flash_device = {
381 .name = "physmap-flash",
382 .id = 0,
383 .dev = {
384 .platform_data = &intcp_flash_data,
385 },
386 .num_resources = 1,
387 .resource = &intcp_flash_resource,
388};
389
390#define INTCP_ETH_SIZE 0x10
391
392static struct resource smc91x_resources[] = {
393 [0] = {
394 .start = INTEGRATOR_CP_ETH_BASE,
395 .end = INTEGRATOR_CP_ETH_BASE + INTCP_ETH_SIZE - 1,
396 .flags = IORESOURCE_MEM,
397 },
398 [1] = {
399 .start = IRQ_CP_ETHINT,
400 .end = IRQ_CP_ETHINT,
401 .flags = IORESOURCE_IRQ,
402 },
403};
404
405static struct platform_device smc91x_device = {
406 .name = "smc91x",
407 .id = 0,
408 .num_resources = ARRAY_SIZE(smc91x_resources),
409 .resource = smc91x_resources,
410};
411
412static struct platform_device *intcp_devs[] __initdata = {
413 &intcp_flash_device,
414 &smc91x_device,
415};
416
417#define INTCP_VA_CIC_BASE __io_address(INTEGRATOR_HDR_BASE + 0x40)
418#define INTCP_VA_PIC_BASE __io_address(INTEGRATOR_IC_BASE)
419#define INTCP_VA_SIC_BASE __io_address(INTEGRATOR_CP_SIC_BASE)
420
421static void __init intcp_init_irq(void)
422{
423 u32 pic_mask, cic_mask, sic_mask;
424
425 /* These masks are for the HW IRQ registers */
426 pic_mask = ~((~0u) << (11 - IRQ_PIC_START));
427 pic_mask |= (~((~0u) << (29 - 22))) << 22;
428 cic_mask = ~((~0u) << (1 + IRQ_CIC_END - IRQ_CIC_START));
429 sic_mask = ~((~0u) << (1 + IRQ_SIC_END - IRQ_SIC_START));
430
431 /*
432 * Disable all interrupt sources
433 */
434 writel(0xffffffff, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR);
435 writel(0xffffffff, INTCP_VA_PIC_BASE + FIQ_ENABLE_CLEAR);
436 writel(0xffffffff, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR);
437 writel(0xffffffff, INTCP_VA_CIC_BASE + FIQ_ENABLE_CLEAR);
438 writel(sic_mask, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR);
439 writel(sic_mask, INTCP_VA_SIC_BASE + FIQ_ENABLE_CLEAR);
440
441 fpga_irq_init(INTCP_VA_PIC_BASE, "PIC", IRQ_PIC_START,
442 -1, pic_mask, NULL);
443
444 fpga_irq_init(INTCP_VA_CIC_BASE, "CIC", IRQ_CIC_START,
445 -1, cic_mask, NULL);
446
447 fpga_irq_init(INTCP_VA_SIC_BASE, "SIC", IRQ_SIC_START,
448 IRQ_CP_CPPLDINT, sic_mask, NULL);
449
450 integrator_clk_init(true);
369} 451}
370 452
371#define TIMER0_VA_BASE __io_address(INTEGRATOR_TIMER0_BASE) 453#define TIMER0_VA_BASE __io_address(INTEGRATOR_TIMER0_BASE)
@@ -386,6 +468,37 @@ static struct sys_timer cp_timer = {
386 .init = intcp_timer_init, 468 .init = intcp_timer_init,
387}; 469};
388 470
471#define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 }
472#define INTEGRATOR_CP_AACI_IRQS { IRQ_CP_AACIINT }
473
474static AMBA_APB_DEVICE(mmc, "mmci", 0, INTEGRATOR_CP_MMC_BASE,
475 INTEGRATOR_CP_MMC_IRQS, &mmc_data);
476
477static AMBA_APB_DEVICE(aaci, "aaci", 0, INTEGRATOR_CP_AACI_BASE,
478 INTEGRATOR_CP_AACI_IRQS, NULL);
479
480static AMBA_AHB_DEVICE(clcd, "clcd", 0, INTCP_PA_CLCD_BASE,
481 { IRQ_CP_CLCDCINT }, &clcd_data);
482
483static struct amba_device *amba_devs[] __initdata = {
484 &mmc_device,
485 &aaci_device,
486 &clcd_device,
487};
488
489static void __init intcp_init(void)
490{
491 int i;
492
493 platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs));
494
495 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
496 struct amba_device *d = amba_devs[i];
497 amba_device_register(d, &iomem_resource);
498 }
499 integrator_init(true);
500}
501
389MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") 502MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
390 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 503 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
391 .atag_offset = 0x100, 504 .atag_offset = 0x100,
@@ -399,3 +512,5 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
399 .init_machine = intcp_init, 512 .init_machine = intcp_init,
400 .restart = integrator_restart, 513 .restart = integrator_restart,
401MACHINE_END 514MACHINE_END
515
516#endif
diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c
index 466defa9784..7a7f6d3273b 100644
--- a/arch/arm/mach-integrator/leds.c
+++ b/arch/arm/mach-integrator/leds.c
@@ -1,90 +1,125 @@
1/* 1/*
2 * linux/arch/arm/mach-integrator/leds.c 2 * Driver for the 4 user LEDs found on the Integrator AP/CP baseboard
3 * Based on Versatile and RealView machine LED code
3 * 4 *
4 * Integrator/AP and Integrator/CP LED control routines 5 * License terms: GNU General Public License (GPL) version 2
5 * 6 * Author: Bryan Wu <bryan.wu@canonical.com>
6 * Copyright (C) 1999 ARM Limited
7 * Copyright (C) 2000 Deep Blue Solutions Ltd
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */ 7 */
23#include <linux/kernel.h> 8#include <linux/kernel.h>
24#include <linux/init.h> 9#include <linux/init.h>
25#include <linux/smp.h>
26#include <linux/spinlock.h>
27#include <linux/io.h> 10#include <linux/io.h>
11#include <linux/slab.h>
12#include <linux/leds.h>
28 13
14#include <mach/cm.h>
29#include <mach/hardware.h> 15#include <mach/hardware.h>
30#include <mach/platform.h> 16#include <mach/platform.h>
31#include <asm/leds.h>
32#include <asm/mach-types.h>
33#include <mach/cm.h>
34 17
35static int saved_leds; 18#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
19
20#define ALPHA_REG __io_address(INTEGRATOR_DBG_BASE)
21#define LEDREG (__io_address(INTEGRATOR_DBG_BASE) + INTEGRATOR_DBG_LEDS_OFFSET)
36 22
37static void integrator_leds_event(led_event_t ledevt) 23struct integrator_led {
24 struct led_classdev cdev;
25 u8 mask;
26};
27
28/*
29 * The triggers lines up below will only be used if the
30 * LED triggers are compiled in.
31 */
32static const struct {
33 const char *name;
34 const char *trigger;
35} integrator_leds[] = {
36 { "integrator:green0", "heartbeat", },
37 { "integrator:yellow", },
38 { "integrator:red", },
39 { "integrator:green1", },
40 { "integrator:core_module", "cpu0", },
41};
42
43static void integrator_led_set(struct led_classdev *cdev,
44 enum led_brightness b)
38{ 45{
39 unsigned long flags; 46 struct integrator_led *led = container_of(cdev,
40 const unsigned int dbg_base = IO_ADDRESS(INTEGRATOR_DBG_BASE); 47 struct integrator_led, cdev);
41 unsigned int update_alpha_leds; 48 u32 reg = __raw_readl(LEDREG);
42 49
43 // yup, change the LEDs 50 if (b != LED_OFF)
44 local_irq_save(flags); 51 reg |= led->mask;
45 update_alpha_leds = 0; 52 else
53 reg &= ~led->mask;
46 54
47 switch(ledevt) { 55 while (__raw_readl(ALPHA_REG) & 1)
48 case led_idle_start: 56 cpu_relax();
49 cm_control(CM_CTRL_LED, 0);
50 break;
51 57
52 case led_idle_end: 58 __raw_writel(reg, LEDREG);
53 cm_control(CM_CTRL_LED, CM_CTRL_LED); 59}
54 break;
55 60
56 case led_timer: 61static enum led_brightness integrator_led_get(struct led_classdev *cdev)
57 saved_leds ^= GREEN_LED; 62{
58 update_alpha_leds = 1; 63 struct integrator_led *led = container_of(cdev,
59 break; 64 struct integrator_led, cdev);
65 u32 reg = __raw_readl(LEDREG);
60 66
61 case led_red_on: 67 return (reg & led->mask) ? LED_FULL : LED_OFF;
62 saved_leds |= RED_LED; 68}
63 update_alpha_leds = 1;
64 break;
65 69
66 case led_red_off: 70static void cm_led_set(struct led_classdev *cdev,
67 saved_leds &= ~RED_LED; 71 enum led_brightness b)
68 update_alpha_leds = 1; 72{
69 break; 73 if (b != LED_OFF)
74 cm_control(CM_CTRL_LED, CM_CTRL_LED);
75 else
76 cm_control(CM_CTRL_LED, 0);
77}
70 78
71 default: 79static enum led_brightness cm_led_get(struct led_classdev *cdev)
72 break; 80{
73 } 81 u32 reg = readl(CM_CTRL);
74 82
75 if (update_alpha_leds) { 83 return (reg & CM_CTRL_LED) ? LED_FULL : LED_OFF;
76 while (__raw_readl(dbg_base + INTEGRATOR_DBG_ALPHA_OFFSET) & 1);
77 __raw_writel(saved_leds, dbg_base + INTEGRATOR_DBG_LEDS_OFFSET);
78 }
79 local_irq_restore(flags);
80} 84}
81 85
82static int __init leds_init(void) 86static int __init integrator_leds_init(void)
83{ 87{
84 if (machine_is_integrator() || machine_is_cintegrator()) 88 int i;
85 leds_event = integrator_leds_event; 89
90 for (i = 0; i < ARRAY_SIZE(integrator_leds); i++) {
91 struct integrator_led *led;
92
93 led = kzalloc(sizeof(*led), GFP_KERNEL);
94 if (!led)
95 break;
96
97
98 led->cdev.name = integrator_leds[i].name;
99
100 if (i == 4) { /* Setting for LED in core module */
101 led->cdev.brightness_set = cm_led_set;
102 led->cdev.brightness_get = cm_led_get;
103 } else {
104 led->cdev.brightness_set = integrator_led_set;
105 led->cdev.brightness_get = integrator_led_get;
106 }
107
108 led->cdev.default_trigger = integrator_leds[i].trigger;
109 led->mask = BIT(i);
110
111 if (led_classdev_register(NULL, &led->cdev) < 0) {
112 kfree(led);
113 break;
114 }
115 }
86 116
87 return 0; 117 return 0;
88} 118}
89 119
90core_initcall(leds_init); 120/*
121 * Since we may have triggers on any subsystem, defer registration
122 * until after subsystem_init.
123 */
124fs_initcall(integrator_leds_init);
125#endif
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
index b866880e82a..bbeca59df66 100644
--- a/arch/arm/mach-integrator/pci_v3.c
+++ b/arch/arm/mach-integrator/pci_v3.c
@@ -41,61 +41,61 @@
41/* 41/*
42 * The V3 PCI interface chip in Integrator provides several windows from 42 * The V3 PCI interface chip in Integrator provides several windows from
43 * local bus memory into the PCI memory areas. Unfortunately, there 43 * local bus memory into the PCI memory areas. Unfortunately, there
44 * are not really enough windows for our usage, therefore we reuse 44 * are not really enough windows for our usage, therefore we reuse
45 * one of the windows for access to PCI configuration space. The 45 * one of the windows for access to PCI configuration space. The
46 * memory map is as follows: 46 * memory map is as follows:
47 * 47 *
48 * Local Bus Memory Usage 48 * Local Bus Memory Usage
49 * 49 *
50 * 40000000 - 4FFFFFFF PCI memory. 256M non-prefetchable 50 * 40000000 - 4FFFFFFF PCI memory. 256M non-prefetchable
51 * 50000000 - 5FFFFFFF PCI memory. 256M prefetchable 51 * 50000000 - 5FFFFFFF PCI memory. 256M prefetchable
52 * 60000000 - 60FFFFFF PCI IO. 16M 52 * 60000000 - 60FFFFFF PCI IO. 16M
53 * 61000000 - 61FFFFFF PCI Configuration. 16M 53 * 61000000 - 61FFFFFF PCI Configuration. 16M
54 * 54 *
55 * There are three V3 windows, each described by a pair of V3 registers. 55 * There are three V3 windows, each described by a pair of V3 registers.
56 * These are LB_BASE0/LB_MAP0, LB_BASE1/LB_MAP1 and LB_BASE2/LB_MAP2. 56 * These are LB_BASE0/LB_MAP0, LB_BASE1/LB_MAP1 and LB_BASE2/LB_MAP2.
57 * Base0 and Base1 can be used for any type of PCI memory access. Base2 57 * Base0 and Base1 can be used for any type of PCI memory access. Base2
58 * can be used either for PCI I/O or for I20 accesses. By default, uHAL 58 * can be used either for PCI I/O or for I20 accesses. By default, uHAL
59 * uses this only for PCI IO space. 59 * uses this only for PCI IO space.
60 * 60 *
61 * Normally these spaces are mapped using the following base registers: 61 * Normally these spaces are mapped using the following base registers:
62 * 62 *
63 * Usage Local Bus Memory Base/Map registers used 63 * Usage Local Bus Memory Base/Map registers used
64 * 64 *
65 * Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0 65 * Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0
66 * Mem 50000000 - 5FFFFFFF LB_BASE1/LB_MAP1 66 * Mem 50000000 - 5FFFFFFF LB_BASE1/LB_MAP1
67 * IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2 67 * IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2
68 * Cfg 61000000 - 61FFFFFF 68 * Cfg 61000000 - 61FFFFFF
69 * 69 *
70 * This means that I20 and PCI configuration space accesses will fail. 70 * This means that I20 and PCI configuration space accesses will fail.
71 * When PCI configuration accesses are needed (via the uHAL PCI 71 * When PCI configuration accesses are needed (via the uHAL PCI
72 * configuration space primitives) we must remap the spaces as follows: 72 * configuration space primitives) we must remap the spaces as follows:
73 * 73 *
74 * Usage Local Bus Memory Base/Map registers used 74 * Usage Local Bus Memory Base/Map registers used
75 * 75 *
76 * Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0 76 * Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0
77 * Mem 50000000 - 5FFFFFFF LB_BASE0/LB_MAP0 77 * Mem 50000000 - 5FFFFFFF LB_BASE0/LB_MAP0
78 * IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2 78 * IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2
79 * Cfg 61000000 - 61FFFFFF LB_BASE1/LB_MAP1 79 * Cfg 61000000 - 61FFFFFF LB_BASE1/LB_MAP1
80 * 80 *
81 * To make this work, the code depends on overlapping windows working. 81 * To make this work, the code depends on overlapping windows working.
82 * The V3 chip translates an address by checking its range within 82 * The V3 chip translates an address by checking its range within
83 * each of the BASE/MAP pairs in turn (in ascending register number 83 * each of the BASE/MAP pairs in turn (in ascending register number
84 * order). It will use the first matching pair. So, for example, 84 * order). It will use the first matching pair. So, for example,
85 * if the same address is mapped by both LB_BASE0/LB_MAP0 and 85 * if the same address is mapped by both LB_BASE0/LB_MAP0 and
86 * LB_BASE1/LB_MAP1, the V3 will use the translation from 86 * LB_BASE1/LB_MAP1, the V3 will use the translation from
87 * LB_BASE0/LB_MAP0. 87 * LB_BASE0/LB_MAP0.
88 * 88 *
89 * To allow PCI Configuration space access, the code enlarges the 89 * To allow PCI Configuration space access, the code enlarges the
90 * window mapped by LB_BASE0/LB_MAP0 from 256M to 512M. This occludes 90 * window mapped by LB_BASE0/LB_MAP0 from 256M to 512M. This occludes
91 * the windows currently mapped by LB_BASE1/LB_MAP1 so that it can 91 * the windows currently mapped by LB_BASE1/LB_MAP1 so that it can
92 * be remapped for use by configuration cycles. 92 * be remapped for use by configuration cycles.
93 * 93 *
94 * At the end of the PCI Configuration space accesses, 94 * At the end of the PCI Configuration space accesses,
95 * LB_BASE1/LB_MAP1 is reset to map PCI Memory. Finally the window 95 * LB_BASE1/LB_MAP1 is reset to map PCI Memory. Finally the window
96 * mapped by LB_BASE0/LB_MAP0 is reduced in size from 512M to 256M to 96 * mapped by LB_BASE0/LB_MAP0 is reduced in size from 512M to 256M to
97 * reveal the now restored LB_BASE1/LB_MAP1 window. 97 * reveal the now restored LB_BASE1/LB_MAP1 window.
98 * 98 *
99 * NOTE: We do not set up I2O mapping. I suspect that this is only 99 * NOTE: We do not set up I2O mapping. I suspect that this is only
100 * for an intelligent (target) device. Using I2O disables most of 100 * for an intelligent (target) device. Using I2O disables most of
101 * the mappings into PCI memory. 101 * the mappings into PCI memory.
@@ -127,8 +127,8 @@
127 * 127 *
128 * returns: configuration address to play on the PCI bus 128 * returns: configuration address to play on the PCI bus
129 * 129 *
130 * To generate the appropriate PCI configuration cycles in the PCI 130 * To generate the appropriate PCI configuration cycles in the PCI
131 * configuration address space, you present the V3 with the following pattern 131 * configuration address space, you present the V3 with the following pattern
132 * (which is very nearly a type 1 (except that the lower two bits are 00 and 132 * (which is very nearly a type 1 (except that the lower two bits are 00 and
133 * not 01). In order for this mapping to work you need to set up one of 133 * not 01). In order for this mapping to work you need to set up one of
134 * the local to PCI aperatures to 16Mbytes in length translating to 134 * the local to PCI aperatures to 16Mbytes in length translating to
@@ -138,7 +138,7 @@
138 * 138 *
139 * Type 0: 139 * Type 0:
140 * 140 *
141 * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1 141 * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1
142 * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0 142 * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0
143 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 143 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
144 * | | |D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|0| 144 * | | |D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|0|
@@ -150,7 +150,7 @@
150 * 150 *
151 * Type 1: 151 * Type 1:
152 * 152 *
153 * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1 153 * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1
154 * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0 154 * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0
155 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 155 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
156 * | | | | | | | | | | |B|B|B|B|B|B|B|B|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|1| 156 * | | | | | | | | | | |B|B|B|B|B|B|B|B|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|1|
@@ -161,7 +161,7 @@
161 * 15:11 Device number (5 bits) 161 * 15:11 Device number (5 bits)
162 * 10:8 function number 162 * 10:8 function number
163 * 7:2 register number 163 * 7:2 register number
164 * 164 *
165 */ 165 */
166static DEFINE_RAW_SPINLOCK(v3_lock); 166static DEFINE_RAW_SPINLOCK(v3_lock);
167 167
@@ -181,7 +181,7 @@ static DEFINE_RAW_SPINLOCK(v3_lock);
181#undef V3_LB_BASE_PREFETCH 181#undef V3_LB_BASE_PREFETCH
182#define V3_LB_BASE_PREFETCH 0 182#define V3_LB_BASE_PREFETCH 0
183 183
184static unsigned long v3_open_config_window(struct pci_bus *bus, 184static void __iomem *v3_open_config_window(struct pci_bus *bus,
185 unsigned int devfn, int offset) 185 unsigned int devfn, int offset)
186{ 186{
187 unsigned int address, mapaddress, busnr; 187 unsigned int address, mapaddress, busnr;
@@ -280,7 +280,7 @@ static void v3_close_config_window(void)
280static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where, 280static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where,
281 int size, u32 *val) 281 int size, u32 *val)
282{ 282{
283 unsigned long addr; 283 void __iomem *addr;
284 unsigned long flags; 284 unsigned long flags;
285 u32 v; 285 u32 v;
286 286
@@ -311,7 +311,7 @@ static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where,
311static int v3_write_config(struct pci_bus *bus, unsigned int devfn, int where, 311static int v3_write_config(struct pci_bus *bus, unsigned int devfn, int where,
312 int size, u32 val) 312 int size, u32 val)
313{ 313{
314 unsigned long addr; 314 void __iomem *addr;
315 unsigned long flags; 315 unsigned long flags;
316 316
317 raw_spin_lock_irqsave(&v3_lock, flags); 317 raw_spin_lock_irqsave(&v3_lock, flags);
@@ -374,12 +374,9 @@ static int __init pci_v3_setup_resources(struct pci_sys_data *sys)
374 } 374 }
375 375
376 /* 376 /*
377 * the IO resource for this bus
378 * the mem resource for this bus 377 * the mem resource for this bus
379 * the prefetch mem resource for this bus 378 * the prefetch mem resource for this bus
380 */ 379 */
381 pci_add_resource_offset(&sys->resources,
382 &ioport_resource, sys->io_offset);
383 pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset); 380 pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset);
384 pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset); 381 pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset);
385 382
@@ -391,9 +388,9 @@ static int __init pci_v3_setup_resources(struct pci_sys_data *sys)
391 * means I can't get additional information on the reason for the pm2fb 388 * means I can't get additional information on the reason for the pm2fb
392 * problems. I suppose I'll just have to mind-meld with the machine. ;) 389 * problems. I suppose I'll just have to mind-meld with the machine. ;)
393 */ 390 */
394#define SC_PCI IO_ADDRESS(INTEGRATOR_SC_PCIENABLE) 391#define SC_PCI __io_address(INTEGRATOR_SC_PCIENABLE)
395#define SC_LBFADDR IO_ADDRESS(INTEGRATOR_SC_BASE + 0x20) 392#define SC_LBFADDR __io_address(INTEGRATOR_SC_BASE + 0x20)
396#define SC_LBFCODE IO_ADDRESS(INTEGRATOR_SC_BASE + 0x24) 393#define SC_LBFCODE __io_address(INTEGRATOR_SC_BASE + 0x24)
397 394
398static int 395static int
399v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) 396v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
@@ -498,7 +495,6 @@ void __init pci_v3_preinit(void)
498 unsigned int temp; 495 unsigned int temp;
499 int ret; 496 int ret;
500 497
501 pcibios_min_io = 0x6000;
502 pcibios_min_mem = 0x00100000; 498 pcibios_min_mem = 0x00100000;
503 499
504 /* 500 /*
diff --git a/arch/arm/mach-iop13xx/include/mach/io.h b/arch/arm/mach-iop13xx/include/mach/io.h
deleted file mode 100644
index f1318851802..00000000000
--- a/arch/arm/mach-iop13xx/include/mach/io.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * iop13xx custom ioremap implementation
3 * Copyright (c) 2005-2006, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 *
18 */
19#ifndef __ASM_ARM_ARCH_IO_H
20#define __ASM_ARM_ARCH_IO_H
21
22#define IO_SPACE_LIMIT 0xffffffff
23
24#define __io(a) __iop13xx_io(a)
25
26extern void __iomem * __iop13xx_io(unsigned long io_addr);
27
28#endif
diff --git a/arch/arm/mach-iop13xx/include/mach/iop13xx.h b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
index e190dcd7d72..7480f58267a 100644
--- a/arch/arm/mach-iop13xx/include/mach/iop13xx.h
+++ b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
@@ -69,21 +69,11 @@ extern unsigned long get_iop_tick_rate(void);
69 * 0x8000.0000 + 928M 0x2.8000.0000 (ioremap) PCIE outbound memory window 69 * 0x8000.0000 + 928M 0x2.8000.0000 (ioremap) PCIE outbound memory window
70 * 70 *
71 * IO MAP 71 * IO MAP
72 * 0x1000 + 64K 0x0.fffb.1000 0xfec6.1000 PCIX outbound i/o window 72 * 0x00000 + 64K 0x0.fffb.0000 0xfee0.0000 PCIX outbound i/o window
73 * 0x1000 + 64K 0x0.fffd.1000 0xfed7.1000 PCIE outbound i/o window 73 * 0x10000 + 64K 0x0.fffd.0000 0xfee1.0000 PCIE outbound i/o window
74 */ 74 */
75#define IOP13XX_PCIX_IO_WINDOW_SIZE 0x10000UL
76#define IOP13XX_PCIX_LOWER_IO_PA 0xfffb0000UL 75#define IOP13XX_PCIX_LOWER_IO_PA 0xfffb0000UL
77#define IOP13XX_PCIX_LOWER_IO_VA 0xfec60000UL
78#define IOP13XX_PCIX_LOWER_IO_BA 0x0UL /* OIOTVR */ 76#define IOP13XX_PCIX_LOWER_IO_BA 0x0UL /* OIOTVR */
79#define IOP13XX_PCIX_IO_BUS_OFFSET 0x1000UL
80#define IOP13XX_PCIX_UPPER_IO_PA (IOP13XX_PCIX_LOWER_IO_PA +\
81 IOP13XX_PCIX_IO_WINDOW_SIZE - 1)
82#define IOP13XX_PCIX_UPPER_IO_VA (IOP13XX_PCIX_LOWER_IO_VA +\
83 IOP13XX_PCIX_IO_WINDOW_SIZE - 1)
84#define IOP13XX_PCIX_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\
85 (IOP13XX_PCIX_LOWER_IO_PA\
86 - IOP13XX_PCIX_LOWER_IO_VA))
87 77
88#define IOP13XX_PCIX_MEM_PHYS_OFFSET 0x100000000ULL 78#define IOP13XX_PCIX_MEM_PHYS_OFFSET 0x100000000ULL
89#define IOP13XX_PCIX_MEM_WINDOW_SIZE 0x3a000000UL 79#define IOP13XX_PCIX_MEM_WINDOW_SIZE 0x3a000000UL
@@ -103,20 +93,8 @@ extern unsigned long get_iop_tick_rate(void);
103 IOP13XX_PCIX_LOWER_MEM_BA) 93 IOP13XX_PCIX_LOWER_MEM_BA)
104 94
105/* PCI-E ranges */ 95/* PCI-E ranges */
106#define IOP13XX_PCIE_IO_WINDOW_SIZE 0x10000UL
107#define IOP13XX_PCIE_LOWER_IO_PA 0xfffd0000UL 96#define IOP13XX_PCIE_LOWER_IO_PA 0xfffd0000UL
108#define IOP13XX_PCIE_LOWER_IO_VA 0xfed70000UL 97#define IOP13XX_PCIE_LOWER_IO_BA 0x10000UL /* OIOTVR */
109#define IOP13XX_PCIE_LOWER_IO_BA 0x0UL /* OIOTVR */
110#define IOP13XX_PCIE_IO_BUS_OFFSET 0x1000UL
111#define IOP13XX_PCIE_UPPER_IO_PA (IOP13XX_PCIE_LOWER_IO_PA +\
112 IOP13XX_PCIE_IO_WINDOW_SIZE - 1)
113#define IOP13XX_PCIE_UPPER_IO_VA (IOP13XX_PCIE_LOWER_IO_VA +\
114 IOP13XX_PCIE_IO_WINDOW_SIZE - 1)
115#define IOP13XX_PCIE_UPPER_IO_BA (IOP13XX_PCIE_LOWER_IO_BA +\
116 IOP13XX_PCIE_IO_WINDOW_SIZE - 1)
117#define IOP13XX_PCIE_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\
118 (IOP13XX_PCIE_LOWER_IO_PA\
119 - IOP13XX_PCIE_LOWER_IO_VA))
120 98
121#define IOP13XX_PCIE_MEM_PHYS_OFFSET 0x200000000ULL 99#define IOP13XX_PCIE_MEM_PHYS_OFFSET 0x200000000ULL
122#define IOP13XX_PCIE_MEM_WINDOW_SIZE 0x3a000000UL 100#define IOP13XX_PCIE_MEM_WINDOW_SIZE 0x3a000000UL
@@ -148,18 +126,16 @@ extern unsigned long get_iop_tick_rate(void);
148 * IOP13XX chipset registers 126 * IOP13XX chipset registers
149 */ 127 */
150#define IOP13XX_PMMR_PHYS_MEM_BASE 0xffd80000UL /* PMMR phys. address */ 128#define IOP13XX_PMMR_PHYS_MEM_BASE 0xffd80000UL /* PMMR phys. address */
151#define IOP13XX_PMMR_VIRT_MEM_BASE 0xfee80000UL /* PMMR phys. address */ 129#define IOP13XX_PMMR_VIRT_MEM_BASE (void __iomem *)(0xfee80000UL) /* PMMR phys. address */
152#define IOP13XX_PMMR_MEM_WINDOW_SIZE 0x80000 130#define IOP13XX_PMMR_MEM_WINDOW_SIZE 0x80000
153#define IOP13XX_PMMR_UPPER_MEM_VA (IOP13XX_PMMR_VIRT_MEM_BASE +\ 131#define IOP13XX_PMMR_UPPER_MEM_VA (IOP13XX_PMMR_VIRT_MEM_BASE +\
154 IOP13XX_PMMR_MEM_WINDOW_SIZE - 1) 132 IOP13XX_PMMR_MEM_WINDOW_SIZE - 1)
155#define IOP13XX_PMMR_UPPER_MEM_PA (IOP13XX_PMMR_PHYS_MEM_BASE +\ 133#define IOP13XX_PMMR_UPPER_MEM_PA (IOP13XX_PMMR_PHYS_MEM_BASE +\
156 IOP13XX_PMMR_MEM_WINDOW_SIZE - 1) 134 IOP13XX_PMMR_MEM_WINDOW_SIZE - 1)
157#define IOP13XX_PMMR_VIRT_TO_PHYS(addr) (u32) ((u32) addr +\ 135#define IOP13XX_PMMR_VIRT_TO_PHYS(addr) (((addr) - IOP13XX_PMMR_VIRT_MEM_BASE)\
158 (IOP13XX_PMMR_PHYS_MEM_BASE\ 136 + IOP13XX_PMMR_PHYS_MEM_BASE)
159 - IOP13XX_PMMR_VIRT_MEM_BASE)) 137#define IOP13XX_PMMR_PHYS_TO_VIRT(addr) (((addr) - IOP13XX_PMMR_PHYS_MEM_BASE)\
160#define IOP13XX_PMMR_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\ 138 + IOP13XX_PMMR_VIRT_MEM_BASE)
161 (IOP13XX_PMMR_PHYS_MEM_BASE\
162 - IOP13XX_PMMR_VIRT_MEM_BASE))
163#define IOP13XX_REG_ADDR32(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) 139#define IOP13XX_REG_ADDR32(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg))
164#define IOP13XX_REG_ADDR16(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) 140#define IOP13XX_REG_ADDR16(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg))
165#define IOP13XX_REG_ADDR8(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) 141#define IOP13XX_REG_ADDR8(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg))
@@ -169,10 +145,10 @@ extern unsigned long get_iop_tick_rate(void);
169#define IOP13XX_PMMR_SIZE 0x00080000 145#define IOP13XX_PMMR_SIZE 0x00080000
170 146
171/*=================== Defines for Platform Devices =====================*/ 147/*=================== Defines for Platform Devices =====================*/
172#define IOP13XX_UART0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002300) 148#define IOP13XX_UART0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE + 0x00002300)
173#define IOP13XX_UART1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002340) 149#define IOP13XX_UART1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE + 0x00002340)
174#define IOP13XX_UART0_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE | 0x00002300) 150#define IOP13XX_UART0_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE + 0x00002300)
175#define IOP13XX_UART1_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE | 0x00002340) 151#define IOP13XX_UART1_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE + 0x00002340)
176 152
177#define IOP13XX_I2C0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002500) 153#define IOP13XX_I2C0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002500)
178#define IOP13XX_I2C1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002520) 154#define IOP13XX_I2C1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002520)
diff --git a/arch/arm/mach-iop13xx/include/mach/memory.h b/arch/arm/mach-iop13xx/include/mach/memory.h
index 1afa99ef97f..7c032d0ab24 100644
--- a/arch/arm/mach-iop13xx/include/mach/memory.h
+++ b/arch/arm/mach-iop13xx/include/mach/memory.h
@@ -16,12 +16,12 @@
16#define IOP13XX_PMMR_P_START (IOP13XX_PMMR_PHYS_MEM_BASE) 16#define IOP13XX_PMMR_P_START (IOP13XX_PMMR_PHYS_MEM_BASE)
17#define IOP13XX_PMMR_P_END (IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_SIZE) 17#define IOP13XX_PMMR_P_END (IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_SIZE)
18 18
19static inline dma_addr_t __virt_to_lbus(unsigned long x) 19static inline dma_addr_t __virt_to_lbus(void __iomem *x)
20{ 20{
21 return x + IOP13XX_PMMR_PHYS_MEM_BASE - IOP13XX_PMMR_VIRT_MEM_BASE; 21 return x + IOP13XX_PMMR_PHYS_MEM_BASE - IOP13XX_PMMR_VIRT_MEM_BASE;
22} 22}
23 23
24static inline unsigned long __lbus_to_virt(dma_addr_t x) 24static inline void __iomem *__lbus_to_virt(dma_addr_t x)
25{ 25{
26 return x + IOP13XX_PMMR_VIRT_MEM_BASE - IOP13XX_PMMR_PHYS_MEM_BASE; 26 return x + IOP13XX_PMMR_VIRT_MEM_BASE - IOP13XX_PMMR_PHYS_MEM_BASE;
27} 27}
@@ -38,23 +38,23 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x)
38 38
39#define __arch_dma_to_virt(dev, addr) \ 39#define __arch_dma_to_virt(dev, addr) \
40 ({ \ 40 ({ \
41 unsigned long __virt; \ 41 void * __virt; \
42 dma_addr_t __dma = addr; \ 42 dma_addr_t __dma = addr; \
43 if (is_lbus_device(dev) && __is_lbus_dma(__dma)) \ 43 if (is_lbus_device(dev) && __is_lbus_dma(__dma)) \
44 __virt = __lbus_to_virt(__dma); \ 44 __virt = __lbus_to_virt(__dma); \
45 else \ 45 else \
46 __virt = __phys_to_virt(__dma); \ 46 __virt = (void *)__phys_to_virt(__dma); \
47 (void *)__virt; \ 47 __virt; \
48 }) 48 })
49 49
50#define __arch_virt_to_dma(dev, addr) \ 50#define __arch_virt_to_dma(dev, addr) \
51 ({ \ 51 ({ \
52 unsigned long __virt = (unsigned long)addr; \ 52 void * __virt = addr; \
53 dma_addr_t __dma; \ 53 dma_addr_t __dma; \
54 if (is_lbus_device(dev) && __is_lbus_virt(__virt)) \ 54 if (is_lbus_device(dev) && __is_lbus_virt(__virt)) \
55 __dma = __virt_to_lbus(__virt); \ 55 __dma = __virt_to_lbus(__virt); \
56 else \ 56 else \
57 __dma = __virt_to_phys(__virt); \ 57 __dma = __virt_to_phys((unsigned long)__virt); \
58 __dma; \ 58 __dma; \
59 }) 59 })
60 60
diff --git a/arch/arm/mach-iop13xx/io.c b/arch/arm/mach-iop13xx/io.c
index 3c364198db9..183dc8b5511 100644
--- a/arch/arm/mach-iop13xx/io.c
+++ b/arch/arm/mach-iop13xx/io.c
@@ -23,25 +23,6 @@
23 23
24#include "pci.h" 24#include "pci.h"
25 25
26void * __iomem __iop13xx_io(unsigned long io_addr)
27{
28 void __iomem * io_virt;
29
30 switch (io_addr) {
31 case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA:
32 io_virt = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(io_addr);
33 break;
34 case IOP13XX_PCIX_LOWER_IO_PA ... IOP13XX_PCIX_UPPER_IO_PA:
35 io_virt = (void *) IOP13XX_PCIX_IO_PHYS_TO_VIRT(io_addr);
36 break;
37 default:
38 BUG();
39 }
40
41 return io_virt;
42}
43EXPORT_SYMBOL(__iop13xx_io);
44
45static void __iomem *__iop13xx_ioremap_caller(unsigned long cookie, 26static void __iomem *__iop13xx_ioremap_caller(unsigned long cookie,
46 size_t size, unsigned int mtype, void *caller) 27 size_t size, unsigned int mtype, void *caller)
47{ 28{
@@ -52,14 +33,14 @@ static void __iomem *__iop13xx_ioremap_caller(unsigned long cookie,
52 if (unlikely(!iop13xx_atux_mem_base)) 33 if (unlikely(!iop13xx_atux_mem_base))
53 retval = NULL; 34 retval = NULL;
54 else 35 else
55 retval = (void *)(iop13xx_atux_mem_base + 36 retval = (iop13xx_atux_mem_base +
56 (cookie - IOP13XX_PCIX_LOWER_MEM_RA)); 37 (cookie - IOP13XX_PCIX_LOWER_MEM_RA));
57 break; 38 break;
58 case IOP13XX_PCIE_LOWER_MEM_RA ... IOP13XX_PCIE_UPPER_MEM_RA: 39 case IOP13XX_PCIE_LOWER_MEM_RA ... IOP13XX_PCIE_UPPER_MEM_RA:
59 if (unlikely(!iop13xx_atue_mem_base)) 40 if (unlikely(!iop13xx_atue_mem_base))
60 retval = NULL; 41 retval = NULL;
61 else 42 else
62 retval = (void *)(iop13xx_atue_mem_base + 43 retval = (iop13xx_atue_mem_base +
63 (cookie - IOP13XX_PCIE_LOWER_MEM_RA)); 44 (cookie - IOP13XX_PCIE_LOWER_MEM_RA));
64 break; 45 break;
65 case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA: 46 case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA:
@@ -67,14 +48,8 @@ static void __iomem *__iop13xx_ioremap_caller(unsigned long cookie,
67 (cookie - IOP13XX_PBI_LOWER_MEM_RA), 48 (cookie - IOP13XX_PBI_LOWER_MEM_RA),
68 size, mtype, __builtin_return_address(0)); 49 size, mtype, __builtin_return_address(0));
69 break; 50 break;
70 case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA:
71 retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie);
72 break;
73 case IOP13XX_PCIX_LOWER_IO_PA ... IOP13XX_PCIX_UPPER_IO_PA:
74 retval = (void *) IOP13XX_PCIX_IO_PHYS_TO_VIRT(cookie);
75 break;
76 case IOP13XX_PMMR_PHYS_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_PA: 51 case IOP13XX_PMMR_PHYS_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_PA:
77 retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie); 52 retval = IOP13XX_PMMR_PHYS_TO_VIRT(cookie);
78 break; 53 break;
79 default: 54 default:
80 retval = __arm_ioremap_caller(cookie, size, mtype, 55 retval = __arm_ioremap_caller(cookie, size, mtype,
@@ -99,9 +74,7 @@ static void __iop13xx_iounmap(volatile void __iomem *addr)
99 goto skip; 74 goto skip;
100 75
101 switch ((u32) addr) { 76 switch ((u32) addr) {
102 case IOP13XX_PCIE_LOWER_IO_VA ... IOP13XX_PCIE_UPPER_IO_VA: 77 case (u32)IOP13XX_PMMR_VIRT_MEM_BASE ... (u32)IOP13XX_PMMR_UPPER_MEM_VA:
103 case IOP13XX_PCIX_LOWER_IO_VA ... IOP13XX_PCIX_UPPER_IO_VA:
104 case IOP13XX_PMMR_VIRT_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_VA:
105 goto skip; 78 goto skip;
106 } 79 }
107 __iounmap(addr); 80 __iounmap(addr);
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c b/arch/arm/mach-iop13xx/iq81340sc.c
index 060cddde2fd..e9474411163 100644
--- a/arch/arm/mach-iop13xx/iq81340sc.c
+++ b/arch/arm/mach-iop13xx/iq81340sc.c
@@ -30,7 +30,7 @@
30extern int init_atu; 30extern int init_atu;
31 31
32static int __init 32static int __init
33iq81340sc_atux_map_irq(struct pci_dev *dev, u8 idsel, u8 pin) 33iq81340sc_atux_map_irq(const struct pci_dev *dev, u8 idsel, u8 pin)
34{ 34{
35 WARN_ON(idsel < 1 || idsel > 2); 35 WARN_ON(idsel < 1 || idsel > 2);
36 36
diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
index 861cb12ef43..2f28018c444 100644
--- a/arch/arm/mach-iop13xx/pci.c
+++ b/arch/arm/mach-iop13xx/pci.c
@@ -36,8 +36,8 @@ u32 iop13xx_atux_pmmr_offset; /* This offset can change based on strapping */
36u32 iop13xx_atue_pmmr_offset; /* This offset can change based on strapping */ 36u32 iop13xx_atue_pmmr_offset; /* This offset can change based on strapping */
37static struct pci_bus *pci_bus_atux = 0; 37static struct pci_bus *pci_bus_atux = 0;
38static struct pci_bus *pci_bus_atue = 0; 38static struct pci_bus *pci_bus_atue = 0;
39u32 iop13xx_atue_mem_base; 39void __iomem *iop13xx_atue_mem_base;
40u32 iop13xx_atux_mem_base; 40void __iomem *iop13xx_atux_mem_base;
41size_t iop13xx_atue_mem_size; 41size_t iop13xx_atue_mem_size;
42size_t iop13xx_atux_mem_size; 42size_t iop13xx_atux_mem_size;
43 43
@@ -88,8 +88,7 @@ void iop13xx_map_pci_memory(void)
88 } 88 }
89 89
90 if (end) { 90 if (end) {
91 iop13xx_atux_mem_base = 91 iop13xx_atux_mem_base = __arm_ioremap_pfn(
92 (u32) __arm_ioremap_pfn(
93 __phys_to_pfn(IOP13XX_PCIX_LOWER_MEM_PA) 92 __phys_to_pfn(IOP13XX_PCIX_LOWER_MEM_PA)
94 , 0, iop13xx_atux_mem_size, MT_DEVICE); 93 , 0, iop13xx_atux_mem_size, MT_DEVICE);
95 if (!iop13xx_atux_mem_base) { 94 if (!iop13xx_atux_mem_base) {
@@ -99,7 +98,7 @@ void iop13xx_map_pci_memory(void)
99 } 98 }
100 } else 99 } else
101 iop13xx_atux_mem_size = 0; 100 iop13xx_atux_mem_size = 0;
102 PRINTK("%s: atu: %d bus_size: %d mem_base: %x\n", 101 PRINTK("%s: atu: %d bus_size: %d mem_base: %p\n",
103 __func__, atu, iop13xx_atux_mem_size, 102 __func__, atu, iop13xx_atux_mem_size,
104 iop13xx_atux_mem_base); 103 iop13xx_atux_mem_base);
105 break; 104 break;
@@ -114,8 +113,7 @@ void iop13xx_map_pci_memory(void)
114 } 113 }
115 114
116 if (end) { 115 if (end) {
117 iop13xx_atue_mem_base = 116 iop13xx_atue_mem_base = __arm_ioremap_pfn(
118 (u32) __arm_ioremap_pfn(
119 __phys_to_pfn(IOP13XX_PCIE_LOWER_MEM_PA) 117 __phys_to_pfn(IOP13XX_PCIE_LOWER_MEM_PA)
120 , 0, iop13xx_atue_mem_size, MT_DEVICE); 118 , 0, iop13xx_atue_mem_size, MT_DEVICE);
121 if (!iop13xx_atue_mem_base) { 119 if (!iop13xx_atue_mem_base) {
@@ -125,13 +123,13 @@ void iop13xx_map_pci_memory(void)
125 } 123 }
126 } else 124 } else
127 iop13xx_atue_mem_size = 0; 125 iop13xx_atue_mem_size = 0;
128 PRINTK("%s: atu: %d bus_size: %d mem_base: %x\n", 126 PRINTK("%s: atu: %d bus_size: %d mem_base: %p\n",
129 __func__, atu, iop13xx_atue_mem_size, 127 __func__, atu, iop13xx_atue_mem_size,
130 iop13xx_atue_mem_base); 128 iop13xx_atue_mem_base);
131 break; 129 break;
132 } 130 }
133 131
134 printk("%s: Initialized (%uM @ resource/virtual: %08lx/%08x)\n", 132 printk("%s: Initialized (%uM @ resource/virtual: %08lx/%p)\n",
135 atu ? "ATUE" : "ATUX", 133 atu ? "ATUE" : "ATUX",
136 (atu ? iop13xx_atue_mem_size : iop13xx_atux_mem_size) / 134 (atu ? iop13xx_atue_mem_size : iop13xx_atux_mem_size) /
137 SZ_1M, 135 SZ_1M,
@@ -506,7 +504,7 @@ iop13xx_pci_abort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
506 504
507/* Scan an IOP13XX PCI bus. nr selects which ATU we use. 505/* Scan an IOP13XX PCI bus. nr selects which ATU we use.
508 */ 506 */
509struct pci_bus *iop13xx_scan_bus(int nr, struct pci_sys_data *sys) 507struct pci_bus * __devinit iop13xx_scan_bus(int nr, struct pci_sys_data *sys)
510{ 508{
511 int which_atu; 509 int which_atu;
512 struct pci_bus *bus = NULL; 510 struct pci_bus *bus = NULL;
@@ -970,7 +968,6 @@ void __init iop13xx_pci_init(void)
970 __raw_writel(__raw_readl(IOP13XX_XBG_BECSR) & 3, IOP13XX_XBG_BECSR); 968 __raw_writel(__raw_readl(IOP13XX_XBG_BECSR) & 3, IOP13XX_XBG_BECSR);
971 969
972 /* Setup the Min Address for PCI memory... */ 970 /* Setup the Min Address for PCI memory... */
973 pcibios_min_io = 0;
974 pcibios_min_mem = IOP13XX_PCIX_LOWER_MEM_BA; 971 pcibios_min_mem = IOP13XX_PCIX_LOWER_MEM_BA;
975 972
976 /* if Linux is given control of an ATU 973 /* if Linux is given control of an ATU
@@ -1003,7 +1000,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1003 if (nr > 1) 1000 if (nr > 1)
1004 return 0; 1001 return 0;
1005 1002
1006 res = kcalloc(2, sizeof(struct resource), GFP_KERNEL); 1003 res = kzalloc(sizeof(struct resource), GFP_KERNEL);
1007 if (!res) 1004 if (!res)
1008 panic("PCI: unable to alloc resources"); 1005 panic("PCI: unable to alloc resources");
1009 1006
@@ -1042,17 +1039,13 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1042 << IOP13XX_ATUX_PCIXSR_FUNC_NUM; 1039 << IOP13XX_ATUX_PCIXSR_FUNC_NUM;
1043 __raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR); 1040 __raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR);
1044 1041
1045 res[0].start = IOP13XX_PCIX_LOWER_IO_PA + IOP13XX_PCIX_IO_BUS_OFFSET; 1042 pci_ioremap_io(0, IOP13XX_PCIX_LOWER_IO_PA);
1046 res[0].end = IOP13XX_PCIX_UPPER_IO_PA;
1047 res[0].name = "IQ81340 ATUX PCI I/O Space";
1048 res[0].flags = IORESOURCE_IO;
1049 1043
1050 res[1].start = IOP13XX_PCIX_LOWER_MEM_RA; 1044 res->start = IOP13XX_PCIX_LOWER_MEM_RA;
1051 res[1].end = IOP13XX_PCIX_UPPER_MEM_RA; 1045 res->end = IOP13XX_PCIX_UPPER_MEM_RA;
1052 res[1].name = "IQ81340 ATUX PCI Memory Space"; 1046 res->name = "IQ81340 ATUX PCI Memory Space";
1053 res[1].flags = IORESOURCE_MEM; 1047 res->flags = IORESOURCE_MEM;
1054 sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET; 1048 sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET;
1055 sys->io_offset = IOP13XX_PCIX_LOWER_IO_PA;
1056 break; 1049 break;
1057 case IOP13XX_INIT_ATU_ATUE: 1050 case IOP13XX_INIT_ATU_ATUE:
1058 /* Note: the function number field in the PCSR is ro */ 1051 /* Note: the function number field in the PCSR is ro */
@@ -1063,17 +1056,13 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1063 1056
1064 __raw_writel(pcsr, IOP13XX_ATUE_PCSR); 1057 __raw_writel(pcsr, IOP13XX_ATUE_PCSR);
1065 1058
1066 res[0].start = IOP13XX_PCIE_LOWER_IO_PA + IOP13XX_PCIE_IO_BUS_OFFSET; 1059 pci_ioremap_io(SZ_64K, IOP13XX_PCIE_LOWER_IO_PA);
1067 res[0].end = IOP13XX_PCIE_UPPER_IO_PA;
1068 res[0].name = "IQ81340 ATUE PCI I/O Space";
1069 res[0].flags = IORESOURCE_IO;
1070 1060
1071 res[1].start = IOP13XX_PCIE_LOWER_MEM_RA; 1061 res->start = IOP13XX_PCIE_LOWER_MEM_RA;
1072 res[1].end = IOP13XX_PCIE_UPPER_MEM_RA; 1062 res->end = IOP13XX_PCIE_UPPER_MEM_RA;
1073 res[1].name = "IQ81340 ATUE PCI Memory Space"; 1063 res->name = "IQ81340 ATUE PCI Memory Space";
1074 res[1].flags = IORESOURCE_MEM; 1064 res->flags = IORESOURCE_MEM;
1075 sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET; 1065 sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET;
1076 sys->io_offset = IOP13XX_PCIE_LOWER_IO_PA;
1077 sys->map_irq = iop13xx_pcie_map_irq; 1066 sys->map_irq = iop13xx_pcie_map_irq;
1078 break; 1067 break;
1079 default: 1068 default:
@@ -1081,11 +1070,9 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1081 return 0; 1070 return 0;
1082 } 1071 }
1083 1072
1084 request_resource(&ioport_resource, &res[0]); 1073 request_resource(&iomem_resource, res);
1085 request_resource(&iomem_resource, &res[1]);
1086 1074
1087 pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset); 1075 pci_add_resource_offset(&sys->resources, res, sys->mem_offset);
1088 pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset);
1089 1076
1090 return 1; 1077 return 1;
1091} 1078}
diff --git a/arch/arm/mach-iop13xx/pci.h b/arch/arm/mach-iop13xx/pci.h
index c70cf5b41e3..d45a80b3080 100644
--- a/arch/arm/mach-iop13xx/pci.h
+++ b/arch/arm/mach-iop13xx/pci.h
@@ -1,6 +1,6 @@
1#include <linux/types.h> 1#include <linux/types.h>
2 2
3extern u32 iop13xx_atue_mem_base; 3extern void __iomem *iop13xx_atue_mem_base;
4extern u32 iop13xx_atux_mem_base; 4extern void __iomem *iop13xx_atux_mem_base;
5extern size_t iop13xx_atue_mem_size; 5extern size_t iop13xx_atue_mem_size;
6extern size_t iop13xx_atux_mem_size; 6extern size_t iop13xx_atux_mem_size;
diff --git a/arch/arm/mach-iop13xx/setup.c b/arch/arm/mach-iop13xx/setup.c
index daabb1fa6c2..3181f61ea63 100644
--- a/arch/arm/mach-iop13xx/setup.c
+++ b/arch/arm/mach-iop13xx/setup.c
@@ -36,20 +36,10 @@
36 */ 36 */
37static struct map_desc iop13xx_std_desc[] __initdata = { 37static struct map_desc iop13xx_std_desc[] __initdata = {
38 { /* mem mapped registers */ 38 { /* mem mapped registers */
39 .virtual = IOP13XX_PMMR_VIRT_MEM_BASE, 39 .virtual = (unsigned long)IOP13XX_PMMR_VIRT_MEM_BASE,
40 .pfn = __phys_to_pfn(IOP13XX_PMMR_PHYS_MEM_BASE), 40 .pfn = __phys_to_pfn(IOP13XX_PMMR_PHYS_MEM_BASE),
41 .length = IOP13XX_PMMR_SIZE, 41 .length = IOP13XX_PMMR_SIZE,
42 .type = MT_DEVICE, 42 .type = MT_DEVICE,
43 }, { /* PCIE IO space */
44 .virtual = IOP13XX_PCIE_LOWER_IO_VA,
45 .pfn = __phys_to_pfn(IOP13XX_PCIE_LOWER_IO_PA),
46 .length = IOP13XX_PCIX_IO_WINDOW_SIZE,
47 .type = MT_DEVICE,
48 }, { /* PCIX IO space */
49 .virtual = IOP13XX_PCIX_LOWER_IO_VA,
50 .pfn = __phys_to_pfn(IOP13XX_PCIX_LOWER_IO_PA),
51 .length = IOP13XX_PCIX_IO_WINDOW_SIZE,
52 .type = MT_DEVICE,
53 }, 43 },
54}; 44};
55 45
@@ -81,8 +71,8 @@ static struct resource iop13xx_uart1_resources[] = {
81 71
82static struct plat_serial8250_port iop13xx_uart0_data[] = { 72static struct plat_serial8250_port iop13xx_uart0_data[] = {
83 { 73 {
84 .membase = (char*)(IOP13XX_UART0_VIRT), 74 .membase = IOP13XX_UART0_VIRT,
85 .mapbase = (IOP13XX_UART0_PHYS), 75 .mapbase = IOP13XX_UART0_PHYS,
86 .irq = IRQ_IOP13XX_UART0, 76 .irq = IRQ_IOP13XX_UART0,
87 .uartclk = IOP13XX_UART_XTAL, 77 .uartclk = IOP13XX_UART_XTAL,
88 .regshift = 2, 78 .regshift = 2,
@@ -94,8 +84,8 @@ static struct plat_serial8250_port iop13xx_uart0_data[] = {
94 84
95static struct plat_serial8250_port iop13xx_uart1_data[] = { 85static struct plat_serial8250_port iop13xx_uart1_data[] = {
96 { 86 {
97 .membase = (char*)(IOP13XX_UART1_VIRT), 87 .membase = IOP13XX_UART1_VIRT,
98 .mapbase = (IOP13XX_UART1_PHYS), 88 .mapbase = IOP13XX_UART1_PHYS,
99 .irq = IRQ_IOP13XX_UART1, 89 .irq = IRQ_IOP13XX_UART1,
100 .uartclk = IOP13XX_UART_XTAL, 90 .uartclk = IOP13XX_UART_XTAL,
101 .regshift = 2, 91 .regshift = 2,
diff --git a/arch/arm/mach-iop32x/glantank.c b/arch/arm/mach-iop32x/glantank.c
index c15a100ba77..02e20c3912b 100644
--- a/arch/arm/mach-iop32x/glantank.c
+++ b/arch/arm/mach-iop32x/glantank.c
@@ -183,7 +183,7 @@ static struct i2c_board_info __initdata glantank_i2c_devices[] = {
183 183
184static void glantank_power_off(void) 184static void glantank_power_off(void)
185{ 185{
186 __raw_writeb(0x01, 0xfe8d0004); 186 __raw_writeb(0x01, IOMEM(0xfe8d0004));
187 187
188 while (1) 188 while (1)
189 ; 189 ;
diff --git a/arch/arm/mach-iop32x/include/mach/io.h b/arch/arm/mach-iop32x/include/mach/io.h
deleted file mode 100644
index e2ada265bb8..00000000000
--- a/arch/arm/mach-iop32x/include/mach/io.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-iop32x/include/mach/io.h
3 *
4 * Copyright (C) 2001 MontaVista Software, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __IO_H
12#define __IO_H
13
14#include <asm/hardware/iop3xx.h>
15
16#define IO_SPACE_LIMIT 0xffffffff
17#define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
18
19#endif
diff --git a/arch/arm/mach-iop33x/include/mach/io.h b/arch/arm/mach-iop33x/include/mach/io.h
deleted file mode 100644
index f7c1b659566..00000000000
--- a/arch/arm/mach-iop33x/include/mach/io.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-iop33x/include/mach/io.h
3 *
4 * Copyright (C) 2001 MontaVista Software, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __IO_H
12#define __IO_H
13
14#include <asm/hardware/iop3xx.h>
15
16#define IO_SPACE_LIMIT 0xffffffff
17#define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
18
19#endif
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
index fd5e7b6881b..73a2d905af8 100644
--- a/arch/arm/mach-ixp4xx/Kconfig
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -234,8 +234,8 @@ config IXP4XX_QMGR
234 234
235config IXP4XX_NPE 235config IXP4XX_NPE
236 tristate "IXP4xx Network Processor Engine support" 236 tristate "IXP4xx Network Processor Engine support"
237 select HOTPLUG
238 select FW_LOADER 237 select FW_LOADER
238 select HOTPLUG
239 help 239 help
240 This driver supports IXP4xx built-in network coprocessors 240 This driver supports IXP4xx built-in network coprocessors
241 and is automatically selected by Ethernet and HSS drivers. 241 and is automatically selected by Ethernet and HSS drivers.
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index a9f80943d01..fdf91a16088 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -53,24 +53,24 @@ static struct clock_event_device clockevent_ixp4xx;
53 *************************************************************************/ 53 *************************************************************************/
54static struct map_desc ixp4xx_io_desc[] __initdata = { 54static struct map_desc ixp4xx_io_desc[] __initdata = {
55 { /* UART, Interrupt ctrl, GPIO, timers, NPEs, MACs, USB .... */ 55 { /* UART, Interrupt ctrl, GPIO, timers, NPEs, MACs, USB .... */
56 .virtual = IXP4XX_PERIPHERAL_BASE_VIRT, 56 .virtual = (unsigned long)IXP4XX_PERIPHERAL_BASE_VIRT,
57 .pfn = __phys_to_pfn(IXP4XX_PERIPHERAL_BASE_PHYS), 57 .pfn = __phys_to_pfn(IXP4XX_PERIPHERAL_BASE_PHYS),
58 .length = IXP4XX_PERIPHERAL_REGION_SIZE, 58 .length = IXP4XX_PERIPHERAL_REGION_SIZE,
59 .type = MT_DEVICE 59 .type = MT_DEVICE
60 }, { /* Expansion Bus Config Registers */ 60 }, { /* Expansion Bus Config Registers */
61 .virtual = IXP4XX_EXP_CFG_BASE_VIRT, 61 .virtual = (unsigned long)IXP4XX_EXP_CFG_BASE_VIRT,
62 .pfn = __phys_to_pfn(IXP4XX_EXP_CFG_BASE_PHYS), 62 .pfn = __phys_to_pfn(IXP4XX_EXP_CFG_BASE_PHYS),
63 .length = IXP4XX_EXP_CFG_REGION_SIZE, 63 .length = IXP4XX_EXP_CFG_REGION_SIZE,
64 .type = MT_DEVICE 64 .type = MT_DEVICE
65 }, { /* PCI Registers */ 65 }, { /* PCI Registers */
66 .virtual = IXP4XX_PCI_CFG_BASE_VIRT, 66 .virtual = (unsigned long)IXP4XX_PCI_CFG_BASE_VIRT,
67 .pfn = __phys_to_pfn(IXP4XX_PCI_CFG_BASE_PHYS), 67 .pfn = __phys_to_pfn(IXP4XX_PCI_CFG_BASE_PHYS),
68 .length = IXP4XX_PCI_CFG_REGION_SIZE, 68 .length = IXP4XX_PCI_CFG_REGION_SIZE,
69 .type = MT_DEVICE 69 .type = MT_DEVICE
70 }, 70 },
71#ifdef CONFIG_DEBUG_LL 71#ifdef CONFIG_DEBUG_LL
72 { /* Debug UART mapping */ 72 { /* Debug UART mapping */
73 .virtual = IXP4XX_DEBUG_UART_BASE_VIRT, 73 .virtual = (unsigned long)IXP4XX_DEBUG_UART_BASE_VIRT,
74 .pfn = __phys_to_pfn(IXP4XX_DEBUG_UART_BASE_PHYS), 74 .pfn = __phys_to_pfn(IXP4XX_DEBUG_UART_BASE_PHYS),
75 .length = IXP4XX_DEBUG_UART_REGION_SIZE, 75 .length = IXP4XX_DEBUG_UART_REGION_SIZE,
76 .type = MT_DEVICE 76 .type = MT_DEVICE
diff --git a/arch/arm/mach-ixp4xx/include/mach/cpu.h b/arch/arm/mach-ixp4xx/include/mach/cpu.h
index b2ef65db0e9..ebc0ba31ce8 100644
--- a/arch/arm/mach-ixp4xx/include/mach/cpu.h
+++ b/arch/arm/mach-ixp4xx/include/mach/cpu.h
@@ -14,6 +14,7 @@
14#ifndef __ASM_ARCH_CPU_H__ 14#ifndef __ASM_ARCH_CPU_H__
15#define __ASM_ARCH_CPU_H__ 15#define __ASM_ARCH_CPU_H__
16 16
17#include <linux/io.h>
17#include <asm/cputype.h> 18#include <asm/cputype.h>
18 19
19/* Processor id value in CP15 Register 0 */ 20/* Processor id value in CP15 Register 0 */
@@ -37,7 +38,7 @@
37 38
38static inline u32 ixp4xx_read_feature_bits(void) 39static inline u32 ixp4xx_read_feature_bits(void)
39{ 40{
40 u32 val = ~*IXP4XX_EXP_CFG2; 41 u32 val = ~__raw_readl(IXP4XX_EXP_CFG2);
41 42
42 if (cpu_is_ixp42x_rev_a0()) 43 if (cpu_is_ixp42x_rev_a0())
43 return IXP42X_FEATURE_MASK & ~(IXP4XX_FEATURE_RCOMP | 44 return IXP42X_FEATURE_MASK & ~(IXP4XX_FEATURE_RCOMP |
@@ -51,7 +52,7 @@ static inline u32 ixp4xx_read_feature_bits(void)
51 52
52static inline void ixp4xx_write_feature_bits(u32 value) 53static inline void ixp4xx_write_feature_bits(u32 value)
53{ 54{
54 *IXP4XX_EXP_CFG2 = ~value; 55 __raw_writel(~value, IXP4XX_EXP_CFG2);
55} 56}
56 57
57#endif /* _ASM_ARCH_CPU_H */ 58#endif /* _ASM_ARCH_CPU_H */
diff --git a/arch/arm/mach-ixp4xx/include/mach/gpio.h b/arch/arm/mach-ixp4xx/include/mach/gpio.h
deleted file mode 100644
index ef37f2635b0..00000000000
--- a/arch/arm/mach-ixp4xx/include/mach/gpio.h
+++ /dev/null
@@ -1,2 +0,0 @@
1/* empty */
2
diff --git a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
index 97c530f66e7..eb68b61ce97 100644
--- a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
+++ b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
@@ -49,21 +49,21 @@
49 * Expansion BUS Configuration registers 49 * Expansion BUS Configuration registers
50 */ 50 */
51#define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000) 51#define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000)
52#define IXP4XX_EXP_CFG_BASE_VIRT (0xFFBFE000) 52#define IXP4XX_EXP_CFG_BASE_VIRT IOMEM(0xFFBFE000)
53#define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000) 53#define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000)
54 54
55/* 55/*
56 * PCI Config registers 56 * PCI Config registers
57 */ 57 */
58#define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000) 58#define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000)
59#define IXP4XX_PCI_CFG_BASE_VIRT (0xFFBFF000) 59#define IXP4XX_PCI_CFG_BASE_VIRT IOMEM(0xFFBFF000)
60#define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000) 60#define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000)
61 61
62/* 62/*
63 * Peripheral space 63 * Peripheral space
64 */ 64 */
65#define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000) 65#define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000)
66#define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBEB000) 66#define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFFBEB000)
67#define IXP4XX_PERIPHERAL_REGION_SIZE (0x00013000) 67#define IXP4XX_PERIPHERAL_REGION_SIZE (0x00013000)
68 68
69/* 69/*
@@ -73,7 +73,7 @@
73 * aligned so that it * can be used with the low-level debug code. 73 * aligned so that it * can be used with the low-level debug code.
74 */ 74 */
75#define IXP4XX_DEBUG_UART_BASE_PHYS (0xC8000000) 75#define IXP4XX_DEBUG_UART_BASE_PHYS (0xC8000000)
76#define IXP4XX_DEBUG_UART_BASE_VIRT (0xffb00000) 76#define IXP4XX_DEBUG_UART_BASE_VIRT IOMEM(0xffb00000)
77#define IXP4XX_DEBUG_UART_REGION_SIZE (0x00001000) 77#define IXP4XX_DEBUG_UART_REGION_SIZE (0x00001000)
78 78
79#define IXP4XX_EXP_CS0_OFFSET 0x00 79#define IXP4XX_EXP_CS0_OFFSET 0x00
@@ -92,7 +92,7 @@
92/* 92/*
93 * Expansion Bus Controller registers. 93 * Expansion Bus Controller registers.
94 */ 94 */
95#define IXP4XX_EXP_REG(x) ((volatile u32 *)(IXP4XX_EXP_CFG_BASE_VIRT+(x))) 95#define IXP4XX_EXP_REG(x) ((volatile u32 __iomem *)(IXP4XX_EXP_CFG_BASE_VIRT+(x)))
96 96
97#define IXP4XX_EXP_CS0 IXP4XX_EXP_REG(IXP4XX_EXP_CS0_OFFSET) 97#define IXP4XX_EXP_CS0 IXP4XX_EXP_REG(IXP4XX_EXP_CS0_OFFSET)
98#define IXP4XX_EXP_CS1 IXP4XX_EXP_REG(IXP4XX_EXP_CS1_OFFSET) 98#define IXP4XX_EXP_CS1 IXP4XX_EXP_REG(IXP4XX_EXP_CS1_OFFSET)
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index ca5c15a4e62..50bca5032b7 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -94,6 +94,13 @@ config MACH_TS219_DT
94 or MV6282. If you have the wrong one, the buttons will not 94 or MV6282. If you have the wrong one, the buttons will not
95 work. 95 work.
96 96
97config MACH_DOCKSTAR_DT
98 bool "Seagate FreeAgent Dockstar (Flattened Device Tree)"
99 select ARCH_KIRKWOOD_DT
100 help
101 Say 'Y' here if you want your kernel to support the
102 Seagate FreeAgent Dockstar (Flattened Device Tree).
103
97config MACH_GOFLEXNET_DT 104config MACH_GOFLEXNET_DT
98 bool "Seagate GoFlex Net (Flattened Device Tree)" 105 bool "Seagate GoFlex Net (Flattened Device Tree)"
99 select ARCH_KIRKWOOD_DT 106 select ARCH_KIRKWOOD_DT
@@ -109,6 +116,20 @@ config MACH_LSXL_DT
109 Buffalo Linkstation LS-XHL & LS-CHLv2 devices, using 116 Buffalo Linkstation LS-XHL & LS-CHLv2 devices, using
110 Flattened Device Tree. 117 Flattened Device Tree.
111 118
119config MACH_IOMEGA_IX2_200_DT
120 bool "Iomega StorCenter ix2-200 (Flattened Device Tree)"
121 select ARCH_KIRKWOOD_DT
122 help
123 Say 'Y' here if you want your kernel to support the
124 Iomega StorCenter ix2-200 (Flattened Device Tree).
125
126config MACH_KM_KIRKWOOD_DT
127 bool "Keymile Kirkwood Reference Design (Flattened Device Tree)"
128 select ARCH_KIRKWOOD_DT
129 help
130 Say 'Y' here if you want your kernel to support the
131 Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
132
112config MACH_TS219 133config MACH_TS219
113 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" 134 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
114 help 135 help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 055c85a1cc4..294779f892d 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -26,5 +26,8 @@ obj-$(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
28obj-$(CONFIG_MACH_TS219_DT) += board-ts219.o tsx1x-common.o 28obj-$(CONFIG_MACH_TS219_DT) += board-ts219.o tsx1x-common.o
29obj-$(CONFIG_MACH_DOCKSTAR_DT) += board-dockstar.o
29obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o 30obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o
30obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o 31obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o
32obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o
33obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index a13299d758e..760a0efe758 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,14 +1,3 @@
1 zreladdr-y += 0x00008000 1 zreladdr-y += 0x00008000
2params_phys-y := 0x00000100 2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000 3initrd_phys-y := 0x00800000
4
5dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
6dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns320.dtb
7dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns325.dtb
8dtb-$(CONFIG_MACH_ICONNECT_DT) += kirkwood-iconnect.dtb
9dtb-$(CONFIG_MACH_IB62X0_DT) += kirkwood-ib62x0.dtb
10dtb-$(CONFIG_MACH_TS219_DT) += kirkwood-ts219-6281.dtb
11dtb-$(CONFIG_MACH_TS219_DT) += kirkwood-ts219-6282.dtb
12dtb-$(CONFIG_MACH_GOFLEXNET_DT) += kirkwood-goflexnet.dtb
13dtb-$(CONFIG_MACH_LSXL_DT) += kirkwood-lschlv2.dtb
14dtb-$(CONFIG_MACH_LSXL_DT) += kirkwood-lsxhl.dtb
diff --git a/arch/arm/mach-kirkwood/addr-map.c b/arch/arm/mach-kirkwood/addr-map.c
index e9a7180863d..8f0d162a1e1 100644
--- a/arch/arm/mach-kirkwood/addr-map.c
+++ b/arch/arm/mach-kirkwood/addr-map.c
@@ -86,5 +86,6 @@ void __init kirkwood_setup_cpu_mbus(void)
86 /* 86 /*
87 * Setup MBUS dram target info. 87 * Setup MBUS dram target info.
88 */ 88 */
89 orion_setup_cpu_mbus_target(&addr_map_cfg, DDR_WINDOW_CPU_BASE); 89 orion_setup_cpu_mbus_target(&addr_map_cfg,
90 (void __iomem *) DDR_WINDOW_CPU_BASE);
90} 91}
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
index 4ab35065a14..43d16d6714b 100644
--- a/arch/arm/mach-kirkwood/board-dnskw.c
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -14,18 +14,8 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
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/ata_platform.h>
18#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
19#include <linux/of.h>
20#include <linux/gpio.h> 18#include <linux/gpio.h>
21#include <linux/input.h>
22#include <linux/gpio-fan.h>
23#include <linux/leds.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <asm/mach/map.h>
27#include <mach/kirkwood.h>
28#include <mach/bridge-regs.h>
29#include "common.h" 19#include "common.h"
30#include "mpp.h" 20#include "mpp.h"
31 21
@@ -67,29 +57,6 @@ static unsigned int dnskw_mpp_config[] __initdata = {
67 0 57 0
68}; 58};
69 59
70/* Fan: ADDA AD045HB-G73 40mm 6000rpm@5v */
71static struct gpio_fan_speed dnskw_fan_speed[] = {
72 { 0, 0 },
73 { 3000, 1 },
74 { 6000, 2 },
75};
76static unsigned dnskw_fan_pins[] = {46, 45};
77
78static struct gpio_fan_platform_data dnskw_fan_data = {
79 .num_ctrl = ARRAY_SIZE(dnskw_fan_pins),
80 .ctrl = dnskw_fan_pins,
81 .num_speed = ARRAY_SIZE(dnskw_fan_speed),
82 .speed = dnskw_fan_speed,
83};
84
85static struct platform_device dnskw_fan_device = {
86 .name = "gpio-fan",
87 .id = -1,
88 .dev = {
89 .platform_data = &dnskw_fan_data,
90 },
91};
92
93static void dnskw_power_off(void) 60static void dnskw_power_off(void)
94{ 61{
95 gpio_set_value(36, 1); 62 gpio_set_value(36, 1);
@@ -114,8 +81,6 @@ void __init dnskw_init(void)
114 kirkwood_ehci_init(); 81 kirkwood_ehci_init();
115 kirkwood_ge00_init(&dnskw_ge00_data); 82 kirkwood_ge00_init(&dnskw_ge00_data);
116 83
117 platform_device_register(&dnskw_fan_device);
118
119 /* Register power-off GPIO. */ 84 /* Register power-off GPIO. */
120 if (gpio_request(36, "dnskw:power:off") == 0 85 if (gpio_request(36, "dnskw:power:off") == 0
121 && gpio_direction_output(36, 0) == 0) 86 && gpio_direction_output(36, 0) == 0)
diff --git a/arch/arm/mach-kirkwood/board-dockstar.c b/arch/arm/mach-kirkwood/board-dockstar.c
new file mode 100644
index 00000000000..f2fbb023e67
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dockstar.c
@@ -0,0 +1,61 @@
1/*
2 * arch/arm/mach-kirkwood/board-dockstar.c
3 *
4 * Seagate FreeAgent Dockstar 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 * Copied and modified for Seagate GoFlex Net support by
12 * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
13 * GoFlex kernel patches.
14 *
15 */
16
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/platform_device.h>
20#include <linux/ata_platform.h>
21#include <linux/mv643xx_eth.h>
22#include <linux/of.h>
23#include <linux/of_address.h>
24#include <linux/of_fdt.h>
25#include <linux/of_irq.h>
26#include <linux/of_platform.h>
27#include <linux/gpio.h>
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30#include <asm/mach/map.h>
31#include <mach/kirkwood.h>
32#include <mach/bridge-regs.h>
33#include <linux/platform_data/mmc-mvsdio.h>
34#include "common.h"
35#include "mpp.h"
36
37static struct mv643xx_eth_platform_data dockstar_ge00_data = {
38 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
39};
40
41static unsigned int dockstar_mpp_config[] __initdata = {
42 MPP29_GPIO, /* USB Power Enable */
43 MPP46_GPIO, /* LED green */
44 MPP47_GPIO, /* LED orange */
45 0
46};
47
48void __init dockstar_dt_init(void)
49{
50 /*
51 * Basic setup. Needs to be called early.
52 */
53 kirkwood_mpp_conf(dockstar_mpp_config);
54
55 if (gpio_request(29, "USB Power Enable") != 0 ||
56 gpio_direction_output(29, 1) != 0)
57 pr_err("can't setup GPIO 29 (USB Power Enable)\n");
58 kirkwood_ehci_init();
59
60 kirkwood_ge00_init(&dockstar_ge00_data);
61}
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
index aeb234d0d0e..20af53a56c0 100644
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -30,7 +30,7 @@
30#include <asm/mach/map.h> 30#include <asm/mach/map.h>
31#include <mach/kirkwood.h> 31#include <mach/kirkwood.h>
32#include <mach/bridge-regs.h> 32#include <mach/bridge-regs.h>
33#include <plat/mvsdio.h> 33#include <linux/platform_data/mmc-mvsdio.h>
34#include "common.h" 34#include "common.h"
35#include "mpp.h" 35#include "mpp.h"
36 36
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index e4eb450de30..70c5a288240 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -33,6 +33,7 @@ struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
33 OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), 33 OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
34 OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), 34 OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
35 OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL), 35 OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL),
36 OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1030000, "mv_crypto", NULL),
36 {}, 37 {},
37}; 38};
38 39
@@ -60,7 +61,6 @@ static void __init kirkwood_dt_init(void)
60 /* internal devices that every board has */ 61 /* internal devices that every board has */
61 kirkwood_xor0_init(); 62 kirkwood_xor0_init();
62 kirkwood_xor1_init(); 63 kirkwood_xor1_init();
63 kirkwood_crypto_init();
64 64
65#ifdef CONFIG_KEXEC 65#ifdef CONFIG_KEXEC
66 kexec_reinit = kirkwood_enable_pcie; 66 kexec_reinit = kirkwood_enable_pcie;
@@ -81,12 +81,21 @@ static void __init kirkwood_dt_init(void)
81 if (of_machine_is_compatible("qnap,ts219")) 81 if (of_machine_is_compatible("qnap,ts219"))
82 qnap_dt_ts219_init(); 82 qnap_dt_ts219_init();
83 83
84 if (of_machine_is_compatible("seagate,dockstar"))
85 dockstar_dt_init();
86
84 if (of_machine_is_compatible("seagate,goflexnet")) 87 if (of_machine_is_compatible("seagate,goflexnet"))
85 goflexnet_init(); 88 goflexnet_init();
86 89
87 if (of_machine_is_compatible("buffalo,lsxl")) 90 if (of_machine_is_compatible("buffalo,lsxl"))
88 lsxl_init(); 91 lsxl_init();
89 92
93 if (of_machine_is_compatible("iom,ix2-200"))
94 iomega_ix2_200_init();
95
96 if (of_machine_is_compatible("keymile,km_kirkwood"))
97 km_kirkwood_init();
98
90 of_platform_populate(NULL, kirkwood_dt_match_table, 99 of_platform_populate(NULL, kirkwood_dt_match_table,
91 kirkwood_auxdata_lookup, NULL); 100 kirkwood_auxdata_lookup, NULL);
92} 101}
@@ -98,8 +107,11 @@ static const char *kirkwood_dt_board_compat[] = {
98 "iom,iconnect", 107 "iom,iconnect",
99 "raidsonic,ib-nas62x0", 108 "raidsonic,ib-nas62x0",
100 "qnap,ts219", 109 "qnap,ts219",
110 "seagate,dockstar",
101 "seagate,goflexnet", 111 "seagate,goflexnet",
102 "buffalo,lsxl", 112 "buffalo,lsxl",
113 "iom,ix2-200",
114 "keymile,km_kirkwood",
103 NULL 115 NULL
104}; 116};
105 117
diff --git a/arch/arm/mach-kirkwood/board-goflexnet.c b/arch/arm/mach-kirkwood/board-goflexnet.c
index 413e2c8ef5f..001ca8c9698 100644
--- a/arch/arm/mach-kirkwood/board-goflexnet.c
+++ b/arch/arm/mach-kirkwood/board-goflexnet.c
@@ -32,7 +32,7 @@
32#include <asm/mach/map.h> 32#include <asm/mach/map.h>
33#include <mach/kirkwood.h> 33#include <mach/kirkwood.h>
34#include <mach/bridge-regs.h> 34#include <mach/bridge-regs.h>
35#include <plat/mvsdio.h> 35#include <linux/platform_data/mmc-mvsdio.h>
36#include "common.h" 36#include "common.h"
37#include "mpp.h" 37#include "mpp.h"
38 38
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
index d7a9198ed30..d084b1e2943 100644
--- a/arch/arm/mach-kirkwood/board-iconnect.c
+++ b/arch/arm/mach-kirkwood/board-iconnect.c
@@ -16,11 +16,8 @@
16#include <linux/of_fdt.h> 16#include <linux/of_fdt.h>
17#include <linux/of_irq.h> 17#include <linux/of_irq.h>
18#include <linux/of_platform.h> 18#include <linux/of_platform.h>
19#include <linux/mtd/partitions.h>
20#include <linux/mv643xx_eth.h> 19#include <linux/mv643xx_eth.h>
21#include <linux/gpio.h> 20#include <linux/gpio.h>
22#include <linux/input.h>
23#include <linux/gpio_keys.h>
24#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
25#include <mach/kirkwood.h> 22#include <mach/kirkwood.h>
26#include "common.h" 23#include "common.h"
@@ -44,57 +41,12 @@ static unsigned int iconnect_mpp_config[] __initdata = {
44 0 41 0
45}; 42};
46 43
47static struct mtd_partition iconnect_nand_parts[] = {
48 {
49 .name = "flash",
50 .offset = 0,
51 .size = MTDPART_SIZ_FULL,
52 },
53};
54
55/* yikes... theses are the original input buttons */
56/* but I'm not convinced by the sw event choices */
57static struct gpio_keys_button iconnect_buttons[] = {
58 {
59 .type = EV_SW,
60 .code = SW_LID,
61 .gpio = 12,
62 .desc = "Reset Button",
63 .active_low = 1,
64 .debounce_interval = 100,
65 }, {
66 .type = EV_SW,
67 .code = SW_TABLET_MODE,
68 .gpio = 35,
69 .desc = "OTB Button",
70 .active_low = 1,
71 .debounce_interval = 100,
72 },
73};
74
75static struct gpio_keys_platform_data iconnect_button_data = {
76 .buttons = iconnect_buttons,
77 .nbuttons = ARRAY_SIZE(iconnect_buttons),
78};
79
80static struct platform_device iconnect_button_device = {
81 .name = "gpio-keys",
82 .id = -1,
83 .num_resources = 0,
84 .dev = {
85 .platform_data = &iconnect_button_data,
86 },
87};
88
89void __init iconnect_init(void) 44void __init iconnect_init(void)
90{ 45{
91 kirkwood_mpp_conf(iconnect_mpp_config); 46 kirkwood_mpp_conf(iconnect_mpp_config);
92 kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25);
93 47
94 kirkwood_ehci_init(); 48 kirkwood_ehci_init();
95 kirkwood_ge00_init(&iconnect_ge00_data); 49 kirkwood_ge00_init(&iconnect_ge00_data);
96
97 platform_device_register(&iconnect_button_device);
98} 50}
99 51
100static int __init iconnect_pci_init(void) 52static int __init iconnect_pci_init(void)
diff --git a/arch/arm/mach-kirkwood/board-iomega_ix2_200.c b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
new file mode 100644
index 00000000000..158fb97d039
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
@@ -0,0 +1,57 @@
1/*
2 * arch/arm/mach-kirkwood/board-iomega_ix2_200.c
3 *
4 * Iomega StorCenter ix2-200
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/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/mv643xx_eth.h>
15#include <linux/ethtool.h>
16#include <mach/kirkwood.h>
17#include "common.h"
18#include "mpp.h"
19
20static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
21 .phy_addr = MV643XX_ETH_PHY_NONE,
22 .speed = SPEED_1000,
23 .duplex = DUPLEX_FULL,
24};
25
26static unsigned int iomega_ix2_200_mpp_config[] __initdata = {
27 MPP12_GPIO, /* Reset Button */
28 MPP14_GPIO, /* Power Button */
29 MPP15_GPIO, /* Backup LED (blue) */
30 MPP16_GPIO, /* Power LED (white) */
31 MPP35_GPIO, /* OTB Button */
32 MPP36_GPIO, /* Rebuild LED (white) */
33 MPP37_GPIO, /* Health LED (red) */
34 MPP38_GPIO, /* SATA LED brightness control 1 */
35 MPP39_GPIO, /* SATA LED brightness control 2 */
36 MPP40_GPIO, /* Backup LED brightness control 1 */
37 MPP41_GPIO, /* Backup LED brightness control 2 */
38 MPP42_GPIO, /* Power LED brightness control 1 */
39 MPP43_GPIO, /* Power LED brightness control 2 */
40 MPP44_GPIO, /* Health LED brightness control 1 */
41 MPP45_GPIO, /* Health LED brightness control 2 */
42 MPP46_GPIO, /* Rebuild LED brightness control 1 */
43 MPP47_GPIO, /* Rebuild LED brightness control 2 */
44 0
45};
46
47void __init iomega_ix2_200_init(void)
48{
49 /*
50 * Basic setup. Needs to be called early.
51 */
52 kirkwood_mpp_conf(iomega_ix2_200_mpp_config);
53
54 kirkwood_ehci_init();
55
56 kirkwood_ge01_init(&iomega_ix2_200_ge00_data);
57}
diff --git a/arch/arm/mach-kirkwood/board-km_kirkwood.c b/arch/arm/mach-kirkwood/board-km_kirkwood.c
new file mode 100644
index 00000000000..f7d32834b75
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-km_kirkwood.c
@@ -0,0 +1,57 @@
1/*
2 * Copyright 2012 2012 KEYMILE AG, CH-3097 Bern
3 * Valentin Longchamp <valentin.longchamp@keymile.com>
4 *
5 * arch/arm/mach-kirkwood/board-km_kirkwood.c
6 *
7 * Keymile km_kirkwood Reference Desing Init for drivers not converted to
8 * flattened device tree yet.
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
13 */
14
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/mv643xx_eth.h>
18#include <linux/clk.h>
19#include <linux/clk-private.h>
20#include "common.h"
21#include "mpp.h"
22
23static struct mv643xx_eth_platform_data km_kirkwood_ge00_data = {
24 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
25};
26
27static unsigned int km_kirkwood_mpp_config[] __initdata = {
28 MPP8_GPIO, /* I2C SDA */
29 MPP9_GPIO, /* I2C SCL */
30 0
31};
32
33void __init km_kirkwood_init(void)
34{
35 struct clk *sata_clk;
36 /*
37 * Basic setup. Needs to be called early.
38 */
39 kirkwood_mpp_conf(km_kirkwood_mpp_config);
40
41 /*
42 * Our variant of kirkwood (integrated in the Bobcat) hangs on accessing
43 * SATA bits (14-15) of the Clock Gating Control Register. Since these
44 * devices are also not present in this variant, their clocks get
45 * disabled because unused when clk_disable_unused() gets called.
46 * That's why we change the flags to these clocks to CLK_IGNORE_UNUSED
47 */
48 sata_clk = clk_get_sys("sata_mv.0", "0");
49 if (!IS_ERR(sata_clk))
50 sata_clk->flags |= CLK_IGNORE_UNUSED;
51 sata_clk = clk_get_sys("sata_mv.0", "1");
52 if (!IS_ERR(sata_clk))
53 sata_clk->flags |= CLK_IGNORE_UNUSED;
54
55 kirkwood_ehci_init();
56 kirkwood_ge00_init(&km_kirkwood_ge00_data);
57}
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 1201191d7f1..3991077f58a 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -26,15 +26,15 @@
26#include <asm/mach/time.h> 26#include <asm/mach/time.h>
27#include <mach/kirkwood.h> 27#include <mach/kirkwood.h>
28#include <mach/bridge-regs.h> 28#include <mach/bridge-regs.h>
29#include <plat/audio.h> 29#include <linux/platform_data/asoc-kirkwood.h>
30#include <plat/cache-feroceon-l2.h> 30#include <plat/cache-feroceon-l2.h>
31#include <plat/mvsdio.h> 31#include <linux/platform_data/mmc-mvsdio.h>
32#include <plat/orion_nand.h> 32#include <linux/platform_data/mtd-orion_nand.h>
33#include <plat/ehci-orion.h> 33#include <linux/platform_data/usb-ehci-orion.h>
34#include <plat/common.h> 34#include <plat/common.h>
35#include <plat/time.h> 35#include <plat/time.h>
36#include <plat/addr-map.h> 36#include <plat/addr-map.h>
37#include <plat/mv_xor.h> 37#include <linux/platform_data/dma-mv_xor.h>
38#include "common.h" 38#include "common.h"
39 39
40/***************************************************************************** 40/*****************************************************************************
@@ -42,17 +42,7 @@
42 ****************************************************************************/ 42 ****************************************************************************/
43static struct map_desc kirkwood_io_desc[] __initdata = { 43static struct map_desc kirkwood_io_desc[] __initdata = {
44 { 44 {
45 .virtual = KIRKWOOD_PCIE_IO_VIRT_BASE, 45 .virtual = (unsigned long) KIRKWOOD_REGS_VIRT_BASE,
46 .pfn = __phys_to_pfn(KIRKWOOD_PCIE_IO_PHYS_BASE),
47 .length = KIRKWOOD_PCIE_IO_SIZE,
48 .type = MT_DEVICE,
49 }, {
50 .virtual = KIRKWOOD_PCIE1_IO_VIRT_BASE,
51 .pfn = __phys_to_pfn(KIRKWOOD_PCIE1_IO_PHYS_BASE),
52 .length = KIRKWOOD_PCIE1_IO_SIZE,
53 .type = MT_DEVICE,
54 }, {
55 .virtual = KIRKWOOD_REGS_VIRT_BASE,
56 .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE), 46 .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE),
57 .length = KIRKWOOD_REGS_SIZE, 47 .length = KIRKWOOD_REGS_SIZE,
58 .type = MT_DEVICE, 48 .type = MT_DEVICE,
@@ -215,8 +205,7 @@ static struct clk *tclk;
215 205
216static struct clk __init *kirkwood_register_gate(const char *name, u8 bit_idx) 206static struct clk __init *kirkwood_register_gate(const char *name, u8 bit_idx)
217{ 207{
218 return clk_register_gate(NULL, name, "tclk", 0, 208 return clk_register_gate(NULL, name, "tclk", 0, CLOCK_GATING_CTRL,
219 (void __iomem *)CLOCK_GATING_CTRL,
220 bit_idx, 0, &gating_lock); 209 bit_idx, 0, &gating_lock);
221} 210}
222 211
@@ -225,8 +214,7 @@ static struct clk __init *kirkwood_register_gate_fn(const char *name,
225 void (*fn_en)(void), 214 void (*fn_en)(void),
226 void (*fn_dis)(void)) 215 void (*fn_dis)(void))
227{ 216{
228 return clk_register_gate_fn(NULL, name, "tclk", 0, 217 return clk_register_gate_fn(NULL, name, "tclk", 0, CLOCK_GATING_CTRL,
229 (void __iomem *)CLOCK_GATING_CTRL,
230 bit_idx, 0, &gating_lock, fn_en, fn_dis); 218 bit_idx, 0, &gating_lock, fn_en, fn_dis);
231} 219}
232 220
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 304dd1abfdc..bcffd7ca1ca 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -82,6 +82,12 @@ void ib62x0_init(void);
82static inline void ib62x0_init(void) {}; 82static inline void ib62x0_init(void) {};
83#endif 83#endif
84 84
85#ifdef CONFIG_MACH_DOCKSTAR_DT
86void dockstar_dt_init(void);
87#else
88static inline void dockstar_dt_init(void) {};
89#endif
90
85#ifdef CONFIG_MACH_GOFLEXNET_DT 91#ifdef CONFIG_MACH_GOFLEXNET_DT
86void goflexnet_init(void); 92void goflexnet_init(void);
87#else 93#else
@@ -94,6 +100,18 @@ void lsxl_init(void);
94static inline void lsxl_init(void) {}; 100static inline void lsxl_init(void) {};
95#endif 101#endif
96 102
103#ifdef CONFIG_MACH_IOMEGA_IX2_200_DT
104void iomega_ix2_200_init(void);
105#else
106static inline void iomega_ix2_200_init(void) {};
107#endif
108
109#ifdef CONFIG_MACH_KM_KIRKWOOD_DT
110void km_kirkwood_init(void);
111#else
112static inline void km_kirkwood_init(void) {};
113#endif
114
97/* early init functions not converted to fdt yet */ 115/* early init functions not converted to fdt yet */
98char *kirkwood_id(void); 116char *kirkwood_id(void);
99void kirkwood_l2_init(void); 117void kirkwood_l2_init(void);
diff --git a/arch/arm/mach-kirkwood/d2net_v2-setup.c b/arch/arm/mach-kirkwood/d2net_v2-setup.c
index 6e1bac929ab..2c1a453df20 100644
--- a/arch/arm/mach-kirkwood/d2net_v2-setup.c
+++ b/arch/arm/mach-kirkwood/d2net_v2-setup.c
@@ -32,7 +32,7 @@
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
34#include <mach/kirkwood.h> 34#include <mach/kirkwood.h>
35#include <mach/leds-ns2.h> 35#include <linux/platform_data/leds-kirkwood-ns2.h>
36#include "common.h" 36#include "common.h"
37#include "mpp.h" 37#include "mpp.h"
38#include "lacie_v2-common.h" 38#include "lacie_v2-common.h"
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
index be90b7d0e10..c49b177c152 100644
--- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
+++ b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
@@ -18,7 +18,7 @@
18#include <asm/mach-types.h> 18#include <asm/mach-types.h>
19#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
20#include <mach/kirkwood.h> 20#include <mach/kirkwood.h>
21#include <plat/mvsdio.h> 21#include <linux/platform_data/mmc-mvsdio.h>
22#include "common.h" 22#include "common.h"
23#include "mpp.h" 23#include "mpp.h"
24 24
diff --git a/arch/arm/mach-kirkwood/dockstar-setup.c b/arch/arm/mach-kirkwood/dockstar-setup.c
index 61d9a552a05..23dcb19cc2a 100644
--- a/arch/arm/mach-kirkwood/dockstar-setup.c
+++ b/arch/arm/mach-kirkwood/dockstar-setup.c
@@ -19,7 +19,7 @@
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 <plat/mvsdio.h> 22#include <linux/platform_data/mmc-mvsdio.h>
23#include "common.h" 23#include "common.h"
24#include "mpp.h" 24#include "mpp.h"
25 25
diff --git a/arch/arm/mach-kirkwood/guruplug-setup.c b/arch/arm/mach-kirkwood/guruplug-setup.c
index bdaed3867d1..7cb55f98224 100644
--- a/arch/arm/mach-kirkwood/guruplug-setup.c
+++ b/arch/arm/mach-kirkwood/guruplug-setup.c
@@ -19,7 +19,7 @@
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 <plat/mvsdio.h> 22#include <linux/platform_data/mmc-mvsdio.h>
23#include "common.h" 23#include "common.h"
24#include "mpp.h" 24#include "mpp.h"
25 25
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
index a115142f869..5c82b7dce4e 100644
--- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
+++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
@@ -13,37 +13,37 @@
13 13
14#include <mach/kirkwood.h> 14#include <mach/kirkwood.h>
15 15
16#define CPU_CONFIG (BRIDGE_VIRT_BASE | 0x0100) 16#define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0100)
17#define CPU_CONFIG_ERROR_PROP 0x00000004 17#define CPU_CONFIG_ERROR_PROP 0x00000004
18 18
19#define CPU_CONTROL (BRIDGE_VIRT_BASE | 0x0104) 19#define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104)
20#define CPU_RESET 0x00000002 20#define CPU_RESET 0x00000002
21 21
22#define RSTOUTn_MASK (BRIDGE_VIRT_BASE | 0x0108) 22#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
23#define WDT_RESET_OUT_EN 0x00000002 23#define WDT_RESET_OUT_EN 0x00000002
24#define SOFT_RESET_OUT_EN 0x00000004 24#define SOFT_RESET_OUT_EN 0x00000004
25 25
26#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c) 26#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
27#define SOFT_RESET 0x00000001 27#define SOFT_RESET 0x00000001
28 28
29#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110) 29#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE + 0x0110)
30#define WDT_INT_REQ 0x0008 30#define WDT_INT_REQ 0x0008
31 31
32#define BRIDGE_INT_TIMER1_CLR (~0x0004) 32#define BRIDGE_INT_TIMER1_CLR (~0x0004)
33 33
34#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200) 34#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE + 0x0200)
35#define IRQ_CAUSE_LOW_OFF 0x0000 35#define IRQ_CAUSE_LOW_OFF 0x0000
36#define IRQ_MASK_LOW_OFF 0x0004 36#define IRQ_MASK_LOW_OFF 0x0004
37#define IRQ_CAUSE_HIGH_OFF 0x0010 37#define IRQ_CAUSE_HIGH_OFF 0x0010
38#define IRQ_MASK_HIGH_OFF 0x0014 38#define IRQ_MASK_HIGH_OFF 0x0014
39 39
40#define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0300) 40#define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE + 0x0300)
41#define TIMER_PHYS_BASE (BRIDGE_PHYS_BASE | 0x0300) 41#define TIMER_PHYS_BASE (BRIDGE_PHYS_BASE + 0x0300)
42 42
43#define L2_CONFIG_REG (BRIDGE_VIRT_BASE | 0x0128) 43#define L2_CONFIG_REG (BRIDGE_VIRT_BASE + 0x0128)
44#define L2_WRITETHROUGH 0x00000010 44#define L2_WRITETHROUGH 0x00000010
45 45
46#define CLOCK_GATING_CTRL (BRIDGE_VIRT_BASE | 0x11c) 46#define CLOCK_GATING_CTRL (BRIDGE_VIRT_BASE + 0x11c)
47#define CGC_BIT_GE0 (0) 47#define CGC_BIT_GE0 (0)
48#define CGC_BIT_PEX0 (2) 48#define CGC_BIT_PEX0 (2)
49#define CGC_BIT_USB0 (3) 49#define CGC_BIT_USB0 (3)
diff --git a/arch/arm/mach-kirkwood/include/mach/gpio.h b/arch/arm/mach-kirkwood/include/mach/gpio.h
deleted file mode 100644
index 84f340b546c..00000000000
--- a/arch/arm/mach-kirkwood/include/mach/gpio.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/*
2 * arch/asm-arm/mach-kirkwood/include/mach/gpio.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#include <plat/gpio.h>
diff --git a/arch/arm/mach-kirkwood/include/mach/io.h b/arch/arm/mach-kirkwood/include/mach/io.h
deleted file mode 100644
index 5d0ab61700d..00000000000
--- a/arch/arm/mach-kirkwood/include/mach/io.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/include/mach/io.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_IO_H
10#define __ASM_ARCH_IO_H
11
12#include "kirkwood.h"
13
14#define IO_SPACE_LIMIT 0xffffffff
15
16static inline void __iomem *__io(unsigned long addr)
17{
18 return (void __iomem *)((addr - KIRKWOOD_PCIE_IO_BUS_BASE)
19 + KIRKWOOD_PCIE_IO_VIRT_BASE);
20}
21
22#define __io(a) __io(a)
23
24#endif
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index c5b68510776..041653a04a9 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -37,17 +37,15 @@
37#define KIRKWOOD_NAND_MEM_SIZE SZ_1K 37#define KIRKWOOD_NAND_MEM_SIZE SZ_1K
38 38
39#define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000 39#define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000
40#define KIRKWOOD_PCIE1_IO_VIRT_BASE 0xfef00000 40#define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00010000
41#define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00100000 41#define KIRKWOOD_PCIE1_IO_SIZE SZ_64K
42#define KIRKWOOD_PCIE1_IO_SIZE SZ_1M
43 42
44#define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 43#define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000
45#define KIRKWOOD_PCIE_IO_VIRT_BASE 0xfee00000
46#define KIRKWOOD_PCIE_IO_BUS_BASE 0x00000000 44#define KIRKWOOD_PCIE_IO_BUS_BASE 0x00000000
47#define KIRKWOOD_PCIE_IO_SIZE SZ_1M 45#define KIRKWOOD_PCIE_IO_SIZE SZ_64K
48 46
49#define KIRKWOOD_REGS_PHYS_BASE 0xf1000000 47#define KIRKWOOD_REGS_PHYS_BASE 0xf1000000
50#define KIRKWOOD_REGS_VIRT_BASE 0xfed00000 48#define KIRKWOOD_REGS_VIRT_BASE IOMEM(0xfed00000)
51#define KIRKWOOD_REGS_SIZE SZ_1M 49#define KIRKWOOD_REGS_SIZE SZ_1M
52 50
53#define KIRKWOOD_PCIE_MEM_PHYS_BASE 0xe0000000 51#define KIRKWOOD_PCIE_MEM_PHYS_BASE 0xe0000000
@@ -61,61 +59,61 @@
61/* 59/*
62 * Register Map 60 * Register Map
63 */ 61 */
64#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x00000) 62#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x00000)
65#define DDR_WINDOW_CPU_BASE (DDR_VIRT_BASE | 0x1500) 63#define DDR_WINDOW_CPU_BASE (DDR_VIRT_BASE + 0x1500)
66#define DDR_OPERATION_BASE (DDR_VIRT_BASE | 0x1418) 64#define DDR_OPERATION_BASE (DDR_VIRT_BASE + 0x1418)
67 65
68#define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x10000) 66#define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x10000)
69#define DEV_BUS_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x10000) 67#define DEV_BUS_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x10000)
70#define SAMPLE_AT_RESET (DEV_BUS_VIRT_BASE | 0x0030) 68#define SAMPLE_AT_RESET (DEV_BUS_VIRT_BASE + 0x0030)
71#define DEVICE_ID (DEV_BUS_VIRT_BASE | 0x0034) 69#define DEVICE_ID (DEV_BUS_VIRT_BASE + 0x0034)
72#define GPIO_LOW_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x0100) 70#define GPIO_LOW_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x0100)
73#define GPIO_HIGH_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x0140) 71#define GPIO_HIGH_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x0140)
74#define RTC_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0300) 72#define RTC_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x0300)
75#define SPI_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0600) 73#define SPI_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x0600)
76#define I2C_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1000) 74#define I2C_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x1000)
77#define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2000) 75#define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x2000)
78#define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2000) 76#define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x2000)
79#define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2100) 77#define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x2100)
80#define UART1_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2100) 78#define UART1_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x2100)
81 79
82#define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x20000) 80#define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x20000)
83#define BRIDGE_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x20000) 81#define BRIDGE_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x20000)
84 82
85#define CRYPTO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x30000) 83#define CRYPTO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x30000)
86 84
87#define PCIE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x40000) 85#define PCIE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x40000)
88#define PCIE_LINK_CTRL (PCIE_VIRT_BASE | 0x70) 86#define PCIE_LINK_CTRL (PCIE_VIRT_BASE + 0x70)
89#define PCIE_STATUS (PCIE_VIRT_BASE | 0x1a04) 87#define PCIE_STATUS (PCIE_VIRT_BASE + 0x1a04)
90#define PCIE1_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x44000) 88#define PCIE1_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x44000)
91#define PCIE1_LINK_CTRL (PCIE1_VIRT_BASE | 0x70) 89#define PCIE1_LINK_CTRL (PCIE1_VIRT_BASE + 0x70)
92#define PCIE1_STATUS (PCIE1_VIRT_BASE | 0x1a04) 90#define PCIE1_STATUS (PCIE1_VIRT_BASE + 0x1a04)
93 91
94#define USB_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x50000) 92#define USB_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x50000)
95 93
96#define XOR0_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x60800) 94#define XOR0_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x60800)
97#define XOR0_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x60800) 95#define XOR0_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x60800)
98#define XOR1_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x60900) 96#define XOR1_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x60900)
99#define XOR1_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x60900) 97#define XOR1_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x60900)
100#define XOR0_HIGH_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x60A00) 98#define XOR0_HIGH_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x60A00)
101#define XOR0_HIGH_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x60A00) 99#define XOR0_HIGH_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x60A00)
102#define XOR1_HIGH_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x60B00) 100#define XOR1_HIGH_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x60B00)
103#define XOR1_HIGH_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x60B00) 101#define XOR1_HIGH_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x60B00)
104 102
105#define GE00_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x70000) 103#define GE00_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x70000)
106#define GE01_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x74000) 104#define GE01_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x74000)
107 105
108#define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000) 106#define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x80000)
109#define SATA_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x80000) 107#define SATA_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x80000)
110#define SATA0_IF_CTRL (SATA_VIRT_BASE | 0x2050) 108#define SATA0_IF_CTRL (SATA_VIRT_BASE + 0x2050)
111#define SATA0_PHY_MODE_2 (SATA_VIRT_BASE | 0x2330) 109#define SATA0_PHY_MODE_2 (SATA_VIRT_BASE + 0x2330)
112#define SATA1_IF_CTRL (SATA_VIRT_BASE | 0x4050) 110#define SATA1_IF_CTRL (SATA_VIRT_BASE + 0x4050)
113#define SATA1_PHY_MODE_2 (SATA_VIRT_BASE | 0x4330) 111#define SATA1_PHY_MODE_2 (SATA_VIRT_BASE + 0x4330)
114 112
115#define SDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x90000) 113#define SDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x90000)
116 114
117#define AUDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0xA0000) 115#define AUDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0xA0000)
118#define AUDIO_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0xA0000) 116#define AUDIO_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0xA0000)
119 117
120/* 118/*
121 * Supported devices and revisions. 119 * Supported devices and revisions.
diff --git a/arch/arm/mach-kirkwood/include/mach/leds-netxbig.h b/arch/arm/mach-kirkwood/include/mach/leds-netxbig.h
deleted file mode 100644
index 24b536ebdf1..00000000000
--- a/arch/arm/mach-kirkwood/include/mach/leds-netxbig.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/include/mach/leds-netxbig.h
3 *
4 * Platform data structure for netxbig LED driver
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#ifndef __MACH_LEDS_NETXBIG_H
12#define __MACH_LEDS_NETXBIG_H
13
14struct netxbig_gpio_ext {
15 unsigned *addr;
16 int num_addr;
17 unsigned *data;
18 int num_data;
19 unsigned enable;
20};
21
22enum netxbig_led_mode {
23 NETXBIG_LED_OFF,
24 NETXBIG_LED_ON,
25 NETXBIG_LED_SATA,
26 NETXBIG_LED_TIMER1,
27 NETXBIG_LED_TIMER2,
28 NETXBIG_LED_MODE_NUM,
29};
30
31#define NETXBIG_LED_INVALID_MODE NETXBIG_LED_MODE_NUM
32
33struct netxbig_led_timer {
34 unsigned long delay_on;
35 unsigned long delay_off;
36 enum netxbig_led_mode mode;
37};
38
39struct netxbig_led {
40 const char *name;
41 const char *default_trigger;
42 int mode_addr;
43 int *mode_val;
44 int bright_addr;
45};
46
47struct netxbig_led_platform_data {
48 struct netxbig_gpio_ext *gpio_ext;
49 struct netxbig_led_timer *timer;
50 int num_timer;
51 struct netxbig_led *leds;
52 int num_leds;
53};
54
55#endif /* __MACH_LEDS_NETXBIG_H */
diff --git a/arch/arm/mach-kirkwood/include/mach/leds-ns2.h b/arch/arm/mach-kirkwood/include/mach/leds-ns2.h
deleted file mode 100644
index e21272e5f66..00000000000
--- a/arch/arm/mach-kirkwood/include/mach/leds-ns2.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/include/mach/leds-ns2.h
3 *
4 * Platform data structure for Network Space v2 LED driver
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#ifndef __MACH_LEDS_NS2_H
12#define __MACH_LEDS_NS2_H
13
14struct ns2_led {
15 const char *name;
16 const char *default_trigger;
17 unsigned cmd;
18 unsigned slow;
19};
20
21struct ns2_led_platform_data {
22 int num_leds;
23 struct ns2_led *leds;
24};
25
26#endif /* __MACH_LEDS_NS2_H */
diff --git a/arch/arm/mach-kirkwood/irq.c b/arch/arm/mach-kirkwood/irq.c
index 720063ffa19..884703535a0 100644
--- a/arch/arm/mach-kirkwood/irq.c
+++ b/arch/arm/mach-kirkwood/irq.c
@@ -10,7 +10,9 @@
10#include <linux/gpio.h> 10#include <linux/gpio.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/irq.h> 12#include <linux/irq.h>
13#include <linux/io.h>
13#include <mach/bridge-regs.h> 14#include <mach/bridge-regs.h>
15#include <plat/orion-gpio.h>
14#include <plat/irq.h> 16#include <plat/irq.h>
15 17
16static int __initdata gpio0_irqs[4] = { 18static int __initdata gpio0_irqs[4] = {
@@ -29,14 +31,14 @@ static int __initdata gpio1_irqs[4] = {
29 31
30void __init kirkwood_init_irq(void) 32void __init kirkwood_init_irq(void)
31{ 33{
32 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF)); 34 orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF);
33 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)); 35 orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF);
34 36
35 /* 37 /*
36 * Initialize gpiolib for GPIOs 0-49. 38 * Initialize gpiolib for GPIOs 0-49.
37 */ 39 */
38 orion_gpio_init(NULL, 0, 32, (void __iomem *)GPIO_LOW_VIRT_BASE, 0, 40 orion_gpio_init(NULL, 0, 32, GPIO_LOW_VIRT_BASE, 0,
39 IRQ_KIRKWOOD_GPIO_START, gpio0_irqs); 41 IRQ_KIRKWOOD_GPIO_START, gpio0_irqs);
40 orion_gpio_init(NULL, 32, 18, (void __iomem *)GPIO_HIGH_VIRT_BASE, 0, 42 orion_gpio_init(NULL, 32, 18, GPIO_HIGH_VIRT_BASE, 0,
41 IRQ_KIRKWOOD_GPIO_START + 32, gpio1_irqs); 43 IRQ_KIRKWOOD_GPIO_START + 32, gpio1_irqs);
42} 44}
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c
index e6bba01bae3..88b0788baca 100644
--- a/arch/arm/mach-kirkwood/netspace_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netspace_v2-setup.c
@@ -34,7 +34,7 @@
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
36#include <mach/kirkwood.h> 36#include <mach/kirkwood.h>
37#include <mach/leds-ns2.h> 37#include <linux/platform_data/leds-kirkwood-ns2.h>
38#include "common.h" 38#include "common.h"
39#include "mpp.h" 39#include "mpp.h"
40#include "lacie_v2-common.h" 40#include "lacie_v2-common.h"
diff --git a/arch/arm/mach-kirkwood/netxbig_v2-setup.c b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
index 31ae8de34e9..a3b091470b8 100644
--- a/arch/arm/mach-kirkwood/netxbig_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
@@ -32,7 +32,7 @@
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
34#include <mach/kirkwood.h> 34#include <mach/kirkwood.h>
35#include <mach/leds-netxbig.h> 35#include <linux/platform_data/leds-kirkwood-netxbig.h>
36#include "common.h" 36#include "common.h"
37#include "mpp.h" 37#include "mpp.h"
38#include "lacie_v2-common.h" 38#include "lacie_v2-common.h"
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
index 7e99c3f340f..134ef50d58f 100644
--- a/arch/arm/mach-kirkwood/openrd-setup.c
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -20,7 +20,7 @@
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
22#include <mach/kirkwood.h> 22#include <mach/kirkwood.h>
23#include <plat/mvsdio.h> 23#include <linux/platform_data/mmc-mvsdio.h>
24#include "common.h" 24#include "common.h"
25#include "mpp.h" 25#include "mpp.h"
26 26
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index 6e8b2efa3c3..ec544918b12 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -47,8 +47,8 @@ void kirkwood_enable_pcie(void)
47void kirkwood_pcie_id(u32 *dev, u32 *rev) 47void kirkwood_pcie_id(u32 *dev, u32 *rev)
48{ 48{
49 kirkwood_enable_pcie(); 49 kirkwood_enable_pcie();
50 *dev = orion_pcie_dev_id((void __iomem *)PCIE_VIRT_BASE); 50 *dev = orion_pcie_dev_id(PCIE_VIRT_BASE);
51 *rev = orion_pcie_rev((void __iomem *)PCIE_VIRT_BASE); 51 *rev = orion_pcie_rev(PCIE_VIRT_BASE);
52} 52}
53 53
54struct pcie_port { 54struct pcie_port {
@@ -56,7 +56,7 @@ struct pcie_port {
56 void __iomem *base; 56 void __iomem *base;
57 spinlock_t conf_lock; 57 spinlock_t conf_lock;
58 int irq; 58 int irq;
59 struct resource res[2]; 59 struct resource res;
60}; 60};
61 61
62static int pcie_port_map[2]; 62static int pcie_port_map[2];
@@ -133,46 +133,30 @@ static struct pci_ops pcie_ops = {
133 133
134static void __init pcie0_ioresources_init(struct pcie_port *pp) 134static void __init pcie0_ioresources_init(struct pcie_port *pp)
135{ 135{
136 pp->base = (void __iomem *)PCIE_VIRT_BASE; 136 pp->base = PCIE_VIRT_BASE;
137 pp->irq = IRQ_KIRKWOOD_PCIE; 137 pp->irq = IRQ_KIRKWOOD_PCIE;
138 138
139 /* 139 /*
140 * IORESOURCE_IO
141 */
142 pp->res[0].name = "PCIe 0 I/O Space";
143 pp->res[0].start = KIRKWOOD_PCIE_IO_BUS_BASE;
144 pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE_IO_SIZE - 1;
145 pp->res[0].flags = IORESOURCE_IO;
146
147 /*
148 * IORESOURCE_MEM 140 * IORESOURCE_MEM
149 */ 141 */
150 pp->res[1].name = "PCIe 0 MEM"; 142 pp->res.name = "PCIe 0 MEM";
151 pp->res[1].start = KIRKWOOD_PCIE_MEM_PHYS_BASE; 143 pp->res.start = KIRKWOOD_PCIE_MEM_PHYS_BASE;
152 pp->res[1].end = pp->res[1].start + KIRKWOOD_PCIE_MEM_SIZE - 1; 144 pp->res.end = pp->res.start + KIRKWOOD_PCIE_MEM_SIZE - 1;
153 pp->res[1].flags = IORESOURCE_MEM; 145 pp->res.flags = IORESOURCE_MEM;
154} 146}
155 147
156static void __init pcie1_ioresources_init(struct pcie_port *pp) 148static void __init pcie1_ioresources_init(struct pcie_port *pp)
157{ 149{
158 pp->base = (void __iomem *)PCIE1_VIRT_BASE; 150 pp->base = PCIE1_VIRT_BASE;
159 pp->irq = IRQ_KIRKWOOD_PCIE1; 151 pp->irq = IRQ_KIRKWOOD_PCIE1;
160 152
161 /* 153 /*
162 * IORESOURCE_IO
163 */
164 pp->res[0].name = "PCIe 1 I/O Space";
165 pp->res[0].start = KIRKWOOD_PCIE1_IO_BUS_BASE;
166 pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE1_IO_SIZE - 1;
167 pp->res[0].flags = IORESOURCE_IO;
168
169 /*
170 * IORESOURCE_MEM 154 * IORESOURCE_MEM
171 */ 155 */
172 pp->res[1].name = "PCIe 1 MEM"; 156 pp->res.name = "PCIe 1 MEM";
173 pp->res[1].start = KIRKWOOD_PCIE1_MEM_PHYS_BASE; 157 pp->res.start = KIRKWOOD_PCIE1_MEM_PHYS_BASE;
174 pp->res[1].end = pp->res[1].start + KIRKWOOD_PCIE1_MEM_SIZE - 1; 158 pp->res.end = pp->res.start + KIRKWOOD_PCIE1_MEM_SIZE - 1;
175 pp->res[1].flags = IORESOURCE_MEM; 159 pp->res.flags = IORESOURCE_MEM;
176} 160}
177 161
178static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) 162static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
@@ -197,23 +181,21 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
197 case 0: 181 case 0:
198 kirkwood_enable_pcie_clk("0"); 182 kirkwood_enable_pcie_clk("0");
199 pcie0_ioresources_init(pp); 183 pcie0_ioresources_init(pp);
184 pci_ioremap_io(SZ_64K * sys->busnr, KIRKWOOD_PCIE_IO_PHYS_BASE);
200 break; 185 break;
201 case 1: 186 case 1:
202 kirkwood_enable_pcie_clk("1"); 187 kirkwood_enable_pcie_clk("1");
203 pcie1_ioresources_init(pp); 188 pcie1_ioresources_init(pp);
189 pci_ioremap_io(SZ_64K * sys->busnr, KIRKWOOD_PCIE1_IO_PHYS_BASE);
204 break; 190 break;
205 default: 191 default:
206 panic("PCIe setup: invalid controller %d", index); 192 panic("PCIe setup: invalid controller %d", index);
207 } 193 }
208 194
209 if (request_resource(&ioport_resource, &pp->res[0])) 195 if (request_resource(&iomem_resource, &pp->res))
210 panic("Request PCIe%d IO resource failed\n", index);
211 if (request_resource(&iomem_resource, &pp->res[1]))
212 panic("Request PCIe%d Memory resource failed\n", index); 196 panic("Request PCIe%d Memory resource failed\n", index);
213 197
214 sys->io_offset = 0; 198 pci_add_resource_offset(&sys->resources, &pp->res, sys->mem_offset);
215 pci_add_resource_offset(&sys->resources, &pp->res[0], sys->io_offset);
216 pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset);
217 199
218 /* 200 /*
219 * Generic PCIe unit setup. 201 * Generic PCIe unit setup.
@@ -273,11 +255,11 @@ static struct hw_pci kirkwood_pci __initdata = {
273 .map_irq = kirkwood_pcie_map_irq, 255 .map_irq = kirkwood_pcie_map_irq,
274}; 256};
275 257
276static void __init add_pcie_port(int index, unsigned long base) 258static void __init add_pcie_port(int index, void __iomem *base)
277{ 259{
278 printk(KERN_INFO "Kirkwood PCIe port %d: ", index); 260 printk(KERN_INFO "Kirkwood PCIe port %d: ", index);
279 261
280 if (orion_pcie_link_up((void __iomem *)base)) { 262 if (orion_pcie_link_up(base)) {
281 printk(KERN_INFO "link up\n"); 263 printk(KERN_INFO "link up\n");
282 pcie_port_map[num_pcie_ports++] = index; 264 pcie_port_map[num_pcie_ports++] = index;
283 } else 265 } else
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
index f742a66a704..19072c84008 100644
--- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
@@ -19,6 +19,7 @@
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 <plat/orion-gpio.h>
22#include "common.h" 23#include "common.h"
23 24
24#define RD88F6192_GPIO_USB_VBUS 10 25#define RD88F6192_GPIO_USB_VBUS 10
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c
index ef922079348..9717101a743 100644
--- a/arch/arm/mach-kirkwood/rd88f6281-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c
@@ -20,7 +20,7 @@
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
22#include <mach/kirkwood.h> 22#include <mach/kirkwood.h>
23#include <plat/mvsdio.h> 23#include <linux/platform_data/mmc-mvsdio.h>
24#include "common.h" 24#include "common.h"
25#include "mpp.h" 25#include "mpp.h"
26 26
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c
index 4ea70e5f713..28d0abaf4bd 100644
--- a/arch/arm/mach-kirkwood/sheevaplug-setup.c
+++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c
@@ -19,7 +19,7 @@
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 <plat/mvsdio.h> 22#include <linux/platform_data/mmc-mvsdio.h>
23#include "common.h" 23#include "common.h"
24#include "mpp.h" 24#include "mpp.h"
25 25
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c
index 5bbca268044..367a9400f53 100644
--- a/arch/arm/mach-kirkwood/ts41x-setup.c
+++ b/arch/arm/mach-kirkwood/ts41x-setup.c
@@ -20,6 +20,7 @@
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/gpio_keys.h> 21#include <linux/gpio_keys.h>
22#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/io.h>
23#include <asm/mach-types.h> 24#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
25#include <mach/kirkwood.h> 26#include <mach/kirkwood.h>
@@ -161,7 +162,7 @@ static int __init ts41x_pci_init(void)
161 * (Marvell 88sx7042/sata_mv) is known to stop working 162 * (Marvell 88sx7042/sata_mv) is known to stop working
162 * after a few minutes. 163 * after a few minutes.
163 */ 164 */
164 orion_pcie_reset((void __iomem *)PCIE_VIRT_BASE); 165 orion_pcie_reset(PCIE_VIRT_BASE);
165 166
166 kirkwood_pcie_id(&dev, &rev); 167 kirkwood_pcie_id(&dev, &rev);
167 if (dev == MV88F6282_DEV_ID) 168 if (dev == MV88F6282_DEV_ID)
diff --git a/arch/arm/mach-ks8695/Kconfig b/arch/arm/mach-ks8695/Kconfig
index f5c39a8c2b0..a545976bdbd 100644
--- a/arch/arm/mach-ks8695/Kconfig
+++ b/arch/arm/mach-ks8695/Kconfig
@@ -21,6 +21,67 @@ config MACH_ACS5K
21 say 'Y' here if you want your kernel to run on the Brivo 21 say 'Y' here if you want your kernel to run on the Brivo
22 Systems LLC, ACS-5000 Master board. 22 Systems LLC, ACS-5000 Master board.
23 23
24config MACH_LITE300
25 bool "SecureComputing SG300"
26 help
27 Say 'Y' here if you want your kernel to support the
28 SecureComputing / SnapGear SG300 VPN Internet Router.
29 See http://www.securecomputing.com for more details.
30
31config MACH_SG310
32 bool "McAfee SG310"
33 help
34 Say 'Y' here if you want your kernel to support the
35 McAfee / SnapGear SG310 VPN Internet Router.
36 See http://www.mcafee.com for more details.
37
38config MACH_SE4200
39 bool "SecureComputing SE4200"
40 help
41 Say 'Y' here if you want your kernel to support the
42 SecureComputing / SnapGear SE4200 Secure Wireless VPN
43 Internet Router.
44 See http://www.securecomputing.com for more details.
45
46config MACH_CM4002
47 bool "OpenGear CM4002"
48 help
49 Say 'Y' here if you want your kernel to support the OpenGear
50 CM4002 Secure Access Server. See http://www.opengear.com for
51 more details.
52
53config MACH_CM4008
54 bool "OpenGear CM4008"
55 select MIGHT_HAVE_PCI
56 help
57 Say 'Y' here if you want your kernel to support the OpenGear
58 CM4008 Console Server. See http://www.opengear.com for more
59 details.
60
61config MACH_CM41xx
62 bool "OpenGear CM41xx"
63 select MIGHT_HAVE_PCI
64 help
65 Say 'Y' here if you want your kernel to support the OpenGear
66 CM4016 or CM4048 Console Servers. See http://www.opengear.com for
67 more details.
68
69config MACH_IM4004
70 bool "OpenGear IM4004"
71 select MIGHT_HAVE_PCI
72 help
73 Say 'Y' here if you want your kernel to support the OpenGear
74 IM4004 Secure Access Server. See http://www.opengear.com for
75 more details.
76
77config MACH_IM42xx
78 bool "OpenGear IM42xx"
79 select MIGHT_HAVE_PCI
80 help
81 Say 'Y' here if you want your kernel to support the OpenGear
82 IM4216 or IM4248 Console Servers. See http://www.opengear.com for
83 more details.
84
24endmenu 85endmenu
25 86
26endif 87endif
diff --git a/arch/arm/mach-ks8695/Makefile b/arch/arm/mach-ks8695/Makefile
index 853efd9133c..e370caf0c91 100644
--- a/arch/arm/mach-ks8695/Makefile
+++ b/arch/arm/mach-ks8695/Makefile
@@ -11,10 +11,15 @@ obj- :=
11# PCI support is optional 11# PCI support is optional
12obj-$(CONFIG_PCI) += pci.o 12obj-$(CONFIG_PCI) += pci.o
13 13
14# LEDs
15obj-$(CONFIG_LEDS) += leds.o
16
17# Board-specific support 14# Board-specific support
18obj-$(CONFIG_MACH_KS8695) += board-micrel.o 15obj-$(CONFIG_MACH_KS8695) += board-micrel.o
19obj-$(CONFIG_MACH_DSM320) += board-dsm320.o 16obj-$(CONFIG_MACH_DSM320) += board-dsm320.o
20obj-$(CONFIG_MACH_ACS5K) += board-acs5k.o 17obj-$(CONFIG_MACH_ACS5K) += board-acs5k.o
18obj-$(CONFIG_MACH_LITE300) += board-sg.o
19obj-$(CONFIG_MACH_SG310) += board-sg.o
20obj-$(CONFIG_MACH_SE4200) += board-sg.o
21obj-$(CONFIG_MACH_CM4002) += board-og.o
22obj-$(CONFIG_MACH_CM4008) += board-og.o
23obj-$(CONFIG_MACH_CM41xx) += board-og.o
24obj-$(CONFIG_MACH_IM4004) += board-og.o
25obj-$(CONFIG_MACH_IM42xx) += board-og.o
diff --git a/arch/arm/mach-ks8695/board-og.c b/arch/arm/mach-ks8695/board-og.c
new file mode 100644
index 00000000000..1623ba461e4
--- /dev/null
+++ b/arch/arm/mach-ks8695/board-og.c
@@ -0,0 +1,199 @@
1/*
2 * board-og.c -- support for the OpenGear KS8695 based boards.
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/kernel.h>
10#include <linux/types.h>
11#include <linux/interrupt.h>
12#include <linux/init.h>
13#include <linux/delay.h>
14#include <linux/platform_device.h>
15#include <linux/serial_8250.h>
16#include <linux/gpio.h>
17#include <linux/irq.h>
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <asm/mach/map.h>
21#include <mach/devices.h>
22#include <mach/regs-gpio.h>
23#include <mach/gpio-ks8695.h>
24#include "generic.h"
25
26static int og_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
27{
28 if (machine_is_im4004() && (slot == 8))
29 return KS8695_IRQ_EXTERN1;
30 return KS8695_IRQ_EXTERN0;
31}
32
33static struct ks8695_pci_cfg __initdata og_pci = {
34 .mode = KS8695_MODE_PCI,
35 .map_irq = og_pci_map_irq,
36};
37
38static void __init og_register_pci(void)
39{
40 /* Initialize the GPIO lines for interrupt mode */
41 ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW);
42
43 /* Cardbus Slot */
44 if (machine_is_im4004())
45 ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_LOW);
46
47 ks8695_init_pci(&og_pci);
48}
49
50/*
51 * The PCI bus reset is driven by a dedicated GPIO line. Toggle it here
52 * and bring the PCI bus out of reset.
53 */
54static void __init og_pci_bus_reset(void)
55{
56 unsigned int rstline = 1;
57
58 /* Some boards use a different GPIO as the PCI reset line */
59 if (machine_is_im4004())
60 rstline = 2;
61 else if (machine_is_im42xx())
62 rstline = 0;
63
64 gpio_request(rstline, "PCI reset");
65 gpio_direction_output(rstline, 0);
66
67 /* Drive a reset on the PCI reset line */
68 gpio_set_value(rstline, 1);
69 gpio_set_value(rstline, 0);
70 mdelay(100);
71 gpio_set_value(rstline, 1);
72 mdelay(100);
73}
74
75/*
76 * Direct connect serial ports (non-PCI that is).
77 */
78#define S8250_PHYS 0x03800000
79#define S8250_VIRT 0xf4000000
80#define S8250_SIZE 0x00100000
81
82static struct __initdata map_desc og_io_desc[] = {
83 {
84 .virtual = S8250_VIRT,
85 .pfn = __phys_to_pfn(S8250_PHYS),
86 .length = S8250_SIZE,
87 .type = MT_DEVICE,
88 }
89};
90
91static struct resource og_uart_resources[] = {
92 {
93 .start = S8250_VIRT,
94 .end = S8250_VIRT + S8250_SIZE,
95 .flags = IORESOURCE_MEM
96 },
97};
98
99static struct plat_serial8250_port og_uart_data[] = {
100 {
101 .mapbase = S8250_VIRT,
102 .membase = (char *) S8250_VIRT,
103 .irq = 3,
104 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
105 .iotype = UPIO_MEM,
106 .regshift = 2,
107 .uartclk = 115200 * 16,
108 },
109 { },
110};
111
112static struct platform_device og_uart = {
113 .name = "serial8250",
114 .id = 0,
115 .dev.platform_data = og_uart_data,
116 .num_resources = 1,
117 .resource = og_uart_resources
118};
119
120static struct platform_device *og_devices[] __initdata = {
121 &og_uart
122};
123
124static void __init og_init(void)
125{
126 ks8695_register_gpios();
127
128 if (machine_is_cm4002()) {
129 ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_HIGH);
130 iotable_init(og_io_desc, ARRAY_SIZE(og_io_desc));
131 platform_add_devices(og_devices, ARRAY_SIZE(og_devices));
132 } else {
133 og_pci_bus_reset();
134 og_register_pci();
135 }
136
137 ks8695_add_device_lan();
138 ks8695_add_device_wan();
139}
140
141#ifdef CONFIG_MACH_CM4002
142MACHINE_START(CM4002, "OpenGear/CM4002")
143 /* OpenGear Inc. */
144 .atag_offset = 0x100,
145 .map_io = ks8695_map_io,
146 .init_irq = ks8695_init_irq,
147 .init_machine = og_init,
148 .timer = &ks8695_timer,
149 .restart = ks8695_restart,
150MACHINE_END
151#endif
152
153#ifdef CONFIG_MACH_CM4008
154MACHINE_START(CM4008, "OpenGear/CM4008")
155 /* OpenGear Inc. */
156 .atag_offset = 0x100,
157 .map_io = ks8695_map_io,
158 .init_irq = ks8695_init_irq,
159 .init_machine = og_init,
160 .timer = &ks8695_timer,
161 .restart = ks8695_restart,
162MACHINE_END
163#endif
164
165#ifdef CONFIG_MACH_CM41xx
166MACHINE_START(CM41XX, "OpenGear/CM41xx")
167 /* OpenGear Inc. */
168 .atag_offset = 0x100,
169 .map_io = ks8695_map_io,
170 .init_irq = ks8695_init_irq,
171 .init_machine = og_init,
172 .timer = &ks8695_timer,
173 .restart = ks8695_restart,
174MACHINE_END
175#endif
176
177#ifdef CONFIG_MACH_IM4004
178MACHINE_START(IM4004, "OpenGear/IM4004")
179 /* OpenGear Inc. */
180 .atag_offset = 0x100,
181 .map_io = ks8695_map_io,
182 .init_irq = ks8695_init_irq,
183 .init_machine = og_init,
184 .timer = &ks8695_timer,
185 .restart = ks8695_restart,
186MACHINE_END
187#endif
188
189#ifdef CONFIG_MACH_IM42xx
190MACHINE_START(IM42XX, "OpenGear/IM42xx")
191 /* OpenGear Inc. */
192 .atag_offset = 0x100,
193 .map_io = ks8695_map_io,
194 .init_irq = ks8695_init_irq,
195 .init_machine = og_init,
196 .timer = &ks8695_timer,
197 .restart = ks8695_restart,
198MACHINE_END
199#endif
diff --git a/arch/arm/mach-ks8695/board-sg.c b/arch/arm/mach-ks8695/board-sg.c
new file mode 100644
index 00000000000..f35b98b5bf3
--- /dev/null
+++ b/arch/arm/mach-ks8695/board-sg.c
@@ -0,0 +1,121 @@
1/*
2 * board-sg.c -- support for the SnapGear KS8695 based boards
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/kernel.h>
10#include <linux/types.h>
11#include <linux/init.h>
12#include <linux/platform_device.h>
13#include <linux/mtd/mtd.h>
14#include <linux/mtd/map.h>
15#include <linux/mtd/physmap.h>
16#include <linux/mtd/partitions.h>
17#include <asm/mach-types.h>
18#include <asm/mach/arch.h>
19#include <mach/devices.h>
20#include "generic.h"
21
22/*
23 * The SG310 machine type is fitted with a conventional 8MB Strataflash
24 * device. Define its partitioning.
25 */
26#define FL_BASE 0x02000000
27#define FL_SIZE SZ_8M
28
29static struct mtd_partition sg_mtd_partitions[] = {
30 [0] = {
31 .name = "SnapGear Boot Loader",
32 .size = SZ_128K,
33 },
34 [1] = {
35 .name = "SnapGear non-volatile configuration",
36 .size = SZ_512K,
37 .offset = SZ_256K,
38 },
39 [2] = {
40 .name = "SnapGear image",
41 .offset = SZ_512K + SZ_256K,
42 },
43 [3] = {
44 .name = "SnapGear StrataFlash",
45 },
46 [4] = {
47 .name = "SnapGear Boot Tags",
48 .size = SZ_128K,
49 .offset = SZ_128K,
50 },
51};
52
53static struct physmap_flash_data sg_mtd_pdata = {
54 .width = 1,
55 .nr_parts = ARRAY_SIZE(sg_mtd_partitions),
56 .parts = sg_mtd_partitions,
57};
58
59
60static struct resource sg_mtd_resource[] = {
61 [0] = {
62 .start = FL_BASE,
63 .end = FL_BASE + FL_SIZE - 1,
64 .flags = IORESOURCE_MEM,
65 },
66};
67
68static struct platform_device sg_mtd_device = {
69 .name = "physmap-flash",
70 .id = 0,
71 .num_resources = ARRAY_SIZE(sg_mtd_resource),
72 .resource = sg_mtd_resource,
73 .dev = {
74 .platform_data = &sg_mtd_pdata,
75 },
76};
77
78static void __init sg_init(void)
79{
80 ks8695_add_device_lan();
81 ks8695_add_device_wan();
82
83 if (machine_is_sg310())
84 platform_device_register(&sg_mtd_device);
85}
86
87#ifdef CONFIG_MACH_LITE300
88MACHINE_START(LITE300, "SecureComputing/SG300")
89 /* SnapGear */
90 .atag_offset = 0x100,
91 .map_io = ks8695_map_io,
92 .init_irq = ks8695_init_irq,
93 .init_machine = sg_init,
94 .timer = &ks8695_timer,
95 .restart = ks8695_restart,
96MACHINE_END
97#endif
98
99#ifdef CONFIG_MACH_SG310
100MACHINE_START(SG310, "McAfee/SG310")
101 /* SnapGear */
102 .atag_offset = 0x100,
103 .map_io = ks8695_map_io,
104 .init_irq = ks8695_init_irq,
105 .init_machine = sg_init,
106 .timer = &ks8695_timer,
107 .restart = ks8695_restart,
108MACHINE_END
109#endif
110
111#ifdef CONFIG_MACH_SE4200
112MACHINE_START(SE4200, "SecureComputing/SE4200")
113 /* SnapGear */
114 .atag_offset = 0x100,
115 .map_io = ks8695_map_io,
116 .init_irq = ks8695_init_irq,
117 .init_machine = sg_init,
118 .timer = &ks8695_timer,
119 .restart = ks8695_restart,
120MACHINE_END
121#endif
diff --git a/arch/arm/mach-ks8695/cpu.c b/arch/arm/mach-ks8695/cpu.c
index 7f3f24053a0..ddb24222918 100644
--- a/arch/arm/mach-ks8695/cpu.c
+++ b/arch/arm/mach-ks8695/cpu.c
@@ -36,7 +36,7 @@
36 36
37static struct __initdata map_desc ks8695_io_desc[] = { 37static struct __initdata map_desc ks8695_io_desc[] = {
38 { 38 {
39 .virtual = KS8695_IO_VA, 39 .virtual = (unsigned long)KS8695_IO_VA,
40 .pfn = __phys_to_pfn(KS8695_IO_PA), 40 .pfn = __phys_to_pfn(KS8695_IO_PA),
41 .length = KS8695_IO_SIZE, 41 .length = KS8695_IO_SIZE,
42 .type = MT_DEVICE, 42 .type = MT_DEVICE,
diff --git a/arch/arm/mach-ks8695/devices.c b/arch/arm/mach-ks8695/devices.c
index 73bd6381287..47399bc3c02 100644
--- a/arch/arm/mach-ks8695/devices.c
+++ b/arch/arm/mach-ks8695/devices.c
@@ -182,27 +182,6 @@ static void __init ks8695_add_device_watchdog(void)
182} 182}
183 183
184 184
185/* --------------------------------------------------------------------
186 * LEDs
187 * -------------------------------------------------------------------- */
188
189#if defined(CONFIG_LEDS)
190short ks8695_leds_cpu = -1;
191short ks8695_leds_timer = -1;
192
193void __init ks8695_init_leds(u8 cpu_led, u8 timer_led)
194{
195 /* Enable GPIO to access the LEDs */
196 gpio_direction_output(cpu_led, 1);
197 gpio_direction_output(timer_led, 1);
198
199 ks8695_leds_cpu = cpu_led;
200 ks8695_leds_timer = timer_led;
201}
202#else
203void __init ks8695_init_leds(u8 cpu_led, u8 timer_led) {}
204#endif
205
206/* -------------------------------------------------------------------- */ 185/* -------------------------------------------------------------------- */
207 186
208/* 187/*
diff --git a/arch/arm/mach-ks8695/include/mach/devices.h b/arch/arm/mach-ks8695/include/mach/devices.h
index 85a3c9aa7d1..1e6594a0f29 100644
--- a/arch/arm/mach-ks8695/include/mach/devices.h
+++ b/arch/arm/mach-ks8695/include/mach/devices.h
@@ -18,11 +18,6 @@ extern void __init ks8695_add_device_wan(void);
18extern void __init ks8695_add_device_lan(void); 18extern void __init ks8695_add_device_lan(void);
19extern void __init ks8695_add_device_hpna(void); 19extern void __init ks8695_add_device_hpna(void);
20 20
21 /* LEDs */
22extern short ks8695_leds_cpu;
23extern short ks8695_leds_timer;
24extern void __init ks8695_init_leds(u8 cpu_led, u8 timer_led);
25
26 /* PCI */ 21 /* PCI */
27#define KS8695_MODE_PCI 0 22#define KS8695_MODE_PCI 0
28#define KS8695_MODE_MINIPCI 1 23#define KS8695_MODE_MINIPCI 1
diff --git a/arch/arm/mach-ks8695/include/mach/hardware.h b/arch/arm/mach-ks8695/include/mach/hardware.h
index 5e0c388143d..5090338c0db 100644
--- a/arch/arm/mach-ks8695/include/mach/hardware.h
+++ b/arch/arm/mach-ks8695/include/mach/hardware.h
@@ -33,7 +33,7 @@
33 * head debug code as the initial MMU setup only deals in L1 sections. 33 * head debug code as the initial MMU setup only deals in L1 sections.
34 */ 34 */
35#define KS8695_IO_PA 0x03F00000 35#define KS8695_IO_PA 0x03F00000
36#define KS8695_IO_VA 0xF0000000 36#define KS8695_IO_VA IOMEM(0xF0000000)
37#define KS8695_IO_SIZE SZ_1M 37#define KS8695_IO_SIZE SZ_1M
38 38
39#define KS8695_PCIMEM_PA 0x60000000 39#define KS8695_PCIMEM_PA 0x60000000
diff --git a/arch/arm/mach-ks8695/include/mach/memory.h b/arch/arm/mach-ks8695/include/mach/memory.h
index f7e1b9bce34..95e731a7ed6 100644
--- a/arch/arm/mach-ks8695/include/mach/memory.h
+++ b/arch/arm/mach-ks8695/include/mach/memory.h
@@ -34,7 +34,8 @@ extern struct bus_type platform_bus_type;
34#define __arch_dma_to_virt(dev, x) ({ (void *) (is_lbus_device(dev) ? \ 34#define __arch_dma_to_virt(dev, x) ({ (void *) (is_lbus_device(dev) ? \
35 __phys_to_virt(x) : __bus_to_virt(x)); }) 35 __phys_to_virt(x) : __bus_to_virt(x)); })
36#define __arch_virt_to_dma(dev, x) ({ is_lbus_device(dev) ? \ 36#define __arch_virt_to_dma(dev, x) ({ is_lbus_device(dev) ? \
37 (dma_addr_t)__virt_to_phys(x) : (dma_addr_t)__virt_to_bus(x); }) 37 (dma_addr_t)__virt_to_phys((unsigned long)x) \
38 : (dma_addr_t)__virt_to_bus(x); })
38#define __arch_pfn_to_dma(dev, pfn) \ 39#define __arch_pfn_to_dma(dev, pfn) \
39 ({ dma_addr_t __dma = __pfn_to_phys(pfn); \ 40 ({ dma_addr_t __dma = __pfn_to_phys(pfn); \
40 if (!is_lbus_device(dev)) \ 41 if (!is_lbus_device(dev)) \
diff --git a/arch/arm/mach-ks8695/include/mach/regs-timer.h b/arch/arm/mach-ks8695/include/mach/regs-timer.h
deleted file mode 100644
index e620cda99d2..00000000000
--- a/arch/arm/mach-ks8695/include/mach/regs-timer.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/regs-timer.h
3 *
4 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
5 * Copyright (C) 2006 Simtec Electronics
6 *
7 * KS8695 - Timer registers and bit definitions.
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 KS8695_TIMER_H
15#define KS8695_TIMER_H
16
17#define KS8695_TMR_OFFSET (0xF0000 + 0xE400)
18#define KS8695_TMR_VA (KS8695_IO_VA + KS8695_TMR_OFFSET)
19#define KS8695_TMR_PA (KS8695_IO_PA + KS8695_TMR_OFFSET)
20
21
22/*
23 * Timer registers
24 */
25#define KS8695_TMCON (0x00) /* Timer Control Register */
26#define KS8695_T1TC (0x04) /* Timer 1 Timeout Count Register */
27#define KS8695_T0TC (0x08) /* Timer 0 Timeout Count Register */
28#define KS8695_T1PD (0x0C) /* Timer 1 Pulse Count Register */
29#define KS8695_T0PD (0x10) /* Timer 0 Pulse Count Register */
30
31
32/* Timer Control Register */
33#define TMCON_T1EN (1 << 1) /* Timer 1 Enable */
34#define TMCON_T0EN (1 << 0) /* Timer 0 Enable */
35
36/* Timer0 Timeout Counter Register */
37#define T0TC_WATCHDOG (0xff) /* Enable watchdog mode */
38
39
40#endif
diff --git a/arch/arm/mach-ks8695/include/mach/uncompress.h b/arch/arm/mach-ks8695/include/mach/uncompress.h
index 9495cb4d701..8879d610308 100644
--- a/arch/arm/mach-ks8695/include/mach/uncompress.h
+++ b/arch/arm/mach-ks8695/include/mach/uncompress.h
@@ -19,15 +19,15 @@
19 19
20static void putc(char c) 20static void putc(char c)
21{ 21{
22 while (!(__raw_readl(KS8695_UART_PA + KS8695_URLS) & URLS_URTHRE)) 22 while (!(__raw_readl((void __iomem*)KS8695_UART_PA + KS8695_URLS) & URLS_URTHRE))
23 barrier(); 23 barrier();
24 24
25 __raw_writel(c, KS8695_UART_PA + KS8695_URTH); 25 __raw_writel(c, (void __iomem*)KS8695_UART_PA + KS8695_URTH);
26} 26}
27 27
28static inline void flush(void) 28static inline void flush(void)
29{ 29{
30 while (!(__raw_readl(KS8695_UART_PA + KS8695_URLS) & URLS_URTE)) 30 while (!(__raw_readl((void __iomem*)KS8695_UART_PA + KS8695_URLS) & URLS_URTE))
31 barrier(); 31 barrier();
32} 32}
33 33
diff --git a/arch/arm/mach-ks8695/leds.c b/arch/arm/mach-ks8695/leds.c
deleted file mode 100644
index 4bd70754729..00000000000
--- a/arch/arm/mach-ks8695/leds.c
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 * LED driver for KS8695-based boards.
3 *
4 * Copyright (C) Andrew Victor
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/gpio.h>
11#include <linux/kernel.h>
12#include <linux/module.h>
13#include <linux/init.h>
14
15#include <asm/leds.h>
16#include <mach/devices.h>
17
18
19static inline void ks8695_led_on(unsigned int led)
20{
21 gpio_set_value(led, 0);
22}
23
24static inline void ks8695_led_off(unsigned int led)
25{
26 gpio_set_value(led, 1);
27}
28
29static inline void ks8695_led_toggle(unsigned int led)
30{
31 unsigned long is_off = gpio_get_value(led);
32 if (is_off)
33 ks8695_led_on(led);
34 else
35 ks8695_led_off(led);
36}
37
38
39/*
40 * Handle LED events.
41 */
42static void ks8695_leds_event(led_event_t evt)
43{
44 unsigned long flags;
45
46 local_irq_save(flags);
47
48 switch(evt) {
49 case led_start: /* System startup */
50 ks8695_led_on(ks8695_leds_cpu);
51 break;
52
53 case led_stop: /* System stop / suspend */
54 ks8695_led_off(ks8695_leds_cpu);
55 break;
56
57#ifdef CONFIG_LEDS_TIMER
58 case led_timer: /* Every 50 timer ticks */
59 ks8695_led_toggle(ks8695_leds_timer);
60 break;
61#endif
62
63#ifdef CONFIG_LEDS_CPU
64 case led_idle_start: /* Entering idle state */
65 ks8695_led_off(ks8695_leds_cpu);
66 break;
67
68 case led_idle_end: /* Exit idle state */
69 ks8695_led_on(ks8695_leds_cpu);
70 break;
71#endif
72
73 default:
74 break;
75 }
76
77 local_irq_restore(flags);
78}
79
80
81static int __init leds_init(void)
82{
83 if ((ks8695_leds_timer == -1) || (ks8695_leds_cpu == -1))
84 return -ENODEV;
85
86 leds_event = ks8695_leds_event;
87
88 leds_event(led_start);
89 return 0;
90}
91
92__initcall(leds_init);
diff --git a/arch/arm/mach-ks8695/time.c b/arch/arm/mach-ks8695/time.c
index ec783a3070a..46c84bc7792 100644
--- a/arch/arm/mach-ks8695/time.c
+++ b/arch/arm/mach-ks8695/time.c
@@ -25,53 +25,98 @@
25#include <linux/kernel.h> 25#include <linux/kernel.h>
26#include <linux/sched.h> 26#include <linux/sched.h>
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/clockchips.h>
28 29
29#include <asm/mach/time.h> 30#include <asm/mach/time.h>
30#include <asm/system_misc.h> 31#include <asm/system_misc.h>
31 32
32#include <mach/regs-timer.h>
33#include <mach/regs-irq.h> 33#include <mach/regs-irq.h>
34 34
35#include "generic.h" 35#include "generic.h"
36 36
37#define KS8695_TMR_OFFSET (0xF0000 + 0xE400)
38#define KS8695_TMR_VA (KS8695_IO_VA + KS8695_TMR_OFFSET)
39#define KS8695_TMR_PA (KS8695_IO_PA + KS8695_TMR_OFFSET)
40
37/* 41/*
38 * Returns number of ms since last clock interrupt. Note that interrupts 42 * Timer registers
39 * will have been disabled by do_gettimeoffset()
40 */ 43 */
41static unsigned long ks8695_gettimeoffset (void) 44#define KS8695_TMCON (0x00) /* Timer Control Register */
45#define KS8695_T1TC (0x04) /* Timer 1 Timeout Count Register */
46#define KS8695_T0TC (0x08) /* Timer 0 Timeout Count Register */
47#define KS8695_T1PD (0x0C) /* Timer 1 Pulse Count Register */
48#define KS8695_T0PD (0x10) /* Timer 0 Pulse Count Register */
49
50/* Timer Control Register */
51#define TMCON_T1EN (1 << 1) /* Timer 1 Enable */
52#define TMCON_T0EN (1 << 0) /* Timer 0 Enable */
53
54/* Timer0 Timeout Counter Register */
55#define T0TC_WATCHDOG (0xff) /* Enable watchdog mode */
56
57static void ks8695_set_mode(enum clock_event_mode mode,
58 struct clock_event_device *evt)
42{ 59{
43 unsigned long elapsed, tick2, intpending; 60 u32 tmcon;
44 61
45 /* 62 if (mode == CLOCK_EVT_FEAT_PERIODIC) {
46 * Get the current number of ticks. Note that there is a race 63 u32 rate = DIV_ROUND_CLOSEST(KS8695_CLOCK_RATE, HZ);
47 * condition between us reading the timer and checking for an 64 u32 half = DIV_ROUND_CLOSEST(rate, 2);
48 * interrupt. We solve this by ensuring that the counter has not 65
49 * reloaded between our two reads. 66 /* Disable timer 1 */
50 */ 67 tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
51 elapsed = __raw_readl(KS8695_TMR_VA + KS8695_T1TC) + __raw_readl(KS8695_TMR_VA + KS8695_T1PD); 68 tmcon &= ~TMCON_T1EN;
52 do { 69 writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
53 tick2 = elapsed; 70
54 intpending = __raw_readl(KS8695_IRQ_VA + KS8695_INTST) & (1 << KS8695_IRQ_TIMER1); 71 /* Both registers need to count down */
55 elapsed = __raw_readl(KS8695_TMR_VA + KS8695_T1TC) + __raw_readl(KS8695_TMR_VA + KS8695_T1PD); 72 writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC);
56 } while (elapsed > tick2); 73 writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD);
57 74
58 /* Convert to number of ticks expired (not remaining) */ 75 /* Re-enable timer1 */
59 elapsed = (CLOCK_TICK_RATE / HZ) - elapsed; 76 tmcon |= TMCON_T1EN;
60 77 writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
61 /* Is interrupt pending? If so, then timer has been reloaded already. */ 78 }
62 if (intpending)
63 elapsed += (CLOCK_TICK_RATE / HZ);
64
65 /* Convert ticks to usecs */
66 return (unsigned long)(elapsed * (tick_nsec / 1000)) / LATCH;
67} 79}
68 80
81static int ks8695_set_next_event(unsigned long cycles,
82 struct clock_event_device *evt)
83
84{
85 u32 half = DIV_ROUND_CLOSEST(cycles, 2);
86 u32 tmcon;
87
88 /* Disable timer 1 */
89 tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
90 tmcon &= ~TMCON_T1EN;
91 writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
92
93 /* Both registers need to count down */
94 writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC);
95 writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD);
96
97 /* Re-enable timer1 */
98 tmcon |= TMCON_T1EN;
99 writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
100
101 return 0;
102}
103
104static struct clock_event_device clockevent_ks8695 = {
105 .name = "ks8695_t1tc",
106 .rating = 300, /* Reasonably fast and accurate clock event */
107 .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
108 .set_next_event = ks8695_set_next_event,
109 .set_mode = ks8695_set_mode,
110};
111
69/* 112/*
70 * IRQ handler for the timer. 113 * IRQ handler for the timer.
71 */ 114 */
72static irqreturn_t ks8695_timer_interrupt(int irq, void *dev_id) 115static irqreturn_t ks8695_timer_interrupt(int irq, void *dev_id)
73{ 116{
74 timer_tick(); 117 struct clock_event_device *evt = &clockevent_ks8695;
118
119 evt->event_handler(evt);
75 return IRQ_HANDLED; 120 return IRQ_HANDLED;
76} 121}
77 122
@@ -83,18 +128,22 @@ static struct irqaction ks8695_timer_irq = {
83 128
84static void ks8695_timer_setup(void) 129static void ks8695_timer_setup(void)
85{ 130{
86 unsigned long tmout = CLOCK_TICK_RATE / HZ;
87 unsigned long tmcon; 131 unsigned long tmcon;
88 132
89 /* disable timer1 */ 133 /* Disable timer 0 and 1 */
90 tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON); 134 tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
91 __raw_writel(tmcon & ~TMCON_T1EN, KS8695_TMR_VA + KS8695_TMCON); 135 tmcon &= ~TMCON_T0EN;
92 136 tmcon &= ~TMCON_T1EN;
93 __raw_writel(tmout / 2, KS8695_TMR_VA + KS8695_T1TC); 137 writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
94 __raw_writel(tmout / 2, KS8695_TMR_VA + KS8695_T1PD);
95 138
96 /* re-enable timer1 */ 139 /*
97 __raw_writel(tmcon | TMCON_T1EN, KS8695_TMR_VA + KS8695_TMCON); 140 * Use timer 1 to fire IRQs on the timeline, minimum 2 cycles
141 * (one on each counter) maximum 2*2^32, but the API will only
142 * accept up to a 32bit full word (0xFFFFFFFFU).
143 */
144 clockevents_config_and_register(&clockevent_ks8695,
145 KS8695_CLOCK_RATE, 2,
146 0xFFFFFFFFU);
98} 147}
99 148
100static void __init ks8695_timer_init (void) 149static void __init ks8695_timer_init (void)
@@ -107,8 +156,6 @@ static void __init ks8695_timer_init (void)
107 156
108struct sys_timer ks8695_timer = { 157struct sys_timer ks8695_timer = {
109 .init = ks8695_timer_init, 158 .init = ks8695_timer_init,
110 .offset = ks8695_gettimeoffset,
111 .resume = ks8695_timer_setup,
112}; 159};
113 160
114void ks8695_restart(char mode, const char *cmd) 161void ks8695_restart(char mode, const char *cmd)
@@ -119,12 +166,12 @@ void ks8695_restart(char mode, const char *cmd)
119 soft_restart(0); 166 soft_restart(0);
120 167
121 /* disable timer0 */ 168 /* disable timer0 */
122 reg = __raw_readl(KS8695_TMR_VA + KS8695_TMCON); 169 reg = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
123 __raw_writel(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON); 170 writel_relaxed(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
124 171
125 /* enable watchdog mode */ 172 /* enable watchdog mode */
126 __raw_writel((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC); 173 writel_relaxed((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
127 174
128 /* re-enable timer0 */ 175 /* re-enable timer0 */
129 __raw_writel(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON); 176 writel_relaxed(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
130} 177}
diff --git a/arch/arm/mach-lpc32xx/Makefile.boot b/arch/arm/mach-lpc32xx/Makefile.boot
index 697323b5f92..d7392a47524 100644
--- a/arch/arm/mach-lpc32xx/Makefile.boot
+++ b/arch/arm/mach-lpc32xx/Makefile.boot
@@ -1,5 +1,3 @@
1 zreladdr-y += 0x80008000 1 zreladdr-y += 0x80008000
2params_phys-y := 0x80000100 2params_phys-y := 0x80000100
3initrd_phys-y := 0x82000000 3initrd_phys-y := 0x82000000
4
5dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c
index a48dc2dec48..0d4db8c544b 100644
--- a/arch/arm/mach-lpc32xx/common.c
+++ b/arch/arm/mach-lpc32xx/common.c
@@ -177,25 +177,25 @@ u32 clk_get_pclk_div(void)
177 177
178static struct map_desc lpc32xx_io_desc[] __initdata = { 178static struct map_desc lpc32xx_io_desc[] __initdata = {
179 { 179 {
180 .virtual = IO_ADDRESS(LPC32XX_AHB0_START), 180 .virtual = (unsigned long)IO_ADDRESS(LPC32XX_AHB0_START),
181 .pfn = __phys_to_pfn(LPC32XX_AHB0_START), 181 .pfn = __phys_to_pfn(LPC32XX_AHB0_START),
182 .length = LPC32XX_AHB0_SIZE, 182 .length = LPC32XX_AHB0_SIZE,
183 .type = MT_DEVICE 183 .type = MT_DEVICE
184 }, 184 },
185 { 185 {
186 .virtual = IO_ADDRESS(LPC32XX_AHB1_START), 186 .virtual = (unsigned long)IO_ADDRESS(LPC32XX_AHB1_START),
187 .pfn = __phys_to_pfn(LPC32XX_AHB1_START), 187 .pfn = __phys_to_pfn(LPC32XX_AHB1_START),
188 .length = LPC32XX_AHB1_SIZE, 188 .length = LPC32XX_AHB1_SIZE,
189 .type = MT_DEVICE 189 .type = MT_DEVICE
190 }, 190 },
191 { 191 {
192 .virtual = IO_ADDRESS(LPC32XX_FABAPB_START), 192 .virtual = (unsigned long)IO_ADDRESS(LPC32XX_FABAPB_START),
193 .pfn = __phys_to_pfn(LPC32XX_FABAPB_START), 193 .pfn = __phys_to_pfn(LPC32XX_FABAPB_START),
194 .length = LPC32XX_FABAPB_SIZE, 194 .length = LPC32XX_FABAPB_SIZE,
195 .type = MT_DEVICE 195 .type = MT_DEVICE
196 }, 196 },
197 { 197 {
198 .virtual = IO_ADDRESS(LPC32XX_IRAM_BASE), 198 .virtual = (unsigned long)IO_ADDRESS(LPC32XX_IRAM_BASE),
199 .pfn = __phys_to_pfn(LPC32XX_IRAM_BASE), 199 .pfn = __phys_to_pfn(LPC32XX_IRAM_BASE),
200 .length = (LPC32XX_IRAM_BANK_SIZE * 2), 200 .length = (LPC32XX_IRAM_BANK_SIZE * 2),
201 .type = MT_DEVICE 201 .type = MT_DEVICE
diff --git a/arch/arm/mach-lpc32xx/include/mach/gpio-lpc32xx.h b/arch/arm/mach-lpc32xx/include/mach/gpio-lpc32xx.h
index 1816e22a347..a544e962a81 100644
--- a/arch/arm/mach-lpc32xx/include/mach/gpio-lpc32xx.h
+++ b/arch/arm/mach-lpc32xx/include/mach/gpio-lpc32xx.h
@@ -30,7 +30,7 @@
30#define LPC32XX_GPIO_P1_MAX 24 30#define LPC32XX_GPIO_P1_MAX 24
31#define LPC32XX_GPIO_P2_MAX 13 31#define LPC32XX_GPIO_P2_MAX 13
32#define LPC32XX_GPIO_P3_MAX 6 32#define LPC32XX_GPIO_P3_MAX 6
33#define LPC32XX_GPI_P3_MAX 28 33#define LPC32XX_GPI_P3_MAX 29
34#define LPC32XX_GPO_P3_MAX 24 34#define LPC32XX_GPO_P3_MAX 24
35 35
36#define LPC32XX_GPIO_P0_GRP 0 36#define LPC32XX_GPIO_P0_GRP 0
diff --git a/arch/arm/mach-lpc32xx/include/mach/hardware.h b/arch/arm/mach-lpc32xx/include/mach/hardware.h
index 33e1dde37bd..69065de97a3 100644
--- a/arch/arm/mach-lpc32xx/include/mach/hardware.h
+++ b/arch/arm/mach-lpc32xx/include/mach/hardware.h
@@ -25,7 +25,7 @@
25/* 25/*
26 * This macro relies on fact that for all HW i/o addresses bits 20-23 are 0 26 * This macro relies on fact that for all HW i/o addresses bits 20-23 are 0
27 */ 27 */
28#define IO_ADDRESS(x) (((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) |\ 28#define IO_ADDRESS(x) IOMEM(((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) |\
29 IO_BASE) 29 IO_BASE)
30 30
31#define io_p2v(x) ((void __iomem *) (unsigned long) IO_ADDRESS(x)) 31#define io_p2v(x) ((void __iomem *) (unsigned long) IO_ADDRESS(x))
diff --git a/arch/arm/mach-lpc32xx/irq.c b/arch/arm/mach-lpc32xx/irq.c
index 5b1cc35e6fb..3c633275335 100644
--- a/arch/arm/mach-lpc32xx/irq.c
+++ b/arch/arm/mach-lpc32xx/irq.c
@@ -283,21 +283,25 @@ static int lpc32xx_set_irq_type(struct irq_data *d, unsigned int type)
283 case IRQ_TYPE_EDGE_RISING: 283 case IRQ_TYPE_EDGE_RISING:
284 /* Rising edge sensitive */ 284 /* Rising edge sensitive */
285 __lpc32xx_set_irq_type(d->hwirq, 1, 1); 285 __lpc32xx_set_irq_type(d->hwirq, 1, 1);
286 __irq_set_handler_locked(d->hwirq, handle_edge_irq);
286 break; 287 break;
287 288
288 case IRQ_TYPE_EDGE_FALLING: 289 case IRQ_TYPE_EDGE_FALLING:
289 /* Falling edge sensitive */ 290 /* Falling edge sensitive */
290 __lpc32xx_set_irq_type(d->hwirq, 0, 1); 291 __lpc32xx_set_irq_type(d->hwirq, 0, 1);
292 __irq_set_handler_locked(d->hwirq, handle_edge_irq);
291 break; 293 break;
292 294
293 case IRQ_TYPE_LEVEL_LOW: 295 case IRQ_TYPE_LEVEL_LOW:
294 /* Low level sensitive */ 296 /* Low level sensitive */
295 __lpc32xx_set_irq_type(d->hwirq, 0, 0); 297 __lpc32xx_set_irq_type(d->hwirq, 0, 0);
298 __irq_set_handler_locked(d->hwirq, handle_level_irq);
296 break; 299 break;
297 300
298 case IRQ_TYPE_LEVEL_HIGH: 301 case IRQ_TYPE_LEVEL_HIGH:
299 /* High level sensitive */ 302 /* High level sensitive */
300 __lpc32xx_set_irq_type(d->hwirq, 1, 0); 303 __lpc32xx_set_irq_type(d->hwirq, 1, 0);
304 __irq_set_handler_locked(d->hwirq, handle_level_irq);
301 break; 305 break;
302 306
303 /* Other modes are not supported */ 307 /* Other modes are not supported */
@@ -305,9 +309,6 @@ static int lpc32xx_set_irq_type(struct irq_data *d, unsigned int type)
305 return -EINVAL; 309 return -EINVAL;
306 } 310 }
307 311
308 /* Ok to use the level handler for all types */
309 irq_set_handler(d->hwirq, handle_level_irq);
310
311 return 0; 312 return 0;
312} 313}
313 314
diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index b07dcc90829..e8ff4c3f056 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -24,12 +24,9 @@
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <linux/dma-mapping.h> 25#include <linux/dma-mapping.h>
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/spi/spi.h>
28#include <linux/spi/eeprom.h>
29#include <linux/gpio.h> 27#include <linux/gpio.h>
30#include <linux/amba/bus.h> 28#include <linux/amba/bus.h>
31#include <linux/amba/clcd.h> 29#include <linux/amba/clcd.h>
32#include <linux/amba/pl022.h>
33#include <linux/amba/pl08x.h> 30#include <linux/amba/pl08x.h>
34#include <linux/amba/mmci.h> 31#include <linux/amba/mmci.h>
35#include <linux/of.h> 32#include <linux/of.h>
@@ -37,6 +34,8 @@
37#include <linux/of_irq.h> 34#include <linux/of_irq.h>
38#include <linux/of_platform.h> 35#include <linux/of_platform.h>
39#include <linux/clk.h> 36#include <linux/clk.h>
37#include <linux/mtd/lpc32xx_slc.h>
38#include <linux/mtd/lpc32xx_mlc.h>
40 39
41#include <asm/setup.h> 40#include <asm/setup.h>
42#include <asm/mach-types.h> 41#include <asm/mach-types.h>
@@ -156,21 +155,6 @@ static struct clcd_board lpc32xx_clcd_data = {
156 .remove = lpc32xx_clcd_remove, 155 .remove = lpc32xx_clcd_remove,
157}; 156};
158 157
159/*
160 * AMBA SSP (SPI)
161 */
162static struct pl022_ssp_controller lpc32xx_ssp0_data = {
163 .bus_id = 0,
164 .num_chipselect = 1,
165 .enable_dma = 0,
166};
167
168static struct pl022_ssp_controller lpc32xx_ssp1_data = {
169 .bus_id = 1,
170 .num_chipselect = 1,
171 .enable_dma = 0,
172};
173
174static struct pl08x_channel_data pl08x_slave_channels[] = { 158static struct pl08x_channel_data pl08x_slave_channels[] = {
175 { 159 {
176 .bus_id = "nand-slc", 160 .bus_id = "nand-slc",
@@ -223,13 +207,25 @@ static struct mmci_platform_data lpc32xx_mmci_data = {
223 * gather, and the MMCI driver doesn't do it this way */ 207 * gather, and the MMCI driver doesn't do it this way */
224}; 208};
225 209
210static struct lpc32xx_slc_platform_data lpc32xx_slc_data = {
211 .dma_filter = pl08x_filter_id,
212};
213
214static struct lpc32xx_mlc_platform_data lpc32xx_mlc_data = {
215 .dma_filter = pl08x_filter_id,
216};
217
226static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = { 218static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = {
227 OF_DEV_AUXDATA("arm,pl022", 0x20084000, "dev:ssp0", &lpc32xx_ssp0_data), 219 OF_DEV_AUXDATA("arm,pl022", 0x20084000, "dev:ssp0", NULL),
228 OF_DEV_AUXDATA("arm,pl022", 0x2008C000, "dev:ssp1", &lpc32xx_ssp1_data), 220 OF_DEV_AUXDATA("arm,pl022", 0x2008C000, "dev:ssp1", NULL),
229 OF_DEV_AUXDATA("arm,pl110", 0x31040000, "dev:clcd", &lpc32xx_clcd_data), 221 OF_DEV_AUXDATA("arm,pl110", 0x31040000, "dev:clcd", &lpc32xx_clcd_data),
230 OF_DEV_AUXDATA("arm,pl080", 0x31000000, "pl08xdmac", &pl08x_pd), 222 OF_DEV_AUXDATA("arm,pl080", 0x31000000, "pl08xdmac", &pl08x_pd),
231 OF_DEV_AUXDATA("arm,pl18x", 0x20098000, "20098000.sd", 223 OF_DEV_AUXDATA("arm,pl18x", 0x20098000, "20098000.sd",
232 &lpc32xx_mmci_data), 224 &lpc32xx_mmci_data),
225 OF_DEV_AUXDATA("nxp,lpc3220-slc", 0x20020000, "20020000.flash",
226 &lpc32xx_slc_data),
227 OF_DEV_AUXDATA("nxp,lpc3220-mlc", 0x200a8000, "200a8000.flash",
228 &lpc32xx_mlc_data),
233 { } 229 { }
234}; 230};
235 231
@@ -253,12 +249,6 @@ static void __init lpc3250_machine_init(void)
253 249
254 of_platform_populate(NULL, of_default_bus_match_table, 250 of_platform_populate(NULL, of_default_bus_match_table,
255 lpc32xx_auxdata_lookup, NULL); 251 lpc32xx_auxdata_lookup, NULL);
256
257 /* Register GPIOs used on this board */
258 if (gpio_request(MMC_PWR_ENABLE_GPIO, "mmc_power_en"))
259 pr_err("Error requesting gpio %u", MMC_PWR_ENABLE_GPIO);
260 else if (gpio_direction_output(MMC_PWR_ENABLE_GPIO, 1))
261 pr_err("Error setting gpio %u to output", MMC_PWR_ENABLE_GPIO);
262} 252}
263 253
264static char const *lpc32xx_dt_compat[] __initdata = { 254static char const *lpc32xx_dt_compat[] __initdata = {
diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig
index 7fddd01b85b..178d4daa5e1 100644
--- a/arch/arm/mach-mmp/Kconfig
+++ b/arch/arm/mach-mmp/Kconfig
@@ -107,18 +107,21 @@ endmenu
107 107
108config CPU_PXA168 108config CPU_PXA168
109 bool 109 bool
110 select COMMON_CLK
110 select CPU_MOHAWK 111 select CPU_MOHAWK
111 help 112 help
112 Select code specific to PXA168 113 Select code specific to PXA168
113 114
114config CPU_PXA910 115config CPU_PXA910
115 bool 116 bool
117 select COMMON_CLK
116 select CPU_MOHAWK 118 select CPU_MOHAWK
117 help 119 help
118 Select code specific to PXA910 120 Select code specific to PXA910
119 121
120config CPU_MMP2 122config CPU_MMP2
121 bool 123 bool
124 select COMMON_CLK
122 select CPU_PJ4 125 select CPU_PJ4
123 help 126 help
124 Select code specific to MMP2. MMP2 is ARMv7 compatible. 127 Select code specific to MMP2. MMP2 is ARMv7 compatible.
diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile
index b786f7e6cd1..095c155d6fb 100644
--- a/arch/arm/mach-mmp/Makefile
+++ b/arch/arm/mach-mmp/Makefile
@@ -2,13 +2,19 @@
2# Makefile for Marvell's PXA168 processors line 2# Makefile for Marvell's PXA168 processors line
3# 3#
4 4
5obj-y += common.o clock.o devices.o time.o irq.o 5obj-y += common.o devices.o time.o irq.o
6 6
7# SoC support 7# SoC support
8obj-$(CONFIG_CPU_PXA168) += pxa168.o 8obj-$(CONFIG_CPU_PXA168) += pxa168.o
9obj-$(CONFIG_CPU_PXA910) += pxa910.o 9obj-$(CONFIG_CPU_PXA910) += pxa910.o
10obj-$(CONFIG_CPU_MMP2) += mmp2.o sram.o 10obj-$(CONFIG_CPU_MMP2) += mmp2.o sram.o
11 11
12ifeq ($(CONFIG_COMMON_CLK), )
13obj-y += clock.o
14obj-$(CONFIG_CPU_PXA168) += clock-pxa168.o
15obj-$(CONFIG_CPU_PXA910) += clock-pxa910.o
16obj-$(CONFIG_CPU_MMP2) += clock-mmp2.o
17endif
12ifeq ($(CONFIG_PM),y) 18ifeq ($(CONFIG_PM),y)
13obj-$(CONFIG_CPU_PXA910) += pm-pxa910.o 19obj-$(CONFIG_CPU_PXA910) += pm-pxa910.o
14obj-$(CONFIG_CPU_MMP2) += pm-mmp2.o 20obj-$(CONFIG_CPU_MMP2) += pm-mmp2.o
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c
index 223090b1444..e5dba9c5dc5 100644
--- a/arch/arm/mach-mmp/aspenite.c
+++ b/arch/arm/mach-mmp/aspenite.c
@@ -27,7 +27,7 @@
27#include <mach/irqs.h> 27#include <mach/irqs.h>
28#include <video/pxa168fb.h> 28#include <video/pxa168fb.h>
29#include <linux/input.h> 29#include <linux/input.h>
30#include <plat/pxa27x_keypad.h> 30#include <linux/platform_data/keypad-pxa27x.h>
31 31
32#include "common.h" 32#include "common.h"
33 33
diff --git a/arch/arm/mach-mmp/clock-mmp2.c b/arch/arm/mach-mmp/clock-mmp2.c
new file mode 100644
index 00000000000..21d22002cd1
--- /dev/null
+++ b/arch/arm/mach-mmp/clock-mmp2.c
@@ -0,0 +1,111 @@
1#include <linux/module.h>
2#include <linux/kernel.h>
3#include <linux/init.h>
4#include <linux/list.h>
5#include <linux/io.h>
6#include <linux/clk.h>
7
8#include <mach/addr-map.h>
9
10#include "common.h"
11#include "clock.h"
12
13/*
14 * APB Clock register offsets for MMP2
15 */
16#define APBC_RTC APBC_REG(0x000)
17#define APBC_TWSI1 APBC_REG(0x004)
18#define APBC_TWSI2 APBC_REG(0x008)
19#define APBC_TWSI3 APBC_REG(0x00c)
20#define APBC_TWSI4 APBC_REG(0x010)
21#define APBC_KPC APBC_REG(0x018)
22#define APBC_UART1 APBC_REG(0x02c)
23#define APBC_UART2 APBC_REG(0x030)
24#define APBC_UART3 APBC_REG(0x034)
25#define APBC_GPIO APBC_REG(0x038)
26#define APBC_PWM0 APBC_REG(0x03c)
27#define APBC_PWM1 APBC_REG(0x040)
28#define APBC_PWM2 APBC_REG(0x044)
29#define APBC_PWM3 APBC_REG(0x048)
30#define APBC_SSP0 APBC_REG(0x04c)
31#define APBC_SSP1 APBC_REG(0x050)
32#define APBC_SSP2 APBC_REG(0x054)
33#define APBC_SSP3 APBC_REG(0x058)
34#define APBC_SSP4 APBC_REG(0x05c)
35#define APBC_SSP5 APBC_REG(0x060)
36#define APBC_TWSI5 APBC_REG(0x07c)
37#define APBC_TWSI6 APBC_REG(0x080)
38#define APBC_UART4 APBC_REG(0x088)
39
40#define APMU_USB APMU_REG(0x05c)
41#define APMU_NAND APMU_REG(0x060)
42#define APMU_SDH0 APMU_REG(0x054)
43#define APMU_SDH1 APMU_REG(0x058)
44#define APMU_SDH2 APMU_REG(0x0e8)
45#define APMU_SDH3 APMU_REG(0x0ec)
46
47static void sdhc_clk_enable(struct clk *clk)
48{
49 uint32_t clk_rst;
50
51 clk_rst = __raw_readl(clk->clk_rst);
52 clk_rst |= clk->enable_val;
53 __raw_writel(clk_rst, clk->clk_rst);
54}
55
56static void sdhc_clk_disable(struct clk *clk)
57{
58 uint32_t clk_rst;
59
60 clk_rst = __raw_readl(clk->clk_rst);
61 clk_rst &= ~clk->enable_val;
62 __raw_writel(clk_rst, clk->clk_rst);
63}
64
65struct clkops sdhc_clk_ops = {
66 .enable = sdhc_clk_enable,
67 .disable = sdhc_clk_disable,
68};
69
70/* APB peripheral clocks */
71static APBC_CLK(uart1, UART1, 1, 26000000);
72static APBC_CLK(uart2, UART2, 1, 26000000);
73static APBC_CLK(uart3, UART3, 1, 26000000);
74static APBC_CLK(uart4, UART4, 1, 26000000);
75static APBC_CLK(twsi1, TWSI1, 0, 26000000);
76static APBC_CLK(twsi2, TWSI2, 0, 26000000);
77static APBC_CLK(twsi3, TWSI3, 0, 26000000);
78static APBC_CLK(twsi4, TWSI4, 0, 26000000);
79static APBC_CLK(twsi5, TWSI5, 0, 26000000);
80static APBC_CLK(twsi6, TWSI6, 0, 26000000);
81static APBC_CLK(gpio, GPIO, 0, 26000000);
82
83static APMU_CLK(nand, NAND, 0xbf, 100000000);
84static APMU_CLK_OPS(sdh0, SDH0, 0x1b, 200000000, &sdhc_clk_ops);
85static APMU_CLK_OPS(sdh1, SDH1, 0x1b, 200000000, &sdhc_clk_ops);
86static APMU_CLK_OPS(sdh2, SDH2, 0x1b, 200000000, &sdhc_clk_ops);
87static APMU_CLK_OPS(sdh3, SDH3, 0x1b, 200000000, &sdhc_clk_ops);
88
89static struct clk_lookup mmp2_clkregs[] = {
90 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
91 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
92 INIT_CLKREG(&clk_uart3, "pxa2xx-uart.2", NULL),
93 INIT_CLKREG(&clk_uart4, "pxa2xx-uart.3", NULL),
94 INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.0", NULL),
95 INIT_CLKREG(&clk_twsi2, "pxa2xx-i2c.1", NULL),
96 INIT_CLKREG(&clk_twsi3, "pxa2xx-i2c.2", NULL),
97 INIT_CLKREG(&clk_twsi4, "pxa2xx-i2c.3", NULL),
98 INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL),
99 INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL),
100 INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
101 INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
102 INIT_CLKREG(&clk_sdh0, "sdhci-pxav3.0", "PXA-SDHCLK"),
103 INIT_CLKREG(&clk_sdh1, "sdhci-pxav3.1", "PXA-SDHCLK"),
104 INIT_CLKREG(&clk_sdh2, "sdhci-pxav3.2", "PXA-SDHCLK"),
105 INIT_CLKREG(&clk_sdh3, "sdhci-pxav3.3", "PXA-SDHCLK"),
106};
107
108void __init mmp2_clk_init(void)
109{
110 clkdev_add_table(ARRAY_AND_SIZE(mmp2_clkregs));
111}
diff --git a/arch/arm/mach-mmp/clock-pxa168.c b/arch/arm/mach-mmp/clock-pxa168.c
new file mode 100644
index 00000000000..5e6c18ccebd
--- /dev/null
+++ b/arch/arm/mach-mmp/clock-pxa168.c
@@ -0,0 +1,91 @@
1#include <linux/module.h>
2#include <linux/kernel.h>
3#include <linux/init.h>
4#include <linux/list.h>
5#include <linux/io.h>
6#include <linux/clk.h>
7
8#include <mach/addr-map.h>
9
10#include "common.h"
11#include "clock.h"
12
13/*
14 * APB clock register offsets for PXA168
15 */
16#define APBC_UART1 APBC_REG(0x000)
17#define APBC_UART2 APBC_REG(0x004)
18#define APBC_GPIO APBC_REG(0x008)
19#define APBC_PWM1 APBC_REG(0x00c)
20#define APBC_PWM2 APBC_REG(0x010)
21#define APBC_PWM3 APBC_REG(0x014)
22#define APBC_PWM4 APBC_REG(0x018)
23#define APBC_RTC APBC_REG(0x028)
24#define APBC_TWSI0 APBC_REG(0x02c)
25#define APBC_KPC APBC_REG(0x030)
26#define APBC_TWSI1 APBC_REG(0x06c)
27#define APBC_UART3 APBC_REG(0x070)
28#define APBC_SSP1 APBC_REG(0x81c)
29#define APBC_SSP2 APBC_REG(0x820)
30#define APBC_SSP3 APBC_REG(0x84c)
31#define APBC_SSP4 APBC_REG(0x858)
32#define APBC_SSP5 APBC_REG(0x85c)
33
34#define APMU_NAND APMU_REG(0x060)
35#define APMU_LCD APMU_REG(0x04c)
36#define APMU_ETH APMU_REG(0x0fc)
37#define APMU_USB APMU_REG(0x05c)
38
39/* APB peripheral clocks */
40static APBC_CLK(uart1, UART1, 1, 14745600);
41static APBC_CLK(uart2, UART2, 1, 14745600);
42static APBC_CLK(uart3, UART3, 1, 14745600);
43static APBC_CLK(twsi0, TWSI0, 1, 33000000);
44static APBC_CLK(twsi1, TWSI1, 1, 33000000);
45static APBC_CLK(pwm1, PWM1, 1, 13000000);
46static APBC_CLK(pwm2, PWM2, 1, 13000000);
47static APBC_CLK(pwm3, PWM3, 1, 13000000);
48static APBC_CLK(pwm4, PWM4, 1, 13000000);
49static APBC_CLK(ssp1, SSP1, 4, 0);
50static APBC_CLK(ssp2, SSP2, 4, 0);
51static APBC_CLK(ssp3, SSP3, 4, 0);
52static APBC_CLK(ssp4, SSP4, 4, 0);
53static APBC_CLK(ssp5, SSP5, 4, 0);
54static APBC_CLK(gpio, GPIO, 0, 13000000);
55static APBC_CLK(keypad, KPC, 0, 32000);
56static APBC_CLK(rtc, RTC, 8, 32768);
57
58static APMU_CLK(nand, NAND, 0x19b, 156000000);
59static APMU_CLK(lcd, LCD, 0x7f, 312000000);
60static APMU_CLK(eth, ETH, 0x09, 0);
61static APMU_CLK(usb, USB, 0x12, 0);
62
63/* device and clock bindings */
64static struct clk_lookup pxa168_clkregs[] = {
65 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
66 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
67 INIT_CLKREG(&clk_uart3, "pxa2xx-uart.2", NULL),
68 INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL),
69 INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL),
70 INIT_CLKREG(&clk_pwm1, "pxa168-pwm.0", NULL),
71 INIT_CLKREG(&clk_pwm2, "pxa168-pwm.1", NULL),
72 INIT_CLKREG(&clk_pwm3, "pxa168-pwm.2", NULL),
73 INIT_CLKREG(&clk_pwm4, "pxa168-pwm.3", NULL),
74 INIT_CLKREG(&clk_ssp1, "pxa168-ssp.0", NULL),
75 INIT_CLKREG(&clk_ssp2, "pxa168-ssp.1", NULL),
76 INIT_CLKREG(&clk_ssp3, "pxa168-ssp.2", NULL),
77 INIT_CLKREG(&clk_ssp4, "pxa168-ssp.3", NULL),
78 INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL),
79 INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
80 INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL),
81 INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
82 INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
83 INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"),
84 INIT_CLKREG(&clk_usb, NULL, "PXA168-USBCLK"),
85 INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL),
86};
87
88void __init pxa168_clk_init(void)
89{
90 clkdev_add_table(ARRAY_AND_SIZE(pxa168_clkregs));
91}
diff --git a/arch/arm/mach-mmp/clock-pxa910.c b/arch/arm/mach-mmp/clock-pxa910.c
new file mode 100644
index 00000000000..933ea71d0b5
--- /dev/null
+++ b/arch/arm/mach-mmp/clock-pxa910.c
@@ -0,0 +1,67 @@
1#include <linux/module.h>
2#include <linux/kernel.h>
3#include <linux/init.h>
4#include <linux/list.h>
5#include <linux/io.h>
6#include <linux/clk.h>
7
8#include <mach/addr-map.h>
9
10#include "common.h"
11#include "clock.h"
12
13/*
14 * APB Clock register offsets for PXA910
15 */
16#define APBC_UART0 APBC_REG(0x000)
17#define APBC_UART1 APBC_REG(0x004)
18#define APBC_GPIO APBC_REG(0x008)
19#define APBC_PWM1 APBC_REG(0x00c)
20#define APBC_PWM2 APBC_REG(0x010)
21#define APBC_PWM3 APBC_REG(0x014)
22#define APBC_PWM4 APBC_REG(0x018)
23#define APBC_SSP1 APBC_REG(0x01c)
24#define APBC_SSP2 APBC_REG(0x020)
25#define APBC_RTC APBC_REG(0x028)
26#define APBC_TWSI0 APBC_REG(0x02c)
27#define APBC_KPC APBC_REG(0x030)
28#define APBC_SSP3 APBC_REG(0x04c)
29#define APBC_TWSI1 APBC_REG(0x06c)
30
31#define APMU_NAND APMU_REG(0x060)
32#define APMU_USB APMU_REG(0x05c)
33
34static APBC_CLK(uart1, UART0, 1, 14745600);
35static APBC_CLK(uart2, UART1, 1, 14745600);
36static APBC_CLK(twsi0, TWSI0, 1, 33000000);
37static APBC_CLK(twsi1, TWSI1, 1, 33000000);
38static APBC_CLK(pwm1, PWM1, 1, 13000000);
39static APBC_CLK(pwm2, PWM2, 1, 13000000);
40static APBC_CLK(pwm3, PWM3, 1, 13000000);
41static APBC_CLK(pwm4, PWM4, 1, 13000000);
42static APBC_CLK(gpio, GPIO, 0, 13000000);
43static APBC_CLK(rtc, RTC, 8, 32768);
44
45static APMU_CLK(nand, NAND, 0x19b, 156000000);
46static APMU_CLK(u2o, USB, 0x1b, 480000000);
47
48/* device and clock bindings */
49static struct clk_lookup pxa910_clkregs[] = {
50 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
51 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
52 INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL),
53 INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL),
54 INIT_CLKREG(&clk_pwm1, "pxa910-pwm.0", NULL),
55 INIT_CLKREG(&clk_pwm2, "pxa910-pwm.1", NULL),
56 INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL),
57 INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL),
58 INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
59 INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
60 INIT_CLKREG(&clk_u2o, NULL, "U2OCLK"),
61 INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL),
62};
63
64void __init pxa910_clk_init(void)
65{
66 clkdev_add_table(ARRAY_AND_SIZE(pxa910_clkregs));
67}
diff --git a/arch/arm/mach-mmp/common.h b/arch/arm/mach-mmp/common.h
index 1c9d6c1ea97..bd453274fca 100644
--- a/arch/arm/mach-mmp/common.h
+++ b/arch/arm/mach-mmp/common.h
@@ -7,3 +7,6 @@ extern void timer_init(int irq);
7extern void __init icu_init_irq(void); 7extern void __init icu_init_irq(void);
8extern void __init mmp_map_io(void); 8extern void __init mmp_map_io(void);
9extern void mmp_restart(char, const char *); 9extern void mmp_restart(char, const char *);
10extern void __init pxa168_clk_init(void);
11extern void __init pxa910_clk_init(void);
12extern void __init mmp2_clk_init(void);
diff --git a/arch/arm/mach-mmp/include/mach/debug-macro.S b/arch/arm/mach-mmp/include/mach/debug-macro.S
index b6f14d203c2..5c3cc29688a 100644
--- a/arch/arm/mach-mmp/include/mach/debug-macro.S
+++ b/arch/arm/mach-mmp/include/mach/debug-macro.S
@@ -9,13 +9,21 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#if defined(CONFIG_DEBUG_MMP_UART2)
13#define MMP_UART_OFFSET 0x00017000
14#elif defined(CONFIG_DEBUG_MMP_UART3)
15#define MMP_UART_OFFSET 0x00018000
16#else
17#error "Select uart for DEBUG_LL"
18#endif
19
12#include <mach/addr-map.h> 20#include <mach/addr-map.h>
13 21
14 .macro addruart, rp, rv, tmp 22 .macro addruart, rp, rv, tmp
15 ldr \rp, =APB_PHYS_BASE @ physical 23 ldr \rp, =APB_PHYS_BASE @ physical
16 ldr \rv, =APB_VIRT_BASE @ virtual 24 ldr \rv, =APB_VIRT_BASE @ virtual
17 orr \rp, \rp, #0x00017000 25 orr \rp, \rp, #MMP_UART_OFFSET
18 orr \rv, \rv, #0x00017000 26 orr \rv, \rv, #MMP_UART_OFFSET
19 .endm 27 .endm
20 28
21#define UART_SHIFT 2 29#define UART_SHIFT 2
diff --git a/arch/arm/mach-mmp/include/mach/mmp2.h b/arch/arm/mach-mmp/include/mach/mmp2.h
index cba22fed226..c4ca4d17194 100644
--- a/arch/arm/mach-mmp/include/mach/mmp2.h
+++ b/arch/arm/mach-mmp/include/mach/mmp2.h
@@ -13,7 +13,7 @@ extern void mmp2_clear_pmic_int(void);
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/i2c/pxa-i2c.h> 14#include <linux/i2c/pxa-i2c.h>
15#include <mach/devices.h> 15#include <mach/devices.h>
16#include <mach/sram.h> 16#include <linux/platform_data/dma-mmp_tdma.h>
17 17
18extern struct pxa_device_desc mmp2_device_uart1; 18extern struct pxa_device_desc mmp2_device_uart1;
19extern struct pxa_device_desc mmp2_device_uart2; 19extern struct pxa_device_desc mmp2_device_uart2;
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h
index 09dcd6e2b6a..37632d964d5 100644
--- a/arch/arm/mach-mmp/include/mach/pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/pxa168.h
@@ -11,9 +11,9 @@ extern void pxa168_clear_keypad_wakeup(void);
11#include <linux/i2c.h> 11#include <linux/i2c.h>
12#include <linux/i2c/pxa-i2c.h> 12#include <linux/i2c/pxa-i2c.h>
13#include <mach/devices.h> 13#include <mach/devices.h>
14#include <plat/pxa3xx_nand.h> 14#include <linux/platform_data/mtd-nand-pxa3xx.h>
15#include <video/pxa168fb.h> 15#include <video/pxa168fb.h>
16#include <plat/pxa27x_keypad.h> 16#include <linux/platform_data/keypad-pxa27x.h>
17#include <mach/cputype.h> 17#include <mach/cputype.h>
18#include <linux/pxa168_eth.h> 18#include <linux/pxa168_eth.h>
19#include <linux/platform_data/mv_usb.h> 19#include <linux/platform_data/mv_usb.h>
diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h
index 793634c837e..3b58a3b2d7d 100644
--- a/arch/arm/mach-mmp/include/mach/pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/pxa910.h
@@ -9,7 +9,7 @@ extern void __init pxa910_init_irq(void);
9#include <linux/i2c.h> 9#include <linux/i2c.h>
10#include <linux/i2c/pxa-i2c.h> 10#include <linux/i2c/pxa-i2c.h>
11#include <mach/devices.h> 11#include <mach/devices.h>
12#include <plat/pxa3xx_nand.h> 12#include <linux/platform_data/mtd-nand-pxa3xx.h>
13 13
14extern struct pxa_device_desc pxa910_device_uart1; 14extern struct pxa_device_desc pxa910_device_uart1;
15extern struct pxa_device_desc pxa910_device_uart2; 15extern struct pxa_device_desc pxa910_device_uart2;
diff --git a/arch/arm/mach-mmp/include/mach/regs-apbc.h b/arch/arm/mach-mmp/include/mach/regs-apbc.h
index 68b0c93ec6a..ddc812f4034 100644
--- a/arch/arm/mach-mmp/include/mach/regs-apbc.h
+++ b/arch/arm/mach-mmp/include/mach/regs-apbc.h
@@ -13,101 +13,6 @@
13 13
14#include <mach/addr-map.h> 14#include <mach/addr-map.h>
15 15
16/*
17 * APB clock register offsets for PXA168
18 */
19#define APBC_PXA168_UART1 APBC_REG(0x000)
20#define APBC_PXA168_UART2 APBC_REG(0x004)
21#define APBC_PXA168_GPIO APBC_REG(0x008)
22#define APBC_PXA168_PWM1 APBC_REG(0x00c)
23#define APBC_PXA168_PWM2 APBC_REG(0x010)
24#define APBC_PXA168_PWM3 APBC_REG(0x014)
25#define APBC_PXA168_PWM4 APBC_REG(0x018)
26#define APBC_PXA168_RTC APBC_REG(0x028)
27#define APBC_PXA168_TWSI0 APBC_REG(0x02c)
28#define APBC_PXA168_KPC APBC_REG(0x030)
29#define APBC_PXA168_TIMERS APBC_REG(0x034)
30#define APBC_PXA168_AIB APBC_REG(0x03c)
31#define APBC_PXA168_SW_JTAG APBC_REG(0x040)
32#define APBC_PXA168_ONEWIRE APBC_REG(0x048)
33#define APBC_PXA168_ASFAR APBC_REG(0x050)
34#define APBC_PXA168_ASSAR APBC_REG(0x054)
35#define APBC_PXA168_TWSI1 APBC_REG(0x06c)
36#define APBC_PXA168_UART3 APBC_REG(0x070)
37#define APBC_PXA168_AC97 APBC_REG(0x084)
38#define APBC_PXA168_SSP1 APBC_REG(0x81c)
39#define APBC_PXA168_SSP2 APBC_REG(0x820)
40#define APBC_PXA168_SSP3 APBC_REG(0x84c)
41#define APBC_PXA168_SSP4 APBC_REG(0x858)
42#define APBC_PXA168_SSP5 APBC_REG(0x85c)
43
44/*
45 * APB Clock register offsets for PXA910
46 */
47#define APBC_PXA910_UART0 APBC_REG(0x000)
48#define APBC_PXA910_UART1 APBC_REG(0x004)
49#define APBC_PXA910_GPIO APBC_REG(0x008)
50#define APBC_PXA910_PWM1 APBC_REG(0x00c)
51#define APBC_PXA910_PWM2 APBC_REG(0x010)
52#define APBC_PXA910_PWM3 APBC_REG(0x014)
53#define APBC_PXA910_PWM4 APBC_REG(0x018)
54#define APBC_PXA910_SSP1 APBC_REG(0x01c)
55#define APBC_PXA910_SSP2 APBC_REG(0x020)
56#define APBC_PXA910_IPC APBC_REG(0x024)
57#define APBC_PXA910_RTC APBC_REG(0x028)
58#define APBC_PXA910_TWSI0 APBC_REG(0x02c)
59#define APBC_PXA910_KPC APBC_REG(0x030)
60#define APBC_PXA910_TIMERS APBC_REG(0x034)
61#define APBC_PXA910_TBROT APBC_REG(0x038)
62#define APBC_PXA910_AIB APBC_REG(0x03c)
63#define APBC_PXA910_SW_JTAG APBC_REG(0x040)
64#define APBC_PXA910_TIMERS1 APBC_REG(0x044)
65#define APBC_PXA910_ONEWIRE APBC_REG(0x048)
66#define APBC_PXA910_SSP3 APBC_REG(0x04c)
67#define APBC_PXA910_ASFAR APBC_REG(0x050)
68#define APBC_PXA910_ASSAR APBC_REG(0x054)
69
70/*
71 * APB Clock register offsets for MMP2
72 */
73#define APBC_MMP2_RTC APBC_REG(0x000)
74#define APBC_MMP2_TWSI1 APBC_REG(0x004)
75#define APBC_MMP2_TWSI2 APBC_REG(0x008)
76#define APBC_MMP2_TWSI3 APBC_REG(0x00c)
77#define APBC_MMP2_TWSI4 APBC_REG(0x010)
78#define APBC_MMP2_ONEWIRE APBC_REG(0x014)
79#define APBC_MMP2_KPC APBC_REG(0x018)
80#define APBC_MMP2_TB_ROTARY APBC_REG(0x01c)
81#define APBC_MMP2_SW_JTAG APBC_REG(0x020)
82#define APBC_MMP2_TIMERS APBC_REG(0x024)
83#define APBC_MMP2_UART1 APBC_REG(0x02c)
84#define APBC_MMP2_UART2 APBC_REG(0x030)
85#define APBC_MMP2_UART3 APBC_REG(0x034)
86#define APBC_MMP2_GPIO APBC_REG(0x038)
87#define APBC_MMP2_PWM0 APBC_REG(0x03c)
88#define APBC_MMP2_PWM1 APBC_REG(0x040)
89#define APBC_MMP2_PWM2 APBC_REG(0x044)
90#define APBC_MMP2_PWM3 APBC_REG(0x048)
91#define APBC_MMP2_SSP0 APBC_REG(0x04c)
92#define APBC_MMP2_SSP1 APBC_REG(0x050)
93#define APBC_MMP2_SSP2 APBC_REG(0x054)
94#define APBC_MMP2_SSP3 APBC_REG(0x058)
95#define APBC_MMP2_SSP4 APBC_REG(0x05c)
96#define APBC_MMP2_SSP5 APBC_REG(0x060)
97#define APBC_MMP2_AIB APBC_REG(0x064)
98#define APBC_MMP2_ASFAR APBC_REG(0x068)
99#define APBC_MMP2_ASSAR APBC_REG(0x06c)
100#define APBC_MMP2_USIM APBC_REG(0x070)
101#define APBC_MMP2_MPMU APBC_REG(0x074)
102#define APBC_MMP2_IPC APBC_REG(0x078)
103#define APBC_MMP2_TWSI5 APBC_REG(0x07c)
104#define APBC_MMP2_TWSI6 APBC_REG(0x080)
105#define APBC_MMP2_TWSI_INTSTS APBC_REG(0x084)
106#define APBC_MMP2_UART4 APBC_REG(0x088)
107#define APBC_MMP2_RIPC APBC_REG(0x08c)
108#define APBC_MMP2_THSENS1 APBC_REG(0x090) /* Thermal Sensor */
109#define APBC_MMP2_THSENS_INTSTS APBC_REG(0x0a4)
110
111/* Common APB clock register bit definitions */ 16/* Common APB clock register bit definitions */
112#define APBC_APBCLK (1 << 0) /* APB Bus Clock Enable */ 17#define APBC_APBCLK (1 << 0) /* APB Bus Clock Enable */
113#define APBC_FNCLK (1 << 1) /* Functional Clock Enable */ 18#define APBC_FNCLK (1 << 1) /* Functional Clock Enable */
diff --git a/arch/arm/mach-mmp/include/mach/regs-apmu.h b/arch/arm/mach-mmp/include/mach/regs-apmu.h
index 7af8deb63e8..93c8d0e29bb 100644
--- a/arch/arm/mach-mmp/include/mach/regs-apmu.h
+++ b/arch/arm/mach-mmp/include/mach/regs-apmu.h
@@ -13,21 +13,6 @@
13 13
14#include <mach/addr-map.h> 14#include <mach/addr-map.h>
15 15
16/* Clock Reset Control */
17#define APMU_IRE APMU_REG(0x048)
18#define APMU_LCD APMU_REG(0x04c)
19#define APMU_CCIC APMU_REG(0x050)
20#define APMU_SDH0 APMU_REG(0x054)
21#define APMU_SDH1 APMU_REG(0x058)
22#define APMU_USB APMU_REG(0x05c)
23#define APMU_NAND APMU_REG(0x060)
24#define APMU_DMA APMU_REG(0x064)
25#define APMU_GEU APMU_REG(0x068)
26#define APMU_BUS APMU_REG(0x06c)
27#define APMU_SDH2 APMU_REG(0x0e8)
28#define APMU_SDH3 APMU_REG(0x0ec)
29#define APMU_ETH APMU_REG(0x0fc)
30
31#define APMU_FNCLK_EN (1 << 4) 16#define APMU_FNCLK_EN (1 << 4)
32#define APMU_AXICLK_EN (1 << 3) 17#define APMU_AXICLK_EN (1 << 3)
33#define APMU_FNRST_DIS (1 << 1) 18#define APMU_FNRST_DIS (1 << 1)
diff --git a/arch/arm/mach-mmp/include/mach/sram.h b/arch/arm/mach-mmp/include/mach/sram.h
deleted file mode 100644
index 239e0fc1bb1..00000000000
--- a/arch/arm/mach-mmp/include/mach/sram.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/sram.h
3 *
4 * SRAM Memory Management
5 *
6 * Copyright (c) 2011 Marvell Semiconductors Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#ifndef __ASM_ARCH_SRAM_H
15#define __ASM_ARCH_SRAM_H
16
17#include <linux/genalloc.h>
18
19/* ARBITRARY: SRAM allocations are multiples of this 2^N size */
20#define SRAM_GRANULARITY 512
21
22enum sram_type {
23 MMP_SRAM_UNDEFINED = 0,
24 MMP_ASRAM,
25 MMP_ISRAM,
26};
27
28struct sram_platdata {
29 char *pool_name;
30 int granularity;
31};
32
33extern struct gen_pool *sram_get_gpool(char *pool_name);
34
35#endif /* __ASM_ARCH_SRAM_H */
diff --git a/arch/arm/mach-mmp/irq.c b/arch/arm/mach-mmp/irq.c
index e60c7d98922..3c71246cd99 100644
--- a/arch/arm/mach-mmp/irq.c
+++ b/arch/arm/mach-mmp/irq.c
@@ -153,10 +153,8 @@ static void icu_mux_irq_demux(unsigned int irq, struct irq_desc *desc)
153 status = readl_relaxed(data->reg_status) & ~mask; 153 status = readl_relaxed(data->reg_status) & ~mask;
154 if (status == 0) 154 if (status == 0)
155 break; 155 break;
156 n = find_first_bit(&status, BITS_PER_LONG); 156 for_each_set_bit(n, &status, BITS_PER_LONG) {
157 while (n < BITS_PER_LONG) {
158 generic_handle_irq(icu_data[i].virq_base + n); 157 generic_handle_irq(icu_data[i].virq_base + n);
159 n = find_next_bit(&status, BITS_PER_LONG, n + 1);
160 } 158 }
161 } 159 }
162} 160}
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c
index c709a24a9d2..3a3768c7a19 100644
--- a/arch/arm/mach-mmp/mmp2.c
+++ b/arch/arm/mach-mmp/mmp2.c
@@ -20,7 +20,6 @@
20#include <asm/mach/time.h> 20#include <asm/mach/time.h>
21#include <mach/addr-map.h> 21#include <mach/addr-map.h>
22#include <mach/regs-apbc.h> 22#include <mach/regs-apbc.h>
23#include <mach/regs-apmu.h>
24#include <mach/cputype.h> 23#include <mach/cputype.h>
25#include <mach/irqs.h> 24#include <mach/irqs.h>
26#include <mach/dma.h> 25#include <mach/dma.h>
@@ -29,7 +28,6 @@
29#include <mach/mmp2.h> 28#include <mach/mmp2.h>
30 29
31#include "common.h" 30#include "common.h"
32#include "clock.h"
33 31
34#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000) 32#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000)
35 33
@@ -98,95 +96,36 @@ void __init mmp2_init_irq(void)
98 mmp2_init_icu(); 96 mmp2_init_icu();
99} 97}
100 98
101static void sdhc_clk_enable(struct clk *clk)
102{
103 uint32_t clk_rst;
104
105 clk_rst = __raw_readl(clk->clk_rst);
106 clk_rst |= clk->enable_val;
107 __raw_writel(clk_rst, clk->clk_rst);
108}
109
110static void sdhc_clk_disable(struct clk *clk)
111{
112 uint32_t clk_rst;
113
114 clk_rst = __raw_readl(clk->clk_rst);
115 clk_rst &= ~clk->enable_val;
116 __raw_writel(clk_rst, clk->clk_rst);
117}
118
119struct clkops sdhc_clk_ops = {
120 .enable = sdhc_clk_enable,
121 .disable = sdhc_clk_disable,
122};
123
124/* APB peripheral clocks */
125static APBC_CLK(uart1, MMP2_UART1, 1, 26000000);
126static APBC_CLK(uart2, MMP2_UART2, 1, 26000000);
127static APBC_CLK(uart3, MMP2_UART3, 1, 26000000);
128static APBC_CLK(uart4, MMP2_UART4, 1, 26000000);
129static APBC_CLK(twsi1, MMP2_TWSI1, 0, 26000000);
130static APBC_CLK(twsi2, MMP2_TWSI2, 0, 26000000);
131static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000);
132static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000);
133static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000);
134static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000);
135static APBC_CLK(gpio, MMP2_GPIO, 0, 26000000);
136
137static APMU_CLK(nand, NAND, 0xbf, 100000000);
138static APMU_CLK_OPS(sdh0, SDH0, 0x1b, 200000000, &sdhc_clk_ops);
139static APMU_CLK_OPS(sdh1, SDH1, 0x1b, 200000000, &sdhc_clk_ops);
140static APMU_CLK_OPS(sdh2, SDH2, 0x1b, 200000000, &sdhc_clk_ops);
141static APMU_CLK_OPS(sdh3, SDH3, 0x1b, 200000000, &sdhc_clk_ops);
142
143static struct clk_lookup mmp2_clkregs[] = {
144 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
145 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
146 INIT_CLKREG(&clk_uart3, "pxa2xx-uart.2", NULL),
147 INIT_CLKREG(&clk_uart4, "pxa2xx-uart.3", NULL),
148 INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.0", NULL),
149 INIT_CLKREG(&clk_twsi2, "pxa2xx-i2c.1", NULL),
150 INIT_CLKREG(&clk_twsi3, "pxa2xx-i2c.2", NULL),
151 INIT_CLKREG(&clk_twsi4, "pxa2xx-i2c.3", NULL),
152 INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL),
153 INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL),
154 INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
155 INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
156 INIT_CLKREG(&clk_sdh0, "sdhci-pxav3.0", "PXA-SDHCLK"),
157 INIT_CLKREG(&clk_sdh1, "sdhci-pxav3.1", "PXA-SDHCLK"),
158 INIT_CLKREG(&clk_sdh2, "sdhci-pxav3.2", "PXA-SDHCLK"),
159 INIT_CLKREG(&clk_sdh3, "sdhci-pxav3.3", "PXA-SDHCLK"),
160};
161
162static int __init mmp2_init(void) 99static int __init mmp2_init(void)
163{ 100{
164 if (cpu_is_mmp2()) { 101 if (cpu_is_mmp2()) {
165#ifdef CONFIG_CACHE_TAUROS2 102#ifdef CONFIG_CACHE_TAUROS2
166 tauros2_init(); 103 tauros2_init(0);
167#endif 104#endif
168 mfp_init_base(MFPR_VIRT_BASE); 105 mfp_init_base(MFPR_VIRT_BASE);
169 mfp_init_addr(mmp2_addr_map); 106 mfp_init_addr(mmp2_addr_map);
170 pxa_init_dma(IRQ_MMP2_DMA_RIQ, 16); 107 pxa_init_dma(IRQ_MMP2_DMA_RIQ, 16);
171 clkdev_add_table(ARRAY_AND_SIZE(mmp2_clkregs)); 108 mmp2_clk_init();
172 } 109 }
173 110
174 return 0; 111 return 0;
175} 112}
176postcore_initcall(mmp2_init); 113postcore_initcall(mmp2_init);
177 114
115#define APBC_TIMERS APBC_REG(0x024)
116
178static void __init mmp2_timer_init(void) 117static void __init mmp2_timer_init(void)
179{ 118{
180 unsigned long clk_rst; 119 unsigned long clk_rst;
181 120
182 __raw_writel(APBC_APBCLK | APBC_RST, APBC_MMP2_TIMERS); 121 __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS);
183 122
184 /* 123 /*
185 * enable bus/functional clock, enable 6.5MHz (divider 4), 124 * enable bus/functional clock, enable 6.5MHz (divider 4),
186 * release reset 125 * release reset
187 */ 126 */
188 clk_rst = APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1); 127 clk_rst = APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1);
189 __raw_writel(clk_rst, APBC_MMP2_TIMERS); 128 __raw_writel(clk_rst, APBC_TIMERS);
190 129
191 timer_init(IRQ_MMP2_TIMER1); 130 timer_init(IRQ_MMP2_TIMER1);
192} 131}
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index 62d787c3447..b7f074f1549 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -18,8 +18,8 @@
18 18
19#include <asm/mach/time.h> 19#include <asm/mach/time.h>
20#include <asm/system_misc.h> 20#include <asm/system_misc.h>
21#include <mach/addr-map.h>
22#include <mach/cputype.h> 21#include <mach/cputype.h>
22#include <mach/addr-map.h>
23#include <mach/regs-apbc.h> 23#include <mach/regs-apbc.h>
24#include <mach/regs-apmu.h> 24#include <mach/regs-apmu.h>
25#include <mach/irqs.h> 25#include <mach/irqs.h>
@@ -50,62 +50,13 @@ void __init pxa168_init_irq(void)
50 icu_init_irq(); 50 icu_init_irq();
51} 51}
52 52
53/* APB peripheral clocks */
54static APBC_CLK(uart1, PXA168_UART1, 1, 14745600);
55static APBC_CLK(uart2, PXA168_UART2, 1, 14745600);
56static APBC_CLK(uart3, PXA168_UART3, 1, 14745600);
57static APBC_CLK(twsi0, PXA168_TWSI0, 1, 33000000);
58static APBC_CLK(twsi1, PXA168_TWSI1, 1, 33000000);
59static APBC_CLK(pwm1, PXA168_PWM1, 1, 13000000);
60static APBC_CLK(pwm2, PXA168_PWM2, 1, 13000000);
61static APBC_CLK(pwm3, PXA168_PWM3, 1, 13000000);
62static APBC_CLK(pwm4, PXA168_PWM4, 1, 13000000);
63static APBC_CLK(ssp1, PXA168_SSP1, 4, 0);
64static APBC_CLK(ssp2, PXA168_SSP2, 4, 0);
65static APBC_CLK(ssp3, PXA168_SSP3, 4, 0);
66static APBC_CLK(ssp4, PXA168_SSP4, 4, 0);
67static APBC_CLK(ssp5, PXA168_SSP5, 4, 0);
68static APBC_CLK(gpio, PXA168_GPIO, 0, 13000000);
69static APBC_CLK(keypad, PXA168_KPC, 0, 32000);
70static APBC_CLK(rtc, PXA168_RTC, 8, 32768);
71
72static APMU_CLK(nand, NAND, 0x19b, 156000000);
73static APMU_CLK(lcd, LCD, 0x7f, 312000000);
74static APMU_CLK(eth, ETH, 0x09, 0);
75static APMU_CLK(usb, USB, 0x12, 0);
76
77/* device and clock bindings */
78static struct clk_lookup pxa168_clkregs[] = {
79 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
80 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
81 INIT_CLKREG(&clk_uart3, "pxa2xx-uart.2", NULL),
82 INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL),
83 INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL),
84 INIT_CLKREG(&clk_pwm1, "pxa168-pwm.0", NULL),
85 INIT_CLKREG(&clk_pwm2, "pxa168-pwm.1", NULL),
86 INIT_CLKREG(&clk_pwm3, "pxa168-pwm.2", NULL),
87 INIT_CLKREG(&clk_pwm4, "pxa168-pwm.3", NULL),
88 INIT_CLKREG(&clk_ssp1, "pxa168-ssp.0", NULL),
89 INIT_CLKREG(&clk_ssp2, "pxa168-ssp.1", NULL),
90 INIT_CLKREG(&clk_ssp3, "pxa168-ssp.2", NULL),
91 INIT_CLKREG(&clk_ssp4, "pxa168-ssp.3", NULL),
92 INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL),
93 INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
94 INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL),
95 INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
96 INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
97 INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"),
98 INIT_CLKREG(&clk_usb, NULL, "PXA168-USBCLK"),
99 INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL),
100};
101
102static int __init pxa168_init(void) 53static int __init pxa168_init(void)
103{ 54{
104 if (cpu_is_pxa168()) { 55 if (cpu_is_pxa168()) {
105 mfp_init_base(MFPR_VIRT_BASE); 56 mfp_init_base(MFPR_VIRT_BASE);
106 mfp_init_addr(pxa168_mfp_addr_map); 57 mfp_init_addr(pxa168_mfp_addr_map);
107 pxa_init_dma(IRQ_PXA168_DMA_INT0, 32); 58 pxa_init_dma(IRQ_PXA168_DMA_INT0, 32);
108 clkdev_add_table(ARRAY_AND_SIZE(pxa168_clkregs)); 59 pxa168_clk_init();
109 } 60 }
110 61
111 return 0; 62 return 0;
@@ -114,6 +65,7 @@ postcore_initcall(pxa168_init);
114 65
115/* system timer - clock enabled, 3.25MHz */ 66/* system timer - clock enabled, 3.25MHz */
116#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)
117 69
118static void __init pxa168_timer_init(void) 70static void __init pxa168_timer_init(void)
119{ 71{
@@ -121,10 +73,10 @@ static void __init pxa168_timer_init(void)
121 * ourselves instead of using clk_* API. Clock rate is defined 73 * ourselves instead of using clk_* API. Clock rate is defined
122 * by APBC_TIMERS_CLK_RST (3.25MHz) and enabled free-running 74 * by APBC_TIMERS_CLK_RST (3.25MHz) and enabled free-running
123 */ 75 */
124 __raw_writel(APBC_APBCLK | APBC_RST, APBC_PXA168_TIMERS); 76 __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS);
125 77
126 /* 3.25MHz, bus/functional clock enabled, release reset */ 78 /* 3.25MHz, bus/functional clock enabled, release reset */
127 __raw_writel(TIMER_CLK_RST, APBC_PXA168_TIMERS); 79 __raw_writel(TIMER_CLK_RST, APBC_TIMERS);
128 80
129 timer_init(IRQ_PXA168_TIMER1); 81 timer_init(IRQ_PXA168_TIMER1);
130} 82}
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c
index 6da52e9f2bd..8b1e16fbb7a 100644
--- a/arch/arm/mach-mmp/pxa910.c
+++ b/arch/arm/mach-mmp/pxa910.c
@@ -14,10 +14,10 @@
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16 16
17#include <asm/hardware/cache-tauros2.h>
17#include <asm/mach/time.h> 18#include <asm/mach/time.h>
18#include <mach/addr-map.h> 19#include <mach/addr-map.h>
19#include <mach/regs-apbc.h> 20#include <mach/regs-apbc.h>
20#include <mach/regs-apmu.h>
21#include <mach/cputype.h> 21#include <mach/cputype.h>
22#include <mach/irqs.h> 22#include <mach/irqs.h>
23#include <mach/dma.h> 23#include <mach/dma.h>
@@ -25,7 +25,6 @@
25#include <mach/devices.h> 25#include <mach/devices.h>
26 26
27#include "common.h" 27#include "common.h"
28#include "clock.h"
29 28
30#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000) 29#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000)
31 30
@@ -82,44 +81,16 @@ void __init pxa910_init_irq(void)
82 icu_init_irq(); 81 icu_init_irq();
83} 82}
84 83
85/* APB peripheral clocks */
86static APBC_CLK(uart1, PXA910_UART0, 1, 14745600);
87static APBC_CLK(uart2, PXA910_UART1, 1, 14745600);
88static APBC_CLK(twsi0, PXA168_TWSI0, 1, 33000000);
89static APBC_CLK(twsi1, PXA168_TWSI1, 1, 33000000);
90static APBC_CLK(pwm1, PXA910_PWM1, 1, 13000000);
91static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000);
92static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000);
93static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000);
94static APBC_CLK(gpio, PXA910_GPIO, 0, 13000000);
95static APBC_CLK(rtc, PXA910_RTC, 8, 32768);
96
97static APMU_CLK(nand, NAND, 0x19b, 156000000);
98static APMU_CLK(u2o, USB, 0x1b, 480000000);
99
100/* device and clock bindings */
101static struct clk_lookup pxa910_clkregs[] = {
102 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
103 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
104 INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL),
105 INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL),
106 INIT_CLKREG(&clk_pwm1, "pxa910-pwm.0", NULL),
107 INIT_CLKREG(&clk_pwm2, "pxa910-pwm.1", NULL),
108 INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL),
109 INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL),
110 INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
111 INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
112 INIT_CLKREG(&clk_u2o, NULL, "U2OCLK"),
113 INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL),
114};
115
116static int __init pxa910_init(void) 84static int __init pxa910_init(void)
117{ 85{
118 if (cpu_is_pxa910()) { 86 if (cpu_is_pxa910()) {
87#ifdef CONFIG_CACHE_TAUROS2
88 tauros2_init(0);
89#endif
119 mfp_init_base(MFPR_VIRT_BASE); 90 mfp_init_base(MFPR_VIRT_BASE);
120 mfp_init_addr(pxa910_mfp_addr_map); 91 mfp_init_addr(pxa910_mfp_addr_map);
121 pxa_init_dma(IRQ_PXA910_DMA_INT0, 32); 92 pxa_init_dma(IRQ_PXA910_DMA_INT0, 32);
122 clkdev_add_table(ARRAY_AND_SIZE(pxa910_clkregs)); 93 pxa910_clk_init();
123 } 94 }
124 95
125 return 0; 96 return 0;
@@ -128,12 +99,13 @@ postcore_initcall(pxa910_init);
128 99
129/* system timer - clock enabled, 3.25MHz */ 100/* system timer - clock enabled, 3.25MHz */
130#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)
131 103
132static void __init pxa910_timer_init(void) 104static void __init pxa910_timer_init(void)
133{ 105{
134 /* reset and configure */ 106 /* reset and configure */
135 __raw_writel(APBC_APBCLK | APBC_RST, APBC_PXA910_TIMERS); 107 __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS);
136 __raw_writel(TIMER_CLK_RST, APBC_PXA910_TIMERS); 108 __raw_writel(TIMER_CLK_RST, APBC_TIMERS);
137 109
138 timer_init(IRQ_PXA910_AP1_TIMER1); 110 timer_init(IRQ_PXA910_AP1_TIMER1);
139} 111}
diff --git a/arch/arm/mach-mmp/sram.c b/arch/arm/mach-mmp/sram.c
index 7e8a5a2e1ec..a6c08ede449 100644
--- a/arch/arm/mach-mmp/sram.c
+++ b/arch/arm/mach-mmp/sram.c
@@ -22,7 +22,7 @@
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/genalloc.h> 23#include <linux/genalloc.h>
24 24
25#include <mach/sram.h> 25#include <linux/platform_data/dma-mmp_tdma.h>
26 26
27struct sram_bank_info { 27struct sram_bank_info {
28 char *pool_name; 28 char *pool_name;
diff --git a/arch/arm/mach-mmp/teton_bga.c b/arch/arm/mach-mmp/teton_bga.c
index 42bef6674ec..dd30ea74785 100644
--- a/arch/arm/mach-mmp/teton_bga.c
+++ b/arch/arm/mach-mmp/teton_bga.c
@@ -17,7 +17,7 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/input.h> 19#include <linux/input.h>
20#include <plat/pxa27x_keypad.h> 20#include <linux/platform_data/keypad-pxa27x.h>
21#include <linux/i2c.h> 21#include <linux/i2c.h>
22 22
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index 7a7de2b12a6..ce55fd8821c 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -177,12 +177,22 @@ static struct mv_usb_platform_data ttc_usb_pdata = {
177#endif 177#endif
178#endif 178#endif
179 179
180#ifdef CONFIG_MTD_NAND_PXA3xx
181static struct pxa3xx_nand_platform_data dkb_nand_info = {
182 .enable_arbiter = 1,
183 .num_cs = 1,
184};
185#endif
186
180static void __init ttc_dkb_init(void) 187static void __init ttc_dkb_init(void)
181{ 188{
182 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config)); 189 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
183 190
184 /* on-chip devices */ 191 /* on-chip devices */
185 pxa910_add_uart(1); 192 pxa910_add_uart(1);
193#ifdef CONFIG_MTD_NAND_PXA3xx
194 pxa910_add_nand(&dkb_nand_info);
195#endif
186 196
187 /* off-chip devices */ 197 /* off-chip devices */
188 pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info)); 198 pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info));
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 1cd40ad301d..b61908594b4 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -1,64 +1,67 @@
1if ARCH_MSM 1if ARCH_MSM
2 2
3comment "Qualcomm MSM SoC Type"
4 depends on (ARCH_MSM8X60 || ARCH_MSM8960)
5
3choice 6choice
4 prompt "Qualcomm MSM SoC Type" 7 prompt "Qualcomm MSM SoC Type"
5 default ARCH_MSM7X00A 8 default ARCH_MSM7X00A
9 depends on !(ARCH_MSM8X60 || ARCH_MSM8960)
6 10
7config ARCH_MSM7X00A 11config ARCH_MSM7X00A
8 bool "MSM7x00A / MSM7x01A" 12 bool "MSM7x00A / MSM7x01A"
9 select MACH_TROUT if !MACH_HALIBUT
10 select ARCH_MSM_ARM11 13 select ARCH_MSM_ARM11
11 select MSM_SMD
12 select MSM_SMD_PKG3
13 select CPU_V6 14 select CPU_V6
14 select GPIO_MSM_V1 15 select GPIO_MSM_V1
16 select MACH_TROUT if !MACH_HALIBUT
15 select MSM_PROC_COMM 17 select MSM_PROC_COMM
18 select MSM_SMD
19 select MSM_SMD_PKG3
16 20
17config ARCH_MSM7X30 21config ARCH_MSM7X30
18 bool "MSM7x30" 22 bool "MSM7x30"
19 select MACH_MSM7X30_SURF # if !
20 select ARCH_MSM_SCORPION 23 select ARCH_MSM_SCORPION
21 select MSM_SMD
22 select MSM_VIC
23 select CPU_V7 24 select CPU_V7
24 select MSM_GPIOMUX
25 select GPIO_MSM_V1 25 select GPIO_MSM_V1
26 select MACH_MSM7X30_SURF # if !
27 select MSM_GPIOMUX
26 select MSM_PROC_COMM 28 select MSM_PROC_COMM
29 select MSM_SMD
30 select MSM_VIC
27 31
28config ARCH_QSD8X50 32config ARCH_QSD8X50
29 bool "QSD8X50" 33 bool "QSD8X50"
30 select MACH_QSD8X50_SURF if !MACH_QSD8X50A_ST1_5
31 select ARCH_MSM_SCORPION 34 select ARCH_MSM_SCORPION
32 select MSM_SMD
33 select MSM_VIC
34 select CPU_V7 35 select CPU_V7
35 select MSM_GPIOMUX
36 select GPIO_MSM_V1 36 select GPIO_MSM_V1
37 select MACH_QSD8X50_SURF if !MACH_QSD8X50A_ST1_5
38 select MSM_GPIOMUX
37 select MSM_PROC_COMM 39 select MSM_PROC_COMM
40 select MSM_SMD
41 select MSM_VIC
42
43endchoice
38 44
39config ARCH_MSM8X60 45config ARCH_MSM8X60
40 bool "MSM8X60" 46 bool "MSM8X60"
41 select MACH_MSM8X60_SURF if (!MACH_MSM8X60_RUMI3 && !MACH_MSM8X60_SIM \
42 && !MACH_MSM8X60_FFA)
43 select ARCH_MSM_SCORPIONMP 47 select ARCH_MSM_SCORPIONMP
44 select ARM_GIC 48 select ARM_GIC
45 select CPU_V7 49 select CPU_V7
46 select MSM_V2_TLMM
47 select GPIO_MSM_V2 50 select GPIO_MSM_V2
48 select MSM_GPIOMUX 51 select MSM_GPIOMUX
49 select MSM_SCM if SMP 52 select MSM_SCM if SMP
53 select MSM_V2_TLMM
54 select USE_OF
50 55
51config ARCH_MSM8960 56config ARCH_MSM8960
52 bool "MSM8960" 57 bool "MSM8960"
53 select ARCH_MSM_SCORPIONMP 58 select ARCH_MSM_SCORPIONMP
54 select MACH_MSM8960_SIM if (!MACH_MSM8960_RUMI3)
55 select ARM_GIC 59 select ARM_GIC
56 select CPU_V7 60 select CPU_V7
57 select MSM_V2_TLMM
58 select MSM_GPIOMUX 61 select MSM_GPIOMUX
59 select MSM_SCM if SMP 62 select MSM_SCM if SMP
60 63 select MSM_V2_TLMM
61endchoice 64 select USE_OF
62 65
63config MSM_HAS_DEBUG_UART_HS 66config MSM_HAS_DEBUG_UART_HS
64 bool 67 bool
@@ -107,47 +110,11 @@ config MACH_QSD8X50_SURF
107 110
108config MACH_QSD8X50A_ST1_5 111config MACH_QSD8X50A_ST1_5
109 depends on ARCH_QSD8X50 112 depends on ARCH_QSD8X50
110 select MSM_SOC_REV_A
111 bool "QSD8x50A ST1.5" 113 bool "QSD8x50A ST1.5"
114 select MSM_SOC_REV_A
112 help 115 help
113 Support for the Qualcomm ST1.5. 116 Support for the Qualcomm ST1.5.
114 117
115config MACH_MSM8X60_RUMI3
116 depends on ARCH_MSM8X60
117 bool "MSM8x60 RUMI3"
118 help
119 Support for the Qualcomm MSM8x60 RUMI3 emulator.
120
121config MACH_MSM8X60_SURF
122 depends on ARCH_MSM8X60
123 bool "MSM8x60 SURF"
124 help
125 Support for the Qualcomm MSM8x60 SURF eval board.
126
127config MACH_MSM8X60_SIM
128 depends on ARCH_MSM8X60
129 bool "MSM8x60 Simulator"
130 help
131 Support for the Qualcomm MSM8x60 simulator.
132
133config MACH_MSM8X60_FFA
134 depends on ARCH_MSM8X60
135 bool "MSM8x60 FFA"
136 help
137 Support for the Qualcomm MSM8x60 FFA eval board.
138
139config MACH_MSM8960_SIM
140 depends on ARCH_MSM8960
141 bool "MSM8960 Simulator"
142 help
143 Support for the Qualcomm MSM8960 simulator.
144
145config MACH_MSM8960_RUMI3
146 depends on ARCH_MSM8960
147 bool "MSM8960 RUMI3"
148 help
149 Support for the Qualcomm MSM8960 RUMI3 emulator.
150
151endmenu 118endmenu
152 119
153config MSM_SMD_PKG3 120config MSM_SMD_PKG3
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 4ad3969b988..17519faf082 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -1,11 +1,11 @@
1obj-y += io.o idle.o timer.o 1obj-y += io.o timer.o
2obj-y += clock.o 2obj-y += clock.o
3obj-$(CONFIG_DEBUG_FS) += clock-debug.o 3obj-$(CONFIG_DEBUG_FS) += clock-debug.o
4 4
5obj-$(CONFIG_MSM_VIC) += irq-vic.o 5obj-$(CONFIG_MSM_VIC) += irq-vic.o
6obj-$(CONFIG_MSM_IOMMU) += devices-iommu.o 6obj-$(CONFIG_MSM_IOMMU) += devices-iommu.o
7 7
8obj-$(CONFIG_ARCH_MSM7X00A) += dma.o irq.o acpuclock-arm11.o 8obj-$(CONFIG_ARCH_MSM7X00A) += dma.o irq.o
9obj-$(CONFIG_ARCH_MSM7X30) += dma.o 9obj-$(CONFIG_ARCH_MSM7X30) += dma.o
10obj-$(CONFIG_ARCH_QSD8X50) += dma.o sirc.o 10obj-$(CONFIG_ARCH_QSD8X50) += dma.o sirc.o
11 11
@@ -25,8 +25,8 @@ obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o b
25obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o 25obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o
26obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o 26obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o
27obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o 27obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o
28obj-$(CONFIG_ARCH_MSM8X60) += board-msm8x60.o 28obj-$(CONFIG_ARCH_MSM8X60) += board-dt-8660.o
29obj-$(CONFIG_ARCH_MSM8960) += board-msm8960.o devices-msm8960.o 29obj-$(CONFIG_ARCH_MSM8960) += board-dt-8960.o
30 30
31obj-$(CONFIG_ARCH_MSM7X30) += gpiomux-v1.o gpiomux.o 31obj-$(CONFIG_ARCH_MSM7X30) += gpiomux-v1.o gpiomux.o
32obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o gpiomux-v1.o gpiomux.o 32obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o gpiomux-v1.o gpiomux.o
diff --git a/arch/arm/mach-msm/acpuclock-arm11.c b/arch/arm/mach-msm/acpuclock-arm11.c
deleted file mode 100644
index 805d4ee53f7..00000000000
--- a/arch/arm/mach-msm/acpuclock-arm11.c
+++ /dev/null
@@ -1,525 +0,0 @@
1/* arch/arm/mach-msm/acpuclock.c
2 *
3 * MSM architecture clock driver
4 *
5 * Copyright (C) 2007 Google, Inc.
6 * Copyright (c) 2007 QUALCOMM Incorporated
7 * Author: San Mehat <san@android.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/init.h>
22#include <linux/list.h>
23#include <linux/errno.h>
24#include <linux/string.h>
25#include <linux/delay.h>
26#include <linux/clk.h>
27#include <linux/cpufreq.h>
28#include <linux/mutex.h>
29#include <linux/io.h>
30#include <mach/board.h>
31#include <mach/msm_iomap.h>
32
33#include "proc_comm.h"
34#include "acpuclock.h"
35
36
37#define A11S_CLK_CNTL_ADDR (MSM_CSR_BASE + 0x100)
38#define A11S_CLK_SEL_ADDR (MSM_CSR_BASE + 0x104)
39#define A11S_VDD_SVS_PLEVEL_ADDR (MSM_CSR_BASE + 0x124)
40
41/*
42 * ARM11 clock configuration for specific ACPU speeds
43 */
44
45#define ACPU_PLL_TCXO -1
46#define ACPU_PLL_0 0
47#define ACPU_PLL_1 1
48#define ACPU_PLL_2 2
49#define ACPU_PLL_3 3
50
51#define PERF_SWITCH_DEBUG 0
52#define PERF_SWITCH_STEP_DEBUG 0
53
54struct clock_state
55{
56 struct clkctl_acpu_speed *current_speed;
57 struct mutex lock;
58 uint32_t acpu_switch_time_us;
59 uint32_t max_speed_delta_khz;
60 uint32_t vdd_switch_time_us;
61 unsigned long power_collapse_khz;
62 unsigned long wait_for_irq_khz;
63};
64
65static struct clk *ebi1_clk;
66static struct clock_state drv_state = { 0 };
67
68static void __init acpuclk_init(void);
69
70/* MSM7201A Levels 3-6 all correspond to 1.2V, level 7 corresponds to 1.325V. */
71enum {
72 VDD_0 = 0,
73 VDD_1 = 1,
74 VDD_2 = 2,
75 VDD_3 = 3,
76 VDD_4 = 3,
77 VDD_5 = 3,
78 VDD_6 = 3,
79 VDD_7 = 7,
80 VDD_END
81};
82
83struct clkctl_acpu_speed {
84 unsigned int a11clk_khz;
85 int pll;
86 unsigned int a11clk_src_sel;
87 unsigned int a11clk_src_div;
88 unsigned int ahbclk_khz;
89 unsigned int ahbclk_div;
90 int vdd;
91 unsigned int axiclk_khz;
92 unsigned long lpj; /* loops_per_jiffy */
93/* Index in acpu_freq_tbl[] for steppings. */
94 short down;
95 short up;
96};
97
98/*
99 * ACPU speed table. Complete table is shown but certain speeds are commented
100 * out to optimized speed switching. Initialize loops_per_jiffy to 0.
101 *
102 * Table stepping up/down is optimized for 256mhz jumps while staying on the
103 * same PLL.
104 */
105#if (0)
106static struct clkctl_acpu_speed acpu_freq_tbl[] = {
107 { 19200, ACPU_PLL_TCXO, 0, 0, 19200, 0, VDD_0, 30720, 0, 0, 8 },
108 { 61440, ACPU_PLL_0, 4, 3, 61440, 0, VDD_0, 30720, 0, 0, 8 },
109 { 81920, ACPU_PLL_0, 4, 2, 40960, 1, VDD_0, 61440, 0, 0, 8 },
110 { 96000, ACPU_PLL_1, 1, 7, 48000, 1, VDD_0, 61440, 0, 0, 9 },
111 { 122880, ACPU_PLL_0, 4, 1, 61440, 1, VDD_3, 61440, 0, 0, 8 },
112 { 128000, ACPU_PLL_1, 1, 5, 64000, 1, VDD_3, 61440, 0, 0, 12 },
113 { 176000, ACPU_PLL_2, 2, 5, 88000, 1, VDD_3, 61440, 0, 0, 11 },
114 { 192000, ACPU_PLL_1, 1, 3, 64000, 2, VDD_3, 61440, 0, 0, 12 },
115 { 245760, ACPU_PLL_0, 4, 0, 81920, 2, VDD_4, 61440, 0, 0, 12 },
116 { 256000, ACPU_PLL_1, 1, 2, 128000, 2, VDD_5, 128000, 0, 0, 12 },
117 { 264000, ACPU_PLL_2, 2, 3, 88000, 2, VDD_5, 128000, 0, 6, 13 },
118 { 352000, ACPU_PLL_2, 2, 2, 88000, 3, VDD_5, 128000, 0, 6, 13 },
119 { 384000, ACPU_PLL_1, 1, 1, 128000, 2, VDD_6, 128000, 0, 5, -1 },
120 { 528000, ACPU_PLL_2, 2, 1, 132000, 3, VDD_7, 128000, 0, 11, -1 },
121 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
122};
123#else /* Table of freq we currently use. */
124static struct clkctl_acpu_speed acpu_freq_tbl[] = {
125 { 19200, ACPU_PLL_TCXO, 0, 0, 19200, 0, VDD_0, 30720, 0, 0, 4 },
126 { 122880, ACPU_PLL_0, 4, 1, 61440, 1, VDD_3, 61440, 0, 0, 4 },
127 { 128000, ACPU_PLL_1, 1, 5, 64000, 1, VDD_3, 61440, 0, 0, 6 },
128 { 176000, ACPU_PLL_2, 2, 5, 88000, 1, VDD_3, 61440, 0, 0, 5 },
129 { 245760, ACPU_PLL_0, 4, 0, 81920, 2, VDD_4, 61440, 0, 0, 5 },
130 { 352000, ACPU_PLL_2, 2, 2, 88000, 3, VDD_5, 128000, 0, 3, 7 },
131 { 384000, ACPU_PLL_1, 1, 1, 128000, 2, VDD_6, 128000, 0, 2, -1 },
132 { 528000, ACPU_PLL_2, 2, 1, 132000, 3, VDD_7, 128000, 0, 5, -1 },
133 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
134};
135#endif
136
137
138#ifdef CONFIG_CPU_FREQ_TABLE
139static struct cpufreq_frequency_table freq_table[] = {
140 { 0, 122880 },
141 { 1, 128000 },
142 { 2, 245760 },
143 { 3, 384000 },
144 { 4, 528000 },
145 { 5, CPUFREQ_TABLE_END },
146};
147#endif
148
149static int pc_pll_request(unsigned id, unsigned on)
150{
151 int res;
152 on = !!on;
153
154#if PERF_SWITCH_DEBUG
155 if (on)
156 printk(KERN_DEBUG "Enabling PLL %d\n", id);
157 else
158 printk(KERN_DEBUG "Disabling PLL %d\n", id);
159#endif
160
161 res = msm_proc_comm(PCOM_CLKCTL_RPC_PLL_REQUEST, &id, &on);
162 if (res < 0)
163 return res;
164
165#if PERF_SWITCH_DEBUG
166 if (on)
167 printk(KERN_DEBUG "PLL %d enabled\n", id);
168 else
169 printk(KERN_DEBUG "PLL %d disabled\n", id);
170#endif
171 return res;
172}
173
174
175/*----------------------------------------------------------------------------
176 * ARM11 'owned' clock control
177 *---------------------------------------------------------------------------*/
178
179unsigned long acpuclk_power_collapse(void) {
180 int ret = acpuclk_get_rate();
181 ret *= 1000;
182 if (ret > drv_state.power_collapse_khz)
183 acpuclk_set_rate(drv_state.power_collapse_khz, 1);
184 return ret;
185}
186
187unsigned long acpuclk_get_wfi_rate(void)
188{
189 return drv_state.wait_for_irq_khz;
190}
191
192unsigned long acpuclk_wait_for_irq(void) {
193 int ret = acpuclk_get_rate();
194 ret *= 1000;
195 if (ret > drv_state.wait_for_irq_khz)
196 acpuclk_set_rate(drv_state.wait_for_irq_khz, 1);
197 return ret;
198}
199
200static int acpuclk_set_vdd_level(int vdd)
201{
202 uint32_t current_vdd;
203
204 current_vdd = readl(A11S_VDD_SVS_PLEVEL_ADDR) & 0x07;
205
206#if PERF_SWITCH_DEBUG
207 printk(KERN_DEBUG "acpuclock: Switching VDD from %u -> %d\n",
208 current_vdd, vdd);
209#endif
210 writel((1 << 7) | (vdd << 3), A11S_VDD_SVS_PLEVEL_ADDR);
211 udelay(drv_state.vdd_switch_time_us);
212 if ((readl(A11S_VDD_SVS_PLEVEL_ADDR) & 0x7) != vdd) {
213#if PERF_SWITCH_DEBUG
214 printk(KERN_ERR "acpuclock: VDD set failed\n");
215#endif
216 return -EIO;
217 }
218
219#if PERF_SWITCH_DEBUG
220 printk(KERN_DEBUG "acpuclock: VDD switched\n");
221#endif
222 return 0;
223}
224
225/* Set proper dividers for the given clock speed. */
226static void acpuclk_set_div(const struct clkctl_acpu_speed *hunt_s) {
227 uint32_t reg_clkctl, reg_clksel, clk_div;
228
229 /* AHB_CLK_DIV */
230 clk_div = (readl(A11S_CLK_SEL_ADDR) >> 1) & 0x03;
231 /*
232 * If the new clock divider is higher than the previous, then
233 * program the divider before switching the clock
234 */
235 if (hunt_s->ahbclk_div > clk_div) {
236 reg_clksel = readl(A11S_CLK_SEL_ADDR);
237 reg_clksel &= ~(0x3 << 1);
238 reg_clksel |= (hunt_s->ahbclk_div << 1);
239 writel(reg_clksel, A11S_CLK_SEL_ADDR);
240 }
241 if ((readl(A11S_CLK_SEL_ADDR) & 0x01) == 0) {
242 /* SRC0 */
243
244 /* Program clock source */
245 reg_clkctl = readl(A11S_CLK_CNTL_ADDR);
246 reg_clkctl &= ~(0x07 << 4);
247 reg_clkctl |= (hunt_s->a11clk_src_sel << 4);
248 writel(reg_clkctl, A11S_CLK_CNTL_ADDR);
249
250 /* Program clock divider */
251 reg_clkctl = readl(A11S_CLK_CNTL_ADDR);
252 reg_clkctl &= ~0xf;
253 reg_clkctl |= hunt_s->a11clk_src_div;
254 writel(reg_clkctl, A11S_CLK_CNTL_ADDR);
255
256 /* Program clock source selection */
257 reg_clksel = readl(A11S_CLK_SEL_ADDR);
258 reg_clksel |= 1; /* CLK_SEL_SRC1NO == SRC1 */
259 writel(reg_clksel, A11S_CLK_SEL_ADDR);
260 } else {
261 /* SRC1 */
262
263 /* Program clock source */
264 reg_clkctl = readl(A11S_CLK_CNTL_ADDR);
265 reg_clkctl &= ~(0x07 << 12);
266 reg_clkctl |= (hunt_s->a11clk_src_sel << 12);
267 writel(reg_clkctl, A11S_CLK_CNTL_ADDR);
268
269 /* Program clock divider */
270 reg_clkctl = readl(A11S_CLK_CNTL_ADDR);
271 reg_clkctl &= ~(0xf << 8);
272 reg_clkctl |= (hunt_s->a11clk_src_div << 8);
273 writel(reg_clkctl, A11S_CLK_CNTL_ADDR);
274
275 /* Program clock source selection */
276 reg_clksel = readl(A11S_CLK_SEL_ADDR);
277 reg_clksel &= ~1; /* CLK_SEL_SRC1NO == SRC0 */
278 writel(reg_clksel, A11S_CLK_SEL_ADDR);
279 }
280
281 /*
282 * If the new clock divider is lower than the previous, then
283 * program the divider after switching the clock
284 */
285 if (hunt_s->ahbclk_div < clk_div) {
286 reg_clksel = readl(A11S_CLK_SEL_ADDR);
287 reg_clksel &= ~(0x3 << 1);
288 reg_clksel |= (hunt_s->ahbclk_div << 1);
289 writel(reg_clksel, A11S_CLK_SEL_ADDR);
290 }
291}
292
293int acpuclk_set_rate(unsigned long rate, int for_power_collapse)
294{
295 uint32_t reg_clkctl;
296 struct clkctl_acpu_speed *cur_s, *tgt_s, *strt_s;
297 int rc = 0;
298 unsigned int plls_enabled = 0, pll;
299
300 strt_s = cur_s = drv_state.current_speed;
301
302 WARN_ONCE(cur_s == NULL, "acpuclk_set_rate: not initialized\n");
303 if (cur_s == NULL)
304 return -ENOENT;
305
306 if (rate == (cur_s->a11clk_khz * 1000))
307 return 0;
308
309 for (tgt_s = acpu_freq_tbl; tgt_s->a11clk_khz != 0; tgt_s++) {
310 if (tgt_s->a11clk_khz == (rate / 1000))
311 break;
312 }
313
314 if (tgt_s->a11clk_khz == 0)
315 return -EINVAL;
316
317 /* Choose the highest speed speed at or below 'rate' with same PLL. */
318 if (for_power_collapse && tgt_s->a11clk_khz < cur_s->a11clk_khz) {
319 while (tgt_s->pll != ACPU_PLL_TCXO && tgt_s->pll != cur_s->pll)
320 tgt_s--;
321 }
322
323 if (strt_s->pll != ACPU_PLL_TCXO)
324 plls_enabled |= 1 << strt_s->pll;
325
326 if (!for_power_collapse) {
327 mutex_lock(&drv_state.lock);
328 if (strt_s->pll != tgt_s->pll && tgt_s->pll != ACPU_PLL_TCXO) {
329 rc = pc_pll_request(tgt_s->pll, 1);
330 if (rc < 0) {
331 pr_err("PLL%d enable failed (%d)\n",
332 tgt_s->pll, rc);
333 goto out;
334 }
335 plls_enabled |= 1 << tgt_s->pll;
336 }
337 /* Increase VDD if needed. */
338 if (tgt_s->vdd > cur_s->vdd) {
339 if ((rc = acpuclk_set_vdd_level(tgt_s->vdd)) < 0) {
340 printk(KERN_ERR "Unable to switch ACPU vdd\n");
341 goto out;
342 }
343 }
344 }
345
346 /* Set wait states for CPU between frequency changes */
347 reg_clkctl = readl(A11S_CLK_CNTL_ADDR);
348 reg_clkctl |= (100 << 16); /* set WT_ST_CNT */
349 writel(reg_clkctl, A11S_CLK_CNTL_ADDR);
350
351#if PERF_SWITCH_DEBUG
352 printk(KERN_INFO "acpuclock: Switching from ACPU rate %u -> %u\n",
353 strt_s->a11clk_khz * 1000, tgt_s->a11clk_khz * 1000);
354#endif
355
356 while (cur_s != tgt_s) {
357 /*
358 * Always jump to target freq if within 256mhz, regulardless of
359 * PLL. If differnece is greater, use the predefinied
360 * steppings in the table.
361 */
362 int d = abs((int)(cur_s->a11clk_khz - tgt_s->a11clk_khz));
363 if (d > drv_state.max_speed_delta_khz) {
364 /* Step up or down depending on target vs current. */
365 int clk_index = tgt_s->a11clk_khz > cur_s->a11clk_khz ?
366 cur_s->up : cur_s->down;
367 if (clk_index < 0) { /* This should not happen. */
368 printk(KERN_ERR "cur:%u target: %u\n",
369 cur_s->a11clk_khz, tgt_s->a11clk_khz);
370 rc = -EINVAL;
371 goto out;
372 }
373 cur_s = &acpu_freq_tbl[clk_index];
374 } else {
375 cur_s = tgt_s;
376 }
377#if PERF_SWITCH_STEP_DEBUG
378 printk(KERN_DEBUG "%s: STEP khz = %u, pll = %d\n",
379 __FUNCTION__, cur_s->a11clk_khz, cur_s->pll);
380#endif
381 if (!for_power_collapse&& cur_s->pll != ACPU_PLL_TCXO
382 && !(plls_enabled & (1 << cur_s->pll))) {
383 rc = pc_pll_request(cur_s->pll, 1);
384 if (rc < 0) {
385 pr_err("PLL%d enable failed (%d)\n",
386 cur_s->pll, rc);
387 goto out;
388 }
389 plls_enabled |= 1 << cur_s->pll;
390 }
391
392 acpuclk_set_div(cur_s);
393 drv_state.current_speed = cur_s;
394 /* Re-adjust lpj for the new clock speed. */
395 loops_per_jiffy = cur_s->lpj;
396 udelay(drv_state.acpu_switch_time_us);
397 }
398
399 /* Nothing else to do for power collapse. */
400 if (for_power_collapse)
401 return 0;
402
403 /* Disable PLLs we are not using anymore. */
404 plls_enabled &= ~(1 << tgt_s->pll);
405 for (pll = ACPU_PLL_0; pll <= ACPU_PLL_2; pll++)
406 if (plls_enabled & (1 << pll)) {
407 rc = pc_pll_request(pll, 0);
408 if (rc < 0) {
409 pr_err("PLL%d disable failed (%d)\n", pll, rc);
410 goto out;
411 }
412 }
413
414 /* Change the AXI bus frequency if we can. */
415 if (strt_s->axiclk_khz != tgt_s->axiclk_khz) {
416 rc = clk_set_rate(ebi1_clk, tgt_s->axiclk_khz * 1000);
417 if (rc < 0)
418 pr_err("Setting AXI min rate failed!\n");
419 }
420
421 /* Drop VDD level if we can. */
422 if (tgt_s->vdd < strt_s->vdd) {
423 if (acpuclk_set_vdd_level(tgt_s->vdd) < 0)
424 printk(KERN_ERR "acpuclock: Unable to drop ACPU vdd\n");
425 }
426
427#if PERF_SWITCH_DEBUG
428 printk(KERN_DEBUG "%s: ACPU speed change complete\n", __FUNCTION__);
429#endif
430out:
431 if (!for_power_collapse)
432 mutex_unlock(&drv_state.lock);
433 return rc;
434}
435
436static void __init acpuclk_init(void)
437{
438 struct clkctl_acpu_speed *speed;
439 uint32_t div, sel;
440 int rc;
441
442 /*
443 * Determine the rate of ACPU clock
444 */
445
446 if (!(readl(A11S_CLK_SEL_ADDR) & 0x01)) { /* CLK_SEL_SRC1N0 */
447 /* CLK_SRC0_SEL */
448 sel = (readl(A11S_CLK_CNTL_ADDR) >> 12) & 0x7;
449 /* CLK_SRC0_DIV */
450 div = (readl(A11S_CLK_CNTL_ADDR) >> 8) & 0x0f;
451 } else {
452 /* CLK_SRC1_SEL */
453 sel = (readl(A11S_CLK_CNTL_ADDR) >> 4) & 0x07;
454 /* CLK_SRC1_DIV */
455 div = readl(A11S_CLK_CNTL_ADDR) & 0x0f;
456 }
457
458 for (speed = acpu_freq_tbl; speed->a11clk_khz != 0; speed++) {
459 if (speed->a11clk_src_sel == sel
460 && (speed->a11clk_src_div == div))
461 break;
462 }
463 if (speed->a11clk_khz == 0) {
464 printk(KERN_WARNING "Warning - ACPU clock reports invalid speed\n");
465 return;
466 }
467
468 drv_state.current_speed = speed;
469
470 rc = clk_set_rate(ebi1_clk, speed->axiclk_khz * 1000);
471 if (rc < 0)
472 pr_err("Setting AXI min rate failed!\n");
473
474 printk(KERN_INFO "ACPU running at %d KHz\n", speed->a11clk_khz);
475}
476
477unsigned long acpuclk_get_rate(void)
478{
479 WARN_ONCE(drv_state.current_speed == NULL,
480 "acpuclk_get_rate: not initialized\n");
481 if (drv_state.current_speed)
482 return drv_state.current_speed->a11clk_khz;
483 else
484 return 0;
485}
486
487uint32_t acpuclk_get_switch_time(void)
488{
489 return drv_state.acpu_switch_time_us;
490}
491
492/*----------------------------------------------------------------------------
493 * Clock driver initialization
494 *---------------------------------------------------------------------------*/
495
496/* Initialize the lpj field in the acpu_freq_tbl. */
497static void __init lpj_init(void)
498{
499 int i;
500 const struct clkctl_acpu_speed *base_clk = drv_state.current_speed;
501 for (i = 0; acpu_freq_tbl[i].a11clk_khz; i++) {
502 acpu_freq_tbl[i].lpj = cpufreq_scale(loops_per_jiffy,
503 base_clk->a11clk_khz,
504 acpu_freq_tbl[i].a11clk_khz);
505 }
506}
507
508void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *clkdata)
509{
510 pr_info("acpu_clock_init()\n");
511
512 ebi1_clk = clk_get(NULL, "ebi1_clk");
513
514 mutex_init(&drv_state.lock);
515 drv_state.acpu_switch_time_us = clkdata->acpu_switch_time_us;
516 drv_state.max_speed_delta_khz = clkdata->max_speed_delta_khz;
517 drv_state.vdd_switch_time_us = clkdata->vdd_switch_time_us;
518 drv_state.power_collapse_khz = clkdata->power_collapse_khz;
519 drv_state.wait_for_irq_khz = clkdata->wait_for_irq_khz;
520 acpuclk_init();
521 lpj_init();
522#ifdef CONFIG_CPU_FREQ_TABLE
523 cpufreq_frequency_table_get_attr(freq_table, smp_processor_id());
524#endif
525}
diff --git a/arch/arm/mach-msm/acpuclock.h b/arch/arm/mach-msm/acpuclock.h
deleted file mode 100644
index 415de2eb9a5..00000000000
--- a/arch/arm/mach-msm/acpuclock.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/* arch/arm/mach-msm/acpuclock.h
2 *
3 * MSM architecture clock driver header
4 *
5 * Copyright (C) 2007 Google, Inc.
6 * Copyright (c) 2007 QUALCOMM Incorporated
7 * Author: San Mehat <san@android.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 __ARCH_ARM_MACH_MSM_ACPUCLOCK_H
21#define __ARCH_ARM_MACH_MSM_ACPUCLOCK_H
22
23int acpuclk_set_rate(unsigned long rate, int for_power_collapse);
24unsigned long acpuclk_get_rate(void);
25uint32_t acpuclk_get_switch_time(void);
26unsigned long acpuclk_wait_for_irq(void);
27unsigned long acpuclk_power_collapse(void);
28unsigned long acpuclk_get_wfi_rate(void);
29
30
31#endif
32
diff --git a/arch/arm/mach-msm/board-dt-8660.c b/arch/arm/mach-msm/board-dt-8660.c
new file mode 100644
index 00000000000..b5b4de2cdf9
--- /dev/null
+++ b/arch/arm/mach-msm/board-dt-8660.c
@@ -0,0 +1,64 @@
1/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include <linux/init.h>
14#include <linux/of.h>
15#include <linux/of_irq.h>
16#include <linux/of_platform.h>
17
18#include <asm/mach/arch.h>
19#include <asm/hardware/gic.h>
20
21#include <mach/board.h>
22#include "common.h"
23
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)
35{
36 smd_debugfs_init();
37}
38
39static struct of_dev_auxdata msm_auxdata_lookup[] __initdata = {
40 {}
41};
42
43static void __init msm8x60_dt_init(void)
44{
45 of_platform_populate(NULL, of_default_bus_match_table,
46 msm_auxdata_lookup, NULL);
47}
48
49static const char *msm8x60_fluid_match[] __initdata = {
50 "qcom,msm8660-fluid",
51 "qcom,msm8660-surf",
52 NULL
53};
54
55DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
56 .smp = smp_ops(msm_smp_ops),
57 .map_io = msm_map_msm8x60_io,
58 .init_irq = msm8x60_init_irq,
59 .handle_irq = gic_handle_irq,
60 .init_machine = msm8x60_dt_init,
61 .init_late = msm8x60_init_late,
62 .timer = &msm_dt_timer,
63 .dt_compat = msm8x60_fluid_match,
64MACHINE_END
diff --git a/arch/arm/mach-msm/board-dt-8960.c b/arch/arm/mach-msm/board-dt-8960.c
new file mode 100644
index 00000000000..4490edb71c1
--- /dev/null
+++ b/arch/arm/mach-msm/board-dt-8960.c
@@ -0,0 +1,50 @@
1/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include <linux/init.h>
14#include <linux/of_irq.h>
15#include <linux/of_platform.h>
16
17#include <asm/hardware/gic.h>
18#include <asm/mach/arch.h>
19
20#include "common.h"
21
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)
33{
34 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
35}
36
37static const char * const msm8960_dt_match[] __initconst = {
38 "qcom,msm8960-cdp",
39 NULL
40};
41
42DT_MACHINE_START(MSM8960_DT, "Qualcomm MSM (Flattened Device Tree)")
43 .smp = smp_ops(msm_smp_ops),
44 .map_io = msm_map_msm8960_io,
45 .init_irq = msm_dt_init_irq,
46 .timer = &msm_dt_timer,
47 .init_machine = msm_dt_init,
48 .dt_compat = msm8960_dt_match,
49 .handle_irq = gic_handle_irq,
50MACHINE_END
diff --git a/arch/arm/mach-msm/board-halibut.c b/arch/arm/mach-msm/board-halibut.c
index 4fa3e99d9a6..6ce542e2e21 100644
--- a/arch/arm/mach-msm/board-halibut.c
+++ b/arch/arm/mach-msm/board-halibut.c
@@ -36,6 +36,7 @@
36#include <linux/mtd/partitions.h> 36#include <linux/mtd/partitions.h>
37 37
38#include "devices.h" 38#include "devices.h"
39#include "common.h"
39 40
40static struct resource smc91x_resources[] = { 41static struct resource smc91x_resources[] = {
41 [0] = { 42 [0] = {
@@ -66,8 +67,6 @@ static struct platform_device *devices[] __initdata = {
66 &smc91x_device, 67 &smc91x_device,
67}; 68};
68 69
69extern struct sys_timer msm_timer;
70
71static void __init halibut_init_early(void) 70static void __init halibut_init_early(void)
72{ 71{
73 arch_ioremap_caller = __msm_ioremap_caller; 72 arch_ioremap_caller = __msm_ioremap_caller;
@@ -107,5 +106,5 @@ MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
107 .init_irq = halibut_init_irq, 106 .init_irq = halibut_init_irq,
108 .init_machine = halibut_init, 107 .init_machine = halibut_init,
109 .init_late = halibut_init_late, 108 .init_late = halibut_init_late,
110 .timer = &msm_timer, 109 .timer = &msm7x01_timer,
111MACHINE_END 110MACHINE_END
diff --git a/arch/arm/mach-msm/board-mahimahi.c b/arch/arm/mach-msm/board-mahimahi.c
index cf1f89a5dc6..df00bc03ce7 100644
--- a/arch/arm/mach-msm/board-mahimahi.c
+++ b/arch/arm/mach-msm/board-mahimahi.c
@@ -30,7 +30,6 @@
30 30
31#include <mach/board.h> 31#include <mach/board.h>
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <mach/system.h>
34 33
35#include "board-mahimahi.h" 34#include "board-mahimahi.h"
36#include "devices.h" 35#include "devices.h"
diff --git a/arch/arm/mach-msm/board-msm7x27.c b/arch/arm/mach-msm/board-msm7x27.c
deleted file mode 100644
index 451ab1d43c9..00000000000
--- a/arch/arm/mach-msm/board-msm7x27.c
+++ /dev/null
@@ -1,170 +0,0 @@
1/*
2 * Copyright (C) 2007 Google, Inc.
3 * Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
4 * Author: Brian Swetland <swetland@google.com>
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16#include <linux/gpio.h>
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/platform_device.h>
20#include <linux/input.h>
21#include <linux/io.h>
22#include <linux/delay.h>
23#include <linux/power_supply.h>
24
25#include <mach/hardware.h>
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/flash.h>
30#include <asm/setup.h>
31#ifdef CONFIG_CACHE_L2X0
32#include <asm/hardware/cache-l2x0.h>
33#endif
34
35#include <mach/vreg.h>
36#include <mach/mpp.h>
37#include <mach/board.h>
38#include <mach/msm_iomap.h>
39
40#include <linux/mtd/nand.h>
41#include <linux/mtd/partitions.h>
42
43#include "devices.h"
44#include "socinfo.h"
45#include "clock.h"
46
47static struct resource smc91x_resources[] = {
48 [0] = {
49 .start = 0x9C004300,
50 .end = 0x9C0043ff,
51 .flags = IORESOURCE_MEM,
52 },
53 [1] = {
54 .start = MSM_GPIO_TO_INT(132),
55 .end = MSM_GPIO_TO_INT(132),
56 .flags = IORESOURCE_IRQ,
57 },
58};
59
60static struct platform_device smc91x_device = {
61 .name = "smc91x",
62 .id = 0,
63 .num_resources = ARRAY_SIZE(smc91x_resources),
64 .resource = smc91x_resources,
65};
66
67static struct platform_device *devices[] __initdata = {
68 &msm_device_uart3,
69 &msm_device_smd,
70 &msm_device_dmov,
71 &msm_device_nand,
72 &smc91x_device,
73};
74
75extern struct sys_timer msm_timer;
76
77static void __init msm7x2x_init_irq(void)
78{
79 msm_init_irq();
80}
81
82static void __init msm7x2x_init(void)
83{
84 if (socinfo_init() < 0)
85 BUG();
86
87 if (machine_is_msm7x25_ffa() || machine_is_msm7x27_ffa()) {
88 smc91x_resources[0].start = 0x98000300;
89 smc91x_resources[0].end = 0x980003ff;
90 smc91x_resources[1].start = MSM_GPIO_TO_INT(85);
91 smc91x_resources[1].end = MSM_GPIO_TO_INT(85);
92 if (gpio_tlmm_config(GPIO_CFG(85, 0,
93 GPIO_INPUT,
94 GPIO_PULL_DOWN,
95 GPIO_2MA),
96 GPIO_ENABLE)) {
97 printk(KERN_ERR
98 "%s: Err: Config GPIO-85 INT\n",
99 __func__);
100 }
101 }
102
103 platform_add_devices(devices, ARRAY_SIZE(devices));
104}
105
106static void __init msm7x2x_map_io(void)
107{
108 msm_map_common_io();
109 /* Technically dependent on the SoC but using machine_is
110 * macros since socinfo is not available this early and there
111 * are plans to restructure the code which will eliminate the
112 * need for socinfo.
113 */
114 if (machine_is_msm7x27_surf() || machine_is_msm7x27_ffa())
115 msm_clock_init(msm_clocks_7x27, msm_num_clocks_7x27);
116
117 if (machine_is_msm7x25_surf() || machine_is_msm7x25_ffa())
118 msm_clock_init(msm_clocks_7x25, msm_num_clocks_7x25);
119
120#ifdef CONFIG_CACHE_L2X0
121 if (machine_is_msm7x27_surf() || machine_is_msm7x27_ffa()) {
122 /* 7x27 has 256KB L2 cache:
123 64Kb/Way and 4-Way Associativity;
124 R/W latency: 3 cycles;
125 evmon/parity/share disabled. */
126 l2x0_init(MSM_L2CC_BASE, 0x00068012, 0xfe000000);
127 }
128#endif
129}
130
131static void __init msm7x2x_init_late(void)
132{
133 smd_debugfs_init();
134}
135
136MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF")
137 .atag_offset = 0x100,
138 .map_io = msm7x2x_map_io,
139 .init_irq = msm7x2x_init_irq,
140 .init_machine = msm7x2x_init,
141 .init_late = msm7x2x_init_late,
142 .timer = &msm_timer,
143MACHINE_END
144
145MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")
146 .atag_offset = 0x100,
147 .map_io = msm7x2x_map_io,
148 .init_irq = msm7x2x_init_irq,
149 .init_machine = msm7x2x_init,
150 .init_late = msm7x2x_init_late,
151 .timer = &msm_timer,
152MACHINE_END
153
154MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")
155 .atag_offset = 0x100,
156 .map_io = msm7x2x_map_io,
157 .init_irq = msm7x2x_init_irq,
158 .init_machine = msm7x2x_init,
159 .init_late = msm7x2x_init_late,
160 .timer = &msm_timer,
161MACHINE_END
162
163MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA")
164 .atag_offset = 0x100,
165 .map_io = msm7x2x_map_io,
166 .init_irq = msm7x2x_init_irq,
167 .init_machine = msm7x2x_init,
168 .init_late = msm7x2x_init_late,
169 .timer = &msm_timer,
170MACHINE_END
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c
index a5001378135..effa6f4336c 100644
--- a/arch/arm/mach-msm/board-msm7x30.c
+++ b/arch/arm/mach-msm/board-msm7x30.c
@@ -38,8 +38,7 @@
38#include "devices.h" 38#include "devices.h"
39#include "gpiomux.h" 39#include "gpiomux.h"
40#include "proc_comm.h" 40#include "proc_comm.h"
41 41#include "common.h"
42extern struct sys_timer msm_timer;
43 42
44static void __init msm7x30_fixup(struct tag *tag, char **cmdline, 43static void __init msm7x30_fixup(struct tag *tag, char **cmdline,
45 struct meminfo *mi) 44 struct meminfo *mi)
@@ -132,7 +131,7 @@ MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
132 .init_irq = msm7x30_init_irq, 131 .init_irq = msm7x30_init_irq,
133 .init_machine = msm7x30_init, 132 .init_machine = msm7x30_init,
134 .init_late = msm7x30_init_late, 133 .init_late = msm7x30_init_late,
135 .timer = &msm_timer, 134 .timer = &msm7x30_timer,
136MACHINE_END 135MACHINE_END
137 136
138MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA") 137MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
@@ -143,7 +142,7 @@ MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
143 .init_irq = msm7x30_init_irq, 142 .init_irq = msm7x30_init_irq,
144 .init_machine = msm7x30_init, 143 .init_machine = msm7x30_init,
145 .init_late = msm7x30_init_late, 144 .init_late = msm7x30_init_late,
146 .timer = &msm_timer, 145 .timer = &msm7x30_timer,
147MACHINE_END 146MACHINE_END
148 147
149MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID") 148MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
@@ -154,5 +153,5 @@ MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
154 .init_irq = msm7x30_init_irq, 153 .init_irq = msm7x30_init_irq,
155 .init_machine = msm7x30_init, 154 .init_machine = msm7x30_init,
156 .init_late = msm7x30_init_late, 155 .init_late = msm7x30_init_late,
157 .timer = &msm_timer, 156 .timer = &msm7x30_timer,
158MACHINE_END 157MACHINE_END
diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c
deleted file mode 100644
index 65f4a1daa2e..00000000000
--- a/arch/arm/mach-msm/board-msm8960.c
+++ /dev/null
@@ -1,122 +0,0 @@
1/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 *
17 */
18#include <linux/kernel.h>
19#include <linux/platform_device.h>
20#include <linux/io.h>
21#include <linux/irq.h>
22#include <linux/clkdev.h>
23#include <linux/memblock.h>
24
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27#include <asm/hardware/gic.h>
28#include <asm/setup.h>
29
30#include <mach/board.h>
31#include <mach/msm_iomap.h>
32
33#include "devices.h"
34
35static void __init msm8960_fixup(struct tag *tag, char **cmdline,
36 struct meminfo *mi)
37{
38 for (; tag->hdr.size; tag = tag_next(tag))
39 if (tag->hdr.tag == ATAG_MEM &&
40 tag->u.mem.start == 0x40200000) {
41 tag->u.mem.start = 0x40000000;
42 tag->u.mem.size += SZ_2M;
43 }
44}
45
46static void __init msm8960_reserve(void)
47{
48 memblock_remove(0x40000000, SZ_2M);
49}
50
51static void __init msm8960_map_io(void)
52{
53 msm_map_msm8960_io();
54}
55
56static void __init msm8960_init_irq(void)
57{
58 unsigned int i;
59 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
60 (void *)MSM_QGIC_CPU_BASE);
61
62 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
63 writel(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
64
65 if (machine_is_msm8960_rumi3())
66 writel(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
67
68 /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
69 * as they are configured as level, which does not play nice with
70 * handle_percpu_irq.
71 */
72 for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
73 if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
74 irq_set_handler(i, handle_percpu_irq);
75 }
76}
77
78static struct platform_device *sim_devices[] __initdata = {
79 &msm8960_device_uart_gsbi2,
80};
81
82static struct platform_device *rumi3_devices[] __initdata = {
83 &msm8960_device_uart_gsbi5,
84};
85
86static void __init msm8960_sim_init(void)
87{
88 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
89}
90
91static void __init msm8960_rumi3_init(void)
92{
93 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
94}
95
96static void __init msm8960_init_late(void)
97{
98 smd_debugfs_init();
99}
100
101MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
102 .fixup = msm8960_fixup,
103 .reserve = msm8960_reserve,
104 .map_io = msm8960_map_io,
105 .init_irq = msm8960_init_irq,
106 .timer = &msm_timer,
107 .handle_irq = gic_handle_irq,
108 .init_machine = msm8960_sim_init,
109 .init_late = msm8960_init_late,
110MACHINE_END
111
112MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
113 .fixup = msm8960_fixup,
114 .reserve = msm8960_reserve,
115 .map_io = msm8960_map_io,
116 .init_irq = msm8960_init_irq,
117 .timer = &msm_timer,
118 .handle_irq = gic_handle_irq,
119 .init_machine = msm8960_rumi3_init,
120 .init_late = msm8960_init_late,
121MACHINE_END
122
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
deleted file mode 100644
index e37a724cd1e..00000000000
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ /dev/null
@@ -1,166 +0,0 @@
1/* Copyright (c) 2010, 2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
16#include <linux/irq.h>
17#include <linux/irqdomain.h>
18#include <linux/of.h>
19#include <linux/of_address.h>
20#include <linux/of_irq.h>
21#include <linux/of_platform.h>
22#include <linux/memblock.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <asm/hardware/gic.h>
27#include <asm/setup.h>
28
29#include <mach/board.h>
30#include <mach/msm_iomap.h>
31
32static void __init msm8x60_fixup(struct tag *tag, char **cmdline,
33 struct meminfo *mi)
34{
35 for (; tag->hdr.size; tag = tag_next(tag))
36 if (tag->hdr.tag == ATAG_MEM &&
37 tag->u.mem.start == 0x40200000) {
38 tag->u.mem.start = 0x40000000;
39 tag->u.mem.size += SZ_2M;
40 }
41}
42
43static void __init msm8x60_reserve(void)
44{
45 memblock_remove(0x40000000, SZ_2M);
46}
47
48static void __init msm8x60_map_io(void)
49{
50 msm_map_msm8x60_io();
51}
52
53#ifdef CONFIG_OF
54static struct of_device_id msm_dt_gic_match[] __initdata = {
55 { .compatible = "qcom,msm-8660-qgic", .data = gic_of_init },
56 {}
57};
58#endif
59
60static void __init msm8x60_init_irq(void)
61{
62 if (!of_have_populated_dt())
63 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
64 (void *)MSM_QGIC_CPU_BASE);
65#ifdef CONFIG_OF
66 else
67 of_irq_init(msm_dt_gic_match);
68#endif
69
70 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
71 writel(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
72
73 /* RUMI does not adhere to GIC spec by enabling STIs by default.
74 * Enable/clear is supposed to be RO for STIs, but is RW on RUMI.
75 */
76 if (!machine_is_msm8x60_sim())
77 writel(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
78}
79
80static void __init msm8x60_init(void)
81{
82}
83
84static void __init msm8x60_init_late(void)
85{
86 smd_debugfs_init();
87}
88
89#ifdef CONFIG_OF
90static struct of_dev_auxdata msm_auxdata_lookup[] __initdata = {
91 {}
92};
93
94static void __init msm8x60_dt_init(void)
95{
96 if (of_machine_is_compatible("qcom,msm8660-surf")) {
97 printk(KERN_INFO "Init surf UART registers\n");
98 msm8x60_init_uart12dm();
99 }
100
101 of_platform_populate(NULL, of_default_bus_match_table,
102 msm_auxdata_lookup, NULL);
103}
104
105static const char *msm8x60_fluid_match[] __initdata = {
106 "qcom,msm8660-fluid",
107 "qcom,msm8660-surf",
108 NULL
109};
110#endif /* CONFIG_OF */
111
112MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3")
113 .fixup = msm8x60_fixup,
114 .reserve = msm8x60_reserve,
115 .map_io = msm8x60_map_io,
116 .init_irq = msm8x60_init_irq,
117 .handle_irq = gic_handle_irq,
118 .init_machine = msm8x60_init,
119 .init_late = msm8x60_init_late,
120 .timer = &msm_timer,
121MACHINE_END
122
123MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
124 .fixup = msm8x60_fixup,
125 .reserve = msm8x60_reserve,
126 .map_io = msm8x60_map_io,
127 .init_irq = msm8x60_init_irq,
128 .handle_irq = gic_handle_irq,
129 .init_machine = msm8x60_init,
130 .init_late = msm8x60_init_late,
131 .timer = &msm_timer,
132MACHINE_END
133
134MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
135 .fixup = msm8x60_fixup,
136 .reserve = msm8x60_reserve,
137 .map_io = msm8x60_map_io,
138 .init_irq = msm8x60_init_irq,
139 .handle_irq = gic_handle_irq,
140 .init_machine = msm8x60_init,
141 .init_late = msm8x60_init_late,
142 .timer = &msm_timer,
143MACHINE_END
144
145MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA")
146 .fixup = msm8x60_fixup,
147 .reserve = msm8x60_reserve,
148 .map_io = msm8x60_map_io,
149 .init_irq = msm8x60_init_irq,
150 .handle_irq = gic_handle_irq,
151 .init_machine = msm8x60_init,
152 .init_late = msm8x60_init_late,
153 .timer = &msm_timer,
154MACHINE_END
155
156#ifdef CONFIG_OF
157/* TODO: General device tree support for all MSM. */
158DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
159 .map_io = msm8x60_map_io,
160 .init_irq = msm8x60_init_irq,
161 .init_machine = msm8x60_dt_init,
162 .init_late = msm8x60_init_late,
163 .timer = &msm_timer,
164 .dt_compat = msm8x60_fluid_match,
165MACHINE_END
166#endif /* CONFIG_OF */
diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c
index c8fe0edb976..2448fcf09eb 100644
--- a/arch/arm/mach-msm/board-qsd8x50.c
+++ b/arch/arm/mach-msm/board-qsd8x50.c
@@ -32,14 +32,13 @@
32#include <mach/irqs.h> 32#include <mach/irqs.h>
33#include <mach/sirc.h> 33#include <mach/sirc.h>
34#include <mach/vreg.h> 34#include <mach/vreg.h>
35#include <mach/mmc.h> 35#include <linux/platform_data/mmc-msm_sdcc.h>
36 36
37#include "devices.h" 37#include "devices.h"
38#include "common.h"
38 39
39extern struct sys_timer msm_timer; 40static const resource_size_t qsd8x50_surf_smc91x_base __initconst = 0x70000300;
40 41static const unsigned qsd8x50_surf_smc91x_gpio __initconst = 156;
41static const resource_size_t qsd8x50_surf_smc91x_base __initdata = 0x70000300;
42static const unsigned qsd8x50_surf_smc91x_gpio __initdata = 156;
43 42
44/* Leave smc91x resources empty here, as we'll fill them in 43/* Leave smc91x resources empty here, as we'll fill them in
45 * at run-time: they vary from board to board, and the true 44 * at run-time: they vary from board to board, and the true
@@ -201,7 +200,7 @@ MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
201 .init_irq = qsd8x50_init_irq, 200 .init_irq = qsd8x50_init_irq,
202 .init_machine = qsd8x50_init, 201 .init_machine = qsd8x50_init,
203 .init_late = qsd8x50_init_late, 202 .init_late = qsd8x50_init_late,
204 .timer = &msm_timer, 203 .timer = &qsd8x50_timer,
205MACHINE_END 204MACHINE_END
206 205
207MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5") 206MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
@@ -210,5 +209,5 @@ MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
210 .init_irq = qsd8x50_init_irq, 209 .init_irq = qsd8x50_init_irq,
211 .init_machine = qsd8x50_init, 210 .init_machine = qsd8x50_init,
212 .init_late = qsd8x50_init_late, 211 .init_late = qsd8x50_init_late,
213 .timer = &msm_timer, 212 .timer = &qsd8x50_timer,
214MACHINE_END 213MACHINE_END
diff --git a/arch/arm/mach-msm/board-sapphire.c b/arch/arm/mach-msm/board-sapphire.c
index 2e569ab10ee..b7b0fc7e327 100644
--- a/arch/arm/mach-msm/board-sapphire.c
+++ b/arch/arm/mach-msm/board-sapphire.c
@@ -27,7 +27,6 @@
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <asm/mach/flash.h> 29#include <asm/mach/flash.h>
30#include <mach/system.h>
31#include <mach/vreg.h> 30#include <mach/vreg.h>
32#include <mach/board.h> 31#include <mach/board.h>
33 32
diff --git a/arch/arm/mach-msm/board-trout-mmc.c b/arch/arm/mach-msm/board-trout-mmc.c
index 8650342b749..3723e55819d 100644
--- a/arch/arm/mach-msm/board-trout-mmc.c
+++ b/arch/arm/mach-msm/board-trout-mmc.c
@@ -15,7 +15,7 @@
15 15
16#include <mach/vreg.h> 16#include <mach/vreg.h>
17 17
18#include <mach/mmc.h> 18#include <linux/platform_data/mmc-msm_sdcc.h>
19 19
20#include "devices.h" 20#include "devices.h"
21 21
diff --git a/arch/arm/mach-msm/board-trout-panel.c b/arch/arm/mach-msm/board-trout-panel.c
index 89bf6b42669..f9a5db6d2ce 100644
--- a/arch/arm/mach-msm/board-trout-panel.c
+++ b/arch/arm/mach-msm/board-trout-panel.c
@@ -14,7 +14,7 @@
14#include <asm/mach-types.h> 14#include <asm/mach-types.h>
15#include <asm/system_info.h> 15#include <asm/system_info.h>
16 16
17#include <mach/msm_fb.h> 17#include <linux/platform_data/video-msm_fb.h>
18#include <mach/vreg.h> 18#include <mach/vreg.h>
19 19
20#include "board-trout.h" 20#include "board-trout.h"
diff --git a/arch/arm/mach-msm/board-trout.c b/arch/arm/mach-msm/board-trout.c
index bbe13f12fa0..4ba0800e243 100644
--- a/arch/arm/mach-msm/board-trout.c
+++ b/arch/arm/mach-msm/board-trout.c
@@ -31,6 +31,7 @@
31 31
32#include "devices.h" 32#include "devices.h"
33#include "board-trout.h" 33#include "board-trout.h"
34#include "common.h"
34 35
35extern int trout_init_mmc(unsigned int); 36extern int trout_init_mmc(unsigned int);
36 37
@@ -42,8 +43,6 @@ static struct platform_device *devices[] __initdata = {
42 &msm_device_i2c, 43 &msm_device_i2c,
43}; 44};
44 45
45extern struct sys_timer msm_timer;
46
47static void __init trout_init_early(void) 46static void __init trout_init_early(void)
48{ 47{
49 arch_ioremap_caller = __msm_ioremap_caller; 48 arch_ioremap_caller = __msm_ioremap_caller;
@@ -111,5 +110,5 @@ MACHINE_START(TROUT, "HTC Dream")
111 .init_irq = trout_init_irq, 110 .init_irq = trout_init_irq,
112 .init_machine = trout_init, 111 .init_machine = trout_init,
113 .init_late = trout_init_late, 112 .init_late = trout_init_late,
114 .timer = &msm_timer, 113 .timer = &msm7x01_timer,
115MACHINE_END 114MACHINE_END
diff --git a/arch/arm/mach-msm/clock-pcom.c b/arch/arm/mach-msm/clock-pcom.c
index 63b71131108..a52c970df15 100644
--- a/arch/arm/mach-msm/clock-pcom.c
+++ b/arch/arm/mach-msm/clock-pcom.c
@@ -25,7 +25,7 @@
25/* 25/*
26 * glue for the proc_comm interface 26 * glue for the proc_comm interface
27 */ 27 */
28int pc_clk_enable(unsigned id) 28static int pc_clk_enable(unsigned id)
29{ 29{
30 int rc = msm_proc_comm(PCOM_CLKCTL_RPC_ENABLE, &id, NULL); 30 int rc = msm_proc_comm(PCOM_CLKCTL_RPC_ENABLE, &id, NULL);
31 if (rc < 0) 31 if (rc < 0)
@@ -34,7 +34,7 @@ int pc_clk_enable(unsigned id)
34 return (int)id < 0 ? -EINVAL : 0; 34 return (int)id < 0 ? -EINVAL : 0;
35} 35}
36 36
37void pc_clk_disable(unsigned id) 37static void pc_clk_disable(unsigned id)
38{ 38{
39 msm_proc_comm(PCOM_CLKCTL_RPC_DISABLE, &id, NULL); 39 msm_proc_comm(PCOM_CLKCTL_RPC_DISABLE, &id, NULL);
40} 40}
@@ -54,7 +54,7 @@ int pc_clk_reset(unsigned id, enum clk_reset_action action)
54 return (int)id < 0 ? -EINVAL : 0; 54 return (int)id < 0 ? -EINVAL : 0;
55} 55}
56 56
57int pc_clk_set_rate(unsigned id, unsigned rate) 57static int pc_clk_set_rate(unsigned id, unsigned rate)
58{ 58{
59 /* The rate _might_ be rounded off to the nearest KHz value by the 59 /* The rate _might_ be rounded off to the nearest KHz value by the
60 * remote function. So a return value of 0 doesn't necessarily mean 60 * remote function. So a return value of 0 doesn't necessarily mean
@@ -67,7 +67,7 @@ int pc_clk_set_rate(unsigned id, unsigned rate)
67 return (int)id < 0 ? -EINVAL : 0; 67 return (int)id < 0 ? -EINVAL : 0;
68} 68}
69 69
70int pc_clk_set_min_rate(unsigned id, unsigned rate) 70static int pc_clk_set_min_rate(unsigned id, unsigned rate)
71{ 71{
72 int rc = msm_proc_comm(PCOM_CLKCTL_RPC_MIN_RATE, &id, &rate); 72 int rc = msm_proc_comm(PCOM_CLKCTL_RPC_MIN_RATE, &id, &rate);
73 if (rc < 0) 73 if (rc < 0)
@@ -76,7 +76,7 @@ int pc_clk_set_min_rate(unsigned id, unsigned rate)
76 return (int)id < 0 ? -EINVAL : 0; 76 return (int)id < 0 ? -EINVAL : 0;
77} 77}
78 78
79int pc_clk_set_max_rate(unsigned id, unsigned rate) 79static int pc_clk_set_max_rate(unsigned id, unsigned rate)
80{ 80{
81 int rc = msm_proc_comm(PCOM_CLKCTL_RPC_MAX_RATE, &id, &rate); 81 int rc = msm_proc_comm(PCOM_CLKCTL_RPC_MAX_RATE, &id, &rate);
82 if (rc < 0) 82 if (rc < 0)
@@ -85,7 +85,7 @@ int pc_clk_set_max_rate(unsigned id, unsigned rate)
85 return (int)id < 0 ? -EINVAL : 0; 85 return (int)id < 0 ? -EINVAL : 0;
86} 86}
87 87
88int pc_clk_set_flags(unsigned id, unsigned flags) 88static int pc_clk_set_flags(unsigned id, unsigned flags)
89{ 89{
90 int rc = msm_proc_comm(PCOM_CLKCTL_RPC_SET_FLAGS, &id, &flags); 90 int rc = msm_proc_comm(PCOM_CLKCTL_RPC_SET_FLAGS, &id, &flags);
91 if (rc < 0) 91 if (rc < 0)
@@ -94,7 +94,7 @@ int pc_clk_set_flags(unsigned id, unsigned flags)
94 return (int)id < 0 ? -EINVAL : 0; 94 return (int)id < 0 ? -EINVAL : 0;
95} 95}
96 96
97unsigned pc_clk_get_rate(unsigned id) 97static unsigned pc_clk_get_rate(unsigned id)
98{ 98{
99 if (msm_proc_comm(PCOM_CLKCTL_RPC_RATE, &id, NULL)) 99 if (msm_proc_comm(PCOM_CLKCTL_RPC_RATE, &id, NULL))
100 return 0; 100 return 0;
@@ -102,7 +102,7 @@ unsigned pc_clk_get_rate(unsigned id)
102 return id; 102 return id;
103} 103}
104 104
105unsigned pc_clk_is_enabled(unsigned id) 105static unsigned pc_clk_is_enabled(unsigned id)
106{ 106{
107 if (msm_proc_comm(PCOM_CLKCTL_RPC_ENABLED, &id, NULL)) 107 if (msm_proc_comm(PCOM_CLKCTL_RPC_ENABLED, &id, NULL))
108 return 0; 108 return 0;
@@ -110,7 +110,7 @@ unsigned pc_clk_is_enabled(unsigned id)
110 return id; 110 return id;
111} 111}
112 112
113long pc_clk_round_rate(unsigned id, unsigned rate) 113static long pc_clk_round_rate(unsigned id, unsigned rate)
114{ 114{
115 115
116 /* Not really supported; pc_clk_set_rate() does rounding on it's own. */ 116 /* Not really supported; pc_clk_set_rate() does rounding on it's own. */
diff --git a/arch/arm/mach-msm/common.h b/arch/arm/mach-msm/common.h
new file mode 100644
index 00000000000..633a7159d5f
--- /dev/null
+++ b/arch/arm/mach-msm/common.h
@@ -0,0 +1,32 @@
1/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12#ifndef __MACH_COMMON_H
13#define __MACH_COMMON_H
14
15extern struct sys_timer msm7x01_timer;
16extern struct sys_timer msm7x30_timer;
17extern struct sys_timer msm_dt_timer;
18extern struct sys_timer qsd8x50_timer;
19
20extern void msm_map_common_io(void);
21extern void msm_map_msm7x30_io(void);
22extern void msm_map_msm8x60_io(void);
23extern void msm_map_msm8960_io(void);
24extern void msm_map_qsd8x50_io(void);
25
26extern void __iomem *__msm_ioremap_caller(unsigned long phys_addr, size_t size,
27 unsigned int mtype, void *caller);
28
29extern struct smp_operations msm_smp_ops;
30extern void msm_cpu_die(unsigned int cpu);
31
32#endif
diff --git a/arch/arm/mach-msm/core.h b/arch/arm/mach-msm/core.h
new file mode 100644
index 00000000000..a9bab53dddf
--- /dev/null
+++ b/arch/arm/mach-msm/core.h
@@ -0,0 +1,2 @@
1extern struct smp_operations msm_smp_ops;
2extern void msm_cpu_die(unsigned int cpu);
diff --git a/arch/arm/mach-msm/devices-msm7x00.c b/arch/arm/mach-msm/devices-msm7x00.c
index 993780f490a..f66ee6ea872 100644
--- a/arch/arm/mach-msm/devices-msm7x00.c
+++ b/arch/arm/mach-msm/devices-msm7x00.c
@@ -27,7 +27,7 @@
27 27
28#include "clock.h" 28#include "clock.h"
29#include "clock-pcom.h" 29#include "clock-pcom.h"
30#include <mach/mmc.h> 30#include <linux/platform_data/mmc-msm_sdcc.h>
31 31
32static struct resource resources_uart1[] = { 32static struct resource resources_uart1[] = {
33 { 33 {
diff --git a/arch/arm/mach-msm/devices-msm7x30.c b/arch/arm/mach-msm/devices-msm7x30.c
index 09b4f140382..e90ab5938c5 100644
--- a/arch/arm/mach-msm/devices-msm7x30.c
+++ b/arch/arm/mach-msm/devices-msm7x30.c
@@ -31,7 +31,7 @@
31#include "clock-pcom.h" 31#include "clock-pcom.h"
32#include "clock-7x30.h" 32#include "clock-7x30.h"
33 33
34#include <mach/mmc.h> 34#include <linux/platform_data/mmc-msm_sdcc.h>
35 35
36static struct resource resources_uart2[] = { 36static struct resource resources_uart2[] = {
37 { 37 {
diff --git a/arch/arm/mach-msm/devices-msm8960.c b/arch/arm/mach-msm/devices-msm8960.c
deleted file mode 100644
index d9e1f26475d..00000000000
--- a/arch/arm/mach-msm/devices-msm8960.c
+++ /dev/null
@@ -1,85 +0,0 @@
1/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17
18#include <linux/kernel.h>
19#include <linux/platform_device.h>
20
21#include <linux/dma-mapping.h>
22#include <mach/irqs-8960.h>
23#include <mach/board.h>
24
25#include "devices.h"
26
27#define MSM_GSBI2_PHYS 0x16100000
28#define MSM_UART2DM_PHYS (MSM_GSBI2_PHYS + 0x40000)
29
30#define MSM_GSBI5_PHYS 0x16400000
31#define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000)
32
33static struct resource resources_uart_gsbi2[] = {
34 {
35 .start = GSBI2_UARTDM_IRQ,
36 .end = GSBI2_UARTDM_IRQ,
37 .flags = IORESOURCE_IRQ,
38 },
39 {
40 .start = MSM_UART2DM_PHYS,
41 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
42 .name = "uart_resource",
43 .flags = IORESOURCE_MEM,
44 },
45 {
46 .start = MSM_GSBI2_PHYS,
47 .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1,
48 .name = "gsbi_resource",
49 .flags = IORESOURCE_MEM,
50 },
51};
52
53struct platform_device msm8960_device_uart_gsbi2 = {
54 .name = "msm_serial",
55 .id = 0,
56 .num_resources = ARRAY_SIZE(resources_uart_gsbi2),
57 .resource = resources_uart_gsbi2,
58};
59
60static struct resource resources_uart_gsbi5[] = {
61 {
62 .start = GSBI5_UARTDM_IRQ,
63 .end = GSBI5_UARTDM_IRQ,
64 .flags = IORESOURCE_IRQ,
65 },
66 {
67 .start = MSM_UART5DM_PHYS,
68 .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1,
69 .name = "uart_resource",
70 .flags = IORESOURCE_MEM,
71 },
72 {
73 .start = MSM_GSBI5_PHYS,
74 .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1,
75 .name = "gsbi_resource",
76 .flags = IORESOURCE_MEM,
77 },
78};
79
80struct platform_device msm8960_device_uart_gsbi5 = {
81 .name = "msm_serial",
82 .id = 0,
83 .num_resources = ARRAY_SIZE(resources_uart_gsbi5),
84 .resource = resources_uart_gsbi5,
85};
diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c
index 131633b12a3..4db61d5fe31 100644
--- a/arch/arm/mach-msm/devices-qsd8x50.c
+++ b/arch/arm/mach-msm/devices-qsd8x50.c
@@ -27,7 +27,7 @@
27 27
28#include <asm/mach/flash.h> 28#include <asm/mach/flash.h>
29 29
30#include <mach/mmc.h> 30#include <linux/platform_data/mmc-msm_sdcc.h>
31#include "clock-pcom.h" 31#include "clock-pcom.h"
32 32
33static struct resource resources_uart3[] = { 33static struct resource resources_uart3[] = {
diff --git a/arch/arm/mach-msm/dma.c b/arch/arm/mach-msm/dma.c
index 02cae5e2951..354b91d4c3a 100644
--- a/arch/arm/mach-msm/dma.c
+++ b/arch/arm/mach-msm/dma.c
@@ -223,8 +223,7 @@ static irqreturn_t msm_datamover_irq_handler(int irq, void *dev_id)
223 PRINT_FLOW("msm_datamover_irq_handler id %d, status %x\n", id, ch_status); 223 PRINT_FLOW("msm_datamover_irq_handler id %d, status %x\n", id, ch_status);
224 if ((ch_status & DMOV_STATUS_CMD_PTR_RDY) && !list_empty(&ready_commands[id])) { 224 if ((ch_status & DMOV_STATUS_CMD_PTR_RDY) && !list_empty(&ready_commands[id])) {
225 cmd = list_entry(ready_commands[id].next, typeof(*cmd), list); 225 cmd = list_entry(ready_commands[id].next, typeof(*cmd), list);
226 list_del(&cmd->list); 226 list_move_tail(&cmd->list, &active_commands[id]);
227 list_add_tail(&cmd->list, &active_commands[id]);
228 if (cmd->execute_func) 227 if (cmd->execute_func)
229 cmd->execute_func(cmd); 228 cmd->execute_func(cmd);
230 PRINT_FLOW("msm_datamover_irq_handler id %d, start command\n", id); 229 PRINT_FLOW("msm_datamover_irq_handler id %d, start command\n", id);
diff --git a/arch/arm/mach-msm/hotplug.c b/arch/arm/mach-msm/hotplug.c
index a446fc14221..750446feb44 100644
--- a/arch/arm/mach-msm/hotplug.c
+++ b/arch/arm/mach-msm/hotplug.c
@@ -13,7 +13,7 @@
13#include <asm/cacheflush.h> 13#include <asm/cacheflush.h>
14#include <asm/smp_plat.h> 14#include <asm/smp_plat.h>
15 15
16extern volatile int pen_release; 16#include "common.h"
17 17
18static inline void cpu_enter_lowpower(void) 18static inline void cpu_enter_lowpower(void)
19{ 19{
@@ -57,17 +57,12 @@ static inline void platform_do_lowpower(unsigned int cpu)
57 } 57 }
58} 58}
59 59
60int platform_cpu_kill(unsigned int cpu)
61{
62 return 1;
63}
64
65/* 60/*
66 * platform-specific code to shutdown a CPU 61 * platform-specific code to shutdown a CPU
67 * 62 *
68 * Called with IRQs disabled 63 * Called with IRQs disabled
69 */ 64 */
70void platform_cpu_die(unsigned int cpu) 65void __ref msm_cpu_die(unsigned int cpu)
71{ 66{
72 /* 67 /*
73 * we're ready for shutdown now, so do it 68 * we're ready for shutdown now, so do it
@@ -81,12 +76,3 @@ void platform_cpu_die(unsigned int cpu)
81 */ 76 */
82 cpu_leave_lowpower(); 77 cpu_leave_lowpower();
83} 78}
84
85int platform_cpu_disable(unsigned int cpu)
86{
87 /*
88 * we don't allow CPU 0 to be shutdown (it is still too special
89 * e.g. clock tick interrupts)
90 */
91 return cpu == 0 ? -EPERM : 0;
92}
diff --git a/arch/arm/mach-msm/idle.c b/arch/arm/mach-msm/idle.c
deleted file mode 100644
index 0c9e13c6574..00000000000
--- a/arch/arm/mach-msm/idle.c
+++ /dev/null
@@ -1,49 +0,0 @@
1/* arch/arm/mach-msm/idle.c
2 *
3 * Idle processing for MSM7K - work around bugs with SWFI.
4 *
5 * Copyright (c) 2007 QUALCOMM Incorporated.
6 * Copyright (C) 2007 Google, Inc.
7 *
8 * This software is licensed under the terms of the GNU General Public
9 * License version 2, as published by the Free Software Foundation, and
10 * may be copied, distributed, and modified under those terms.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 */
18
19#include <linux/init.h>
20#include <asm/system.h>
21
22static void msm_idle(void)
23{
24#ifdef CONFIG_MSM7X00A_IDLE
25 asm volatile (
26
27 "mrc p15, 0, r1, c1, c0, 0 /* read current CR */ \n\t"
28 "bic r0, r1, #(1 << 2) /* clear dcache bit */ \n\t"
29 "bic r0, r0, #(1 << 12) /* clear icache bit */ \n\t"
30 "mcr p15, 0, r0, c1, c0, 0 /* disable d/i cache */ \n\t"
31
32 "mov r0, #0 /* prepare wfi value */ \n\t"
33 "mcr p15, 0, r0, c7, c10, 0 /* flush the cache */ \n\t"
34 "mcr p15, 0, r0, c7, c10, 4 /* memory barrier */ \n\t"
35 "mcr p15, 0, r0, c7, c0, 4 /* wait for interrupt */ \n\t"
36
37 "mcr p15, 0, r1, c1, c0, 0 /* restore d/i cache */ \n\t"
38
39 : : : "r0","r1" );
40#endif
41}
42
43static int __init msm_idle_init(void)
44{
45 arm_pm_idle = msm_idle;
46 return 0;
47}
48
49arch_initcall(msm_idle_init);
diff --git a/arch/arm/mach-msm/include/mach/board.h b/arch/arm/mach-msm/include/mach/board.h
index 435f8edfafd..8cebedb1123 100644
--- a/arch/arm/mach-msm/include/mach/board.h
+++ b/arch/arm/mach-msm/include/mach/board.h
@@ -18,31 +18,18 @@
18#define __ASM_ARCH_MSM_BOARD_H 18#define __ASM_ARCH_MSM_BOARD_H
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <mach/mmc.h> 21#include <linux/platform_data/mmc-msm_sdcc.h>
22 22
23/* platform device data structures */ 23/* platform device data structures */
24 24
25struct msm_acpu_clock_platform_data
26{
27 uint32_t acpu_switch_time_us;
28 uint32_t max_speed_delta_khz;
29 uint32_t vdd_switch_time_us;
30 unsigned long power_collapse_khz;
31 unsigned long wait_for_irq_khz;
32};
33
34struct clk_lookup; 25struct clk_lookup;
35 26
36extern struct sys_timer msm_timer;
37
38/* common init routines for use by arch/arm/mach-msm/board-*.c */ 27/* common init routines for use by arch/arm/mach-msm/board-*.c */
39 28
40void __init msm_add_devices(void); 29void __init msm_add_devices(void);
41void __init msm_map_common_io(void);
42void __init msm_init_irq(void); 30void __init msm_init_irq(void);
43void __init msm_init_gpio(void); 31void __init msm_init_gpio(void);
44void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks); 32void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks);
45void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *);
46int __init msm_add_sdcc(unsigned int controller, 33int __init msm_add_sdcc(unsigned int controller,
47 struct msm_mmc_platform_data *plat, 34 struct msm_mmc_platform_data *plat,
48 unsigned int stat_irq, unsigned long stat_irq_flags); 35 unsigned int stat_irq, unsigned long stat_irq_flags);
diff --git a/arch/arm/mach-msm/include/mach/gpio.h b/arch/arm/mach-msm/include/mach/gpio.h
deleted file mode 100644
index 40a8c178f10..00000000000
--- a/arch/arm/mach-msm/include/mach/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/mach-msm/include/mach/mmc.h b/arch/arm/mach-msm/include/mach/mmc.h
deleted file mode 100644
index ffcd9e3a6a7..00000000000
--- a/arch/arm/mach-msm/include/mach/mmc.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * arch/arm/include/asm/mach/mmc.h
3 */
4#ifndef ASMARM_MACH_MMC_H
5#define ASMARM_MACH_MMC_H
6
7#include <linux/mmc/host.h>
8#include <linux/mmc/card.h>
9#include <linux/mmc/sdio_func.h>
10
11struct msm_mmc_gpio {
12 unsigned no;
13 const char *name;
14};
15
16struct msm_mmc_gpio_data {
17 struct msm_mmc_gpio *gpio;
18 u8 size;
19};
20
21struct msm_mmc_platform_data {
22 unsigned int ocr_mask; /* available voltages */
23 u32 (*translate_vdd)(struct device *, unsigned int);
24 unsigned int (*status)(struct device *);
25 int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id);
26 struct msm_mmc_gpio_data *gpio_data;
27 void (*init_card)(struct mmc_card *card);
28};
29
30#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_fb.h b/arch/arm/mach-msm/include/mach/msm_fb.h
deleted file mode 100644
index 1f4fc81b3d8..00000000000
--- a/arch/arm/mach-msm/include/mach/msm_fb.h
+++ /dev/null
@@ -1,147 +0,0 @@
1/* arch/arm/mach-msm/include/mach/msm_fb.h
2 *
3 * Internal shared definitions for various MSM framebuffer parts.
4 *
5 * Copyright (C) 2007 Google Incorporated
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#ifndef _MSM_FB_H_
18#define _MSM_FB_H_
19
20#include <linux/device.h>
21
22struct mddi_info;
23
24struct msm_fb_data {
25 int xres; /* x resolution in pixels */
26 int yres; /* y resolution in pixels */
27 int width; /* disply width in mm */
28 int height; /* display height in mm */
29 unsigned output_format;
30};
31
32struct msmfb_callback {
33 void (*func)(struct msmfb_callback *);
34};
35
36enum {
37 MSM_MDDI_PMDH_INTERFACE,
38 MSM_MDDI_EMDH_INTERFACE,
39 MSM_EBI2_INTERFACE,
40};
41
42#define MSMFB_CAP_PARTIAL_UPDATES (1 << 0)
43
44struct msm_panel_data {
45 /* turns off the fb memory */
46 int (*suspend)(struct msm_panel_data *);
47 /* turns on the fb memory */
48 int (*resume)(struct msm_panel_data *);
49 /* turns off the panel */
50 int (*blank)(struct msm_panel_data *);
51 /* turns on the panel */
52 int (*unblank)(struct msm_panel_data *);
53 void (*wait_vsync)(struct msm_panel_data *);
54 void (*request_vsync)(struct msm_panel_data *, struct msmfb_callback *);
55 void (*clear_vsync)(struct msm_panel_data *);
56 /* from the enum above */
57 unsigned interface_type;
58 /* data to be passed to the fb driver */
59 struct msm_fb_data *fb_data;
60
61 /* capabilities supported by the panel */
62 uint32_t caps;
63};
64
65struct msm_mddi_client_data {
66 void (*suspend)(struct msm_mddi_client_data *);
67 void (*resume)(struct msm_mddi_client_data *);
68 void (*activate_link)(struct msm_mddi_client_data *);
69 void (*remote_write)(struct msm_mddi_client_data *, uint32_t val,
70 uint32_t reg);
71 uint32_t (*remote_read)(struct msm_mddi_client_data *, uint32_t reg);
72 void (*auto_hibernate)(struct msm_mddi_client_data *, int);
73 /* custom data that needs to be passed from the board file to a
74 * particular client */
75 void *private_client_data;
76 struct resource *fb_resource;
77 /* from the list above */
78 unsigned interface_type;
79};
80
81struct msm_mddi_platform_data {
82 unsigned int clk_rate;
83 void (*power_client)(struct msm_mddi_client_data *, int on);
84
85 /* fixup the mfr name, product id */
86 void (*fixup)(uint16_t *mfr_name, uint16_t *product_id);
87
88 struct resource *fb_resource; /*optional*/
89 /* number of clients in the list that follows */
90 int num_clients;
91 /* array of client information of clients */
92 struct {
93 unsigned product_id; /* mfr id in top 16 bits, product id
94 * in lower 16 bits
95 */
96 char *name; /* the device name will be the platform
97 * device name registered for the client,
98 * it should match the name of the associated
99 * driver
100 */
101 unsigned id; /* id for mddi client device node, will also
102 * be used as device id of panel devices, if
103 * the client device will have multiple panels
104 * space must be left here for them
105 */
106 void *client_data; /* required private client data */
107 unsigned int clk_rate; /* optional: if the client requires a
108 * different mddi clk rate
109 */
110 } client_platform_data[];
111};
112
113struct mdp_blit_req;
114struct fb_info;
115struct mdp_device {
116 struct device dev;
117 void (*dma)(struct mdp_device *mpd, uint32_t addr,
118 uint32_t stride, uint32_t w, uint32_t h, uint32_t x,
119 uint32_t y, struct msmfb_callback *callback, int interface);
120 void (*dma_wait)(struct mdp_device *mdp);
121 int (*blit)(struct mdp_device *mdp, struct fb_info *fb,
122 struct mdp_blit_req *req);
123 void (*set_grp_disp)(struct mdp_device *mdp, uint32_t disp_id);
124};
125
126struct class_interface;
127int register_mdp_client(struct class_interface *class_intf);
128
129/**** private client data structs go below this line ***/
130
131struct msm_mddi_bridge_platform_data {
132 /* from board file */
133 int (*init)(struct msm_mddi_bridge_platform_data *,
134 struct msm_mddi_client_data *);
135 int (*uninit)(struct msm_mddi_bridge_platform_data *,
136 struct msm_mddi_client_data *);
137 /* passed to panel for use by the fb driver */
138 int (*blank)(struct msm_mddi_bridge_platform_data *,
139 struct msm_mddi_client_data *);
140 int (*unblank)(struct msm_mddi_bridge_platform_data *,
141 struct msm_mddi_client_data *);
142 struct msm_fb_data fb_data;
143};
144
145
146
147#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h b/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
index 6c4046c2129..67dc0e98b95 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
@@ -105,11 +105,4 @@
105#define MSM_AD5_PHYS 0xAC000000 105#define MSM_AD5_PHYS 0xAC000000
106#define MSM_AD5_SIZE (SZ_1M*13) 106#define MSM_AD5_SIZE (SZ_1M*13)
107 107
108#ifndef __ASSEMBLY__
109
110extern void __iomem *__msm_ioremap_caller(unsigned long phys_addr, size_t size,
111 unsigned int mtype, void *caller);
112
113#endif
114
115#endif 108#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h b/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
index f944fe65a65..198202c267c 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
@@ -100,8 +100,4 @@
100#define MSM_HSUSB_PHYS 0xA3600000 100#define MSM_HSUSB_PHYS 0xA3600000
101#define MSM_HSUSB_SIZE SZ_1K 101#define MSM_HSUSB_SIZE SZ_1K
102 102
103#ifndef __ASSEMBLY__
104extern void msm_map_msm7x30_io(void);
105#endif
106
107#endif 103#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8960.h b/arch/arm/mach-msm/include/mach/msm_iomap-8960.h
index a1752c0284f..9819a556aca 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-8960.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-8960.h
@@ -46,12 +46,8 @@
46#define MSM8960_TMR0_SIZE SZ_4K 46#define MSM8960_TMR0_SIZE SZ_4K
47 47
48#ifdef CONFIG_DEBUG_MSM8960_UART 48#ifdef CONFIG_DEBUG_MSM8960_UART
49#define MSM_DEBUG_UART_BASE 0xE1040000 49#define MSM_DEBUG_UART_BASE 0xF0040000
50#define MSM_DEBUG_UART_PHYS 0x16440000 50#define MSM_DEBUG_UART_PHYS 0x16440000
51#endif 51#endif
52 52
53#ifndef __ASSEMBLY__
54extern void msm_map_msm8960_io(void);
55#endif
56
57#endif 53#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h b/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
index da77cc1d545..0faa894729b 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
@@ -122,8 +122,4 @@
122#define MSM_SDC4_PHYS 0xA0600000 122#define MSM_SDC4_PHYS 0xA0600000
123#define MSM_SDC4_SIZE SZ_4K 123#define MSM_SDC4_SIZE SZ_4K
124 124
125#ifndef __ASSEMBLY__
126extern void msm_map_qsd8x50_io(void);
127#endif
128
129#endif 125#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h b/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
index 5aed57dc808..199372e62de 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
@@ -41,21 +41,10 @@
41#define MSM8X60_QGIC_CPU_PHYS 0x02081000 41#define MSM8X60_QGIC_CPU_PHYS 0x02081000
42#define MSM8X60_QGIC_CPU_SIZE SZ_4K 42#define MSM8X60_QGIC_CPU_SIZE SZ_4K
43 43
44#define MSM_ACC_BASE IOMEM(0xF0002000)
45#define MSM_ACC_PHYS 0x02001000
46#define MSM_ACC_SIZE SZ_4K
47
48#define MSM_GCC_BASE IOMEM(0xF0003000)
49#define MSM_GCC_PHYS 0x02082000
50#define MSM_GCC_SIZE SZ_4K
51
52#define MSM_TLMM_BASE IOMEM(0xF0004000) 44#define MSM_TLMM_BASE IOMEM(0xF0004000)
53#define MSM_TLMM_PHYS 0x00800000 45#define MSM_TLMM_PHYS 0x00800000
54#define MSM_TLMM_SIZE SZ_16K 46#define MSM_TLMM_SIZE SZ_16K
55 47
56#define MSM_SHARED_RAM_BASE IOMEM(0xF0100000)
57#define MSM_SHARED_RAM_SIZE SZ_1M
58
59#define MSM8X60_TMR_PHYS 0x02000000 48#define MSM8X60_TMR_PHYS 0x02000000
60#define MSM8X60_TMR_SIZE SZ_4K 49#define MSM8X60_TMR_SIZE SZ_4K
61 50
@@ -63,12 +52,8 @@
63#define MSM8X60_TMR0_SIZE SZ_4K 52#define MSM8X60_TMR0_SIZE SZ_4K
64 53
65#ifdef CONFIG_DEBUG_MSM8660_UART 54#ifdef CONFIG_DEBUG_MSM8660_UART
66#define MSM_DEBUG_UART_BASE 0xE1040000 55#define MSM_DEBUG_UART_BASE 0xF0040000
67#define MSM_DEBUG_UART_PHYS 0x19C40000 56#define MSM_DEBUG_UART_PHYS 0x19C40000
68#endif 57#endif
69 58
70#ifndef __ASSEMBLY__
71extern void msm_map_msm8x60_io(void);
72#endif
73
74#endif 59#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap.h b/arch/arm/mach-msm/include/mach/msm_iomap.h
index 00afdfb8c38..2ab7cf0919b 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap.h
@@ -41,12 +41,11 @@
41#include "msm_iomap-7x30.h" 41#include "msm_iomap-7x30.h"
42#elif defined(CONFIG_ARCH_QSD8X50) 42#elif defined(CONFIG_ARCH_QSD8X50)
43#include "msm_iomap-8x50.h" 43#include "msm_iomap-8x50.h"
44#elif defined(CONFIG_ARCH_MSM8X60)
45#include "msm_iomap-8x60.h"
46#else 44#else
47#include "msm_iomap-7x00.h" 45#include "msm_iomap-7x00.h"
48#endif 46#endif
49 47
48#include "msm_iomap-8x60.h"
50#include "msm_iomap-8960.h" 49#include "msm_iomap-8960.h"
51 50
52#define MSM_DEBUG_UART_SIZE SZ_4K 51#define MSM_DEBUG_UART_SIZE SZ_4K
diff --git a/arch/arm/mach-msm/include/mach/system.h b/arch/arm/mach-msm/include/mach/system.h
deleted file mode 100644
index f5fb2ec87ff..00000000000
--- a/arch/arm/mach-msm/include/mach/system.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/* arch/arm/mach-msm/include/mach/system.h
2 *
3 * Copyright (C) 2007 Google, Inc.
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16/* low level hardware reset hook -- for example, hitting the
17 * PSHOLD line on the PMIC to hard reset the system
18 */
19extern void (*msm_hw_reset_hook)(void);
diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
index a1e7b116885..123ef9cbce1 100644
--- a/arch/arm/mach-msm/io.c
+++ b/arch/arm/mach-msm/io.c
@@ -29,30 +29,32 @@
29 29
30#include <mach/board.h> 30#include <mach/board.h>
31 31
32#define MSM_CHIP_DEVICE(name, chip) { \ 32#include "common.h"
33
34#define MSM_CHIP_DEVICE_TYPE(name, chip, mem_type) { \
33 .virtual = (unsigned long) MSM_##name##_BASE, \ 35 .virtual = (unsigned long) MSM_##name##_BASE, \
34 .pfn = __phys_to_pfn(chip##_##name##_PHYS), \ 36 .pfn = __phys_to_pfn(chip##_##name##_PHYS), \
35 .length = chip##_##name##_SIZE, \ 37 .length = chip##_##name##_SIZE, \
36 .type = MT_DEVICE_NONSHARED, \ 38 .type = mem_type, \
37 } 39 }
38 40
41#define MSM_DEVICE_TYPE(name, mem_type) \
42 MSM_CHIP_DEVICE_TYPE(name, MSM, mem_type)
43#define MSM_CHIP_DEVICE(name, chip) \
44 MSM_CHIP_DEVICE_TYPE(name, chip, MT_DEVICE)
39#define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM) 45#define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM)
40 46
41#if defined(CONFIG_ARCH_MSM7X00A) || defined(CONFIG_ARCH_MSM7X27) \ 47#if defined(CONFIG_ARCH_MSM7X00A)
42 || defined(CONFIG_ARCH_MSM7X25)
43static struct map_desc msm_io_desc[] __initdata = { 48static struct map_desc msm_io_desc[] __initdata = {
44 MSM_DEVICE(VIC), 49 MSM_DEVICE_TYPE(VIC, MT_DEVICE_NONSHARED),
45 MSM_CHIP_DEVICE(CSR, MSM7X00), 50 MSM_CHIP_DEVICE_TYPE(CSR, MSM7X00, MT_DEVICE_NONSHARED),
46 MSM_DEVICE(DMOV), 51 MSM_DEVICE_TYPE(DMOV, MT_DEVICE_NONSHARED),
47 MSM_CHIP_DEVICE(GPIO1, MSM7X00), 52 MSM_CHIP_DEVICE_TYPE(GPIO1, MSM7X00, MT_DEVICE_NONSHARED),
48 MSM_CHIP_DEVICE(GPIO2, MSM7X00), 53 MSM_CHIP_DEVICE_TYPE(GPIO2, MSM7X00, MT_DEVICE_NONSHARED),
49 MSM_DEVICE(CLK_CTL), 54 MSM_DEVICE_TYPE(CLK_CTL, MT_DEVICE_NONSHARED),
50#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \ 55#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
51 defined(CONFIG_DEBUG_MSM_UART3) 56 defined(CONFIG_DEBUG_MSM_UART3)
52 MSM_DEVICE(DEBUG_UART), 57 MSM_DEVICE_TYPE(DEBUG_UART, MT_DEVICE_NONSHARED),
53#endif
54#ifdef CONFIG_ARCH_MSM7X30
55 MSM_DEVICE(GCC),
56#endif 58#endif
57 { 59 {
58 .virtual = (unsigned long) MSM_SHARED_RAM_BASE, 60 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
@@ -109,8 +111,6 @@ static struct map_desc msm8x60_io_desc[] __initdata = {
109 MSM_CHIP_DEVICE(QGIC_CPU, MSM8X60), 111 MSM_CHIP_DEVICE(QGIC_CPU, MSM8X60),
110 MSM_CHIP_DEVICE(TMR, MSM8X60), 112 MSM_CHIP_DEVICE(TMR, MSM8X60),
111 MSM_CHIP_DEVICE(TMR0, MSM8X60), 113 MSM_CHIP_DEVICE(TMR0, MSM8X60),
112 MSM_DEVICE(ACC),
113 MSM_DEVICE(GCC),
114#ifdef CONFIG_DEBUG_MSM8660_UART 114#ifdef CONFIG_DEBUG_MSM8660_UART
115 MSM_DEVICE(DEBUG_UART), 115 MSM_DEVICE(DEBUG_UART),
116#endif 116#endif
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
index e012dc8391c..7ed69b69c87 100644
--- a/arch/arm/mach-msm/platsmp.c
+++ b/arch/arm/mach-msm/platsmp.c
@@ -22,23 +22,14 @@
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/smp_plat.h> 23#include <asm/smp_plat.h>
24 24
25#include <mach/msm_iomap.h>
26
27#include "scm-boot.h" 25#include "scm-boot.h"
26#include "common.h"
28 27
29#define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x15A0 28#define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x15A0
30#define SCSS_CPU1CORE_RESET 0xD80 29#define SCSS_CPU1CORE_RESET 0xD80
31#define SCSS_DBG_STATUS_CORE_PWRDUP 0xE64 30#define SCSS_DBG_STATUS_CORE_PWRDUP 0xE64
32 31
33/* Mask for edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
34#define GIC_PPI_EDGE_MASK 0xFFFFD7FF
35
36extern void msm_secondary_startup(void); 32extern void msm_secondary_startup(void);
37/*
38 * control for which core is the next to come out of the secondary
39 * boot "holding pen".
40 */
41volatile int pen_release = -1;
42 33
43static DEFINE_SPINLOCK(boot_lock); 34static DEFINE_SPINLOCK(boot_lock);
44 35
@@ -48,11 +39,8 @@ static inline int get_core_count(void)
48 return ((read_cpuid_id() >> 4) & 3) + 1; 39 return ((read_cpuid_id() >> 4) & 3) + 1;
49} 40}
50 41
51void __cpuinit platform_secondary_init(unsigned int cpu) 42static void __cpuinit msm_secondary_init(unsigned int cpu)
52{ 43{
53 /* Configure edge-triggered PPIs */
54 writel(GIC_PPI_EDGE_MASK, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
55
56 /* 44 /*
57 * if any interrupts are already enabled for the primary 45 * if any interrupts are already enabled for the primary
58 * core (e.g. timer irq), then they will not have been enabled 46 * core (e.g. timer irq), then they will not have been enabled
@@ -93,7 +81,7 @@ static __cpuinit void prepare_cold_cpu(unsigned int cpu)
93 "address\n"); 81 "address\n");
94} 82}
95 83
96int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 84static int __cpuinit msm_boot_secondary(unsigned int cpu, struct task_struct *idle)
97{ 85{
98 unsigned long timeout; 86 unsigned long timeout;
99 static int cold_boot_done; 87 static int cold_boot_done;
@@ -153,7 +141,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
153 * does not support the ARM SCU, so just set the possible cpu mask to 141 * does not support the ARM SCU, so just set the possible cpu mask to
154 * NR_CPUS. 142 * NR_CPUS.
155 */ 143 */
156void __init smp_init_cpus(void) 144static void __init msm_smp_init_cpus(void)
157{ 145{
158 unsigned int i, ncores = get_core_count(); 146 unsigned int i, ncores = get_core_count();
159 147
@@ -169,6 +157,16 @@ void __init smp_init_cpus(void)
169 set_smp_cross_call(gic_raise_softirq); 157 set_smp_cross_call(gic_raise_softirq);
170} 158}
171 159
172void __init platform_smp_prepare_cpus(unsigned int max_cpus) 160static void __init msm_smp_prepare_cpus(unsigned int max_cpus)
173{ 161{
174} 162}
163
164struct smp_operations msm_smp_ops __initdata = {
165 .smp_init_cpus = msm_smp_init_cpus,
166 .smp_prepare_cpus = msm_smp_prepare_cpus,
167 .smp_secondary_init = msm_secondary_init,
168 .smp_boot_secondary = msm_boot_secondary,
169#ifdef CONFIG_HOTPLUG_CPU
170 .cpu_die = msm_cpu_die,
171#endif
172};
diff --git a/arch/arm/mach-msm/proc_comm.c b/arch/arm/mach-msm/proc_comm.c
index 9980dc736e7..8f1eecd8818 100644
--- a/arch/arm/mach-msm/proc_comm.c
+++ b/arch/arm/mach-msm/proc_comm.c
@@ -19,7 +19,6 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <mach/msm_iomap.h> 21#include <mach/msm_iomap.h>
22#include <mach/system.h>
23 22
24#include "proc_comm.h" 23#include "proc_comm.h"
25 24
diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index 657be73297d..c5a2eddc6cd 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -30,7 +30,6 @@
30#include <linux/delay.h> 30#include <linux/delay.h>
31 31
32#include <mach/msm_smd.h> 32#include <mach/msm_smd.h>
33#include <mach/system.h>
34 33
35#include "smd_private.h" 34#include "smd_private.h"
36#include "proc_comm.h" 35#include "proc_comm.h"
@@ -39,8 +38,6 @@
39#define CONFIG_QDSP6 1 38#define CONFIG_QDSP6 1
40#endif 39#endif
41 40
42void (*msm_hw_reset_hook)(void);
43
44#define MODULE_NAME "msm_smd" 41#define MODULE_NAME "msm_smd"
45 42
46enum { 43enum {
@@ -52,13 +49,14 @@ static int msm_smd_debug_mask;
52 49
53struct shared_info { 50struct shared_info {
54 int ready; 51 int ready;
55 unsigned state; 52 void __iomem *state;
56}; 53};
57 54
58static unsigned dummy_state[SMSM_STATE_COUNT]; 55static unsigned dummy_state[SMSM_STATE_COUNT];
59 56
60static struct shared_info smd_info = { 57static struct shared_info smd_info = {
61 .state = (unsigned) &dummy_state, 58 /* FIXME: not a real __iomem pointer */
59 .state = &dummy_state,
62}; 60};
63 61
64module_param_named(debug_mask, msm_smd_debug_mask, 62module_param_named(debug_mask, msm_smd_debug_mask,
@@ -101,10 +99,6 @@ static void handle_modem_crash(void)
101 pr_err("ARM9 has CRASHED\n"); 99 pr_err("ARM9 has CRASHED\n");
102 smd_diag(); 100 smd_diag();
103 101
104 /* hard reboot if possible */
105 if (msm_hw_reset_hook)
106 msm_hw_reset_hook();
107
108 /* in this case the modem or watchdog should reboot us */ 102 /* in this case the modem or watchdog should reboot us */
109 for (;;) 103 for (;;)
110 ; 104 ;
@@ -796,22 +790,22 @@ void *smem_alloc(unsigned id, unsigned size)
796 return smem_find(id, size); 790 return smem_find(id, size);
797} 791}
798 792
799void *smem_item(unsigned id, unsigned *size) 793void __iomem *smem_item(unsigned id, unsigned *size)
800{ 794{
801 struct smem_shared *shared = (void *) MSM_SHARED_RAM_BASE; 795 struct smem_shared *shared = (void *) MSM_SHARED_RAM_BASE;
802 struct smem_heap_entry *toc = shared->heap_toc; 796 struct smem_heap_entry *toc = shared->heap_toc;
803 797
804 if (id >= SMEM_NUM_ITEMS) 798 if (id >= SMEM_NUM_ITEMS)
805 return 0; 799 return NULL;
806 800
807 if (toc[id].allocated) { 801 if (toc[id].allocated) {
808 *size = toc[id].size; 802 *size = toc[id].size;
809 return (void *) (MSM_SHARED_RAM_BASE + toc[id].offset); 803 return (MSM_SHARED_RAM_BASE + toc[id].offset);
810 } else { 804 } else {
811 *size = 0; 805 *size = 0;
812 } 806 }
813 807
814 return 0; 808 return NULL;
815} 809}
816 810
817void *smem_find(unsigned id, unsigned size_in) 811void *smem_find(unsigned id, unsigned size_in)
@@ -857,7 +851,7 @@ static irqreturn_t smsm_irq_handler(int irq, void *data)
857int smsm_change_state(enum smsm_state_item item, 851int smsm_change_state(enum smsm_state_item item,
858 uint32_t clear_mask, uint32_t set_mask) 852 uint32_t clear_mask, uint32_t set_mask)
859{ 853{
860 unsigned long addr = smd_info.state + item * 4; 854 void __iomem *addr = smd_info.state + item * 4;
861 unsigned long flags; 855 unsigned long flags;
862 unsigned state; 856 unsigned state;
863 857
@@ -943,10 +937,10 @@ int smd_core_init(void)
943 /* wait for essential items to be initialized */ 937 /* wait for essential items to be initialized */
944 for (;;) { 938 for (;;) {
945 unsigned size; 939 unsigned size;
946 void *state; 940 void __iomem *state;
947 state = smem_item(SMEM_SMSM_SHARED_STATE, &size); 941 state = smem_item(SMEM_SMSM_SHARED_STATE, &size);
948 if (size == SMSM_V1_SIZE || size == SMSM_V2_SIZE) { 942 if (size == SMSM_V1_SIZE || size == SMSM_V2_SIZE) {
949 smd_info.state = (unsigned)state; 943 smd_info.state = state;
950 break; 944 break;
951 } 945 }
952 } 946 }
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
index 81280825493..476549a8a70 100644
--- a/arch/arm/mach-msm/timer.c
+++ b/arch/arm/mach-msm/timer.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * 2 *
3 * Copyright (C) 2007 Google, Inc. 3 * Copyright (C) 2007 Google, Inc.
4 * Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved. 4 * Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
5 * 5 *
6 * This software is licensed under the terms of the GNU General Public 6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and 7 * License version 2, as published by the Free Software Foundation, and
@@ -20,15 +20,16 @@
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/of.h>
24#include <linux/of_address.h>
25#include <linux/of_irq.h>
23 26
24#include <asm/mach/time.h> 27#include <asm/mach/time.h>
25#include <asm/hardware/gic.h> 28#include <asm/hardware/gic.h>
26#include <asm/localtimer.h> 29#include <asm/localtimer.h>
27#include <asm/sched_clock.h> 30#include <asm/sched_clock.h>
28 31
29#include <mach/msm_iomap.h> 32#include "common.h"
30#include <mach/cpu.h>
31#include <mach/board.h>
32 33
33#define TIMER_MATCH_VAL 0x0000 34#define TIMER_MATCH_VAL 0x0000
34#define TIMER_COUNT_VAL 0x0004 35#define TIMER_COUNT_VAL 0x0004
@@ -36,7 +37,6 @@
36#define TIMER_ENABLE_CLR_ON_MATCH_EN BIT(1) 37#define TIMER_ENABLE_CLR_ON_MATCH_EN BIT(1)
37#define TIMER_ENABLE_EN BIT(0) 38#define TIMER_ENABLE_EN BIT(0)
38#define TIMER_CLEAR 0x000C 39#define TIMER_CLEAR 0x000C
39#define DGT_CLK_CTL 0x0034
40#define DGT_CLK_CTL_DIV_4 0x3 40#define DGT_CLK_CTL_DIV_4 0x3
41 41
42#define GPT_HZ 32768 42#define GPT_HZ 32768
@@ -101,7 +101,7 @@ static struct clock_event_device msm_clockevent = {
101 101
102static union { 102static union {
103 struct clock_event_device *evt; 103 struct clock_event_device *evt;
104 struct clock_event_device __percpu **percpu_evt; 104 struct clock_event_device * __percpu *percpu_evt;
105} msm_evt; 105} msm_evt;
106 106
107static void __iomem *source_base; 107static void __iomem *source_base;
@@ -151,7 +151,7 @@ static int __cpuinit msm_local_timer_setup(struct clock_event_device *evt)
151 151
152 *__this_cpu_ptr(msm_evt.percpu_evt) = evt; 152 *__this_cpu_ptr(msm_evt.percpu_evt) = evt;
153 clockevents_register_device(evt); 153 clockevents_register_device(evt);
154 enable_percpu_irq(evt->irq, 0); 154 enable_percpu_irq(evt->irq, IRQ_TYPE_EDGE_RISING);
155 return 0; 155 return 0;
156} 156}
157 157
@@ -172,44 +172,21 @@ static notrace u32 msm_sched_clock_read(void)
172 return msm_clocksource.read(&msm_clocksource); 172 return msm_clocksource.read(&msm_clocksource);
173} 173}
174 174
175static void __init msm_timer_init(void) 175static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq,
176 bool percpu)
176{ 177{
177 struct clock_event_device *ce = &msm_clockevent; 178 struct clock_event_device *ce = &msm_clockevent;
178 struct clocksource *cs = &msm_clocksource; 179 struct clocksource *cs = &msm_clocksource;
179 int res; 180 int res;
180 u32 dgt_hz;
181
182 if (cpu_is_msm7x01()) {
183 event_base = MSM_CSR_BASE;
184 source_base = MSM_CSR_BASE + 0x10;
185 dgt_hz = 19200000 >> MSM_DGT_SHIFT; /* 600 KHz */
186 cs->read = msm_read_timer_count_shift;
187 cs->mask = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT));
188 } else if (cpu_is_msm7x30()) {
189 event_base = MSM_CSR_BASE + 0x04;
190 source_base = MSM_CSR_BASE + 0x24;
191 dgt_hz = 24576000 / 4;
192 } else if (cpu_is_qsd8x50()) {
193 event_base = MSM_CSR_BASE;
194 source_base = MSM_CSR_BASE + 0x10;
195 dgt_hz = 19200000 / 4;
196 } else if (cpu_is_msm8x60() || cpu_is_msm8960()) {
197 event_base = MSM_TMR_BASE + 0x04;
198 /* Use CPU0's timer as the global clock source. */
199 source_base = MSM_TMR0_BASE + 0x24;
200 dgt_hz = 27000000 / 4;
201 writel_relaxed(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL);
202 } else
203 BUG();
204 181
205 writel_relaxed(0, event_base + TIMER_ENABLE); 182 writel_relaxed(0, event_base + TIMER_ENABLE);
206 writel_relaxed(0, event_base + TIMER_CLEAR); 183 writel_relaxed(0, event_base + TIMER_CLEAR);
207 writel_relaxed(~0, event_base + TIMER_MATCH_VAL); 184 writel_relaxed(~0, event_base + TIMER_MATCH_VAL);
208 ce->cpumask = cpumask_of(0); 185 ce->cpumask = cpumask_of(0);
186 ce->irq = irq;
209 187
210 ce->irq = INT_GP_TIMER_EXP;
211 clockevents_config_and_register(ce, GPT_HZ, 4, 0xffffffff); 188 clockevents_config_and_register(ce, GPT_HZ, 4, 0xffffffff);
212 if (cpu_is_msm8x60() || cpu_is_msm8960()) { 189 if (percpu) {
213 msm_evt.percpu_evt = alloc_percpu(struct clock_event_device *); 190 msm_evt.percpu_evt = alloc_percpu(struct clock_event_device *);
214 if (!msm_evt.percpu_evt) { 191 if (!msm_evt.percpu_evt) {
215 pr_err("memory allocation failed for %s\n", ce->name); 192 pr_err("memory allocation failed for %s\n", ce->name);
@@ -219,7 +196,7 @@ static void __init msm_timer_init(void)
219 res = request_percpu_irq(ce->irq, msm_timer_interrupt, 196 res = request_percpu_irq(ce->irq, msm_timer_interrupt,
220 ce->name, msm_evt.percpu_evt); 197 ce->name, msm_evt.percpu_evt);
221 if (!res) { 198 if (!res) {
222 enable_percpu_irq(ce->irq, 0); 199 enable_percpu_irq(ce->irq, IRQ_TYPE_EDGE_RISING);
223#ifdef CONFIG_LOCAL_TIMERS 200#ifdef CONFIG_LOCAL_TIMERS
224 local_timer_register(&msm_local_timer_ops); 201 local_timer_register(&msm_local_timer_ops);
225#endif 202#endif
@@ -238,10 +215,143 @@ err:
238 res = clocksource_register_hz(cs, dgt_hz); 215 res = clocksource_register_hz(cs, dgt_hz);
239 if (res) 216 if (res)
240 pr_err("clocksource_register failed\n"); 217 pr_err("clocksource_register failed\n");
241 setup_sched_clock(msm_sched_clock_read, 218 setup_sched_clock(msm_sched_clock_read, sched_bits, dgt_hz);
242 cpu_is_msm7x01() ? 32 - MSM_DGT_SHIFT : 32, dgt_hz);
243} 219}
244 220
245struct sys_timer msm_timer = { 221#ifdef CONFIG_OF
246 .init = msm_timer_init 222static const struct of_device_id msm_dgt_match[] __initconst = {
223 { .compatible = "qcom,msm-dgt" },
224 { },
225};
226
227static const struct of_device_id msm_gpt_match[] __initconst = {
228 { .compatible = "qcom,msm-gpt" },
229 { },
230};
231
232static void __init msm_dt_timer_init(void)
233{
234 struct device_node *np;
235 u32 freq;
236 int irq;
237 struct resource res;
238 u32 percpu_offset;
239 void __iomem *dgt_clk_ctl;
240
241 np = of_find_matching_node(NULL, msm_gpt_match);
242 if (!np) {
243 pr_err("Can't find GPT DT node\n");
244 return;
245 }
246
247 event_base = of_iomap(np, 0);
248 if (!event_base) {
249 pr_err("Failed to map event base\n");
250 return;
251 }
252
253 irq = irq_of_parse_and_map(np, 0);
254 if (irq <= 0) {
255 pr_err("Can't get irq\n");
256 return;
257 }
258 of_node_put(np);
259
260 np = of_find_matching_node(NULL, msm_dgt_match);
261 if (!np) {
262 pr_err("Can't find DGT DT node\n");
263 return;
264 }
265
266 if (of_property_read_u32(np, "cpu-offset", &percpu_offset))
267 percpu_offset = 0;
268
269 if (of_address_to_resource(np, 0, &res)) {
270 pr_err("Failed to parse DGT resource\n");
271 return;
272 }
273
274 source_base = ioremap(res.start + percpu_offset, resource_size(&res));
275 if (!source_base) {
276 pr_err("Failed to map source base\n");
277 return;
278 }
279
280 if (!of_address_to_resource(np, 1, &res)) {
281 dgt_clk_ctl = ioremap(res.start + percpu_offset,
282 resource_size(&res));
283 if (!dgt_clk_ctl) {
284 pr_err("Failed to map DGT control base\n");
285 return;
286 }
287 writel_relaxed(DGT_CLK_CTL_DIV_4, dgt_clk_ctl);
288 iounmap(dgt_clk_ctl);
289 }
290
291 if (of_property_read_u32(np, "clock-frequency", &freq)) {
292 pr_err("Unknown frequency\n");
293 return;
294 }
295 of_node_put(np);
296
297 msm_timer_init(freq, 32, irq, !!percpu_offset);
298}
299
300struct sys_timer msm_dt_timer = {
301 .init = msm_dt_timer_init
302};
303#endif
304
305static int __init msm_timer_map(phys_addr_t event, phys_addr_t source)
306{
307 event_base = ioremap(event, SZ_64);
308 if (!event_base) {
309 pr_err("Failed to map event base\n");
310 return 1;
311 }
312 source_base = ioremap(source, SZ_64);
313 if (!source_base) {
314 pr_err("Failed to map source base\n");
315 return 1;
316 }
317 return 0;
318}
319
320static void __init msm7x01_timer_init(void)
321{
322 struct clocksource *cs = &msm_clocksource;
323
324 if (msm_timer_map(0xc0100000, 0xc0100010))
325 return;
326 cs->read = msm_read_timer_count_shift;
327 cs->mask = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT));
328 /* 600 KHz */
329 msm_timer_init(19200000 >> MSM_DGT_SHIFT, 32 - MSM_DGT_SHIFT, 7,
330 false);
331}
332
333struct sys_timer msm7x01_timer = {
334 .init = msm7x01_timer_init
335};
336
337static void __init msm7x30_timer_init(void)
338{
339 if (msm_timer_map(0xc0100004, 0xc0100024))
340 return;
341 msm_timer_init(24576000 / 4, 32, 1, false);
342}
343
344struct sys_timer msm7x30_timer = {
345 .init = msm7x30_timer_init
346};
347
348static void __init qsd8x50_timer_init(void)
349{
350 if (msm_timer_map(0xAC100000, 0xAC100010))
351 return;
352 msm_timer_init(19200000 / 4, 32, 7, false);
353}
354
355struct sys_timer qsd8x50_timer = {
356 .init = qsd8x50_timer_init
247}; 357};
diff --git a/arch/arm/mach-mv78xx0/addr-map.c b/arch/arm/mach-mv78xx0/addr-map.c
index a9bc84180d2..26e9876b50e 100644
--- a/arch/arm/mach-mv78xx0/addr-map.c
+++ b/arch/arm/mach-mv78xx0/addr-map.c
@@ -13,6 +13,7 @@
13#include <linux/mbus.h> 13#include <linux/mbus.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <plat/addr-map.h> 15#include <plat/addr-map.h>
16#include <mach/mv78xx0.h>
16#include "common.h" 17#include "common.h"
17 18
18/* 19/*
@@ -47,13 +48,13 @@ static void __init __iomem *win_cfg_base(const struct orion_addr_map_cfg *cfg, i
47 * so we don't need to take that into account here. 48 * so we don't need to take that into account here.
48 */ 49 */
49 50
50 return (void __iomem *)((win < 8) ? WIN0_OFF(win) : WIN8_OFF(win)); 51 return (win < 8) ? WIN0_OFF(win) : WIN8_OFF(win);
51} 52}
52 53
53/* 54/*
54 * Description of the windows needed by the platform code 55 * Description of the windows needed by the platform code
55 */ 56 */
56static struct __initdata orion_addr_map_cfg addr_map_cfg = { 57static struct orion_addr_map_cfg addr_map_cfg __initdata = {
57 .num_wins = 14, 58 .num_wins = 14,
58 .remappable_wins = 8, 59 .remappable_wins = 8,
59 .win_cfg_base = win_cfg_base, 60 .win_cfg_base = win_cfg_base,
@@ -71,17 +72,17 @@ void __init mv78xx0_setup_cpu_mbus(void)
71 */ 72 */
72 if (mv78xx0_core_index() == 0) 73 if (mv78xx0_core_index() == 0)
73 orion_setup_cpu_mbus_target(&addr_map_cfg, 74 orion_setup_cpu_mbus_target(&addr_map_cfg,
74 DDR_WINDOW_CPU0_BASE); 75 (void __iomem *) DDR_WINDOW_CPU0_BASE);
75 else 76 else
76 orion_setup_cpu_mbus_target(&addr_map_cfg, 77 orion_setup_cpu_mbus_target(&addr_map_cfg,
77 DDR_WINDOW_CPU1_BASE); 78 (void __iomem *) DDR_WINDOW_CPU1_BASE);
78} 79}
79 80
80void __init mv78xx0_setup_pcie_io_win(int window, u32 base, u32 size, 81void __init mv78xx0_setup_pcie_io_win(int window, u32 base, u32 size,
81 int maj, int min) 82 int maj, int min)
82{ 83{
83 orion_setup_cpu_win(&addr_map_cfg, window, base, size, 84 orion_setup_cpu_win(&addr_map_cfg, window, base, size,
84 TARGET_PCIE(maj), ATTR_PCIE_IO(min), -1); 85 TARGET_PCIE(maj), ATTR_PCIE_IO(min), 0);
85} 86}
86 87
87void __init mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size, 88void __init mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size,
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 3057f7d4329..d0cb4857b4b 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -20,8 +20,8 @@
20#include <mach/mv78xx0.h> 20#include <mach/mv78xx0.h>
21#include <mach/bridge-regs.h> 21#include <mach/bridge-regs.h>
22#include <plat/cache-feroceon-l2.h> 22#include <plat/cache-feroceon-l2.h>
23#include <plat/ehci-orion.h> 23#include <linux/platform_data/usb-ehci-orion.h>
24#include <plat/orion_nand.h> 24#include <linux/platform_data/mtd-orion_nand.h>
25#include <plat/time.h> 25#include <plat/time.h>
26#include <plat/common.h> 26#include <plat/common.h>
27#include <plat/addr-map.h> 27#include <plat/addr-map.h>
@@ -130,17 +130,12 @@ static int get_tclk(void)
130 ****************************************************************************/ 130 ****************************************************************************/
131static struct map_desc mv78xx0_io_desc[] __initdata = { 131static struct map_desc mv78xx0_io_desc[] __initdata = {
132 { 132 {
133 .virtual = MV78XX0_CORE_REGS_VIRT_BASE, 133 .virtual = (unsigned long) MV78XX0_CORE_REGS_VIRT_BASE,
134 .pfn = 0, 134 .pfn = 0,
135 .length = MV78XX0_CORE_REGS_SIZE, 135 .length = MV78XX0_CORE_REGS_SIZE,
136 .type = MT_DEVICE, 136 .type = MT_DEVICE,
137 }, { 137 }, {
138 .virtual = MV78XX0_PCIE_IO_VIRT_BASE(0), 138 .virtual = (unsigned long) MV78XX0_REGS_VIRT_BASE,
139 .pfn = __phys_to_pfn(MV78XX0_PCIE_IO_PHYS_BASE(0)),
140 .length = MV78XX0_PCIE_IO_SIZE * 8,
141 .type = MT_DEVICE,
142 }, {
143 .virtual = MV78XX0_REGS_VIRT_BASE,
144 .pfn = __phys_to_pfn(MV78XX0_REGS_PHYS_BASE), 139 .pfn = __phys_to_pfn(MV78XX0_REGS_PHYS_BASE),
145 .length = MV78XX0_REGS_SIZE, 140 .length = MV78XX0_REGS_SIZE,
146 .type = MT_DEVICE, 141 .type = MT_DEVICE,
@@ -341,7 +336,7 @@ void __init mv78xx0_init_early(void)
341 orion_time_set_base(TIMER_VIRT_BASE); 336 orion_time_set_base(TIMER_VIRT_BASE);
342} 337}
343 338
344static void mv78xx0_timer_init(void) 339static void __init_refok mv78xx0_timer_init(void)
345{ 340{
346 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR, 341 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
347 IRQ_MV78XX0_TIMER_1, get_tclk()); 342 IRQ_MV78XX0_TIMER_1, get_tclk());
diff --git a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
index eb187e0e059..5f03484584d 100644
--- a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
+++ b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
@@ -11,18 +11,18 @@
11 11
12#include <mach/mv78xx0.h> 12#include <mach/mv78xx0.h>
13 13
14#define CPU_CONTROL (BRIDGE_VIRT_BASE | 0x0104) 14#define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104)
15#define L2_WRITETHROUGH 0x00020000 15#define L2_WRITETHROUGH 0x00020000
16 16
17#define RSTOUTn_MASK (BRIDGE_VIRT_BASE | 0x0108) 17#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
18#define SOFT_RESET_OUT_EN 0x00000004 18#define SOFT_RESET_OUT_EN 0x00000004
19 19
20#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c) 20#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
21#define SOFT_RESET 0x00000001 21#define SOFT_RESET 0x00000001
22 22
23#define BRIDGE_INT_TIMER1_CLR (~0x0004) 23#define BRIDGE_INT_TIMER1_CLR (~0x0004)
24 24
25#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200) 25#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE + 0x0200)
26#define IRQ_CAUSE_ERR_OFF 0x0000 26#define IRQ_CAUSE_ERR_OFF 0x0000
27#define IRQ_CAUSE_LOW_OFF 0x0004 27#define IRQ_CAUSE_LOW_OFF 0x0004
28#define IRQ_CAUSE_HIGH_OFF 0x0008 28#define IRQ_CAUSE_HIGH_OFF 0x0008
@@ -30,7 +30,7 @@
30#define IRQ_MASK_LOW_OFF 0x0010 30#define IRQ_MASK_LOW_OFF 0x0010
31#define IRQ_MASK_HIGH_OFF 0x0014 31#define IRQ_MASK_HIGH_OFF 0x0014
32 32
33#define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0300) 33#define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE + 0x0300)
34#define TIMER_PHYS_BASE (BRIDGE_PHYS_BASE | 0x0300) 34#define TIMER_PHYS_BASE (BRIDGE_PHYS_BASE + 0x0300)
35 35
36#endif 36#endif
diff --git a/arch/arm/mach-mv78xx0/include/mach/io.h b/arch/arm/mach-mv78xx0/include/mach/io.h
deleted file mode 100644
index c7d9d00d8fc..00000000000
--- a/arch/arm/mach-mv78xx0/include/mach/io.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * arch/arm/mach-mv78xx0/include/mach/io.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_IO_H
10#define __ASM_ARCH_IO_H
11
12#include "mv78xx0.h"
13
14#define IO_SPACE_LIMIT 0xffffffff
15
16static inline void __iomem *__io(unsigned long addr)
17{
18 return (void __iomem *)((addr - MV78XX0_PCIE_IO_PHYS_BASE(0))
19 + MV78XX0_PCIE_IO_VIRT_BASE(0));
20}
21
22#define __io(a) __io(a)
23
24#endif
diff --git a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
index e807c4c52a0..46200a183cf 100644
--- a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
+++ b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
@@ -29,28 +29,27 @@
29 * 29 *
30 * virt phys size 30 * virt phys size
31 * fe400000 f102x000 16K core-specific peripheral registers 31 * fe400000 f102x000 16K core-specific peripheral registers
32 * fe700000 f0800000 1M PCIe #0 I/O space 32 * fee00000 f0800000 64K PCIe #0 I/O space
33 * fe800000 f0900000 1M PCIe #1 I/O space 33 * fee10000 f0900000 64K PCIe #1 I/O space
34 * fe900000 f0a00000 1M PCIe #2 I/O space 34 * fee20000 f0a00000 64K PCIe #2 I/O space
35 * fea00000 f0b00000 1M PCIe #3 I/O space 35 * fee30000 f0b00000 64K PCIe #3 I/O space
36 * feb00000 f0c00000 1M PCIe #4 I/O space 36 * fee40000 f0c00000 64K PCIe #4 I/O space
37 * fec00000 f0d00000 1M PCIe #5 I/O space 37 * fee50000 f0d00000 64K PCIe #5 I/O space
38 * fed00000 f0e00000 1M PCIe #6 I/O space 38 * fee60000 f0e00000 64K PCIe #6 I/O space
39 * fee00000 f0f00000 1M PCIe #7 I/O space 39 * fee70000 f0f00000 64K PCIe #7 I/O space
40 * fef00000 f1000000 1M on-chip peripheral registers 40 * fd000000 f1000000 1M on-chip peripheral registers
41 */ 41 */
42#define MV78XX0_CORE0_REGS_PHYS_BASE 0xf1020000 42#define MV78XX0_CORE0_REGS_PHYS_BASE 0xf1020000
43#define MV78XX0_CORE1_REGS_PHYS_BASE 0xf1024000 43#define MV78XX0_CORE1_REGS_PHYS_BASE 0xf1024000
44#define MV78XX0_CORE_REGS_VIRT_BASE 0xfe400000 44#define MV78XX0_CORE_REGS_VIRT_BASE IOMEM(0xfe400000)
45#define MV78XX0_CORE_REGS_PHYS_BASE 0xfe400000 45#define MV78XX0_CORE_REGS_PHYS_BASE 0xfe400000
46#define MV78XX0_CORE_REGS_SIZE SZ_16K 46#define MV78XX0_CORE_REGS_SIZE SZ_16K
47 47
48#define MV78XX0_PCIE_IO_PHYS_BASE(i) (0xf0800000 + ((i) << 20)) 48#define MV78XX0_PCIE_IO_PHYS_BASE(i) (0xf0800000 + ((i) << 20))
49#define MV78XX0_PCIE_IO_VIRT_BASE(i) (0xfe700000 + ((i) << 20))
50#define MV78XX0_PCIE_IO_SIZE SZ_1M 49#define MV78XX0_PCIE_IO_SIZE SZ_1M
51 50
52#define MV78XX0_REGS_PHYS_BASE 0xf1000000 51#define MV78XX0_REGS_PHYS_BASE 0xf1000000
53#define MV78XX0_REGS_VIRT_BASE 0xfef00000 52#define MV78XX0_REGS_VIRT_BASE IOMEM(0xfd000000)
54#define MV78XX0_REGS_SIZE SZ_1M 53#define MV78XX0_REGS_SIZE SZ_1M
55 54
56#define MV78XX0_PCIE_MEM_PHYS_BASE 0xc0000000 55#define MV78XX0_PCIE_MEM_PHYS_BASE 0xc0000000
@@ -65,47 +64,47 @@
65/* 64/*
66 * Register Map 65 * Register Map
67 */ 66 */
68#define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x00000) 67#define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x00000)
69#define DDR_WINDOW_CPU0_BASE (DDR_VIRT_BASE | 0x1500) 68#define DDR_WINDOW_CPU0_BASE (DDR_VIRT_BASE + 0x1500)
70#define DDR_WINDOW_CPU1_BASE (DDR_VIRT_BASE | 0x1570) 69#define DDR_WINDOW_CPU1_BASE (DDR_VIRT_BASE + 0x1570)
71 70
72#define DEV_BUS_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0x10000) 71#define DEV_BUS_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x10000)
73#define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x10000) 72#define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x10000)
74#define SAMPLE_AT_RESET_LOW (DEV_BUS_VIRT_BASE | 0x0030) 73#define SAMPLE_AT_RESET_LOW (DEV_BUS_VIRT_BASE + 0x0030)
75#define SAMPLE_AT_RESET_HIGH (DEV_BUS_VIRT_BASE | 0x0034) 74#define SAMPLE_AT_RESET_HIGH (DEV_BUS_VIRT_BASE + 0x0034)
76#define GPIO_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x0100) 75#define GPIO_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x0100)
77#define I2C_0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1000) 76#define I2C_0_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x1000)
78#define I2C_1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1100) 77#define I2C_1_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x1100)
79#define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2000) 78#define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x2000)
80#define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2000) 79#define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x2000)
81#define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2100) 80#define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x2100)
82#define UART1_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2100) 81#define UART1_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x2100)
83#define UART2_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2200) 82#define UART2_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x2200)
84#define UART2_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2200) 83#define UART2_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x2200)
85#define UART3_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2300) 84#define UART3_PHYS_BASE (DEV_BUS_PHYS_BASE + 0x2300)
86#define UART3_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2300) 85#define UART3_VIRT_BASE (DEV_BUS_VIRT_BASE + 0x2300)
87 86
88#define GE10_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0x30000) 87#define GE10_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x30000)
89#define GE11_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0x34000) 88#define GE11_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x34000)
90 89
91#define PCIE00_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x40000) 90#define PCIE00_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x40000)
92#define PCIE01_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x44000) 91#define PCIE01_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x44000)
93#define PCIE02_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x48000) 92#define PCIE02_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x48000)
94#define PCIE03_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x4c000) 93#define PCIE03_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x4c000)
95 94
96#define USB0_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0x50000) 95#define USB0_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x50000)
97#define USB1_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0x51000) 96#define USB1_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x51000)
98#define USB2_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0x52000) 97#define USB2_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x52000)
99 98
100#define GE00_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0x70000) 99#define GE00_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x70000)
101#define GE01_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0x74000) 100#define GE01_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x74000)
102 101
103#define PCIE10_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x80000) 102#define PCIE10_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x80000)
104#define PCIE11_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x84000) 103#define PCIE11_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x84000)
105#define PCIE12_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x88000) 104#define PCIE12_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x88000)
106#define PCIE13_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x8c000) 105#define PCIE13_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x8c000)
107 106
108#define SATA_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0xa0000) 107#define SATA_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0xa0000)
109 108
110/* 109/*
111 * Supported devices and revisions. 110 * Supported devices and revisions.
diff --git a/arch/arm/mach-mv78xx0/irq.c b/arch/arm/mach-mv78xx0/irq.c
index eff9a750bbe..32073444024 100644
--- a/arch/arm/mach-mv78xx0/irq.c
+++ b/arch/arm/mach-mv78xx0/irq.c
@@ -10,7 +10,9 @@
10#include <linux/gpio.h> 10#include <linux/gpio.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/irq.h> 12#include <linux/irq.h>
13#include <linux/io.h>
13#include <mach/bridge-regs.h> 14#include <mach/bridge-regs.h>
15#include <plat/orion-gpio.h>
14#include <plat/irq.h> 16#include <plat/irq.h>
15#include "common.h" 17#include "common.h"
16 18
@@ -23,16 +25,16 @@ static int __initdata gpio0_irqs[4] = {
23 25
24void __init mv78xx0_init_irq(void) 26void __init mv78xx0_init_irq(void)
25{ 27{
26 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF)); 28 orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF);
27 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)); 29 orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF);
28 orion_irq_init(64, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF)); 30 orion_irq_init(64, IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF);
29 31
30 /* 32 /*
31 * Initialize gpiolib for GPIOs 0-31. (The GPIO interrupt mask 33 * Initialize gpiolib for GPIOs 0-31. (The GPIO interrupt mask
32 * registers for core #1 are at an offset of 0x18 from those of 34 * registers for core #1 are at an offset of 0x18 from those of
33 * core #0.) 35 * core #0.)
34 */ 36 */
35 orion_gpio_init(NULL, 0, 32, (void __iomem *)GPIO_VIRT_BASE, 37 orion_gpio_init(NULL, 0, 32, GPIO_VIRT_BASE,
36 mv78xx0_core_index() ? 0x18 : 0, 38 mv78xx0_core_index() ? 0x18 : 0,
37 IRQ_MV78XX0_GPIO_START, gpio0_irqs); 39 IRQ_MV78XX0_GPIO_START, gpio0_irqs);
38} 40}
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c
index 2e56e86b6d6..a9a154a646d 100644
--- a/arch/arm/mach-mv78xx0/pcie.c
+++ b/arch/arm/mach-mv78xx0/pcie.c
@@ -15,6 +15,7 @@
15#include <asm/mach/pci.h> 15#include <asm/mach/pci.h>
16#include <plat/pcie.h> 16#include <plat/pcie.h>
17#include <plat/addr-map.h> 17#include <plat/addr-map.h>
18#include <mach/mv78xx0.h>
18#include "common.h" 19#include "common.h"
19 20
20struct pcie_port { 21struct pcie_port {
@@ -23,119 +24,73 @@ struct pcie_port {
23 u8 root_bus_nr; 24 u8 root_bus_nr;
24 void __iomem *base; 25 void __iomem *base;
25 spinlock_t conf_lock; 26 spinlock_t conf_lock;
26 char io_space_name[16];
27 char mem_space_name[16]; 27 char mem_space_name[16];
28 struct resource res[2]; 28 struct resource res;
29}; 29};
30 30
31static struct pcie_port pcie_port[8]; 31static struct pcie_port pcie_port[8];
32static int num_pcie_ports; 32static int num_pcie_ports;
33static struct resource pcie_io_space; 33static struct resource pcie_io_space;
34static struct resource pcie_mem_space;
35
36 34
37void __init mv78xx0_pcie_id(u32 *dev, u32 *rev) 35void __init mv78xx0_pcie_id(u32 *dev, u32 *rev)
38{ 36{
39 *dev = orion_pcie_dev_id((void __iomem *)PCIE00_VIRT_BASE); 37 *dev = orion_pcie_dev_id(PCIE00_VIRT_BASE);
40 *rev = orion_pcie_rev((void __iomem *)PCIE00_VIRT_BASE); 38 *rev = orion_pcie_rev(PCIE00_VIRT_BASE);
41} 39}
42 40
41u32 pcie_port_size[8] = {
42 0,
43 0x30000000,
44 0x10000000,
45 0x10000000,
46 0x08000000,
47 0x08000000,
48 0x08000000,
49 0x04000000,
50};
51
43static void __init mv78xx0_pcie_preinit(void) 52static void __init mv78xx0_pcie_preinit(void)
44{ 53{
45 int i; 54 int i;
46 u32 size_each; 55 u32 size_each;
47 u32 start; 56 u32 start;
48 int win; 57 int win = 0;
49 58
50 pcie_io_space.name = "PCIe I/O Space"; 59 pcie_io_space.name = "PCIe I/O Space";
51 pcie_io_space.start = MV78XX0_PCIE_IO_PHYS_BASE(0); 60 pcie_io_space.start = MV78XX0_PCIE_IO_PHYS_BASE(0);
52 pcie_io_space.end = 61 pcie_io_space.end =
53 MV78XX0_PCIE_IO_PHYS_BASE(0) + MV78XX0_PCIE_IO_SIZE * 8 - 1; 62 MV78XX0_PCIE_IO_PHYS_BASE(0) + MV78XX0_PCIE_IO_SIZE * 8 - 1;
54 pcie_io_space.flags = IORESOURCE_IO; 63 pcie_io_space.flags = IORESOURCE_MEM;
55 if (request_resource(&iomem_resource, &pcie_io_space)) 64 if (request_resource(&iomem_resource, &pcie_io_space))
56 panic("can't allocate PCIe I/O space"); 65 panic("can't allocate PCIe I/O space");
57 66
58 pcie_mem_space.name = "PCIe MEM Space"; 67 if (num_pcie_ports > 7)
59 pcie_mem_space.start = MV78XX0_PCIE_MEM_PHYS_BASE; 68 panic("invalid number of PCIe ports");
60 pcie_mem_space.end = 69
61 MV78XX0_PCIE_MEM_PHYS_BASE + MV78XX0_PCIE_MEM_SIZE - 1; 70 size_each = pcie_port_size[num_pcie_ports];
62 pcie_mem_space.flags = IORESOURCE_MEM;
63 if (request_resource(&iomem_resource, &pcie_mem_space))
64 panic("can't allocate PCIe MEM space");
65 71
72 start = MV78XX0_PCIE_MEM_PHYS_BASE;
66 for (i = 0; i < num_pcie_ports; i++) { 73 for (i = 0; i < num_pcie_ports; i++) {
67 struct pcie_port *pp = pcie_port + i; 74 struct pcie_port *pp = pcie_port + i;
68 75
69 snprintf(pp->io_space_name, sizeof(pp->io_space_name),
70 "PCIe %d.%d I/O", pp->maj, pp->min);
71 pp->io_space_name[sizeof(pp->io_space_name) - 1] = 0;
72 pp->res[0].name = pp->io_space_name;
73 pp->res[0].start = MV78XX0_PCIE_IO_PHYS_BASE(i);
74 pp->res[0].end = pp->res[0].start + MV78XX0_PCIE_IO_SIZE - 1;
75 pp->res[0].flags = IORESOURCE_IO;
76
77 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), 76 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name),
78 "PCIe %d.%d MEM", pp->maj, pp->min); 77 "PCIe %d.%d MEM", pp->maj, pp->min);
79 pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0; 78 pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0;
80 pp->res[1].name = pp->mem_space_name; 79 pp->res.name = pp->mem_space_name;
81 pp->res[1].flags = IORESOURCE_MEM; 80 pp->res.flags = IORESOURCE_MEM;
82 } 81 pp->res.start = start;
83 82 pp->res.end = start + size_each - 1;
84 switch (num_pcie_ports) {
85 case 0:
86 size_each = 0;
87 break;
88
89 case 1:
90 size_each = 0x30000000;
91 break;
92
93 case 2 ... 3:
94 size_each = 0x10000000;
95 break;
96
97 case 4 ... 6:
98 size_each = 0x08000000;
99 break;
100
101 case 7:
102 size_each = 0x04000000;
103 break;
104
105 default:
106 panic("invalid number of PCIe ports");
107 }
108
109 start = MV78XX0_PCIE_MEM_PHYS_BASE;
110 for (i = 0; i < num_pcie_ports; i++) {
111 struct pcie_port *pp = pcie_port + i;
112
113 pp->res[1].start = start;
114 pp->res[1].end = start + size_each - 1;
115 start += size_each; 83 start += size_each;
116 }
117
118 for (i = 0; i < num_pcie_ports; i++) {
119 struct pcie_port *pp = pcie_port + i;
120 84
121 if (request_resource(&pcie_io_space, &pp->res[0])) 85 if (request_resource(&iomem_resource, &pp->res))
122 panic("can't allocate PCIe I/O sub-space");
123
124 if (request_resource(&pcie_mem_space, &pp->res[1]))
125 panic("can't allocate PCIe MEM sub-space"); 86 panic("can't allocate PCIe MEM sub-space");
126 }
127 87
128 win = 0; 88 mv78xx0_setup_pcie_mem_win(win + i + 8, pp->res.start,
129 for (i = 0; i < num_pcie_ports; i++) { 89 resource_size(&pp->res),
130 struct pcie_port *pp = pcie_port + i; 90 pp->maj, pp->min);
131 91
132 mv78xx0_setup_pcie_io_win(win++, pp->res[0].start, 92 mv78xx0_setup_pcie_io_win(win + i, i * SZ_64K, SZ_64K,
133 resource_size(&pp->res[0]),
134 pp->maj, pp->min); 93 pp->maj, pp->min);
135
136 mv78xx0_setup_pcie_mem_win(win++, pp->res[1].start,
137 resource_size(&pp->res[1]),
138 pp->maj, pp->min);
139 } 94 }
140} 95}
141 96
@@ -156,8 +111,9 @@ static int __init mv78xx0_pcie_setup(int nr, struct pci_sys_data *sys)
156 orion_pcie_set_local_bus_nr(pp->base, sys->busnr); 111 orion_pcie_set_local_bus_nr(pp->base, sys->busnr);
157 orion_pcie_setup(pp->base); 112 orion_pcie_setup(pp->base);
158 113
159 pci_add_resource_offset(&sys->resources, &pp->res[0], sys->io_offset); 114 pci_ioremap_io(nr * SZ_64K, MV78XX0_PCIE_IO_PHYS_BASE(nr));
160 pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset); 115
116 pci_add_resource_offset(&sys->resources, &pp->res, sys->mem_offset);
161 117
162 return 1; 118 return 1;
163} 119}
@@ -267,11 +223,11 @@ static struct hw_pci mv78xx0_pci __initdata = {
267 .map_irq = mv78xx0_pcie_map_irq, 223 .map_irq = mv78xx0_pcie_map_irq,
268}; 224};
269 225
270static void __init add_pcie_port(int maj, int min, unsigned long base) 226static void __init add_pcie_port(int maj, int min, void __iomem *base)
271{ 227{
272 printk(KERN_INFO "MV78xx0 PCIe port %d.%d: ", maj, min); 228 printk(KERN_INFO "MV78xx0 PCIe port %d.%d: ", maj, min);
273 229
274 if (orion_pcie_link_up((void __iomem *)base)) { 230 if (orion_pcie_link_up(base)) {
275 struct pcie_port *pp = &pcie_port[num_pcie_ports++]; 231 struct pcie_port *pp = &pcie_port[num_pcie_ports++];
276 232
277 printk("link up\n"); 233 printk("link up\n");
@@ -279,9 +235,9 @@ static void __init add_pcie_port(int maj, int min, unsigned long base)
279 pp->maj = maj; 235 pp->maj = maj;
280 pp->min = min; 236 pp->min = min;
281 pp->root_bus_nr = -1; 237 pp->root_bus_nr = -1;
282 pp->base = (void __iomem *)base; 238 pp->base = base;
283 spin_lock_init(&pp->conf_lock); 239 spin_lock_init(&pp->conf_lock);
284 memset(pp->res, 0, sizeof(pp->res)); 240 memset(&pp->res, 0, sizeof(pp->res));
285 } else { 241 } else {
286 printk("link down, ignoring\n"); 242 printk("link down, ignoring\n");
287 } 243 }
@@ -293,7 +249,7 @@ void __init mv78xx0_pcie_init(int init_port0, int init_port1)
293 249
294 if (init_port0) { 250 if (init_port0) {
295 add_pcie_port(0, 0, PCIE00_VIRT_BASE); 251 add_pcie_port(0, 0, PCIE00_VIRT_BASE);
296 if (!orion_pcie_x4_mode((void __iomem *)PCIE00_VIRT_BASE)) { 252 if (!orion_pcie_x4_mode(PCIE00_VIRT_BASE)) {
297 add_pcie_port(0, 1, PCIE01_VIRT_BASE); 253 add_pcie_port(0, 1, PCIE01_VIRT_BASE);
298 add_pcie_port(0, 2, PCIE02_VIRT_BASE); 254 add_pcie_port(0, 2, PCIE02_VIRT_BASE);
299 add_pcie_port(0, 3, PCIE03_VIRT_BASE); 255 add_pcie_port(0, 3, PCIE03_VIRT_BASE);
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index caa2c5e734f..416d46ef7eb 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -1,15 +1,39 @@
1config ARCH_MVEBU
2 bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7
3 select CLKSRC_MMIO
4 select COMMON_CLK
5 select GENERIC_CLOCKEVENTS
6 select GENERIC_IRQ_CHIP
7 select IRQ_DOMAIN
8 select MULTI_IRQ_HANDLER
9 select PINCTRL
10 select PLAT_ORION
11 select SPARSE_IRQ
12
1if ARCH_MVEBU 13if ARCH_MVEBU
2 14
3menu "Marvell SOC with device tree" 15menu "Marvell SOC with device tree"
4 16
5config MACH_ARMADA_370_XP 17config MACH_ARMADA_370_XP
6 bool "Marvell Armada 370 and Aramada XP boards" 18 bool
7 select ARMADA_370_XP_TIMER 19 select ARMADA_370_XP_TIMER
8 select CPU_V7 20 select CPU_V7
21
22config MACH_ARMADA_370
23 bool "Marvell Armada 370 boards"
24 select MACH_ARMADA_370_XP
25 select PINCTRL_ARMADA_370
9 help 26 help
27 Say 'Y' here if you want your kernel to support boards based
28 on the Marvell Armada 370 SoC with device tree.
10 29
11 Say 'Y' here if you want your kernel to support boards based on 30config MACH_ARMADA_XP
12 Marvell Armada 370 or Armada XP with device tree. 31 bool "Marvell Armada XP boards"
32 select MACH_ARMADA_370_XP
33 select PINCTRL_ARMADA_XP
34 help
35 Say 'Y' here if you want your kernel to support boards based
36 on the Marvell Armada XP SoC with device tree.
13 37
14endmenu 38endmenu
15 39
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index e61d2b8fdf5..57f996b6aa0 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -1,2 +1,5 @@
1ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
2 -I$(srctree)/arch/arm/plat-orion/include
3
1obj-y += system-controller.o 4obj-y += system-controller.o
2obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o irq-armada-370-xp.o 5obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o irq-armada-370-xp.o addr-map.o
diff --git a/arch/arm/mach-mvebu/Makefile.boot b/arch/arm/mach-mvebu/Makefile.boot
deleted file mode 100644
index 2579a2fc233..00000000000
--- a/arch/arm/mach-mvebu/Makefile.boot
+++ /dev/null
@@ -1,3 +0,0 @@
1zreladdr-y := 0x00008000
2dtb-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-db.dtb
3dtb-$(CONFIG_MACH_ARMADA_370_XP) += armada-xp-db.dtb
diff --git a/arch/arm/mach-mvebu/addr-map.c b/arch/arm/mach-mvebu/addr-map.c
new file mode 100644
index 00000000000..fe454a4430b
--- /dev/null
+++ b/arch/arm/mach-mvebu/addr-map.c
@@ -0,0 +1,134 @@
1/*
2 * Address map functions for Marvell 370 / XP SoCs
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/mbus.h>
16#include <linux/io.h>
17#include <linux/of.h>
18#include <linux/of_address.h>
19#include <plat/addr-map.h>
20
21/*
22 * Generic Address Decode Windows bit settings
23 */
24#define ARMADA_XP_TARGET_DEV_BUS 1
25#define ARMADA_XP_ATTR_DEV_BOOTROM 0x1D
26#define ARMADA_XP_TARGET_ETH1 3
27#define ARMADA_XP_TARGET_PCIE_0_2 4
28#define ARMADA_XP_TARGET_ETH0 7
29#define ARMADA_XP_TARGET_PCIE_1_3 8
30
31#define ARMADA_370_TARGET_DEV_BUS 1
32#define ARMADA_370_ATTR_DEV_BOOTROM 0x1D
33#define ARMADA_370_TARGET_PCIE_0 4
34#define ARMADA_370_TARGET_PCIE_1 8
35
36#define ARMADA_WINDOW_8_PLUS_OFFSET 0x90
37#define ARMADA_SDRAM_ADDR_DECODING_OFFSET 0x180
38
39static const struct __initdata orion_addr_map_info
40armada_xp_addr_map_info[] = {
41 /*
42 * Window for the BootROM, needed for SMP on Armada XP
43 */
44 { 0, 0xfff00000, SZ_1M, ARMADA_XP_TARGET_DEV_BUS,
45 ARMADA_XP_ATTR_DEV_BOOTROM, -1 },
46 /* End marker */
47 { -1, 0, 0, 0, 0, 0 },
48};
49
50static const struct __initdata orion_addr_map_info
51armada_370_addr_map_info[] = {
52 /* End marker */
53 { -1, 0, 0, 0, 0, 0 },
54};
55
56static struct of_device_id of_addr_decoding_controller_table[] = {
57 { .compatible = "marvell,armada-addr-decoding-controller" },
58 { /* end of list */ },
59};
60
61static void __iomem *
62armada_cfg_base(const struct orion_addr_map_cfg *cfg, int win)
63{
64 unsigned int offset;
65
66 /* The register layout is a bit annoying and the below code
67 * tries to cope with it.
68 * - At offset 0x0, there are the registers for the first 8
69 * windows, with 4 registers of 32 bits per window (ctrl,
70 * base, remap low, remap high)
71 * - Then at offset 0x80, there is a hole of 0x10 bytes for
72 * the internal registers base address and internal units
73 * sync barrier register.
74 * - Then at offset 0x90, there the registers for 12
75 * windows, with only 2 registers of 32 bits per window
76 * (ctrl, base).
77 */
78 if (win < 8)
79 offset = (win << 4);
80 else
81 offset = ARMADA_WINDOW_8_PLUS_OFFSET + (win << 3);
82
83 return cfg->bridge_virt_base + offset;
84}
85
86static struct __initdata orion_addr_map_cfg addr_map_cfg = {
87 .num_wins = 20,
88 .remappable_wins = 8,
89 .win_cfg_base = armada_cfg_base,
90};
91
92static int __init armada_setup_cpu_mbus(void)
93{
94 struct device_node *np;
95 void __iomem *mbus_unit_addr_decoding_base;
96 void __iomem *sdram_addr_decoding_base;
97
98 np = of_find_matching_node(NULL, of_addr_decoding_controller_table);
99 if (!np)
100 return -ENODEV;
101
102 mbus_unit_addr_decoding_base = of_iomap(np, 0);
103 BUG_ON(!mbus_unit_addr_decoding_base);
104
105 sdram_addr_decoding_base =
106 mbus_unit_addr_decoding_base +
107 ARMADA_SDRAM_ADDR_DECODING_OFFSET;
108
109 addr_map_cfg.bridge_virt_base = mbus_unit_addr_decoding_base;
110
111 /*
112 * Disable, clear and configure windows.
113 */
114 if (of_machine_is_compatible("marvell,armadaxp"))
115 orion_config_wins(&addr_map_cfg, armada_xp_addr_map_info);
116 else if (of_machine_is_compatible("marvell,armada370"))
117 orion_config_wins(&addr_map_cfg, armada_370_addr_map_info);
118 else {
119 pr_err("Unsupported SoC\n");
120 return -EINVAL;
121 }
122
123 /*
124 * Setup MBUS dram target info.
125 */
126 orion_setup_cpu_mbus_target(&addr_map_cfg,
127 sdram_addr_decoding_base);
128 return 0;
129}
130
131/* Using a early_initcall is needed so that this initialization gets
132 * done before the SMP initialization, which requires the BootROM to
133 * be remapped. */
134early_initcall(armada_setup_cpu_mbus);
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index 4ef923b032e..49d791548ad 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -20,12 +20,12 @@
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 <asm/mach/time.h> 22#include <asm/mach/time.h>
23#include <mach/armada-370-xp.h> 23#include "armada-370-xp.h"
24#include "common.h" 24#include "common.h"
25 25
26static struct map_desc armada_370_xp_io_desc[] __initdata = { 26static struct map_desc armada_370_xp_io_desc[] __initdata = {
27 { 27 {
28 .virtual = ARMADA_370_XP_REGS_VIRT_BASE, 28 .virtual = (unsigned long) ARMADA_370_XP_REGS_VIRT_BASE,
29 .pfn = __phys_to_pfn(ARMADA_370_XP_REGS_PHYS_BASE), 29 .pfn = __phys_to_pfn(ARMADA_370_XP_REGS_PHYS_BASE),
30 .length = ARMADA_370_XP_REGS_SIZE, 30 .length = ARMADA_370_XP_REGS_SIZE,
31 .type = MT_DEVICE, 31 .type = MT_DEVICE,
diff --git a/arch/arm/mach-mvebu/include/mach/armada-370-xp.h b/arch/arm/mach-mvebu/armada-370-xp.h
index 25f0ca8d782..aac9bebc6b0 100644
--- a/arch/arm/mach-mvebu/include/mach/armada-370-xp.h
+++ b/arch/arm/mach-mvebu/armada-370-xp.h
@@ -16,7 +16,7 @@
16#define __MACH_ARMADA_370_XP_H 16#define __MACH_ARMADA_370_XP_H
17 17
18#define ARMADA_370_XP_REGS_PHYS_BASE 0xd0000000 18#define ARMADA_370_XP_REGS_PHYS_BASE 0xd0000000
19#define ARMADA_370_XP_REGS_VIRT_BASE 0xfeb00000 19#define ARMADA_370_XP_REGS_VIRT_BASE IOMEM(0xfeb00000)
20#define ARMADA_370_XP_REGS_SIZE SZ_1M 20#define ARMADA_370_XP_REGS_SIZE SZ_1M
21 21
22#endif /* __MACH_ARMADA_370_XP_H */ 22#endif /* __MACH_ARMADA_370_XP_H */
diff --git a/arch/arm/mach-ep93xx/include/mach/gpio.h b/arch/arm/mach-mvebu/include/mach/gpio.h
index 40a8c178f10..40a8c178f10 100644
--- a/arch/arm/mach-ep93xx/include/mach/gpio.h
+++ b/arch/arm/mach-mvebu/include/mach/gpio.h
diff --git a/arch/arm/mach-mvebu/include/mach/timex.h b/arch/arm/mach-mvebu/include/mach/timex.h
deleted file mode 100644
index ab324a3748f..00000000000
--- a/arch/arm/mach-mvebu/include/mach/timex.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * Marvell Armada SoC time definitions
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Lior Amsalem <alior@marvell.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-mvebu/include/mach/uncompress.h b/arch/arm/mach-mvebu/include/mach/uncompress.h
deleted file mode 100644
index d6a100ccf30..00000000000
--- a/arch/arm/mach-mvebu/include/mach/uncompress.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Marvell Armada SoC kernel uncompression UART routines
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Lior Amsalem <alior@marvell.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <mach/armada-370-xp.h>
14
15#define UART_THR ((volatile unsigned char *)(ARMADA_370_XP_REGS_PHYS_BASE\
16 + 0x12000))
17#define UART_LSR ((volatile unsigned char *)(ARMADA_370_XP_REGS_PHYS_BASE\
18 + 0x12014))
19
20#define LSR_THRE 0x20
21
22static void putc(const char c)
23{
24 int i;
25
26 for (i = 0; i < 0x1000; i++) {
27 /* Transmit fifo not full? */
28 if (*UART_LSR & LSR_THRE)
29 break;
30 }
31
32 *UART_THR = c;
33}
34
35static void flush(void)
36{
37}
38
39/*
40 * nothing to do
41 */
42#define arch_decomp_setup()
43#define arch_decomp_wdog()
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index 9a8bbda195b..ecc431909d6 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -1,7 +1,5 @@
1if ARCH_MXS 1if ARCH_MXS
2 2
3source "arch/arm/mach-mxs/devices/Kconfig"
4
5config SOC_IMX23 3config SOC_IMX23
6 bool 4 bool
7 select ARM_AMBA 5 select ARM_AMBA
@@ -27,91 +25,4 @@ config MACH_MXS_DT
27 Include support for Freescale MXS platforms(i.MX23 and i.MX28) 25 Include support for Freescale MXS platforms(i.MX23 and i.MX28)
28 using the device tree for discovery 26 using the device tree for discovery
29 27
30config MACH_STMP378X_DEVB
31 bool "Support STMP378x_devb Platform"
32 select SOC_IMX23
33 select MXS_HAVE_AMBA_DUART
34 select MXS_HAVE_PLATFORM_AUART
35 select MXS_HAVE_PLATFORM_MXS_MMC
36 select MXS_HAVE_PLATFORM_RTC_STMP3XXX
37 help
38 Include support for STMP378x-devb platform. This includes specific
39 configurations for the board and its peripherals.
40
41config MACH_MX23EVK
42 bool "Support MX23EVK Platform"
43 select SOC_IMX23
44 select MXS_HAVE_AMBA_DUART
45 select MXS_HAVE_PLATFORM_AUART
46 select MXS_HAVE_PLATFORM_MXS_MMC
47 select MXS_HAVE_PLATFORM_MXSFB
48 select MXS_HAVE_PLATFORM_RTC_STMP3XXX
49 help
50 Include support for MX23EVK platform. This includes specific
51 configurations for the board and its peripherals.
52
53config MACH_MX28EVK
54 bool "Support MX28EVK Platform"
55 select SOC_IMX28
56 select LEDS_GPIO_REGISTER
57 select MXS_HAVE_AMBA_DUART
58 select MXS_HAVE_PLATFORM_AUART
59 select MXS_HAVE_PLATFORM_FEC
60 select MXS_HAVE_PLATFORM_FLEXCAN
61 select MXS_HAVE_PLATFORM_MXS_MMC
62 select MXS_HAVE_PLATFORM_MXSFB
63 select MXS_HAVE_PLATFORM_MXS_SAIF
64 select MXS_HAVE_PLATFORM_MXS_I2C
65 select MXS_HAVE_PLATFORM_RTC_STMP3XXX
66 help
67 Include support for MX28EVK platform. This includes specific
68 configurations for the board and its peripherals.
69
70config MODULE_TX28
71 bool
72 select SOC_IMX28
73 select LEDS_GPIO_REGISTER
74 select MXS_HAVE_AMBA_DUART
75 select MXS_HAVE_PLATFORM_AUART
76 select MXS_HAVE_PLATFORM_FEC
77 select MXS_HAVE_PLATFORM_MXS_I2C
78 select MXS_HAVE_PLATFORM_MXS_MMC
79 select MXS_HAVE_PLATFORM_MXS_PWM
80 select MXS_HAVE_PLATFORM_RTC_STMP3XXX
81
82config MODULE_M28
83 bool
84 select SOC_IMX28
85 select LEDS_GPIO_REGISTER
86 select MXS_HAVE_AMBA_DUART
87 select MXS_HAVE_PLATFORM_AUART
88 select MXS_HAVE_PLATFORM_FEC
89 select MXS_HAVE_PLATFORM_FLEXCAN
90 select MXS_HAVE_PLATFORM_MXS_I2C
91 select MXS_HAVE_PLATFORM_MXS_MMC
92 select MXS_HAVE_PLATFORM_MXSFB
93
94config MODULE_APX4
95 bool
96 select SOC_IMX28
97 select LEDS_GPIO_REGISTER
98 select MXS_HAVE_AMBA_DUART
99 select MXS_HAVE_PLATFORM_AUART
100 select MXS_HAVE_PLATFORM_FEC
101 select MXS_HAVE_PLATFORM_MXS_I2C
102 select MXS_HAVE_PLATFORM_MXS_MMC
103 select MXS_HAVE_PLATFORM_MXS_SAIF
104
105config MACH_TX28
106 bool "Ka-Ro TX28 module"
107 select MODULE_TX28
108
109config MACH_M28EVK
110 bool "Support DENX M28EVK Platform"
111 select MODULE_M28
112
113config MACH_APX4DEVKIT
114 bool "Support Bluegiga APX4 Development Kit"
115 select MODULE_APX4
116
117endif 28endif
diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
index fed3695a133..3d3c8a97306 100644
--- a/arch/arm/mach-mxs/Makefile
+++ b/arch/arm/mach-mxs/Makefile
@@ -1,15 +1,6 @@
1# Common support 1# Common support
2obj-y := devices.o icoll.o iomux.o ocotp.o system.o timer.o mm.o 2obj-y := icoll.o ocotp.o system.o timer.o mm.o
3 3
4obj-$(CONFIG_PM) += pm.o 4obj-$(CONFIG_PM) += pm.o
5 5
6obj-$(CONFIG_MACH_MXS_DT) += mach-mxs.o 6obj-$(CONFIG_MACH_MXS_DT) += mach-mxs.o
7obj-$(CONFIG_MACH_STMP378X_DEVB) += mach-stmp378x_devb.o
8obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o
9obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o
10obj-$(CONFIG_MACH_M28EVK) += mach-m28evk.o
11obj-$(CONFIG_MACH_APX4DEVKIT) += mach-apx4devkit.o
12obj-$(CONFIG_MODULE_TX28) += module-tx28.o
13obj-$(CONFIG_MACH_TX28) += mach-tx28.o
14
15obj-y += devices/
diff --git a/arch/arm/mach-mxs/Makefile.boot b/arch/arm/mach-mxs/Makefile.boot
index 4582999cf08..07b11fe6453 100644
--- a/arch/arm/mach-mxs/Makefile.boot
+++ b/arch/arm/mach-mxs/Makefile.boot
@@ -1,10 +1 @@
1zreladdr-y += 0x40008000 zreladdr-y += 0x40008000
2
3dtb-y += imx23-evk.dtb \
4 imx23-olinuxino.dtb \
5 imx23-stmp378x_devb.dtb \
6 imx28-apx4devkit.dtb \
7 imx28-cfa10036.dtb \
8 imx28-evk.dtb \
9 imx28-m28evk.dtb \
10 imx28-tx28.dtb \
diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h
deleted file mode 100644
index 9ee5cede3d4..00000000000
--- a/arch/arm/mach-mxs/devices-mx23.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License version 2 as published by the
9 * Free Software Foundation.
10 */
11#include <mach/mx23.h>
12#include <mach/devices-common.h>
13#include <linux/mxsfb.h>
14#include <linux/amba/bus.h>
15
16static inline int mx23_add_duart(void)
17{
18 struct amba_device *d;
19
20 d = amba_ahb_device_add(NULL, "duart", MX23_DUART_BASE_ADDR, SZ_8K,
21 MX23_INT_DUART, 0, 0, 0);
22 return IS_ERR(d) ? PTR_ERR(d) : 0;
23}
24
25extern const struct mxs_auart_data mx23_auart_data[] __initconst;
26#define mx23_add_auart(id) mxs_add_auart(&mx23_auart_data[id])
27#define mx23_add_auart0() mx23_add_auart(0)
28#define mx23_add_auart1() mx23_add_auart(1)
29
30extern const struct mxs_gpmi_nand_data mx23_gpmi_nand_data __initconst;
31#define mx23_add_gpmi_nand(pdata) \
32 mxs_add_gpmi_nand(pdata, &mx23_gpmi_nand_data)
33
34extern const struct mxs_mxs_mmc_data mx23_mxs_mmc_data[] __initconst;
35#define mx23_add_mxs_mmc(id, pdata) \
36 mxs_add_mxs_mmc(&mx23_mxs_mmc_data[id], pdata)
37
38#define mx23_add_mxs_pwm(id) mxs_add_mxs_pwm(MX23_PWM_BASE_ADDR, id)
39
40struct platform_device *__init mx23_add_mxsfb(
41 const struct mxsfb_platform_data *pdata);
42
43struct platform_device *__init mx23_add_rtc_stmp3xxx(void);
diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h
deleted file mode 100644
index fcab431060f..00000000000
--- a/arch/arm/mach-mxs/devices-mx28.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License version 2 as published by the
9 * Free Software Foundation.
10 */
11#include <mach/mx28.h>
12#include <mach/devices-common.h>
13#include <linux/mxsfb.h>
14#include <linux/amba/bus.h>
15
16static inline int mx28_add_duart(void)
17{
18 struct amba_device *d;
19
20 d = amba_ahb_device_add(NULL, "duart", MX28_DUART_BASE_ADDR, SZ_8K,
21 MX28_INT_DUART, 0, 0, 0);
22 return IS_ERR(d) ? PTR_ERR(d) : 0;
23}
24
25extern const struct mxs_auart_data mx28_auart_data[] __initconst;
26#define mx28_add_auart(id) mxs_add_auart(&mx28_auart_data[id])
27#define mx28_add_auart0() mx28_add_auart(0)
28#define mx28_add_auart1() mx28_add_auart(1)
29#define mx28_add_auart2() mx28_add_auart(2)
30#define mx28_add_auart3() mx28_add_auart(3)
31#define mx28_add_auart4() mx28_add_auart(4)
32
33extern const struct mxs_fec_data mx28_fec_data[] __initconst;
34#define mx28_add_fec(id, pdata) \
35 mxs_add_fec(&mx28_fec_data[id], pdata)
36
37extern const struct mxs_flexcan_data mx28_flexcan_data[] __initconst;
38#define mx28_add_flexcan(id, pdata) \
39 mxs_add_flexcan(&mx28_flexcan_data[id], pdata)
40#define mx28_add_flexcan0(pdata) mx28_add_flexcan(0, pdata)
41#define mx28_add_flexcan1(pdata) mx28_add_flexcan(1, pdata)
42
43extern const struct mxs_gpmi_nand_data mx28_gpmi_nand_data __initconst;
44#define mx28_add_gpmi_nand(pdata) \
45 mxs_add_gpmi_nand(pdata, &mx28_gpmi_nand_data)
46
47extern const struct mxs_mxs_i2c_data mx28_mxs_i2c_data[] __initconst;
48#define mx28_add_mxs_i2c(id) mxs_add_mxs_i2c(&mx28_mxs_i2c_data[id])
49
50extern const struct mxs_mxs_mmc_data mx28_mxs_mmc_data[] __initconst;
51#define mx28_add_mxs_mmc(id, pdata) \
52 mxs_add_mxs_mmc(&mx28_mxs_mmc_data[id], pdata)
53
54#define mx28_add_mxs_pwm(id) mxs_add_mxs_pwm(MX28_PWM_BASE_ADDR, id)
55
56struct platform_device *__init mx28_add_mxsfb(
57 const struct mxsfb_platform_data *pdata);
58
59extern const struct mxs_saif_data mx28_saif_data[] __initconst;
60#define mx28_add_saif(id, pdata) \
61 mxs_add_saif(&mx28_saif_data[id], pdata)
62
63struct platform_device *__init mx28_add_rtc_stmp3xxx(void);
diff --git a/arch/arm/mach-mxs/devices.c b/arch/arm/mach-mxs/devices.c
deleted file mode 100644
index cf50b5a66dd..00000000000
--- a/arch/arm/mach-mxs/devices.c
+++ /dev/null
@@ -1,87 +0,0 @@
1/*
2 * Copyright 2008 Sascha Hauer, kernel@pengutronix.de
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18
19#include <linux/kernel.h>
20#include <linux/slab.h>
21#include <linux/init.h>
22#include <linux/platform_device.h>
23#include <linux/amba/bus.h>
24
25struct platform_device *__init mxs_add_platform_device_dmamask(
26 const char *name, int id,
27 const struct resource *res, unsigned int num_resources,
28 const void *data, size_t size_data, u64 dmamask)
29{
30 int ret = -ENOMEM;
31 struct platform_device *pdev;
32
33 pdev = platform_device_alloc(name, id);
34 if (!pdev)
35 goto err;
36
37 if (dmamask) {
38 /*
39 * This memory isn't freed when the device is put,
40 * I don't have a nice idea for that though. Conceptually
41 * dma_mask in struct device should not be a pointer.
42 * See http://thread.gmane.org/gmane.linux.kernel.pci/9081
43 */
44 pdev->dev.dma_mask =
45 kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
46 if (!pdev->dev.dma_mask)
47 /* ret is still -ENOMEM; */
48 goto err;
49
50 *pdev->dev.dma_mask = dmamask;
51 pdev->dev.coherent_dma_mask = dmamask;
52 }
53
54 if (res) {
55 ret = platform_device_add_resources(pdev, res, num_resources);
56 if (ret)
57 goto err;
58 }
59
60 if (data) {
61 ret = platform_device_add_data(pdev, data, size_data);
62 if (ret)
63 goto err;
64 }
65
66 ret = platform_device_add(pdev);
67 if (ret) {
68err:
69 if (dmamask)
70 kfree(pdev->dev.dma_mask);
71 platform_device_put(pdev);
72 return ERR_PTR(ret);
73 }
74
75 return pdev;
76}
77
78struct device mxs_apbh_bus = {
79 .init_name = "mxs_apbh",
80 .parent = &platform_bus,
81};
82
83static int __init mxs_device_init(void)
84{
85 return device_register(&mxs_apbh_bus);
86}
87core_initcall(mxs_device_init);
diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig
deleted file mode 100644
index 19659de1c4e..00000000000
--- a/arch/arm/mach-mxs/devices/Kconfig
+++ /dev/null
@@ -1,33 +0,0 @@
1config MXS_HAVE_AMBA_DUART
2 bool
3
4config MXS_HAVE_PLATFORM_AUART
5 bool
6
7config MXS_HAVE_PLATFORM_FEC
8 bool
9
10config MXS_HAVE_PLATFORM_FLEXCAN
11 select HAVE_CAN_FLEXCAN if CAN
12 bool
13
14config MXS_HAVE_PLATFORM_GPMI_NAND
15 bool
16
17config MXS_HAVE_PLATFORM_MXS_I2C
18 bool
19
20config MXS_HAVE_PLATFORM_MXS_MMC
21 bool
22
23config MXS_HAVE_PLATFORM_MXS_PWM
24 bool
25
26config MXS_HAVE_PLATFORM_MXSFB
27 bool
28
29config MXS_HAVE_PLATFORM_MXS_SAIF
30 bool
31
32config MXS_HAVE_PLATFORM_RTC_STMP3XXX
33 bool
diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile
deleted file mode 100644
index 5f72d978744..00000000000
--- a/arch/arm/mach-mxs/devices/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
1obj-$(CONFIG_MXS_HAVE_PLATFORM_AUART) += platform-auart.o
2obj-y += platform-dma.o
3obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
4obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
5obj-$(CONFIG_MXS_HAVE_PLATFORM_GPMI_NAND) += platform-gpmi-nand.o
6obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_I2C) += platform-mxs-i2c.o
7obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_MMC) += platform-mxs-mmc.o
8obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_PWM) += platform-mxs-pwm.o
9obj-y += platform-gpio-mxs.o
10obj-$(CONFIG_MXS_HAVE_PLATFORM_MXSFB) += platform-mxsfb.o
11obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_SAIF) += platform-mxs-saif.o
12obj-$(CONFIG_MXS_HAVE_PLATFORM_RTC_STMP3XXX) += platform-rtc-stmp3xxx.o
diff --git a/arch/arm/mach-mxs/devices/platform-auart.c b/arch/arm/mach-mxs/devices/platform-auart.c
deleted file mode 100644
index 27608f5d2ac..00000000000
--- a/arch/arm/mach-mxs/devices/platform-auart.c
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Sascha Hauer <s.hauer@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <linux/dma-mapping.h>
10#include <asm/sizes.h>
11#include <mach/mx23.h>
12#include <mach/mx28.h>
13#include <mach/devices-common.h>
14
15#define mxs_auart_data_entry_single(soc, _id, hwid) \
16 { \
17 .id = _id, \
18 .iobase = soc ## _AUART ## hwid ## _BASE_ADDR, \
19 .irq = soc ## _INT_AUART ## hwid, \
20 }
21
22#define mxs_auart_data_entry(soc, _id, hwid) \
23 [_id] = mxs_auart_data_entry_single(soc, _id, hwid)
24
25#ifdef CONFIG_SOC_IMX23
26const struct mxs_auart_data mx23_auart_data[] __initconst = {
27#define mx23_auart_data_entry(_id, hwid) \
28 mxs_auart_data_entry(MX23, _id, hwid)
29 mx23_auart_data_entry(0, 1),
30 mx23_auart_data_entry(1, 2),
31};
32#endif
33
34#ifdef CONFIG_SOC_IMX28
35const struct mxs_auart_data mx28_auart_data[] __initconst = {
36#define mx28_auart_data_entry(_id) \
37 mxs_auart_data_entry(MX28, _id, _id)
38 mx28_auart_data_entry(0),
39 mx28_auart_data_entry(1),
40 mx28_auart_data_entry(2),
41 mx28_auart_data_entry(3),
42 mx28_auart_data_entry(4),
43};
44#endif
45
46struct platform_device *__init mxs_add_auart(
47 const struct mxs_auart_data *data)
48{
49 struct resource res[] = {
50 {
51 .start = data->iobase,
52 .end = data->iobase + SZ_8K - 1,
53 .flags = IORESOURCE_MEM,
54 }, {
55 .start = data->irq,
56 .end = data->irq,
57 .flags = IORESOURCE_IRQ,
58 },
59 };
60
61 return mxs_add_platform_device_dmamask("mxs-auart", data->id,
62 res, ARRAY_SIZE(res), NULL, 0,
63 DMA_BIT_MASK(32));
64}
65
diff --git a/arch/arm/mach-mxs/devices/platform-dma.c b/arch/arm/mach-mxs/devices/platform-dma.c
deleted file mode 100644
index 46824501de0..00000000000
--- a/arch/arm/mach-mxs/devices/platform-dma.c
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8#include <linux/compiler.h>
9#include <linux/dma-mapping.h>
10#include <linux/err.h>
11#include <linux/init.h>
12
13#include <mach/mx23.h>
14#include <mach/mx28.h>
15#include <mach/devices-common.h>
16
17struct platform_device *__init mxs_add_dma(const char *devid,
18 resource_size_t base)
19{
20 struct resource res[] = {
21 {
22 .start = base,
23 .end = base + SZ_8K - 1,
24 .flags = IORESOURCE_MEM,
25 }
26 };
27
28 return mxs_add_platform_device_dmamask(devid, -1,
29 res, ARRAY_SIZE(res), NULL, 0,
30 DMA_BIT_MASK(32));
31}
diff --git a/arch/arm/mach-mxs/devices/platform-fec.c b/arch/arm/mach-mxs/devices/platform-fec.c
deleted file mode 100644
index ae96a4fd8f1..00000000000
--- a/arch/arm/mach-mxs/devices/platform-fec.c
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <linux/dma-mapping.h>
10#include <asm/sizes.h>
11#include <mach/mx28.h>
12#include <mach/devices-common.h>
13
14#define mxs_fec_data_entry_single(soc, _id) \
15 { \
16 .id = _id, \
17 .iobase = soc ## _ENET_MAC ## _id ## _BASE_ADDR, \
18 .irq = soc ## _INT_ENET_MAC ## _id, \
19 }
20
21#define mxs_fec_data_entry(soc, _id) \
22 [_id] = mxs_fec_data_entry_single(soc, _id)
23
24#ifdef CONFIG_SOC_IMX28
25const struct mxs_fec_data mx28_fec_data[] __initconst = {
26#define mx28_fec_data_entry(_id) \
27 mxs_fec_data_entry(MX28, _id)
28 mx28_fec_data_entry(0),
29 mx28_fec_data_entry(1),
30};
31#endif
32
33struct platform_device *__init mxs_add_fec(
34 const struct mxs_fec_data *data,
35 const struct fec_platform_data *pdata)
36{
37 struct resource res[] = {
38 {
39 .start = data->iobase,
40 .end = data->iobase + SZ_16K - 1,
41 .flags = IORESOURCE_MEM,
42 }, {
43 .start = data->irq,
44 .end = data->irq,
45 .flags = IORESOURCE_IRQ,
46 },
47 };
48
49 return mxs_add_platform_device_dmamask("imx28-fec", data->id,
50 res, ARRAY_SIZE(res), pdata, sizeof(*pdata),
51 DMA_BIT_MASK(32));
52}
diff --git a/arch/arm/mach-mxs/devices/platform-flexcan.c b/arch/arm/mach-mxs/devices/platform-flexcan.c
deleted file mode 100644
index 43a6b4bae6f..00000000000
--- a/arch/arm/mach-mxs/devices/platform-flexcan.c
+++ /dev/null
@@ -1,51 +0,0 @@
1/*
2 * Copyright (C) 2010, 2011 Pengutronix,
3 * Marc Kleine-Budde <kernel@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <asm/sizes.h>
10#include <mach/mx28.h>
11#include <mach/devices-common.h>
12
13#define mxs_flexcan_data_entry_single(soc, _id, _hwid, _size) \
14 { \
15 .id = _id, \
16 .iobase = soc ## _CAN ## _hwid ## _BASE_ADDR, \
17 .iosize = _size, \
18 .irq = soc ## _INT_CAN ## _hwid, \
19 }
20
21#define mxs_flexcan_data_entry(soc, _id, _hwid, _size) \
22 [_id] = mxs_flexcan_data_entry_single(soc, _id, _hwid, _size)
23
24#ifdef CONFIG_SOC_IMX28
25const struct mxs_flexcan_data mx28_flexcan_data[] __initconst = {
26#define mx28_flexcan_data_entry(_id, _hwid) \
27 mxs_flexcan_data_entry_single(MX28, _id, _hwid, SZ_8K)
28 mx28_flexcan_data_entry(0, 0),
29 mx28_flexcan_data_entry(1, 1),
30};
31#endif /* ifdef CONFIG_SOC_IMX28 */
32
33struct platform_device *__init mxs_add_flexcan(
34 const struct mxs_flexcan_data *data,
35 const struct flexcan_platform_data *pdata)
36{
37 struct resource res[] = {
38 {
39 .start = data->iobase,
40 .end = data->iobase + data->iosize - 1,
41 .flags = IORESOURCE_MEM,
42 }, {
43 .start = data->irq,
44 .end = data->irq,
45 .flags = IORESOURCE_IRQ,
46 },
47 };
48
49 return mxs_add_platform_device("flexcan", data->id,
50 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
51}
diff --git a/arch/arm/mach-mxs/devices/platform-gpio-mxs.c b/arch/arm/mach-mxs/devices/platform-gpio-mxs.c
deleted file mode 100644
index cd99f19ec63..00000000000
--- a/arch/arm/mach-mxs/devices/platform-gpio-mxs.c
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8#include <linux/compiler.h>
9#include <linux/err.h>
10#include <linux/init.h>
11
12#include <mach/mx23.h>
13#include <mach/mx28.h>
14#include <mach/devices-common.h>
15
16struct platform_device *__init mxs_add_gpio(
17 char *name, int id, resource_size_t iobase, int irq)
18{
19 struct resource res[] = {
20 {
21 .start = iobase,
22 .end = iobase + SZ_8K - 1,
23 .flags = IORESOURCE_MEM,
24 }, {
25 .start = irq,
26 .end = irq,
27 .flags = IORESOURCE_IRQ,
28 },
29 };
30
31 return platform_device_register_resndata(&mxs_apbh_bus,
32 name, id, res, ARRAY_SIZE(res), NULL, 0);
33}
diff --git a/arch/arm/mach-mxs/devices/platform-gpmi-nand.c b/arch/arm/mach-mxs/devices/platform-gpmi-nand.c
deleted file mode 100644
index 3e22df5944a..00000000000
--- a/arch/arm/mach-mxs/devices/platform-gpmi-nand.c
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License 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#include <asm/sizes.h>
19#include <mach/mx23.h>
20#include <mach/mx28.h>
21#include <mach/devices-common.h>
22#include <linux/dma-mapping.h>
23
24#ifdef CONFIG_SOC_IMX23
25const struct mxs_gpmi_nand_data mx23_gpmi_nand_data __initconst = {
26 .devid = "imx23-gpmi-nand",
27 .res = {
28 /* GPMI */
29 DEFINE_RES_MEM_NAMED(MX23_GPMI_BASE_ADDR, SZ_8K,
30 GPMI_NAND_GPMI_REGS_ADDR_RES_NAME),
31 DEFINE_RES_IRQ_NAMED(MX23_INT_GPMI_ATTENTION,
32 GPMI_NAND_GPMI_INTERRUPT_RES_NAME),
33 /* BCH */
34 DEFINE_RES_MEM_NAMED(MX23_BCH_BASE_ADDR, SZ_8K,
35 GPMI_NAND_BCH_REGS_ADDR_RES_NAME),
36 DEFINE_RES_IRQ_NAMED(MX23_INT_BCH,
37 GPMI_NAND_BCH_INTERRUPT_RES_NAME),
38 /* DMA */
39 DEFINE_RES_NAMED(MX23_DMA_GPMI0,
40 MX23_DMA_GPMI3 - MX23_DMA_GPMI0 + 1,
41 GPMI_NAND_DMA_CHANNELS_RES_NAME,
42 IORESOURCE_DMA),
43 DEFINE_RES_IRQ_NAMED(MX23_INT_GPMI_DMA,
44 GPMI_NAND_DMA_INTERRUPT_RES_NAME),
45 },
46};
47#endif
48
49#ifdef CONFIG_SOC_IMX28
50const struct mxs_gpmi_nand_data mx28_gpmi_nand_data __initconst = {
51 .devid = "imx28-gpmi-nand",
52 .res = {
53 /* GPMI */
54 DEFINE_RES_MEM_NAMED(MX28_GPMI_BASE_ADDR, SZ_8K,
55 GPMI_NAND_GPMI_REGS_ADDR_RES_NAME),
56 DEFINE_RES_IRQ_NAMED(MX28_INT_GPMI,
57 GPMI_NAND_GPMI_INTERRUPT_RES_NAME),
58 /* BCH */
59 DEFINE_RES_MEM_NAMED(MX28_BCH_BASE_ADDR, SZ_8K,
60 GPMI_NAND_BCH_REGS_ADDR_RES_NAME),
61 DEFINE_RES_IRQ_NAMED(MX28_INT_BCH,
62 GPMI_NAND_BCH_INTERRUPT_RES_NAME),
63 /* DMA */
64 DEFINE_RES_NAMED(MX28_DMA_GPMI0,
65 MX28_DMA_GPMI7 - MX28_DMA_GPMI0 + 1,
66 GPMI_NAND_DMA_CHANNELS_RES_NAME,
67 IORESOURCE_DMA),
68 DEFINE_RES_IRQ_NAMED(MX28_INT_GPMI_DMA,
69 GPMI_NAND_DMA_INTERRUPT_RES_NAME),
70 },
71};
72#endif
73
74struct platform_device *__init
75mxs_add_gpmi_nand(const struct gpmi_nand_platform_data *pdata,
76 const struct mxs_gpmi_nand_data *data)
77{
78 return mxs_add_platform_device_dmamask(data->devid, -1,
79 data->res, GPMI_NAND_RES_SIZE,
80 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
81}
diff --git a/arch/arm/mach-mxs/devices/platform-mxs-i2c.c b/arch/arm/mach-mxs/devices/platform-mxs-i2c.c
deleted file mode 100644
index 79222ec8ede..00000000000
--- a/arch/arm/mach-mxs/devices/platform-mxs-i2c.c
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * Copyright (C) 2011 Pengutronix
3 * Wolfram Sang <w.sang@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <asm/sizes.h>
10#include <mach/mx28.h>
11#include <mach/devices-common.h>
12
13#define mxs_i2c_data_entry_single(soc, _id) \
14 { \
15 .id = _id, \
16 .iobase = soc ## _I2C ## _id ## _BASE_ADDR, \
17 .errirq = soc ## _INT_I2C ## _id ## _ERROR, \
18 .dmairq = soc ## _INT_I2C ## _id ## _DMA, \
19 }
20
21#define mxs_i2c_data_entry(soc, _id) \
22 [_id] = mxs_i2c_data_entry_single(soc, _id)
23
24#ifdef CONFIG_SOC_IMX28
25const struct mxs_mxs_i2c_data mx28_mxs_i2c_data[] __initconst = {
26 mxs_i2c_data_entry(MX28, 0),
27 mxs_i2c_data_entry(MX28, 1),
28};
29#endif
30
31struct platform_device *__init mxs_add_mxs_i2c(
32 const struct mxs_mxs_i2c_data *data)
33{
34 struct resource res[] = {
35 {
36 .start = data->iobase,
37 .end = data->iobase + SZ_8K - 1,
38 .flags = IORESOURCE_MEM,
39 }, {
40 .start = data->errirq,
41 .end = data->errirq,
42 .flags = IORESOURCE_IRQ,
43 }, {
44 .start = data->dmairq,
45 .end = data->dmairq,
46 .flags = IORESOURCE_IRQ,
47 },
48 };
49
50 return mxs_add_platform_device("mxs-i2c", data->id, res,
51 ARRAY_SIZE(res), NULL, 0);
52}
diff --git a/arch/arm/mach-mxs/devices/platform-mxs-mmc.c b/arch/arm/mach-mxs/devices/platform-mxs-mmc.c
deleted file mode 100644
index b33c9d05c55..00000000000
--- a/arch/arm/mach-mxs/devices/platform-mxs-mmc.c
+++ /dev/null
@@ -1,76 +0,0 @@
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License version 2 as published by the
9 * Free Software Foundation.
10 */
11
12#include <linux/compiler.h>
13#include <linux/err.h>
14#include <linux/init.h>
15
16#include <mach/mx23.h>
17#include <mach/mx28.h>
18#include <mach/devices-common.h>
19
20#define mxs_mxs_mmc_data_entry_single(soc, _devid, _id, hwid) \
21 { \
22 .devid = _devid, \
23 .id = _id, \
24 .iobase = soc ## _SSP ## hwid ## _BASE_ADDR, \
25 .dma = soc ## _DMA_SSP ## hwid, \
26 .irq_err = soc ## _INT_SSP ## hwid ## _ERROR, \
27 .irq_dma = soc ## _INT_SSP ## hwid ## _DMA, \
28 }
29
30#define mxs_mxs_mmc_data_entry(soc, _devid, _id, hwid) \
31 [_id] = mxs_mxs_mmc_data_entry_single(soc, _devid, _id, hwid)
32
33
34#ifdef CONFIG_SOC_IMX23
35const struct mxs_mxs_mmc_data mx23_mxs_mmc_data[] __initconst = {
36 mxs_mxs_mmc_data_entry(MX23, "imx23-mmc", 0, 1),
37 mxs_mxs_mmc_data_entry(MX23, "imx23-mmc", 1, 2),
38};
39#endif
40
41#ifdef CONFIG_SOC_IMX28
42const struct mxs_mxs_mmc_data mx28_mxs_mmc_data[] __initconst = {
43 mxs_mxs_mmc_data_entry(MX28, "imx28-mmc", 0, 0),
44 mxs_mxs_mmc_data_entry(MX28, "imx28-mmc", 1, 1),
45 mxs_mxs_mmc_data_entry(MX28, "imx28-mmc", 2, 2),
46 mxs_mxs_mmc_data_entry(MX28, "imx28-mmc", 3, 3),
47};
48#endif
49
50struct platform_device *__init mxs_add_mxs_mmc(
51 const struct mxs_mxs_mmc_data *data,
52 const struct mxs_mmc_platform_data *pdata)
53{
54 struct resource res[] = {
55 {
56 .start = data->iobase,
57 .end = data->iobase + SZ_8K - 1,
58 .flags = IORESOURCE_MEM,
59 }, {
60 .start = data->dma,
61 .end = data->dma,
62 .flags = IORESOURCE_DMA,
63 }, {
64 .start = data->irq_err,
65 .end = data->irq_err,
66 .flags = IORESOURCE_IRQ,
67 }, {
68 .start = data->irq_dma,
69 .end = data->irq_dma,
70 .flags = IORESOURCE_IRQ,
71 },
72 };
73
74 return mxs_add_platform_device(data->devid, data->id,
75 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
76}
diff --git a/arch/arm/mach-mxs/devices/platform-mxs-pwm.c b/arch/arm/mach-mxs/devices/platform-mxs-pwm.c
deleted file mode 100644
index 680f5a90293..00000000000
--- a/arch/arm/mach-mxs/devices/platform-mxs-pwm.c
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Sascha Hauer <s.hauer@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <asm/sizes.h>
10#include <mach/devices-common.h>
11
12struct platform_device *__init mxs_add_mxs_pwm(resource_size_t iobase, int id)
13{
14 struct resource res = {
15 .flags = IORESOURCE_MEM,
16 };
17
18 res.start = iobase + 0x10 + 0x20 * id;
19 res.end = res.start + 0x1f;
20
21 return mxs_add_platform_device("mxs-pwm", id, &res, 1, NULL, 0);
22}
diff --git a/arch/arm/mach-mxs/devices/platform-mxs-saif.c b/arch/arm/mach-mxs/devices/platform-mxs-saif.c
deleted file mode 100644
index f6e3a60b420..00000000000
--- a/arch/arm/mach-mxs/devices/platform-mxs-saif.c
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8#include <linux/compiler.h>
9#include <linux/err.h>
10#include <linux/init.h>
11
12#include <mach/mx23.h>
13#include <mach/mx28.h>
14#include <mach/devices-common.h>
15
16#define mxs_saif_data_entry_single(soc, _id) \
17 { \
18 .id = _id, \
19 .iobase = soc ## _SAIF ## _id ## _BASE_ADDR, \
20 .irq = soc ## _INT_SAIF ## _id, \
21 .dma = soc ## _DMA_SAIF ## _id, \
22 .dmairq = soc ## _INT_SAIF ## _id ##_DMA, \
23 }
24
25#define mxs_saif_data_entry(soc, _id) \
26 [_id] = mxs_saif_data_entry_single(soc, _id)
27
28#ifdef CONFIG_SOC_IMX28
29const struct mxs_saif_data mx28_saif_data[] __initconst = {
30 mxs_saif_data_entry(MX28, 0),
31 mxs_saif_data_entry(MX28, 1),
32};
33#endif
34
35struct platform_device *__init mxs_add_saif(const struct mxs_saif_data *data,
36 const struct mxs_saif_platform_data *pdata)
37{
38 struct resource res[] = {
39 {
40 .start = data->iobase,
41 .end = data->iobase + SZ_4K - 1,
42 .flags = IORESOURCE_MEM,
43 }, {
44 .start = data->irq,
45 .end = data->irq,
46 .flags = IORESOURCE_IRQ,
47 }, {
48 .start = data->dma,
49 .end = data->dma,
50 .flags = IORESOURCE_DMA,
51 }, {
52 .start = data->dmairq,
53 .end = data->dmairq,
54 .flags = IORESOURCE_IRQ,
55 },
56
57 };
58
59 return mxs_add_platform_device("mxs-saif", data->id, res,
60 ARRAY_SIZE(res), pdata, sizeof(*pdata));
61}
diff --git a/arch/arm/mach-mxs/devices/platform-mxsfb.c b/arch/arm/mach-mxs/devices/platform-mxsfb.c
deleted file mode 100644
index 76b53f73418..00000000000
--- a/arch/arm/mach-mxs/devices/platform-mxsfb.c
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * Copyright (C) 2011 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8#include <linux/dma-mapping.h>
9#include <asm/sizes.h>
10#include <mach/mx23.h>
11#include <mach/mx28.h>
12#include <mach/devices-common.h>
13#include <linux/mxsfb.h>
14
15#ifdef CONFIG_SOC_IMX23
16struct platform_device *__init mx23_add_mxsfb(
17 const struct mxsfb_platform_data *pdata)
18{
19 struct resource res[] = {
20 {
21 .start = MX23_LCDIF_BASE_ADDR,
22 .end = MX23_LCDIF_BASE_ADDR + SZ_8K - 1,
23 .flags = IORESOURCE_MEM,
24 },
25 };
26
27 return mxs_add_platform_device_dmamask("imx23-fb", -1,
28 res, ARRAY_SIZE(res), pdata, sizeof(*pdata), DMA_BIT_MASK(32));
29}
30#endif /* ifdef CONFIG_SOC_IMX23 */
31
32#ifdef CONFIG_SOC_IMX28
33struct platform_device *__init mx28_add_mxsfb(
34 const struct mxsfb_platform_data *pdata)
35{
36 struct resource res[] = {
37 {
38 .start = MX28_LCDIF_BASE_ADDR,
39 .end = MX28_LCDIF_BASE_ADDR + SZ_8K - 1,
40 .flags = IORESOURCE_MEM,
41 },
42 };
43
44 return mxs_add_platform_device_dmamask("imx28-fb", -1,
45 res, ARRAY_SIZE(res), pdata, sizeof(*pdata), DMA_BIT_MASK(32));
46}
47#endif /* ifdef CONFIG_SOC_IMX28 */
diff --git a/arch/arm/mach-mxs/devices/platform-rtc-stmp3xxx.c b/arch/arm/mach-mxs/devices/platform-rtc-stmp3xxx.c
deleted file mode 100644
index 639eaee1555..00000000000
--- a/arch/arm/mach-mxs/devices/platform-rtc-stmp3xxx.c
+++ /dev/null
@@ -1,51 +0,0 @@
1/*
2 * Copyright (C) 2011 Pengutronix, Wolfram Sang <w.sang@pengutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8#include <asm/sizes.h>
9#include <mach/mx23.h>
10#include <mach/mx28.h>
11#include <mach/devices-common.h>
12
13#ifdef CONFIG_SOC_IMX23
14struct platform_device *__init mx23_add_rtc_stmp3xxx(void)
15{
16 struct resource res[] = {
17 {
18 .start = MX23_RTC_BASE_ADDR,
19 .end = MX23_RTC_BASE_ADDR + SZ_8K - 1,
20 .flags = IORESOURCE_MEM,
21 }, {
22 .start = MX23_INT_RTC_ALARM,
23 .end = MX23_INT_RTC_ALARM,
24 .flags = IORESOURCE_IRQ,
25 },
26 };
27
28 return mxs_add_platform_device("stmp3xxx-rtc", 0, res, ARRAY_SIZE(res),
29 NULL, 0);
30}
31#endif /* CONFIG_SOC_IMX23 */
32
33#ifdef CONFIG_SOC_IMX28
34struct platform_device *__init mx28_add_rtc_stmp3xxx(void)
35{
36 struct resource res[] = {
37 {
38 .start = MX28_RTC_BASE_ADDR,
39 .end = MX28_RTC_BASE_ADDR + SZ_8K - 1,
40 .flags = IORESOURCE_MEM,
41 }, {
42 .start = MX28_INT_RTC_ALARM,
43 .end = MX28_INT_RTC_ALARM,
44 .flags = IORESOURCE_IRQ,
45 },
46 };
47
48 return mxs_add_platform_device("stmp3xxx-rtc", 0, res, ARRAY_SIZE(res),
49 NULL, 0);
50}
51#endif /* CONFIG_SOC_IMX28 */
diff --git a/arch/arm/mach-mxs/icoll.c b/arch/arm/mach-mxs/icoll.c
index 23ca9d083b2..8fb23af154b 100644
--- a/arch/arm/mach-mxs/icoll.c
+++ b/arch/arm/mach-mxs/icoll.c
@@ -19,20 +19,27 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/irqdomain.h>
22#include <linux/io.h> 23#include <linux/io.h>
23 24#include <linux/of.h>
25#include <linux/of_irq.h>
26#include <asm/exception.h>
24#include <mach/mxs.h> 27#include <mach/mxs.h>
25#include <mach/common.h> 28#include <mach/common.h>
26 29
27#define HW_ICOLL_VECTOR 0x0000 30#define HW_ICOLL_VECTOR 0x0000
28#define HW_ICOLL_LEVELACK 0x0010 31#define HW_ICOLL_LEVELACK 0x0010
29#define HW_ICOLL_CTRL 0x0020 32#define HW_ICOLL_CTRL 0x0020
33#define HW_ICOLL_STAT_OFFSET 0x0070
30#define HW_ICOLL_INTERRUPTn_SET(n) (0x0124 + (n) * 0x10) 34#define HW_ICOLL_INTERRUPTn_SET(n) (0x0124 + (n) * 0x10)
31#define HW_ICOLL_INTERRUPTn_CLR(n) (0x0128 + (n) * 0x10) 35#define HW_ICOLL_INTERRUPTn_CLR(n) (0x0128 + (n) * 0x10)
32#define BM_ICOLL_INTERRUPTn_ENABLE 0x00000004 36#define BM_ICOLL_INTERRUPTn_ENABLE 0x00000004
33#define BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 0x1 37#define BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 0x1
34 38
39#define ICOLL_NUM_IRQS 128
40
35static void __iomem *icoll_base = MXS_IO_ADDRESS(MXS_ICOLL_BASE_ADDR); 41static void __iomem *icoll_base = MXS_IO_ADDRESS(MXS_ICOLL_BASE_ADDR);
42static struct irq_domain *icoll_domain;
36 43
37static void icoll_ack_irq(struct irq_data *d) 44static void icoll_ack_irq(struct irq_data *d)
38{ 45{
@@ -48,13 +55,13 @@ static void icoll_ack_irq(struct irq_data *d)
48static void icoll_mask_irq(struct irq_data *d) 55static void icoll_mask_irq(struct irq_data *d)
49{ 56{
50 __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE, 57 __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE,
51 icoll_base + HW_ICOLL_INTERRUPTn_CLR(d->irq)); 58 icoll_base + HW_ICOLL_INTERRUPTn_CLR(d->hwirq));
52} 59}
53 60
54static void icoll_unmask_irq(struct irq_data *d) 61static void icoll_unmask_irq(struct irq_data *d)
55{ 62{
56 __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE, 63 __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE,
57 icoll_base + HW_ICOLL_INTERRUPTn_SET(d->irq)); 64 icoll_base + HW_ICOLL_INTERRUPTn_SET(d->hwirq));
58} 65}
59 66
60static struct irq_chip mxs_icoll_chip = { 67static struct irq_chip mxs_icoll_chip = {
@@ -63,18 +70,56 @@ static struct irq_chip mxs_icoll_chip = {
63 .irq_unmask = icoll_unmask_irq, 70 .irq_unmask = icoll_unmask_irq,
64}; 71};
65 72
66void __init icoll_init_irq(void) 73asmlinkage void __exception_irq_entry icoll_handle_irq(struct pt_regs *regs)
67{ 74{
68 int i; 75 u32 irqnr;
76
77 do {
78 irqnr = __raw_readl(icoll_base + HW_ICOLL_STAT_OFFSET);
79 if (irqnr != 0x7f) {
80 __raw_writel(irqnr, icoll_base + HW_ICOLL_VECTOR);
81 irqnr = irq_find_mapping(icoll_domain, irqnr);
82 handle_IRQ(irqnr, regs);
83 continue;
84 }
85 break;
86 } while (1);
87}
88
89static int icoll_irq_domain_map(struct irq_domain *d, unsigned int virq,
90 irq_hw_number_t hw)
91{
92 irq_set_chip_and_handler(virq, &mxs_icoll_chip, handle_level_irq);
93 set_irq_flags(virq, IRQF_VALID);
94
95 return 0;
96}
69 97
98static struct irq_domain_ops icoll_irq_domain_ops = {
99 .map = icoll_irq_domain_map,
100 .xlate = irq_domain_xlate_onecell,
101};
102
103void __init icoll_of_init(struct device_node *np,
104 struct device_node *interrupt_parent)
105{
70 /* 106 /*
71 * Interrupt Collector reset, which initializes the priority 107 * Interrupt Collector reset, which initializes the priority
72 * for each irq to level 0. 108 * for each irq to level 0.
73 */ 109 */
74 mxs_reset_block(icoll_base + HW_ICOLL_CTRL); 110 mxs_reset_block(icoll_base + HW_ICOLL_CTRL);
75 111
76 for (i = 0; i < MXS_INTERNAL_IRQS; i++) { 112 icoll_domain = irq_domain_add_linear(np, ICOLL_NUM_IRQS,
77 irq_set_chip_and_handler(i, &mxs_icoll_chip, handle_level_irq); 113 &icoll_irq_domain_ops, NULL);
78 set_irq_flags(i, IRQF_VALID); 114 WARN_ON(!icoll_domain);
79 } 115}
116
117static const struct of_device_id icoll_of_match[] __initconst = {
118 {.compatible = "fsl,icoll", .data = icoll_of_init},
119 { /* sentinel */ }
120};
121
122void __init icoll_init_irq(void)
123{
124 of_irq_init(icoll_of_match);
80} 125}
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
index de6c7ba4254..be5a9c93cb2 100644
--- a/arch/arm/mach-mxs/include/mach/common.h
+++ b/arch/arm/mach-mxs/include/mach/common.h
@@ -13,25 +13,17 @@
13 13
14extern const u32 *mxs_get_ocotp(void); 14extern const u32 *mxs_get_ocotp(void);
15extern int mxs_reset_block(void __iomem *); 15extern int mxs_reset_block(void __iomem *);
16extern void mxs_timer_init(int); 16extern void mxs_timer_init(void);
17extern void mxs_restart(char, const char *); 17extern void mxs_restart(char, const char *);
18extern int mxs_saif_clkmux_select(unsigned int clkmux); 18extern int mxs_saif_clkmux_select(unsigned int clkmux);
19 19
20extern void mx23_soc_init(void);
21extern int mx23_clocks_init(void); 20extern int mx23_clocks_init(void);
22extern void mx23_map_io(void); 21extern void mx23_map_io(void);
23extern void mx23_init_irq(void);
24 22
25extern void mx28_soc_init(void);
26extern int mx28_clocks_init(void); 23extern int mx28_clocks_init(void);
27extern void mx28_map_io(void); 24extern void mx28_map_io(void);
28extern void mx28_init_irq(void);
29 25
30extern void icoll_init_irq(void); 26extern void icoll_init_irq(void);
31 27extern void icoll_handle_irq(struct pt_regs *);
32extern struct platform_device *mxs_add_dma(const char *devid,
33 resource_size_t base);
34extern struct platform_device *mxs_add_gpio(char *name, int id,
35 resource_size_t iobase, int irq);
36 28
37#endif /* __MACH_MXS_COMMON_H__ */ 29#endif /* __MACH_MXS_COMMON_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h
deleted file mode 100644
index e8b1d958240..00000000000
--- a/arch/arm/mach-mxs/include/mach/devices-common.h
+++ /dev/null
@@ -1,114 +0,0 @@
1/*
2 * Copyright (C) 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <linux/kernel.h>
10#include <linux/platform_device.h>
11#include <linux/init.h>
12#include <linux/amba/bus.h>
13
14extern struct device mxs_apbh_bus;
15
16struct platform_device *mxs_add_platform_device_dmamask(
17 const char *name, int id,
18 const struct resource *res, unsigned int num_resources,
19 const void *data, size_t size_data, u64 dmamask);
20
21static inline struct platform_device *mxs_add_platform_device(
22 const char *name, int id,
23 const struct resource *res, unsigned int num_resources,
24 const void *data, size_t size_data)
25{
26 return mxs_add_platform_device_dmamask(
27 name, id, res, num_resources, data, size_data, 0);
28}
29
30/* auart */
31struct mxs_auart_data {
32 int id;
33 resource_size_t iobase;
34 resource_size_t iosize;
35 resource_size_t irq;
36};
37struct platform_device *__init mxs_add_auart(
38 const struct mxs_auart_data *data);
39
40/* fec */
41#include <linux/fec.h>
42struct mxs_fec_data {
43 int id;
44 resource_size_t iobase;
45 resource_size_t iosize;
46 resource_size_t irq;
47};
48struct platform_device *__init mxs_add_fec(
49 const struct mxs_fec_data *data,
50 const struct fec_platform_data *pdata);
51
52/* flexcan */
53#include <linux/can/platform/flexcan.h>
54struct mxs_flexcan_data {
55 int id;
56 resource_size_t iobase;
57 resource_size_t iosize;
58 resource_size_t irq;
59};
60struct platform_device *__init mxs_add_flexcan(
61 const struct mxs_flexcan_data *data,
62 const struct flexcan_platform_data *pdata);
63
64/* gpmi-nand */
65#include <linux/mtd/gpmi-nand.h>
66struct mxs_gpmi_nand_data {
67 const char *devid;
68 const struct resource res[GPMI_NAND_RES_SIZE];
69};
70struct platform_device *__init
71mxs_add_gpmi_nand(const struct gpmi_nand_platform_data *pdata,
72 const struct mxs_gpmi_nand_data *data);
73
74/* i2c */
75struct mxs_mxs_i2c_data {
76 int id;
77 resource_size_t iobase;
78 resource_size_t errirq;
79 resource_size_t dmairq;
80};
81struct platform_device * __init mxs_add_mxs_i2c(
82 const struct mxs_mxs_i2c_data *data);
83
84/* mmc */
85#include <linux/mmc/mxs-mmc.h>
86struct mxs_mxs_mmc_data {
87 const char *devid;
88 int id;
89 resource_size_t iobase;
90 resource_size_t dma;
91 resource_size_t irq_err;
92 resource_size_t irq_dma;
93};
94struct platform_device *__init mxs_add_mxs_mmc(
95 const struct mxs_mxs_mmc_data *data,
96 const struct mxs_mmc_platform_data *pdata);
97
98/* pwm */
99struct platform_device *__init mxs_add_mxs_pwm(
100 resource_size_t iobase, int id);
101
102/* saif */
103#include <sound/saif.h>
104struct mxs_saif_data {
105 int id;
106 resource_size_t iobase;
107 resource_size_t irq;
108 resource_size_t dma;
109 resource_size_t dmairq;
110};
111
112struct platform_device *__init mxs_add_saif(
113 const struct mxs_saif_data *data,
114 const struct mxs_saif_platform_data *pdata);
diff --git a/arch/arm/mach-mxs/include/mach/gpio.h b/arch/arm/mach-mxs/include/mach/gpio.h
deleted file mode 100644
index 40a8c178f10..00000000000
--- a/arch/arm/mach-mxs/include/mach/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/mach-mxs/include/mach/iomux-mx23.h b/arch/arm/mach-mxs/include/mach/iomux-mx23.h
deleted file mode 100644
index b0190a4822f..00000000000
--- a/arch/arm/mach-mxs/include/mach/iomux-mx23.h
+++ /dev/null
@@ -1,355 +0,0 @@
1/*
2 * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com>
3 * Copyright (C) 2010 Freescale Semiconductor, Inc.
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#ifndef __MACH_IOMUX_MX23_H__
14#define __MACH_IOMUX_MX23_H__
15
16#include <mach/iomux.h>
17
18/*
19 * The naming convention for the pad modes is MX23_PAD_<padname>__<padmode>
20 * If <padname> or <padmode> refers to a GPIO, it is named GPIO_<unit>_<num>
21 * See also iomux.h
22 *
23 * BANK PIN MUX
24 */
25/* MUXSEL_0 */
26#define MX23_PAD_GPMI_D00__GPMI_D00 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_0)
27#define MX23_PAD_GPMI_D01__GPMI_D01 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_0)
28#define MX23_PAD_GPMI_D02__GPMI_D02 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_0)
29#define MX23_PAD_GPMI_D03__GPMI_D03 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_0)
30#define MX23_PAD_GPMI_D04__GPMI_D04 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_0)
31#define MX23_PAD_GPMI_D05__GPMI_D05 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_0)
32#define MX23_PAD_GPMI_D06__GPMI_D06 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_0)
33#define MX23_PAD_GPMI_D07__GPMI_D07 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_0)
34#define MX23_PAD_GPMI_D08__GPMI_D08 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_0)
35#define MX23_PAD_GPMI_D09__GPMI_D09 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_0)
36#define MX23_PAD_GPMI_D10__GPMI_D10 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_0)
37#define MX23_PAD_GPMI_D11__GPMI_D11 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_0)
38#define MX23_PAD_GPMI_D12__GPMI_D12 MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_0)
39#define MX23_PAD_GPMI_D13__GPMI_D13 MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_0)
40#define MX23_PAD_GPMI_D14__GPMI_D14 MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_0)
41#define MX23_PAD_GPMI_D15__GPMI_D15 MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_0)
42#define MX23_PAD_GPMI_CLE__GPMI_CLE MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_0)
43#define MX23_PAD_GPMI_ALE__GPMI_ALE MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_0)
44#define MX23_PAD_GPMI_CE2N__GPMI_CE2N MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_0)
45#define MX23_PAD_GPMI_RDY0__GPMI_RDY0 MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_0)
46#define MX23_PAD_GPMI_RDY1__GPMI_RDY1 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_0)
47#define MX23_PAD_GPMI_RDY2__GPMI_RDY2 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_0)
48#define MX23_PAD_GPMI_RDY3__GPMI_RDY3 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_0)
49#define MX23_PAD_GPMI_WPN__GPMI_WPN MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_0)
50#define MX23_PAD_GPMI_WRN__GPMI_WRN MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_0)
51#define MX23_PAD_GPMI_RDN__GPMI_RDN MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_0)
52#define MX23_PAD_AUART1_CTS__AUART1_CTS MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_0)
53#define MX23_PAD_AUART1_RTS__AUART1_RTS MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_0)
54#define MX23_PAD_AUART1_RX__AUART1_RX MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_0)
55#define MX23_PAD_AUART1_TX__AUART1_TX MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_0)
56#define MX23_PAD_I2C_SCL__I2C_SCL MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_0)
57#define MX23_PAD_I2C_SDA__I2C_SDA MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_0)
58
59#define MX23_PAD_LCD_D00__LCD_D00 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_0)
60#define MX23_PAD_LCD_D01__LCD_D01 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_0)
61#define MX23_PAD_LCD_D02__LCD_D02 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_0)
62#define MX23_PAD_LCD_D03__LCD_D03 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_0)
63#define MX23_PAD_LCD_D04__LCD_D04 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_0)
64#define MX23_PAD_LCD_D05__LCD_D05 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_0)
65#define MX23_PAD_LCD_D06__LCD_D06 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_0)
66#define MX23_PAD_LCD_D07__LCD_D07 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_0)
67#define MX23_PAD_LCD_D08__LCD_D08 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_0)
68#define MX23_PAD_LCD_D09__LCD_D09 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_0)
69#define MX23_PAD_LCD_D10__LCD_D10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_0)
70#define MX23_PAD_LCD_D11__LCD_D11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_0)
71#define MX23_PAD_LCD_D12__LCD_D12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_0)
72#define MX23_PAD_LCD_D13__LCD_D13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_0)
73#define MX23_PAD_LCD_D14__LCD_D14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_0)
74#define MX23_PAD_LCD_D15__LCD_D15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_0)
75#define MX23_PAD_LCD_D16__LCD_D16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_0)
76#define MX23_PAD_LCD_D17__LCD_D17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_0)
77#define MX23_PAD_LCD_RESET__LCD_RESET MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_0)
78#define MX23_PAD_LCD_RS__LCD_RS MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_0)
79#define MX23_PAD_LCD_WR__LCD_WR MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_0)
80#define MX23_PAD_LCD_CS__LCD_CS MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_0)
81#define MX23_PAD_LCD_DOTCK__LCD_DOTCK MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_0)
82#define MX23_PAD_LCD_ENABLE__LCD_ENABLE MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_0)
83#define MX23_PAD_LCD_HSYNC__LCD_HSYNC MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_0)
84#define MX23_PAD_LCD_VSYNC__LCD_VSYNC MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_0)
85#define MX23_PAD_PWM0__PWM0 MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_0)
86#define MX23_PAD_PWM1__PWM1 MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_0)
87#define MX23_PAD_PWM2__PWM2 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_0)
88#define MX23_PAD_PWM3__PWM3 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_0)
89#define MX23_PAD_PWM4__PWM4 MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_0)
90
91#define MX23_PAD_SSP1_CMD__SSP1_CMD MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_0)
92#define MX23_PAD_SSP1_DETECT__SSP1_DETECT MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_0)
93#define MX23_PAD_SSP1_DATA0__SSP1_DATA0 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_0)
94#define MX23_PAD_SSP1_DATA1__SSP1_DATA1 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_0)
95#define MX23_PAD_SSP1_DATA2__SSP1_DATA2 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_0)
96#define MX23_PAD_SSP1_DATA3__SSP1_DATA3 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_0)
97#define MX23_PAD_SSP1_SCK__SSP1_SCK MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_0)
98#define MX23_PAD_ROTARYA__ROTARYA MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_0)
99#define MX23_PAD_ROTARYB__ROTARYB MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_0)
100#define MX23_PAD_EMI_A00__EMI_A00 MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_0)
101#define MX23_PAD_EMI_A01__EMI_A01 MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_0)
102#define MX23_PAD_EMI_A02__EMI_A02 MXS_IOMUX_PAD_NAKED(2, 11, PAD_MUXSEL_0)
103#define MX23_PAD_EMI_A03__EMI_A03 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_0)
104#define MX23_PAD_EMI_A04__EMI_A04 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_0)
105#define MX23_PAD_EMI_A05__EMI_A05 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_0)
106#define MX23_PAD_EMI_A06__EMI_A06 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_0)
107#define MX23_PAD_EMI_A07__EMI_A07 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_0)
108#define MX23_PAD_EMI_A08__EMI_A08 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_0)
109#define MX23_PAD_EMI_A09__EMI_A09 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_0)
110#define MX23_PAD_EMI_A10__EMI_A10 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_0)
111#define MX23_PAD_EMI_A11__EMI_A11 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_0)
112#define MX23_PAD_EMI_A12__EMI_A12 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_0)
113#define MX23_PAD_EMI_BA0__EMI_BA0 MXS_IOMUX_PAD_NAKED(2, 22, PAD_MUXSEL_0)
114#define MX23_PAD_EMI_BA1__EMI_BA1 MXS_IOMUX_PAD_NAKED(2, 23, PAD_MUXSEL_0)
115#define MX23_PAD_EMI_CASN__EMI_CASN MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_0)
116#define MX23_PAD_EMI_CE0N__EMI_CE0N MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_0)
117#define MX23_PAD_EMI_CE1N__EMI_CE1N MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_0)
118#define MX23_PAD_GPMI_CE1N__GPMI_CE1N MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_0)
119#define MX23_PAD_GPMI_CE0N__GPMI_CE0N MXS_IOMUX_PAD_NAKED(2, 28, PAD_MUXSEL_0)
120#define MX23_PAD_EMI_CKE__EMI_CKE MXS_IOMUX_PAD_NAKED(2, 29, PAD_MUXSEL_0)
121#define MX23_PAD_EMI_RASN__EMI_RASN MXS_IOMUX_PAD_NAKED(2, 30, PAD_MUXSEL_0)
122#define MX23_PAD_EMI_WEN__EMI_WEN MXS_IOMUX_PAD_NAKED(2, 31, PAD_MUXSEL_0)
123
124#define MX23_PAD_EMI_D00__EMI_D00 MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_0)
125#define MX23_PAD_EMI_D01__EMI_D01 MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_0)
126#define MX23_PAD_EMI_D02__EMI_D02 MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_0)
127#define MX23_PAD_EMI_D03__EMI_D03 MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_0)
128#define MX23_PAD_EMI_D04__EMI_D04 MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_0)
129#define MX23_PAD_EMI_D05__EMI_D05 MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_0)
130#define MX23_PAD_EMI_D06__EMI_D06 MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_0)
131#define MX23_PAD_EMI_D07__EMI_D07 MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_0)
132#define MX23_PAD_EMI_D08__EMI_D08 MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_0)
133#define MX23_PAD_EMI_D09__EMI_D09 MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_0)
134#define MX23_PAD_EMI_D10__EMI_D10 MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_0)
135#define MX23_PAD_EMI_D11__EMI_D11 MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_0)
136#define MX23_PAD_EMI_D12__EMI_D12 MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_0)
137#define MX23_PAD_EMI_D13__EMI_D13 MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_0)
138#define MX23_PAD_EMI_D14__EMI_D14 MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_0)
139#define MX23_PAD_EMI_D15__EMI_D15 MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_0)
140#define MX23_PAD_EMI_DQM0__EMI_DQM0 MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_0)
141#define MX23_PAD_EMI_DQM1__EMI_DQM1 MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_0)
142#define MX23_PAD_EMI_DQS0__EMI_DQS0 MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_0)
143#define MX23_PAD_EMI_DQS1__EMI_DQS1 MXS_IOMUX_PAD_NAKED(3, 19, PAD_MUXSEL_0)
144#define MX23_PAD_EMI_CLK__EMI_CLK MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_0)
145#define MX23_PAD_EMI_CLKN__EMI_CLKN MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_0)
146
147/* MUXSEL_1 */
148#define MX23_PAD_GPMI_D00__LCD_D8 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_1)
149#define MX23_PAD_GPMI_D01__LCD_D9 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_1)
150#define MX23_PAD_GPMI_D02__LCD_D10 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_1)
151#define MX23_PAD_GPMI_D03__LCD_D11 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_1)
152#define MX23_PAD_GPMI_D04__LCD_D12 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_1)
153#define MX23_PAD_GPMI_D05__LCD_D13 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_1)
154#define MX23_PAD_GPMI_D06__LCD_D14 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_1)
155#define MX23_PAD_GPMI_D07__LCD_D15 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_1)
156#define MX23_PAD_GPMI_D08__LCD_D18 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_1)
157#define MX23_PAD_GPMI_D09__LCD_D19 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_1)
158#define MX23_PAD_GPMI_D10__LCD_D20 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_1)
159#define MX23_PAD_GPMI_D11__LCD_D21 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_1)
160#define MX23_PAD_GPMI_D12__LCD_D22 MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_1)
161#define MX23_PAD_GPMI_D13__LCD_D23 MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_1)
162#define MX23_PAD_GPMI_D14__AUART2_RX MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_1)
163#define MX23_PAD_GPMI_D15__AUART2_TX MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_1)
164#define MX23_PAD_GPMI_CLE__LCD_D16 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_1)
165#define MX23_PAD_GPMI_ALE__LCD_D17 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_1)
166#define MX23_PAD_GPMI_CE2N__ATA_A2 MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_1)
167#define MX23_PAD_AUART1_RTS__IR_CLK MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_1)
168#define MX23_PAD_AUART1_RX__IR_RX MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_1)
169#define MX23_PAD_AUART1_TX__IR_TX MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_1)
170#define MX23_PAD_I2C_SCL__GPMI_RDY2 MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_1)
171#define MX23_PAD_I2C_SDA__GPMI_CE2N MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_1)
172
173#define MX23_PAD_LCD_D00__ETM_DA8 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_1)
174#define MX23_PAD_LCD_D01__ETM_DA9 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_1)
175#define MX23_PAD_LCD_D02__ETM_DA10 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_1)
176#define MX23_PAD_LCD_D03__ETM_DA11 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_1)
177#define MX23_PAD_LCD_D04__ETM_DA12 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_1)
178#define MX23_PAD_LCD_D05__ETM_DA13 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_1)
179#define MX23_PAD_LCD_D06__ETM_DA14 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_1)
180#define MX23_PAD_LCD_D07__ETM_DA15 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_1)
181#define MX23_PAD_LCD_D08__ETM_DA0 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_1)
182#define MX23_PAD_LCD_D09__ETM_DA1 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_1)
183#define MX23_PAD_LCD_D10__ETM_DA2 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_1)
184#define MX23_PAD_LCD_D11__ETM_DA3 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_1)
185#define MX23_PAD_LCD_D12__ETM_DA4 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_1)
186#define MX23_PAD_LCD_D13__ETM_DA5 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_1)
187#define MX23_PAD_LCD_D14__ETM_DA6 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_1)
188#define MX23_PAD_LCD_D15__ETM_DA7 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_1)
189#define MX23_PAD_LCD_RESET__ETM_TCTL MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_1)
190#define MX23_PAD_LCD_RS__ETM_TCLK MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_1)
191#define MX23_PAD_LCD_DOTCK__GPMI_RDY3 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_1)
192#define MX23_PAD_LCD_ENABLE__I2C_SCL MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_1)
193#define MX23_PAD_LCD_HSYNC__I2C_SDA MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_1)
194#define MX23_PAD_LCD_VSYNC__LCD_BUSY MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_1)
195#define MX23_PAD_PWM0__ROTARYA MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_1)
196#define MX23_PAD_PWM1__ROTARYB MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_1)
197#define MX23_PAD_PWM2__GPMI_RDY3 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_1)
198#define MX23_PAD_PWM3__ETM_TCTL MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_1)
199#define MX23_PAD_PWM4__ETM_TCLK MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_1)
200
201#define MX23_PAD_SSP1_DETECT__GPMI_CE3N MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_1)
202#define MX23_PAD_SSP1_DATA1__I2C_SCL MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_1)
203#define MX23_PAD_SSP1_DATA2__I2C_SDA MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_1)
204#define MX23_PAD_ROTARYA__AUART2_RTS MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_1)
205#define MX23_PAD_ROTARYB__AUART2_CTS MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_1)
206
207/* MUXSEL_2 */
208#define MX23_PAD_GPMI_D00__SSP2_DATA0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_2)
209#define MX23_PAD_GPMI_D01__SSP2_DATA1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_2)
210#define MX23_PAD_GPMI_D02__SSP2_DATA2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_2)
211#define MX23_PAD_GPMI_D03__SSP2_DATA3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_2)
212#define MX23_PAD_GPMI_D04__SSP2_DATA4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_2)
213#define MX23_PAD_GPMI_D05__SSP2_DATA5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_2)
214#define MX23_PAD_GPMI_D06__SSP2_DATA6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_2)
215#define MX23_PAD_GPMI_D07__SSP2_DATA7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_2)
216#define MX23_PAD_GPMI_D08__SSP1_DATA4 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_2)
217#define MX23_PAD_GPMI_D09__SSP1_DATA5 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_2)
218#define MX23_PAD_GPMI_D10__SSP1_DATA6 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_2)
219#define MX23_PAD_GPMI_D11__SSP1_DATA7 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_2)
220#define MX23_PAD_GPMI_D15__GPMI_CE3N MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_2)
221#define MX23_PAD_GPMI_RDY0__SSP2_DETECT MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_2)
222#define MX23_PAD_GPMI_RDY1__SSP2_CMD MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_2)
223#define MX23_PAD_GPMI_WRN__SSP2_SCK MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_2)
224#define MX23_PAD_AUART1_CTS__SSP1_DATA4 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_2)
225#define MX23_PAD_AUART1_RTS__SSP1_DATA5 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_2)
226#define MX23_PAD_AUART1_RX__SSP1_DATA6 MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_2)
227#define MX23_PAD_AUART1_TX__SSP1_DATA7 MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_2)
228#define MX23_PAD_I2C_SCL__AUART1_TX MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_2)
229#define MX23_PAD_I2C_SDA__AUART1_RX MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_2)
230
231#define MX23_PAD_LCD_D08__SAIF2_SDATA0 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_2)
232#define MX23_PAD_LCD_D09__SAIF1_SDATA0 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_2)
233#define MX23_PAD_LCD_D10__SAIF_MCLK_BITCLK MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_2)
234#define MX23_PAD_LCD_D11__SAIF_LRCLK MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_2)
235#define MX23_PAD_LCD_D12__SAIF2_SDATA1 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_2)
236#define MX23_PAD_LCD_D13__SAIF2_SDATA2 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_2)
237#define MX23_PAD_LCD_D14__SAIF1_SDATA2 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_2)
238#define MX23_PAD_LCD_D15__SAIF1_SDATA1 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_2)
239#define MX23_PAD_LCD_D16__SAIF_ALT_BITCLK MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_2)
240#define MX23_PAD_LCD_RESET__GPMI_CE3N MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_2)
241#define MX23_PAD_PWM0__DUART_RX MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_2)
242#define MX23_PAD_PWM1__DUART_TX MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_2)
243#define MX23_PAD_PWM3__AUART1_CTS MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_2)
244#define MX23_PAD_PWM4__AUART1_RTS MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_2)
245
246#define MX23_PAD_SSP1_CMD__JTAG_TDO MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_2)
247#define MX23_PAD_SSP1_DETECT__USB_OTG_ID MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_2)
248#define MX23_PAD_SSP1_DATA0__JTAG_TDI MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_2)
249#define MX23_PAD_SSP1_DATA1__JTAG_TCLK MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_2)
250#define MX23_PAD_SSP1_DATA2__JTAG_RTCK MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_2)
251#define MX23_PAD_SSP1_DATA3__JTAG_TMS MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_2)
252#define MX23_PAD_SSP1_SCK__JTAG_TRST MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_2)
253#define MX23_PAD_ROTARYA__SPDIF MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_2)
254#define MX23_PAD_ROTARYB__GPMI_CE3N MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_2)
255
256/* MUXSEL_GPIO */
257#define MX23_PAD_GPMI_D00__GPIO_0_0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_GPIO)
258#define MX23_PAD_GPMI_D01__GPIO_0_1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_GPIO)
259#define MX23_PAD_GPMI_D02__GPIO_0_2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_GPIO)
260#define MX23_PAD_GPMI_D03__GPIO_0_3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_GPIO)
261#define MX23_PAD_GPMI_D04__GPIO_0_4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_GPIO)
262#define MX23_PAD_GPMI_D05__GPIO_0_5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_GPIO)
263#define MX23_PAD_GPMI_D06__GPIO_0_6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_GPIO)
264#define MX23_PAD_GPMI_D07__GPIO_0_7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_GPIO)
265#define MX23_PAD_GPMI_D08__GPIO_0_8 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_GPIO)
266#define MX23_PAD_GPMI_D09__GPIO_0_9 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_GPIO)
267#define MX23_PAD_GPMI_D10__GPIO_0_10 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_GPIO)
268#define MX23_PAD_GPMI_D11__GPIO_0_11 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_GPIO)
269#define MX23_PAD_GPMI_D12__GPIO_0_12 MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_GPIO)
270#define MX23_PAD_GPMI_D13__GPIO_0_13 MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_GPIO)
271#define MX23_PAD_GPMI_D14__GPIO_0_14 MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_GPIO)
272#define MX23_PAD_GPMI_D15__GPIO_0_15 MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_GPIO)
273#define MX23_PAD_GPMI_CLE__GPIO_0_16 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_GPIO)
274#define MX23_PAD_GPMI_ALE__GPIO_0_17 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_GPIO)
275#define MX23_PAD_GPMI_CE2N__GPIO_0_18 MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_GPIO)
276#define MX23_PAD_GPMI_RDY0__GPIO_0_19 MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_GPIO)
277#define MX23_PAD_GPMI_RDY1__GPIO_0_20 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_GPIO)
278#define MX23_PAD_GPMI_RDY2__GPIO_0_21 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_GPIO)
279#define MX23_PAD_GPMI_RDY3__GPIO_0_22 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_GPIO)
280#define MX23_PAD_GPMI_WPN__GPIO_0_23 MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_GPIO)
281#define MX23_PAD_GPMI_WRN__GPIO_0_24 MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_GPIO)
282#define MX23_PAD_GPMI_RDN__GPIO_0_25 MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_GPIO)
283#define MX23_PAD_AUART1_CTS__GPIO_0_26 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_GPIO)
284#define MX23_PAD_AUART1_RTS__GPIO_0_27 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_GPIO)
285#define MX23_PAD_AUART1_RX__GPIO_0_28 MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_GPIO)
286#define MX23_PAD_AUART1_TX__GPIO_0_29 MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_GPIO)
287#define MX23_PAD_I2C_SCL__GPIO_0_30 MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_GPIO)
288#define MX23_PAD_I2C_SDA__GPIO_0_31 MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_GPIO)
289
290#define MX23_PAD_LCD_D00__GPIO_1_0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_GPIO)
291#define MX23_PAD_LCD_D01__GPIO_1_1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_GPIO)
292#define MX23_PAD_LCD_D02__GPIO_1_2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_GPIO)
293#define MX23_PAD_LCD_D03__GPIO_1_3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_GPIO)
294#define MX23_PAD_LCD_D04__GPIO_1_4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_GPIO)
295#define MX23_PAD_LCD_D05__GPIO_1_5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_GPIO)
296#define MX23_PAD_LCD_D06__GPIO_1_6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_GPIO)
297#define MX23_PAD_LCD_D07__GPIO_1_7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_GPIO)
298#define MX23_PAD_LCD_D08__GPIO_1_8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_GPIO)
299#define MX23_PAD_LCD_D09__GPIO_1_9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_GPIO)
300#define MX23_PAD_LCD_D10__GPIO_1_10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_GPIO)
301#define MX23_PAD_LCD_D11__GPIO_1_11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_GPIO)
302#define MX23_PAD_LCD_D12__GPIO_1_12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_GPIO)
303#define MX23_PAD_LCD_D13__GPIO_1_13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_GPIO)
304#define MX23_PAD_LCD_D14__GPIO_1_14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_GPIO)
305#define MX23_PAD_LCD_D15__GPIO_1_15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_GPIO)
306#define MX23_PAD_LCD_D16__GPIO_1_16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_GPIO)
307#define MX23_PAD_LCD_D17__GPIO_1_17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_GPIO)
308#define MX23_PAD_LCD_RESET__GPIO_1_18 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_GPIO)
309#define MX23_PAD_LCD_RS__GPIO_1_19 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_GPIO)
310#define MX23_PAD_LCD_WR__GPIO_1_20 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_GPIO)
311#define MX23_PAD_LCD_CS__GPIO_1_21 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_GPIO)
312#define MX23_PAD_LCD_DOTCK__GPIO_1_22 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_GPIO)
313#define MX23_PAD_LCD_ENABLE__GPIO_1_23 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_GPIO)
314#define MX23_PAD_LCD_HSYNC__GPIO_1_24 MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_GPIO)
315#define MX23_PAD_LCD_VSYNC__GPIO_1_25 MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_GPIO)
316#define MX23_PAD_PWM0__GPIO_1_26 MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_GPIO)
317#define MX23_PAD_PWM1__GPIO_1_27 MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_GPIO)
318#define MX23_PAD_PWM2__GPIO_1_28 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_GPIO)
319#define MX23_PAD_PWM3__GPIO_1_29 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_GPIO)
320#define MX23_PAD_PWM4__GPIO_1_30 MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_GPIO)
321
322#define MX23_PAD_SSP1_CMD__GPIO_2_0 MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_GPIO)
323#define MX23_PAD_SSP1_DETECT__GPIO_2_1 MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_GPIO)
324#define MX23_PAD_SSP1_DATA0__GPIO_2_2 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_GPIO)
325#define MX23_PAD_SSP1_DATA1__GPIO_2_3 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_GPIO)
326#define MX23_PAD_SSP1_DATA2__GPIO_2_4 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_GPIO)
327#define MX23_PAD_SSP1_DATA3__GPIO_2_5 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_GPIO)
328#define MX23_PAD_SSP1_SCK__GPIO_2_6 MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_GPIO)
329#define MX23_PAD_ROTARYA__GPIO_2_7 MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_GPIO)
330#define MX23_PAD_ROTARYB__GPIO_2_8 MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_GPIO)
331#define MX23_PAD_EMI_A00__GPIO_2_9 MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_GPIO)
332#define MX23_PAD_EMI_A01__GPIO_2_10 MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_GPIO)
333#define MX23_PAD_EMI_A02__GPIO_2_11 MXS_IOMUX_PAD_NAKED(2, 11, PAD_MUXSEL_GPIO)
334#define MX23_PAD_EMI_A03__GPIO_2_12 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_GPIO)
335#define MX23_PAD_EMI_A04__GPIO_2_13 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_GPIO)
336#define MX23_PAD_EMI_A05__GPIO_2_14 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_GPIO)
337#define MX23_PAD_EMI_A06__GPIO_2_15 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_GPIO)
338#define MX23_PAD_EMI_A07__GPIO_2_16 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_GPIO)
339#define MX23_PAD_EMI_A08__GPIO_2_17 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_GPIO)
340#define MX23_PAD_EMI_A09__GPIO_2_18 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_GPIO)
341#define MX23_PAD_EMI_A10__GPIO_2_19 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_GPIO)
342#define MX23_PAD_EMI_A11__GPIO_2_20 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_GPIO)
343#define MX23_PAD_EMI_A12__GPIO_2_21 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_GPIO)
344#define MX23_PAD_EMI_BA0__GPIO_2_22 MXS_IOMUX_PAD_NAKED(2, 22, PAD_MUXSEL_GPIO)
345#define MX23_PAD_EMI_BA1__GPIO_2_23 MXS_IOMUX_PAD_NAKED(2, 23, PAD_MUXSEL_GPIO)
346#define MX23_PAD_EMI_CASN__GPIO_2_24 MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_GPIO)
347#define MX23_PAD_EMI_CE0N__GPIO_2_25 MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_GPIO)
348#define MX23_PAD_EMI_CE1N__GPIO_2_26 MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_GPIO)
349#define MX23_PAD_GPMI_CE1N__GPIO_2_27 MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_GPIO)
350#define MX23_PAD_GPMI_CE0N__GPIO_2_28 MXS_IOMUX_PAD_NAKED(2, 28, PAD_MUXSEL_GPIO)
351#define MX23_PAD_EMI_CKE__GPIO_2_29 MXS_IOMUX_PAD_NAKED(2, 29, PAD_MUXSEL_GPIO)
352#define MX23_PAD_EMI_RASN__GPIO_2_30 MXS_IOMUX_PAD_NAKED(2, 30, PAD_MUXSEL_GPIO)
353#define MX23_PAD_EMI_WEN__GPIO_2_31 MXS_IOMUX_PAD_NAKED(2, 31, PAD_MUXSEL_GPIO)
354
355#endif /* __MACH_IOMUX_MX23_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/iomux-mx28.h b/arch/arm/mach-mxs/include/mach/iomux-mx28.h
deleted file mode 100644
index f50fefd1052..00000000000
--- a/arch/arm/mach-mxs/include/mach/iomux-mx28.h
+++ /dev/null
@@ -1,537 +0,0 @@
1/*
2 * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com>
3 * Copyright (C) 2010 Freescale Semiconductor, Inc.
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#ifndef __MACH_IOMUX_MX28_H__
14#define __MACH_IOMUX_MX28_H__
15
16#include <mach/iomux.h>
17
18/*
19 * The naming convention for the pad modes is MX28_PAD_<padname>__<padmode>
20 * If <padname> or <padmode> refers to a GPIO, it is named GPIO_<unit>_<num>
21 * See also iomux.h
22 *
23 * BANK PIN MUX
24 */
25/* MUXSEL_0 */
26#define MX28_PAD_GPMI_D00__GPMI_D0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_0)
27#define MX28_PAD_GPMI_D01__GPMI_D1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_0)
28#define MX28_PAD_GPMI_D02__GPMI_D2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_0)
29#define MX28_PAD_GPMI_D03__GPMI_D3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_0)
30#define MX28_PAD_GPMI_D04__GPMI_D4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_0)
31#define MX28_PAD_GPMI_D05__GPMI_D5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_0)
32#define MX28_PAD_GPMI_D06__GPMI_D6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_0)
33#define MX28_PAD_GPMI_D07__GPMI_D7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_0)
34#define MX28_PAD_GPMI_CE0N__GPMI_CE0N MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_0)
35#define MX28_PAD_GPMI_CE1N__GPMI_CE1N MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_0)
36#define MX28_PAD_GPMI_CE2N__GPMI_CE2N MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_0)
37#define MX28_PAD_GPMI_CE3N__GPMI_CE3N MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_0)
38#define MX28_PAD_GPMI_RDY0__GPMI_READY0 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_0)
39#define MX28_PAD_GPMI_RDY1__GPMI_READY1 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_0)
40#define MX28_PAD_GPMI_RDY2__GPMI_READY2 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_0)
41#define MX28_PAD_GPMI_RDY3__GPMI_READY3 MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_0)
42#define MX28_PAD_GPMI_RDN__GPMI_RDN MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_0)
43#define MX28_PAD_GPMI_WRN__GPMI_WRN MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_0)
44#define MX28_PAD_GPMI_ALE__GPMI_ALE MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_0)
45#define MX28_PAD_GPMI_CLE__GPMI_CLE MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_0)
46#define MX28_PAD_GPMI_RESETN__GPMI_RESETN MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_0)
47
48#define MX28_PAD_LCD_D00__LCD_D0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_0)
49#define MX28_PAD_LCD_D01__LCD_D1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_0)
50#define MX28_PAD_LCD_D02__LCD_D2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_0)
51#define MX28_PAD_LCD_D03__LCD_D3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_0)
52#define MX28_PAD_LCD_D04__LCD_D4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_0)
53#define MX28_PAD_LCD_D05__LCD_D5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_0)
54#define MX28_PAD_LCD_D06__LCD_D6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_0)
55#define MX28_PAD_LCD_D07__LCD_D7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_0)
56#define MX28_PAD_LCD_D08__LCD_D8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_0)
57#define MX28_PAD_LCD_D09__LCD_D9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_0)
58#define MX28_PAD_LCD_D10__LCD_D10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_0)
59#define MX28_PAD_LCD_D11__LCD_D11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_0)
60#define MX28_PAD_LCD_D12__LCD_D12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_0)
61#define MX28_PAD_LCD_D13__LCD_D13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_0)
62#define MX28_PAD_LCD_D14__LCD_D14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_0)
63#define MX28_PAD_LCD_D15__LCD_D15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_0)
64#define MX28_PAD_LCD_D16__LCD_D16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_0)
65#define MX28_PAD_LCD_D17__LCD_D17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_0)
66#define MX28_PAD_LCD_D18__LCD_D18 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_0)
67#define MX28_PAD_LCD_D19__LCD_D19 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_0)
68#define MX28_PAD_LCD_D20__LCD_D20 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_0)
69#define MX28_PAD_LCD_D21__LCD_D21 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_0)
70#define MX28_PAD_LCD_D22__LCD_D22 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_0)
71#define MX28_PAD_LCD_D23__LCD_D23 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_0)
72#define MX28_PAD_LCD_RD_E__LCD_RD_E MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_0)
73#define MX28_PAD_LCD_WR_RWN__LCD_WR_RWN MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_0)
74#define MX28_PAD_LCD_RS__LCD_RS MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_0)
75#define MX28_PAD_LCD_CS__LCD_CS MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_0)
76#define MX28_PAD_LCD_VSYNC__LCD_VSYNC MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_0)
77#define MX28_PAD_LCD_HSYNC__LCD_HSYNC MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_0)
78#define MX28_PAD_LCD_DOTCLK__LCD_DOTCLK MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_0)
79#define MX28_PAD_LCD_ENABLE__LCD_ENABLE MXS_IOMUX_PAD_NAKED(1, 31, PAD_MUXSEL_0)
80
81#define MX28_PAD_SSP0_DATA0__SSP0_D0 MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_0)
82#define MX28_PAD_SSP0_DATA1__SSP0_D1 MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_0)
83#define MX28_PAD_SSP0_DATA2__SSP0_D2 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_0)
84#define MX28_PAD_SSP0_DATA3__SSP0_D3 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_0)
85#define MX28_PAD_SSP0_DATA4__SSP0_D4 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_0)
86#define MX28_PAD_SSP0_DATA5__SSP0_D5 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_0)
87#define MX28_PAD_SSP0_DATA6__SSP0_D6 MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_0)
88#define MX28_PAD_SSP0_DATA7__SSP0_D7 MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_0)
89#define MX28_PAD_SSP0_CMD__SSP0_CMD MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_0)
90#define MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_0)
91#define MX28_PAD_SSP0_SCK__SSP0_SCK MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_0)
92#define MX28_PAD_SSP1_SCK__SSP1_SCK MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_0)
93#define MX28_PAD_SSP1_CMD__SSP1_CMD MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_0)
94#define MX28_PAD_SSP1_DATA0__SSP1_D0 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_0)
95#define MX28_PAD_SSP1_DATA3__SSP1_D3 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_0)
96#define MX28_PAD_SSP2_SCK__SSP2_SCK MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_0)
97#define MX28_PAD_SSP2_MOSI__SSP2_CMD MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_0)
98#define MX28_PAD_SSP2_MISO__SSP2_D0 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_0)
99#define MX28_PAD_SSP2_SS0__SSP2_D3 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_0)
100#define MX28_PAD_SSP2_SS1__SSP2_D4 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_0)
101#define MX28_PAD_SSP2_SS2__SSP2_D5 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_0)
102#define MX28_PAD_SSP3_SCK__SSP3_SCK MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_0)
103#define MX28_PAD_SSP3_MOSI__SSP3_CMD MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_0)
104#define MX28_PAD_SSP3_MISO__SSP3_D0 MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_0)
105#define MX28_PAD_SSP3_SS0__SSP3_D3 MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_0)
106
107#define MX28_PAD_AUART0_RX__AUART0_RX MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_0)
108#define MX28_PAD_AUART0_TX__AUART0_TX MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_0)
109#define MX28_PAD_AUART0_CTS__AUART0_CTS MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_0)
110#define MX28_PAD_AUART0_RTS__AUART0_RTS MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_0)
111#define MX28_PAD_AUART1_RX__AUART1_RX MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_0)
112#define MX28_PAD_AUART1_TX__AUART1_TX MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_0)
113#define MX28_PAD_AUART1_CTS__AUART1_CTS MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_0)
114#define MX28_PAD_AUART1_RTS__AUART1_RTS MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_0)
115#define MX28_PAD_AUART2_RX__AUART2_RX MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_0)
116#define MX28_PAD_AUART2_TX__AUART2_TX MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_0)
117#define MX28_PAD_AUART2_CTS__AUART2_CTS MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_0)
118#define MX28_PAD_AUART2_RTS__AUART2_RTS MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_0)
119#define MX28_PAD_AUART3_RX__AUART3_RX MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_0)
120#define MX28_PAD_AUART3_TX__AUART3_TX MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_0)
121#define MX28_PAD_AUART3_CTS__AUART3_CTS MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_0)
122#define MX28_PAD_AUART3_RTS__AUART3_RTS MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_0)
123#define MX28_PAD_PWM0__PWM_0 MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_0)
124#define MX28_PAD_PWM1__PWM_1 MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_0)
125#define MX28_PAD_PWM2__PWM_2 MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_0)
126#define MX28_PAD_SAIF0_MCLK__SAIF0_MCLK MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_0)
127#define MX28_PAD_SAIF0_LRCLK__SAIF0_LRCLK MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_0)
128#define MX28_PAD_SAIF0_BITCLK__SAIF0_BITCLK MXS_IOMUX_PAD_NAKED(3, 22, PAD_MUXSEL_0)
129#define MX28_PAD_SAIF0_SDATA0__SAIF0_SDATA0 MXS_IOMUX_PAD_NAKED(3, 23, PAD_MUXSEL_0)
130#define MX28_PAD_I2C0_SCL__I2C0_SCL MXS_IOMUX_PAD_NAKED(3, 24, PAD_MUXSEL_0)
131#define MX28_PAD_I2C0_SDA__I2C0_SDA MXS_IOMUX_PAD_NAKED(3, 25, PAD_MUXSEL_0)
132#define MX28_PAD_SAIF1_SDATA0__SAIF1_SDATA0 MXS_IOMUX_PAD_NAKED(3, 26, PAD_MUXSEL_0)
133#define MX28_PAD_SPDIF__SPDIF_TX MXS_IOMUX_PAD_NAKED(3, 27, PAD_MUXSEL_0)
134#define MX28_PAD_PWM3__PWM_3 MXS_IOMUX_PAD_NAKED(3, 28, PAD_MUXSEL_0)
135#define MX28_PAD_PWM4__PWM_4 MXS_IOMUX_PAD_NAKED(3, 29, PAD_MUXSEL_0)
136#define MX28_PAD_LCD_RESET__LCD_RESET MXS_IOMUX_PAD_NAKED(3, 30, PAD_MUXSEL_0)
137
138#define MX28_PAD_ENET0_MDC__ENET0_MDC MXS_IOMUX_PAD_NAKED(4, 0, PAD_MUXSEL_0)
139#define MX28_PAD_ENET0_MDIO__ENET0_MDIO MXS_IOMUX_PAD_NAKED(4, 1, PAD_MUXSEL_0)
140#define MX28_PAD_ENET0_RX_EN__ENET0_RX_EN MXS_IOMUX_PAD_NAKED(4, 2, PAD_MUXSEL_0)
141#define MX28_PAD_ENET0_RXD0__ENET0_RXD0 MXS_IOMUX_PAD_NAKED(4, 3, PAD_MUXSEL_0)
142#define MX28_PAD_ENET0_RXD1__ENET0_RXD1 MXS_IOMUX_PAD_NAKED(4, 4, PAD_MUXSEL_0)
143#define MX28_PAD_ENET0_TX_CLK__ENET0_TX_CLK MXS_IOMUX_PAD_NAKED(4, 5, PAD_MUXSEL_0)
144#define MX28_PAD_ENET0_TX_EN__ENET0_TX_EN MXS_IOMUX_PAD_NAKED(4, 6, PAD_MUXSEL_0)
145#define MX28_PAD_ENET0_TXD0__ENET0_TXD0 MXS_IOMUX_PAD_NAKED(4, 7, PAD_MUXSEL_0)
146#define MX28_PAD_ENET0_TXD1__ENET0_TXD1 MXS_IOMUX_PAD_NAKED(4, 8, PAD_MUXSEL_0)
147#define MX28_PAD_ENET0_RXD2__ENET0_RXD2 MXS_IOMUX_PAD_NAKED(4, 9, PAD_MUXSEL_0)
148#define MX28_PAD_ENET0_RXD3__ENET0_RXD3 MXS_IOMUX_PAD_NAKED(4, 10, PAD_MUXSEL_0)
149#define MX28_PAD_ENET0_TXD2__ENET0_TXD2 MXS_IOMUX_PAD_NAKED(4, 11, PAD_MUXSEL_0)
150#define MX28_PAD_ENET0_TXD3__ENET0_TXD3 MXS_IOMUX_PAD_NAKED(4, 12, PAD_MUXSEL_0)
151#define MX28_PAD_ENET0_RX_CLK__ENET0_RX_CLK MXS_IOMUX_PAD_NAKED(4, 13, PAD_MUXSEL_0)
152#define MX28_PAD_ENET0_COL__ENET0_COL MXS_IOMUX_PAD_NAKED(4, 14, PAD_MUXSEL_0)
153#define MX28_PAD_ENET0_CRS__ENET0_CRS MXS_IOMUX_PAD_NAKED(4, 15, PAD_MUXSEL_0)
154#define MX28_PAD_ENET_CLK__CLKCTRL_ENET MXS_IOMUX_PAD_NAKED(4, 16, PAD_MUXSEL_0)
155#define MX28_PAD_JTAG_RTCK__JTAG_RTCK MXS_IOMUX_PAD_NAKED(4, 20, PAD_MUXSEL_0)
156
157#define MX28_PAD_EMI_D00__EMI_DATA0 MXS_IOMUX_PAD_NAKED(5, 0, PAD_MUXSEL_0)
158#define MX28_PAD_EMI_D01__EMI_DATA1 MXS_IOMUX_PAD_NAKED(5, 1, PAD_MUXSEL_0)
159#define MX28_PAD_EMI_D02__EMI_DATA2 MXS_IOMUX_PAD_NAKED(5, 2, PAD_MUXSEL_0)
160#define MX28_PAD_EMI_D03__EMI_DATA3 MXS_IOMUX_PAD_NAKED(5, 3, PAD_MUXSEL_0)
161#define MX28_PAD_EMI_D04__EMI_DATA4 MXS_IOMUX_PAD_NAKED(5, 4, PAD_MUXSEL_0)
162#define MX28_PAD_EMI_D05__EMI_DATA5 MXS_IOMUX_PAD_NAKED(5, 5, PAD_MUXSEL_0)
163#define MX28_PAD_EMI_D06__EMI_DATA6 MXS_IOMUX_PAD_NAKED(5, 6, PAD_MUXSEL_0)
164#define MX28_PAD_EMI_D07__EMI_DATA7 MXS_IOMUX_PAD_NAKED(5, 7, PAD_MUXSEL_0)
165#define MX28_PAD_EMI_D08__EMI_DATA8 MXS_IOMUX_PAD_NAKED(5, 8, PAD_MUXSEL_0)
166#define MX28_PAD_EMI_D09__EMI_DATA9 MXS_IOMUX_PAD_NAKED(5, 9, PAD_MUXSEL_0)
167#define MX28_PAD_EMI_D10__EMI_DATA10 MXS_IOMUX_PAD_NAKED(5, 10, PAD_MUXSEL_0)
168#define MX28_PAD_EMI_D11__EMI_DATA11 MXS_IOMUX_PAD_NAKED(5, 11, PAD_MUXSEL_0)
169#define MX28_PAD_EMI_D12__EMI_DATA12 MXS_IOMUX_PAD_NAKED(5, 12, PAD_MUXSEL_0)
170#define MX28_PAD_EMI_D13__EMI_DATA13 MXS_IOMUX_PAD_NAKED(5, 13, PAD_MUXSEL_0)
171#define MX28_PAD_EMI_D14__EMI_DATA14 MXS_IOMUX_PAD_NAKED(5, 14, PAD_MUXSEL_0)
172#define MX28_PAD_EMI_D15__EMI_DATA15 MXS_IOMUX_PAD_NAKED(5, 15, PAD_MUXSEL_0)
173#define MX28_PAD_EMI_ODT0__EMI_ODT0 MXS_IOMUX_PAD_NAKED(5, 16, PAD_MUXSEL_0)
174#define MX28_PAD_EMI_DQM0__EMI_DQM0 MXS_IOMUX_PAD_NAKED(5, 17, PAD_MUXSEL_0)
175#define MX28_PAD_EMI_ODT1__EMI_ODT1 MXS_IOMUX_PAD_NAKED(5, 18, PAD_MUXSEL_0)
176#define MX28_PAD_EMI_DQM1__EMI_DQM1 MXS_IOMUX_PAD_NAKED(5, 19, PAD_MUXSEL_0)
177#define MX28_PAD_EMI_DDR_OPEN_FB__EMI_DDR_OPEN_FEEDBACK MXS_IOMUX_PAD_NAKED(5, 20, PAD_MUXSEL_0)
178#define MX28_PAD_EMI_CLK__EMI_CLK MXS_IOMUX_PAD_NAKED(5, 21, PAD_MUXSEL_0)
179#define MX28_PAD_EMI_DQS0__EMI_DQS0 MXS_IOMUX_PAD_NAKED(5, 22, PAD_MUXSEL_0)
180#define MX28_PAD_EMI_DQS1__EMI_DQS1 MXS_IOMUX_PAD_NAKED(5, 23, PAD_MUXSEL_0)
181#define MX28_PAD_EMI_DDR_OPEN__EMI_DDR_OPEN MXS_IOMUX_PAD_NAKED(5, 26, PAD_MUXSEL_0)
182
183#define MX28_PAD_EMI_A00__EMI_ADDR0 MXS_IOMUX_PAD_NAKED(6, 0, PAD_MUXSEL_0)
184#define MX28_PAD_EMI_A01__EMI_ADDR1 MXS_IOMUX_PAD_NAKED(6, 1, PAD_MUXSEL_0)
185#define MX28_PAD_EMI_A02__EMI_ADDR2 MXS_IOMUX_PAD_NAKED(6, 2, PAD_MUXSEL_0)
186#define MX28_PAD_EMI_A03__EMI_ADDR3 MXS_IOMUX_PAD_NAKED(6, 3, PAD_MUXSEL_0)
187#define MX28_PAD_EMI_A04__EMI_ADDR4 MXS_IOMUX_PAD_NAKED(6, 4, PAD_MUXSEL_0)
188#define MX28_PAD_EMI_A05__EMI_ADDR5 MXS_IOMUX_PAD_NAKED(6, 5, PAD_MUXSEL_0)
189#define MX28_PAD_EMI_A06__EMI_ADDR6 MXS_IOMUX_PAD_NAKED(6, 6, PAD_MUXSEL_0)
190#define MX28_PAD_EMI_A07__EMI_ADDR7 MXS_IOMUX_PAD_NAKED(6, 7, PAD_MUXSEL_0)
191#define MX28_PAD_EMI_A08__EMI_ADDR8 MXS_IOMUX_PAD_NAKED(6, 8, PAD_MUXSEL_0)
192#define MX28_PAD_EMI_A09__EMI_ADDR9 MXS_IOMUX_PAD_NAKED(6, 9, PAD_MUXSEL_0)
193#define MX28_PAD_EMI_A10__EMI_ADDR10 MXS_IOMUX_PAD_NAKED(6, 10, PAD_MUXSEL_0)
194#define MX28_PAD_EMI_A11__EMI_ADDR11 MXS_IOMUX_PAD_NAKED(6, 11, PAD_MUXSEL_0)
195#define MX28_PAD_EMI_A12__EMI_ADDR12 MXS_IOMUX_PAD_NAKED(6, 12, PAD_MUXSEL_0)
196#define MX28_PAD_EMI_A13__EMI_ADDR13 MXS_IOMUX_PAD_NAKED(6, 13, PAD_MUXSEL_0)
197#define MX28_PAD_EMI_A14__EMI_ADDR14 MXS_IOMUX_PAD_NAKED(6, 14, PAD_MUXSEL_0)
198#define MX28_PAD_EMI_BA0__EMI_BA0 MXS_IOMUX_PAD_NAKED(6, 16, PAD_MUXSEL_0)
199#define MX28_PAD_EMI_BA1__EMI_BA1 MXS_IOMUX_PAD_NAKED(6, 17, PAD_MUXSEL_0)
200#define MX28_PAD_EMI_BA2__EMI_BA2 MXS_IOMUX_PAD_NAKED(6, 18, PAD_MUXSEL_0)
201#define MX28_PAD_EMI_CASN__EMI_CASN MXS_IOMUX_PAD_NAKED(6, 19, PAD_MUXSEL_0)
202#define MX28_PAD_EMI_RASN__EMI_RASN MXS_IOMUX_PAD_NAKED(6, 20, PAD_MUXSEL_0)
203#define MX28_PAD_EMI_WEN__EMI_WEN MXS_IOMUX_PAD_NAKED(6, 21, PAD_MUXSEL_0)
204#define MX28_PAD_EMI_CE0N__EMI_CE0N MXS_IOMUX_PAD_NAKED(6, 22, PAD_MUXSEL_0)
205#define MX28_PAD_EMI_CE1N__EMI_CE1N MXS_IOMUX_PAD_NAKED(6, 23, PAD_MUXSEL_0)
206#define MX28_PAD_EMI_CKE__EMI_CKE MXS_IOMUX_PAD_NAKED(6, 24, PAD_MUXSEL_0)
207
208/* MUXSEL_1 */
209#define MX28_PAD_GPMI_D00__SSP1_D0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_1)
210#define MX28_PAD_GPMI_D01__SSP1_D1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_1)
211#define MX28_PAD_GPMI_D02__SSP1_D2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_1)
212#define MX28_PAD_GPMI_D03__SSP1_D3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_1)
213#define MX28_PAD_GPMI_D04__SSP1_D4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_1)
214#define MX28_PAD_GPMI_D05__SSP1_D5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_1)
215#define MX28_PAD_GPMI_D06__SSP1_D6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_1)
216#define MX28_PAD_GPMI_D07__SSP1_D7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_1)
217#define MX28_PAD_GPMI_CE0N__SSP3_D0 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_1)
218#define MX28_PAD_GPMI_CE1N__SSP3_D3 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_1)
219#define MX28_PAD_GPMI_CE2N__CAN1_TX MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_1)
220#define MX28_PAD_GPMI_CE3N__CAN1_RX MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_1)
221#define MX28_PAD_GPMI_RDY0__SSP1_CARD_DETECT MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_1)
222#define MX28_PAD_GPMI_RDY1__SSP1_CMD MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_1)
223#define MX28_PAD_GPMI_RDY2__CAN0_TX MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_1)
224#define MX28_PAD_GPMI_RDY3__CAN0_RX MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_1)
225#define MX28_PAD_GPMI_RDN__SSP3_SCK MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_1)
226#define MX28_PAD_GPMI_WRN__SSP1_SCK MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_1)
227#define MX28_PAD_GPMI_ALE__SSP3_D1 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_1)
228#define MX28_PAD_GPMI_CLE__SSP3_D2 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_1)
229#define MX28_PAD_GPMI_RESETN__SSP3_CMD MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_1)
230
231#define MX28_PAD_LCD_D03__ETM_DA8 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_1)
232#define MX28_PAD_LCD_D04__ETM_DA9 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_1)
233#define MX28_PAD_LCD_D08__ETM_DA3 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_1)
234#define MX28_PAD_LCD_D09__ETM_DA4 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_1)
235#define MX28_PAD_LCD_D20__ENET1_1588_EVENT2_OUT MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_1)
236#define MX28_PAD_LCD_D21__ENET1_1588_EVENT2_IN MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_1)
237#define MX28_PAD_LCD_D22__ENET1_1588_EVENT3_OUT MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_1)
238#define MX28_PAD_LCD_D23__ENET1_1588_EVENT3_IN MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_1)
239#define MX28_PAD_LCD_RD_E__LCD_VSYNC MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_1)
240#define MX28_PAD_LCD_WR_RWN__LCD_HSYNC MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_1)
241#define MX28_PAD_LCD_RS__LCD_DOTCLK MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_1)
242#define MX28_PAD_LCD_CS__LCD_ENABLE MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_1)
243#define MX28_PAD_LCD_VSYNC__SAIF1_SDATA0 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_1)
244#define MX28_PAD_LCD_HSYNC__SAIF1_SDATA1 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_1)
245#define MX28_PAD_LCD_DOTCLK__SAIF1_MCLK MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_1)
246
247#define MX28_PAD_SSP0_DATA4__SSP2_D0 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_1)
248#define MX28_PAD_SSP0_DATA5__SSP2_D3 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_1)
249#define MX28_PAD_SSP0_DATA6__SSP2_CMD MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_1)
250#define MX28_PAD_SSP0_DATA7__SSP2_SCK MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_1)
251#define MX28_PAD_SSP1_SCK__SSP2_D1 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_1)
252#define MX28_PAD_SSP1_CMD__SSP2_D2 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_1)
253#define MX28_PAD_SSP1_DATA0__SSP2_D6 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_1)
254#define MX28_PAD_SSP1_DATA3__SSP2_D7 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_1)
255#define MX28_PAD_SSP2_SCK__AUART2_RX MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_1)
256#define MX28_PAD_SSP2_MOSI__AUART2_TX MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_1)
257#define MX28_PAD_SSP2_MISO__AUART3_RX MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_1)
258#define MX28_PAD_SSP2_SS0__AUART3_TX MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_1)
259#define MX28_PAD_SSP2_SS1__SSP2_D1 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_1)
260#define MX28_PAD_SSP2_SS2__SSP2_D2 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_1)
261#define MX28_PAD_SSP3_SCK__AUART4_TX MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_1)
262#define MX28_PAD_SSP3_MOSI__AUART4_RX MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_1)
263#define MX28_PAD_SSP3_MISO__AUART4_RTS MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_1)
264#define MX28_PAD_SSP3_SS0__AUART4_CTS MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_1)
265
266#define MX28_PAD_AUART0_RX__I2C0_SCL MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_1)
267#define MX28_PAD_AUART0_TX__I2C0_SDA MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_1)
268#define MX28_PAD_AUART0_CTS__AUART4_RX MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_1)
269#define MX28_PAD_AUART0_RTS__AUART4_TX MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_1)
270#define MX28_PAD_AUART1_RX__SSP2_CARD_DETECT MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_1)
271#define MX28_PAD_AUART1_TX__SSP3_CARD_DETECT MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_1)
272#define MX28_PAD_AUART1_CTS__USB0_OVERCURRENT MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_1)
273#define MX28_PAD_AUART1_RTS__USB0_ID MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_1)
274#define MX28_PAD_AUART2_RX__SSP3_D1 MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_1)
275#define MX28_PAD_AUART2_TX__SSP3_D2 MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_1)
276#define MX28_PAD_AUART2_CTS__I2C1_SCL MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_1)
277#define MX28_PAD_AUART2_RTS__I2C1_SDA MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_1)
278#define MX28_PAD_AUART3_RX__CAN0_TX MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_1)
279#define MX28_PAD_AUART3_TX__CAN0_RX MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_1)
280#define MX28_PAD_AUART3_CTS__CAN1_TX MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_1)
281#define MX28_PAD_AUART3_RTS__CAN1_RX MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_1)
282#define MX28_PAD_PWM0__I2C1_SCL MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_1)
283#define MX28_PAD_PWM1__I2C1_SDA MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_1)
284#define MX28_PAD_PWM2__USB0_ID MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_1)
285#define MX28_PAD_SAIF0_MCLK__PWM_3 MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_1)
286#define MX28_PAD_SAIF0_LRCLK__PWM_4 MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_1)
287#define MX28_PAD_SAIF0_BITCLK__PWM_5 MXS_IOMUX_PAD_NAKED(3, 22, PAD_MUXSEL_1)
288#define MX28_PAD_SAIF0_SDATA0__PWM_6 MXS_IOMUX_PAD_NAKED(3, 23, PAD_MUXSEL_1)
289#define MX28_PAD_I2C0_SCL__TIMROT_ROTARYA MXS_IOMUX_PAD_NAKED(3, 24, PAD_MUXSEL_1)
290#define MX28_PAD_I2C0_SDA__TIMROT_ROTARYB MXS_IOMUX_PAD_NAKED(3, 25, PAD_MUXSEL_1)
291#define MX28_PAD_SAIF1_SDATA0__PWM_7 MXS_IOMUX_PAD_NAKED(3, 26, PAD_MUXSEL_1)
292#define MX28_PAD_LCD_RESET__LCD_VSYNC MXS_IOMUX_PAD_NAKED(3, 30, PAD_MUXSEL_1)
293
294#define MX28_PAD_ENET0_MDC__GPMI_CE4N MXS_IOMUX_PAD_NAKED(4, 0, PAD_MUXSEL_1)
295#define MX28_PAD_ENET0_MDIO__GPMI_CE5N MXS_IOMUX_PAD_NAKED(4, 1, PAD_MUXSEL_1)
296#define MX28_PAD_ENET0_RX_EN__GPMI_CE6N MXS_IOMUX_PAD_NAKED(4, 2, PAD_MUXSEL_1)
297#define MX28_PAD_ENET0_RXD0__GPMI_CE7N MXS_IOMUX_PAD_NAKED(4, 3, PAD_MUXSEL_1)
298#define MX28_PAD_ENET0_RXD1__GPMI_READY4 MXS_IOMUX_PAD_NAKED(4, 4, PAD_MUXSEL_1)
299#define MX28_PAD_ENET0_TX_CLK__HSADC_TRIGGER MXS_IOMUX_PAD_NAKED(4, 5, PAD_MUXSEL_1)
300#define MX28_PAD_ENET0_TX_EN__GPMI_READY5 MXS_IOMUX_PAD_NAKED(4, 6, PAD_MUXSEL_1)
301#define MX28_PAD_ENET0_TXD0__GPMI_READY6 MXS_IOMUX_PAD_NAKED(4, 7, PAD_MUXSEL_1)
302#define MX28_PAD_ENET0_TXD1__GPMI_READY7 MXS_IOMUX_PAD_NAKED(4, 8, PAD_MUXSEL_1)
303#define MX28_PAD_ENET0_RXD2__ENET1_RXD0 MXS_IOMUX_PAD_NAKED(4, 9, PAD_MUXSEL_1)
304#define MX28_PAD_ENET0_RXD3__ENET1_RXD1 MXS_IOMUX_PAD_NAKED(4, 10, PAD_MUXSEL_1)
305#define MX28_PAD_ENET0_TXD2__ENET1_TXD0 MXS_IOMUX_PAD_NAKED(4, 11, PAD_MUXSEL_1)
306#define MX28_PAD_ENET0_TXD3__ENET1_TXD1 MXS_IOMUX_PAD_NAKED(4, 12, PAD_MUXSEL_1)
307#define MX28_PAD_ENET0_RX_CLK__ENET0_RX_ER MXS_IOMUX_PAD_NAKED(4, 13, PAD_MUXSEL_1)
308#define MX28_PAD_ENET0_COL__ENET1_TX_EN MXS_IOMUX_PAD_NAKED(4, 14, PAD_MUXSEL_1)
309#define MX28_PAD_ENET0_CRS__ENET1_RX_EN MXS_IOMUX_PAD_NAKED(4, 15, PAD_MUXSEL_1)
310
311/* MUXSEL_2 */
312#define MX28_PAD_GPMI_CE2N__ENET0_RX_ER MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_2)
313#define MX28_PAD_GPMI_CE3N__SAIF1_MCLK MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_2)
314#define MX28_PAD_GPMI_RDY0__USB0_ID MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_2)
315#define MX28_PAD_GPMI_RDY2__ENET0_TX_ER MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_2)
316#define MX28_PAD_GPMI_RDY3__HSADC_TRIGGER MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_2)
317#define MX28_PAD_GPMI_ALE__SSP3_D4 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_2)
318#define MX28_PAD_GPMI_CLE__SSP3_D5 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_2)
319
320#define MX28_PAD_LCD_D00__ETM_DA0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_2)
321#define MX28_PAD_LCD_D01__ETM_DA1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_2)
322#define MX28_PAD_LCD_D02__ETM_DA2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_2)
323#define MX28_PAD_LCD_D03__ETM_DA3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_2)
324#define MX28_PAD_LCD_D04__ETM_DA4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_2)
325#define MX28_PAD_LCD_D05__ETM_DA5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_2)
326#define MX28_PAD_LCD_D06__ETM_DA6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_2)
327#define MX28_PAD_LCD_D07__ETM_DA7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_2)
328#define MX28_PAD_LCD_D08__ETM_DA8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_2)
329#define MX28_PAD_LCD_D09__ETM_DA9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_2)
330#define MX28_PAD_LCD_D10__ETM_DA10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_2)
331#define MX28_PAD_LCD_D11__ETM_DA11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_2)
332#define MX28_PAD_LCD_D12__ETM_DA12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_2)
333#define MX28_PAD_LCD_D13__ETM_DA13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_2)
334#define MX28_PAD_LCD_D14__ETM_DA14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_2)
335#define MX28_PAD_LCD_D15__ETM_DA15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_2)
336#define MX28_PAD_LCD_D16__ETM_DA7 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_2)
337#define MX28_PAD_LCD_D17__ETM_DA6 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_2)
338#define MX28_PAD_LCD_D18__ETM_DA5 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_2)
339#define MX28_PAD_LCD_D19__ETM_DA4 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_2)
340#define MX28_PAD_LCD_D20__ETM_DA3 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_2)
341#define MX28_PAD_LCD_D21__ETM_DA2 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_2)
342#define MX28_PAD_LCD_D22__ETM_DA1 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_2)
343#define MX28_PAD_LCD_D23__ETM_DA0 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_2)
344#define MX28_PAD_LCD_RD_E__ETM_TCTL MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_2)
345#define MX28_PAD_LCD_WR_RWN__ETM_TCLK MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_2)
346#define MX28_PAD_LCD_HSYNC__ETM_TCTL MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_2)
347#define MX28_PAD_LCD_DOTCLK__ETM_TCLK MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_2)
348
349#define MX28_PAD_SSP1_SCK__ENET0_1588_EVENT2_OUT MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_2)
350#define MX28_PAD_SSP1_CMD__ENET0_1588_EVENT2_IN MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_2)
351#define MX28_PAD_SSP1_DATA0__ENET0_1588_EVENT3_OUT MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_2)
352#define MX28_PAD_SSP1_DATA3__ENET0_1588_EVENT3_IN MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_2)
353#define MX28_PAD_SSP2_SCK__SAIF0_SDATA1 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_2)
354#define MX28_PAD_SSP2_MOSI__SAIF0_SDATA2 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_2)
355#define MX28_PAD_SSP2_MISO__SAIF1_SDATA1 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_2)
356#define MX28_PAD_SSP2_SS0__SAIF1_SDATA2 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_2)
357#define MX28_PAD_SSP2_SS1__USB1_OVERCURRENT MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_2)
358#define MX28_PAD_SSP2_SS2__USB0_OVERCURRENT MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_2)
359#define MX28_PAD_SSP3_SCK__ENET1_1588_EVENT0_OUT MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_2)
360#define MX28_PAD_SSP3_MOSI__ENET1_1588_EVENT0_IN MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_2)
361#define MX28_PAD_SSP3_MISO__ENET1_1588_EVENT1_OUT MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_2)
362#define MX28_PAD_SSP3_SS0__ENET1_1588_EVENT1_IN MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_2)
363
364#define MX28_PAD_AUART0_RX__DUART_CTS MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_2)
365#define MX28_PAD_AUART0_TX__DUART_RTS MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_2)
366#define MX28_PAD_AUART0_CTS__DUART_RX MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_2)
367#define MX28_PAD_AUART0_RTS__DUART_TX MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_2)
368#define MX28_PAD_AUART1_RX__PWM_0 MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_2)
369#define MX28_PAD_AUART1_TX__PWM_1 MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_2)
370#define MX28_PAD_AUART1_CTS__TIMROT_ROTARYA MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_2)
371#define MX28_PAD_AUART1_RTS__TIMROT_ROTARYB MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_2)
372#define MX28_PAD_AUART2_RX__SSP3_D4 MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_2)
373#define MX28_PAD_AUART2_TX__SSP3_D5 MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_2)
374#define MX28_PAD_AUART2_CTS__SAIF1_BITCLK MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_2)
375#define MX28_PAD_AUART2_RTS__SAIF1_LRCLK MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_2)
376#define MX28_PAD_AUART3_RX__ENET0_1588_EVENT0_OUT MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_2)
377#define MX28_PAD_AUART3_TX__ENET0_1588_EVENT0_IN MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_2)
378#define MX28_PAD_AUART3_CTS__ENET0_1588_EVENT1_OUT MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_2)
379#define MX28_PAD_AUART3_RTS__ENET0_1588_EVENT1_IN MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_2)
380#define MX28_PAD_PWM0__DUART_RX MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_2)
381#define MX28_PAD_PWM1__DUART_TX MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_2)
382#define MX28_PAD_PWM2__USB1_OVERCURRENT MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_2)
383#define MX28_PAD_SAIF0_MCLK__AUART4_CTS MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_2)
384#define MX28_PAD_SAIF0_LRCLK__AUART4_RTS MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_2)
385#define MX28_PAD_SAIF0_BITCLK__AUART4_RX MXS_IOMUX_PAD_NAKED(3, 22, PAD_MUXSEL_2)
386#define MX28_PAD_SAIF0_SDATA0__AUART4_TX MXS_IOMUX_PAD_NAKED(3, 23, PAD_MUXSEL_2)
387#define MX28_PAD_I2C0_SCL__DUART_RX MXS_IOMUX_PAD_NAKED(3, 24, PAD_MUXSEL_2)
388#define MX28_PAD_I2C0_SDA__DUART_TX MXS_IOMUX_PAD_NAKED(3, 25, PAD_MUXSEL_2)
389#define MX28_PAD_SAIF1_SDATA0__SAIF0_SDATA1 MXS_IOMUX_PAD_NAKED(3, 26, PAD_MUXSEL_2)
390#define MX28_PAD_SPDIF__ENET1_RX_ER MXS_IOMUX_PAD_NAKED(3, 27, PAD_MUXSEL_2)
391
392#define MX28_PAD_ENET0_MDC__SAIF0_SDATA1 MXS_IOMUX_PAD_NAKED(4, 0, PAD_MUXSEL_2)
393#define MX28_PAD_ENET0_MDIO__SAIF0_SDATA2 MXS_IOMUX_PAD_NAKED(4, 1, PAD_MUXSEL_2)
394#define MX28_PAD_ENET0_RX_EN__SAIF1_SDATA1 MXS_IOMUX_PAD_NAKED(4, 2, PAD_MUXSEL_2)
395#define MX28_PAD_ENET0_RXD0__SAIF1_SDATA2 MXS_IOMUX_PAD_NAKED(4, 3, PAD_MUXSEL_2)
396#define MX28_PAD_ENET0_TX_CLK__ENET0_1588_EVENT2_OUT MXS_IOMUX_PAD_NAKED(4, 5, PAD_MUXSEL_2)
397#define MX28_PAD_ENET0_RXD2__ENET0_1588_EVENT0_OUT MXS_IOMUX_PAD_NAKED(4, 9, PAD_MUXSEL_2)
398#define MX28_PAD_ENET0_RXD3__ENET0_1588_EVENT0_IN MXS_IOMUX_PAD_NAKED(4, 10, PAD_MUXSEL_2)
399#define MX28_PAD_ENET0_TXD2__ENET0_1588_EVENT1_OUT MXS_IOMUX_PAD_NAKED(4, 11, PAD_MUXSEL_2)
400#define MX28_PAD_ENET0_TXD3__ENET0_1588_EVENT1_IN MXS_IOMUX_PAD_NAKED(4, 12, PAD_MUXSEL_2)
401#define MX28_PAD_ENET0_RX_CLK__ENET0_1588_EVENT2_IN MXS_IOMUX_PAD_NAKED(4, 13, PAD_MUXSEL_2)
402#define MX28_PAD_ENET0_COL__ENET0_1588_EVENT3_OUT MXS_IOMUX_PAD_NAKED(4, 14, PAD_MUXSEL_2)
403#define MX28_PAD_ENET0_CRS__ENET0_1588_EVENT3_IN MXS_IOMUX_PAD_NAKED(4, 15, PAD_MUXSEL_2)
404
405/* MUXSEL_GPIO */
406#define MX28_PAD_GPMI_D00__GPIO_0_0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_GPIO)
407#define MX28_PAD_GPMI_D01__GPIO_0_1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_GPIO)
408#define MX28_PAD_GPMI_D02__GPIO_0_2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_GPIO)
409#define MX28_PAD_GPMI_D03__GPIO_0_3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_GPIO)
410#define MX28_PAD_GPMI_D04__GPIO_0_4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_GPIO)
411#define MX28_PAD_GPMI_D05__GPIO_0_5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_GPIO)
412#define MX28_PAD_GPMI_D06__GPIO_0_6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_GPIO)
413#define MX28_PAD_GPMI_D07__GPIO_0_7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_GPIO)
414#define MX28_PAD_GPMI_CE0N__GPIO_0_16 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_GPIO)
415#define MX28_PAD_GPMI_CE1N__GPIO_0_17 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_GPIO)
416#define MX28_PAD_GPMI_CE2N__GPIO_0_18 MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_GPIO)
417#define MX28_PAD_GPMI_CE3N__GPIO_0_19 MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_GPIO)
418#define MX28_PAD_GPMI_RDY0__GPIO_0_20 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_GPIO)
419#define MX28_PAD_GPMI_RDY1__GPIO_0_21 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_GPIO)
420#define MX28_PAD_GPMI_RDY2__GPIO_0_22 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_GPIO)
421#define MX28_PAD_GPMI_RDY3__GPIO_0_23 MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_GPIO)
422#define MX28_PAD_GPMI_RDN__GPIO_0_24 MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_GPIO)
423#define MX28_PAD_GPMI_WRN__GPIO_0_25 MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_GPIO)
424#define MX28_PAD_GPMI_ALE__GPIO_0_26 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_GPIO)
425#define MX28_PAD_GPMI_CLE__GPIO_0_27 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_GPIO)
426#define MX28_PAD_GPMI_RESETN__GPIO_0_28 MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_GPIO)
427
428#define MX28_PAD_LCD_D00__GPIO_1_0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_GPIO)
429#define MX28_PAD_LCD_D01__GPIO_1_1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_GPIO)
430#define MX28_PAD_LCD_D02__GPIO_1_2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_GPIO)
431#define MX28_PAD_LCD_D03__GPIO_1_3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_GPIO)
432#define MX28_PAD_LCD_D04__GPIO_1_4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_GPIO)
433#define MX28_PAD_LCD_D05__GPIO_1_5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_GPIO)
434#define MX28_PAD_LCD_D06__GPIO_1_6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_GPIO)
435#define MX28_PAD_LCD_D07__GPIO_1_7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_GPIO)
436#define MX28_PAD_LCD_D08__GPIO_1_8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_GPIO)
437#define MX28_PAD_LCD_D09__GPIO_1_9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_GPIO)
438#define MX28_PAD_LCD_D10__GPIO_1_10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_GPIO)
439#define MX28_PAD_LCD_D11__GPIO_1_11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_GPIO)
440#define MX28_PAD_LCD_D12__GPIO_1_12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_GPIO)
441#define MX28_PAD_LCD_D13__GPIO_1_13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_GPIO)
442#define MX28_PAD_LCD_D14__GPIO_1_14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_GPIO)
443#define MX28_PAD_LCD_D15__GPIO_1_15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_GPIO)
444#define MX28_PAD_LCD_D16__GPIO_1_16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_GPIO)
445#define MX28_PAD_LCD_D17__GPIO_1_17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_GPIO)
446#define MX28_PAD_LCD_D18__GPIO_1_18 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_GPIO)
447#define MX28_PAD_LCD_D19__GPIO_1_19 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_GPIO)
448#define MX28_PAD_LCD_D20__GPIO_1_20 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_GPIO)
449#define MX28_PAD_LCD_D21__GPIO_1_21 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_GPIO)
450#define MX28_PAD_LCD_D22__GPIO_1_22 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_GPIO)
451#define MX28_PAD_LCD_D23__GPIO_1_23 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_GPIO)
452#define MX28_PAD_LCD_RD_E__GPIO_1_24 MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_GPIO)
453#define MX28_PAD_LCD_WR_RWN__GPIO_1_25 MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_GPIO)
454#define MX28_PAD_LCD_RS__GPIO_1_26 MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_GPIO)
455#define MX28_PAD_LCD_CS__GPIO_1_27 MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_GPIO)
456#define MX28_PAD_LCD_VSYNC__GPIO_1_28 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_GPIO)
457#define MX28_PAD_LCD_HSYNC__GPIO_1_29 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_GPIO)
458#define MX28_PAD_LCD_DOTCLK__GPIO_1_30 MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_GPIO)
459#define MX28_PAD_LCD_ENABLE__GPIO_1_31 MXS_IOMUX_PAD_NAKED(1, 31, PAD_MUXSEL_GPIO)
460
461#define MX28_PAD_SSP0_DATA0__GPIO_2_0 MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_GPIO)
462#define MX28_PAD_SSP0_DATA1__GPIO_2_1 MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_GPIO)
463#define MX28_PAD_SSP0_DATA2__GPIO_2_2 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_GPIO)
464#define MX28_PAD_SSP0_DATA3__GPIO_2_3 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_GPIO)
465#define MX28_PAD_SSP0_DATA4__GPIO_2_4 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_GPIO)
466#define MX28_PAD_SSP0_DATA5__GPIO_2_5 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_GPIO)
467#define MX28_PAD_SSP0_DATA6__GPIO_2_6 MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_GPIO)
468#define MX28_PAD_SSP0_DATA7__GPIO_2_7 MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_GPIO)
469#define MX28_PAD_SSP0_CMD__GPIO_2_8 MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_GPIO)
470#define MX28_PAD_SSP0_DETECT__GPIO_2_9 MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_GPIO)
471#define MX28_PAD_SSP0_SCK__GPIO_2_10 MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_GPIO)
472#define MX28_PAD_SSP1_SCK__GPIO_2_12 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_GPIO)
473#define MX28_PAD_SSP1_CMD__GPIO_2_13 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_GPIO)
474#define MX28_PAD_SSP1_DATA0__GPIO_2_14 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_GPIO)
475#define MX28_PAD_SSP1_DATA3__GPIO_2_15 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_GPIO)
476#define MX28_PAD_SSP2_SCK__GPIO_2_16 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_GPIO)
477#define MX28_PAD_SSP2_MOSI__GPIO_2_17 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_GPIO)
478#define MX28_PAD_SSP2_MISO__GPIO_2_18 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_GPIO)
479#define MX28_PAD_SSP2_SS0__GPIO_2_19 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_GPIO)
480#define MX28_PAD_SSP2_SS1__GPIO_2_20 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_GPIO)
481#define MX28_PAD_SSP2_SS2__GPIO_2_21 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_GPIO)
482#define MX28_PAD_SSP3_SCK__GPIO_2_24 MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_GPIO)
483#define MX28_PAD_SSP3_MOSI__GPIO_2_25 MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_GPIO)
484#define MX28_PAD_SSP3_MISO__GPIO_2_26 MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_GPIO)
485#define MX28_PAD_SSP3_SS0__GPIO_2_27 MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_GPIO)
486
487#define MX28_PAD_AUART0_RX__GPIO_3_0 MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_GPIO)
488#define MX28_PAD_AUART0_TX__GPIO_3_1 MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_GPIO)
489#define MX28_PAD_AUART0_CTS__GPIO_3_2 MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_GPIO)
490#define MX28_PAD_AUART0_RTS__GPIO_3_3 MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_GPIO)
491#define MX28_PAD_AUART1_RX__GPIO_3_4 MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_GPIO)
492#define MX28_PAD_AUART1_TX__GPIO_3_5 MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_GPIO)
493#define MX28_PAD_AUART1_CTS__GPIO_3_6 MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_GPIO)
494#define MX28_PAD_AUART1_RTS__GPIO_3_7 MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_GPIO)
495#define MX28_PAD_AUART2_RX__GPIO_3_8 MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_GPIO)
496#define MX28_PAD_AUART2_TX__GPIO_3_9 MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_GPIO)
497#define MX28_PAD_AUART2_CTS__GPIO_3_10 MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_GPIO)
498#define MX28_PAD_AUART2_RTS__GPIO_3_11 MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_GPIO)
499#define MX28_PAD_AUART3_RX__GPIO_3_12 MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_GPIO)
500#define MX28_PAD_AUART3_TX__GPIO_3_13 MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_GPIO)
501#define MX28_PAD_AUART3_CTS__GPIO_3_14 MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_GPIO)
502#define MX28_PAD_AUART3_RTS__GPIO_3_15 MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_GPIO)
503#define MX28_PAD_PWM0__GPIO_3_16 MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_GPIO)
504#define MX28_PAD_PWM1__GPIO_3_17 MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_GPIO)
505#define MX28_PAD_PWM2__GPIO_3_18 MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_GPIO)
506#define MX28_PAD_SAIF0_MCLK__GPIO_3_20 MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_GPIO)
507#define MX28_PAD_SAIF0_LRCLK__GPIO_3_21 MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_GPIO)
508#define MX28_PAD_SAIF0_BITCLK__GPIO_3_22 MXS_IOMUX_PAD_NAKED(3, 22, PAD_MUXSEL_GPIO)
509#define MX28_PAD_SAIF0_SDATA0__GPIO_3_23 MXS_IOMUX_PAD_NAKED(3, 23, PAD_MUXSEL_GPIO)
510#define MX28_PAD_I2C0_SCL__GPIO_3_24 MXS_IOMUX_PAD_NAKED(3, 24, PAD_MUXSEL_GPIO)
511#define MX28_PAD_I2C0_SDA__GPIO_3_25 MXS_IOMUX_PAD_NAKED(3, 25, PAD_MUXSEL_GPIO)
512#define MX28_PAD_SAIF1_SDATA0__GPIO_3_26 MXS_IOMUX_PAD_NAKED(3, 26, PAD_MUXSEL_GPIO)
513#define MX28_PAD_SPDIF__GPIO_3_27 MXS_IOMUX_PAD_NAKED(3, 27, PAD_MUXSEL_GPIO)
514#define MX28_PAD_PWM3__GPIO_3_28 MXS_IOMUX_PAD_NAKED(3, 28, PAD_MUXSEL_GPIO)
515#define MX28_PAD_PWM4__GPIO_3_29 MXS_IOMUX_PAD_NAKED(3, 29, PAD_MUXSEL_GPIO)
516#define MX28_PAD_LCD_RESET__GPIO_3_30 MXS_IOMUX_PAD_NAKED(3, 30, PAD_MUXSEL_GPIO)
517
518#define MX28_PAD_ENET0_MDC__GPIO_4_0 MXS_IOMUX_PAD_NAKED(4, 0, PAD_MUXSEL_GPIO)
519#define MX28_PAD_ENET0_MDIO__GPIO_4_1 MXS_IOMUX_PAD_NAKED(4, 1, PAD_MUXSEL_GPIO)
520#define MX28_PAD_ENET0_RX_EN__GPIO_4_2 MXS_IOMUX_PAD_NAKED(4, 2, PAD_MUXSEL_GPIO)
521#define MX28_PAD_ENET0_RXD0__GPIO_4_3 MXS_IOMUX_PAD_NAKED(4, 3, PAD_MUXSEL_GPIO)
522#define MX28_PAD_ENET0_RXD1__GPIO_4_4 MXS_IOMUX_PAD_NAKED(4, 4, PAD_MUXSEL_GPIO)
523#define MX28_PAD_ENET0_TX_CLK__GPIO_4_5 MXS_IOMUX_PAD_NAKED(4, 5, PAD_MUXSEL_GPIO)
524#define MX28_PAD_ENET0_TX_EN__GPIO_4_6 MXS_IOMUX_PAD_NAKED(4, 6, PAD_MUXSEL_GPIO)
525#define MX28_PAD_ENET0_TXD0__GPIO_4_7 MXS_IOMUX_PAD_NAKED(4, 7, PAD_MUXSEL_GPIO)
526#define MX28_PAD_ENET0_TXD1__GPIO_4_8 MXS_IOMUX_PAD_NAKED(4, 8, PAD_MUXSEL_GPIO)
527#define MX28_PAD_ENET0_RXD2__GPIO_4_9 MXS_IOMUX_PAD_NAKED(4, 9, PAD_MUXSEL_GPIO)
528#define MX28_PAD_ENET0_RXD3__GPIO_4_10 MXS_IOMUX_PAD_NAKED(4, 10, PAD_MUXSEL_GPIO)
529#define MX28_PAD_ENET0_TXD2__GPIO_4_11 MXS_IOMUX_PAD_NAKED(4, 11, PAD_MUXSEL_GPIO)
530#define MX28_PAD_ENET0_TXD3__GPIO_4_12 MXS_IOMUX_PAD_NAKED(4, 12, PAD_MUXSEL_GPIO)
531#define MX28_PAD_ENET0_RX_CLK__GPIO_4_13 MXS_IOMUX_PAD_NAKED(4, 13, PAD_MUXSEL_GPIO)
532#define MX28_PAD_ENET0_COL__GPIO_4_14 MXS_IOMUX_PAD_NAKED(4, 14, PAD_MUXSEL_GPIO)
533#define MX28_PAD_ENET0_CRS__GPIO_4_15 MXS_IOMUX_PAD_NAKED(4, 15, PAD_MUXSEL_GPIO)
534#define MX28_PAD_ENET_CLK__GPIO_4_16 MXS_IOMUX_PAD_NAKED(4, 16, PAD_MUXSEL_GPIO)
535#define MX28_PAD_JTAG_RTCK__GPIO_4_20 MXS_IOMUX_PAD_NAKED(4, 20, PAD_MUXSEL_GPIO)
536
537#endif /* __MACH_IOMUX_MX28_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/iomux.h b/arch/arm/mach-mxs/include/mach/iomux.h
deleted file mode 100644
index 7abdf58b8bb..00000000000
--- a/arch/arm/mach-mxs/include/mach/iomux.h
+++ /dev/null
@@ -1,168 +0,0 @@
1/*
2 * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH,
3 * <armlinux@phytec.de>
4 * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */
20
21#ifndef __MACH_MXS_IOMUX_H__
22#define __MACH_MXS_IOMUX_H__
23
24/*
25 * IOMUX/PAD Bit field definitions
26 *
27 * PAD_BANK: 0..2 (3)
28 * PAD_PIN: 3..7 (5)
29 * PAD_MUXSEL: 8..9 (2)
30 * PAD_MA: 10..11 (2)
31 * PAD_MA_VALID: 12 (1)
32 * PAD_VOL: 13 (1)
33 * PAD_VOL_VALID: 14 (1)
34 * PAD_PULL: 15 (1)
35 * PAD_PULL_VALID: 16 (1)
36 * RESERVED: 17..31 (15)
37 */
38typedef u32 iomux_cfg_t;
39
40#define MXS_PAD_BANK_SHIFT 0
41#define MXS_PAD_BANK_MASK ((iomux_cfg_t)0x7 << MXS_PAD_BANK_SHIFT)
42#define MXS_PAD_PIN_SHIFT 3
43#define MXS_PAD_PIN_MASK ((iomux_cfg_t)0x1f << MXS_PAD_PIN_SHIFT)
44#define MXS_PAD_MUXSEL_SHIFT 8
45#define MXS_PAD_MUXSEL_MASK ((iomux_cfg_t)0x3 << MXS_PAD_MUXSEL_SHIFT)
46#define MXS_PAD_MA_SHIFT 10
47#define MXS_PAD_MA_MASK ((iomux_cfg_t)0x3 << MXS_PAD_MA_SHIFT)
48#define MXS_PAD_MA_VALID_SHIFT 12
49#define MXS_PAD_MA_VALID_MASK ((iomux_cfg_t)0x1 << MXS_PAD_MA_VALID_SHIFT)
50#define MXS_PAD_VOL_SHIFT 13
51#define MXS_PAD_VOL_MASK ((iomux_cfg_t)0x1 << MXS_PAD_VOL_SHIFT)
52#define MXS_PAD_VOL_VALID_SHIFT 14
53#define MXS_PAD_VOL_VALID_MASK ((iomux_cfg_t)0x1 << MXS_PAD_VOL_VALID_SHIFT)
54#define MXS_PAD_PULL_SHIFT 15
55#define MXS_PAD_PULL_MASK ((iomux_cfg_t)0x1 << MXS_PAD_PULL_SHIFT)
56#define MXS_PAD_PULL_VALID_SHIFT 16
57#define MXS_PAD_PULL_VALID_MASK ((iomux_cfg_t)0x1 << MXS_PAD_PULL_VALID_SHIFT)
58
59#define PAD_MUXSEL_0 0
60#define PAD_MUXSEL_1 1
61#define PAD_MUXSEL_2 2
62#define PAD_MUXSEL_GPIO 3
63
64#define PAD_4MA 0
65#define PAD_8MA 1
66#define PAD_12MA 2
67#define PAD_16MA 3
68
69#define PAD_1V8 0
70#define PAD_3V3 1
71
72#define PAD_NOPULL 0
73#define PAD_PULLUP 1
74
75#define MXS_PAD_4MA ((PAD_4MA << MXS_PAD_MA_SHIFT) | \
76 MXS_PAD_MA_VALID_MASK)
77#define MXS_PAD_8MA ((PAD_8MA << MXS_PAD_MA_SHIFT) | \
78 MXS_PAD_MA_VALID_MASK)
79#define MXS_PAD_12MA ((PAD_12MA << MXS_PAD_MA_SHIFT) | \
80 MXS_PAD_MA_VALID_MASK)
81#define MXS_PAD_16MA ((PAD_16MA << MXS_PAD_MA_SHIFT) | \
82 MXS_PAD_MA_VALID_MASK)
83
84#define MXS_PAD_1V8 ((PAD_1V8 << MXS_PAD_VOL_SHIFT) | \
85 MXS_PAD_VOL_VALID_MASK)
86#define MXS_PAD_3V3 ((PAD_3V3 << MXS_PAD_VOL_SHIFT) | \
87 MXS_PAD_VOL_VALID_MASK)
88
89#define MXS_PAD_NOPULL ((PAD_NOPULL << MXS_PAD_PULL_SHIFT) | \
90 MXS_PAD_PULL_VALID_MASK)
91#define MXS_PAD_PULLUP ((PAD_PULLUP << MXS_PAD_PULL_SHIFT) | \
92 MXS_PAD_PULL_VALID_MASK)
93
94/* generic pad control used in most cases */
95#define MXS_PAD_CTRL (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL)
96
97#define MXS_IOMUX_PAD(_bank, _pin, _muxsel, _ma, _vol, _pull) \
98 (((iomux_cfg_t)(_bank) << MXS_PAD_BANK_SHIFT) | \
99 ((iomux_cfg_t)(_pin) << MXS_PAD_PIN_SHIFT) | \
100 ((iomux_cfg_t)(_muxsel) << MXS_PAD_MUXSEL_SHIFT) | \
101 ((iomux_cfg_t)(_ma) << MXS_PAD_MA_SHIFT) | \
102 ((iomux_cfg_t)(_vol) << MXS_PAD_VOL_SHIFT) | \
103 ((iomux_cfg_t)(_pull) << MXS_PAD_PULL_SHIFT))
104
105/*
106 * A pad becomes naked, when none of mA, vol or pull
107 * validity bits is set.
108 */
109#define MXS_IOMUX_PAD_NAKED(_bank, _pin, _muxsel) \
110 MXS_IOMUX_PAD(_bank, _pin, _muxsel, 0, 0, 0)
111
112static inline unsigned int PAD_BANK(iomux_cfg_t pad)
113{
114 return (pad & MXS_PAD_BANK_MASK) >> MXS_PAD_BANK_SHIFT;
115}
116
117static inline unsigned int PAD_PIN(iomux_cfg_t pad)
118{
119 return (pad & MXS_PAD_PIN_MASK) >> MXS_PAD_PIN_SHIFT;
120}
121
122static inline unsigned int PAD_MUXSEL(iomux_cfg_t pad)
123{
124 return (pad & MXS_PAD_MUXSEL_MASK) >> MXS_PAD_MUXSEL_SHIFT;
125}
126
127static inline unsigned int PAD_MA(iomux_cfg_t pad)
128{
129 return (pad & MXS_PAD_MA_MASK) >> MXS_PAD_MA_SHIFT;
130}
131
132static inline unsigned int PAD_MA_VALID(iomux_cfg_t pad)
133{
134 return (pad & MXS_PAD_MA_VALID_MASK) >> MXS_PAD_MA_VALID_SHIFT;
135}
136
137static inline unsigned int PAD_VOL(iomux_cfg_t pad)
138{
139 return (pad & MXS_PAD_VOL_MASK) >> MXS_PAD_VOL_SHIFT;
140}
141
142static inline unsigned int PAD_VOL_VALID(iomux_cfg_t pad)
143{
144 return (pad & MXS_PAD_VOL_VALID_MASK) >> MXS_PAD_VOL_VALID_SHIFT;
145}
146
147static inline unsigned int PAD_PULL(iomux_cfg_t pad)
148{
149 return (pad & MXS_PAD_PULL_MASK) >> MXS_PAD_PULL_SHIFT;
150}
151
152static inline unsigned int PAD_PULL_VALID(iomux_cfg_t pad)
153{
154 return (pad & MXS_PAD_PULL_VALID_MASK) >> MXS_PAD_PULL_VALID_SHIFT;
155}
156
157/*
158 * configures a single pad in the iomuxer
159 */
160int mxs_iomux_setup_pad(iomux_cfg_t pad);
161
162/*
163 * configures multiple pads
164 * convenient way to call the above function with tables
165 */
166int mxs_iomux_setup_multiple_pads(const iomux_cfg_t *pad_list, unsigned count);
167
168#endif /* __MACH_MXS_IOMUX_H__*/
diff --git a/arch/arm/mach-mxs/include/mach/irqs.h b/arch/arm/mach-mxs/include/mach/irqs.h
deleted file mode 100644
index f771039b814..00000000000
--- a/arch/arm/mach-mxs/include/mach/irqs.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * Copyright 2004-2007 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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __MACH_MXS_IRQS_H__
12#define __MACH_MXS_IRQS_H__
13
14#define MXS_INTERNAL_IRQS 128
15
16#define MXS_GPIO_IRQ_START MXS_INTERNAL_IRQS
17
18/* the maximum for MXS-based */
19#define MXS_GPIO_IRQS (32 * 5)
20
21/*
22 * The next 16 interrupts are for board specific purposes. Since
23 * the kernel can only run on one machine at a time, we can re-use
24 * these. If you need more, increase MXS_BOARD_IRQS, but keep it
25 * within sensible limits.
26 */
27#define MXS_BOARD_IRQ_START (MXS_GPIO_IRQ_START + MXS_GPIO_IRQS)
28#define MXS_BOARD_IRQS 16
29
30#define NR_IRQS (MXS_BOARD_IRQ_START + MXS_BOARD_IRQS)
31
32#endif /* __MACH_MXS_IRQS_H__ */
diff --git a/arch/arm/mach-mxs/iomux.c b/arch/arm/mach-mxs/iomux.c
deleted file mode 100644
index 0e804e2f11f..00000000000
--- a/arch/arm/mach-mxs/iomux.c
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * Copyright 2004-2006,2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
4 * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH,
5 * <armlinux@phytec.de>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
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 Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 */
21
22#include <linux/errno.h>
23#include <linux/init.h>
24#include <linux/kernel.h>
25#include <linux/module.h>
26#include <linux/string.h>
27#include <linux/gpio.h>
28
29#include <asm/mach/map.h>
30
31#include <mach/mxs.h>
32#include <mach/iomux.h>
33
34/*
35 * configures a single pad in the iomuxer
36 */
37int mxs_iomux_setup_pad(iomux_cfg_t pad)
38{
39 u32 reg, ofs, bp, bm;
40 void __iomem *iomux_base = MXS_IO_ADDRESS(MXS_PINCTRL_BASE_ADDR);
41
42 /* muxsel */
43 ofs = 0x100;
44 ofs += PAD_BANK(pad) * 0x20 + PAD_PIN(pad) / 16 * 0x10;
45 bp = PAD_PIN(pad) % 16 * 2;
46 bm = 0x3 << bp;
47 reg = __raw_readl(iomux_base + ofs);
48 reg &= ~bm;
49 reg |= PAD_MUXSEL(pad) << bp;
50 __raw_writel(reg, iomux_base + ofs);
51
52 /* drive */
53 ofs = cpu_is_mx23() ? 0x200 : 0x300;
54 ofs += PAD_BANK(pad) * 0x40 + PAD_PIN(pad) / 8 * 0x10;
55 /* mA */
56 if (PAD_MA_VALID(pad)) {
57 bp = PAD_PIN(pad) % 8 * 4;
58 bm = 0x3 << bp;
59 reg = __raw_readl(iomux_base + ofs);
60 reg &= ~bm;
61 reg |= PAD_MA(pad) << bp;
62 __raw_writel(reg, iomux_base + ofs);
63 }
64 /* vol */
65 if (PAD_VOL_VALID(pad)) {
66 bp = PAD_PIN(pad) % 8 * 4 + 2;
67 if (PAD_VOL(pad))
68 __mxs_setl(1 << bp, iomux_base + ofs);
69 else
70 __mxs_clrl(1 << bp, iomux_base + ofs);
71 }
72
73 /* pull */
74 if (PAD_PULL_VALID(pad)) {
75 ofs = cpu_is_mx23() ? 0x400 : 0x600;
76 ofs += PAD_BANK(pad) * 0x10;
77 bp = PAD_PIN(pad);
78 if (PAD_PULL(pad))
79 __mxs_setl(1 << bp, iomux_base + ofs);
80 else
81 __mxs_clrl(1 << bp, iomux_base + ofs);
82 }
83
84 return 0;
85}
86
87int mxs_iomux_setup_multiple_pads(const iomux_cfg_t *pad_list, unsigned count)
88{
89 const iomux_cfg_t *p = pad_list;
90 int i;
91 int ret;
92
93 for (i = 0; i < count; i++) {
94 ret = mxs_iomux_setup_pad(*p);
95 if (ret)
96 return ret;
97 p++;
98 }
99
100 return 0;
101}
diff --git a/arch/arm/mach-mxs/mach-apx4devkit.c b/arch/arm/mach-mxs/mach-apx4devkit.c
deleted file mode 100644
index f5f061757de..00000000000
--- a/arch/arm/mach-mxs/mach-apx4devkit.c
+++ /dev/null
@@ -1,273 +0,0 @@
1/*
2 * Copyright (C) 2011-2012
3 * Lauri Hintsala, Bluegiga, <lauri.hintsala@bluegiga.com>
4 * Veli-Pekka Peltola, Bluegiga, <veli-pekka.peltola@bluegiga.com>
5 *
6 * based on: mach-mx28evk.c
7 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19
20#include <linux/delay.h>
21#include <linux/platform_device.h>
22#include <linux/gpio.h>
23#include <linux/leds.h>
24#include <linux/clk.h>
25#include <linux/i2c.h>
26#include <linux/regulator/machine.h>
27#include <linux/regulator/fixed.h>
28#include <linux/micrel_phy.h>
29
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/time.h>
33
34#include <mach/common.h>
35#include <mach/digctl.h>
36#include <mach/iomux-mx28.h>
37
38#include "devices-mx28.h"
39
40#define APX4DEVKIT_GPIO_USERLED MXS_GPIO_NR(3, 28)
41
42static const iomux_cfg_t apx4devkit_pads[] __initconst = {
43 /* duart */
44 MX28_PAD_PWM0__DUART_RX | MXS_PAD_CTRL,
45 MX28_PAD_PWM1__DUART_TX | MXS_PAD_CTRL,
46
47 /* auart0 */
48 MX28_PAD_AUART0_RX__AUART0_RX | MXS_PAD_CTRL,
49 MX28_PAD_AUART0_TX__AUART0_TX | MXS_PAD_CTRL,
50 MX28_PAD_AUART0_CTS__AUART0_CTS | MXS_PAD_CTRL,
51 MX28_PAD_AUART0_RTS__AUART0_RTS | MXS_PAD_CTRL,
52
53 /* auart1 */
54 MX28_PAD_AUART1_RX__AUART1_RX | MXS_PAD_CTRL,
55 MX28_PAD_AUART1_TX__AUART1_TX | MXS_PAD_CTRL,
56
57 /* auart2 */
58 MX28_PAD_SSP2_SCK__AUART2_RX | MXS_PAD_CTRL,
59 MX28_PAD_SSP2_MOSI__AUART2_TX | MXS_PAD_CTRL,
60
61 /* auart3 */
62 MX28_PAD_SSP2_MISO__AUART3_RX | MXS_PAD_CTRL,
63 MX28_PAD_SSP2_SS0__AUART3_TX | MXS_PAD_CTRL,
64
65#define MXS_PAD_FEC (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP)
66 /* fec0 */
67 MX28_PAD_ENET0_MDC__ENET0_MDC | MXS_PAD_FEC,
68 MX28_PAD_ENET0_MDIO__ENET0_MDIO | MXS_PAD_FEC,
69 MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | MXS_PAD_FEC,
70 MX28_PAD_ENET0_RXD0__ENET0_RXD0 | MXS_PAD_FEC,
71 MX28_PAD_ENET0_RXD1__ENET0_RXD1 | MXS_PAD_FEC,
72 MX28_PAD_ENET0_TX_EN__ENET0_TX_EN | MXS_PAD_FEC,
73 MX28_PAD_ENET0_TXD0__ENET0_TXD0 | MXS_PAD_FEC,
74 MX28_PAD_ENET0_TXD1__ENET0_TXD1 | MXS_PAD_FEC,
75 MX28_PAD_ENET_CLK__CLKCTRL_ENET | MXS_PAD_FEC,
76
77 /* i2c */
78 MX28_PAD_I2C0_SCL__I2C0_SCL,
79 MX28_PAD_I2C0_SDA__I2C0_SDA,
80
81 /* mmc0 */
82 MX28_PAD_SSP0_DATA0__SSP0_D0 |
83 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
84 MX28_PAD_SSP0_DATA1__SSP0_D1 |
85 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
86 MX28_PAD_SSP0_DATA2__SSP0_D2 |
87 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
88 MX28_PAD_SSP0_DATA3__SSP0_D3 |
89 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
90 MX28_PAD_SSP0_DATA4__SSP0_D4 |
91 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
92 MX28_PAD_SSP0_DATA5__SSP0_D5 |
93 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
94 MX28_PAD_SSP0_DATA6__SSP0_D6 |
95 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
96 MX28_PAD_SSP0_DATA7__SSP0_D7 |
97 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
98 MX28_PAD_SSP0_CMD__SSP0_CMD |
99 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
100 MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT |
101 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
102 MX28_PAD_SSP0_SCK__SSP0_SCK |
103 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
104
105 /* led */
106 MX28_PAD_PWM3__GPIO_3_28 | MXS_PAD_CTRL,
107
108 /* saif0 & saif1 */
109 MX28_PAD_SAIF0_MCLK__SAIF0_MCLK |
110 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
111 MX28_PAD_SAIF0_LRCLK__SAIF0_LRCLK |
112 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
113 MX28_PAD_SAIF0_BITCLK__SAIF0_BITCLK |
114 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
115 MX28_PAD_SAIF0_SDATA0__SAIF0_SDATA0 |
116 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
117 MX28_PAD_SAIF1_SDATA0__SAIF1_SDATA0 |
118 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
119};
120
121/* led */
122static const struct gpio_led apx4devkit_leds[] __initconst = {
123 {
124 .name = "user-led",
125 .default_trigger = "heartbeat",
126 .gpio = APX4DEVKIT_GPIO_USERLED,
127 },
128};
129
130static const struct gpio_led_platform_data apx4devkit_led_data __initconst = {
131 .leds = apx4devkit_leds,
132 .num_leds = ARRAY_SIZE(apx4devkit_leds),
133};
134
135static const struct fec_platform_data mx28_fec_pdata __initconst = {
136 .phy = PHY_INTERFACE_MODE_RMII,
137};
138
139static const struct mxs_mmc_platform_data apx4devkit_mmc_pdata __initconst = {
140 .wp_gpio = -EINVAL,
141 .flags = SLOTF_4_BIT_CAPABLE,
142};
143
144static const struct i2c_board_info apx4devkit_i2c_boardinfo[] __initconst = {
145 { I2C_BOARD_INFO("sgtl5000", 0x0a) }, /* ASoC */
146 { I2C_BOARD_INFO("pcf8563", 0x51) }, /* RTC */
147};
148
149#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || \
150 defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
151static struct regulator_consumer_supply apx4devkit_audio_consumer_supplies[] = {
152 REGULATOR_SUPPLY("VDDA", "0-000a"),
153 REGULATOR_SUPPLY("VDDIO", "0-000a"),
154};
155
156static struct regulator_init_data apx4devkit_vdd_reg_init_data = {
157 .constraints = {
158 .name = "3V3",
159 .always_on = 1,
160 },
161 .consumer_supplies = apx4devkit_audio_consumer_supplies,
162 .num_consumer_supplies = ARRAY_SIZE(apx4devkit_audio_consumer_supplies),
163};
164
165static struct fixed_voltage_config apx4devkit_vdd_pdata = {
166 .supply_name = "board-3V3",
167 .microvolts = 3300000,
168 .gpio = -EINVAL,
169 .enabled_at_boot = 1,
170 .init_data = &apx4devkit_vdd_reg_init_data,
171};
172
173static struct platform_device apx4devkit_voltage_regulator = {
174 .name = "reg-fixed-voltage",
175 .id = -1,
176 .num_resources = 0,
177 .dev = {
178 .platform_data = &apx4devkit_vdd_pdata,
179 },
180};
181
182static void __init apx4devkit_add_regulators(void)
183{
184 platform_device_register(&apx4devkit_voltage_regulator);
185}
186#else
187static void __init apx4devkit_add_regulators(void) {}
188#endif
189
190static const struct mxs_saif_platform_data
191 apx4devkit_mxs_saif_pdata[] __initconst = {
192 /* working on EXTMSTR0 mode (saif0 master, saif1 slave) */
193 {
194 .master_mode = 1,
195 .master_id = 0,
196 }, {
197 .master_mode = 0,
198 .master_id = 0,
199 },
200};
201
202static int apx4devkit_phy_fixup(struct phy_device *phy)
203{
204 phy->dev_flags |= MICREL_PHY_50MHZ_CLK;
205 return 0;
206}
207
208static void __init apx4devkit_fec_phy_clk_enable(void)
209{
210 struct clk *clk;
211
212 /* Enable fec phy clock */
213 clk = clk_get_sys("enet_out", NULL);
214 if (!IS_ERR(clk))
215 clk_prepare_enable(clk);
216}
217
218static void __init apx4devkit_init(void)
219{
220 mx28_soc_init();
221
222 mxs_iomux_setup_multiple_pads(apx4devkit_pads,
223 ARRAY_SIZE(apx4devkit_pads));
224
225 mx28_add_duart();
226 mx28_add_auart0();
227 mx28_add_auart1();
228 mx28_add_auart2();
229 mx28_add_auart3();
230
231 /*
232 * Register fixup for the Micrel KS8031 PHY clock
233 * (shares same ID with KS8051)
234 */
235 phy_register_fixup_for_uid(PHY_ID_KS8051, MICREL_PHY_ID_MASK,
236 apx4devkit_phy_fixup);
237
238 apx4devkit_fec_phy_clk_enable();
239 mx28_add_fec(0, &mx28_fec_pdata);
240
241 mx28_add_mxs_mmc(0, &apx4devkit_mmc_pdata);
242
243 gpio_led_register_device(0, &apx4devkit_led_data);
244
245 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
246 mx28_add_saif(0, &apx4devkit_mxs_saif_pdata[0]);
247 mx28_add_saif(1, &apx4devkit_mxs_saif_pdata[1]);
248
249 apx4devkit_add_regulators();
250
251 mx28_add_mxs_i2c(0);
252 i2c_register_board_info(0, apx4devkit_i2c_boardinfo,
253 ARRAY_SIZE(apx4devkit_i2c_boardinfo));
254
255 mxs_add_platform_device("mxs-sgtl5000", 0, NULL, 0, NULL, 0);
256}
257
258static void __init apx4devkit_timer_init(void)
259{
260 mx28_clocks_init();
261}
262
263static struct sys_timer apx4devkit_timer = {
264 .init = apx4devkit_timer_init,
265};
266
267MACHINE_START(APX4DEVKIT, "Bluegiga APX4 Development Kit")
268 .map_io = mx28_map_io,
269 .init_irq = mx28_init_irq,
270 .timer = &apx4devkit_timer,
271 .init_machine = apx4devkit_init,
272 .restart = mxs_restart,
273MACHINE_END
diff --git a/arch/arm/mach-mxs/mach-m28evk.c b/arch/arm/mach-mxs/mach-m28evk.c
deleted file mode 100644
index 4c00c879b89..00000000000
--- a/arch/arm/mach-mxs/mach-m28evk.c
+++ /dev/null
@@ -1,366 +0,0 @@
1/*
2 * Copyright (C) 2011
3 * Stefano Babic, DENX Software Engineering, <sbabic@denx.de>
4 *
5 * based on: mach-mx28_evk.c
6 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
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/delay.h>
20#include <linux/platform_device.h>
21#include <linux/gpio.h>
22#include <linux/leds.h>
23#include <linux/irq.h>
24#include <linux/clk.h>
25#include <linux/i2c.h>
26#include <linux/i2c/at24.h>
27
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30#include <asm/mach/time.h>
31
32#include <mach/common.h>
33#include <mach/iomux-mx28.h>
34
35#include "devices-mx28.h"
36
37#define M28EVK_GPIO_USERLED1 MXS_GPIO_NR(3, 16)
38#define M28EVK_GPIO_USERLED2 MXS_GPIO_NR(3, 17)
39
40#define MX28EVK_BL_ENABLE MXS_GPIO_NR(3, 18)
41#define M28EVK_LCD_ENABLE MXS_GPIO_NR(3, 28)
42
43#define MX28EVK_MMC0_WRITE_PROTECT MXS_GPIO_NR(2, 12)
44#define MX28EVK_MMC1_WRITE_PROTECT MXS_GPIO_NR(0, 28)
45
46static const iomux_cfg_t m28evk_pads[] __initconst = {
47 /* duart */
48 MX28_PAD_AUART0_CTS__DUART_RX | MXS_PAD_CTRL,
49 MX28_PAD_AUART0_RTS__DUART_TX | MXS_PAD_CTRL,
50
51 /* auart0 */
52 MX28_PAD_AUART0_RX__AUART0_RX | MXS_PAD_CTRL,
53 MX28_PAD_AUART0_TX__AUART0_TX | MXS_PAD_CTRL,
54
55 /* auart3 */
56 MX28_PAD_AUART3_RX__AUART3_RX | MXS_PAD_CTRL,
57 MX28_PAD_AUART3_TX__AUART3_TX | MXS_PAD_CTRL,
58 MX28_PAD_AUART3_CTS__AUART3_CTS | MXS_PAD_CTRL,
59 MX28_PAD_AUART3_RTS__AUART3_RTS | MXS_PAD_CTRL,
60
61#define MXS_PAD_FEC (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP)
62 /* fec0 */
63 MX28_PAD_ENET0_MDC__ENET0_MDC | MXS_PAD_FEC,
64 MX28_PAD_ENET0_MDIO__ENET0_MDIO | MXS_PAD_FEC,
65 MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | MXS_PAD_FEC,
66 MX28_PAD_ENET0_RXD0__ENET0_RXD0 | MXS_PAD_FEC,
67 MX28_PAD_ENET0_RXD1__ENET0_RXD1 | MXS_PAD_FEC,
68 MX28_PAD_ENET0_TX_EN__ENET0_TX_EN | MXS_PAD_FEC,
69 MX28_PAD_ENET0_TXD0__ENET0_TXD0 | MXS_PAD_FEC,
70 MX28_PAD_ENET0_TXD1__ENET0_TXD1 | MXS_PAD_FEC,
71 MX28_PAD_ENET_CLK__CLKCTRL_ENET | MXS_PAD_FEC,
72 /* fec1 */
73 MX28_PAD_ENET0_CRS__ENET1_RX_EN | MXS_PAD_FEC,
74 MX28_PAD_ENET0_RXD2__ENET1_RXD0 | MXS_PAD_FEC,
75 MX28_PAD_ENET0_RXD3__ENET1_RXD1 | MXS_PAD_FEC,
76 MX28_PAD_ENET0_COL__ENET1_TX_EN | MXS_PAD_FEC,
77 MX28_PAD_ENET0_TXD2__ENET1_TXD0 | MXS_PAD_FEC,
78 MX28_PAD_ENET0_TXD3__ENET1_TXD1 | MXS_PAD_FEC,
79
80 /* flexcan0 */
81 MX28_PAD_GPMI_RDY2__CAN0_TX,
82 MX28_PAD_GPMI_RDY3__CAN0_RX,
83
84 /* flexcan1 */
85 MX28_PAD_GPMI_CE2N__CAN1_TX,
86 MX28_PAD_GPMI_CE3N__CAN1_RX,
87
88 /* I2C */
89 MX28_PAD_I2C0_SCL__I2C0_SCL,
90 MX28_PAD_I2C0_SDA__I2C0_SDA,
91
92 /* mxsfb (lcdif) */
93 MX28_PAD_LCD_D00__LCD_D0 | MXS_PAD_CTRL,
94 MX28_PAD_LCD_D01__LCD_D1 | MXS_PAD_CTRL,
95 MX28_PAD_LCD_D02__LCD_D2 | MXS_PAD_CTRL,
96 MX28_PAD_LCD_D03__LCD_D3 | MXS_PAD_CTRL,
97 MX28_PAD_LCD_D04__LCD_D4 | MXS_PAD_CTRL,
98 MX28_PAD_LCD_D05__LCD_D5 | MXS_PAD_CTRL,
99 MX28_PAD_LCD_D06__LCD_D6 | MXS_PAD_CTRL,
100 MX28_PAD_LCD_D07__LCD_D7 | MXS_PAD_CTRL,
101 MX28_PAD_LCD_D08__LCD_D8 | MXS_PAD_CTRL,
102 MX28_PAD_LCD_D09__LCD_D9 | MXS_PAD_CTRL,
103 MX28_PAD_LCD_D10__LCD_D10 | MXS_PAD_CTRL,
104 MX28_PAD_LCD_D11__LCD_D11 | MXS_PAD_CTRL,
105 MX28_PAD_LCD_D12__LCD_D12 | MXS_PAD_CTRL,
106 MX28_PAD_LCD_D13__LCD_D13 | MXS_PAD_CTRL,
107 MX28_PAD_LCD_D14__LCD_D14 | MXS_PAD_CTRL,
108 MX28_PAD_LCD_D15__LCD_D15 | MXS_PAD_CTRL,
109 MX28_PAD_LCD_D16__LCD_D16 | MXS_PAD_CTRL,
110 MX28_PAD_LCD_D17__LCD_D17 | MXS_PAD_CTRL,
111 MX28_PAD_LCD_D18__LCD_D18 | MXS_PAD_CTRL,
112 MX28_PAD_LCD_D19__LCD_D19 | MXS_PAD_CTRL,
113 MX28_PAD_LCD_D20__LCD_D20 | MXS_PAD_CTRL,
114 MX28_PAD_LCD_D21__LCD_D21 | MXS_PAD_CTRL,
115 MX28_PAD_LCD_D22__LCD_D22 | MXS_PAD_CTRL,
116 MX28_PAD_LCD_D23__LCD_D23 | MXS_PAD_CTRL,
117
118 MX28_PAD_LCD_ENABLE__LCD_ENABLE | MXS_PAD_CTRL,
119 MX28_PAD_LCD_DOTCLK__LCD_DOTCLK | MXS_PAD_CTRL,
120
121 /* mmc0 */
122 MX28_PAD_SSP0_DATA0__SSP0_D0 |
123 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
124 MX28_PAD_SSP0_DATA1__SSP0_D1 |
125 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
126 MX28_PAD_SSP0_DATA2__SSP0_D2 |
127 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
128 MX28_PAD_SSP0_DATA3__SSP0_D3 |
129 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
130 MX28_PAD_SSP0_DATA4__SSP0_D4 |
131 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
132 MX28_PAD_SSP0_DATA5__SSP0_D5 |
133 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
134 MX28_PAD_SSP0_DATA6__SSP0_D6 |
135 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
136 MX28_PAD_SSP0_DATA7__SSP0_D7 |
137 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
138 MX28_PAD_SSP0_CMD__SSP0_CMD |
139 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
140 MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT |
141 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
142 MX28_PAD_SSP0_SCK__SSP0_SCK |
143 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
144
145 /* mmc1 */
146 MX28_PAD_GPMI_D00__SSP1_D0 |
147 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
148 MX28_PAD_GPMI_D01__SSP1_D1 |
149 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
150 MX28_PAD_GPMI_D02__SSP1_D2 |
151 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
152 MX28_PAD_GPMI_D03__SSP1_D3 |
153 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
154 MX28_PAD_GPMI_D04__SSP1_D4 |
155 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
156 MX28_PAD_GPMI_D05__SSP1_D5 |
157 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
158 MX28_PAD_GPMI_D06__SSP1_D6 |
159 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
160 MX28_PAD_GPMI_D07__SSP1_D7 |
161 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
162 MX28_PAD_GPMI_RDY1__SSP1_CMD |
163 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
164 MX28_PAD_GPMI_RDY0__SSP1_CARD_DETECT |
165 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
166 MX28_PAD_GPMI_WRN__SSP1_SCK |
167 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
168 /* write protect */
169 MX28_PAD_GPMI_RESETN__GPIO_0_28 |
170 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
171 /* slot power enable */
172 MX28_PAD_PWM4__GPIO_3_29 |
173 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
174
175 /* led */
176 MX28_PAD_PWM0__GPIO_3_16 | MXS_PAD_CTRL,
177 MX28_PAD_PWM1__GPIO_3_17 | MXS_PAD_CTRL,
178
179 /* nand */
180 MX28_PAD_GPMI_D00__GPMI_D0 |
181 (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL),
182 MX28_PAD_GPMI_D01__GPMI_D1 |
183 (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL),
184 MX28_PAD_GPMI_D02__GPMI_D2 |
185 (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL),
186 MX28_PAD_GPMI_D03__GPMI_D3 |
187 (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL),
188 MX28_PAD_GPMI_D04__GPMI_D4 |
189 (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL),
190 MX28_PAD_GPMI_D05__GPMI_D5 |
191 (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL),
192 MX28_PAD_GPMI_D06__GPMI_D6 |
193 (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL),
194 MX28_PAD_GPMI_D07__GPMI_D7 |
195 (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL),
196 MX28_PAD_GPMI_CE0N__GPMI_CE0N |
197 (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL),
198 MX28_PAD_GPMI_RDY0__GPMI_READY0 |
199 (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL),
200 MX28_PAD_GPMI_RDN__GPMI_RDN |
201 (MXS_PAD_12MA | MXS_PAD_1V8 | MXS_PAD_PULLUP),
202 MX28_PAD_GPMI_WRN__GPMI_WRN |
203 (MXS_PAD_12MA | MXS_PAD_1V8 | MXS_PAD_PULLUP),
204 MX28_PAD_GPMI_ALE__GPMI_ALE |
205 (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_PULLUP),
206 MX28_PAD_GPMI_CLE__GPMI_CLE |
207 (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_PULLUP),
208 MX28_PAD_GPMI_RESETN__GPMI_RESETN |
209 (MXS_PAD_12MA | MXS_PAD_1V8 | MXS_PAD_PULLUP),
210
211 /* Backlight */
212 MX28_PAD_PWM3__GPIO_3_28 | MXS_PAD_CTRL,
213};
214
215/* led */
216static const struct gpio_led m28evk_leds[] __initconst = {
217 {
218 .name = "user-led1",
219 .default_trigger = "heartbeat",
220 .gpio = M28EVK_GPIO_USERLED1,
221 },
222 {
223 .name = "user-led2",
224 .default_trigger = "heartbeat",
225 .gpio = M28EVK_GPIO_USERLED2,
226 },
227};
228
229static const struct gpio_led_platform_data m28evk_led_data __initconst = {
230 .leds = m28evk_leds,
231 .num_leds = ARRAY_SIZE(m28evk_leds),
232};
233
234static struct fec_platform_data mx28_fec_pdata[] __initdata = {
235 {
236 /* fec0 */
237 .phy = PHY_INTERFACE_MODE_RMII,
238 }, {
239 /* fec1 */
240 .phy = PHY_INTERFACE_MODE_RMII,
241 },
242};
243
244static int __init m28evk_fec_get_mac(void)
245{
246 int i;
247 u32 val;
248 const u32 *ocotp = mxs_get_ocotp();
249
250 if (!ocotp)
251 return -ETIMEDOUT;
252
253 /*
254 * OCOTP only stores the last 4 octets for each mac address,
255 * so hard-code DENX OUI (C0:E5:4E) here.
256 */
257 for (i = 0; i < 2; i++) {
258 val = ocotp[i];
259 mx28_fec_pdata[i].mac[0] = 0xC0;
260 mx28_fec_pdata[i].mac[1] = 0xE5;
261 mx28_fec_pdata[i].mac[2] = 0x4E;
262 mx28_fec_pdata[i].mac[3] = (val >> 16) & 0xff;
263 mx28_fec_pdata[i].mac[4] = (val >> 8) & 0xff;
264 mx28_fec_pdata[i].mac[5] = (val >> 0) & 0xff;
265 }
266
267 return 0;
268}
269
270/* mxsfb (lcdif) */
271static struct fb_videomode m28evk_video_modes[] = {
272 {
273 .name = "Ampire AM-800480R2TMQW-T01H",
274 .refresh = 60,
275 .xres = 800,
276 .yres = 480,
277 .pixclock = 30066, /* picosecond (33.26 MHz) */
278 .left_margin = 0,
279 .right_margin = 256,
280 .upper_margin = 0,
281 .lower_margin = 45,
282 .hsync_len = 1,
283 .vsync_len = 1,
284 .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT,
285 },
286};
287
288static const struct mxsfb_platform_data m28evk_mxsfb_pdata __initconst = {
289 .mode_list = m28evk_video_modes,
290 .mode_count = ARRAY_SIZE(m28evk_video_modes),
291 .default_bpp = 16,
292 .ld_intf_width = STMLCDIF_18BIT,
293};
294
295static struct at24_platform_data m28evk_eeprom = {
296 .byte_len = 16384,
297 .page_size = 32,
298 .flags = AT24_FLAG_ADDR16,
299};
300
301static struct i2c_board_info m28_stk5v3_i2c_boardinfo[] __initdata = {
302 {
303 I2C_BOARD_INFO("at24", 0x51), /* E0=1, E1=0, E2=0 */
304 .platform_data = &m28evk_eeprom,
305 },
306};
307
308static struct mxs_mmc_platform_data m28evk_mmc_pdata[] __initdata = {
309 {
310 /* mmc0 */
311 .wp_gpio = MX28EVK_MMC0_WRITE_PROTECT,
312 .flags = SLOTF_8_BIT_CAPABLE,
313 }, {
314 /* mmc1 */
315 .wp_gpio = MX28EVK_MMC1_WRITE_PROTECT,
316 .flags = SLOTF_8_BIT_CAPABLE,
317 },
318};
319
320static void __init m28evk_init(void)
321{
322 mx28_soc_init();
323
324 mxs_iomux_setup_multiple_pads(m28evk_pads, ARRAY_SIZE(m28evk_pads));
325
326 mx28_add_duart();
327 mx28_add_auart0();
328 mx28_add_auart3();
329
330 if (!m28evk_fec_get_mac()) {
331 mx28_add_fec(0, &mx28_fec_pdata[0]);
332 mx28_add_fec(1, &mx28_fec_pdata[1]);
333 }
334
335 mx28_add_flexcan(0, NULL);
336 mx28_add_flexcan(1, NULL);
337
338 mx28_add_mxsfb(&m28evk_mxsfb_pdata);
339
340 mx28_add_mxs_mmc(0, &m28evk_mmc_pdata[0]);
341 mx28_add_mxs_mmc(1, &m28evk_mmc_pdata[1]);
342
343 gpio_led_register_device(0, &m28evk_led_data);
344
345 /* I2C */
346 mx28_add_mxs_i2c(0);
347 i2c_register_board_info(0, m28_stk5v3_i2c_boardinfo,
348 ARRAY_SIZE(m28_stk5v3_i2c_boardinfo));
349}
350
351static void __init m28evk_timer_init(void)
352{
353 mx28_clocks_init();
354}
355
356static struct sys_timer m28evk_timer = {
357 .init = m28evk_timer_init,
358};
359
360MACHINE_START(M28EVK, "DENX M28 EVK")
361 .map_io = mx28_map_io,
362 .init_irq = mx28_init_irq,
363 .timer = &m28evk_timer,
364 .init_machine = m28evk_init,
365 .restart = mxs_restart,
366MACHINE_END
diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c
deleted file mode 100644
index e7272a41939..00000000000
--- a/arch/arm/mach-mxs/mach-mx23evk.c
+++ /dev/null
@@ -1,190 +0,0 @@
1/*
2 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#include <linux/delay.h>
16#include <linux/platform_device.h>
17#include <linux/gpio.h>
18
19#include <asm/mach-types.h>
20#include <asm/mach/arch.h>
21#include <asm/mach/time.h>
22
23#include <mach/common.h>
24#include <mach/iomux-mx23.h>
25
26#include "devices-mx23.h"
27
28#define MX23EVK_LCD_ENABLE MXS_GPIO_NR(1, 18)
29#define MX23EVK_BL_ENABLE MXS_GPIO_NR(1, 28)
30#define MX23EVK_MMC0_WRITE_PROTECT MXS_GPIO_NR(1, 30)
31#define MX23EVK_MMC0_SLOT_POWER MXS_GPIO_NR(1, 29)
32
33static const iomux_cfg_t mx23evk_pads[] __initconst = {
34 /* duart */
35 MX23_PAD_PWM0__DUART_RX | MXS_PAD_CTRL,
36 MX23_PAD_PWM1__DUART_TX | MXS_PAD_CTRL,
37
38 /* auart */
39 MX23_PAD_AUART1_RX__AUART1_RX | MXS_PAD_CTRL,
40 MX23_PAD_AUART1_TX__AUART1_TX | MXS_PAD_CTRL,
41 MX23_PAD_AUART1_CTS__AUART1_CTS | MXS_PAD_CTRL,
42 MX23_PAD_AUART1_RTS__AUART1_RTS | MXS_PAD_CTRL,
43
44 /* mxsfb (lcdif) */
45 MX23_PAD_LCD_D00__LCD_D00 | MXS_PAD_CTRL,
46 MX23_PAD_LCD_D01__LCD_D01 | MXS_PAD_CTRL,
47 MX23_PAD_LCD_D02__LCD_D02 | MXS_PAD_CTRL,
48 MX23_PAD_LCD_D03__LCD_D03 | MXS_PAD_CTRL,
49 MX23_PAD_LCD_D04__LCD_D04 | MXS_PAD_CTRL,
50 MX23_PAD_LCD_D05__LCD_D05 | MXS_PAD_CTRL,
51 MX23_PAD_LCD_D06__LCD_D06 | MXS_PAD_CTRL,
52 MX23_PAD_LCD_D07__LCD_D07 | MXS_PAD_CTRL,
53 MX23_PAD_LCD_D08__LCD_D08 | MXS_PAD_CTRL,
54 MX23_PAD_LCD_D09__LCD_D09 | MXS_PAD_CTRL,
55 MX23_PAD_LCD_D10__LCD_D10 | MXS_PAD_CTRL,
56 MX23_PAD_LCD_D11__LCD_D11 | MXS_PAD_CTRL,
57 MX23_PAD_LCD_D12__LCD_D12 | MXS_PAD_CTRL,
58 MX23_PAD_LCD_D13__LCD_D13 | MXS_PAD_CTRL,
59 MX23_PAD_LCD_D14__LCD_D14 | MXS_PAD_CTRL,
60 MX23_PAD_LCD_D15__LCD_D15 | MXS_PAD_CTRL,
61 MX23_PAD_LCD_D16__LCD_D16 | MXS_PAD_CTRL,
62 MX23_PAD_LCD_D17__LCD_D17 | MXS_PAD_CTRL,
63 MX23_PAD_GPMI_D08__LCD_D18 | MXS_PAD_CTRL,
64 MX23_PAD_GPMI_D09__LCD_D19 | MXS_PAD_CTRL,
65 MX23_PAD_GPMI_D10__LCD_D20 | MXS_PAD_CTRL,
66 MX23_PAD_GPMI_D11__LCD_D21 | MXS_PAD_CTRL,
67 MX23_PAD_GPMI_D12__LCD_D22 | MXS_PAD_CTRL,
68 MX23_PAD_GPMI_D13__LCD_D23 | MXS_PAD_CTRL,
69 MX23_PAD_LCD_VSYNC__LCD_VSYNC | MXS_PAD_CTRL,
70 MX23_PAD_LCD_HSYNC__LCD_HSYNC | MXS_PAD_CTRL,
71 MX23_PAD_LCD_DOTCK__LCD_DOTCK | MXS_PAD_CTRL,
72 MX23_PAD_LCD_ENABLE__LCD_ENABLE | MXS_PAD_CTRL,
73 /* LCD panel enable */
74 MX23_PAD_LCD_RESET__GPIO_1_18 | MXS_PAD_CTRL,
75 /* backlight control */
76 MX23_PAD_PWM2__GPIO_1_28 | MXS_PAD_CTRL,
77
78 /* mmc */
79 MX23_PAD_SSP1_DATA0__SSP1_DATA0 |
80 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
81 MX23_PAD_SSP1_DATA1__SSP1_DATA1 |
82 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
83 MX23_PAD_SSP1_DATA2__SSP1_DATA2 |
84 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
85 MX23_PAD_SSP1_DATA3__SSP1_DATA3 |
86 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
87 MX23_PAD_GPMI_D08__SSP1_DATA4 |
88 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
89 MX23_PAD_GPMI_D09__SSP1_DATA5 |
90 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
91 MX23_PAD_GPMI_D10__SSP1_DATA6 |
92 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
93 MX23_PAD_GPMI_D11__SSP1_DATA7 |
94 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
95 MX23_PAD_SSP1_CMD__SSP1_CMD |
96 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
97 MX23_PAD_SSP1_DETECT__SSP1_DETECT |
98 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
99 MX23_PAD_SSP1_SCK__SSP1_SCK |
100 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
101 /* write protect */
102 MX23_PAD_PWM4__GPIO_1_30 |
103 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
104 /* slot power enable */
105 MX23_PAD_PWM3__GPIO_1_29 |
106 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
107};
108
109/* mxsfb (lcdif) */
110static struct fb_videomode mx23evk_video_modes[] = {
111 {
112 .name = "Samsung-LMS430HF02",
113 .refresh = 60,
114 .xres = 480,
115 .yres = 272,
116 .pixclock = 108096, /* picosecond (9.2 MHz) */
117 .left_margin = 15,
118 .right_margin = 8,
119 .upper_margin = 12,
120 .lower_margin = 4,
121 .hsync_len = 1,
122 .vsync_len = 1,
123 .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT |
124 FB_SYNC_DOTCLK_FAILING_ACT,
125 },
126};
127
128static const struct mxsfb_platform_data mx23evk_mxsfb_pdata __initconst = {
129 .mode_list = mx23evk_video_modes,
130 .mode_count = ARRAY_SIZE(mx23evk_video_modes),
131 .default_bpp = 32,
132 .ld_intf_width = STMLCDIF_24BIT,
133};
134
135static struct mxs_mmc_platform_data mx23evk_mmc_pdata __initdata = {
136 .wp_gpio = MX23EVK_MMC0_WRITE_PROTECT,
137 .flags = SLOTF_8_BIT_CAPABLE,
138};
139
140static void __init mx23evk_init(void)
141{
142 int ret;
143
144 mx23_soc_init();
145
146 mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads));
147
148 mx23_add_duart();
149 mx23_add_auart0();
150
151 /* power on mmc slot by writing 0 to the gpio */
152 ret = gpio_request_one(MX23EVK_MMC0_SLOT_POWER, GPIOF_OUT_INIT_LOW,
153 "mmc0-slot-power");
154 if (ret)
155 pr_warn("failed to request gpio mmc0-slot-power: %d\n", ret);
156 mx23_add_mxs_mmc(0, &mx23evk_mmc_pdata);
157
158 ret = gpio_request_one(MX23EVK_LCD_ENABLE, GPIOF_DIR_OUT, "lcd-enable");
159 if (ret)
160 pr_warn("failed to request gpio lcd-enable: %d\n", ret);
161 else
162 gpio_set_value(MX23EVK_LCD_ENABLE, 1);
163
164 ret = gpio_request_one(MX23EVK_BL_ENABLE, GPIOF_DIR_OUT, "bl-enable");
165 if (ret)
166 pr_warn("failed to request gpio bl-enable: %d\n", ret);
167 else
168 gpio_set_value(MX23EVK_BL_ENABLE, 1);
169
170 mx23_add_mxsfb(&mx23evk_mxsfb_pdata);
171 mx23_add_rtc_stmp3xxx();
172}
173
174static void __init mx23evk_timer_init(void)
175{
176 mx23_clocks_init();
177}
178
179static struct sys_timer mx23evk_timer = {
180 .init = mx23evk_timer_init,
181};
182
183MACHINE_START(MX23EVK, "Freescale MX23 EVK")
184 /* Maintainer: Freescale Semiconductor, Inc. */
185 .map_io = mx23_map_io,
186 .init_irq = mx23_init_irq,
187 .timer = &mx23evk_timer,
188 .init_machine = mx23evk_init,
189 .restart = mxs_restart,
190MACHINE_END
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c
deleted file mode 100644
index dafd48e86c8..00000000000
--- a/arch/arm/mach-mxs/mach-mx28evk.c
+++ /dev/null
@@ -1,477 +0,0 @@
1/*
2 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#include <linux/delay.h>
16#include <linux/platform_device.h>
17#include <linux/gpio.h>
18#include <linux/leds.h>
19#include <linux/clk.h>
20#include <linux/i2c.h>
21#include <linux/regulator/machine.h>
22#include <linux/regulator/fixed.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <asm/mach/time.h>
27
28#include <mach/common.h>
29#include <mach/iomux-mx28.h>
30#include <mach/digctl.h>
31
32#include "devices-mx28.h"
33
34#define MX28EVK_FLEXCAN_SWITCH MXS_GPIO_NR(2, 13)
35#define MX28EVK_FEC_PHY_POWER MXS_GPIO_NR(2, 15)
36#define MX28EVK_GPIO_LED MXS_GPIO_NR(3, 5)
37#define MX28EVK_BL_ENABLE MXS_GPIO_NR(3, 18)
38#define MX28EVK_LCD_ENABLE MXS_GPIO_NR(3, 30)
39#define MX28EVK_FEC_PHY_RESET MXS_GPIO_NR(4, 13)
40
41#define MX28EVK_MMC0_WRITE_PROTECT MXS_GPIO_NR(2, 12)
42#define MX28EVK_MMC1_WRITE_PROTECT MXS_GPIO_NR(0, 28)
43#define MX28EVK_MMC0_SLOT_POWER MXS_GPIO_NR(3, 28)
44#define MX28EVK_MMC1_SLOT_POWER MXS_GPIO_NR(3, 29)
45
46static const iomux_cfg_t mx28evk_pads[] __initconst = {
47 /* duart */
48 MX28_PAD_PWM0__DUART_RX | MXS_PAD_CTRL,
49 MX28_PAD_PWM1__DUART_TX | MXS_PAD_CTRL,
50
51 /* auart0 */
52 MX28_PAD_AUART0_RX__AUART0_RX | MXS_PAD_CTRL,
53 MX28_PAD_AUART0_TX__AUART0_TX | MXS_PAD_CTRL,
54 MX28_PAD_AUART0_CTS__AUART0_CTS | MXS_PAD_CTRL,
55 MX28_PAD_AUART0_RTS__AUART0_RTS | MXS_PAD_CTRL,
56 /* auart3 */
57 MX28_PAD_AUART3_RX__AUART3_RX | MXS_PAD_CTRL,
58 MX28_PAD_AUART3_TX__AUART3_TX | MXS_PAD_CTRL,
59 MX28_PAD_AUART3_CTS__AUART3_CTS | MXS_PAD_CTRL,
60 MX28_PAD_AUART3_RTS__AUART3_RTS | MXS_PAD_CTRL,
61
62#define MXS_PAD_FEC (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP)
63 /* fec0 */
64 MX28_PAD_ENET0_MDC__ENET0_MDC | MXS_PAD_FEC,
65 MX28_PAD_ENET0_MDIO__ENET0_MDIO | MXS_PAD_FEC,
66 MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | MXS_PAD_FEC,
67 MX28_PAD_ENET0_RXD0__ENET0_RXD0 | MXS_PAD_FEC,
68 MX28_PAD_ENET0_RXD1__ENET0_RXD1 | MXS_PAD_FEC,
69 MX28_PAD_ENET0_TX_EN__ENET0_TX_EN | MXS_PAD_FEC,
70 MX28_PAD_ENET0_TXD0__ENET0_TXD0 | MXS_PAD_FEC,
71 MX28_PAD_ENET0_TXD1__ENET0_TXD1 | MXS_PAD_FEC,
72 MX28_PAD_ENET_CLK__CLKCTRL_ENET | MXS_PAD_FEC,
73 /* fec1 */
74 MX28_PAD_ENET0_CRS__ENET1_RX_EN | MXS_PAD_FEC,
75 MX28_PAD_ENET0_RXD2__ENET1_RXD0 | MXS_PAD_FEC,
76 MX28_PAD_ENET0_RXD3__ENET1_RXD1 | MXS_PAD_FEC,
77 MX28_PAD_ENET0_COL__ENET1_TX_EN | MXS_PAD_FEC,
78 MX28_PAD_ENET0_TXD2__ENET1_TXD0 | MXS_PAD_FEC,
79 MX28_PAD_ENET0_TXD3__ENET1_TXD1 | MXS_PAD_FEC,
80 /* phy power line */
81 MX28_PAD_SSP1_DATA3__GPIO_2_15 | MXS_PAD_CTRL,
82 /* phy reset line */
83 MX28_PAD_ENET0_RX_CLK__GPIO_4_13 | MXS_PAD_CTRL,
84
85 /* flexcan0 */
86 MX28_PAD_GPMI_RDY2__CAN0_TX,
87 MX28_PAD_GPMI_RDY3__CAN0_RX,
88 /* flexcan1 */
89 MX28_PAD_GPMI_CE2N__CAN1_TX,
90 MX28_PAD_GPMI_CE3N__CAN1_RX,
91 /* transceiver power control */
92 MX28_PAD_SSP1_CMD__GPIO_2_13,
93
94 /* mxsfb (lcdif) */
95 MX28_PAD_LCD_D00__LCD_D0 | MXS_PAD_CTRL,
96 MX28_PAD_LCD_D01__LCD_D1 | MXS_PAD_CTRL,
97 MX28_PAD_LCD_D02__LCD_D2 | MXS_PAD_CTRL,
98 MX28_PAD_LCD_D03__LCD_D3 | MXS_PAD_CTRL,
99 MX28_PAD_LCD_D04__LCD_D4 | MXS_PAD_CTRL,
100 MX28_PAD_LCD_D05__LCD_D5 | MXS_PAD_CTRL,
101 MX28_PAD_LCD_D06__LCD_D6 | MXS_PAD_CTRL,
102 MX28_PAD_LCD_D07__LCD_D7 | MXS_PAD_CTRL,
103 MX28_PAD_LCD_D08__LCD_D8 | MXS_PAD_CTRL,
104 MX28_PAD_LCD_D09__LCD_D9 | MXS_PAD_CTRL,
105 MX28_PAD_LCD_D10__LCD_D10 | MXS_PAD_CTRL,
106 MX28_PAD_LCD_D11__LCD_D11 | MXS_PAD_CTRL,
107 MX28_PAD_LCD_D12__LCD_D12 | MXS_PAD_CTRL,
108 MX28_PAD_LCD_D13__LCD_D13 | MXS_PAD_CTRL,
109 MX28_PAD_LCD_D14__LCD_D14 | MXS_PAD_CTRL,
110 MX28_PAD_LCD_D15__LCD_D15 | MXS_PAD_CTRL,
111 MX28_PAD_LCD_D16__LCD_D16 | MXS_PAD_CTRL,
112 MX28_PAD_LCD_D17__LCD_D17 | MXS_PAD_CTRL,
113 MX28_PAD_LCD_D18__LCD_D18 | MXS_PAD_CTRL,
114 MX28_PAD_LCD_D19__LCD_D19 | MXS_PAD_CTRL,
115 MX28_PAD_LCD_D20__LCD_D20 | MXS_PAD_CTRL,
116 MX28_PAD_LCD_D21__LCD_D21 | MXS_PAD_CTRL,
117 MX28_PAD_LCD_D22__LCD_D22 | MXS_PAD_CTRL,
118 MX28_PAD_LCD_D23__LCD_D23 | MXS_PAD_CTRL,
119 MX28_PAD_LCD_RD_E__LCD_VSYNC | MXS_PAD_CTRL,
120 MX28_PAD_LCD_WR_RWN__LCD_HSYNC | MXS_PAD_CTRL,
121 MX28_PAD_LCD_RS__LCD_DOTCLK | MXS_PAD_CTRL,
122 MX28_PAD_LCD_CS__LCD_ENABLE | MXS_PAD_CTRL,
123 /* LCD panel enable */
124 MX28_PAD_LCD_RESET__GPIO_3_30 | MXS_PAD_CTRL,
125 /* backlight control */
126 MX28_PAD_PWM2__GPIO_3_18 | MXS_PAD_CTRL,
127 /* mmc0 */
128 MX28_PAD_SSP0_DATA0__SSP0_D0 |
129 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
130 MX28_PAD_SSP0_DATA1__SSP0_D1 |
131 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
132 MX28_PAD_SSP0_DATA2__SSP0_D2 |
133 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
134 MX28_PAD_SSP0_DATA3__SSP0_D3 |
135 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
136 MX28_PAD_SSP0_DATA4__SSP0_D4 |
137 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
138 MX28_PAD_SSP0_DATA5__SSP0_D5 |
139 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
140 MX28_PAD_SSP0_DATA6__SSP0_D6 |
141 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
142 MX28_PAD_SSP0_DATA7__SSP0_D7 |
143 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
144 MX28_PAD_SSP0_CMD__SSP0_CMD |
145 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
146 MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT |
147 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
148 MX28_PAD_SSP0_SCK__SSP0_SCK |
149 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
150 /* write protect */
151 MX28_PAD_SSP1_SCK__GPIO_2_12 |
152 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
153 /* slot power enable */
154 MX28_PAD_PWM3__GPIO_3_28 |
155 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
156
157 /* mmc1 */
158 MX28_PAD_GPMI_D00__SSP1_D0 |
159 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
160 MX28_PAD_GPMI_D01__SSP1_D1 |
161 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
162 MX28_PAD_GPMI_D02__SSP1_D2 |
163 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
164 MX28_PAD_GPMI_D03__SSP1_D3 |
165 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
166 MX28_PAD_GPMI_D04__SSP1_D4 |
167 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
168 MX28_PAD_GPMI_D05__SSP1_D5 |
169 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
170 MX28_PAD_GPMI_D06__SSP1_D6 |
171 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
172 MX28_PAD_GPMI_D07__SSP1_D7 |
173 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
174 MX28_PAD_GPMI_RDY1__SSP1_CMD |
175 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
176 MX28_PAD_GPMI_RDY0__SSP1_CARD_DETECT |
177 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
178 MX28_PAD_GPMI_WRN__SSP1_SCK |
179 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
180 /* write protect */
181 MX28_PAD_GPMI_RESETN__GPIO_0_28 |
182 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
183 /* slot power enable */
184 MX28_PAD_PWM4__GPIO_3_29 |
185 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
186
187 /* led */
188 MX28_PAD_AUART1_TX__GPIO_3_5 | MXS_PAD_CTRL,
189
190 /* I2C */
191 MX28_PAD_I2C0_SCL__I2C0_SCL |
192 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
193 MX28_PAD_I2C0_SDA__I2C0_SDA |
194 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
195
196 /* saif0 & saif1 */
197 MX28_PAD_SAIF0_MCLK__SAIF0_MCLK |
198 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
199 MX28_PAD_SAIF0_LRCLK__SAIF0_LRCLK |
200 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
201 MX28_PAD_SAIF0_BITCLK__SAIF0_BITCLK |
202 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
203 MX28_PAD_SAIF0_SDATA0__SAIF0_SDATA0 |
204 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
205 MX28_PAD_SAIF1_SDATA0__SAIF1_SDATA0 |
206 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
207};
208
209/* led */
210static const struct gpio_led mx28evk_leds[] __initconst = {
211 {
212 .name = "GPIO-LED",
213 .default_trigger = "heartbeat",
214 .gpio = MX28EVK_GPIO_LED,
215 },
216};
217
218static const struct gpio_led_platform_data mx28evk_led_data __initconst = {
219 .leds = mx28evk_leds,
220 .num_leds = ARRAY_SIZE(mx28evk_leds),
221};
222
223/* fec */
224static void __init mx28evk_fec_reset(void)
225{
226 struct clk *clk;
227
228 /* Enable fec phy clock */
229 clk = clk_get_sys("enet_out", NULL);
230 if (!IS_ERR(clk))
231 clk_prepare_enable(clk);
232
233 gpio_set_value(MX28EVK_FEC_PHY_RESET, 0);
234 mdelay(1);
235 gpio_set_value(MX28EVK_FEC_PHY_RESET, 1);
236}
237
238static struct fec_platform_data mx28_fec_pdata[] __initdata = {
239 {
240 /* fec0 */
241 .phy = PHY_INTERFACE_MODE_RMII,
242 }, {
243 /* fec1 */
244 .phy = PHY_INTERFACE_MODE_RMII,
245 },
246};
247
248static int __init mx28evk_fec_get_mac(void)
249{
250 int i;
251 u32 val;
252 const u32 *ocotp = mxs_get_ocotp();
253
254 if (!ocotp)
255 return -ETIMEDOUT;
256
257 /*
258 * OCOTP only stores the last 4 octets for each mac address,
259 * so hard-code Freescale OUI (00:04:9f) here.
260 */
261 for (i = 0; i < 2; i++) {
262 val = ocotp[i];
263 mx28_fec_pdata[i].mac[0] = 0x00;
264 mx28_fec_pdata[i].mac[1] = 0x04;
265 mx28_fec_pdata[i].mac[2] = 0x9f;
266 mx28_fec_pdata[i].mac[3] = (val >> 16) & 0xff;
267 mx28_fec_pdata[i].mac[4] = (val >> 8) & 0xff;
268 mx28_fec_pdata[i].mac[5] = (val >> 0) & 0xff;
269 }
270
271 return 0;
272}
273
274/*
275 * MX28EVK_FLEXCAN_SWITCH is shared between both flexcan controllers
276 */
277static int flexcan0_en, flexcan1_en;
278
279static void mx28evk_flexcan_switch(void)
280{
281 if (flexcan0_en || flexcan1_en)
282 gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 1);
283 else
284 gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 0);
285}
286
287static void mx28evk_flexcan0_switch(int enable)
288{
289 flexcan0_en = enable;
290 mx28evk_flexcan_switch();
291}
292
293static void mx28evk_flexcan1_switch(int enable)
294{
295 flexcan1_en = enable;
296 mx28evk_flexcan_switch();
297}
298
299static const struct flexcan_platform_data
300 mx28evk_flexcan_pdata[] __initconst = {
301 {
302 .transceiver_switch = mx28evk_flexcan0_switch,
303 }, {
304 .transceiver_switch = mx28evk_flexcan1_switch,
305 }
306};
307
308/* mxsfb (lcdif) */
309static struct fb_videomode mx28evk_video_modes[] = {
310 {
311 .name = "Seiko-43WVF1G",
312 .refresh = 60,
313 .xres = 800,
314 .yres = 480,
315 .pixclock = 29851, /* picosecond (33.5 MHz) */
316 .left_margin = 89,
317 .right_margin = 164,
318 .upper_margin = 23,
319 .lower_margin = 10,
320 .hsync_len = 10,
321 .vsync_len = 10,
322 .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT |
323 FB_SYNC_DOTCLK_FAILING_ACT,
324 },
325};
326
327static const struct mxsfb_platform_data mx28evk_mxsfb_pdata __initconst = {
328 .mode_list = mx28evk_video_modes,
329 .mode_count = ARRAY_SIZE(mx28evk_video_modes),
330 .default_bpp = 32,
331 .ld_intf_width = STMLCDIF_24BIT,
332};
333
334static struct mxs_mmc_platform_data mx28evk_mmc_pdata[] __initdata = {
335 {
336 /* mmc0 */
337 .wp_gpio = MX28EVK_MMC0_WRITE_PROTECT,
338 .flags = SLOTF_8_BIT_CAPABLE,
339 }, {
340 /* mmc1 */
341 .wp_gpio = MX28EVK_MMC1_WRITE_PROTECT,
342 .flags = SLOTF_8_BIT_CAPABLE,
343 },
344};
345
346static struct i2c_board_info mxs_i2c0_board_info[] __initdata = {
347 {
348 I2C_BOARD_INFO("sgtl5000", 0x0a),
349 },
350};
351
352#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
353static struct regulator_consumer_supply mx28evk_audio_consumer_supplies[] = {
354 REGULATOR_SUPPLY("VDDA", "0-000a"),
355 REGULATOR_SUPPLY("VDDIO", "0-000a"),
356};
357
358static struct regulator_init_data mx28evk_vdd_reg_init_data = {
359 .constraints = {
360 .name = "3V3",
361 .always_on = 1,
362 },
363 .consumer_supplies = mx28evk_audio_consumer_supplies,
364 .num_consumer_supplies = ARRAY_SIZE(mx28evk_audio_consumer_supplies),
365};
366
367static struct fixed_voltage_config mx28evk_vdd_pdata = {
368 .supply_name = "board-3V3",
369 .microvolts = 3300000,
370 .gpio = -EINVAL,
371 .enabled_at_boot = 1,
372 .init_data = &mx28evk_vdd_reg_init_data,
373};
374static struct platform_device mx28evk_voltage_regulator = {
375 .name = "reg-fixed-voltage",
376 .id = -1,
377 .num_resources = 0,
378 .dev = {
379 .platform_data = &mx28evk_vdd_pdata,
380 },
381};
382static void __init mx28evk_add_regulators(void)
383{
384 platform_device_register(&mx28evk_voltage_regulator);
385}
386#else
387static void __init mx28evk_add_regulators(void) {}
388#endif
389
390static const struct gpio mx28evk_gpios[] __initconst = {
391 { MX28EVK_LCD_ENABLE, GPIOF_OUT_INIT_HIGH, "lcd-enable" },
392 { MX28EVK_BL_ENABLE, GPIOF_OUT_INIT_HIGH, "bl-enable" },
393 { MX28EVK_FLEXCAN_SWITCH, GPIOF_DIR_OUT, "flexcan-switch" },
394 { MX28EVK_MMC0_SLOT_POWER, GPIOF_OUT_INIT_LOW, "mmc0-slot-power" },
395 { MX28EVK_MMC1_SLOT_POWER, GPIOF_OUT_INIT_LOW, "mmc1-slot-power" },
396 { MX28EVK_FEC_PHY_POWER, GPIOF_OUT_INIT_LOW, "fec-phy-power" },
397 { MX28EVK_FEC_PHY_RESET, GPIOF_DIR_OUT, "fec-phy-reset" },
398};
399
400static const struct mxs_saif_platform_data
401 mx28evk_mxs_saif_pdata[] __initconst = {
402 /* working on EXTMSTR0 mode (saif0 master, saif1 slave) */
403 {
404 .master_mode = 1,
405 .master_id = 0,
406 }, {
407 .master_mode = 0,
408 .master_id = 0,
409 },
410};
411
412static void __init mx28evk_init(void)
413{
414 int ret;
415
416 mx28_soc_init();
417
418 mxs_iomux_setup_multiple_pads(mx28evk_pads, ARRAY_SIZE(mx28evk_pads));
419
420 mx28_add_duart();
421 mx28_add_auart0();
422 mx28_add_auart3();
423
424 if (mx28evk_fec_get_mac())
425 pr_warn("%s: failed on fec mac setup\n", __func__);
426
427 ret = gpio_request_array(mx28evk_gpios, ARRAY_SIZE(mx28evk_gpios));
428 if (ret)
429 pr_err("One or more GPIOs failed to be requested: %d\n", ret);
430
431 mx28evk_fec_reset();
432 mx28_add_fec(0, &mx28_fec_pdata[0]);
433 mx28_add_fec(1, &mx28_fec_pdata[1]);
434
435 mx28_add_flexcan(0, &mx28evk_flexcan_pdata[0]);
436 mx28_add_flexcan(1, &mx28evk_flexcan_pdata[1]);
437
438 mx28_add_mxsfb(&mx28evk_mxsfb_pdata);
439
440 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
441 mx28_add_saif(0, &mx28evk_mxs_saif_pdata[0]);
442 mx28_add_saif(1, &mx28evk_mxs_saif_pdata[1]);
443
444 mx28_add_mxs_i2c(0);
445 i2c_register_board_info(0, mxs_i2c0_board_info,
446 ARRAY_SIZE(mxs_i2c0_board_info));
447
448 mx28evk_add_regulators();
449
450 mxs_add_platform_device("mxs-sgtl5000", 0, NULL, 0,
451 NULL, 0);
452
453 mx28_add_mxs_mmc(0, &mx28evk_mmc_pdata[0]);
454 mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]);
455
456 mx28_add_rtc_stmp3xxx();
457
458 gpio_led_register_device(0, &mx28evk_led_data);
459}
460
461static void __init mx28evk_timer_init(void)
462{
463 mx28_clocks_init();
464}
465
466static struct sys_timer mx28evk_timer = {
467 .init = mx28evk_timer_init,
468};
469
470MACHINE_START(MX28EVK, "Freescale MX28 EVK")
471 /* Maintainer: Freescale Semiconductor, Inc. */
472 .map_io = mx28_map_io,
473 .init_irq = mx28_init_irq,
474 .timer = &mx28evk_timer,
475 .init_machine = mx28evk_init,
476 .restart = mxs_restart,
477MACHINE_END
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 8dabfe81d07..4748ec551a6 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -12,18 +12,21 @@
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/can/platform/flexcan.h>
16#include <linux/delay.h>
15#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/gpio.h>
16#include <linux/init.h> 19#include <linux/init.h>
17#include <linux/init.h>
18#include <linux/irqdomain.h>
19#include <linux/micrel_phy.h> 20#include <linux/micrel_phy.h>
20#include <linux/mxsfb.h> 21#include <linux/mxsfb.h>
21#include <linux/of_irq.h>
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23#include <linux/phy.h> 23#include <linux/phy.h>
24#include <linux/pinctrl/consumer.h>
24#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
25#include <asm/mach/time.h> 26#include <asm/mach/time.h>
26#include <mach/common.h> 27#include <mach/common.h>
28#include <mach/digctl.h>
29#include <mach/mxs.h>
27 30
28static struct fb_videomode mx23evk_video_modes[] = { 31static struct fb_videomode mx23evk_video_modes[] = {
29 { 32 {
@@ -99,43 +102,43 @@ static struct fb_videomode apx4devkit_video_modes[] = {
99 102
100static struct mxsfb_platform_data mxsfb_pdata __initdata; 103static struct mxsfb_platform_data mxsfb_pdata __initdata;
101 104
102static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = { 105/*
103 OF_DEV_AUXDATA("fsl,imx23-lcdif", 0x80030000, NULL, &mxsfb_pdata), 106 * MX28EVK_FLEXCAN_SWITCH is shared between both flexcan controllers
104 OF_DEV_AUXDATA("fsl,imx28-lcdif", 0x80030000, NULL, &mxsfb_pdata), 107 */
105 { /* sentinel */ } 108#define MX28EVK_FLEXCAN_SWITCH MXS_GPIO_NR(2, 13)
106};
107 109
108static int __init mxs_icoll_add_irq_domain(struct device_node *np, 110static int flexcan0_en, flexcan1_en;
109 struct device_node *interrupt_parent)
110{
111 irq_domain_add_legacy(np, 128, 0, 0, &irq_domain_simple_ops, NULL);
112 111
113 return 0; 112static void mx28evk_flexcan_switch(void)
113{
114 if (flexcan0_en || flexcan1_en)
115 gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 1);
116 else
117 gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 0);
114} 118}
115 119
116static int __init mxs_gpio_add_irq_domain(struct device_node *np, 120static void mx28evk_flexcan0_switch(int enable)
117 struct device_node *interrupt_parent)
118{ 121{
119 static int gpio_irq_base = MXS_GPIO_IRQ_START; 122 flexcan0_en = enable;
120 123 mx28evk_flexcan_switch();
121 irq_domain_add_legacy(np, 32, gpio_irq_base, 0, &irq_domain_simple_ops, NULL); 124}
122 gpio_irq_base += 32;
123 125
124 return 0; 126static void mx28evk_flexcan1_switch(int enable)
127{
128 flexcan1_en = enable;
129 mx28evk_flexcan_switch();
125} 130}
126 131
127static const struct of_device_id mxs_irq_match[] __initconst = { 132static struct flexcan_platform_data flexcan_pdata[2];
128 { .compatible = "fsl,mxs-icoll", .data = mxs_icoll_add_irq_domain, }, 133
129 { .compatible = "fsl,mxs-gpio", .data = mxs_gpio_add_irq_domain, }, 134static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
135 OF_DEV_AUXDATA("fsl,imx23-lcdif", 0x80030000, NULL, &mxsfb_pdata),
136 OF_DEV_AUXDATA("fsl,imx28-lcdif", 0x80030000, NULL, &mxsfb_pdata),
137 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80032000, NULL, &flexcan_pdata[0]),
138 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80034000, NULL, &flexcan_pdata[1]),
130 { /* sentinel */ } 139 { /* sentinel */ }
131}; 140};
132 141
133static void __init mxs_dt_init_irq(void)
134{
135 icoll_init_irq();
136 of_irq_init(mxs_irq_match);
137}
138
139static void __init imx23_timer_init(void) 142static void __init imx23_timer_init(void)
140{ 143{
141 mx23_clocks_init(); 144 mx23_clocks_init();
@@ -237,13 +240,21 @@ static void __init imx28_evk_init(void)
237 mxsfb_pdata.mode_count = ARRAY_SIZE(mx28evk_video_modes); 240 mxsfb_pdata.mode_count = ARRAY_SIZE(mx28evk_video_modes);
238 mxsfb_pdata.default_bpp = 32; 241 mxsfb_pdata.default_bpp = 32;
239 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT; 242 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
243
244 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
240} 245}
241 246
242static void __init m28evk_init(void) 247static void __init imx28_evk_post_init(void)
243{ 248{
244 enable_clk_enet_out(); 249 if (!gpio_request_one(MX28EVK_FLEXCAN_SWITCH, GPIOF_DIR_OUT,
245 update_fec_mac_prop(OUI_DENX); 250 "flexcan-switch")) {
251 flexcan_pdata[0].transceiver_switch = mx28evk_flexcan0_switch;
252 flexcan_pdata[1].transceiver_switch = mx28evk_flexcan1_switch;
253 }
254}
246 255
256static void __init m28evk_init(void)
257{
247 mxsfb_pdata.mode_list = m28evk_video_modes; 258 mxsfb_pdata.mode_list = m28evk_video_modes;
248 mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes); 259 mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes);
249 mxsfb_pdata.default_bpp = 16; 260 mxsfb_pdata.default_bpp = 16;
@@ -261,7 +272,7 @@ static void __init apx4devkit_init(void)
261 enable_clk_enet_out(); 272 enable_clk_enet_out();
262 273
263 if (IS_BUILTIN(CONFIG_PHYLIB)) 274 if (IS_BUILTIN(CONFIG_PHYLIB))
264 phy_register_fixup_for_uid(PHY_ID_KS8051, MICREL_PHY_ID_MASK, 275 phy_register_fixup_for_uid(PHY_ID_KSZ8051, MICREL_PHY_ID_MASK,
265 apx4devkit_phy_fixup); 276 apx4devkit_phy_fixup);
266 277
267 mxsfb_pdata.mode_list = apx4devkit_video_modes; 278 mxsfb_pdata.mode_list = apx4devkit_video_modes;
@@ -270,6 +281,80 @@ static void __init apx4devkit_init(void)
270 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT; 281 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
271} 282}
272 283
284#define ENET0_MDC__GPIO_4_0 MXS_GPIO_NR(4, 0)
285#define ENET0_MDIO__GPIO_4_1 MXS_GPIO_NR(4, 1)
286#define ENET0_RX_EN__GPIO_4_2 MXS_GPIO_NR(4, 2)
287#define ENET0_RXD0__GPIO_4_3 MXS_GPIO_NR(4, 3)
288#define ENET0_RXD1__GPIO_4_4 MXS_GPIO_NR(4, 4)
289#define ENET0_TX_EN__GPIO_4_6 MXS_GPIO_NR(4, 6)
290#define ENET0_TXD0__GPIO_4_7 MXS_GPIO_NR(4, 7)
291#define ENET0_TXD1__GPIO_4_8 MXS_GPIO_NR(4, 8)
292#define ENET_CLK__GPIO_4_16 MXS_GPIO_NR(4, 16)
293
294#define TX28_FEC_PHY_POWER MXS_GPIO_NR(3, 29)
295#define TX28_FEC_PHY_RESET MXS_GPIO_NR(4, 13)
296#define TX28_FEC_nINT MXS_GPIO_NR(4, 5)
297
298static const struct gpio tx28_gpios[] __initconst = {
299 { ENET0_MDC__GPIO_4_0, GPIOF_OUT_INIT_LOW, "GPIO_4_0" },
300 { ENET0_MDIO__GPIO_4_1, GPIOF_OUT_INIT_LOW, "GPIO_4_1" },
301 { ENET0_RX_EN__GPIO_4_2, GPIOF_OUT_INIT_LOW, "GPIO_4_2" },
302 { ENET0_RXD0__GPIO_4_3, GPIOF_OUT_INIT_LOW, "GPIO_4_3" },
303 { ENET0_RXD1__GPIO_4_4, GPIOF_OUT_INIT_LOW, "GPIO_4_4" },
304 { ENET0_TX_EN__GPIO_4_6, GPIOF_OUT_INIT_LOW, "GPIO_4_6" },
305 { ENET0_TXD0__GPIO_4_7, GPIOF_OUT_INIT_LOW, "GPIO_4_7" },
306 { ENET0_TXD1__GPIO_4_8, GPIOF_OUT_INIT_LOW, "GPIO_4_8" },
307 { ENET_CLK__GPIO_4_16, GPIOF_OUT_INIT_LOW, "GPIO_4_16" },
308 { TX28_FEC_PHY_POWER, GPIOF_OUT_INIT_LOW, "fec-phy-power" },
309 { TX28_FEC_PHY_RESET, GPIOF_OUT_INIT_LOW, "fec-phy-reset" },
310 { TX28_FEC_nINT, GPIOF_DIR_IN, "fec-int" },
311};
312
313static void __init tx28_post_init(void)
314{
315 struct device_node *np;
316 struct platform_device *pdev;
317 struct pinctrl *pctl;
318 int ret;
319
320 enable_clk_enet_out();
321
322 np = of_find_compatible_node(NULL, NULL, "fsl,imx28-fec");
323 pdev = of_find_device_by_node(np);
324 if (!pdev) {
325 pr_err("%s: failed to find fec device\n", __func__);
326 return;
327 }
328
329 pctl = pinctrl_get_select(&pdev->dev, "gpio_mode");
330 if (IS_ERR(pctl)) {
331 pr_err("%s: failed to get pinctrl state\n", __func__);
332 return;
333 }
334
335 ret = gpio_request_array(tx28_gpios, ARRAY_SIZE(tx28_gpios));
336 if (ret) {
337 pr_err("%s: failed to request gpios: %d\n", __func__, ret);
338 return;
339 }
340
341 /* Power up fec phy */
342 gpio_set_value(TX28_FEC_PHY_POWER, 1);
343 msleep(26); /* 25ms according to data sheet */
344
345 /* Mode strap pins */
346 gpio_set_value(ENET0_RX_EN__GPIO_4_2, 1);
347 gpio_set_value(ENET0_RXD0__GPIO_4_3, 1);
348 gpio_set_value(ENET0_RXD1__GPIO_4_4, 1);
349
350 udelay(100); /* minimum assertion time for nRST */
351
352 /* Deasserting FEC PHY RESET */
353 gpio_set_value(TX28_FEC_PHY_RESET, 1);
354
355 pinctrl_put(pctl);
356}
357
273static void __init mxs_machine_init(void) 358static void __init mxs_machine_init(void)
274{ 359{
275 if (of_machine_is_compatible("fsl,imx28-evk")) 360 if (of_machine_is_compatible("fsl,imx28-evk"))
@@ -283,29 +368,28 @@ static void __init mxs_machine_init(void)
283 368
284 of_platform_populate(NULL, of_default_bus_match_table, 369 of_platform_populate(NULL, of_default_bus_match_table,
285 mxs_auxdata_lookup, NULL); 370 mxs_auxdata_lookup, NULL);
371
372 if (of_machine_is_compatible("karo,tx28"))
373 tx28_post_init();
374
375 if (of_machine_is_compatible("fsl,imx28-evk"))
376 imx28_evk_post_init();
286} 377}
287 378
288static const char *imx23_dt_compat[] __initdata = { 379static const char *imx23_dt_compat[] __initdata = {
289 "fsl,imx23-evk",
290 "fsl,stmp378x_devb"
291 "olimex,imx23-olinuxino",
292 "fsl,imx23", 380 "fsl,imx23",
293 NULL, 381 NULL,
294}; 382};
295 383
296static const char *imx28_dt_compat[] __initdata = { 384static const char *imx28_dt_compat[] __initdata = {
297 "bluegiga,apx4devkit",
298 "crystalfontz,cfa10036",
299 "denx,m28evk",
300 "fsl,imx28-evk",
301 "karo,tx28",
302 "fsl,imx28", 385 "fsl,imx28",
303 NULL, 386 NULL,
304}; 387};
305 388
306DT_MACHINE_START(IMX23, "Freescale i.MX23 (Device Tree)") 389DT_MACHINE_START(IMX23, "Freescale i.MX23 (Device Tree)")
307 .map_io = mx23_map_io, 390 .map_io = mx23_map_io,
308 .init_irq = mxs_dt_init_irq, 391 .init_irq = icoll_init_irq,
392 .handle_irq = icoll_handle_irq,
309 .timer = &imx23_timer, 393 .timer = &imx23_timer,
310 .init_machine = mxs_machine_init, 394 .init_machine = mxs_machine_init,
311 .dt_compat = imx23_dt_compat, 395 .dt_compat = imx23_dt_compat,
@@ -314,7 +398,8 @@ MACHINE_END
314 398
315DT_MACHINE_START(IMX28, "Freescale i.MX28 (Device Tree)") 399DT_MACHINE_START(IMX28, "Freescale i.MX28 (Device Tree)")
316 .map_io = mx28_map_io, 400 .map_io = mx28_map_io,
317 .init_irq = mxs_dt_init_irq, 401 .init_irq = icoll_init_irq,
402 .handle_irq = icoll_handle_irq,
318 .timer = &imx28_timer, 403 .timer = &imx28_timer,
319 .init_machine = mxs_machine_init, 404 .init_machine = mxs_machine_init,
320 .dt_compat = imx28_dt_compat, 405 .dt_compat = imx28_dt_compat,
diff --git a/arch/arm/mach-mxs/mach-stmp378x_devb.c b/arch/arm/mach-mxs/mach-stmp378x_devb.c
deleted file mode 100644
index 6548965e4a7..00000000000
--- a/arch/arm/mach-mxs/mach-stmp378x_devb.c
+++ /dev/null
@@ -1,123 +0,0 @@
1/*
2 * board setup for STMP378x-Development-Board
3 *
4 * based on mx23evk board setup and information gained form the original
5 * plat-stmp based board setup, now converted to mach-mxs.
6 *
7 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
8 * Copyright (C) 2011 Wolfram Sang, Pengutronix e.K.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19
20#include <linux/platform_device.h>
21#include <linux/gpio.h>
22#include <linux/spi/spi.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <asm/mach/time.h>
27
28#include <mach/common.h>
29#include <mach/iomux-mx23.h>
30
31#include "devices-mx23.h"
32
33#define STMP378X_DEVB_MMC0_WRITE_PROTECT MXS_GPIO_NR(1, 30)
34#define STMP378X_DEVB_MMC0_SLOT_POWER MXS_GPIO_NR(1, 29)
35
36#define STMP378X_DEVB_PAD_AUART (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL)
37
38static const iomux_cfg_t stmp378x_dvb_pads[] __initconst = {
39 /* duart (extended setup missing in old boardcode, too */
40 MX23_PAD_PWM0__DUART_RX,
41 MX23_PAD_PWM1__DUART_TX,
42
43 /* auart */
44 MX23_PAD_AUART1_RX__AUART1_RX | STMP378X_DEVB_PAD_AUART,
45 MX23_PAD_AUART1_TX__AUART1_TX | STMP378X_DEVB_PAD_AUART,
46 MX23_PAD_AUART1_CTS__AUART1_CTS | STMP378X_DEVB_PAD_AUART,
47 MX23_PAD_AUART1_RTS__AUART1_RTS | STMP378X_DEVB_PAD_AUART,
48
49 /* mmc */
50 MX23_PAD_SSP1_DATA0__SSP1_DATA0 |
51 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
52 MX23_PAD_SSP1_DATA1__SSP1_DATA1 |
53 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
54 MX23_PAD_SSP1_DATA2__SSP1_DATA2 |
55 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
56 MX23_PAD_SSP1_DATA3__SSP1_DATA3 |
57 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
58 MX23_PAD_SSP1_CMD__SSP1_CMD |
59 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
60 MX23_PAD_SSP1_DETECT__SSP1_DETECT |
61 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
62 MX23_PAD_SSP1_SCK__SSP1_SCK |
63 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
64 MX23_PAD_PWM4__GPIO_1_30 | MXS_PAD_CTRL, /* write protect */
65 MX23_PAD_PWM3__GPIO_1_29 | MXS_PAD_CTRL, /* power enable */
66};
67
68static struct mxs_mmc_platform_data stmp378x_dvb_mmc_pdata __initdata = {
69 .wp_gpio = STMP378X_DEVB_MMC0_WRITE_PROTECT,
70};
71
72static struct spi_board_info spi_board_info[] __initdata = {
73#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
74 {
75 .modalias = "enc28j60",
76 .max_speed_hz = 6 * 1000 * 1000,
77 .bus_num = 1,
78 .chip_select = 0,
79 .platform_data = NULL,
80 },
81#endif
82};
83
84static void __init stmp378x_dvb_init(void)
85{
86 int ret;
87
88 mx23_soc_init();
89
90 mxs_iomux_setup_multiple_pads(stmp378x_dvb_pads,
91 ARRAY_SIZE(stmp378x_dvb_pads));
92
93 mx23_add_duart();
94 mx23_add_auart0();
95 mx23_add_rtc_stmp3xxx();
96
97 /* power on mmc slot */
98 ret = gpio_request_one(STMP378X_DEVB_MMC0_SLOT_POWER,
99 GPIOF_OUT_INIT_LOW, "mmc0-slot-power");
100 if (ret)
101 pr_warn("could not power mmc (%d)\n", ret);
102
103 mx23_add_mxs_mmc(0, &stmp378x_dvb_mmc_pdata);
104
105 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
106}
107
108static void __init stmp378x_dvb_timer_init(void)
109{
110 mx23_clocks_init();
111}
112
113static struct sys_timer stmp378x_dvb_timer = {
114 .init = stmp378x_dvb_timer_init,
115};
116
117MACHINE_START(STMP378X, "STMP378X")
118 .map_io = mx23_map_io,
119 .init_irq = mx23_init_irq,
120 .timer = &stmp378x_dvb_timer,
121 .init_machine = stmp378x_dvb_init,
122 .restart = mxs_restart,
123MACHINE_END
diff --git a/arch/arm/mach-mxs/mach-tx28.c b/arch/arm/mach-mxs/mach-tx28.c
deleted file mode 100644
index 8837029de1a..00000000000
--- a/arch/arm/mach-mxs/mach-tx28.c
+++ /dev/null
@@ -1,184 +0,0 @@
1/*
2 * Copyright (C) 2010 <LW@KARO-electronics.de>
3 *
4 * based on: mach-mx28_evk.c
5 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation
10 */
11#include <linux/kernel.h>
12#include <linux/gpio.h>
13#include <linux/leds.h>
14#include <linux/platform_device.h>
15#include <linux/spi/spi.h>
16#include <linux/spi/spi_gpio.h>
17#include <linux/i2c.h>
18
19#include <asm/mach/arch.h>
20#include <asm/mach/time.h>
21
22#include <mach/common.h>
23#include <mach/iomux-mx28.h>
24
25#include "devices-mx28.h"
26#include "module-tx28.h"
27
28#define TX28_STK5_GPIO_LED MXS_GPIO_NR(4, 10)
29
30static const iomux_cfg_t tx28_stk5v3_pads[] __initconst = {
31 /* LED */
32 MX28_PAD_ENET0_RXD3__GPIO_4_10 |
33 MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL,
34
35 /* framebuffer */
36#define LCD_MODE (MXS_PAD_3V3 | MXS_PAD_4MA)
37 MX28_PAD_LCD_D00__LCD_D0 | LCD_MODE,
38 MX28_PAD_LCD_D01__LCD_D1 | LCD_MODE,
39 MX28_PAD_LCD_D02__LCD_D2 | LCD_MODE,
40 MX28_PAD_LCD_D03__LCD_D3 | LCD_MODE,
41 MX28_PAD_LCD_D04__LCD_D4 | LCD_MODE,
42 MX28_PAD_LCD_D05__LCD_D5 | LCD_MODE,
43 MX28_PAD_LCD_D06__LCD_D6 | LCD_MODE,
44 MX28_PAD_LCD_D07__LCD_D7 | LCD_MODE,
45 MX28_PAD_LCD_D08__LCD_D8 | LCD_MODE,
46 MX28_PAD_LCD_D09__LCD_D9 | LCD_MODE,
47 MX28_PAD_LCD_D10__LCD_D10 | LCD_MODE,
48 MX28_PAD_LCD_D11__LCD_D11 | LCD_MODE,
49 MX28_PAD_LCD_D12__LCD_D12 | LCD_MODE,
50 MX28_PAD_LCD_D13__LCD_D13 | LCD_MODE,
51 MX28_PAD_LCD_D14__LCD_D14 | LCD_MODE,
52 MX28_PAD_LCD_D15__LCD_D15 | LCD_MODE,
53 MX28_PAD_LCD_D16__LCD_D16 | LCD_MODE,
54 MX28_PAD_LCD_D17__LCD_D17 | LCD_MODE,
55 MX28_PAD_LCD_D18__LCD_D18 | LCD_MODE,
56 MX28_PAD_LCD_D19__LCD_D19 | LCD_MODE,
57 MX28_PAD_LCD_D20__LCD_D20 | LCD_MODE,
58 MX28_PAD_LCD_D21__LCD_D21 | LCD_MODE,
59 MX28_PAD_LCD_D22__LCD_D22 | LCD_MODE,
60 MX28_PAD_LCD_D23__LCD_D23 | LCD_MODE,
61 MX28_PAD_LCD_RD_E__LCD_VSYNC | LCD_MODE,
62 MX28_PAD_LCD_WR_RWN__LCD_HSYNC | LCD_MODE,
63 MX28_PAD_LCD_RS__LCD_DOTCLK | LCD_MODE,
64 MX28_PAD_LCD_CS__LCD_CS | LCD_MODE,
65 MX28_PAD_LCD_VSYNC__LCD_VSYNC | LCD_MODE,
66 MX28_PAD_LCD_HSYNC__LCD_HSYNC | LCD_MODE,
67 MX28_PAD_LCD_DOTCLK__LCD_DOTCLK | LCD_MODE,
68 MX28_PAD_LCD_ENABLE__GPIO_1_31 | LCD_MODE,
69 MX28_PAD_LCD_RESET__GPIO_3_30 | LCD_MODE,
70 MX28_PAD_PWM0__PWM_0 | LCD_MODE,
71
72 /* UART1 */
73 MX28_PAD_AUART0_CTS__DUART_RX,
74 MX28_PAD_AUART0_RTS__DUART_TX,
75 MX28_PAD_AUART0_TX__DUART_RTS,
76 MX28_PAD_AUART0_RX__DUART_CTS,
77
78 /* UART2 */
79 MX28_PAD_AUART1_RX__AUART1_RX,
80 MX28_PAD_AUART1_TX__AUART1_TX,
81 MX28_PAD_AUART1_RTS__AUART1_RTS,
82 MX28_PAD_AUART1_CTS__AUART1_CTS,
83
84 /* CAN */
85 MX28_PAD_GPMI_RDY2__CAN0_TX,
86 MX28_PAD_GPMI_RDY3__CAN0_RX,
87
88 /* I2C */
89 MX28_PAD_I2C0_SCL__I2C0_SCL,
90 MX28_PAD_I2C0_SDA__I2C0_SDA,
91
92 /* TSC2007 */
93 MX28_PAD_SAIF0_MCLK__GPIO_3_20 | MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_PULLUP,
94
95 /* MMC0 */
96 MX28_PAD_SSP0_DATA0__SSP0_D0 |
97 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
98 MX28_PAD_SSP0_DATA1__SSP0_D1 |
99 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
100 MX28_PAD_SSP0_DATA2__SSP0_D2 |
101 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
102 MX28_PAD_SSP0_DATA3__SSP0_D3 |
103 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
104 MX28_PAD_SSP0_CMD__SSP0_CMD |
105 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
106 MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT |
107 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
108 MX28_PAD_SSP0_SCK__SSP0_SCK |
109 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
110};
111
112static const struct gpio_led tx28_stk5v3_leds[] __initconst = {
113 {
114 .name = "GPIO-LED",
115 .default_trigger = "heartbeat",
116 .gpio = TX28_STK5_GPIO_LED,
117 },
118};
119
120static const struct gpio_led_platform_data tx28_stk5v3_led_data __initconst = {
121 .leds = tx28_stk5v3_leds,
122 .num_leds = ARRAY_SIZE(tx28_stk5v3_leds),
123};
124
125static struct spi_board_info tx28_spi_board_info[] = {
126 {
127 .modalias = "spidev",
128 .max_speed_hz = 20000000,
129 .bus_num = 0,
130 .chip_select = 1,
131 .controller_data = (void *)SPI_GPIO_NO_CHIPSELECT,
132 .mode = SPI_MODE_0,
133 },
134};
135
136static struct i2c_board_info tx28_stk5v3_i2c_boardinfo[] __initdata = {
137 {
138 I2C_BOARD_INFO("ds1339", 0x68),
139 },
140};
141
142static struct mxs_mmc_platform_data tx28_mmc0_pdata __initdata = {
143 .wp_gpio = -EINVAL,
144 .flags = SLOTF_4_BIT_CAPABLE,
145};
146
147static void __init tx28_stk5v3_init(void)
148{
149 mx28_soc_init();
150
151 mxs_iomux_setup_multiple_pads(tx28_stk5v3_pads,
152 ARRAY_SIZE(tx28_stk5v3_pads));
153
154 mx28_add_duart(); /* UART1 */
155 mx28_add_auart(1); /* UART2 */
156
157 tx28_add_fec0();
158 /* spi via ssp will be added when available */
159 spi_register_board_info(tx28_spi_board_info,
160 ARRAY_SIZE(tx28_spi_board_info));
161 gpio_led_register_device(0, &tx28_stk5v3_led_data);
162 mx28_add_mxs_i2c(0);
163 i2c_register_board_info(0, tx28_stk5v3_i2c_boardinfo,
164 ARRAY_SIZE(tx28_stk5v3_i2c_boardinfo));
165 mx28_add_mxs_mmc(0, &tx28_mmc0_pdata);
166 mx28_add_rtc_stmp3xxx();
167}
168
169static void __init tx28_timer_init(void)
170{
171 mx28_clocks_init();
172}
173
174static struct sys_timer tx28_timer = {
175 .init = tx28_timer_init,
176};
177
178MACHINE_START(TX28, "Ka-Ro electronics TX28 module")
179 .map_io = mx28_map_io,
180 .init_irq = mx28_init_irq,
181 .timer = &tx28_timer,
182 .init_machine = tx28_stk5v3_init,
183 .restart = mxs_restart,
184MACHINE_END
diff --git a/arch/arm/mach-mxs/mm.c b/arch/arm/mach-mxs/mm.c
index dccb67a9e7c..a4294aa9f30 100644
--- a/arch/arm/mach-mxs/mm.c
+++ b/arch/arm/mach-mxs/mm.c
@@ -13,14 +13,11 @@
13 13
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/pinctrl/machine.h>
17 16
18#include <asm/mach/map.h> 17#include <asm/mach/map.h>
19 18
20#include <mach/mx23.h> 19#include <mach/mx23.h>
21#include <mach/mx28.h> 20#include <mach/mx28.h>
22#include <mach/common.h>
23#include <mach/iomux.h>
24 21
25/* 22/*
26 * Define the MX23 memory map. 23 * Define the MX23 memory map.
@@ -48,43 +45,7 @@ void __init mx23_map_io(void)
48 iotable_init(mx23_io_desc, ARRAY_SIZE(mx23_io_desc)); 45 iotable_init(mx23_io_desc, ARRAY_SIZE(mx23_io_desc));
49} 46}
50 47
51void __init mx23_init_irq(void)
52{
53 icoll_init_irq();
54}
55
56void __init mx28_map_io(void) 48void __init mx28_map_io(void)
57{ 49{
58 iotable_init(mx28_io_desc, ARRAY_SIZE(mx28_io_desc)); 50 iotable_init(mx28_io_desc, ARRAY_SIZE(mx28_io_desc));
59} 51}
60
61void __init mx28_init_irq(void)
62{
63 icoll_init_irq();
64}
65
66void __init mx23_soc_init(void)
67{
68 pinctrl_provide_dummies();
69
70 mxs_add_dma("imx23-dma-apbh", MX23_APBH_DMA_BASE_ADDR);
71 mxs_add_dma("imx23-dma-apbx", MX23_APBX_DMA_BASE_ADDR);
72
73 mxs_add_gpio("imx23-gpio", 0, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO0);
74 mxs_add_gpio("imx23-gpio", 1, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO1);
75 mxs_add_gpio("imx23-gpio", 2, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO2);
76}
77
78void __init mx28_soc_init(void)
79{
80 pinctrl_provide_dummies();
81
82 mxs_add_dma("imx28-dma-apbh", MX23_APBH_DMA_BASE_ADDR);
83 mxs_add_dma("imx28-dma-apbx", MX23_APBX_DMA_BASE_ADDR);
84
85 mxs_add_gpio("imx28-gpio", 0, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO0);
86 mxs_add_gpio("imx28-gpio", 1, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO1);
87 mxs_add_gpio("imx28-gpio", 2, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO2);
88 mxs_add_gpio("imx28-gpio", 3, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO3);
89 mxs_add_gpio("imx28-gpio", 4, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO4);
90}
diff --git a/arch/arm/mach-mxs/module-tx28.c b/arch/arm/mach-mxs/module-tx28.c
deleted file mode 100644
index 0f71f82101c..00000000000
--- a/arch/arm/mach-mxs/module-tx28.c
+++ /dev/null
@@ -1,160 +0,0 @@
1/*
2 * Copyright (C) 2010 <LW@KARO-electronics.de>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8
9#include <linux/delay.h>
10#include <linux/fec.h>
11#include <linux/gpio.h>
12
13#include <mach/iomux-mx28.h>
14#include "devices-mx28.h"
15
16#include "module-tx28.h"
17
18#define TX28_FEC_PHY_POWER MXS_GPIO_NR(3, 29)
19#define TX28_FEC_PHY_RESET MXS_GPIO_NR(4, 13)
20
21static const iomux_cfg_t tx28_fec_gpio_pads[] __initconst = {
22 /* PHY POWER */
23 MX28_PAD_PWM4__GPIO_3_29 |
24 MXS_PAD_4MA | MXS_PAD_NOPULL | MXS_PAD_3V3,
25 /* PHY RESET */
26 MX28_PAD_ENET0_RX_CLK__GPIO_4_13 |
27 MXS_PAD_4MA | MXS_PAD_NOPULL | MXS_PAD_3V3,
28 /* Mode strap pins 0-2 */
29 MX28_PAD_ENET0_RXD0__GPIO_4_3 |
30 MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3,
31 MX28_PAD_ENET0_RXD1__GPIO_4_4 |
32 MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3,
33 MX28_PAD_ENET0_RX_EN__GPIO_4_2 |
34 MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3,
35 /* nINT */
36 MX28_PAD_ENET0_TX_CLK__GPIO_4_5 |
37 MXS_PAD_4MA | MXS_PAD_NOPULL | MXS_PAD_3V3,
38
39 MX28_PAD_ENET0_MDC__GPIO_4_0,
40 MX28_PAD_ENET0_MDIO__GPIO_4_1,
41 MX28_PAD_ENET0_TX_EN__GPIO_4_6,
42 MX28_PAD_ENET0_TXD0__GPIO_4_7,
43 MX28_PAD_ENET0_TXD1__GPIO_4_8,
44 MX28_PAD_ENET_CLK__GPIO_4_16,
45};
46
47#define FEC_MODE (MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3)
48static const iomux_cfg_t tx28_fec0_pads[] __initconst = {
49 MX28_PAD_ENET0_MDC__ENET0_MDC | FEC_MODE,
50 MX28_PAD_ENET0_MDIO__ENET0_MDIO | FEC_MODE,
51 MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | FEC_MODE,
52 MX28_PAD_ENET0_RXD0__ENET0_RXD0 | FEC_MODE,
53 MX28_PAD_ENET0_RXD1__ENET0_RXD1 | FEC_MODE,
54 MX28_PAD_ENET0_TX_EN__ENET0_TX_EN | FEC_MODE,
55 MX28_PAD_ENET0_TXD0__ENET0_TXD0 | FEC_MODE,
56 MX28_PAD_ENET0_TXD1__ENET0_TXD1 | FEC_MODE,
57 MX28_PAD_ENET_CLK__CLKCTRL_ENET | FEC_MODE,
58};
59
60static const iomux_cfg_t tx28_fec1_pads[] __initconst = {
61 MX28_PAD_ENET0_RXD2__ENET1_RXD0,
62 MX28_PAD_ENET0_RXD3__ENET1_RXD1,
63 MX28_PAD_ENET0_TXD2__ENET1_TXD0,
64 MX28_PAD_ENET0_TXD3__ENET1_TXD1,
65 MX28_PAD_ENET0_COL__ENET1_TX_EN,
66 MX28_PAD_ENET0_CRS__ENET1_RX_EN,
67};
68
69static const struct fec_platform_data tx28_fec0_data __initconst = {
70 .phy = PHY_INTERFACE_MODE_RMII,
71};
72
73static const struct fec_platform_data tx28_fec1_data __initconst = {
74 .phy = PHY_INTERFACE_MODE_RMII,
75};
76
77int __init tx28_add_fec0(void)
78{
79 int i, ret;
80
81 pr_debug("%s: Switching FEC PHY power off\n", __func__);
82 ret = mxs_iomux_setup_multiple_pads(tx28_fec_gpio_pads,
83 ARRAY_SIZE(tx28_fec_gpio_pads));
84 for (i = 0; i < ARRAY_SIZE(tx28_fec_gpio_pads); i++) {
85 unsigned int gpio = MXS_GPIO_NR(PAD_BANK(tx28_fec_gpio_pads[i]),
86 PAD_PIN(tx28_fec_gpio_pads[i]));
87
88 ret = gpio_request(gpio, "FEC");
89 if (ret) {
90 pr_err("Failed to request GPIO_%d_%d: %d\n",
91 PAD_BANK(tx28_fec_gpio_pads[i]),
92 PAD_PIN(tx28_fec_gpio_pads[i]), ret);
93 goto free_gpios;
94 }
95 ret = gpio_direction_output(gpio, 0);
96 if (ret) {
97 pr_err("Failed to set direction of GPIO_%d_%d to output: %d\n",
98 gpio / 32 + 1, gpio % 32, ret);
99 goto free_gpios;
100 }
101 }
102
103 /* Power up fec phy */
104 pr_debug("%s: Switching FEC PHY power on\n", __func__);
105 ret = gpio_direction_output(TX28_FEC_PHY_POWER, 1);
106 if (ret) {
107 pr_err("Failed to power on PHY: %d\n", ret);
108 goto free_gpios;
109 }
110 mdelay(26); /* 25ms according to data sheet */
111
112 /* nINT */
113 gpio_direction_input(MXS_GPIO_NR(4, 5));
114 /* Mode strap pins */
115 gpio_direction_output(MXS_GPIO_NR(4, 2), 1);
116 gpio_direction_output(MXS_GPIO_NR(4, 3), 1);
117 gpio_direction_output(MXS_GPIO_NR(4, 4), 1);
118
119 udelay(100); /* minimum assertion time for nRST */
120
121 pr_debug("%s: Deasserting FEC PHY RESET\n", __func__);
122 gpio_set_value(TX28_FEC_PHY_RESET, 1);
123
124 ret = mxs_iomux_setup_multiple_pads(tx28_fec0_pads,
125 ARRAY_SIZE(tx28_fec0_pads));
126 if (ret) {
127 pr_debug("%s: mxs_iomux_setup_multiple_pads() failed with rc: %d\n",
128 __func__, ret);
129 goto free_gpios;
130 }
131 pr_debug("%s: Registering FEC0 device\n", __func__);
132 mx28_add_fec(0, &tx28_fec0_data);
133 return 0;
134
135free_gpios:
136 while (--i >= 0) {
137 unsigned int gpio = MXS_GPIO_NR(PAD_BANK(tx28_fec_gpio_pads[i]),
138 PAD_PIN(tx28_fec_gpio_pads[i]));
139
140 gpio_free(gpio);
141 }
142
143 return ret;
144}
145
146int __init tx28_add_fec1(void)
147{
148 int ret;
149
150 ret = mxs_iomux_setup_multiple_pads(tx28_fec1_pads,
151 ARRAY_SIZE(tx28_fec1_pads));
152 if (ret) {
153 pr_debug("%s: mxs_iomux_setup_multiple_pads() failed with rc: %d\n",
154 __func__, ret);
155 return ret;
156 }
157 pr_debug("%s: Registering FEC1 device\n", __func__);
158 mx28_add_fec(1, &tx28_fec1_data);
159 return 0;
160}
diff --git a/arch/arm/mach-mxs/module-tx28.h b/arch/arm/mach-mxs/module-tx28.h
deleted file mode 100644
index 8ed425457d3..00000000000
--- a/arch/arm/mach-mxs/module-tx28.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9int __init tx28_add_fec0(void);
10int __init tx28_add_fec1(void);
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c
index 02d36de9c4e..7c379261339 100644
--- a/arch/arm/mach-mxs/timer.c
+++ b/arch/arm/mach-mxs/timer.c
@@ -25,6 +25,8 @@
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/clockchips.h> 26#include <linux/clockchips.h>
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/of.h>
29#include <linux/of_irq.h>
28 30
29#include <asm/mach/time.h> 31#include <asm/mach/time.h>
30#include <mach/mxs.h> 32#include <mach/mxs.h>
@@ -244,9 +246,17 @@ static int __init mxs_clocksource_init(struct clk *timer_clk)
244 return 0; 246 return 0;
245} 247}
246 248
247void __init mxs_timer_init(int irq) 249void __init mxs_timer_init(void)
248{ 250{
251 struct device_node *np;
249 struct clk *timer_clk; 252 struct clk *timer_clk;
253 int irq;
254
255 np = of_find_compatible_node(NULL, NULL, "fsl,timrot");
256 if (!np) {
257 pr_err("%s: failed find timrot node\n", __func__);
258 return;
259 }
250 260
251 timer_clk = clk_get_sys("timrot", NULL); 261 timer_clk = clk_get_sys("timrot", NULL);
252 if (IS_ERR(timer_clk)) { 262 if (IS_ERR(timer_clk)) {
@@ -295,5 +305,6 @@ void __init mxs_timer_init(int irq)
295 mxs_clockevent_init(timer_clk); 305 mxs_clockevent_init(timer_clk);
296 306
297 /* Make irqs happen */ 307 /* Make irqs happen */
308 irq = irq_of_parse_and_map(np, 0);
298 setup_irq(irq, &mxs_timer_irq); 309 setup_irq(irq, &mxs_timer_irq);
299} 310}
diff --git a/arch/arm/mach-netx/include/mach/eth.h b/arch/arm/mach-netx/include/mach/eth.h
deleted file mode 100644
index 88af1ac28ea..00000000000
--- a/arch/arm/mach-netx/include/mach/eth.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * arch/arm/mach-netx/include/mach/eth.h
3 *
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef ASMARM_ARCH_ETH_H
21#define ASMARM_ARCH_ETH_H
22
23struct netxeth_platform_data {
24 unsigned int xcno; /* number of xmac/xpec engine this eth uses */
25};
26
27#endif
diff --git a/arch/arm/mach-netx/nxdb500.c b/arch/arm/mach-netx/nxdb500.c
index 180ea899a48..8b781ff7c9e 100644
--- a/arch/arm/mach-netx/nxdb500.c
+++ b/arch/arm/mach-netx/nxdb500.c
@@ -30,7 +30,7 @@
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/hardware/vic.h> 31#include <asm/hardware/vic.h>
32#include <mach/netx-regs.h> 32#include <mach/netx-regs.h>
33#include <mach/eth.h> 33#include <linux/platform_data/eth-netx.h>
34 34
35#include "generic.h" 35#include "generic.h"
36#include "fb.h" 36#include "fb.h"
diff --git a/arch/arm/mach-netx/nxdkn.c b/arch/arm/mach-netx/nxdkn.c
index 58009e29b20..b26dbce334f 100644
--- a/arch/arm/mach-netx/nxdkn.c
+++ b/arch/arm/mach-netx/nxdkn.c
@@ -30,7 +30,7 @@
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/hardware/vic.h> 31#include <asm/hardware/vic.h>
32#include <mach/netx-regs.h> 32#include <mach/netx-regs.h>
33#include <mach/eth.h> 33#include <linux/platform_data/eth-netx.h>
34 34
35#include "generic.h" 35#include "generic.h"
36 36
diff --git a/arch/arm/mach-netx/nxeb500hmi.c b/arch/arm/mach-netx/nxeb500hmi.c
index 122e99826ef..257382efafa 100644
--- a/arch/arm/mach-netx/nxeb500hmi.c
+++ b/arch/arm/mach-netx/nxeb500hmi.c
@@ -30,7 +30,7 @@
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/hardware/vic.h> 31#include <asm/hardware/vic.h>
32#include <mach/netx-regs.h> 32#include <mach/netx-regs.h>
33#include <mach/eth.h> 33#include <linux/platform_data/eth-netx.h>
34 34
35#include "generic.h" 35#include "generic.h"
36#include "fb.h" 36#include "fb.h"
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
index 365879b47c0..c744946ef02 100644
--- a/arch/arm/mach-nomadik/Kconfig
+++ b/arch/arm/mach-nomadik/Kconfig
@@ -4,8 +4,8 @@ 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 NOMADIK_8815
8 select HAS_MTU 7 select HAS_MTU
8 select NOMADIK_8815
9 9
10endmenu 10endmenu
11 11
@@ -16,7 +16,7 @@ config I2C_BITBANG_8815NHK
16 tristate "Driver for bit-bang busses found on the 8815 NHK" 16 tristate "Driver for bit-bang busses found on the 8815 NHK"
17 depends on I2C && MACH_NOMADIK_8815NHK 17 depends on I2C && MACH_NOMADIK_8815NHK
18 depends on PINCTRL_NOMADIK 18 depends on PINCTRL_NOMADIK
19 select I2C_ALGOBIT
20 default y 19 default y
20 select I2C_ALGOBIT
21 21
22endif 22endif
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
index f4535a7dadf..bfa1eab91f4 100644
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -23,6 +23,7 @@
23#include <linux/mtd/partitions.h> 23#include <linux/mtd/partitions.h>
24#include <linux/i2c.h> 24#include <linux/i2c.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/pinctrl/machine.h>
26#include <asm/hardware/vic.h> 27#include <asm/hardware/vic.h>
27#include <asm/sizes.h> 28#include <asm/sizes.h>
28#include <asm/mach-types.h> 29#include <asm/mach-types.h>
@@ -33,8 +34,9 @@
33 34
34#include <plat/gpio-nomadik.h> 35#include <plat/gpio-nomadik.h>
35#include <plat/mtu.h> 36#include <plat/mtu.h>
37#include <plat/pincfg.h>
36 38
37#include <mach/nand.h> 39#include <linux/platform_data/mtd-nomadik-nand.h>
38#include <mach/fsmc.h> 40#include <mach/fsmc.h>
39 41
40#include "cpu-8815.h" 42#include "cpu-8815.h"
@@ -112,8 +114,7 @@ static struct mtd_partition nhk8815_partitions[] = {
112static struct nomadik_nand_platform_data nhk8815_nand_data = { 114static struct nomadik_nand_platform_data nhk8815_nand_data = {
113 .parts = nhk8815_partitions, 115 .parts = nhk8815_partitions,
114 .nparts = ARRAY_SIZE(nhk8815_partitions), 116 .nparts = ARRAY_SIZE(nhk8815_partitions),
115 .options = NAND_COPYBACK | NAND_CACHEPRG | NAND_NO_PADDING \ 117 .options = NAND_COPYBACK | NAND_CACHEPRG | NAND_NO_PADDING,
116 | NAND_NO_READRDY,
117 .init = nhk8815_nand_init, 118 .init = nhk8815_nand_init,
118}; 119};
119 120
@@ -291,8 +292,42 @@ static struct i2c_board_info __initdata nhk8815_i2c2_devices[] = {
291 }, 292 },
292}; 293};
293 294
295static unsigned long out_low[] = { PIN_OUTPUT_LOW };
296static unsigned long out_high[] = { PIN_OUTPUT_HIGH };
297static unsigned long in_nopull[] = { PIN_INPUT_NOPULL };
298static unsigned long in_pullup[] = { PIN_INPUT_PULLUP };
299
300static struct pinctrl_map __initdata nhk8815_pinmap[] = {
301 PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"),
302 PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"),
303 /* Hog in MMC/SD card mux */
304 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"),
305 /* MCCLK */
306 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low),
307 /* MCCMD */
308 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup),
309 /* MCCMDDIR */
310 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high),
311 /* MCDAT3-0 */
312 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup),
313 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup),
314 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup),
315 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup),
316 /* MCDAT0DIR */
317 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high),
318 /* MCDAT31DIR */
319 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high),
320 /* MCMSFBCLK */
321 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup),
322 /* CD input GPIO */
323 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull),
324 /* CD bias drive */
325 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low),
326};
327
294static void __init nhk8815_platform_init(void) 328static void __init nhk8815_platform_init(void)
295{ 329{
330 pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
296 cpu8815_platform_init(); 331 cpu8815_platform_init();
297 nhk8815_onenand_init(); 332 nhk8815_onenand_init();
298 platform_add_devices(nhk8815_platform_devices, 333 platform_add_devices(nhk8815_platform_devices,
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index 6fd8e46567a..b617eaed0ce 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -83,6 +83,18 @@ void cpu8815_add_gpios(resource_size_t *base, int num, int irq,
83 } 83 }
84} 84}
85 85
86static inline void
87cpu8815_add_pinctrl(struct device *parent, const char *name)
88{
89 struct platform_device_info pdevinfo = {
90 .parent = parent,
91 .name = name,
92 .id = -1,
93 };
94
95 platform_device_register_full(&pdevinfo);
96}
97
86static int __init cpu8815_init(void) 98static int __init cpu8815_init(void)
87{ 99{
88 struct nmk_gpio_platform_data pdata = { 100 struct nmk_gpio_platform_data pdata = {
@@ -91,6 +103,7 @@ static int __init cpu8815_init(void)
91 103
92 cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base), 104 cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base),
93 IRQ_GPIO0, &pdata); 105 IRQ_GPIO0, &pdata);
106 cpu8815_add_pinctrl(NULL, "pinctrl-stn8815");
94 amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0); 107 amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0);
95 amba_apb_device_add(NULL, "rtc-pl031", NOMADIK_RTC_BASE, SZ_4K, IRQ_RTC_RTT, 0, NULL, 0); 108 amba_apb_device_add(NULL, "rtc-pl031", NOMADIK_RTC_BASE, SZ_4K, IRQ_RTC_RTT, 0, NULL, 0);
96 return 0; 109 return 0;
diff --git a/arch/arm/mach-nomadik/include/mach/gpio.h b/arch/arm/mach-nomadik/include/mach/gpio.h
deleted file mode 100644
index efdde0ae0a4..00000000000
--- a/arch/arm/mach-nomadik/include/mach/gpio.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef __ASM_ARCH_GPIO_H
2#define __ASM_ARCH_GPIO_H
3
4#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-nomadik/include/mach/hardware.h b/arch/arm/mach-nomadik/include/mach/hardware.h
index 6316dba3bfc..02035e459f5 100644
--- a/arch/arm/mach-nomadik/include/mach/hardware.h
+++ b/arch/arm/mach-nomadik/include/mach/hardware.h
@@ -30,7 +30,7 @@
30 - NOMADIK_IO_VIRTUAL + NOMADIK_IO_PHYSICAL) 30 - NOMADIK_IO_VIRTUAL + NOMADIK_IO_PHYSICAL)
31 31
32/* used in asm code, so no casts */ 32/* used in asm code, so no casts */
33#define IO_ADDRESS(x) ((x) - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL) 33#define IO_ADDRESS(x) IOMEM((x) - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL)
34 34
35/* 35/*
36 * Base address defination for Nomadik Onchip Logic Block 36 * Base address defination for Nomadik Onchip Logic Block
diff --git a/arch/arm/mach-nomadik/include/mach/nand.h b/arch/arm/mach-nomadik/include/mach/nand.h
deleted file mode 100644
index c3c8254c22a..00000000000
--- a/arch/arm/mach-nomadik/include/mach/nand.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#ifndef __ASM_ARCH_NAND_H
2#define __ASM_ARCH_NAND_H
3
4struct nomadik_nand_platform_data {
5 struct mtd_partition *parts;
6 int nparts;
7 int options;
8 int (*init) (void);
9 int (*exit) (void);
10};
11
12#define NAND_IO_DATA 0x40000000
13#define NAND_IO_CMD 0x40800000
14#define NAND_IO_ADDR 0x41000000
15
16#endif /* __ASM_ARCH_NAND_H */
diff --git a/arch/arm/mach-nomadik/include/mach/uncompress.h b/arch/arm/mach-nomadik/include/mach/uncompress.h
index 071003bc845..7d4687e9cbd 100644
--- a/arch/arm/mach-nomadik/include/mach/uncompress.h
+++ b/arch/arm/mach-nomadik/include/mach/uncompress.h
@@ -27,10 +27,10 @@
27struct amba_device; 27struct amba_device;
28#include <linux/amba/serial.h> 28#include <linux/amba/serial.h>
29 29
30#define NOMADIK_UART_DR 0x101FB000 30#define NOMADIK_UART_DR (void __iomem *)0x101FB000
31#define NOMADIK_UART_LCRH 0x101FB02c 31#define NOMADIK_UART_LCRH (void __iomem *)0x101FB02c
32#define NOMADIK_UART_CR 0x101FB030 32#define NOMADIK_UART_CR (void __iomem *)0x101FB030
33#define NOMADIK_UART_FR 0x101FB018 33#define NOMADIK_UART_FR (void __iomem *)0x101FB018
34 34
35static void putc(const char c) 35static void putc(const char c)
36{ 36{
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index cba3f7191cf..903da8eb886 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -8,15 +8,15 @@ comment "OMAP Core Type"
8config ARCH_OMAP730 8config ARCH_OMAP730
9 depends on ARCH_OMAP1 9 depends on ARCH_OMAP1
10 bool "OMAP730 Based System" 10 bool "OMAP730 Based System"
11 select ARCH_OMAP_OTG
11 select CPU_ARM926T 12 select CPU_ARM926T
12 select OMAP_MPU_TIMER 13 select OMAP_MPU_TIMER
13 select ARCH_OMAP_OTG
14 14
15config ARCH_OMAP850 15config ARCH_OMAP850
16 depends on ARCH_OMAP1 16 depends on ARCH_OMAP1
17 bool "OMAP850 Based System" 17 bool "OMAP850 Based System"
18 select CPU_ARM926T
19 select ARCH_OMAP_OTG 18 select ARCH_OMAP_OTG
19 select CPU_ARM926T
20 20
21config ARCH_OMAP15XX 21config ARCH_OMAP15XX
22 depends on ARCH_OMAP1 22 depends on ARCH_OMAP1
@@ -28,8 +28,8 @@ config ARCH_OMAP15XX
28config ARCH_OMAP16XX 28config ARCH_OMAP16XX
29 depends on ARCH_OMAP1 29 depends on ARCH_OMAP1
30 bool "OMAP16xx Based System" 30 bool "OMAP16xx Based System"
31 select CPU_ARM926T
32 select ARCH_OMAP_OTG 31 select ARCH_OMAP_OTG
32 select CPU_ARM926T
33 33
34comment "OMAP Board Type" 34comment "OMAP Board Type"
35 depends on ARCH_OMAP1 35 depends on ARCH_OMAP1
@@ -132,8 +132,8 @@ config MACH_OMAP_PALMTT
132 132
133config MACH_SX1 133config MACH_SX1
134 bool "Siemens SX1" 134 bool "Siemens SX1"
135 select I2C
136 depends on ARCH_OMAP1 && ARCH_OMAP15XX 135 depends on ARCH_OMAP1 && ARCH_OMAP15XX
136 select I2C
137 help 137 help
138 Support for the Siemens SX1 phone. To boot the kernel, 138 Support for the Siemens SX1 phone. To boot the kernel,
139 you'll need a SX1 compatible bootloader; check out 139 you'll need a SX1 compatible bootloader; check out
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 398e9e53e18..cd169c38616 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -61,14 +61,6 @@ obj-$(CONFIG_ARCH_OMAP850) += gpio7xx.o
61obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o 61obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o
62obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o 62obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o
63 63
64# LEDs support
65led-$(CONFIG_MACH_OMAP_H2) += leds-h2p2-debug.o
66led-$(CONFIG_MACH_OMAP_H3) += leds-h2p2-debug.o
67led-$(CONFIG_MACH_OMAP_INNOVATOR) += leds-innovator.o
68led-$(CONFIG_MACH_OMAP_PERSEUS2) += leds-h2p2-debug.o
69led-$(CONFIG_MACH_OMAP_OSK) += leds-osk.o
70obj-$(CONFIG_LEDS) += $(led-y)
71
72ifneq ($(CONFIG_FB_OMAP),) 64ifneq ($(CONFIG_FB_OMAP),)
73obj-y += lcd_dma.o 65obj-y += lcd_dma.o
74endif 66endif
diff --git a/arch/arm/mach-omap1/ams-delta-fiq-handler.S b/arch/arm/mach-omap1/ams-delta-fiq-handler.S
index a051cb8ae57..3d1e1c250a1 100644
--- a/arch/arm/mach-omap1/ams-delta-fiq-handler.S
+++ b/arch/arm/mach-omap1/ams-delta-fiq-handler.S
@@ -16,8 +16,9 @@
16#include <linux/linkage.h> 16#include <linux/linkage.h>
17#include <asm/assembler.h> 17#include <asm/assembler.h>
18 18
19#include <plat/board-ams-delta.h> 19#include <mach/board-ams-delta.h>
20 20
21#include <mach/irqs.h>
21#include <mach/ams-delta-fiq.h> 22#include <mach/ams-delta-fiq.h>
22 23
23#include "iomap.h" 24#include "iomap.h"
diff --git a/arch/arm/mach-omap1/ams-delta-fiq.c b/arch/arm/mach-omap1/ams-delta-fiq.c
index 68e8e5654c0..f12a12af352 100644
--- a/arch/arm/mach-omap1/ams-delta-fiq.c
+++ b/arch/arm/mach-omap1/ams-delta-fiq.c
@@ -19,7 +19,7 @@
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/io.h> 20#include <linux/io.h>
21 21
22#include <plat/board-ams-delta.h> 22#include <mach/board-ams-delta.h>
23 23
24#include <asm/fiq.h> 24#include <asm/fiq.h>
25 25
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index c53469802c0..9518bf5996d 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -26,6 +26,7 @@
26#include <linux/export.h> 26#include <linux/export.h>
27#include <linux/omapfb.h> 27#include <linux/omapfb.h>
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/platform_data/gpio-omap.h>
29 30
30#include <media/soc_camera.h> 31#include <media/soc_camera.h>
31 32
@@ -34,10 +35,9 @@
34#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
35#include <asm/mach/map.h> 36#include <asm/mach/map.h>
36 37
37#include <plat/board-ams-delta.h> 38#include <mach/board-ams-delta.h>
38#include <plat/keypad.h> 39#include <linux/platform_data/keypad-omap.h>
39#include <plat/mux.h> 40#include <mach/mux.h>
40#include <plat/board.h>
41 41
42#include <mach/hardware.h> 42#include <mach/hardware.h>
43#include <mach/ams-delta-fiq.h> 43#include <mach/ams-delta-fiq.h>
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 6872f3fd400..4b6de70c47a 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -28,11 +28,10 @@
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29 29
30#include <plat/tc.h> 30#include <plat/tc.h>
31#include <plat/mux.h> 31#include <mach/mux.h>
32#include <plat/flash.h> 32#include <mach/flash.h>
33#include <plat/fpga.h> 33#include <plat/fpga.h>
34#include <plat/keypad.h> 34#include <linux/platform_data/keypad-omap.h>
35#include <plat/board.h>
36 35
37#include <mach/hardware.h> 36#include <mach/hardware.h>
38 37
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index 6ec385e2b98..4ec579fdd36 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -22,8 +22,7 @@
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24 24
25#include <plat/mux.h> 25#include <mach/mux.h>
26#include <plat/board.h>
27 26
28#include <mach/usb.h> 27#include <mach/usb.h>
29 28
@@ -52,9 +51,6 @@ static struct omap_usb_config generic1610_usb_config __initdata = {
52}; 51};
53#endif 52#endif
54 53
55static struct omap_board_config_kernel generic_config[] __initdata = {
56};
57
58static void __init omap_generic_init(void) 54static void __init omap_generic_init(void)
59{ 55{
60#ifdef CONFIG_ARCH_OMAP15XX 56#ifdef CONFIG_ARCH_OMAP15XX
@@ -76,8 +72,6 @@ static void __init omap_generic_init(void)
76 } 72 }
77#endif 73#endif
78 74
79 omap_board_config = generic_config;
80 omap_board_config_size = ARRAY_SIZE(generic_config);
81 omap_serial_init(); 75 omap_serial_init();
82 omap_register_i2c_bus(1, 100, NULL, 0); 76 omap_register_i2c_bus(1, 100, NULL, 0);
83} 77}
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 44a4ab195fb..376f7f29ef7 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -31,17 +31,19 @@
31#include <linux/i2c/tps65010.h> 31#include <linux/i2c/tps65010.h>
32#include <linux/smc91x.h> 32#include <linux/smc91x.h>
33#include <linux/omapfb.h> 33#include <linux/omapfb.h>
34#include <linux/platform_data/gpio-omap.h>
35#include <linux/leds.h>
34 36
35#include <asm/mach-types.h> 37#include <asm/mach-types.h>
36#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
37#include <asm/mach/map.h> 39#include <asm/mach/map.h>
38 40
39#include <plat/mux.h> 41#include <mach/mux.h>
40#include <plat/dma.h> 42#include <plat/dma.h>
41#include <plat/tc.h> 43#include <plat/tc.h>
42#include <plat/irda.h> 44#include <mach/irda.h>
43#include <plat/keypad.h> 45#include <linux/platform_data/keypad-omap.h>
44#include <plat/flash.h> 46#include <mach/flash.h>
45 47
46#include <mach/hardware.h> 48#include <mach/hardware.h>
47#include <mach/usb.h> 49#include <mach/usb.h>
@@ -306,12 +308,39 @@ static struct platform_device h2_irda_device = {
306 .resource = h2_irda_resources, 308 .resource = h2_irda_resources,
307}; 309};
308 310
311static struct gpio_led h2_gpio_led_pins[] = {
312 {
313 .name = "h2:red",
314 .default_trigger = "heartbeat",
315 .gpio = 3,
316 },
317 {
318 .name = "h2:green",
319 .default_trigger = "cpu0",
320 .gpio = OMAP_MPUIO(4),
321 },
322};
323
324static struct gpio_led_platform_data h2_gpio_led_data = {
325 .leds = h2_gpio_led_pins,
326 .num_leds = ARRAY_SIZE(h2_gpio_led_pins),
327};
328
329static struct platform_device h2_gpio_leds = {
330 .name = "leds-gpio",
331 .id = -1,
332 .dev = {
333 .platform_data = &h2_gpio_led_data,
334 },
335};
336
309static struct platform_device *h2_devices[] __initdata = { 337static struct platform_device *h2_devices[] __initdata = {
310 &h2_nor_device, 338 &h2_nor_device,
311 &h2_nand_device, 339 &h2_nand_device,
312 &h2_smc91x_device, 340 &h2_smc91x_device,
313 &h2_irda_device, 341 &h2_irda_device,
314 &h2_kp_device, 342 &h2_kp_device,
343 &h2_gpio_leds,
315}; 344};
316 345
317static void __init h2_init_smc91x(void) 346static void __init h2_init_smc91x(void)
@@ -406,6 +435,10 @@ static void __init h2_init(void)
406 omap_cfg_reg(E19_1610_KBR4); 435 omap_cfg_reg(E19_1610_KBR4);
407 omap_cfg_reg(N19_1610_KBR5); 436 omap_cfg_reg(N19_1610_KBR5);
408 437
438 /* GPIO based LEDs */
439 omap_cfg_reg(P18_1610_GPIO3);
440 omap_cfg_reg(MPUIO4);
441
409 h2_smc91x_resources[1].start = gpio_to_irq(0); 442 h2_smc91x_resources[1].start = gpio_to_irq(0);
410 h2_smc91x_resources[1].end = gpio_to_irq(0); 443 h2_smc91x_resources[1].end = gpio_to_irq(0);
411 platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); 444 platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 86cb5a04a40..ededdb7ef28 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -31,6 +31,8 @@
31#include <linux/i2c/tps65010.h> 31#include <linux/i2c/tps65010.h>
32#include <linux/smc91x.h> 32#include <linux/smc91x.h>
33#include <linux/omapfb.h> 33#include <linux/omapfb.h>
34#include <linux/platform_data/gpio-omap.h>
35#include <linux/leds.h>
34 36
35#include <asm/setup.h> 37#include <asm/setup.h>
36#include <asm/page.h> 38#include <asm/page.h>
@@ -38,11 +40,11 @@
38#include <asm/mach/arch.h> 40#include <asm/mach/arch.h>
39#include <asm/mach/map.h> 41#include <asm/mach/map.h>
40 42
41#include <plat/mux.h> 43#include <mach/mux.h>
42#include <plat/tc.h> 44#include <plat/tc.h>
43#include <plat/keypad.h> 45#include <linux/platform_data/keypad-omap.h>
44#include <plat/dma.h> 46#include <plat/dma.h>
45#include <plat/flash.h> 47#include <mach/flash.h>
46 48
47#include <mach/hardware.h> 49#include <mach/hardware.h>
48#include <mach/irqs.h> 50#include <mach/irqs.h>
@@ -324,6 +326,32 @@ static struct spi_board_info h3_spi_board_info[] __initdata = {
324 }, 326 },
325}; 327};
326 328
329static struct gpio_led h3_gpio_led_pins[] = {
330 {
331 .name = "h3:red",
332 .default_trigger = "heartbeat",
333 .gpio = 3,
334 },
335 {
336 .name = "h3:green",
337 .default_trigger = "cpu0",
338 .gpio = OMAP_MPUIO(4),
339 },
340};
341
342static struct gpio_led_platform_data h3_gpio_led_data = {
343 .leds = h3_gpio_led_pins,
344 .num_leds = ARRAY_SIZE(h3_gpio_led_pins),
345};
346
347static struct platform_device h3_gpio_leds = {
348 .name = "leds-gpio",
349 .id = -1,
350 .dev = {
351 .platform_data = &h3_gpio_led_data,
352 },
353};
354
327static struct platform_device *devices[] __initdata = { 355static struct platform_device *devices[] __initdata = {
328 &nor_device, 356 &nor_device,
329 &nand_device, 357 &nand_device,
@@ -331,6 +359,7 @@ static struct platform_device *devices[] __initdata = {
331 &intlat_device, 359 &intlat_device,
332 &h3_kp_device, 360 &h3_kp_device,
333 &h3_lcd_device, 361 &h3_lcd_device,
362 &h3_gpio_leds,
334}; 363};
335 364
336static struct omap_usb_config h3_usb_config __initdata = { 365static struct omap_usb_config h3_usb_config __initdata = {
@@ -398,6 +427,10 @@ static void __init h3_init(void)
398 omap_cfg_reg(E19_1610_KBR4); 427 omap_cfg_reg(E19_1610_KBR4);
399 omap_cfg_reg(N19_1610_KBR5); 428 omap_cfg_reg(N19_1610_KBR5);
400 429
430 /* GPIO based LEDs */
431 omap_cfg_reg(P18_1610_GPIO3);
432 omap_cfg_reg(MPUIO4);
433
401 smc91x_resources[1].start = gpio_to_irq(40); 434 smc91x_resources[1].start = gpio_to_irq(40);
402 smc91x_resources[1].end = gpio_to_irq(40); 435 smc91x_resources[1].end = gpio_to_irq(40);
403 platform_add_devices(devices, ARRAY_SIZE(devices)); 436 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index b3f6e943e66..87ab2086ef9 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -37,13 +37,12 @@
37#include <linux/spi/spi.h> 37#include <linux/spi/spi.h>
38#include <linux/spi/ads7846.h> 38#include <linux/spi/ads7846.h>
39#include <linux/omapfb.h> 39#include <linux/omapfb.h>
40#include <linux/platform_data/keypad-omap.h>
40 41
41#include <asm/mach-types.h> 42#include <asm/mach-types.h>
42#include <asm/mach/arch.h> 43#include <asm/mach/arch.h>
43 44
44#include <plat/omap7xx.h> 45#include <mach/omap7xx.h>
45#include <plat/board.h>
46#include <plat/keypad.h>
47#include <plat/mmc.h> 46#include <plat/mmc.h>
48 47
49#include <mach/irqs.h> 48#include <mach/irqs.h>
@@ -476,8 +475,7 @@ static void __init htcherald_lcd_init(void)
476 break; 475 break;
477 } 476 }
478 if (!tries) 477 if (!tries)
479 printk(KERN_WARNING "Timeout waiting for end of frame " 478 pr_err("Timeout waiting for end of frame -- LCD may not be available\n");
480 "-- LCD may not be available\n");
481 479
482 /* turn off DMA */ 480 /* turn off DMA */
483 reg = omap_readw(OMAP_DMA_LCD_CCR); 481 reg = omap_readw(OMAP_DMA_LCD_CCR);
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index f21c2966daa..db5f7d2976e 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -31,11 +31,11 @@
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32#include <asm/mach/map.h> 32#include <asm/mach/map.h>
33 33
34#include <plat/mux.h> 34#include <mach/mux.h>
35#include <plat/flash.h> 35#include <mach/flash.h>
36#include <plat/fpga.h> 36#include <plat/fpga.h>
37#include <plat/tc.h> 37#include <plat/tc.h>
38#include <plat/keypad.h> 38#include <linux/platform_data/keypad-omap.h>
39#include <plat/mmc.h> 39#include <plat/mmc.h>
40 40
41#include <mach/hardware.h> 41#include <mach/hardware.h>
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 2c0ca8fc338..7d5c06d6a52 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -21,14 +21,14 @@
21#include <linux/workqueue.h> 21#include <linux/workqueue.h>
22#include <linux/delay.h> 22#include <linux/delay.h>
23 23
24#include <linux/platform_data/keypad-omap.h>
25#include <linux/platform_data/lcd-mipid.h>
26
24#include <asm/mach-types.h> 27#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 29#include <asm/mach/map.h>
27 30
28#include <plat/mux.h> 31#include <mach/mux.h>
29#include <plat/board.h>
30#include <plat/keypad.h>
31#include <plat/lcd_mipid.h>
32#include <plat/mmc.h> 32#include <plat/mmc.h>
33#include <plat/clock.h> 33#include <plat/clock.h>
34 34
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 8784705edb6..5973945a874 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -39,13 +39,15 @@
39#include <linux/mtd/partitions.h> 39#include <linux/mtd/partitions.h>
40#include <linux/mtd/physmap.h> 40#include <linux/mtd/physmap.h>
41#include <linux/i2c/tps65010.h> 41#include <linux/i2c/tps65010.h>
42#include <linux/platform_data/gpio-omap.h>
43#include <linux/platform_data/omap1_bl.h>
42 44
43#include <asm/mach-types.h> 45#include <asm/mach-types.h>
44#include <asm/mach/arch.h> 46#include <asm/mach/arch.h>
45#include <asm/mach/map.h> 47#include <asm/mach/map.h>
46 48
47#include <plat/flash.h> 49#include <mach/flash.h>
48#include <plat/mux.h> 50#include <mach/mux.h>
49#include <plat/tc.h> 51#include <plat/tc.h>
50 52
51#include <mach/hardware.h> 53#include <mach/hardware.h>
@@ -302,7 +304,7 @@ static struct omap_lcd_config osk_lcd_config __initdata = {
302#include <linux/spi/spi.h> 304#include <linux/spi/spi.h>
303#include <linux/spi/ads7846.h> 305#include <linux/spi/ads7846.h>
304 306
305#include <plat/keypad.h> 307#include <linux/platform_data/keypad-omap.h>
306 308
307static struct at24_platform_data at24c04 = { 309static struct at24_platform_data at24c04 = {
308 .byte_len = SZ_4K / 8, 310 .byte_len = SZ_4K / 8,
@@ -380,10 +382,37 @@ static struct platform_device osk5912_lcd_device = {
380 .id = -1, 382 .id = -1,
381}; 383};
382 384
385static struct gpio_led mistral_gpio_led_pins[] = {
386 {
387 .name = "mistral:red",
388 .default_trigger = "heartbeat",
389 .gpio = 3,
390 },
391 {
392 .name = "mistral:green",
393 .default_trigger = "cpu0",
394 .gpio = OMAP_MPUIO(4),
395 },
396};
397
398static struct gpio_led_platform_data mistral_gpio_led_data = {
399 .leds = mistral_gpio_led_pins,
400 .num_leds = ARRAY_SIZE(mistral_gpio_led_pins),
401};
402
403static struct platform_device mistral_gpio_leds = {
404 .name = "leds-gpio",
405 .id = -1,
406 .dev = {
407 .platform_data = &mistral_gpio_led_data,
408 },
409};
410
383static struct platform_device *mistral_devices[] __initdata = { 411static struct platform_device *mistral_devices[] __initdata = {
384 &osk5912_kp_device, 412 &osk5912_kp_device,
385 &mistral_bl_device, 413 &mistral_bl_device,
386 &osk5912_lcd_device, 414 &osk5912_lcd_device,
415 &mistral_gpio_leds,
387}; 416};
388 417
389static int mistral_get_pendown_state(void) 418static int mistral_get_pendown_state(void)
@@ -508,6 +537,12 @@ static void __init osk_mistral_init(void)
508 if (gpio_request(2, "lcd_pwr") == 0) 537 if (gpio_request(2, "lcd_pwr") == 0)
509 gpio_direction_output(2, 1); 538 gpio_direction_output(2, 1);
510 539
540 /*
541 * GPIO based LEDs
542 */
543 omap_cfg_reg(P18_1610_GPIO3);
544 omap_cfg_reg(MPUIO4);
545
511 i2c_register_board_info(1, mistral_i2c_board_info, 546 i2c_register_board_info(1, mistral_i2c_board_info,
512 ARRAY_SIZE(mistral_i2c_board_info)); 547 ARRAY_SIZE(mistral_i2c_board_info));
513 548
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 26bcb9defcd..1c578d58923 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -28,18 +28,18 @@
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/apm-emulation.h> 29#include <linux/apm-emulation.h>
30#include <linux/omapfb.h> 30#include <linux/omapfb.h>
31#include <linux/platform_data/omap1_bl.h>
31 32
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 35#include <asm/mach/map.h>
35 36
36#include <plat/flash.h> 37#include <mach/flash.h>
37#include <plat/mux.h> 38#include <mach/mux.h>
38#include <plat/tc.h> 39#include <plat/tc.h>
39#include <plat/dma.h> 40#include <plat/dma.h>
40#include <plat/board.h> 41#include <mach/irda.h>
41#include <plat/irda.h> 42#include <linux/platform_data/keypad-omap.h>
42#include <plat/keypad.h>
43 43
44#include <mach/hardware.h> 44#include <mach/hardware.h>
45#include <mach/usb.h> 45#include <mach/usb.h>
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index 4d099446dfa..97158095083 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -27,19 +27,19 @@
27#include <linux/omapfb.h> 27#include <linux/omapfb.h>
28#include <linux/spi/spi.h> 28#include <linux/spi/spi.h>
29#include <linux/spi/ads7846.h> 29#include <linux/spi/ads7846.h>
30#include <linux/platform_data/omap1_bl.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>
33#include <asm/mach/map.h> 34#include <asm/mach/map.h>
34 35
35#include <plat/led.h> 36#include <plat/led.h>
36#include <plat/flash.h> 37#include <mach/flash.h>
37#include <plat/mux.h> 38#include <mach/mux.h>
38#include <plat/dma.h> 39#include <plat/dma.h>
39#include <plat/tc.h> 40#include <plat/tc.h>
40#include <plat/board.h> 41#include <mach/irda.h>
41#include <plat/irda.h> 42#include <linux/platform_data/keypad-omap.h>
42#include <plat/keypad.h>
43 43
44#include <mach/hardware.h> 44#include <mach/hardware.h>
45#include <mach/usb.h> 45#include <mach/usb.h>
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index 355980321c2..e311032e7ee 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -30,18 +30,18 @@
30#include <linux/omapfb.h> 30#include <linux/omapfb.h>
31#include <linux/spi/spi.h> 31#include <linux/spi/spi.h>
32#include <linux/spi/ads7846.h> 32#include <linux/spi/ads7846.h>
33#include <linux/platform_data/omap1_bl.h>
33 34
34#include <asm/mach-types.h> 35#include <asm/mach-types.h>
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 38
38#include <plat/flash.h> 39#include <mach/flash.h>
39#include <plat/mux.h> 40#include <mach/mux.h>
40#include <plat/dma.h> 41#include <plat/dma.h>
41#include <plat/tc.h> 42#include <plat/tc.h>
42#include <plat/board.h> 43#include <mach/irda.h>
43#include <plat/irda.h> 44#include <linux/platform_data/keypad-omap.h>
44#include <plat/keypad.h>
45 45
46#include <mach/hardware.h> 46#include <mach/hardware.h>
47#include <mach/usb.h> 47#include <mach/usb.h>
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 703d55ecffe..198b05417bf 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -22,17 +22,16 @@
22#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/smc91x.h> 23#include <linux/smc91x.h>
24#include <linux/omapfb.h> 24#include <linux/omapfb.h>
25#include <linux/platform_data/keypad-omap.h>
25 26
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
28#include <asm/mach/map.h> 29#include <asm/mach/map.h>
29 30
30#include <plat/tc.h> 31#include <plat/tc.h>
31#include <plat/mux.h> 32#include <mach/mux.h>
32#include <plat/fpga.h> 33#include <plat/fpga.h>
33#include <plat/flash.h> 34#include <mach/flash.h>
34#include <plat/keypad.h>
35#include <plat/board.h>
36 35
37#include <mach/hardware.h> 36#include <mach/hardware.h>
38 37
diff --git a/arch/arm/mach-omap1/board-sx1-mmc.c b/arch/arm/mach-omap1/board-sx1-mmc.c
index b59f78850e6..5932d56e17b 100644
--- a/arch/arm/mach-omap1/board-sx1-mmc.c
+++ b/arch/arm/mach-omap1/board-sx1-mmc.c
@@ -17,7 +17,7 @@
17 17
18#include <mach/hardware.h> 18#include <mach/hardware.h>
19#include <plat/mmc.h> 19#include <plat/mmc.h>
20#include <plat/board-sx1.h> 20#include <mach/board-sx1.h>
21 21
22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
23 23
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 8c665bd16ac..13bf2cc5681 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -28,19 +28,18 @@
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/export.h> 29#include <linux/export.h>
30#include <linux/omapfb.h> 30#include <linux/omapfb.h>
31#include <linux/platform_data/keypad-omap.h>
31 32
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 35#include <asm/mach/map.h>
35 36
36#include <plat/flash.h> 37#include <mach/flash.h>
37#include <plat/mux.h> 38#include <mach/mux.h>
38#include <plat/dma.h> 39#include <plat/dma.h>
39#include <plat/irda.h> 40#include <mach/irda.h>
40#include <plat/tc.h> 41#include <plat/tc.h>
41#include <plat/board.h> 42#include <mach/board-sx1.h>
42#include <plat/keypad.h>
43#include <plat/board-sx1.h>
44 43
45#include <mach/hardware.h> 44#include <mach/hardware.h>
46#include <mach/usb.h> 45#include <mach/usb.h>
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index 3497769eb35..ad75e3411d4 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -31,11 +31,10 @@
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32#include <asm/mach/map.h> 32#include <asm/mach/map.h>
33 33
34#include <plat/board-voiceblue.h> 34#include <mach/board-voiceblue.h>
35#include <plat/flash.h> 35#include <mach/flash.h>
36#include <plat/mux.h> 36#include <mach/mux.h>
37#include <plat/tc.h> 37#include <plat/tc.h>
38#include <plat/board.h>
39 38
40#include <mach/hardware.h> 39#include <mach/hardware.h>
41#include <mach/usb.h> 40#include <mach/usb.h>
@@ -155,9 +154,6 @@ static struct omap_usb_config voiceblue_usb_config __initdata = {
155 .pins[2] = 6, 154 .pins[2] = 6,
156}; 155};
157 156
158static struct omap_board_config_kernel voiceblue_config[] = {
159};
160
161#define MACHINE_PANICED 1 157#define MACHINE_PANICED 1
162#define MACHINE_REBOOTING 2 158#define MACHINE_REBOOTING 2
163#define MACHINE_REBOOT 4 159#define MACHINE_REBOOT 4
@@ -275,8 +271,6 @@ static void __init voiceblue_init(void)
275 voiceblue_smc91x_resources[1].start = gpio_to_irq(8); 271 voiceblue_smc91x_resources[1].start = gpio_to_irq(8);
276 voiceblue_smc91x_resources[1].end = gpio_to_irq(8); 272 voiceblue_smc91x_resources[1].end = gpio_to_irq(8);
277 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); 273 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
278 omap_board_config = voiceblue_config;
279 omap_board_config_size = ARRAY_SIZE(voiceblue_config);
280 omap_serial_init(); 274 omap_serial_init();
281 omap1_usb_init(&voiceblue_usb_config); 275 omap1_usb_init(&voiceblue_usb_config);
282 omap_register_i2c_bus(1, 100, NULL, 0); 276 omap_register_i2c_bus(1, 100, NULL, 0);
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index a9ee06b6cb4..638f4070fc7 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -587,8 +587,8 @@ void omap1_clk_disable_unused(struct clk *clk)
587 /* Clocks in the DSP domain need api_ck. Just assume bootloader 587 /* Clocks in the DSP domain need api_ck. Just assume bootloader
588 * has not enabled any DSP clocks */ 588 * has not enabled any DSP clocks */
589 if (clk->enable_reg == DSP_IDLECT2) { 589 if (clk->enable_reg == DSP_IDLECT2) {
590 printk(KERN_INFO "Skipping reset check for DSP domain " 590 pr_info("Skipping reset check for DSP domain clock \"%s\"\n",
591 "clock \"%s\"\n", clk->name); 591 clk->name);
592 return; 592 return;
593 } 593 }
594 594
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
index c007d80dfb6..9b45f4b0ee2 100644
--- a/arch/arm/mach-omap1/clock_data.c
+++ b/arch/arm/mach-omap1/clock_data.c
@@ -25,7 +25,6 @@
25#include <plat/clock.h> 25#include <plat/clock.h>
26#include <plat/cpu.h> 26#include <plat/cpu.h>
27#include <plat/clkdev_omap.h> 27#include <plat/clkdev_omap.h>
28#include <plat/board.h>
29#include <plat/sram.h> /* for omap_sram_reprogram_clock() */ 28#include <plat/sram.h> /* for omap_sram_reprogram_clock() */
30 29
31#include <mach/hardware.h> 30#include <mach/hardware.h>
@@ -776,11 +775,10 @@ static struct clk_functions omap1_clk_functions = {
776 775
777static void __init omap1_show_rates(void) 776static void __init omap1_show_rates(void)
778{ 777{
779 pr_notice("Clocking rate (xtal/DPLL1/MPU): " 778 pr_notice("Clocking rate (xtal/DPLL1/MPU): %ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n",
780 "%ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n", 779 ck_ref.rate / 1000000, (ck_ref.rate / 100000) % 10,
781 ck_ref.rate / 1000000, (ck_ref.rate / 100000) % 10, 780 ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10,
782 ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10, 781 arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
783 arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
784} 782}
785 783
786u32 cpu_mask; 784u32 cpu_mask;
@@ -788,7 +786,6 @@ u32 cpu_mask;
788int __init omap1_clk_init(void) 786int __init omap1_clk_init(void)
789{ 787{
790 struct omap_clk *c; 788 struct omap_clk *c;
791 const struct omap_clock_config *info;
792 int crystal_type = 0; /* Default 12 MHz */ 789 int crystal_type = 0; /* Default 12 MHz */
793 u32 reg; 790 u32 reg;
794 791
@@ -837,19 +834,13 @@ int __init omap1_clk_init(void)
837 ck_dpll1_p = clk_get(NULL, "ck_dpll1"); 834 ck_dpll1_p = clk_get(NULL, "ck_dpll1");
838 ck_ref_p = clk_get(NULL, "ck_ref"); 835 ck_ref_p = clk_get(NULL, "ck_ref");
839 836
840 info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config);
841 if (info != NULL) {
842 if (!cpu_is_omap15xx())
843 crystal_type = info->system_clock_type;
844 }
845
846 if (cpu_is_omap7xx()) 837 if (cpu_is_omap7xx())
847 ck_ref.rate = 13000000; 838 ck_ref.rate = 13000000;
848 if (cpu_is_omap16xx() && crystal_type == 2) 839 if (cpu_is_omap16xx() && crystal_type == 2)
849 ck_ref.rate = 19200000; 840 ck_ref.rate = 19200000;
850 841
851 pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: " 842 pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: 0x%04x\n",
852 "0x%04x\n", omap_readw(ARM_SYSST), omap_readw(DPLL_CTL), 843 omap_readw(ARM_SYSST), omap_readw(DPLL_CTL),
853 omap_readw(ARM_CKCTL)); 844 omap_readw(ARM_CKCTL));
854 845
855 /* We want to be in syncronous scalable mode */ 846 /* We want to be in syncronous scalable mode */
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index fa1fa4deb6a..d3fec92c54c 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -20,12 +20,11 @@
20#include <asm/mach/map.h> 20#include <asm/mach/map.h>
21 21
22#include <plat/tc.h> 22#include <plat/tc.h>
23#include <plat/board.h> 23#include <mach/mux.h>
24#include <plat/mux.h>
25#include <plat/dma.h> 24#include <plat/dma.h>
26#include <plat/mmc.h> 25#include <plat/mmc.h>
27#include <plat/omap7xx.h>
28 26
27#include <mach/omap7xx.h>
29#include <mach/camera.h> 28#include <mach/camera.h>
30#include <mach/hardware.h> 29#include <mach/hardware.h>
31 30
@@ -232,7 +231,7 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
232 231
233 omap_mmc_add("mmci-omap", i, base, size, irq, 232 omap_mmc_add("mmci-omap", i, base, size, irq,
234 rx_req, tx_req, mmc_data[i]); 233 rx_req, tx_req, mmc_data[i]);
235 }; 234 }
236} 235}
237 236
238#endif 237#endif
@@ -358,6 +357,33 @@ static inline void omap_init_uwire(void) {}
358#endif 357#endif
359 358
360 359
360#define OMAP1_RNG_BASE 0xfffe5000
361
362static struct resource omap1_rng_resources[] = {
363 {
364 .start = OMAP1_RNG_BASE,
365 .end = OMAP1_RNG_BASE + 0x4f,
366 .flags = IORESOURCE_MEM,
367 },
368};
369
370static struct platform_device omap1_rng_device = {
371 .name = "omap_rng",
372 .id = -1,
373 .num_resources = ARRAY_SIZE(omap1_rng_resources),
374 .resource = omap1_rng_resources,
375};
376
377static void omap1_init_rng(void)
378{
379 if (!cpu_is_omap16xx())
380 return;
381
382 (void) platform_device_register(&omap1_rng_device);
383}
384
385/*-------------------------------------------------------------------------*/
386
361/* 387/*
362 * This gets called after board-specific INIT_MACHINE, and initializes most 388 * This gets called after board-specific INIT_MACHINE, and initializes most
363 * on-chip peripherals accessible on this board (except for few like USB): 389 * on-chip peripherals accessible on this board (except for few like USB):
@@ -396,6 +422,7 @@ static int __init omap1_init_devices(void)
396 omap_init_spi100k(); 422 omap_init_spi100k();
397 omap_init_sti(); 423 omap_init_sti();
398 omap_init_uwire(); 424 omap_init_uwire();
425 omap1_init_rng();
399 426
400 return 0; 427 return 0;
401} 428}
diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c
index 3ef7d52316b..29007fef84c 100644
--- a/arch/arm/mach-omap1/dma.c
+++ b/arch/arm/mach-omap1/dma.c
@@ -27,7 +27,8 @@
27 27
28#include <plat/dma.h> 28#include <plat/dma.h>
29#include <plat/tc.h> 29#include <plat/tc.h>
30#include <plat/irqs.h> 30
31#include <mach/irqs.h>
31 32
32#define OMAP1_DMA_BASE (0xfffed800) 33#define OMAP1_DMA_BASE (0xfffed800)
33#define OMAP1_LOGICAL_DMA_CH_COUNT 17 34#define OMAP1_LOGICAL_DMA_CH_COUNT 17
@@ -330,8 +331,9 @@ static int __init omap1_system_dma_init(void)
330 d->chan = kzalloc(sizeof(struct omap_dma_lch) * 331 d->chan = kzalloc(sizeof(struct omap_dma_lch) *
331 (d->lch_count), GFP_KERNEL); 332 (d->lch_count), GFP_KERNEL);
332 if (!d->chan) { 333 if (!d->chan) {
333 dev_err(&pdev->dev, "%s: Memory allocation failed" 334 dev_err(&pdev->dev,
334 "for d->chan!!!\n", __func__); 335 "%s: Memory allocation failed for d->chan!\n",
336 __func__);
335 goto exit_release_d; 337 goto exit_release_d;
336 } 338 }
337 339
diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c
index 401eb3c080c..73ae6169aa4 100644
--- a/arch/arm/mach-omap1/flash.c
+++ b/arch/arm/mach-omap1/flash.c
@@ -11,7 +11,7 @@
11#include <linux/mtd/map.h> 11#include <linux/mtd/map.h>
12 12
13#include <plat/tc.h> 13#include <plat/tc.h>
14#include <plat/flash.h> 14#include <mach/flash.h>
15 15
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17 17
diff --git a/arch/arm/mach-omap1/gpio15xx.c b/arch/arm/mach-omap1/gpio15xx.c
index ebef15e5e7b..98e6f39224a 100644
--- a/arch/arm/mach-omap1/gpio15xx.c
+++ b/arch/arm/mach-omap1/gpio15xx.c
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/platform_data/gpio-omap.h>
20 21
21#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE 22#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE
22#define OMAP1510_GPIO_BASE 0xFFFCE000 23#define OMAP1510_GPIO_BASE 0xFFFCE000
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index 2a48cd2e175..33f419236b1 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/platform_data/gpio-omap.h>
20 21
21#define OMAP1610_GPIO1_BASE 0xfffbe400 22#define OMAP1610_GPIO1_BASE 0xfffbe400
22#define OMAP1610_GPIO2_BASE 0xfffbec00 23#define OMAP1610_GPIO2_BASE 0xfffbec00
diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c
index acf12b73eac..958ce9acee9 100644
--- a/arch/arm/mach-omap1/gpio7xx.c
+++ b/arch/arm/mach-omap1/gpio7xx.c
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/platform_data/gpio-omap.h>
20 21
21#define OMAP7XX_GPIO1_BASE 0xfffbc000 22#define OMAP7XX_GPIO1_BASE 0xfffbc000
22#define OMAP7XX_GPIO2_BASE 0xfffbc800 23#define OMAP7XX_GPIO2_BASE 0xfffbc800
diff --git a/arch/arm/mach-omap1/i2c.c b/arch/arm/mach-omap1/i2c.c
index 5446c991264..a0551a6d745 100644
--- a/arch/arm/mach-omap1/i2c.c
+++ b/arch/arm/mach-omap1/i2c.c
@@ -20,7 +20,7 @@
20 */ 20 */
21 21
22#include <plat/i2c.h> 22#include <plat/i2c.h>
23#include <plat/mux.h> 23#include <mach/mux.h>
24#include <plat/cpu.h> 24#include <plat/cpu.h>
25 25
26void __init omap1_i2c_mux_pins(int bus_id) 26void __init omap1_i2c_mux_pins(int bus_id)
diff --git a/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h b/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h
index 23eed0035ed..adb5e764965 100644
--- a/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h
+++ b/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h
@@ -14,8 +14,6 @@
14#ifndef __AMS_DELTA_FIQ_H 14#ifndef __AMS_DELTA_FIQ_H
15#define __AMS_DELTA_FIQ_H 15#define __AMS_DELTA_FIQ_H
16 16
17#include <plat/irqs.h>
18
19/* 17/*
20 * Interrupt number used for passing control from FIQ to IRQ. 18 * Interrupt number used for passing control from FIQ to IRQ.
21 * IRQ12, described as reserved, has been selected. 19 * IRQ12, described as reserved, has been selected.
diff --git a/arch/arm/plat-omap/include/plat/board-ams-delta.h b/arch/arm/mach-omap1/include/mach/board-ams-delta.h
index ad6f865d1f1..ad6f865d1f1 100644
--- a/arch/arm/plat-omap/include/plat/board-ams-delta.h
+++ b/arch/arm/mach-omap1/include/mach/board-ams-delta.h
diff --git a/arch/arm/plat-omap/include/plat/board-sx1.h b/arch/arm/mach-omap1/include/mach/board-sx1.h
index 355adbdaae3..355adbdaae3 100644
--- a/arch/arm/plat-omap/include/plat/board-sx1.h
+++ b/arch/arm/mach-omap1/include/mach/board-sx1.h
diff --git a/arch/arm/plat-omap/include/plat/board-voiceblue.h b/arch/arm/mach-omap1/include/mach/board-voiceblue.h
index 27916b210f5..27916b210f5 100644
--- a/arch/arm/plat-omap/include/plat/board-voiceblue.h
+++ b/arch/arm/mach-omap1/include/mach/board-voiceblue.h
diff --git a/arch/arm/plat-omap/include/plat/flash.h b/arch/arm/mach-omap1/include/mach/flash.h
index 0d88499b79e..0d88499b79e 100644
--- a/arch/arm/plat-omap/include/plat/flash.h
+++ b/arch/arm/mach-omap1/include/mach/flash.h
diff --git a/arch/arm/mach-omap1/include/mach/gpio.h b/arch/arm/mach-omap1/include/mach/gpio.h
index e737706a8fe..ebf86c0f4f4 100644
--- a/arch/arm/mach-omap1/include/mach/gpio.h
+++ b/arch/arm/mach-omap1/include/mach/gpio.h
@@ -1,5 +1,3 @@
1/* 1/*
2 * arch/arm/mach-omap1/include/mach/gpio.h 2 * arch/arm/mach-omap1/include/mach/gpio.h
3 */ 3 */
4
5#include <plat/gpio.h>
diff --git a/arch/arm/mach-omap1/include/mach/hardware.h b/arch/arm/mach-omap1/include/mach/hardware.h
index 01e35fa106b..84248d250ad 100644
--- a/arch/arm/mach-omap1/include/mach/hardware.h
+++ b/arch/arm/mach-omap1/include/mach/hardware.h
@@ -1,11 +1,46 @@
1/* 1/*
2 * arch/arm/mach-omap1/include/mach/hardware.h 2 * arch/arm/mach-omap1/include/mach/hardware.h
3 *
4 * Hardware definitions for TI OMAP processors and boards
5 *
6 * NOTE: Please put device driver specific defines into a separate header
7 * file for each driver.
8 *
9 * Copyright (C) 2001 RidgeRun, Inc.
10 * Author: RidgeRun, Inc. Greg Lonnon <glonnon@ridgerun.com>
11 *
12 * Reorganized for Linux-2.6 by Tony Lindgren <tony@atomide.com>
13 * and Dirk Behme <dirk.behme@de.bosch.com>
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 *
20 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
21 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
23 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * You should have received a copy of the GNU General Public License along
32 * with this program; if not, write to the Free Software Foundation, Inc.,
33 * 675 Mass Ave, Cambridge, MA 02139, USA.
3 */ 34 */
4 35
5#ifndef __MACH_HARDWARE_H 36#ifndef __ASM_ARCH_OMAP_HARDWARE_H
6#define __MACH_HARDWARE_H 37#define __ASM_ARCH_OMAP_HARDWARE_H
7 38
39#include <asm/sizes.h>
8#ifndef __ASSEMBLER__ 40#ifndef __ASSEMBLER__
41#include <asm/types.h>
42#include <plat/cpu.h>
43
9/* 44/*
10 * NOTE: Please use ioremap + __raw_read/write where possible instead of these 45 * NOTE: Please use ioremap + __raw_read/write where possible instead of these
11 */ 46 */
@@ -35,7 +70,249 @@ static inline u32 omap_cs3_phys(void)
35 ? 0 : OMAP_CS3_PHYS; 70 ? 0 : OMAP_CS3_PHYS;
36} 71}
37 72
73#endif /* ifndef __ASSEMBLER__ */
74
75#include <plat/serial.h>
76
77/*
78 * ---------------------------------------------------------------------------
79 * Common definitions for all OMAP processors
80 * NOTE: Put all processor or board specific parts to the special header
81 * files.
82 * ---------------------------------------------------------------------------
83 */
84
85/*
86 * ----------------------------------------------------------------------------
87 * Timers
88 * ----------------------------------------------------------------------------
89 */
90#define OMAP_MPU_TIMER1_BASE (0xfffec500)
91#define OMAP_MPU_TIMER2_BASE (0xfffec600)
92#define OMAP_MPU_TIMER3_BASE (0xfffec700)
93#define MPU_TIMER_FREE (1 << 6)
94#define MPU_TIMER_CLOCK_ENABLE (1 << 5)
95#define MPU_TIMER_AR (1 << 1)
96#define MPU_TIMER_ST (1 << 0)
97
98/*
99 * ----------------------------------------------------------------------------
100 * Clocks
101 * ----------------------------------------------------------------------------
102 */
103#define CLKGEN_REG_BASE (0xfffece00)
104#define ARM_CKCTL (CLKGEN_REG_BASE + 0x0)
105#define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4)
106#define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8)
107#define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC)
108#define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10)
109#define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14)
110#define ARM_SYSST (CLKGEN_REG_BASE + 0x18)
111#define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24)
112
113#define CK_RATEF 1
114#define CK_IDLEF 2
115#define CK_ENABLEF 4
116#define CK_SELECTF 8
117#define SETARM_IDLE_SHIFT
118
119/* DPLL control registers */
120#define DPLL_CTL (0xfffecf00)
121
122/* DSP clock control. Must use __raw_readw() and __raw_writew() with these */
123#define DSP_CONFIG_REG_BASE IOMEM(0xe1008000)
124#define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0)
125#define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4)
126#define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8)
127#define DSP_RSTCT2 (DSP_CONFIG_REG_BASE + 0x14)
128
129/*
130 * ---------------------------------------------------------------------------
131 * UPLD
132 * ---------------------------------------------------------------------------
133 */
134#define ULPD_REG_BASE (0xfffe0800)
135#define ULPD_IT_STATUS (ULPD_REG_BASE + 0x14)
136#define ULPD_SETUP_ANALOG_CELL_3 (ULPD_REG_BASE + 0x24)
137#define ULPD_CLOCK_CTRL (ULPD_REG_BASE + 0x30)
138# define DIS_USB_PVCI_CLK (1 << 5) /* no USB/FAC synch */
139# define USB_MCLK_EN (1 << 4) /* enable W4_USB_CLKO */
140#define ULPD_SOFT_REQ (ULPD_REG_BASE + 0x34)
141# define SOFT_UDC_REQ (1 << 4)
142# define SOFT_USB_CLK_REQ (1 << 3)
143# define SOFT_DPLL_REQ (1 << 0)
144#define ULPD_DPLL_CTRL (ULPD_REG_BASE + 0x3c)
145#define ULPD_STATUS_REQ (ULPD_REG_BASE + 0x40)
146#define ULPD_APLL_CTRL (ULPD_REG_BASE + 0x4c)
147#define ULPD_POWER_CTRL (ULPD_REG_BASE + 0x50)
148#define ULPD_SOFT_DISABLE_REQ_REG (ULPD_REG_BASE + 0x68)
149# define DIS_MMC2_DPLL_REQ (1 << 11)
150# define DIS_MMC1_DPLL_REQ (1 << 10)
151# define DIS_UART3_DPLL_REQ (1 << 9)
152# define DIS_UART2_DPLL_REQ (1 << 8)
153# define DIS_UART1_DPLL_REQ (1 << 7)
154# define DIS_USB_HOST_DPLL_REQ (1 << 6)
155#define ULPD_SDW_CLK_DIV_CTRL_SEL (ULPD_REG_BASE + 0x74)
156#define ULPD_CAM_CLK_CTRL (ULPD_REG_BASE + 0x7c)
157
158/*
159 * ---------------------------------------------------------------------------
160 * Watchdog timer
161 * ---------------------------------------------------------------------------
162 */
163
164/* Watchdog timer within the OMAP3.2 gigacell */
165#define OMAP_MPU_WATCHDOG_BASE (0xfffec800)
166#define OMAP_WDT_TIMER (OMAP_MPU_WATCHDOG_BASE + 0x0)
167#define OMAP_WDT_LOAD_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4)
168#define OMAP_WDT_READ_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4)
169#define OMAP_WDT_TIMER_MODE (OMAP_MPU_WATCHDOG_BASE + 0x8)
170
171/*
172 * ---------------------------------------------------------------------------
173 * Interrupts
174 * ---------------------------------------------------------------------------
175 */
176#ifdef CONFIG_ARCH_OMAP1
177
178/*
179 * XXX: These probably want to be moved to arch/arm/mach-omap/omap1/irq.c
180 * or something similar.. -- PFM.
181 */
182
183#define OMAP_IH1_BASE 0xfffecb00
184#define OMAP_IH2_BASE 0xfffe0000
185
186#define OMAP_IH1_ITR (OMAP_IH1_BASE + 0x00)
187#define OMAP_IH1_MIR (OMAP_IH1_BASE + 0x04)
188#define OMAP_IH1_SIR_IRQ (OMAP_IH1_BASE + 0x10)
189#define OMAP_IH1_SIR_FIQ (OMAP_IH1_BASE + 0x14)
190#define OMAP_IH1_CONTROL (OMAP_IH1_BASE + 0x18)
191#define OMAP_IH1_ILR0 (OMAP_IH1_BASE + 0x1c)
192#define OMAP_IH1_ISR (OMAP_IH1_BASE + 0x9c)
193
194#define OMAP_IH2_ITR (OMAP_IH2_BASE + 0x00)
195#define OMAP_IH2_MIR (OMAP_IH2_BASE + 0x04)
196#define OMAP_IH2_SIR_IRQ (OMAP_IH2_BASE + 0x10)
197#define OMAP_IH2_SIR_FIQ (OMAP_IH2_BASE + 0x14)
198#define OMAP_IH2_CONTROL (OMAP_IH2_BASE + 0x18)
199#define OMAP_IH2_ILR0 (OMAP_IH2_BASE + 0x1c)
200#define OMAP_IH2_ISR (OMAP_IH2_BASE + 0x9c)
201
202#define IRQ_ITR_REG_OFFSET 0x00
203#define IRQ_MIR_REG_OFFSET 0x04
204#define IRQ_SIR_IRQ_REG_OFFSET 0x10
205#define IRQ_SIR_FIQ_REG_OFFSET 0x14
206#define IRQ_CONTROL_REG_OFFSET 0x18
207#define IRQ_ISR_REG_OFFSET 0x9c
208#define IRQ_ILR0_REG_OFFSET 0x1c
209#define IRQ_GMR_REG_OFFSET 0xa0
210
38#endif 211#endif
39#endif
40 212
41#include <plat/hardware.h> 213/*
214 * ----------------------------------------------------------------------------
215 * System control registers
216 * ----------------------------------------------------------------------------
217 */
218#define MOD_CONF_CTRL_0 0xfffe1080
219#define MOD_CONF_CTRL_1 0xfffe1110
220
221/*
222 * ----------------------------------------------------------------------------
223 * Pin multiplexing registers
224 * ----------------------------------------------------------------------------
225 */
226#define FUNC_MUX_CTRL_0 0xfffe1000
227#define FUNC_MUX_CTRL_1 0xfffe1004
228#define FUNC_MUX_CTRL_2 0xfffe1008
229#define COMP_MODE_CTRL_0 0xfffe100c
230#define FUNC_MUX_CTRL_3 0xfffe1010
231#define FUNC_MUX_CTRL_4 0xfffe1014
232#define FUNC_MUX_CTRL_5 0xfffe1018
233#define FUNC_MUX_CTRL_6 0xfffe101C
234#define FUNC_MUX_CTRL_7 0xfffe1020
235#define FUNC_MUX_CTRL_8 0xfffe1024
236#define FUNC_MUX_CTRL_9 0xfffe1028
237#define FUNC_MUX_CTRL_A 0xfffe102C
238#define FUNC_MUX_CTRL_B 0xfffe1030
239#define FUNC_MUX_CTRL_C 0xfffe1034
240#define FUNC_MUX_CTRL_D 0xfffe1038
241#define PULL_DWN_CTRL_0 0xfffe1040
242#define PULL_DWN_CTRL_1 0xfffe1044
243#define PULL_DWN_CTRL_2 0xfffe1048
244#define PULL_DWN_CTRL_3 0xfffe104c
245#define PULL_DWN_CTRL_4 0xfffe10ac
246
247/* OMAP-1610 specific multiplexing registers */
248#define FUNC_MUX_CTRL_E 0xfffe1090
249#define FUNC_MUX_CTRL_F 0xfffe1094
250#define FUNC_MUX_CTRL_10 0xfffe1098
251#define FUNC_MUX_CTRL_11 0xfffe109c
252#define FUNC_MUX_CTRL_12 0xfffe10a0
253#define PU_PD_SEL_0 0xfffe10b4
254#define PU_PD_SEL_1 0xfffe10b8
255#define PU_PD_SEL_2 0xfffe10bc
256#define PU_PD_SEL_3 0xfffe10c0
257#define PU_PD_SEL_4 0xfffe10c4
258
259/* Timer32K for 1610 and 1710*/
260#define OMAP_TIMER32K_BASE 0xFFFBC400
261
262/*
263 * ---------------------------------------------------------------------------
264 * TIPB bus interface
265 * ---------------------------------------------------------------------------
266 */
267#define TIPB_PUBLIC_CNTL_BASE 0xfffed300
268#define MPU_PUBLIC_TIPB_CNTL (TIPB_PUBLIC_CNTL_BASE + 0x8)
269#define TIPB_PRIVATE_CNTL_BASE 0xfffeca00
270#define MPU_PRIVATE_TIPB_CNTL (TIPB_PRIVATE_CNTL_BASE + 0x8)
271
272/*
273 * ----------------------------------------------------------------------------
274 * MPUI interface
275 * ----------------------------------------------------------------------------
276 */
277#define MPUI_BASE (0xfffec900)
278#define MPUI_CTRL (MPUI_BASE + 0x0)
279#define MPUI_DEBUG_ADDR (MPUI_BASE + 0x4)
280#define MPUI_DEBUG_DATA (MPUI_BASE + 0x8)
281#define MPUI_DEBUG_FLAG (MPUI_BASE + 0xc)
282#define MPUI_STATUS_REG (MPUI_BASE + 0x10)
283#define MPUI_DSP_STATUS (MPUI_BASE + 0x14)
284#define MPUI_DSP_BOOT_CONFIG (MPUI_BASE + 0x18)
285#define MPUI_DSP_API_CONFIG (MPUI_BASE + 0x1c)
286
287/*
288 * ----------------------------------------------------------------------------
289 * LED Pulse Generator
290 * ----------------------------------------------------------------------------
291 */
292#define OMAP_LPG1_BASE 0xfffbd000
293#define OMAP_LPG2_BASE 0xfffbd800
294#define OMAP_LPG1_LCR (OMAP_LPG1_BASE + 0x00)
295#define OMAP_LPG1_PMR (OMAP_LPG1_BASE + 0x04)
296#define OMAP_LPG2_LCR (OMAP_LPG2_BASE + 0x00)
297#define OMAP_LPG2_PMR (OMAP_LPG2_BASE + 0x04)
298
299/*
300 * ----------------------------------------------------------------------------
301 * Pulse-Width Light
302 * ----------------------------------------------------------------------------
303 */
304#define OMAP_PWL_BASE 0xfffb5800
305#define OMAP_PWL_ENABLE (OMAP_PWL_BASE + 0x00)
306#define OMAP_PWL_CLK_ENABLE (OMAP_PWL_BASE + 0x04)
307
308/*
309 * ---------------------------------------------------------------------------
310 * Processor specific defines
311 * ---------------------------------------------------------------------------
312 */
313
314#include "omap7xx.h"
315#include "omap1510.h"
316#include "omap16xx.h"
317
318#endif /* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/arch/arm/plat-omap/include/plat/irda.h b/arch/arm/mach-omap1/include/mach/irda.h
index 40f60339d1c..40f60339d1c 100644
--- a/arch/arm/plat-omap/include/plat/irda.h
+++ b/arch/arm/mach-omap1/include/mach/irda.h
diff --git a/arch/arm/mach-omap1/include/mach/irqs.h b/arch/arm/mach-omap1/include/mach/irqs.h
index 9292fdc1cb0..729992d7d26 100644
--- a/arch/arm/mach-omap1/include/mach/irqs.h
+++ b/arch/arm/mach-omap1/include/mach/irqs.h
@@ -1,5 +1,268 @@
1/* 1/*
2 * arch/arm/mach-omap1/include/mach/irqs.h 2 * arch/arm/plat-omap/include/mach/irqs.h
3 *
4 * Copyright (C) Greg Lonnon 2001
5 * Updated for OMAP-1610 by Tony Lindgren <tony@atomide.com>
6 *
7 * Copyright (C) 2009 Texas Instruments
8 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 * NOTE: The interrupt vectors for the OMAP-1509, OMAP-1510, and OMAP-1610
25 * are different.
3 */ 26 */
4 27
5#include <plat/irqs.h> 28#ifndef __ASM_ARCH_OMAP15XX_IRQS_H
29#define __ASM_ARCH_OMAP15XX_IRQS_H
30
31/*
32 * IRQ numbers for interrupt handler 1
33 *
34 * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below
35 *
36 */
37#define INT_CAMERA 1
38#define INT_FIQ 3
39#define INT_RTDX 6
40#define INT_DSP_MMU_ABORT 7
41#define INT_HOST 8
42#define INT_ABORT 9
43#define INT_BRIDGE_PRIV 13
44#define INT_GPIO_BANK1 14
45#define INT_UART3 15
46#define INT_TIMER3 16
47#define INT_DMA_CH0_6 19
48#define INT_DMA_CH1_7 20
49#define INT_DMA_CH2_8 21
50#define INT_DMA_CH3 22
51#define INT_DMA_CH4 23
52#define INT_DMA_CH5 24
53#define INT_TIMER1 26
54#define INT_WD_TIMER 27
55#define INT_BRIDGE_PUB 28
56#define INT_TIMER2 30
57#define INT_LCD_CTRL 31
58
59/*
60 * OMAP-1510 specific IRQ numbers for interrupt handler 1
61 */
62#define INT_1510_IH2_IRQ 0
63#define INT_1510_RES2 2
64#define INT_1510_SPI_TX 4
65#define INT_1510_SPI_RX 5
66#define INT_1510_DSP_MAILBOX1 10
67#define INT_1510_DSP_MAILBOX2 11
68#define INT_1510_RES12 12
69#define INT_1510_LB_MMU 17
70#define INT_1510_RES18 18
71#define INT_1510_LOCAL_BUS 29
72
73/*
74 * OMAP-1610 specific IRQ numbers for interrupt handler 1
75 */
76#define INT_1610_IH2_IRQ INT_1510_IH2_IRQ
77#define INT_1610_IH2_FIQ 2
78#define INT_1610_McBSP2_TX 4
79#define INT_1610_McBSP2_RX 5
80#define INT_1610_DSP_MAILBOX1 10
81#define INT_1610_DSP_MAILBOX2 11
82#define INT_1610_LCD_LINE 12
83#define INT_1610_GPTIMER1 17
84#define INT_1610_GPTIMER2 18
85#define INT_1610_SSR_FIFO_0 29
86
87/*
88 * OMAP-7xx specific IRQ numbers for interrupt handler 1
89 */
90#define INT_7XX_IH2_FIQ 0
91#define INT_7XX_IH2_IRQ 1
92#define INT_7XX_USB_NON_ISO 2
93#define INT_7XX_USB_ISO 3
94#define INT_7XX_ICR 4
95#define INT_7XX_EAC 5
96#define INT_7XX_GPIO_BANK1 6
97#define INT_7XX_GPIO_BANK2 7
98#define INT_7XX_GPIO_BANK3 8
99#define INT_7XX_McBSP2TX 10
100#define INT_7XX_McBSP2RX 11
101#define INT_7XX_McBSP2RX_OVF 12
102#define INT_7XX_LCD_LINE 14
103#define INT_7XX_GSM_PROTECT 15
104#define INT_7XX_TIMER3 16
105#define INT_7XX_GPIO_BANK5 17
106#define INT_7XX_GPIO_BANK6 18
107#define INT_7XX_SPGIO_WR 29
108
109/*
110 * IRQ numbers for interrupt handler 2
111 *
112 * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below
113 */
114#define IH2_BASE 32
115
116#define INT_KEYBOARD (1 + IH2_BASE)
117#define INT_uWireTX (2 + IH2_BASE)
118#define INT_uWireRX (3 + IH2_BASE)
119#define INT_I2C (4 + IH2_BASE)
120#define INT_MPUIO (5 + IH2_BASE)
121#define INT_USB_HHC_1 (6 + IH2_BASE)
122#define INT_McBSP3TX (10 + IH2_BASE)
123#define INT_McBSP3RX (11 + IH2_BASE)
124#define INT_McBSP1TX (12 + IH2_BASE)
125#define INT_McBSP1RX (13 + IH2_BASE)
126#define INT_UART1 (14 + IH2_BASE)
127#define INT_UART2 (15 + IH2_BASE)
128#define INT_BT_MCSI1TX (16 + IH2_BASE)
129#define INT_BT_MCSI1RX (17 + IH2_BASE)
130#define INT_SOSSI_MATCH (19 + IH2_BASE)
131#define INT_USB_W2FC (20 + IH2_BASE)
132#define INT_1WIRE (21 + IH2_BASE)
133#define INT_OS_TIMER (22 + IH2_BASE)
134#define INT_MMC (23 + IH2_BASE)
135#define INT_GAUGE_32K (24 + IH2_BASE)
136#define INT_RTC_TIMER (25 + IH2_BASE)
137#define INT_RTC_ALARM (26 + IH2_BASE)
138#define INT_MEM_STICK (27 + IH2_BASE)
139
140/*
141 * OMAP-1510 specific IRQ numbers for interrupt handler 2
142 */
143#define INT_1510_DSP_MMU (28 + IH2_BASE)
144#define INT_1510_COM_SPI_RO (31 + IH2_BASE)
145
146/*
147 * OMAP-1610 specific IRQ numbers for interrupt handler 2
148 */
149#define INT_1610_FAC (0 + IH2_BASE)
150#define INT_1610_USB_HHC_2 (7 + IH2_BASE)
151#define INT_1610_USB_OTG (8 + IH2_BASE)
152#define INT_1610_SoSSI (9 + IH2_BASE)
153#define INT_1610_SoSSI_MATCH (19 + IH2_BASE)
154#define INT_1610_DSP_MMU (28 + IH2_BASE)
155#define INT_1610_McBSP2RX_OF (31 + IH2_BASE)
156#define INT_1610_STI (32 + IH2_BASE)
157#define INT_1610_STI_WAKEUP (33 + IH2_BASE)
158#define INT_1610_GPTIMER3 (34 + IH2_BASE)
159#define INT_1610_GPTIMER4 (35 + IH2_BASE)
160#define INT_1610_GPTIMER5 (36 + IH2_BASE)
161#define INT_1610_GPTIMER6 (37 + IH2_BASE)
162#define INT_1610_GPTIMER7 (38 + IH2_BASE)
163#define INT_1610_GPTIMER8 (39 + IH2_BASE)
164#define INT_1610_GPIO_BANK2 (40 + IH2_BASE)
165#define INT_1610_GPIO_BANK3 (41 + IH2_BASE)
166#define INT_1610_MMC2 (42 + IH2_BASE)
167#define INT_1610_CF (43 + IH2_BASE)
168#define INT_1610_WAKE_UP_REQ (46 + IH2_BASE)
169#define INT_1610_GPIO_BANK4 (48 + IH2_BASE)
170#define INT_1610_SPI (49 + IH2_BASE)
171#define INT_1610_DMA_CH6 (53 + IH2_BASE)
172#define INT_1610_DMA_CH7 (54 + IH2_BASE)
173#define INT_1610_DMA_CH8 (55 + IH2_BASE)
174#define INT_1610_DMA_CH9 (56 + IH2_BASE)
175#define INT_1610_DMA_CH10 (57 + IH2_BASE)
176#define INT_1610_DMA_CH11 (58 + IH2_BASE)
177#define INT_1610_DMA_CH12 (59 + IH2_BASE)
178#define INT_1610_DMA_CH13 (60 + IH2_BASE)
179#define INT_1610_DMA_CH14 (61 + IH2_BASE)
180#define INT_1610_DMA_CH15 (62 + IH2_BASE)
181#define INT_1610_NAND (63 + IH2_BASE)
182#define INT_1610_SHA1MD5 (91 + IH2_BASE)
183
184/*
185 * OMAP-7xx specific IRQ numbers for interrupt handler 2
186 */
187#define INT_7XX_HW_ERRORS (0 + IH2_BASE)
188#define INT_7XX_NFIQ_PWR_FAIL (1 + IH2_BASE)
189#define INT_7XX_CFCD (2 + IH2_BASE)
190#define INT_7XX_CFIREQ (3 + IH2_BASE)
191#define INT_7XX_I2C (4 + IH2_BASE)
192#define INT_7XX_PCC (5 + IH2_BASE)
193#define INT_7XX_MPU_EXT_NIRQ (6 + IH2_BASE)
194#define INT_7XX_SPI_100K_1 (7 + IH2_BASE)
195#define INT_7XX_SYREN_SPI (8 + IH2_BASE)
196#define INT_7XX_VLYNQ (9 + IH2_BASE)
197#define INT_7XX_GPIO_BANK4 (10 + IH2_BASE)
198#define INT_7XX_McBSP1TX (11 + IH2_BASE)
199#define INT_7XX_McBSP1RX (12 + IH2_BASE)
200#define INT_7XX_McBSP1RX_OF (13 + IH2_BASE)
201#define INT_7XX_UART_MODEM_IRDA_2 (14 + IH2_BASE)
202#define INT_7XX_UART_MODEM_1 (15 + IH2_BASE)
203#define INT_7XX_MCSI (16 + IH2_BASE)
204#define INT_7XX_uWireTX (17 + IH2_BASE)
205#define INT_7XX_uWireRX (18 + IH2_BASE)
206#define INT_7XX_SMC_CD (19 + IH2_BASE)
207#define INT_7XX_SMC_IREQ (20 + IH2_BASE)
208#define INT_7XX_HDQ_1WIRE (21 + IH2_BASE)
209#define INT_7XX_TIMER32K (22 + IH2_BASE)
210#define INT_7XX_MMC_SDIO (23 + IH2_BASE)
211#define INT_7XX_UPLD (24 + IH2_BASE)
212#define INT_7XX_USB_HHC_1 (27 + IH2_BASE)
213#define INT_7XX_USB_HHC_2 (28 + IH2_BASE)
214#define INT_7XX_USB_GENI (29 + IH2_BASE)
215#define INT_7XX_USB_OTG (30 + IH2_BASE)
216#define INT_7XX_CAMERA_IF (31 + IH2_BASE)
217#define INT_7XX_RNG (32 + IH2_BASE)
218#define INT_7XX_DUAL_MODE_TIMER (33 + IH2_BASE)
219#define INT_7XX_DBB_RF_EN (34 + IH2_BASE)
220#define INT_7XX_MPUIO_KEYPAD (35 + IH2_BASE)
221#define INT_7XX_SHA1_MD5 (36 + IH2_BASE)
222#define INT_7XX_SPI_100K_2 (37 + IH2_BASE)
223#define INT_7XX_RNG_IDLE (38 + IH2_BASE)
224#define INT_7XX_MPUIO (39 + IH2_BASE)
225#define INT_7XX_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE)
226#define INT_7XX_LLPC_OE_FALLING (41 + IH2_BASE)
227#define INT_7XX_LLPC_OE_RISING (42 + IH2_BASE)
228#define INT_7XX_LLPC_VSYNC (43 + IH2_BASE)
229#define INT_7XX_WAKE_UP_REQ (46 + IH2_BASE)
230#define INT_7XX_DMA_CH6 (53 + IH2_BASE)
231#define INT_7XX_DMA_CH7 (54 + IH2_BASE)
232#define INT_7XX_DMA_CH8 (55 + IH2_BASE)
233#define INT_7XX_DMA_CH9 (56 + IH2_BASE)
234#define INT_7XX_DMA_CH10 (57 + IH2_BASE)
235#define INT_7XX_DMA_CH11 (58 + IH2_BASE)
236#define INT_7XX_DMA_CH12 (59 + IH2_BASE)
237#define INT_7XX_DMA_CH13 (60 + IH2_BASE)
238#define INT_7XX_DMA_CH14 (61 + IH2_BASE)
239#define INT_7XX_DMA_CH15 (62 + IH2_BASE)
240#define INT_7XX_NAND (63 + IH2_BASE)
241
242/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and
243 * 16 MPUIO lines */
244#define OMAP_MAX_GPIO_LINES 192
245#define IH_GPIO_BASE (128 + IH2_BASE)
246#define IH_MPUIO_BASE (OMAP_MAX_GPIO_LINES + IH_GPIO_BASE)
247#define OMAP_IRQ_END (IH_MPUIO_BASE + 16)
248
249/* External FPGA handles interrupts on Innovator boards */
250#define OMAP_FPGA_IRQ_BASE (OMAP_IRQ_END)
251#ifdef CONFIG_MACH_OMAP_INNOVATOR
252#define OMAP_FPGA_NR_IRQS 24
253#else
254#define OMAP_FPGA_NR_IRQS 0
255#endif
256#define OMAP_FPGA_IRQ_END (OMAP_FPGA_IRQ_BASE + OMAP_FPGA_NR_IRQS)
257
258#define NR_IRQS OMAP_FPGA_IRQ_END
259
260#define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32))
261
262#include <mach/hardware.h>
263
264#ifdef CONFIG_FIQ
265#define FIQ_START 1024
266#endif
267
268#endif
diff --git a/arch/arm/plat-omap/include/plat/mux.h b/arch/arm/mach-omap1/include/mach/mux.h
index 32394895920..32394895920 100644
--- a/arch/arm/plat-omap/include/plat/mux.h
+++ b/arch/arm/mach-omap1/include/mach/mux.h
diff --git a/arch/arm/plat-omap/include/plat/omap1510.h b/arch/arm/mach-omap1/include/mach/omap1510.h
index d2400466813..8fe05d6137c 100644
--- a/arch/arm/plat-omap/include/plat/omap1510.h
+++ b/arch/arm/mach-omap1/include/mach/omap1510.h
@@ -1,5 +1,4 @@
1/* arch/arm/plat-omap/include/mach/omap1510.h 1/*
2 *
3 * Hardware definitions for TI OMAP1510 processor. 2 * Hardware definitions for TI OMAP1510 processor.
4 * 3 *
5 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com> 4 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com>
diff --git a/arch/arm/plat-omap/include/plat/omap16xx.h b/arch/arm/mach-omap1/include/mach/omap16xx.h
index e69e1d857b4..cd1c724869c 100644
--- a/arch/arm/plat-omap/include/plat/omap16xx.h
+++ b/arch/arm/mach-omap1/include/mach/omap16xx.h
@@ -1,5 +1,4 @@
1/* arch/arm/plat-omap/include/mach/omap16xx.h 1/*
2 *
3 * Hardware definitions for TI OMAP1610/5912/1710 processors. 2 * Hardware definitions for TI OMAP1610/5912/1710 processors.
4 * 3 *
5 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com> 4 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com>
diff --git a/arch/arm/plat-omap/include/plat/omap7xx.h b/arch/arm/mach-omap1/include/mach/omap7xx.h
index 48e4757e1e3..63da994bc60 100644
--- a/arch/arm/plat-omap/include/plat/omap7xx.h
+++ b/arch/arm/mach-omap1/include/mach/omap7xx.h
@@ -1,5 +1,4 @@
1/* arch/arm/plat-omap/include/mach/omap7xx.h 1/*
2 *
3 * Hardware definitions for TI OMAP7XX processor. 2 * Hardware definitions for TI OMAP7XX processor.
4 * 3 *
5 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com> 4 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com>
diff --git a/arch/arm/mach-omap1/include/mach/smp.h b/arch/arm/mach-omap1/include/mach/smp.h
deleted file mode 100644
index 80a371c06e5..00000000000
--- a/arch/arm/mach-omap1/include/mach/smp.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-omap1/include/mach/smp.h
3 */
4
5#include <plat/smp.h>
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index 6c95a59f0f1..6a5baab1f4c 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -16,7 +16,7 @@
16#include <asm/tlb.h> 16#include <asm/tlb.h>
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18 18
19#include <plat/mux.h> 19#include <mach/mux.h>
20#include <plat/tc.h> 20#include <plat/tc.h>
21#include <plat/dma.h> 21#include <plat/dma.h>
22 22
diff --git a/arch/arm/mach-omap1/lcd_dma.c b/arch/arm/mach-omap1/lcd_dma.c
index 5769c71815b..ed42628611b 100644
--- a/arch/arm/mach-omap1/lcd_dma.c
+++ b/arch/arm/mach-omap1/lcd_dma.c
@@ -113,8 +113,7 @@ EXPORT_SYMBOL(omap_set_lcd_dma_b1_mirror);
113void omap_set_lcd_dma_b1_vxres(unsigned long vxres) 113void omap_set_lcd_dma_b1_vxres(unsigned long vxres)
114{ 114{
115 if (cpu_is_omap15xx()) { 115 if (cpu_is_omap15xx()) {
116 printk(KERN_ERR "DMA virtual resolution is not supported " 116 pr_err("DMA virtual resolution is not supported in 1510 mode\n");
117 "in 1510 mode\n");
118 BUG(); 117 BUG();
119 } 118 }
120 lcd_dma.vxres = vxres; 119 lcd_dma.vxres = vxres;
@@ -437,8 +436,7 @@ static int __init omap_init_lcd_dma(void)
437 r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0, 436 r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0,
438 "LCD DMA", NULL); 437 "LCD DMA", NULL);
439 if (r != 0) 438 if (r != 0)
440 printk(KERN_ERR "unable to request IRQ for LCD DMA " 439 pr_err("unable to request IRQ for LCD DMA (error %d)\n", r);
441 "(error %d)\n", r);
442 440
443 return r; 441 return r;
444} 442}
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c
deleted file mode 100644
index f6b14a14a95..00000000000
--- a/arch/arm/mach-omap1/leds-h2p2-debug.c
+++ /dev/null
@@ -1,166 +0,0 @@
1/*
2 * linux/arch/arm/mach-omap1/leds-h2p2-debug.c
3 *
4 * Copyright 2003 by Texas Instruments Incorporated
5 *
6 * There are 16 LEDs on the debug board (all green); four may be used
7 * for logical 'green', 'amber', 'red', and 'blue' (after "claiming").
8 *
9 * The "surfer" expansion board and H2 sample board also have two-color
10 * green+red LEDs (in parallel), used here for timer and idle indicators.
11 */
12#include <linux/gpio.h>
13#include <linux/init.h>
14#include <linux/kernel_stat.h>
15#include <linux/sched.h>
16#include <linux/io.h>
17
18#include <mach/hardware.h>
19#include <asm/leds.h>
20#include <asm/mach-types.h>
21
22#include <plat/fpga.h>
23
24#include "leds.h"
25
26
27#define GPIO_LED_RED 3
28#define GPIO_LED_GREEN OMAP_MPUIO(4)
29
30
31#define LED_STATE_ENABLED 0x01
32#define LED_STATE_CLAIMED 0x02
33#define LED_TIMER_ON 0x04
34
35#define GPIO_IDLE GPIO_LED_GREEN
36#define GPIO_TIMER GPIO_LED_RED
37
38
39void h2p2_dbg_leds_event(led_event_t evt)
40{
41 unsigned long flags;
42
43 static struct h2p2_dbg_fpga __iomem *fpga;
44 static u16 led_state, hw_led_state;
45
46 local_irq_save(flags);
47
48 if (!(led_state & LED_STATE_ENABLED) && evt != led_start)
49 goto done;
50
51 switch (evt) {
52 case led_start:
53 if (!fpga)
54 fpga = ioremap(H2P2_DBG_FPGA_START,
55 H2P2_DBG_FPGA_SIZE);
56 if (fpga) {
57 led_state |= LED_STATE_ENABLED;
58 __raw_writew(~0, &fpga->leds);
59 }
60 break;
61
62 case led_stop:
63 case led_halted:
64 /* all leds off during suspend or shutdown */
65
66 if (! machine_is_omap_perseus2()) {
67 gpio_set_value(GPIO_TIMER, 0);
68 gpio_set_value(GPIO_IDLE, 0);
69 }
70
71 __raw_writew(~0, &fpga->leds);
72 led_state &= ~LED_STATE_ENABLED;
73 if (evt == led_halted) {
74 iounmap(fpga);
75 fpga = NULL;
76 }
77
78 goto done;
79
80 case led_claim:
81 led_state |= LED_STATE_CLAIMED;
82 hw_led_state = 0;
83 break;
84
85 case led_release:
86 led_state &= ~LED_STATE_CLAIMED;
87 break;
88
89#ifdef CONFIG_LEDS_TIMER
90 case led_timer:
91 led_state ^= LED_TIMER_ON;
92
93 if (machine_is_omap_perseus2())
94 hw_led_state ^= H2P2_DBG_FPGA_P2_LED_TIMER;
95 else {
96 gpio_set_value(GPIO_TIMER, led_state & LED_TIMER_ON);
97 goto done;
98 }
99
100 break;
101#endif
102
103#ifdef CONFIG_LEDS_CPU
104 case led_idle_start:
105 if (machine_is_omap_perseus2())
106 hw_led_state |= H2P2_DBG_FPGA_P2_LED_IDLE;
107 else {
108 gpio_set_value(GPIO_IDLE, 1);
109 goto done;
110 }
111
112 break;
113
114 case led_idle_end:
115 if (machine_is_omap_perseus2())
116 hw_led_state &= ~H2P2_DBG_FPGA_P2_LED_IDLE;
117 else {
118 gpio_set_value(GPIO_IDLE, 0);
119 goto done;
120 }
121
122 break;
123#endif
124
125 case led_green_on:
126 hw_led_state |= H2P2_DBG_FPGA_LED_GREEN;
127 break;
128 case led_green_off:
129 hw_led_state &= ~H2P2_DBG_FPGA_LED_GREEN;
130 break;
131
132 case led_amber_on:
133 hw_led_state |= H2P2_DBG_FPGA_LED_AMBER;
134 break;
135 case led_amber_off:
136 hw_led_state &= ~H2P2_DBG_FPGA_LED_AMBER;
137 break;
138
139 case led_red_on:
140 hw_led_state |= H2P2_DBG_FPGA_LED_RED;
141 break;
142 case led_red_off:
143 hw_led_state &= ~H2P2_DBG_FPGA_LED_RED;
144 break;
145
146 case led_blue_on:
147 hw_led_state |= H2P2_DBG_FPGA_LED_BLUE;
148 break;
149 case led_blue_off:
150 hw_led_state &= ~H2P2_DBG_FPGA_LED_BLUE;
151 break;
152
153 default:
154 break;
155 }
156
157
158 /*
159 * Actually burn the LEDs
160 */
161 if (led_state & LED_STATE_ENABLED)
162 __raw_writew(~hw_led_state, &fpga->leds);
163
164done:
165 local_irq_restore(flags);
166}
diff --git a/arch/arm/mach-omap1/leds-innovator.c b/arch/arm/mach-omap1/leds-innovator.c
deleted file mode 100644
index 3a066ee8d02..00000000000
--- a/arch/arm/mach-omap1/leds-innovator.c
+++ /dev/null
@@ -1,98 +0,0 @@
1/*
2 * linux/arch/arm/mach-omap1/leds-innovator.c
3 */
4#include <linux/init.h>
5
6#include <mach/hardware.h>
7#include <asm/leds.h>
8
9#include "leds.h"
10
11
12#define LED_STATE_ENABLED 1
13#define LED_STATE_CLAIMED 2
14
15static unsigned int led_state;
16static unsigned int hw_led_state;
17
18void innovator_leds_event(led_event_t evt)
19{
20 unsigned long flags;
21
22 local_irq_save(flags);
23
24 switch (evt) {
25 case led_start:
26 hw_led_state = 0;
27 led_state = LED_STATE_ENABLED;
28 break;
29
30 case led_stop:
31 led_state &= ~LED_STATE_ENABLED;
32 hw_led_state = 0;
33 break;
34
35 case led_claim:
36 led_state |= LED_STATE_CLAIMED;
37 hw_led_state = 0;
38 break;
39
40 case led_release:
41 led_state &= ~LED_STATE_CLAIMED;
42 hw_led_state = 0;
43 break;
44
45#ifdef CONFIG_LEDS_TIMER
46 case led_timer:
47 if (!(led_state & LED_STATE_CLAIMED))
48 hw_led_state ^= 0;
49 break;
50#endif
51
52#ifdef CONFIG_LEDS_CPU
53 case led_idle_start:
54 if (!(led_state & LED_STATE_CLAIMED))
55 hw_led_state |= 0;
56 break;
57
58 case led_idle_end:
59 if (!(led_state & LED_STATE_CLAIMED))
60 hw_led_state &= ~0;
61 break;
62#endif
63
64 case led_halted:
65 break;
66
67 case led_green_on:
68 if (led_state & LED_STATE_CLAIMED)
69 hw_led_state &= ~0;
70 break;
71
72 case led_green_off:
73 if (led_state & LED_STATE_CLAIMED)
74 hw_led_state |= 0;
75 break;
76
77 case led_amber_on:
78 break;
79
80 case led_amber_off:
81 break;
82
83 case led_red_on:
84 if (led_state & LED_STATE_CLAIMED)
85 hw_led_state &= ~0;
86 break;
87
88 case led_red_off:
89 if (led_state & LED_STATE_CLAIMED)
90 hw_led_state |= 0;
91 break;
92
93 default:
94 break;
95 }
96
97 local_irq_restore(flags);
98}
diff --git a/arch/arm/mach-omap1/leds-osk.c b/arch/arm/mach-omap1/leds-osk.c
deleted file mode 100644
index 936ed426b84..00000000000
--- a/arch/arm/mach-omap1/leds-osk.c
+++ /dev/null
@@ -1,113 +0,0 @@
1/*
2 * linux/arch/arm/mach-omap1/leds-osk.c
3 *
4 * LED driver for OSK with optional Mistral QVGA board
5 */
6#include <linux/gpio.h>
7#include <linux/init.h>
8
9#include <mach/hardware.h>
10#include <asm/leds.h>
11
12#include "leds.h"
13
14
15#define LED_STATE_ENABLED (1 << 0)
16#define LED_STATE_CLAIMED (1 << 1)
17static u8 led_state;
18
19#define TIMER_LED (1 << 3) /* Mistral board */
20#define IDLE_LED (1 << 4) /* Mistral board */
21static u8 hw_led_state;
22
23
24#ifdef CONFIG_OMAP_OSK_MISTRAL
25
26/* For now, all system indicators require the Mistral board, since that
27 * LED can be manipulated without a task context. This LED is either red,
28 * or green, but not both; it can't give the full "disco led" effect.
29 */
30
31#define GPIO_LED_RED 3
32#define GPIO_LED_GREEN OMAP_MPUIO(4)
33
34static void mistral_setled(void)
35{
36 int red = 0;
37 int green = 0;
38
39 if (hw_led_state & TIMER_LED)
40 red = 1;
41 else if (hw_led_state & IDLE_LED)
42 green = 1;
43 /* else both sides are disabled */
44
45 gpio_set_value(GPIO_LED_GREEN, green);
46 gpio_set_value(GPIO_LED_RED, red);
47}
48
49#endif
50
51void osk_leds_event(led_event_t evt)
52{
53 unsigned long flags;
54 u16 leds;
55
56 local_irq_save(flags);
57
58 if (!(led_state & LED_STATE_ENABLED) && evt != led_start)
59 goto done;
60
61 leds = hw_led_state;
62 switch (evt) {
63 case led_start:
64 led_state |= LED_STATE_ENABLED;
65 hw_led_state = 0;
66 leds = ~0;
67 break;
68
69 case led_halted:
70 case led_stop:
71 led_state &= ~LED_STATE_ENABLED;
72 hw_led_state = 0;
73 break;
74
75 case led_claim:
76 led_state |= LED_STATE_CLAIMED;
77 hw_led_state = 0;
78 leds = ~0;
79 break;
80
81 case led_release:
82 led_state &= ~LED_STATE_CLAIMED;
83 hw_led_state = 0;
84 break;
85
86#ifdef CONFIG_OMAP_OSK_MISTRAL
87
88 case led_timer:
89 hw_led_state ^= TIMER_LED;
90 mistral_setled();
91 break;
92
93 case led_idle_start: /* idle == off */
94 hw_led_state &= ~IDLE_LED;
95 mistral_setled();
96 break;
97
98 case led_idle_end:
99 hw_led_state |= IDLE_LED;
100 mistral_setled();
101 break;
102
103#endif /* CONFIG_OMAP_OSK_MISTRAL */
104
105 default:
106 break;
107 }
108
109 leds ^= hw_led_state;
110
111done:
112 local_irq_restore(flags);
113}
diff --git a/arch/arm/mach-omap1/leds.c b/arch/arm/mach-omap1/leds.c
deleted file mode 100644
index ae6dd93b8dd..00000000000
--- a/arch/arm/mach-omap1/leds.c
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * linux/arch/arm/mach-omap1/leds.c
3 *
4 * OMAP LEDs dispatcher
5 */
6#include <linux/gpio.h>
7#include <linux/kernel.h>
8#include <linux/init.h>
9
10#include <asm/leds.h>
11#include <asm/mach-types.h>
12
13#include <plat/mux.h>
14
15#include "leds.h"
16
17static int __init
18omap_leds_init(void)
19{
20 if (!cpu_class_is_omap1())
21 return -ENODEV;
22
23 if (machine_is_omap_innovator())
24 leds_event = innovator_leds_event;
25
26 else if (machine_is_omap_h2()
27 || machine_is_omap_h3()
28 || machine_is_omap_perseus2())
29 leds_event = h2p2_dbg_leds_event;
30
31 else if (machine_is_omap_osk())
32 leds_event = osk_leds_event;
33
34 else
35 return -1;
36
37 if (machine_is_omap_h2()
38 || machine_is_omap_h3()
39#ifdef CONFIG_OMAP_OSK_MISTRAL
40 || machine_is_omap_osk()
41#endif
42 ) {
43
44 /* LED1/LED2 pins can be used as GPIO (as done here), or by
45 * the LPG (works even in deep sleep!), to drive a bicolor
46 * LED on the H2 sample board, and another on the H2/P2
47 * "surfer" expansion board.
48 *
49 * The same pins drive a LED on the OSK Mistral board, but
50 * that's a different kind of LED (just one color at a time).
51 */
52 omap_cfg_reg(P18_1610_GPIO3);
53 if (gpio_request(3, "LED red") == 0)
54 gpio_direction_output(3, 1);
55 else
56 printk(KERN_WARNING "LED: can't get GPIO3/red?\n");
57
58 omap_cfg_reg(MPUIO4);
59 if (gpio_request(OMAP_MPUIO(4), "LED green") == 0)
60 gpio_direction_output(OMAP_MPUIO(4), 1);
61 else
62 printk(KERN_WARNING "LED: can't get MPUIO4/green?\n");
63 }
64
65 leds_event(led_start);
66 return 0;
67}
68
69__initcall(omap_leds_init);
diff --git a/arch/arm/mach-omap1/leds.h b/arch/arm/mach-omap1/leds.h
deleted file mode 100644
index a1e9fedc376..00000000000
--- a/arch/arm/mach-omap1/leds.h
+++ /dev/null
@@ -1,3 +0,0 @@
1extern void innovator_leds_event(led_event_t evt);
2extern void h2p2_dbg_leds_event(led_event_t evt);
3extern void osk_leds_event(led_event_t evt);
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index adf00975b9b..bdc2e7541ad 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -20,9 +20,9 @@
20#include <linux/slab.h> 20#include <linux/slab.h>
21 21
22#include <plat/dma.h> 22#include <plat/dma.h>
23#include <plat/mux.h> 23#include <mach/mux.h>
24#include <plat/cpu.h> 24#include <plat/cpu.h>
25#include <plat/mcbsp.h> 25#include <linux/platform_data/asoc-ti-mcbsp.h>
26 26
27#include <mach/irqs.h> 27#include <mach/irqs.h>
28 28
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c
index e9cc52d4cb2..667ce5027f6 100644
--- a/arch/arm/mach-omap1/mux.c
+++ b/arch/arm/mach-omap1/mux.c
@@ -29,7 +29,7 @@
29 29
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31 31
32#include <plat/mux.h> 32#include <mach/mux.h>
33 33
34#ifdef CONFIG_OMAP_MUX 34#ifdef CONFIG_OMAP_MUX
35 35
@@ -451,6 +451,56 @@ static int __init_or_module omap1_cfg_reg(const struct pin_config *cfg)
451#endif 451#endif
452} 452}
453 453
454static struct omap_mux_cfg *mux_cfg;
455
456int __init omap_mux_register(struct omap_mux_cfg *arch_mux_cfg)
457{
458 if (!arch_mux_cfg || !arch_mux_cfg->pins || arch_mux_cfg->size == 0
459 || !arch_mux_cfg->cfg_reg) {
460 printk(KERN_ERR "Invalid pin table\n");
461 return -EINVAL;
462 }
463
464 mux_cfg = arch_mux_cfg;
465
466 return 0;
467}
468
469/*
470 * Sets the Omap MUX and PULL_DWN registers based on the table
471 */
472int __init_or_module omap_cfg_reg(const unsigned long index)
473{
474 struct pin_config *reg;
475
476 if (!cpu_class_is_omap1()) {
477 printk(KERN_ERR "mux: Broken omap_cfg_reg(%lu) entry\n",
478 index);
479 WARN_ON(1);
480 return -EINVAL;
481 }
482
483 if (mux_cfg == NULL) {
484 printk(KERN_ERR "Pin mux table not initialized\n");
485 return -ENODEV;
486 }
487
488 if (index >= mux_cfg->size) {
489 printk(KERN_ERR "Invalid pin mux index: %lu (%lu)\n",
490 index, mux_cfg->size);
491 dump_stack();
492 return -ENODEV;
493 }
494
495 reg = &mux_cfg->pins[index];
496
497 if (!mux_cfg->cfg_reg)
498 return -ENODEV;
499
500 return mux_cfg->cfg_reg(reg);
501}
502EXPORT_SYMBOL(omap_cfg_reg);
503
454int __init omap1_mux_init(void) 504int __init omap1_mux_init(void)
455{ 505{
456 if (cpu_is_omap7xx()) { 506 if (cpu_is_omap7xx()) {
@@ -468,4 +518,8 @@ int __init omap1_mux_init(void)
468 return omap_mux_register(&arch_mux_cfg); 518 return omap_mux_register(&arch_mux_cfg);
469} 519}
470 520
471#endif 521#else
522#define omap_mux_init() do {} while(0)
523#define omap_cfg_reg(x) do {} while(0)
524#endif /* CONFIG_OMAP_MUX */
525
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index b2560d32b3a..47ec1615548 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -53,7 +53,7 @@
53#include <plat/clock.h> 53#include <plat/clock.h>
54#include <plat/sram.h> 54#include <plat/sram.h>
55#include <plat/tc.h> 55#include <plat/tc.h>
56#include <plat/mux.h> 56#include <mach/mux.h>
57#include <plat/dma.h> 57#include <plat/dma.h>
58#include <plat/dmtimer.h> 58#include <plat/dmtimer.h>
59 59
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 6809c9e56c9..b9d6834af83 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -22,8 +22,7 @@
22 22
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24 24
25#include <plat/board.h> 25#include <mach/mux.h>
26#include <plat/mux.h>
27#include <plat/fpga.h> 26#include <plat/fpga.h>
28 27
29#include "pm.h" 28#include "pm.h"
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 4062480bfec..4d4816fd6fc 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -44,7 +44,6 @@
44#include <linux/clockchips.h> 44#include <linux/clockchips.h>
45#include <linux/io.h> 45#include <linux/io.h>
46 46
47#include <asm/leds.h>
48#include <asm/irq.h> 47#include <asm/irq.h>
49#include <asm/sched_clock.h> 48#include <asm/sched_clock.h>
50 49
diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
index aa81593db1a..cdeb9d3ef64 100644
--- a/arch/arm/mach-omap1/timer.c
+++ b/arch/arm/mach-omap1/timer.c
@@ -141,7 +141,7 @@ static int __init omap1_dm_timer_init(void)
141 141
142 pdata->set_timer_src = omap1_dm_timer_set_src; 142 pdata->set_timer_src = omap1_dm_timer_set_src;
143 pdata->timer_capability = OMAP_TIMER_ALWON | 143 pdata->timer_capability = OMAP_TIMER_ALWON |
144 OMAP_TIMER_NEEDS_RESET; 144 OMAP_TIMER_NEEDS_RESET | OMAP_TIMER_HAS_DSP_IRQ;
145 145
146 ret = platform_device_add_data(pdev, pdata, sizeof(*pdata)); 146 ret = platform_device_add_data(pdev, pdata, sizeof(*pdata));
147 if (ret) { 147 if (ret) {
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index eae49c3980c..74529549130 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -46,7 +46,6 @@
46#include <linux/clockchips.h> 46#include <linux/clockchips.h>
47#include <linux/io.h> 47#include <linux/io.h>
48 48
49#include <asm/leds.h>
50#include <asm/irq.h> 49#include <asm/irq.h>
51#include <asm/mach/irq.h> 50#include <asm/mach/irq.h>
52#include <asm/mach/time.h> 51#include <asm/mach/time.h>
diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c
index 65f88176fba..84267edd942 100644
--- a/arch/arm/mach-omap1/usb.c
+++ b/arch/arm/mach-omap1/usb.c
@@ -26,7 +26,7 @@
26 26
27#include <asm/irq.h> 27#include <asm/irq.h>
28 28
29#include <plat/mux.h> 29#include <mach/mux.h>
30 30
31#include <mach/usb.h> 31#include <mach/usb.h>
32 32
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index fcd4e85c4dd..2a1a898c7f9 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -6,24 +6,28 @@ config ARCH_OMAP2PLUS_TYPICAL
6 bool "Typical OMAP configuration" 6 bool "Typical OMAP configuration"
7 default y 7 default y
8 select AEABI 8 select AEABI
9 select REGULATOR 9 select HIGHMEM
10 select PM_RUNTIME
11 select VFP
12 select NEON if ARCH_OMAP3 || ARCH_OMAP4 || SOC_OMAP5
13 select SERIAL_OMAP
14 select SERIAL_OMAP_CONSOLE
15 select I2C 10 select I2C
16 select I2C_OMAP 11 select I2C_OMAP
17 select MENELAUS if ARCH_OMAP2 12 select MENELAUS if ARCH_OMAP2
13 select NEON if ARCH_OMAP3 || ARCH_OMAP4 || SOC_OMAP5
14 select PINCTRL
15 select PM_RUNTIME
16 select REGULATOR
17 select SERIAL_OMAP
18 select SERIAL_OMAP_CONSOLE
18 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4 19 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
19 select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4 20 select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
20 select HIGHMEM 21 select VFP
21 help 22 help
22 Compile a kernel suitable for booting most boards 23 Compile a kernel suitable for booting most boards
23 24
24config SOC_HAS_OMAP2_SDRC 25config SOC_HAS_OMAP2_SDRC
25 bool "OMAP2 SDRAM Controller support" 26 bool "OMAP2 SDRAM Controller support"
26 27
28config SOC_HAS_REALTIME_COUNTER
29 bool "Real time free running counter"
30
27config ARCH_OMAP2 31config ARCH_OMAP2
28 bool "TI OMAP2" 32 bool "TI OMAP2"
29 depends on ARCH_OMAP2PLUS 33 depends on ARCH_OMAP2PLUS
@@ -36,40 +40,44 @@ config ARCH_OMAP3
36 bool "TI OMAP3" 40 bool "TI OMAP3"
37 depends on ARCH_OMAP2PLUS 41 depends on ARCH_OMAP2PLUS
38 default y 42 default y
39 select CPU_V7
40 select USB_ARCH_HAS_EHCI if USB_SUPPORT
41 select ARCH_HAS_OPP 43 select ARCH_HAS_OPP
42 select PM_RUNTIME if CPU_IDLE
43 select PM_OPP if PM
44 select ARM_CPU_SUSPEND if PM 44 select ARM_CPU_SUSPEND if PM
45 select CPU_V7
45 select MULTI_IRQ_HANDLER 46 select MULTI_IRQ_HANDLER
47 select OMAP_INTERCONNECT
48 select PM_OPP if PM
49 select PM_RUNTIME if CPU_IDLE
46 select SOC_HAS_OMAP2_SDRC 50 select SOC_HAS_OMAP2_SDRC
51 select USB_ARCH_HAS_EHCI if USB_SUPPORT
47 52
48config ARCH_OMAP4 53config ARCH_OMAP4
49 bool "TI OMAP4" 54 bool "TI OMAP4"
50 default y 55 default y
51 depends on ARCH_OMAP2PLUS 56 depends on ARCH_OMAP2PLUS
57 select ARCH_HAS_OPP
58 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
59 select ARM_CPU_SUSPEND if PM
60 select ARM_ERRATA_720789
61 select ARM_GIC
52 select CACHE_L2X0 62 select CACHE_L2X0
53 select CPU_V7 63 select CPU_V7
54 select ARM_GIC
55 select HAVE_SMP 64 select HAVE_SMP
56 select LOCAL_TIMERS if SMP 65 select LOCAL_TIMERS if SMP
66 select OMAP_INTERCONNECT
57 select PL310_ERRATA_588369 67 select PL310_ERRATA_588369
58 select PL310_ERRATA_727915 68 select PL310_ERRATA_727915
59 select ARM_ERRATA_720789
60 select ARCH_HAS_OPP
61 select PM_RUNTIME if CPU_IDLE
62 select PM_OPP if PM 69 select PM_OPP if PM
70 select PM_RUNTIME if CPU_IDLE
63 select USB_ARCH_HAS_EHCI if USB_SUPPORT 71 select USB_ARCH_HAS_EHCI if USB_SUPPORT
64 select ARM_CPU_SUSPEND if PM
65 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
66 72
67config SOC_OMAP5 73config SOC_OMAP5
68 bool "TI OMAP5" 74 bool "TI OMAP5"
69 select CPU_V7 75 select ARM_ARCH_TIMER
76 select ARM_CPU_SUSPEND if PM
70 select ARM_GIC 77 select ARM_GIC
78 select CPU_V7
71 select HAVE_SMP 79 select HAVE_SMP
72 select ARM_CPU_SUSPEND if PM 80 select SOC_HAS_REALTIME_COUNTER
73 81
74comment "OMAP Core Type" 82comment "OMAP Core Type"
75 depends on ARCH_OMAP2 83 depends on ARCH_OMAP2
@@ -101,8 +109,8 @@ config SOC_TI81XX
101config SOC_AM33XX 109config SOC_AM33XX
102 bool "AM33XX support" 110 bool "AM33XX support"
103 default y 111 default y
104 select CPU_V7
105 select ARM_CPU_SUSPEND if PM 112 select ARM_CPU_SUSPEND if PM
113 select CPU_V7
106 select MULTI_IRQ_HANDLER 114 select MULTI_IRQ_HANDLER
107 115
108config OMAP_PACKAGE_ZAF 116config OMAP_PACKAGE_ZAF
@@ -149,8 +157,8 @@ config MACH_OMAP_H4
149 bool "OMAP 2420 H4 board" 157 bool "OMAP 2420 H4 board"
150 depends on SOC_OMAP2420 158 depends on SOC_OMAP2420
151 default y 159 default y
152 select OMAP_PACKAGE_ZAF
153 select OMAP_DEBUG_DEVICES 160 select OMAP_DEBUG_DEVICES
161 select OMAP_PACKAGE_ZAF
154 162
155config MACH_OMAP_APOLLON 163config MACH_OMAP_APOLLON
156 bool "OMAP 2420 Apollon board" 164 bool "OMAP 2420 Apollon board"
@@ -185,8 +193,8 @@ config MACH_OMAP_LDP
185config MACH_OMAP3530_LV_SOM 193config MACH_OMAP3530_LV_SOM
186 bool "OMAP3 Logic 3530 LV SOM board" 194 bool "OMAP3 Logic 3530 LV SOM board"
187 depends on ARCH_OMAP3 195 depends on ARCH_OMAP3
188 select OMAP_PACKAGE_CBB
189 default y 196 default y
197 select OMAP_PACKAGE_CBB
190 help 198 help
191 Support for the LogicPD OMAP3530 SOM Development kit 199 Support for the LogicPD OMAP3530 SOM Development kit
192 for full description please see the products webpage at 200 for full description please see the products webpage at
@@ -195,8 +203,8 @@ config MACH_OMAP3530_LV_SOM
195config MACH_OMAP3_TORPEDO 203config MACH_OMAP3_TORPEDO
196 bool "OMAP3 Logic 35x Torpedo board" 204 bool "OMAP3 Logic 35x Torpedo board"
197 depends on ARCH_OMAP3 205 depends on ARCH_OMAP3
198 select OMAP_PACKAGE_CBB
199 default y 206 default y
207 select OMAP_PACKAGE_CBB
200 help 208 help
201 Support for the LogicPD OMAP35x Torpedo Development kit 209 Support for the LogicPD OMAP35x Torpedo Development kit
202 for full description please see the products webpage at 210 for full description please see the products webpage at
@@ -232,10 +240,11 @@ config MACH_OMAP3_PANDORA
232 select OMAP_PACKAGE_CBB 240 select OMAP_PACKAGE_CBB
233 select REGULATOR_FIXED_VOLTAGE if REGULATOR 241 select REGULATOR_FIXED_VOLTAGE if REGULATOR
234 242
235config MACH_OMAP3_TOUCHBOOK 243config MACH_TOUCHBOOK
236 bool "OMAP3 Touch Book" 244 bool "OMAP3 Touch Book"
237 depends on ARCH_OMAP3 245 depends on ARCH_OMAP3
238 default y 246 default y
247 select OMAP_PACKAGE_CBB
239 248
240config MACH_OMAP_3430SDP 249config MACH_OMAP_3430SDP
241 bool "OMAP 3430 SDP board" 250 bool "OMAP 3430 SDP board"
@@ -256,17 +265,17 @@ config MACH_NOKIA_N8X0
256 bool "Nokia N800/N810" 265 bool "Nokia N800/N810"
257 depends on SOC_OMAP2420 266 depends on SOC_OMAP2420
258 default y 267 default y
259 select OMAP_PACKAGE_ZAC
260 select MACH_NOKIA_N800 268 select MACH_NOKIA_N800
261 select MACH_NOKIA_N810 269 select MACH_NOKIA_N810
262 select MACH_NOKIA_N810_WIMAX 270 select MACH_NOKIA_N810_WIMAX
271 select OMAP_PACKAGE_ZAC
263 272
264config MACH_NOKIA_RM680 273config MACH_NOKIA_RM680
265 bool "Nokia RM-680/696 board" 274 bool "Nokia RM-680/696 board"
266 depends on ARCH_OMAP3 275 depends on ARCH_OMAP3
267 default y 276 default y
268 select OMAP_PACKAGE_CBB
269 select MACH_NOKIA_RM696 277 select MACH_NOKIA_RM696
278 select OMAP_PACKAGE_CBB
270 279
271config MACH_NOKIA_RX51 280config MACH_NOKIA_RX51
272 bool "Nokia RX-51 board" 281 bool "Nokia RX-51 board"
@@ -279,20 +288,20 @@ config MACH_OMAP_ZOOM2
279 depends on ARCH_OMAP3 288 depends on ARCH_OMAP3
280 default y 289 default y
281 select OMAP_PACKAGE_CBB 290 select OMAP_PACKAGE_CBB
291 select REGULATOR_FIXED_VOLTAGE if REGULATOR
282 select SERIAL_8250 292 select SERIAL_8250
283 select SERIAL_CORE_CONSOLE
284 select SERIAL_8250_CONSOLE 293 select SERIAL_8250_CONSOLE
285 select REGULATOR_FIXED_VOLTAGE if REGULATOR 294 select SERIAL_CORE_CONSOLE
286 295
287config MACH_OMAP_ZOOM3 296config MACH_OMAP_ZOOM3
288 bool "OMAP3630 Zoom3 board" 297 bool "OMAP3630 Zoom3 board"
289 depends on ARCH_OMAP3 298 depends on ARCH_OMAP3
290 default y 299 default y
291 select OMAP_PACKAGE_CBP 300 select OMAP_PACKAGE_CBP
301 select REGULATOR_FIXED_VOLTAGE if REGULATOR
292 select SERIAL_8250 302 select SERIAL_8250
293 select SERIAL_CORE_CONSOLE
294 select SERIAL_8250_CONSOLE 303 select SERIAL_8250_CONSOLE
295 select REGULATOR_FIXED_VOLTAGE if REGULATOR 304 select SERIAL_CORE_CONSOLE
296 305
297config MACH_CM_T35 306config MACH_CM_T35
298 bool "CompuLab CM-T35/CM-T3730 modules" 307 bool "CompuLab CM-T35/CM-T3730 modules"
@@ -320,8 +329,8 @@ config MACH_IGEP0030
320 bool "IGEP OMAP3 module" 329 bool "IGEP OMAP3 module"
321 depends on ARCH_OMAP3 330 depends on ARCH_OMAP3
322 default y 331 default y
323 select OMAP_PACKAGE_CBB
324 select MACH_IGEP0020 332 select MACH_IGEP0020
333 select OMAP_PACKAGE_CBB
325 334
326config MACH_SBC3530 335config MACH_SBC3530
327 bool "OMAP3 SBC STALKER board" 336 bool "OMAP3 SBC STALKER board"
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index f6a24b3f9c4..fe40d9e488c 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -4,36 +4,30 @@
4 4
5# Common support 5# Common support
6obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \ 6obj-y := id.o io.o control.o mux.o devices.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 7 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o
8 8
9omap-2-3-common = irq.o 9# INTCPS IP block support - XXX should be moved to drivers/
10hwmod-common = omap_hwmod.o \ 10obj-$(CONFIG_ARCH_OMAP2) += irq.o
11 omap_hwmod_common_data.o 11obj-$(CONFIG_ARCH_OMAP3) += irq.o
12clock-common = clock.o clock_common_data.o \ 12obj-$(CONFIG_SOC_AM33XX) += irq.o
13 clkt_dpll.o clkt_clksel.o
14secure-common = omap-smc.o omap-secure.o
15 13
16obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) 14# Secure monitor API support
17obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common) 15obj-$(CONFIG_ARCH_OMAP3) += omap-smc.o omap-secure.o
18obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) $(secure-common) 16obj-$(CONFIG_ARCH_OMAP4) += omap-smc.o omap-secure.o
19obj-$(CONFIG_SOC_AM33XX) += irq.o $(hwmod-common) 17obj-$(CONFIG_SOC_OMAP5) += omap-smc.o omap-secure.o
20obj-$(CONFIG_SOC_OMAP5) += prm44xx.o $(hwmod-common) $(secure-common)
21 18
22ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),) 19ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),)
23obj-y += mcbsp.o 20obj-y += mcbsp.o
24endif 21endif
25 22
26obj-$(CONFIG_TWL4030_CORE) += omap_twl.o 23obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
27obj-$(CONFIG_SOC_HAS_OMAP2_SDRC) += sdrc.o
28 24
29# SMP support ONLY available for OMAP4 25# SMP support ONLY available for OMAP4
30 26
31obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o 27obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o
32obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o 28obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o
33omap-4-5-common = omap4-common.o omap-wakeupgen.o \ 29obj-$(CONFIG_ARCH_OMAP4) += omap4-common.o omap-wakeupgen.o
34 sleep44xx.o 30obj-$(CONFIG_SOC_OMAP5) += omap4-common.o omap-wakeupgen.o
35obj-$(CONFIG_ARCH_OMAP4) += $(omap-4-5-common)
36obj-$(CONFIG_SOC_OMAP5) += $(omap-4-5-common)
37 31
38plus_sec := $(call as-instr,.arch_extension sec,+sec) 32plus_sec := $(call as-instr,.arch_extension sec,+sec)
39AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec) 33AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec)
@@ -58,6 +52,7 @@ obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o
58# SMS/SDRC 52# SMS/SDRC
59obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o 53obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o
60# obj-$(CONFIG_ARCH_OMAP3) += sdrc3xxx.o 54# obj-$(CONFIG_ARCH_OMAP3) += sdrc3xxx.o
55obj-$(CONFIG_SOC_HAS_OMAP2_SDRC) += sdrc.o
61 56
62# OPP table initialization 57# OPP table initialization
63ifeq ($(CONFIG_PM_OPP),y) 58ifeq ($(CONFIG_PM_OPP),y)
@@ -68,15 +63,15 @@ endif
68 63
69# Power Management 64# Power Management
70ifeq ($(CONFIG_PM),y) 65ifeq ($(CONFIG_PM),y)
71obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o 66obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o sleep24xx.o
72obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o
73obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o 67obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o
74obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o omap-mpuss-lowpower.o 68obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o omap-mpuss-lowpower.o
75obj-$(CONFIG_SOC_OMAP5) += omap-mpuss-lowpower.o 69obj-$(CONFIG_ARCH_OMAP4) += sleep44xx.o
70obj-$(CONFIG_SOC_OMAP5) += omap-mpuss-lowpower.o sleep44xx.o
76obj-$(CONFIG_PM_DEBUG) += pm-debug.o 71obj-$(CONFIG_PM_DEBUG) += pm-debug.o
77 72
78obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o 73obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o
79obj-$(CONFIG_POWER_AVS_OMAP_CLASS3) += smartreflex-class3.o 74obj-$(CONFIG_POWER_AVS_OMAP_CLASS3) += smartreflex-class3.o
80 75
81AFLAGS_sleep24xx.o :=-Wa,-march=armv6 76AFLAGS_sleep24xx.o :=-Wa,-march=armv6
82AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a$(plus_sec) 77AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a$(plus_sec)
@@ -88,92 +83,76 @@ endif
88endif 83endif
89 84
90ifeq ($(CONFIG_CPU_IDLE),y) 85ifeq ($(CONFIG_CPU_IDLE),y)
91obj-$(CONFIG_ARCH_OMAP3) += cpuidle34xx.o 86obj-$(CONFIG_ARCH_OMAP3) += cpuidle34xx.o
92obj-$(CONFIG_ARCH_OMAP4) += cpuidle44xx.o 87obj-$(CONFIG_ARCH_OMAP4) += cpuidle44xx.o
93endif 88endif
94 89
95# PRCM 90# PRCM
96omap-prcm-4-5-common = prcm.o cminst44xx.o cm44xx.o \ 91obj-y += prcm.o prm_common.o
97 prcm_mpu44xx.o prminst44xx.o \ 92obj-$(CONFIG_ARCH_OMAP2) += cm2xxx_3xxx.o prm2xxx_3xxx.o
98 vc44xx_data.o vp44xx_data.o 93obj-$(CONFIG_ARCH_OMAP3) += cm2xxx_3xxx.o prm2xxx_3xxx.o
99obj-y += prm_common.o
100obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
101obj-$(CONFIG_ARCH_OMAP3) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
102obj-$(CONFIG_ARCH_OMAP3) += vc3xxx_data.o vp3xxx_data.o 94obj-$(CONFIG_ARCH_OMAP3) += vc3xxx_data.o vp3xxx_data.o
103obj-$(CONFIG_SOC_AM33XX) += prcm.o prm33xx.o cm33xx.o 95obj-$(CONFIG_SOC_AM33XX) += prm33xx.o cm33xx.o
104obj-$(CONFIG_ARCH_OMAP4) += $(omap-prcm-4-5-common) prm44xx.o 96omap-prcm-4-5-common = cminst44xx.o cm44xx.o prm44xx.o \
97 prcm_mpu44xx.o prminst44xx.o \
98 vc44xx_data.o vp44xx_data.o \
99 prm44xx.o
100obj-$(CONFIG_ARCH_OMAP4) += $(omap-prcm-4-5-common)
105obj-$(CONFIG_SOC_OMAP5) += $(omap-prcm-4-5-common) 101obj-$(CONFIG_SOC_OMAP5) += $(omap-prcm-4-5-common)
106 102
107# OMAP voltage domains 103# OMAP voltage domains
108voltagedomain-common := voltage.o vc.o vp.o 104obj-y += voltage.o vc.o vp.o
109obj-$(CONFIG_ARCH_OMAP2) += $(voltagedomain-common)
110obj-$(CONFIG_ARCH_OMAP2) += voltagedomains2xxx_data.o 105obj-$(CONFIG_ARCH_OMAP2) += voltagedomains2xxx_data.o
111obj-$(CONFIG_ARCH_OMAP3) += $(voltagedomain-common)
112obj-$(CONFIG_ARCH_OMAP3) += voltagedomains3xxx_data.o 106obj-$(CONFIG_ARCH_OMAP3) += voltagedomains3xxx_data.o
113obj-$(CONFIG_ARCH_OMAP4) += $(voltagedomain-common)
114obj-$(CONFIG_ARCH_OMAP4) += voltagedomains44xx_data.o 107obj-$(CONFIG_ARCH_OMAP4) += voltagedomains44xx_data.o
115obj-$(CONFIG_SOC_AM33XX) += $(voltagedomain-common) 108obj-$(CONFIG_SOC_AM33XX) += voltagedomains33xx_data.o
116obj-$(CONFIG_SOC_AM33XX) += voltagedomains33xx_data.o
117obj-$(CONFIG_SOC_OMAP5) += $(voltagedomain-common)
118 109
119# OMAP powerdomain framework 110# OMAP powerdomain framework
120powerdomain-common += powerdomain.o powerdomain-common.o 111obj-y += powerdomain.o powerdomain-common.o
121obj-$(CONFIG_ARCH_OMAP2) += $(powerdomain-common)
122obj-$(CONFIG_ARCH_OMAP2) += powerdomains2xxx_data.o 112obj-$(CONFIG_ARCH_OMAP2) += powerdomains2xxx_data.o
123obj-$(CONFIG_ARCH_OMAP2) += powerdomain2xxx_3xxx.o 113obj-$(CONFIG_ARCH_OMAP2) += powerdomain2xxx_3xxx.o
124obj-$(CONFIG_ARCH_OMAP2) += powerdomains2xxx_3xxx_data.o 114obj-$(CONFIG_ARCH_OMAP2) += powerdomains2xxx_3xxx_data.o
125obj-$(CONFIG_ARCH_OMAP3) += $(powerdomain-common)
126obj-$(CONFIG_ARCH_OMAP3) += powerdomain2xxx_3xxx.o 115obj-$(CONFIG_ARCH_OMAP3) += powerdomain2xxx_3xxx.o
127obj-$(CONFIG_ARCH_OMAP3) += powerdomains3xxx_data.o 116obj-$(CONFIG_ARCH_OMAP3) += powerdomains3xxx_data.o
128obj-$(CONFIG_ARCH_OMAP3) += powerdomains2xxx_3xxx_data.o 117obj-$(CONFIG_ARCH_OMAP3) += powerdomains2xxx_3xxx_data.o
129obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common)
130obj-$(CONFIG_ARCH_OMAP4) += powerdomain44xx.o 118obj-$(CONFIG_ARCH_OMAP4) += powerdomain44xx.o
131obj-$(CONFIG_ARCH_OMAP4) += powerdomains44xx_data.o 119obj-$(CONFIG_ARCH_OMAP4) += powerdomains44xx_data.o
132obj-$(CONFIG_SOC_AM33XX) += $(powerdomain-common)
133obj-$(CONFIG_SOC_AM33XX) += powerdomain33xx.o 120obj-$(CONFIG_SOC_AM33XX) += powerdomain33xx.o
134obj-$(CONFIG_SOC_AM33XX) += powerdomains33xx_data.o 121obj-$(CONFIG_SOC_AM33XX) += powerdomains33xx_data.o
135obj-$(CONFIG_SOC_OMAP5) += $(powerdomain-common)
136obj-$(CONFIG_SOC_OMAP5) += powerdomain44xx.o 122obj-$(CONFIG_SOC_OMAP5) += powerdomain44xx.o
137 123
138# PRCM clockdomain control 124# PRCM clockdomain control
139clockdomain-common += clockdomain.o 125obj-y += clockdomain.o
140obj-$(CONFIG_ARCH_OMAP2) += $(clockdomain-common)
141obj-$(CONFIG_ARCH_OMAP2) += clockdomain2xxx_3xxx.o 126obj-$(CONFIG_ARCH_OMAP2) += clockdomain2xxx_3xxx.o
142obj-$(CONFIG_ARCH_OMAP2) += clockdomains2xxx_3xxx_data.o 127obj-$(CONFIG_ARCH_OMAP2) += clockdomains2xxx_3xxx_data.o
143obj-$(CONFIG_SOC_OMAP2420) += clockdomains2420_data.o 128obj-$(CONFIG_SOC_OMAP2420) += clockdomains2420_data.o
144obj-$(CONFIG_SOC_OMAP2430) += clockdomains2430_data.o 129obj-$(CONFIG_SOC_OMAP2430) += clockdomains2430_data.o
145obj-$(CONFIG_ARCH_OMAP3) += $(clockdomain-common)
146obj-$(CONFIG_ARCH_OMAP3) += clockdomain2xxx_3xxx.o 130obj-$(CONFIG_ARCH_OMAP3) += clockdomain2xxx_3xxx.o
147obj-$(CONFIG_ARCH_OMAP3) += clockdomains2xxx_3xxx_data.o 131obj-$(CONFIG_ARCH_OMAP3) += clockdomains2xxx_3xxx_data.o
148obj-$(CONFIG_ARCH_OMAP3) += clockdomains3xxx_data.o 132obj-$(CONFIG_ARCH_OMAP3) += clockdomains3xxx_data.o
149obj-$(CONFIG_ARCH_OMAP4) += $(clockdomain-common)
150obj-$(CONFIG_ARCH_OMAP4) += clockdomain44xx.o 133obj-$(CONFIG_ARCH_OMAP4) += clockdomain44xx.o
151obj-$(CONFIG_ARCH_OMAP4) += clockdomains44xx_data.o 134obj-$(CONFIG_ARCH_OMAP4) += clockdomains44xx_data.o
152obj-$(CONFIG_SOC_AM33XX) += $(clockdomain-common)
153obj-$(CONFIG_SOC_AM33XX) += clockdomain33xx.o 135obj-$(CONFIG_SOC_AM33XX) += clockdomain33xx.o
154obj-$(CONFIG_SOC_AM33XX) += clockdomains33xx_data.o 136obj-$(CONFIG_SOC_AM33XX) += clockdomains33xx_data.o
155obj-$(CONFIG_SOC_OMAP5) += $(clockdomain-common)
156obj-$(CONFIG_SOC_OMAP5) += clockdomain44xx.o 137obj-$(CONFIG_SOC_OMAP5) += clockdomain44xx.o
157 138
158# Clock framework 139# Clock framework
159obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o 140obj-y += clock.o clock_common_data.o \
160obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_sys.o 141 clkt_dpll.o clkt_clksel.o
161obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpllcore.o 142obj-$(CONFIG_ARCH_OMAP2) += clock2xxx.o
143obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpllcore.o clkt2xxx_sys.o
162obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_virt_prcm_set.o 144obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_virt_prcm_set.o
163obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_apll.o clkt2xxx_osc.o 145obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_apll.o clkt2xxx_osc.o
164obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpll.o clkt_iclk.o 146obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpll.o clkt_iclk.o
165obj-$(CONFIG_SOC_OMAP2420) += clock2420_data.o 147obj-$(CONFIG_SOC_OMAP2420) += clock2420_data.o
166obj-$(CONFIG_SOC_OMAP2430) += clock2430.o clock2430_data.o 148obj-$(CONFIG_SOC_OMAP2430) += clock2430.o clock2430_data.o
167obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o 149obj-$(CONFIG_ARCH_OMAP3) += clock3xxx.o
168obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clkt34xx_dpll3m2.o 150obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clkt34xx_dpll3m2.o
169obj-$(CONFIG_ARCH_OMAP3) += clock3517.o clock36xx.o 151obj-$(CONFIG_ARCH_OMAP3) += clock3517.o clock36xx.o clkt_iclk.o
170obj-$(CONFIG_ARCH_OMAP3) += dpll3xxx.o clock3xxx_data.o 152obj-$(CONFIG_ARCH_OMAP3) += dpll3xxx.o clock3xxx_data.o
171obj-$(CONFIG_ARCH_OMAP3) += clkt_iclk.o 153obj-$(CONFIG_ARCH_OMAP4) += clock44xx_data.o
172obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o
173obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o dpll44xx.o 154obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o dpll44xx.o
174obj-$(CONFIG_SOC_AM33XX) += $(clock-common) dpll3xxx.o 155obj-$(CONFIG_SOC_AM33XX) += dpll3xxx.o clock33xx_data.o
175obj-$(CONFIG_SOC_AM33XX) += clock33xx_data.o
176obj-$(CONFIG_SOC_OMAP5) += $(clock-common)
177obj-$(CONFIG_SOC_OMAP5) += dpll3xxx.o dpll44xx.o 156obj-$(CONFIG_SOC_OMAP5) += dpll3xxx.o dpll44xx.o
178 157
179# OMAP2 clock rate set data (old "OPP" data) 158# OMAP2 clock rate set data (old "OPP" data)
@@ -181,6 +160,7 @@ obj-$(CONFIG_SOC_OMAP2420) += opp2420_data.o
181obj-$(CONFIG_SOC_OMAP2430) += opp2430_data.o 160obj-$(CONFIG_SOC_OMAP2430) += opp2430_data.o
182 161
183# hwmod data 162# hwmod data
163obj-y += omap_hwmod_common_data.o
184obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_ipblock_data.o 164obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_ipblock_data.o
185obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_3xxx_ipblock_data.o 165obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_3xxx_ipblock_data.o
186obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_interconnect_data.o 166obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_interconnect_data.o
@@ -194,15 +174,12 @@ obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2430_data.o
194obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_2xxx_3xxx_ipblock_data.o 174obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_2xxx_3xxx_ipblock_data.o
195obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_2xxx_3xxx_interconnect_data.o 175obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_2xxx_3xxx_interconnect_data.o
196obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o 176obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o
177obj-$(CONFIG_SOC_AM33XX) += omap_hwmod_33xx_data.o
197obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o 178obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o
198 179
199# EMU peripherals 180# EMU peripherals
200obj-$(CONFIG_OMAP3_EMU) += emu.o 181obj-$(CONFIG_OMAP3_EMU) += emu.o
201 182obj-$(CONFIG_HW_PERF_EVENTS) += pmu.o
202# L3 interconnect
203obj-$(CONFIG_ARCH_OMAP3) += omap_l3_smx.o
204obj-$(CONFIG_ARCH_OMAP4) += omap_l3_noc.o
205obj-$(CONFIG_SOC_OMAP5) += omap_l3_noc.o
206 183
207obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o 184obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
208mailbox_mach-objs := mailbox.o 185mailbox_mach-objs := mailbox.o
@@ -229,10 +206,10 @@ obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
229obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o 206obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o
230obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o 207obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o
231obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o 208obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o
232obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o 209obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o
233obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o 210obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o
234obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o 211obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o
235obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o 212obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o
236obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o 213obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o
237obj-$(CONFIG_MACH_OVERO) += board-overo.o 214obj-$(CONFIG_MACH_OVERO) += board-overo.o
238obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o 215obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o
@@ -255,7 +232,7 @@ obj-$(CONFIG_MACH_OMAP_3630SDP) += board-zoom-display.o
255obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o 232obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o
256obj-$(CONFIG_MACH_CM_T3517) += board-cm-t3517.o 233obj-$(CONFIG_MACH_CM_T3517) += board-cm-t3517.o
257obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o 234obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o
258obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o 235obj-$(CONFIG_MACH_TOUCHBOOK) += board-omap3touchbook.o
259obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o 236obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o
260obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o 237obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o
261 238
diff --git a/arch/arm/plat-omap/include/plat/am33xx.h b/arch/arm/mach-omap2/am33xx.h
index 06c19bb7bca..06c19bb7bca 100644
--- a/arch/arm/plat-omap/include/plat/am33xx.h
+++ b/arch/arm/mach-omap2/am33xx.h
diff --git a/arch/arm/mach-omap2/am35xx-emac.c b/arch/arm/mach-omap2/am35xx-emac.c
index 2c90ac68668..d0c54c573d3 100644
--- a/arch/arm/mach-omap2/am35xx-emac.c
+++ b/arch/arm/mach-omap2/am35xx-emac.c
@@ -19,7 +19,7 @@
19#include <linux/davinci_emac.h> 19#include <linux/davinci_emac.h>
20#include <asm/system.h> 20#include <asm/system.h>
21#include <plat/omap_device.h> 21#include <plat/omap_device.h>
22#include <mach/am35xx.h> 22#include "am35xx.h"
23#include "control.h" 23#include "control.h"
24#include "am35xx-emac.h" 24#include "am35xx-emac.h"
25 25
diff --git a/arch/arm/mach-omap2/include/mach/am35xx.h b/arch/arm/mach-omap2/am35xx.h
index 95594495fcf..95594495fcf 100644
--- a/arch/arm/mach-omap2/include/mach/am35xx.h
+++ b/arch/arm/mach-omap2/am35xx.h
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 9511584fdc4..95b384d54f8 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -33,11 +33,10 @@
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 34#include <asm/mach/map.h>
35 35
36#include <plat/board.h>
37#include "common.h" 36#include "common.h"
38#include <plat/gpmc.h> 37#include <plat/gpmc.h>
39#include <plat/usb.h> 38#include <plat/usb.h>
40#include <plat/gpmc-smc91x.h> 39#include "gpmc-smc91x.h"
41 40
42#include <video/omapdss.h> 41#include <video/omapdss.h>
43#include <video/omap-panel-generic-dpi.h> 42#include <video/omap-panel-generic-dpi.h>
@@ -212,9 +211,6 @@ static struct regulator_init_data sdp2430_vmmc1 = {
212}; 211};
213 212
214static struct twl4030_gpio_platform_data sdp2430_gpio_data = { 213static struct twl4030_gpio_platform_data sdp2430_gpio_data = {
215 .gpio_base = OMAP_MAX_GPIO_LINES,
216 .irq_base = TWL4030_GPIO_IRQ_BASE,
217 .irq_end = TWL4030_GPIO_IRQ_END,
218}; 214};
219 215
220static struct twl4030_platform_data sdp2430_twldata = { 216static struct twl4030_platform_data sdp2430_twldata = {
@@ -235,7 +231,7 @@ static int __init omap2430_i2c_init(void)
235 sdp2430_i2c1_boardinfo[0].irq = gpio_to_irq(78); 231 sdp2430_i2c1_boardinfo[0].irq = gpio_to_irq(78);
236 omap_register_i2c_bus(1, 100, sdp2430_i2c1_boardinfo, 232 omap_register_i2c_bus(1, 100, sdp2430_i2c1_boardinfo,
237 ARRAY_SIZE(sdp2430_i2c1_boardinfo)); 233 ARRAY_SIZE(sdp2430_i2c1_boardinfo));
238 omap_pmic_init(2, 100, "twl4030", INT_24XX_SYS_NIRQ, 234 omap_pmic_init(2, 100, "twl4030", 7 + OMAP_INTC_START,
239 &sdp2430_twldata); 235 &sdp2430_twldata);
240 return 0; 236 return 0;
241} 237}
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index a98c688058a..96cd3693e1a 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -24,14 +24,12 @@
24#include <linux/io.h> 24#include <linux/io.h>
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 28
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/mach/map.h> 31#include <asm/mach/map.h>
32 32
33#include <plat/mcspi.h>
34#include <plat/board.h>
35#include <plat/usb.h> 33#include <plat/usb.h>
36#include "common.h" 34#include "common.h"
37#include <plat/dma.h> 35#include <plat/dma.h>
@@ -39,7 +37,7 @@
39#include <video/omapdss.h> 37#include <video/omapdss.h>
40#include <video/omap-panel-tfp410.h> 38#include <video/omap-panel-tfp410.h>
41 39
42#include <plat/gpmc-smc91x.h> 40#include "gpmc-smc91x.h"
43 41
44#include "board-flash.h" 42#include "board-flash.h"
45#include "mux.h" 43#include "mux.h"
@@ -191,9 +189,6 @@ static struct omap_dss_board_info sdp3430_dss_data = {
191 .default_device = &sdp3430_lcd_device, 189 .default_device = &sdp3430_lcd_device,
192}; 190};
193 191
194static struct omap_board_config_kernel sdp3430_config[] __initdata = {
195};
196
197static struct omap2_hsmmc_info mmc[] = { 192static struct omap2_hsmmc_info mmc[] = {
198 { 193 {
199 .mmc = 1, 194 .mmc = 1,
@@ -233,9 +228,6 @@ static int sdp3430_twl_gpio_setup(struct device *dev,
233} 228}
234 229
235static struct twl4030_gpio_platform_data sdp3430_gpio_data = { 230static struct twl4030_gpio_platform_data sdp3430_gpio_data = {
236 .gpio_base = OMAP_MAX_GPIO_LINES,
237 .irq_base = TWL4030_GPIO_IRQ_BASE,
238 .irq_end = TWL4030_GPIO_IRQ_END,
239 .pulldowns = BIT(2) | BIT(6) | BIT(8) | BIT(13) 231 .pulldowns = BIT(2) | BIT(6) | BIT(8) | BIT(13)
240 | BIT(16) | BIT(17), 232 | BIT(16) | BIT(17),
241 .setup = sdp3430_twl_gpio_setup, 233 .setup = sdp3430_twl_gpio_setup,
@@ -576,8 +568,6 @@ static void __init omap_3430sdp_init(void)
576 int gpio_pendown; 568 int gpio_pendown;
577 569
578 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 570 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
579 omap_board_config = sdp3430_config;
580 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
581 omap_hsmmc_init(mmc); 571 omap_hsmmc_init(mmc);
582 omap3430_i2c_init(); 572 omap3430_i2c_init();
583 omap_display_init(&sdp3430_dss_data); 573 omap_display_init(&sdp3430_dss_data);
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 2dc9ba523c7..fc224ad8674 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -17,8 +17,7 @@
17#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
18 18
19#include "common.h" 19#include "common.h"
20#include <plat/board.h> 20#include "gpmc-smc91x.h"
21#include <plat/gpmc-smc91x.h>
22#include <plat/usb.h> 21#include <plat/usb.h>
23 22
24#include <mach/board-zoom.h> 23#include <mach/board-zoom.h>
@@ -67,9 +66,6 @@ static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
67 .reset_gpio_port[2] = -EINVAL 66 .reset_gpio_port[2] = -EINVAL
68}; 67};
69 68
70static struct omap_board_config_kernel sdp_config[] __initdata = {
71};
72
73#ifdef CONFIG_OMAP_MUX 69#ifdef CONFIG_OMAP_MUX
74static struct omap_board_mux board_mux[] __initdata = { 70static struct omap_board_mux board_mux[] __initdata = {
75 { .reg_offset = OMAP_MUX_TERMINATOR }, 71 { .reg_offset = OMAP_MUX_TERMINATOR },
@@ -197,8 +193,6 @@ static struct flash_partitions sdp_flash_partitions[] = {
197static void __init omap_sdp_init(void) 193static void __init omap_sdp_init(void)
198{ 194{
199 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); 195 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
200 omap_board_config = sdp_config;
201 omap_board_config_size = ARRAY_SIZE(sdp_config);
202 zoom_peripherals_init(); 196 zoom_peripherals_init();
203 omap_sdrc_init(h8mbx00u0mer0em_sdrc_params, 197 omap_sdrc_init(h8mbx00u0mer0em_sdrc_params,
204 h8mbx00u0mer0em_sdrc_params); 198 h8mbx00u0mer0em_sdrc_params);
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index ad8a7d94afc..3669c120c7e 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -28,23 +28,22 @@
28#include <linux/leds_pwm.h> 28#include <linux/leds_pwm.h>
29#include <linux/platform_data/omap4-keypad.h> 29#include <linux/platform_data/omap4-keypad.h>
30 30
31#include <mach/hardware.h>
32#include <asm/hardware/gic.h> 31#include <asm/hardware/gic.h>
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
35#include <asm/mach/map.h> 34#include <asm/mach/map.h>
36 35
37#include <plat/board.h>
38#include "common.h" 36#include "common.h"
39#include <plat/usb.h> 37#include <plat/usb.h>
40#include <plat/mmc.h> 38#include <plat/mmc.h>
41#include <plat/omap4-keypad.h> 39#include "omap4-keypad.h"
42#include <video/omapdss.h> 40#include <video/omapdss.h>
43#include <video/omap-panel-nokia-dsi.h> 41#include <video/omap-panel-nokia-dsi.h>
44#include <video/omap-panel-picodlp.h> 42#include <video/omap-panel-picodlp.h>
45#include <linux/wl12xx.h> 43#include <linux/wl12xx.h>
46#include <linux/platform_data/omap-abe-twl6040.h> 44#include <linux/platform_data/omap-abe-twl6040.h>
47 45
46#include "soc.h"
48#include "mux.h" 47#include "mux.h"
49#include "hsmmc.h" 48#include "hsmmc.h"
50#include "control.h" 49#include "control.h"
@@ -544,7 +543,14 @@ static struct twl6040_platform_data twl6040_data = {
544 .codec = &twl6040_codec, 543 .codec = &twl6040_codec,
545 .vibra = &twl6040_vibra, 544 .vibra = &twl6040_vibra,
546 .audpwron_gpio = 127, 545 .audpwron_gpio = 127,
547 .irq_base = TWL6040_CODEC_IRQ_BASE, 546};
547
548static struct i2c_board_info __initdata sdp4430_i2c_1_boardinfo[] = {
549 {
550 I2C_BOARD_INFO("twl6040", 0x4b),
551 .irq = 119 + OMAP44XX_IRQ_GIC_START,
552 .platform_data = &twl6040_data,
553 },
548}; 554};
549 555
550static struct twl4030_platform_data sdp4430_twldata = { 556static struct twl4030_platform_data sdp4430_twldata = {
@@ -580,8 +586,8 @@ static int __init omap4_i2c_init(void)
580 TWL_COMMON_REGULATOR_CLK32KG | 586 TWL_COMMON_REGULATOR_CLK32KG |
581 TWL_COMMON_REGULATOR_V1V8 | 587 TWL_COMMON_REGULATOR_V1V8 |
582 TWL_COMMON_REGULATOR_V2V1); 588 TWL_COMMON_REGULATOR_V2V1);
583 omap4_pmic_init("twl6030", &sdp4430_twldata, 589 omap4_pmic_init("twl6030", &sdp4430_twldata, sdp4430_i2c_1_boardinfo,
584 &twl6040_data, OMAP44XX_IRQ_SYS_2N); 590 ARRAY_SIZE(sdp4430_i2c_1_boardinfo));
585 omap_register_i2c_bus(2, 400, NULL, 0); 591 omap_register_i2c_bus(2, 400, NULL, 0);
586 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, 592 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
587 ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); 593 ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
@@ -601,29 +607,6 @@ static void __init omap_sfh7741prox_init(void)
601 __func__, OMAP4_SFH7741_ENABLE_GPIO, error); 607 __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
602} 608}
603 609
604static struct gpio sdp4430_hdmi_gpios[] = {
605 { HDMI_GPIO_CT_CP_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ct_cp_hpd" },
606 { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
607 { HDMI_GPIO_HPD, GPIOF_DIR_IN, "hdmi_gpio_hpd" },
608};
609
610static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
611{
612 int status;
613
614 status = gpio_request_array(sdp4430_hdmi_gpios,
615 ARRAY_SIZE(sdp4430_hdmi_gpios));
616 if (status)
617 pr_err("%s: Cannot request HDMI GPIOs\n", __func__);
618
619 return status;
620}
621
622static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)
623{
624 gpio_free_array(sdp4430_hdmi_gpios, ARRAY_SIZE(sdp4430_hdmi_gpios));
625}
626
627static struct nokia_dsi_panel_data dsi1_panel = { 610static struct nokia_dsi_panel_data dsi1_panel = {
628 .name = "taal", 611 .name = "taal",
629 .reset_gpio = 102, 612 .reset_gpio = 102,
@@ -644,29 +627,6 @@ static struct omap_dss_device sdp4430_lcd_device = {
644 .phy.dsi = { 627 .phy.dsi = {
645 .module = 0, 628 .module = 0,
646 }, 629 },
647
648 .clocks = {
649 .dispc = {
650 .channel = {
651 /* Logic Clock = 172.8 MHz */
652 .lck_div = 1,
653 /* Pixel Clock = 34.56 MHz */
654 .pck_div = 5,
655 .lcd_clk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC,
656 },
657 .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,
658 },
659
660 .dsi = {
661 .regn = 16, /* Fint = 2.4 MHz */
662 .regm = 180, /* DDR Clock = 216 MHz */
663 .regm_dispc = 5, /* PLL1_CLK1 = 172.8 MHz */
664 .regm_dsi = 5, /* PLL1_CLK2 = 172.8 MHz */
665
666 .lp_clk_div = 10, /* LP Clock = 8.64 MHz */
667 .dsi_fclk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI,
668 },
669 },
670 .channel = OMAP_DSS_CHANNEL_LCD, 630 .channel = OMAP_DSS_CHANNEL_LCD,
671}; 631};
672 632
@@ -691,33 +651,12 @@ static struct omap_dss_device sdp4430_lcd2_device = {
691 651
692 .module = 1, 652 .module = 1,
693 }, 653 },
694
695 .clocks = {
696 .dispc = {
697 .channel = {
698 /* Logic Clock = 172.8 MHz */
699 .lck_div = 1,
700 /* Pixel Clock = 34.56 MHz */
701 .pck_div = 5,
702 .lcd_clk_src = OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC,
703 },
704 .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,
705 },
706
707 .dsi = {
708 .regn = 16, /* Fint = 2.4 MHz */
709 .regm = 180, /* DDR Clock = 216 MHz */
710 .regm_dispc = 5, /* PLL1_CLK1 = 172.8 MHz */
711 .regm_dsi = 5, /* PLL1_CLK2 = 172.8 MHz */
712
713 .lp_clk_div = 10, /* LP Clock = 8.64 MHz */
714 .dsi_fclk_src = OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI,
715 },
716 },
717 .channel = OMAP_DSS_CHANNEL_LCD2, 654 .channel = OMAP_DSS_CHANNEL_LCD2,
718}; 655};
719 656
720static struct omap_dss_hdmi_data sdp4430_hdmi_data = { 657static struct omap_dss_hdmi_data sdp4430_hdmi_data = {
658 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
659 .ls_oe_gpio = HDMI_GPIO_LS_OE,
721 .hpd_gpio = HDMI_GPIO_HPD, 660 .hpd_gpio = HDMI_GPIO_HPD,
722}; 661};
723 662
@@ -725,8 +664,6 @@ static struct omap_dss_device sdp4430_hdmi_device = {
725 .name = "hdmi", 664 .name = "hdmi",
726 .driver_name = "hdmi_panel", 665 .driver_name = "hdmi_panel",
727 .type = OMAP_DISPLAY_TYPE_HDMI, 666 .type = OMAP_DISPLAY_TYPE_HDMI,
728 .platform_enable = sdp4430_panel_enable_hdmi,
729 .platform_disable = sdp4430_panel_disable_hdmi,
730 .channel = OMAP_DSS_CHANNEL_DIGIT, 667 .channel = OMAP_DSS_CHANNEL_DIGIT,
731 .data = &sdp4430_hdmi_data, 668 .data = &sdp4430_hdmi_data,
732}; 669};
@@ -824,6 +761,32 @@ static struct omap_board_mux board_mux[] __initdata = {
824 /* NIRQ2 for twl6040 */ 761 /* NIRQ2 for twl6040 */
825 OMAP4_MUX(SYS_NIRQ2, OMAP_MUX_MODE0 | 762 OMAP4_MUX(SYS_NIRQ2, OMAP_MUX_MODE0 |
826 OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE), 763 OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE),
764 /* GPIO_127 for twl6040 */
765 OMAP4_MUX(HDQ_SIO, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
766 /* McPDM */
767 OMAP4_MUX(ABE_PDM_UL_DATA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
768 OMAP4_MUX(ABE_PDM_DL_DATA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
769 OMAP4_MUX(ABE_PDM_FRAME, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
770 OMAP4_MUX(ABE_PDM_LB_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
771 OMAP4_MUX(ABE_CLKS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
772 /* DMIC */
773 OMAP4_MUX(ABE_DMIC_CLK1, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
774 OMAP4_MUX(ABE_DMIC_DIN1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
775 OMAP4_MUX(ABE_DMIC_DIN2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
776 OMAP4_MUX(ABE_DMIC_DIN3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
777 /* McBSP1 */
778 OMAP4_MUX(ABE_MCBSP1_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
779 OMAP4_MUX(ABE_MCBSP1_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
780 OMAP4_MUX(ABE_MCBSP1_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT |
781 OMAP_PULL_ENA),
782 OMAP4_MUX(ABE_MCBSP1_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
783 /* McBSP2 */
784 OMAP4_MUX(ABE_MCBSP2_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
785 OMAP4_MUX(ABE_MCBSP2_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
786 OMAP4_MUX(ABE_MCBSP2_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT |
787 OMAP_PULL_ENA),
788 OMAP4_MUX(ABE_MCBSP2_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
789
827 { .reg_offset = OMAP_MUX_TERMINATOR }, 790 { .reg_offset = OMAP_MUX_TERMINATOR },
828}; 791};
829 792
@@ -909,6 +872,7 @@ static void __init omap_4430sdp_init(void)
909MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") 872MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
910 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */ 873 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
911 .atag_offset = 0x100, 874 .atag_offset = 0x100,
875 .smp = smp_ops(omap4_smp_ops),
912 .reserve = omap_reserve, 876 .reserve = omap_reserve,
913 .map_io = omap4_map_io, 877 .map_io = omap4_map_io,
914 .init_early = omap4430_init_early, 878 .init_early = omap4430_init_early,
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index 92432c28673..318feadb1d6 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -21,12 +21,10 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23 23
24#include <mach/hardware.h>
25#include <asm/mach-types.h> 24#include <asm/mach-types.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 27
29#include <plat/board.h>
30#include "common.h" 28#include "common.h"
31#include <plat/usb.h> 29#include <plat/usb.h>
32 30
@@ -37,11 +35,6 @@
37#define GPIO_USB_POWER 35 35#define GPIO_USB_POWER 35
38#define GPIO_USB_NRESET 38 36#define GPIO_USB_NRESET 38
39 37
40
41/* Board initialization */
42static struct omap_board_config_kernel am3517_crane_config[] __initdata = {
43};
44
45#ifdef CONFIG_OMAP_MUX 38#ifdef CONFIG_OMAP_MUX
46static struct omap_board_mux board_mux[] __initdata = { 39static struct omap_board_mux board_mux[] __initdata = {
47 { .reg_offset = OMAP_MUX_TERMINATOR }, 40 { .reg_offset = OMAP_MUX_TERMINATOR },
@@ -67,9 +60,6 @@ static void __init am3517_crane_init(void)
67 omap_serial_init(); 60 omap_serial_init();
68 omap_sdrc_init(NULL, NULL); 61 omap_sdrc_init(NULL, NULL);
69 62
70 omap_board_config = am3517_crane_config;
71 omap_board_config_size = ARRAY_SIZE(am3517_crane_config);
72
73 /* Configure GPIO for EHCI port */ 63 /* Configure GPIO for EHCI port */
74 if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) { 64 if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) {
75 pr_err("Can not configure mux for GPIO_USB_NRESET %d\n", 65 pr_err("Can not configure mux for GPIO_USB_NRESET %d\n",
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 18f601096ce..e16289755f2 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -25,14 +25,13 @@
25#include <linux/can/platform/ti_hecc.h> 25#include <linux/can/platform/ti_hecc.h>
26#include <linux/davinci_emac.h> 26#include <linux/davinci_emac.h>
27#include <linux/mmc/host.h> 27#include <linux/mmc/host.h>
28#include <linux/platform_data/gpio-omap.h>
28 29
29#include <mach/hardware.h> 30#include "am35xx.h"
30#include <mach/am35xx.h>
31#include <asm/mach-types.h> 31#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34 34
35#include <plat/board.h>
36#include "common.h" 35#include "common.h"
37#include <plat/usb.h> 36#include <plat/usb.h>
38#include <video/omapdss.h> 37#include <video/omapdss.h>
@@ -264,6 +263,16 @@ static __init void am3517_evm_musb_init(void)
264 usb_musb_init(&musb_board_data); 263 usb_musb_init(&musb_board_data);
265} 264}
266 265
266static __init void am3517_evm_mcbsp1_init(void)
267{
268 u32 devconf0;
269
270 /* McBSP1 CLKR/FSR signal to be connected to CLKX/FSX pin */
271 devconf0 = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
272 devconf0 |= OMAP2_MCBSP1_CLKR_MASK | OMAP2_MCBSP1_FSR_MASK;
273 omap_ctrl_writel(devconf0, OMAP2_CONTROL_DEVCONF0);
274}
275
267static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 276static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
268 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 277 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
269#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \ 278#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
@@ -296,8 +305,7 @@ static struct resource am3517_hecc_resources[] = {
296 .flags = IORESOURCE_MEM, 305 .flags = IORESOURCE_MEM,
297 }, 306 },
298 { 307 {
299 .start = INT_35XX_HECC0_IRQ, 308 .start = 24 + OMAP_INTC_START,
300 .end = INT_35XX_HECC0_IRQ,
301 .flags = IORESOURCE_IRQ, 309 .flags = IORESOURCE_IRQ,
302 }, 310 },
303}; 311};
@@ -324,9 +332,6 @@ static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata)
324 platform_device_register(&am3517_hecc_device); 332 platform_device_register(&am3517_hecc_device);
325} 333}
326 334
327static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
328};
329
330static struct omap2_hsmmc_info mmc[] = { 335static struct omap2_hsmmc_info mmc[] = {
331 { 336 {
332 .mmc = 1, 337 .mmc = 1,
@@ -346,8 +351,6 @@ static struct omap2_hsmmc_info mmc[] = {
346 351
347static void __init am3517_evm_init(void) 352static void __init am3517_evm_init(void)
348{ 353{
349 omap_board_config = am3517_evm_config;
350 omap_board_config_size = ARRAY_SIZE(am3517_evm_config);
351 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 354 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
352 355
353 am3517_evm_i2c_init(); 356 am3517_evm_i2c_init();
@@ -373,6 +376,9 @@ static void __init am3517_evm_init(void)
373 /* MUSB */ 376 /* MUSB */
374 am3517_evm_musb_init(); 377 am3517_evm_musb_init();
375 378
379 /* McBSP1 */
380 am3517_evm_mcbsp1_init();
381
376 /* MMC init function */ 382 /* MMC init function */
377 omap_hsmmc_init(mmc); 383 omap_hsmmc_init(mmc);
378} 384}
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index e5fa46bfde2..cea3abace81 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -29,13 +29,11 @@
29#include <linux/smc91x.h> 29#include <linux/smc91x.h>
30#include <linux/gpio.h> 30#include <linux/gpio.h>
31 31
32#include <mach/hardware.h>
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
35#include <asm/mach/flash.h> 34#include <asm/mach/flash.h>
36 35
37#include <plat/led.h> 36#include <plat/led.h>
38#include <plat/board.h>
39#include "common.h" 37#include "common.h"
40#include <plat/gpmc.h> 38#include <plat/gpmc.h>
41 39
@@ -204,7 +202,7 @@ static inline void __init apollon_init_smc91x(void)
204 return; 202 return;
205 } 203 }
206 204
207 clk_enable(gpmc_fck); 205 clk_prepare_enable(gpmc_fck);
208 rate = clk_get_rate(gpmc_fck); 206 rate = clk_get_rate(gpmc_fck);
209 207
210 eth_cs = APOLLON_ETH_CS; 208 eth_cs = APOLLON_ETH_CS;
@@ -248,7 +246,7 @@ static inline void __init apollon_init_smc91x(void)
248 gpmc_cs_free(APOLLON_ETH_CS); 246 gpmc_cs_free(APOLLON_ETH_CS);
249 } 247 }
250out: 248out:
251 clk_disable(gpmc_fck); 249 clk_disable_unprepare(gpmc_fck);
252 clk_put(gpmc_fck); 250 clk_put(gpmc_fck);
253} 251}
254 252
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 97d719047af..376d26eb601 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -23,6 +23,7 @@
23#include <linux/input/matrix_keypad.h> 23#include <linux/input/matrix_keypad.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/platform_data/gpio-omap.h>
26 27
27#include <linux/i2c/at24.h> 28#include <linux/i2c/at24.h>
28#include <linux/i2c/twl.h> 29#include <linux/i2c/twl.h>
@@ -37,15 +38,14 @@
37#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
38#include <asm/mach/map.h> 39#include <asm/mach/map.h>
39 40
40#include <plat/board.h>
41#include "common.h" 41#include "common.h"
42#include <plat/nand.h> 42#include <linux/platform_data/mtd-nand-omap2.h>
43#include <plat/gpmc.h> 43#include <plat/gpmc.h>
44#include <plat/usb.h> 44#include <plat/usb.h>
45#include <video/omapdss.h> 45#include <video/omapdss.h>
46#include <video/omap-panel-generic-dpi.h> 46#include <video/omap-panel-generic-dpi.h>
47#include <video/omap-panel-tfp410.h> 47#include <video/omap-panel-tfp410.h>
48#include <plat/mcspi.h> 48#include <linux/platform_data/spi-omap2-mcspi.h>
49 49
50#include <mach/hardware.h> 50#include <mach/hardware.h>
51 51
@@ -64,7 +64,7 @@
64 64
65#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 65#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
66#include <linux/smsc911x.h> 66#include <linux/smsc911x.h>
67#include <plat/gpmc-smsc911x.h> 67#include "gpmc-smsc911x.h"
68 68
69static struct omap_smsc911x_platform_data cm_t35_smsc911x_cfg = { 69static struct omap_smsc911x_platform_data cm_t35_smsc911x_cfg = {
70 .id = 0, 70 .id = 0,
@@ -470,9 +470,6 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio,
470} 470}
471 471
472static struct twl4030_gpio_platform_data cm_t35_gpio_data = { 472static struct twl4030_gpio_platform_data cm_t35_gpio_data = {
473 .gpio_base = OMAP_MAX_GPIO_LINES,
474 .irq_base = TWL4030_GPIO_IRQ_BASE,
475 .irq_end = TWL4030_GPIO_IRQ_END,
476 .setup = cm_t35_twl_gpio_setup, 473 .setup = cm_t35_twl_gpio_setup,
477}; 474};
478 475
@@ -714,13 +711,8 @@ static inline void cm_t35_init_mux(void) {}
714static inline void cm_t3730_init_mux(void) {} 711static inline void cm_t3730_init_mux(void) {}
715#endif 712#endif
716 713
717static struct omap_board_config_kernel cm_t35_config[] __initdata = {
718};
719
720static void __init cm_t3x_common_init(void) 714static void __init cm_t3x_common_init(void)
721{ 715{
722 omap_board_config = cm_t35_config;
723 omap_board_config_size = ARRAY_SIZE(cm_t35_config);
724 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); 716 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
725 omap_serial_init(); 717 omap_serial_init();
726 omap_sdrc_init(mt46h32m32lf6_sdrc_params, 718 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
@@ -731,6 +723,7 @@ static void __init cm_t3x_common_init(void)
731 cm_t35_init_ethernet(); 723 cm_t35_init_ethernet();
732 cm_t35_init_led(); 724 cm_t35_init_led();
733 cm_t35_init_display(); 725 cm_t35_init_display();
726 omap_twl4030_audio_init("cm-t3x");
734 727
735 usb_musb_init(NULL); 728 usb_musb_init(NULL);
736 cm_t35_init_usbh(); 729 cm_t35_init_usbh();
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index a33ad4641d9..59c0a45f75b 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -38,13 +38,12 @@
38#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
39#include <asm/mach/map.h> 39#include <asm/mach/map.h>
40 40
41#include <plat/board.h>
42#include "common.h" 41#include "common.h"
43#include <plat/usb.h> 42#include <plat/usb.h>
44#include <plat/nand.h> 43#include <linux/platform_data/mtd-nand-omap2.h>
45#include <plat/gpmc.h> 44#include <plat/gpmc.h>
46 45
47#include <mach/am35xx.h> 46#include "am35xx.h"
48 47
49#include "mux.h" 48#include "mux.h"
50#include "control.h" 49#include "control.h"
@@ -90,8 +89,7 @@ static struct resource cm_t3517_hecc_resources[] = {
90 .flags = IORESOURCE_MEM, 89 .flags = IORESOURCE_MEM,
91 }, 90 },
92 { 91 {
93 .start = INT_35XX_HECC0_IRQ, 92 .start = 24 + OMAP_INTC_START,
94 .end = INT_35XX_HECC0_IRQ,
95 .flags = IORESOURCE_IRQ, 93 .flags = IORESOURCE_IRQ,
96 }, 94 },
97}; 95};
@@ -249,9 +247,6 @@ static void __init cm_t3517_init_nand(void)
249static inline void cm_t3517_init_nand(void) {} 247static inline void cm_t3517_init_nand(void) {}
250#endif 248#endif
251 249
252static struct omap_board_config_kernel cm_t3517_config[] __initdata = {
253};
254
255#ifdef CONFIG_OMAP_MUX 250#ifdef CONFIG_OMAP_MUX
256static struct omap_board_mux board_mux[] __initdata = { 251static struct omap_board_mux board_mux[] __initdata = {
257 /* GPIO186 - Green LED */ 252 /* GPIO186 - Green LED */
@@ -285,8 +280,6 @@ static void __init cm_t3517_init(void)
285 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 280 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
286 omap_serial_init(); 281 omap_serial_init();
287 omap_sdrc_init(NULL, NULL); 282 omap_sdrc_init(NULL, NULL);
288 omap_board_config = cm_t3517_config;
289 omap_board_config_size = ARRAY_SIZE(cm_t3517_config);
290 cm_t3517_init_leds(); 283 cm_t3517_init_leds();
291 cm_t3517_init_nand(); 284 cm_t3517_init_nand();
292 cm_t3517_init_rtc(); 285 cm_t3517_init_rtc();
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 6567c1cd557..1fd161e934c 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -32,31 +32,27 @@
32 32
33#include <linux/regulator/machine.h> 33#include <linux/regulator/machine.h>
34#include <linux/i2c/twl.h> 34#include <linux/i2c/twl.h>
35 35#include "id.h"
36#include <mach/hardware.h>
37#include <mach/id.h>
38#include <asm/mach-types.h> 36#include <asm/mach-types.h>
39#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
40#include <asm/mach/map.h> 38#include <asm/mach/map.h>
41#include <asm/mach/flash.h> 39#include <asm/mach/flash.h>
42 40
43#include <plat/board.h>
44#include "common.h" 41#include "common.h"
45#include <plat/gpmc.h> 42#include <plat/gpmc.h>
46#include <plat/nand.h> 43#include <linux/platform_data/mtd-nand-omap2.h>
47#include <plat/usb.h> 44#include <plat/usb.h>
48#include <video/omapdss.h> 45#include <video/omapdss.h>
49#include <video/omap-panel-generic-dpi.h> 46#include <video/omap-panel-generic-dpi.h>
50#include <video/omap-panel-tfp410.h> 47#include <video/omap-panel-tfp410.h>
51 48
52#include <plat/mcspi.h> 49#include <linux/platform_data/spi-omap2-mcspi.h>
53#include <linux/input/matrix_keypad.h> 50#include <linux/input/matrix_keypad.h>
54#include <linux/spi/spi.h> 51#include <linux/spi/spi.h>
55#include <linux/dm9000.h> 52#include <linux/dm9000.h>
56#include <linux/interrupt.h> 53#include <linux/interrupt.h>
57 54
58#include "sdram-micron-mt46h32m32lf-6.h" 55#include "sdram-micron-mt46h32m32lf-6.h"
59
60#include "mux.h" 56#include "mux.h"
61#include "hsmmc.h" 57#include "hsmmc.h"
62#include "common-board-devices.h" 58#include "common-board-devices.h"
@@ -236,9 +232,6 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
236} 232}
237 233
238static struct twl4030_gpio_platform_data devkit8000_gpio_data = { 234static struct twl4030_gpio_platform_data devkit8000_gpio_data = {
239 .gpio_base = OMAP_MAX_GPIO_LINES,
240 .irq_base = TWL4030_GPIO_IRQ_BASE,
241 .irq_end = TWL4030_GPIO_IRQ_END,
242 .use_leds = true, 235 .use_leds = true,
243 .pulldowns = BIT(1) | BIT(2) | BIT(6) | BIT(8) | BIT(13) 236 .pulldowns = BIT(1) | BIT(2) | BIT(6) | BIT(8) | BIT(13)
244 | BIT(15) | BIT(16) | BIT(17), 237 | BIT(15) | BIT(16) | BIT(17),
@@ -630,6 +623,7 @@ static void __init devkit8000_init(void)
630 usbhs_init(&usbhs_bdata); 623 usbhs_init(&usbhs_bdata);
631 omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions, 624 omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions,
632 ARRAY_SIZE(devkit8000_nand_partitions)); 625 ARRAY_SIZE(devkit8000_nand_partitions));
626 omap_twl4030_audio_init("omap3beagle");
633 627
634 /* Ensure SDRC pins are mux'd for self-refresh */ 628 /* Ensure SDRC pins are mux'd for self-refresh */
635 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 629 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 53c39d239d6..e642acf9cad 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -16,13 +16,14 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <plat/irqs.h>
20 19
20#include <plat/cpu.h>
21#include <plat/gpmc.h> 21#include <plat/gpmc.h>
22#include <plat/nand.h> 22#include <linux/platform_data/mtd-nand-omap2.h>
23#include <plat/onenand.h> 23#include <linux/platform_data/mtd-onenand-omap2.h>
24#include <plat/tc.h> 24#include <plat/tc.h>
25 25
26#include "common.h"
26#include "board-flash.h" 27#include "board-flash.h"
27 28
28#define REG_FPGA_REV 0x10 29#define REG_FPGA_REV 0x10
@@ -140,7 +141,6 @@ __init board_nand_init(struct mtd_partition *nand_parts,
140 board_nand_data.devsize = nand_type; 141 board_nand_data.devsize = nand_type;
141 142
142 board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT; 143 board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT;
143 board_nand_data.gpmc_irq = OMAP_GPMC_IRQ_BASE + cs;
144 gpmc_nand_init(&board_nand_data); 144 gpmc_nand_init(&board_nand_data);
145} 145}
146#endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ 146#endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */
@@ -218,7 +218,7 @@ void __init board_flash_init(struct flash_partitions partition_info[],
218 if (onenandcs > GPMC_CS_NUM) 218 if (onenandcs > GPMC_CS_NUM)
219 onenandcs = cs; 219 onenandcs = cs;
220 break; 220 break;
221 }; 221 }
222 cs++; 222 cs++;
223 } 223 }
224 224
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 6f93a20536e..601ecdfb1cf 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -16,11 +16,9 @@
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 <mach/hardware.h>
20#include <asm/hardware/gic.h> 19#include <asm/hardware/gic.h>
21#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
22 21
23#include <plat/board.h>
24#include "common.h" 22#include "common.h"
25#include "common-board-devices.h" 23#include "common-board-devices.h"
26 24
@@ -127,6 +125,7 @@ static const char *omap4_boards_compat[] __initdata = {
127 125
128DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") 126DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
129 .reserve = omap_reserve, 127 .reserve = omap_reserve,
128 .smp = smp_ops(omap4_smp_ops),
130 .map_io = omap4_map_io, 129 .map_io = omap4_map_io,
131 .init_early = omap4430_init_early, 130 .init_early = omap4430_init_early,
132 .init_irq = omap_gic_of_init, 131 .init_irq = omap_gic_of_init,
@@ -147,6 +146,7 @@ static const char *omap5_boards_compat[] __initdata = {
147 146
148DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)") 147DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
149 .reserve = omap_reserve, 148 .reserve = omap_reserve,
149 .smp = smp_ops(omap4_smp_ops),
150 .map_io = omap5_map_io, 150 .map_io = omap5_map_io,
151 .init_early = omap5_init_early, 151 .init_early = omap5_init_early,
152 .init_irq = omap_gic_of_init, 152 .init_irq = omap_gic_of_init,
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index ace20482e3e..8d04bf851af 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -27,20 +27,19 @@
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/input/matrix_keypad.h> 28#include <linux/input/matrix_keypad.h>
29 29
30#include <mach/hardware.h>
31#include <asm/mach-types.h> 30#include <asm/mach-types.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 33
35#include <plat/board.h>
36#include "common.h"
37#include <plat/menelaus.h> 34#include <plat/menelaus.h>
38#include <plat/dma.h> 35#include <plat/dma.h>
39#include <plat/gpmc.h> 36#include <plat/gpmc.h>
37#include "debug-devices.h"
40 38
41#include <video/omapdss.h> 39#include <video/omapdss.h>
42#include <video/omap-panel-generic-dpi.h> 40#include <video/omap-panel-generic-dpi.h>
43 41
42#include "common.h"
44#include "mux.h" 43#include "mux.h"
45#include "control.h" 44#include "control.h"
46 45
@@ -266,9 +265,9 @@ static inline void __init h4_init_debug(void)
266 return; 265 return;
267 } 266 }
268 267
269 clk_enable(gpmc_fck); 268 clk_prepare_enable(gpmc_fck);
270 rate = clk_get_rate(gpmc_fck); 269 rate = clk_get_rate(gpmc_fck);
271 clk_disable(gpmc_fck); 270 clk_disable_unprepare(gpmc_fck);
272 clk_put(gpmc_fck); 271 clk_put(gpmc_fck);
273 272
274 if (is_gpmc_muxed()) 273 if (is_gpmc_muxed())
@@ -312,7 +311,7 @@ static inline void __init h4_init_debug(void)
312 gpmc_cs_free(eth_cs); 311 gpmc_cs_free(eth_cs);
313 312
314out: 313out:
315 clk_disable(gpmc_fck); 314 clk_disable_unprepare(gpmc_fck);
316 clk_put(gpmc_fck); 315 clk_put(gpmc_fck);
317} 316}
318 317
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 28214483aab..48d5e41dfbf 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -29,13 +29,13 @@
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
32#include <plat/board.h>
33#include "common.h" 32#include "common.h"
34#include <plat/gpmc.h> 33#include <plat/gpmc.h>
35#include <plat/usb.h> 34#include <plat/usb.h>
35
36#include <video/omapdss.h> 36#include <video/omapdss.h>
37#include <video/omap-panel-tfp410.h> 37#include <video/omap-panel-tfp410.h>
38#include <plat/onenand.h> 38#include <linux/platform_data/mtd-onenand-omap2.h>
39 39
40#include "mux.h" 40#include "mux.h"
41#include "hsmmc.h" 41#include "hsmmc.h"
@@ -192,7 +192,7 @@ static void __init igep_flash_init(void) {}
192#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 192#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
193 193
194#include <linux/smsc911x.h> 194#include <linux/smsc911x.h>
195#include <plat/gpmc-smsc911x.h> 195#include "gpmc-smsc911x.h"
196 196
197static struct omap_smsc911x_platform_data smsc911x_cfg = { 197static struct omap_smsc911x_platform_data smsc911x_cfg = {
198 .cs = IGEP2_SMSC911X_CS, 198 .cs = IGEP2_SMSC911X_CS,
@@ -425,9 +425,6 @@ static int igep_twl_gpio_setup(struct device *dev,
425}; 425};
426 426
427static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = { 427static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = {
428 .gpio_base = OMAP_MAX_GPIO_LINES,
429 .irq_base = TWL4030_GPIO_IRQ_BASE,
430 .irq_end = TWL4030_GPIO_IRQ_END,
431 .use_leds = true, 428 .use_leds = true,
432 .setup = igep_twl_gpio_setup, 429 .setup = igep_twl_gpio_setup,
433}; 430};
@@ -628,6 +625,7 @@ static void __init igep_init(void)
628 625
629 igep_flash_init(); 626 igep_flash_init();
630 igep_leds_init(); 627 igep_leds_init();
628 omap_twl4030_audio_init("igep2");
631 629
632 /* 630 /*
633 * WLAN-BT combo module from MuRata which has a Marvell WLAN 631 * WLAN-BT combo module from MuRata which has a Marvell WLAN
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index ef9e8297749..ee8c3cfb95b 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -28,21 +28,17 @@
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/platform_data/spi-omap2-mcspi.h>
31 32
32#include <mach/hardware.h>
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
35#include <asm/mach/map.h> 35#include <asm/mach/map.h>
36 36
37#include <plat/mcspi.h>
38#include <plat/board.h>
39#include "common.h" 37#include "common.h"
40#include <plat/gpmc.h> 38#include <plat/gpmc.h>
41#include <mach/board-zoom.h> 39#include <mach/board-zoom.h>
42
43#include <asm/delay.h>
44#include <plat/usb.h> 40#include <plat/usb.h>
45#include <plat/gpmc-smsc911x.h> 41#include "gpmc-smsc911x.h"
46 42
47#include <video/omapdss.h> 43#include <video/omapdss.h>
48#include <video/omap-panel-generic-dpi.h> 44#include <video/omap-panel-generic-dpi.h>
@@ -275,9 +271,6 @@ static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
275} 271}
276 272
277static struct twl4030_gpio_platform_data ldp_gpio_data = { 273static struct twl4030_gpio_platform_data ldp_gpio_data = {
278 .gpio_base = OMAP_MAX_GPIO_LINES,
279 .irq_base = TWL4030_GPIO_IRQ_BASE,
280 .irq_end = TWL4030_GPIO_IRQ_END,
281 .setup = ldp_twl_gpio_setup, 274 .setup = ldp_twl_gpio_setup,
282}; 275};
283 276
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index 677357ff61a..d95f727ca39 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -20,19 +20,16 @@
20#include <linux/i2c.h> 20#include <linux/i2c.h>
21#include <linux/spi/spi.h> 21#include <linux/spi/spi.h>
22#include <linux/usb/musb.h> 22#include <linux/usb/musb.h>
23#include <linux/platform_data/spi-omap2-mcspi.h>
24#include <linux/platform_data/mtd-onenand-omap2.h>
23#include <sound/tlv320aic3x.h> 25#include <sound/tlv320aic3x.h>
24 26
25#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
26#include <asm/mach-types.h> 28#include <asm/mach-types.h>
27 29
28#include <plat/board.h>
29#include "common.h" 30#include "common.h"
30#include <plat/menelaus.h> 31#include <plat/menelaus.h>
31#include <mach/irqs.h>
32#include <plat/mcspi.h>
33#include <plat/onenand.h>
34#include <plat/mmc.h> 32#include <plat/mmc.h>
35#include <plat/serial.h>
36 33
37#include "mux.h" 34#include "mux.h"
38 35
@@ -553,8 +550,8 @@ static int n8x0_auto_sleep_regulators(void)
553 550
554 ret = menelaus_set_regulator_sleep(1, val); 551 ret = menelaus_set_regulator_sleep(1, val);
555 if (ret < 0) { 552 if (ret < 0) {
556 printk(KERN_ERR "Could not set regulators to sleep on " 553 pr_err("Could not set regulators to sleep on menelaus: %u\n",
557 "menelaus: %u\n", ret); 554 ret);
558 return ret; 555 return ret;
559 } 556 }
560 return 0; 557 return 0;
@@ -566,8 +563,7 @@ static int n8x0_auto_voltage_scale(void)
566 563
567 ret = menelaus_set_vcore_hw(1400, 1050); 564 ret = menelaus_set_vcore_hw(1400, 1050);
568 if (ret < 0) { 565 if (ret < 0) {
569 printk(KERN_ERR "Could not set VCORE voltage on " 566 pr_err("Could not set VCORE voltage on menelaus: %u\n", ret);
570 "menelaus: %u\n", ret);
571 return ret; 567 return ret;
572 } 568 }
573 return 0; 569 return 0;
@@ -600,7 +596,7 @@ static struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = {
600static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] __initdata = { 596static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] __initdata = {
601 { 597 {
602 I2C_BOARD_INFO("menelaus", 0x72), 598 I2C_BOARD_INFO("menelaus", 0x72),
603 .irq = INT_24XX_SYS_NIRQ, 599 .irq = 7 + OMAP_INTC_START,
604 .platform_data = &n8x0_menelaus_platform_data, 600 .platform_data = &n8x0_menelaus_platform_data,
605 }, 601 },
606}; 602};
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 6202fc76e49..388c431c745 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -33,18 +33,16 @@
33#include <linux/regulator/machine.h> 33#include <linux/regulator/machine.h>
34#include <linux/i2c/twl.h> 34#include <linux/i2c/twl.h>
35 35
36#include <mach/hardware.h>
37#include <asm/mach-types.h> 36#include <asm/mach-types.h>
38#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
39#include <asm/mach/map.h> 38#include <asm/mach/map.h>
40#include <asm/mach/flash.h> 39#include <asm/mach/flash.h>
41 40
42#include <plat/board.h>
43#include "common.h" 41#include "common.h"
44#include <video/omapdss.h> 42#include <video/omapdss.h>
45#include <video/omap-panel-tfp410.h> 43#include <video/omap-panel-tfp410.h>
46#include <plat/gpmc.h> 44#include <plat/gpmc.h>
47#include <plat/nand.h> 45#include <linux/platform_data/mtd-nand-omap2.h>
48#include <plat/usb.h> 46#include <plat/usb.h>
49#include <plat/omap_device.h> 47#include <plat/omap_device.h>
50 48
@@ -297,9 +295,6 @@ static int beagle_twl_gpio_setup(struct device *dev,
297} 295}
298 296
299static struct twl4030_gpio_platform_data beagle_gpio_data = { 297static struct twl4030_gpio_platform_data beagle_gpio_data = {
300 .gpio_base = OMAP_MAX_GPIO_LINES,
301 .irq_base = TWL4030_GPIO_IRQ_BASE,
302 .irq_end = TWL4030_GPIO_IRQ_END,
303 .use_leds = true, 298 .use_leds = true,
304 .pullups = BIT(1), 299 .pullups = BIT(1),
305 .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13) 300 .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13)
@@ -466,7 +461,7 @@ static void __init beagle_opp_init(void)
466 mpu_dev = omap_device_get_by_hwmod_name("mpu"); 461 mpu_dev = omap_device_get_by_hwmod_name("mpu");
467 iva_dev = omap_device_get_by_hwmod_name("iva"); 462 iva_dev = omap_device_get_by_hwmod_name("iva");
468 463
469 if (!mpu_dev || !iva_dev) { 464 if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) {
470 pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", 465 pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
471 __func__, mpu_dev, iva_dev); 466 __func__, mpu_dev, iva_dev);
472 return; 467 return;
@@ -519,6 +514,7 @@ static void __init omap3_beagle_init(void)
519 usbhs_init(&usbhs_bdata); 514 usbhs_init(&usbhs_bdata);
520 omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, 515 omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
521 ARRAY_SIZE(omap3beagle_nand_partitions)); 516 ARRAY_SIZE(omap3beagle_nand_partitions));
517 omap_twl4030_audio_init("omap3beagle");
522 518
523 /* Ensure msecure is mux'd to be able to set the RTC. */ 519 /* Ensure msecure is mux'd to be able to set the RTC. */
524 omap_mux_init_signal("sys_drm_msecure", OMAP_PIN_OFF_OUTPUT_HIGH); 520 omap_mux_init_signal("sys_drm_msecure", OMAP_PIN_OFF_OUTPUT_HIGH);
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 0d362e9f9cb..b9b776b6c95 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -32,6 +32,7 @@
32#include <linux/spi/ads7846.h> 32#include <linux/spi/ads7846.h>
33#include <linux/i2c/twl.h> 33#include <linux/i2c/twl.h>
34#include <linux/usb/otg.h> 34#include <linux/usb/otg.h>
35#include <linux/usb/nop-usb-xceiv.h>
35#include <linux/smsc911x.h> 36#include <linux/smsc911x.h>
36 37
37#include <linux/wl12xx.h> 38#include <linux/wl12xx.h>
@@ -40,16 +41,14 @@
40#include <linux/mmc/host.h> 41#include <linux/mmc/host.h>
41#include <linux/export.h> 42#include <linux/export.h>
42 43
43#include <mach/hardware.h>
44#include <asm/mach-types.h> 44#include <asm/mach-types.h>
45#include <asm/mach/arch.h> 45#include <asm/mach/arch.h>
46#include <asm/mach/map.h> 46#include <asm/mach/map.h>
47 47
48#include <plat/board.h>
49#include <plat/usb.h> 48#include <plat/usb.h>
50#include <plat/nand.h> 49#include <linux/platform_data/mtd-nand-omap2.h>
51#include "common.h" 50#include "common.h"
52#include <plat/mcspi.h> 51#include <linux/platform_data/spi-omap2-mcspi.h>
53#include <video/omapdss.h> 52#include <video/omapdss.h>
54#include <video/omap-panel-tfp410.h> 53#include <video/omap-panel-tfp410.h>
55 54
@@ -75,13 +74,24 @@
75#define OMAP3EVM_GEN1_ETHR_GPIO_RST 64 74#define OMAP3EVM_GEN1_ETHR_GPIO_RST 64
76#define OMAP3EVM_GEN2_ETHR_GPIO_RST 7 75#define OMAP3EVM_GEN2_ETHR_GPIO_RST 7
77 76
77/*
78 * OMAP35x EVM revision
79 * Run time detection of EVM revision is done by reading Ethernet
80 * PHY ID -
81 * GEN_1 = 0x01150000
82 * GEN_2 = 0x92200000
83 */
84enum {
85 OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */
86 OMAP3EVM_BOARD_GEN_2, /* EVM Rev >= Rev E */
87};
88
78static u8 omap3_evm_version; 89static u8 omap3_evm_version;
79 90
80u8 get_omap3_evm_rev(void) 91static u8 get_omap3_evm_rev(void)
81{ 92{
82 return omap3_evm_version; 93 return omap3_evm_version;
83} 94}
84EXPORT_SYMBOL(get_omap3_evm_rev);
85 95
86static void __init omap3_evm_get_revision(void) 96static void __init omap3_evm_get_revision(void)
87{ 97{
@@ -108,7 +118,7 @@ static void __init omap3_evm_get_revision(void)
108} 118}
109 119
110#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 120#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
111#include <plat/gpmc-smsc911x.h> 121#include "gpmc-smsc911x.h"
112 122
113static struct omap_smsc911x_platform_data smsc911x_cfg = { 123static struct omap_smsc911x_platform_data smsc911x_cfg = {
114 .cs = OMAP3EVM_SMSC911X_CS, 124 .cs = OMAP3EVM_SMSC911X_CS,
@@ -377,9 +387,6 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
377} 387}
378 388
379static struct twl4030_gpio_platform_data omap3evm_gpio_data = { 389static struct twl4030_gpio_platform_data omap3evm_gpio_data = {
380 .gpio_base = OMAP_MAX_GPIO_LINES,
381 .irq_base = TWL4030_GPIO_IRQ_BASE,
382 .irq_end = TWL4030_GPIO_IRQ_END,
383 .use_leds = true, 390 .use_leds = true,
384 .setup = omap3evm_twl_gpio_setup, 391 .setup = omap3evm_twl_gpio_setup,
385}; 392};
@@ -526,9 +533,6 @@ static int __init omap3_evm_i2c_init(void)
526 return 0; 533 return 0;
527} 534}
528 535
529static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
530};
531
532static struct usbhs_omap_board_data usbhs_bdata __initdata = { 536static struct usbhs_omap_board_data usbhs_bdata __initdata = {
533 537
534 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, 538 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -688,9 +692,6 @@ static void __init omap3_evm_init(void)
688 obm = (cpu_is_omap3630()) ? omap36x_board_mux : omap35x_board_mux; 692 obm = (cpu_is_omap3630()) ? omap36x_board_mux : omap35x_board_mux;
689 omap3_mux_init(obm, OMAP_PACKAGE_CBB); 693 omap3_mux_init(obm, OMAP_PACKAGE_CBB);
690 694
691 omap_board_config = omap3_evm_config;
692 omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
693
694 omap_mux_init_gpio(63, OMAP_PIN_INPUT); 695 omap_mux_init_gpio(63, OMAP_PIN_INPUT);
695 omap_hsmmc_init(mmc); 696 omap_hsmmc_init(mmc);
696 697
@@ -737,6 +738,7 @@ static void __init omap3_evm_init(void)
737 omap3evm_init_smsc911x(); 738 omap3evm_init_smsc911x();
738 omap3_evm_display_init(); 739 omap3_evm_display_init();
739 omap3_evm_wl12xx_init(); 740 omap3_evm_wl12xx_init();
741 omap_twl4030_audio_init("omap3evm");
740} 742}
741 743
742MACHINE_START(OMAP3EVM, "OMAP3 EVM") 744MACHINE_START(OMAP3EVM, "OMAP3 EVM")
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index fca93d1afd4..7bd8253b5d1 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -30,24 +30,21 @@
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 32
33#include <mach/hardware.h>
34#include <asm/mach-types.h> 33#include <asm/mach-types.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 36
37#include "gpmc-smsc911x.h"
38#include <plat/gpmc.h>
39#include <plat/sdrc.h>
40#include <plat/usb.h>
41
42#include "common.h"
38#include "mux.h" 43#include "mux.h"
39#include "hsmmc.h" 44#include "hsmmc.h"
40#include "control.h" 45#include "control.h"
41#include "common-board-devices.h" 46#include "common-board-devices.h"
42 47
43#include <plat/mux.h>
44#include <plat/board.h>
45#include "common.h"
46#include <plat/gpmc-smsc911x.h>
47#include <plat/gpmc.h>
48#include <plat/sdrc.h>
49#include <plat/usb.h>
50
51#define OMAP3LOGIC_SMSC911X_CS 1 48#define OMAP3LOGIC_SMSC911X_CS 1
52 49
53#define OMAP3530_LV_SOM_MMC_GPIO_CD 110 50#define OMAP3530_LV_SOM_MMC_GPIO_CD 110
@@ -78,9 +75,6 @@ static struct regulator_init_data omap3logic_vmmc1 = {
78}; 75};
79 76
80static struct twl4030_gpio_platform_data omap3logic_gpio_data = { 77static struct twl4030_gpio_platform_data omap3logic_gpio_data = {
81 .gpio_base = OMAP_MAX_GPIO_LINES,
82 .irq_base = TWL4030_GPIO_IRQ_BASE,
83 .irq_end = TWL4030_GPIO_IRQ_END,
84 .use_leds = true, 78 .use_leds = true,
85 .pullups = BIT(1), 79 .pullups = BIT(1),
86 .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) 80 .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8)
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 57aebee44fd..00a1f4ae6e4 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -35,18 +35,16 @@
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/platform_data/spi-omap2-mcspi.h>
38 39
39#include <asm/mach-types.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 43
43#include <plat/board.h>
44#include "common.h" 44#include "common.h"
45#include <mach/hardware.h>
46#include <plat/mcspi.h>
47#include <plat/usb.h> 45#include <plat/usb.h>
48#include <video/omapdss.h> 46#include <video/omapdss.h>
49#include <plat/nand.h> 47#include <linux/platform_data/mtd-nand-omap2.h>
50 48
51#include "mux.h" 49#include "mux.h"
52#include "sdram-micron-mt46h32m32lf-6.h" 50#include "sdram-micron-mt46h32m32lf-6.h"
@@ -321,9 +319,6 @@ static int omap3pandora_twl_gpio_setup(struct device *dev,
321} 319}
322 320
323static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { 321static struct twl4030_gpio_platform_data omap3pandora_gpio_data = {
324 .gpio_base = OMAP_MAX_GPIO_LINES,
325 .irq_base = TWL4030_GPIO_IRQ_BASE,
326 .irq_end = TWL4030_GPIO_IRQ_END,
327 .setup = omap3pandora_twl_gpio_setup, 322 .setup = omap3pandora_twl_gpio_setup,
328}; 323};
329 324
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index b318f5602e3..731235eb319 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -28,28 +28,26 @@
28#include <linux/regulator/machine.h> 28#include <linux/regulator/machine.h>
29#include <linux/i2c/twl.h> 29#include <linux/i2c/twl.h>
30#include <linux/mmc/host.h> 30#include <linux/mmc/host.h>
31#include <linux/input/matrix_keypad.h>
32#include <linux/spi/spi.h>
33#include <linux/interrupt.h>
34#include <linux/smsc911x.h>
35#include <linux/i2c/at24.h>
31 36
32#include <mach/hardware.h>
33#include <asm/mach-types.h> 37#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
35#include <asm/mach/map.h> 39#include <asm/mach/map.h>
36#include <asm/mach/flash.h> 40#include <asm/mach/flash.h>
37 41
38#include <plat/board.h>
39#include "common.h" 42#include "common.h"
40#include <plat/gpmc.h> 43#include <plat/gpmc.h>
41#include <plat/nand.h> 44#include <linux/platform_data/mtd-nand-omap2.h>
42#include <plat/usb.h> 45#include <plat/usb.h>
43#include <video/omapdss.h> 46#include <video/omapdss.h>
44#include <video/omap-panel-generic-dpi.h> 47#include <video/omap-panel-generic-dpi.h>
45#include <video/omap-panel-tfp410.h> 48#include <video/omap-panel-tfp410.h>
46 49
47#include <plat/mcspi.h> 50#include <linux/platform_data/spi-omap2-mcspi.h>
48#include <linux/input/matrix_keypad.h>
49#include <linux/spi/spi.h>
50#include <linux/interrupt.h>
51#include <linux/smsc911x.h>
52#include <linux/i2c/at24.h>
53 51
54#include "sdram-micron-mt46h32m32lf-6.h" 52#include "sdram-micron-mt46h32m32lf-6.h"
55#include "mux.h" 53#include "mux.h"
@@ -57,7 +55,7 @@
57#include "common-board-devices.h" 55#include "common-board-devices.h"
58 56
59#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 57#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
60#include <plat/gpmc-smsc911x.h> 58#include "gpmc-smsc911x.h"
61 59
62#define OMAP3STALKER_ETHR_START 0x2c000000 60#define OMAP3STALKER_ETHR_START 0x2c000000
63#define OMAP3STALKER_ETHR_SIZE 1024 61#define OMAP3STALKER_ETHR_SIZE 1024
@@ -279,9 +277,6 @@ omap3stalker_twl_gpio_setup(struct device *dev,
279} 277}
280 278
281static struct twl4030_gpio_platform_data omap3stalker_gpio_data = { 279static struct twl4030_gpio_platform_data omap3stalker_gpio_data = {
282 .gpio_base = OMAP_MAX_GPIO_LINES,
283 .irq_base = TWL4030_GPIO_IRQ_BASE,
284 .irq_end = TWL4030_GPIO_IRQ_END,
285 .use_leds = true, 280 .use_leds = true,
286 .setup = omap3stalker_twl_gpio_setup, 281 .setup = omap3stalker_twl_gpio_setup,
287}; 282};
@@ -362,9 +357,6 @@ static int __init omap3_stalker_i2c_init(void)
362 357
363#define OMAP3_STALKER_TS_GPIO 175 358#define OMAP3_STALKER_TS_GPIO 175
364 359
365static struct omap_board_config_kernel omap3_stalker_config[] __initdata = {
366};
367
368static struct platform_device *omap3_stalker_devices[] __initdata = { 360static struct platform_device *omap3_stalker_devices[] __initdata = {
369 &keys_gpio, 361 &keys_gpio,
370}; 362};
@@ -399,8 +391,6 @@ static void __init omap3_stalker_init(void)
399{ 391{
400 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 392 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
401 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); 393 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
402 omap_board_config = omap3_stalker_config;
403 omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);
404 394
405 omap_mux_init_gpio(23, OMAP_PIN_INPUT); 395 omap_mux_init_gpio(23, OMAP_PIN_INPUT);
406 omap_hsmmc_init(mmc); 396 omap_hsmmc_init(mmc);
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 485d14d6a8c..944ffc43657 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -29,7 +29,7 @@
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 31
32#include <plat/mcspi.h> 32#include <linux/platform_data/spi-omap2-mcspi.h>
33#include <linux/spi/spi.h> 33#include <linux/spi/spi.h>
34 34
35#include <linux/spi/ads7846.h> 35#include <linux/spi/ads7846.h>
@@ -37,17 +37,15 @@
37#include <linux/regulator/machine.h> 37#include <linux/regulator/machine.h>
38#include <linux/i2c/twl.h> 38#include <linux/i2c/twl.h>
39 39
40#include <mach/hardware.h>
41#include <asm/mach-types.h> 40#include <asm/mach-types.h>
42#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
43#include <asm/mach/map.h> 42#include <asm/mach/map.h>
44#include <asm/mach/flash.h> 43#include <asm/mach/flash.h>
45#include <asm/system_info.h> 44#include <asm/system_info.h>
46 45
47#include <plat/board.h>
48#include "common.h" 46#include "common.h"
49#include <plat/gpmc.h> 47#include <plat/gpmc.h>
50#include <plat/nand.h> 48#include <linux/platform_data/mtd-nand-omap2.h>
51#include <plat/usb.h> 49#include <plat/usb.h>
52 50
53#include "mux.h" 51#include "mux.h"
@@ -139,9 +137,6 @@ static int touchbook_twl_gpio_setup(struct device *dev,
139} 137}
140 138
141static struct twl4030_gpio_platform_data touchbook_gpio_data = { 139static struct twl4030_gpio_platform_data touchbook_gpio_data = {
142 .gpio_base = OMAP_MAX_GPIO_LINES,
143 .irq_base = TWL4030_GPIO_IRQ_BASE,
144 .irq_end = TWL4030_GPIO_IRQ_END,
145 .use_leds = true, 140 .use_leds = true,
146 .pullups = BIT(1), 141 .pullups = BIT(1),
147 .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13) 142 .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13)
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 70f6d1d2546..bfcd397e233 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -32,19 +32,18 @@
32#include <linux/wl12xx.h> 32#include <linux/wl12xx.h>
33#include <linux/platform_data/omap-abe-twl6040.h> 33#include <linux/platform_data/omap-abe-twl6040.h>
34 34
35#include <mach/hardware.h>
36#include <asm/hardware/gic.h> 35#include <asm/hardware/gic.h>
37#include <asm/mach-types.h> 36#include <asm/mach-types.h>
38#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
39#include <asm/mach/map.h> 38#include <asm/mach/map.h>
40#include <video/omapdss.h> 39#include <video/omapdss.h>
41 40
42#include <plat/board.h>
43#include "common.h" 41#include "common.h"
44#include <plat/usb.h> 42#include <plat/usb.h>
45#include <plat/mmc.h> 43#include <plat/mmc.h>
46#include <video/omap-panel-tfp410.h> 44#include <video/omap-panel-tfp410.h>
47 45
46#include "soc.h"
48#include "hsmmc.h" 47#include "hsmmc.h"
49#include "control.h" 48#include "control.h"
50#include "mux.h" 49#include "mux.h"
@@ -172,7 +171,7 @@ static void __init omap4_ehci_init(void)
172 return; 171 return;
173 } 172 }
174 clk_set_rate(phy_ref_clk, 19200000); 173 clk_set_rate(phy_ref_clk, 19200000);
175 clk_enable(phy_ref_clk); 174 clk_prepare_enable(phy_ref_clk);
176 175
177 /* disable the power to the usb hub prior to init and reset phy+hub */ 176 /* disable the power to the usb hub prior to init and reset phy+hub */
178 ret = gpio_request_array(panda_ehci_gpios, 177 ret = gpio_request_array(panda_ehci_gpios,
@@ -248,8 +247,7 @@ static struct platform_device omap_vwlan_device = {
248}; 247};
249 248
250static struct wl12xx_platform_data omap_panda_wlan_data __initdata = { 249static struct wl12xx_platform_data omap_panda_wlan_data __initdata = {
251 /* PANDA ref clock is 38.4 MHz */ 250 .board_ref_clock = WL12XX_REFCLOCK_38, /* 38.4 MHz */
252 .board_ref_clock = 2,
253}; 251};
254 252
255static struct twl6040_codec_data twl6040_codec = { 253static struct twl6040_codec_data twl6040_codec = {
@@ -263,7 +261,14 @@ static struct twl6040_codec_data twl6040_codec = {
263static struct twl6040_platform_data twl6040_data = { 261static struct twl6040_platform_data twl6040_data = {
264 .codec = &twl6040_codec, 262 .codec = &twl6040_codec,
265 .audpwron_gpio = 127, 263 .audpwron_gpio = 127,
266 .irq_base = TWL6040_CODEC_IRQ_BASE, 264};
265
266static struct i2c_board_info __initdata panda_i2c_1_boardinfo[] = {
267 {
268 I2C_BOARD_INFO("twl6040", 0x4b),
269 .irq = 119 + OMAP44XX_IRQ_GIC_START,
270 .platform_data = &twl6040_data,
271 },
267}; 272};
268 273
269/* Panda board uses the common PMIC configuration */ 274/* Panda board uses the common PMIC configuration */
@@ -293,8 +298,8 @@ static int __init omap4_panda_i2c_init(void)
293 TWL_COMMON_REGULATOR_CLK32KG | 298 TWL_COMMON_REGULATOR_CLK32KG |
294 TWL_COMMON_REGULATOR_V1V8 | 299 TWL_COMMON_REGULATOR_V1V8 |
295 TWL_COMMON_REGULATOR_V2V1); 300 TWL_COMMON_REGULATOR_V2V1);
296 omap4_pmic_init("twl6030", &omap4_panda_twldata, 301 omap4_pmic_init("twl6030", &omap4_panda_twldata, panda_i2c_1_boardinfo,
297 &twl6040_data, OMAP44XX_IRQ_SYS_2N); 302 ARRAY_SIZE(panda_i2c_1_boardinfo));
298 omap_register_i2c_bus(2, 400, NULL, 0); 303 omap_register_i2c_bus(2, 400, NULL, 0);
299 /* 304 /*
300 * Bus 3 is attached to the DVI port where devices like the pico DLP 305 * Bus 3 is attached to the DVI port where devices like the pico DLP
@@ -382,6 +387,21 @@ static struct omap_board_mux board_mux[] __initdata = {
382 /* NIRQ2 for twl6040 */ 387 /* NIRQ2 for twl6040 */
383 OMAP4_MUX(SYS_NIRQ2, OMAP_MUX_MODE0 | 388 OMAP4_MUX(SYS_NIRQ2, OMAP_MUX_MODE0 |
384 OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE), 389 OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE),
390 /* GPIO_127 for twl6040 */
391 OMAP4_MUX(HDQ_SIO, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
392 /* McPDM */
393 OMAP4_MUX(ABE_PDM_UL_DATA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
394 OMAP4_MUX(ABE_PDM_DL_DATA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
395 OMAP4_MUX(ABE_PDM_FRAME, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
396 OMAP4_MUX(ABE_PDM_LB_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
397 OMAP4_MUX(ABE_CLKS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
398 /* McBSP1 */
399 OMAP4_MUX(ABE_MCBSP1_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
400 OMAP4_MUX(ABE_MCBSP1_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
401 OMAP4_MUX(ABE_MCBSP1_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT |
402 OMAP_PULL_ENA),
403 OMAP4_MUX(ABE_MCBSP1_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
404
385 { .reg_offset = OMAP_MUX_TERMINATOR }, 405 { .reg_offset = OMAP_MUX_TERMINATOR },
386}; 406};
387 407
@@ -408,30 +428,9 @@ static struct omap_dss_device omap4_panda_dvi_device = {
408 .channel = OMAP_DSS_CHANNEL_LCD2, 428 .channel = OMAP_DSS_CHANNEL_LCD2,
409}; 429};
410 430
411static struct gpio panda_hdmi_gpios[] = {
412 { HDMI_GPIO_CT_CP_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ct_cp_hpd" },
413 { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
414 { HDMI_GPIO_HPD, GPIOF_DIR_IN, "hdmi_gpio_hpd" },
415};
416
417static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev)
418{
419 int status;
420
421 status = gpio_request_array(panda_hdmi_gpios,
422 ARRAY_SIZE(panda_hdmi_gpios));
423 if (status)
424 pr_err("Cannot request HDMI GPIOs\n");
425
426 return status;
427}
428
429static void omap4_panda_panel_disable_hdmi(struct omap_dss_device *dssdev)
430{
431 gpio_free_array(panda_hdmi_gpios, ARRAY_SIZE(panda_hdmi_gpios));
432}
433
434static struct omap_dss_hdmi_data omap4_panda_hdmi_data = { 431static struct omap_dss_hdmi_data omap4_panda_hdmi_data = {
432 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
433 .ls_oe_gpio = HDMI_GPIO_LS_OE,
435 .hpd_gpio = HDMI_GPIO_HPD, 434 .hpd_gpio = HDMI_GPIO_HPD,
436}; 435};
437 436
@@ -439,8 +438,6 @@ static struct omap_dss_device omap4_panda_hdmi_device = {
439 .name = "hdmi", 438 .name = "hdmi",
440 .driver_name = "hdmi_panel", 439 .driver_name = "hdmi_panel",
441 .type = OMAP_DISPLAY_TYPE_HDMI, 440 .type = OMAP_DISPLAY_TYPE_HDMI,
442 .platform_enable = omap4_panda_panel_enable_hdmi,
443 .platform_disable = omap4_panda_panel_disable_hdmi,
444 .channel = OMAP_DSS_CHANNEL_DIGIT, 441 .channel = OMAP_DSS_CHANNEL_DIGIT,
445 .data = &omap4_panda_hdmi_data, 442 .data = &omap4_panda_hdmi_data,
446}; 443};
@@ -518,6 +515,7 @@ static void __init omap4_panda_init(void)
518MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") 515MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
519 /* Maintainer: David Anders - Texas Instruments Inc */ 516 /* Maintainer: David Anders - Texas Instruments Inc */
520 .atag_offset = 0x100, 517 .atag_offset = 0x100,
518 .smp = smp_ops(omap4_smp_ops),
521 .reserve = omap_reserve, 519 .reserve = omap_reserve,
522 .map_io = omap4_map_io, 520 .map_io = omap4_map_io,
523 .init_early = omap4430_init_early, 521 .init_early = omap4430_init_early,
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 779734d8ba3..b700685762b 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -37,21 +37,19 @@
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 39
40#include <linux/platform_data/mtd-nand-omap2.h>
41#include <linux/platform_data/spi-omap2-mcspi.h>
42
40#include <asm/mach-types.h> 43#include <asm/mach-types.h>
41#include <asm/mach/arch.h> 44#include <asm/mach/arch.h>
42#include <asm/mach/flash.h> 45#include <asm/mach/flash.h>
43#include <asm/mach/map.h> 46#include <asm/mach/map.h>
44 47
45#include <plat/board.h>
46#include "common.h" 48#include "common.h"
47#include <video/omapdss.h> 49#include <video/omapdss.h>
48#include <video/omap-panel-generic-dpi.h> 50#include <video/omap-panel-generic-dpi.h>
49#include <video/omap-panel-tfp410.h> 51#include <video/omap-panel-tfp410.h>
50#include <plat/gpmc.h> 52#include <plat/gpmc.h>
51#include <mach/hardware.h>
52#include <plat/nand.h>
53#include <plat/mcspi.h>
54#include <plat/mux.h>
55#include <plat/usb.h> 53#include <plat/usb.h>
56 54
57#include "mux.h" 55#include "mux.h"
@@ -116,7 +114,7 @@ static inline void __init overo_ads7846_init(void) { return; }
116#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 114#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
117 115
118#include <linux/smsc911x.h> 116#include <linux/smsc911x.h>
119#include <plat/gpmc-smsc911x.h> 117#include "gpmc-smsc911x.h"
120 118
121static struct omap_smsc911x_platform_data smsc911x_cfg = { 119static struct omap_smsc911x_platform_data smsc911x_cfg = {
122 .id = 0, 120 .id = 0,
@@ -399,9 +397,6 @@ static int overo_twl_gpio_setup(struct device *dev,
399} 397}
400 398
401static struct twl4030_gpio_platform_data overo_gpio_data = { 399static struct twl4030_gpio_platform_data overo_gpio_data = {
402 .gpio_base = OMAP_MAX_GPIO_LINES,
403 .irq_base = TWL4030_GPIO_IRQ_BASE,
404 .irq_end = TWL4030_GPIO_IRQ_END,
405 .use_leds = true, 400 .use_leds = true,
406 .setup = overo_twl_gpio_setup, 401 .setup = overo_twl_gpio_setup,
407}; 402};
@@ -509,6 +504,7 @@ static void __init overo_init(void)
509 overo_display_init(); 504 overo_display_init();
510 overo_init_led(); 505 overo_init_led();
511 overo_init_keys(); 506 overo_init_keys();
507 omap_twl4030_audio_init("overo");
512 508
513 /* Ensure SDRC pins are mux'd for self-refresh */ 509 /* Ensure SDRC pins are mux'd for self-refresh */
514 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 510 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
@@ -522,8 +518,7 @@ static void __init overo_init(void)
522 udelay(10); 518 udelay(10);
523 gpio_set_value(OVERO_GPIO_W2W_NRESET, 1); 519 gpio_set_value(OVERO_GPIO_W2W_NRESET, 1);
524 } else { 520 } else {
525 printk(KERN_ERR "could not obtain gpio for " 521 pr_err("could not obtain gpio for OVERO_GPIO_W2W_NRESET\n");
526 "OVERO_GPIO_W2W_NRESET\n");
527 } 522 }
528 523
529 ret = gpio_request_array(overo_bt_gpios, ARRAY_SIZE(overo_bt_gpios)); 524 ret = gpio_request_array(overo_bt_gpios, ARRAY_SIZE(overo_bt_gpios));
@@ -542,8 +537,7 @@ static void __init overo_init(void)
542 if (ret == 0) 537 if (ret == 0)
543 gpio_export(OVERO_GPIO_USBH_CPEN, 0); 538 gpio_export(OVERO_GPIO_USBH_CPEN, 0);
544 else 539 else
545 printk(KERN_ERR "could not obtain gpio for " 540 pr_err("could not obtain gpio for OVERO_GPIO_USBH_CPEN\n");
546 "OVERO_GPIO_USBH_CPEN\n");
547} 541}
548 542
549MACHINE_START(OVERO, "Gumstix Overo") 543MACHINE_START(OVERO, "Gumstix Overo")
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 0ad1bb3bdb9..45997bfbcbd 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -17,6 +17,7 @@
17#include <linux/regulator/fixed.h> 17#include <linux/regulator/fixed.h>
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 21
21#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
22#include <asm/mach-types.h> 23#include <asm/mach-types.h>
@@ -26,7 +27,7 @@
26#include <plat/usb.h> 27#include <plat/usb.h>
27#include <plat/gpmc.h> 28#include <plat/gpmc.h>
28#include "common.h" 29#include "common.h"
29#include <plat/onenand.h> 30#include <plat/serial.h>
30 31
31#include "mux.h" 32#include "mux.h"
32#include "hsmmc.h" 33#include "hsmmc.h"
@@ -72,9 +73,6 @@ static struct platform_device *rm680_peripherals_devices[] __initdata = {
72 73
73/* TWL */ 74/* TWL */
74static struct twl4030_gpio_platform_data rm680_gpio_data = { 75static struct twl4030_gpio_platform_data rm680_gpio_data = {
75 .gpio_base = OMAP_MAX_GPIO_LINES,
76 .irq_base = TWL4030_GPIO_IRQ_BASE,
77 .irq_end = TWL4030_GPIO_IRQ_END,
78 .pullups = BIT(0), 76 .pullups = BIT(0),
79 .pulldowns = BIT(1) | BIT(2) | BIT(8) | BIT(15), 77 .pulldowns = BIT(1) | BIT(2) | BIT(8) | BIT(15),
80}; 78};
@@ -87,7 +85,7 @@ static struct twl4030_platform_data rm680_twl_data = {
87static void __init rm680_i2c_init(void) 85static void __init rm680_i2c_init(void)
88{ 86{
89 omap3_pmic_get_config(&rm680_twl_data, TWL_COMMON_PDATA_USB, 0); 87 omap3_pmic_get_config(&rm680_twl_data, TWL_COMMON_PDATA_USB, 0);
90 omap_pmic_init(1, 2900, "twl5031", INT_34XX_SYS_NIRQ, &rm680_twl_data); 88 omap_pmic_init(1, 2900, "twl5031", 7 + OMAP_INTC_START, &rm680_twl_data);
91 omap_register_i2c_bus(2, 400, NULL, 0); 89 omap_register_i2c_bus(2, 400, NULL, 0);
92 omap_register_i2c_bus(3, 400, NULL, 0); 90 omap_register_i2c_bus(3, 400, NULL, 0);
93} 91}
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index df2534de336..020e03c95bf 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -25,17 +25,18 @@
25#include <linux/gpio_keys.h> 25#include <linux/gpio_keys.h>
26#include <linux/mmc/host.h> 26#include <linux/mmc/host.h>
27#include <linux/power/isp1704_charger.h> 27#include <linux/power/isp1704_charger.h>
28#include <linux/platform_data/spi-omap2-mcspi.h>
29#include <linux/platform_data/mtd-onenand-omap2.h>
30
28#include <asm/system_info.h> 31#include <asm/system_info.h>
29 32
30#include <plat/mcspi.h>
31#include <plat/board.h>
32#include "common.h" 33#include "common.h"
33#include <plat/dma.h> 34#include <plat/dma.h>
34#include <plat/gpmc.h> 35#include <plat/gpmc.h>
35#include <plat/onenand.h> 36#include <plat/omap-pm.h>
36#include <plat/gpmc-smc91x.h> 37#include "gpmc-smc91x.h"
37 38
38#include <mach/board-rx51.h> 39#include "board-rx51.h"
39 40
40#include <sound/tlv320aic3x.h> 41#include <sound/tlv320aic3x.h>
41#include <sound/tpa6130a2-plat.h> 42#include <sound/tpa6130a2-plat.h>
@@ -46,6 +47,10 @@
46#include <../drivers/staging/iio/light/tsl2563.h> 47#include <../drivers/staging/iio/light/tsl2563.h>
47#include <linux/lis3lv02d.h> 48#include <linux/lis3lv02d.h>
48 49
50#if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE)
51#include <media/ir-rx51.h>
52#endif
53
49#include "mux.h" 54#include "mux.h"
50#include "hsmmc.h" 55#include "hsmmc.h"
51#include "common-board-devices.h" 56#include "common-board-devices.h"
@@ -743,7 +748,7 @@ static struct radio_si4713_platform_data rx51_si4713_data __initdata_or_module =
743 .subdev_board_info = &rx51_si4713_board_info, 748 .subdev_board_info = &rx51_si4713_board_info,
744}; 749};
745 750
746static struct platform_device rx51_si4713_dev = { 751static struct platform_device rx51_si4713_dev __initdata_or_module = {
747 .name = "radio-si4713", 752 .name = "radio-si4713",
748 .id = -1, 753 .id = -1,
749 .dev = { 754 .dev = {
@@ -774,9 +779,6 @@ static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
774} 779}
775 780
776static struct twl4030_gpio_platform_data rx51_gpio_data = { 781static struct twl4030_gpio_platform_data rx51_gpio_data = {
777 .gpio_base = OMAP_MAX_GPIO_LINES,
778 .irq_base = TWL4030_GPIO_IRQ_BASE,
779 .irq_end = TWL4030_GPIO_IRQ_END,
780 .pulldowns = BIT(0) | BIT(1) | BIT(2) | BIT(3) 782 .pulldowns = BIT(0) | BIT(1) | BIT(2) | BIT(3)
781 | BIT(4) | BIT(5) 783 | BIT(4) | BIT(5)
782 | BIT(8) | BIT(9) | BIT(10) | BIT(11) 784 | BIT(8) | BIT(9) | BIT(10) | BIT(11)
@@ -1051,7 +1053,7 @@ static int __init rx51_i2c_init(void)
1051 rx51_twldata.vdac->constraints.apply_uV = true; 1053 rx51_twldata.vdac->constraints.apply_uV = true;
1052 rx51_twldata.vdac->constraints.name = "VDAC"; 1054 rx51_twldata.vdac->constraints.name = "VDAC";
1053 1055
1054 omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata); 1056 omap_pmic_init(1, 2200, "twl5030", 7 + OMAP_INTC_START, &rx51_twldata);
1055 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2, 1057 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
1056 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); 1058 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
1057#if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE) 1059#if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE)
@@ -1220,6 +1222,30 @@ static void __init rx51_init_tsc2005(void)
1220 gpio_to_irq(RX51_TSC2005_IRQ_GPIO); 1222 gpio_to_irq(RX51_TSC2005_IRQ_GPIO);
1221} 1223}
1222 1224
1225#if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE)
1226static struct lirc_rx51_platform_data rx51_lirc_data = {
1227 .set_max_mpu_wakeup_lat = omap_pm_set_max_mpu_wakeup_lat,
1228 .pwm_timer = 9, /* Use GPT 9 for CIR */
1229};
1230
1231static struct platform_device rx51_lirc_device = {
1232 .name = "lirc_rx51",
1233 .id = -1,
1234 .dev = {
1235 .platform_data = &rx51_lirc_data,
1236 },
1237};
1238
1239static void __init rx51_init_lirc(void)
1240{
1241 platform_device_register(&rx51_lirc_device);
1242}
1243#else
1244static void __init rx51_init_lirc(void)
1245{
1246}
1247#endif
1248
1223void __init rx51_peripherals_init(void) 1249void __init rx51_peripherals_init(void)
1224{ 1250{
1225 rx51_i2c_init(); 1251 rx51_i2c_init();
@@ -1230,6 +1256,7 @@ void __init rx51_peripherals_init(void)
1230 rx51_init_wl1251(); 1256 rx51_init_wl1251();
1231 rx51_init_tsc2005(); 1257 rx51_init_tsc2005();
1232 rx51_init_si4713(); 1258 rx51_init_si4713();
1259 rx51_init_lirc();
1233 spi_register_board_info(rx51_peripherals_spi_board_info, 1260 spi_register_board_info(rx51_peripherals_spi_board_info,
1234 ARRAY_SIZE(rx51_peripherals_spi_board_info)); 1261 ARRAY_SIZE(rx51_peripherals_spi_board_info));
1235 1262
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c
index 2c1289bd5e6..c22e111bcd0 100644
--- a/arch/arm/mach-omap2/board-rx51-video.c
+++ b/arch/arm/mach-omap2/board-rx51-video.c
@@ -17,9 +17,9 @@
17#include <asm/mach-types.h> 17#include <asm/mach-types.h>
18#include <video/omapdss.h> 18#include <video/omapdss.h>
19#include <plat/vram.h> 19#include <plat/vram.h>
20#include <plat/mcspi.h> 20#include <linux/platform_data/spi-omap2-mcspi.h>
21 21
22#include <mach/board-rx51.h> 22#include "board-rx51.h"
23 23
24#include "mux.h" 24#include "mux.h"
25 25
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 345dd931f76..7bbb05d9689 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -17,14 +17,12 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/leds.h> 19#include <linux/leds.h>
20#include <linux/platform_data/spi-omap2-mcspi.h>
20 21
21#include <mach/hardware.h>
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/mach/map.h> 24#include <asm/mach/map.h>
25 25
26#include <plat/mcspi.h>
27#include <plat/board.h>
28#include "common.h" 26#include "common.h"
29#include <plat/dma.h> 27#include <plat/dma.h>
30#include <plat/gpmc.h> 28#include <plat/gpmc.h>
diff --git a/arch/arm/mach-omap2/include/mach/board-rx51.h b/arch/arm/mach-omap2/board-rx51.h
index b76f49e7eed..b76f49e7eed 100644
--- a/arch/arm/mach-omap2/include/mach/board-rx51.h
+++ b/arch/arm/mach-omap2/board-rx51.h
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c
index d4c8392cadb..c4f8833b4c3 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -15,13 +15,10 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17 17
18#include <mach/hardware.h>
19#include <asm/mach-types.h> 18#include <asm/mach-types.h>
20#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
21#include <asm/mach/map.h> 20#include <asm/mach/map.h>
22 21
23#include <plat/irqs.h>
24#include <plat/board.h>
25#include "common.h" 22#include "common.h"
26#include <plat/usb.h> 23#include <plat/usb.h>
27 24
@@ -32,15 +29,10 @@ static struct omap_musb_board_data musb_board_data = {
32 .power = 500, 29 .power = 500,
33}; 30};
34 31
35static struct omap_board_config_kernel ti81xx_evm_config[] __initdata = {
36};
37
38static void __init ti81xx_evm_init(void) 32static void __init ti81xx_evm_init(void)
39{ 33{
40 omap_serial_init(); 34 omap_serial_init();
41 omap_sdrc_init(NULL, NULL); 35 omap_sdrc_init(NULL, NULL);
42 omap_board_config = ti81xx_evm_config;
43 omap_board_config_size = ARRAY_SIZE(ti81xx_evm_config);
44 usb_musb_init(&musb_board_data); 36 usb_musb_init(&musb_board_data);
45} 37}
46 38
diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c
index f64f4417306..afb2278a29f 100644
--- a/arch/arm/mach-omap2/board-zoom-debugboard.c
+++ b/arch/arm/mach-omap2/board-zoom-debugboard.c
@@ -18,10 +18,13 @@
18#include <linux/regulator/machine.h> 18#include <linux/regulator/machine.h>
19 19
20#include <plat/gpmc.h> 20#include <plat/gpmc.h>
21#include <plat/gpmc-smsc911x.h> 21#include "gpmc-smsc911x.h"
22 22
23#include <mach/board-zoom.h> 23#include <mach/board-zoom.h>
24 24
25#include "soc.h"
26#include "common.h"
27
25#define ZOOM_SMSC911X_CS 7 28#define ZOOM_SMSC911X_CS 7
26#define ZOOM_SMSC911X_GPIO 158 29#define ZOOM_SMSC911X_GPIO 158
27#define ZOOM_QUADUART_CS 3 30#define ZOOM_QUADUART_CS 3
@@ -81,8 +84,7 @@ static inline void __init zoom_init_quaduart(void)
81 quart_cs = ZOOM_QUADUART_CS; 84 quart_cs = ZOOM_QUADUART_CS;
82 85
83 if (gpmc_cs_request(quart_cs, SZ_1M, &cs_mem_base) < 0) { 86 if (gpmc_cs_request(quart_cs, SZ_1M, &cs_mem_base) < 0) {
84 printk(KERN_ERR "Failed to request GPMC mem" 87 pr_err("Failed to request GPMC mem for Quad UART(TL16CP754C)\n");
85 "for Quad UART(TL16CP754C)\n");
86 return; 88 return;
87 } 89 }
88 90
@@ -104,8 +106,8 @@ static inline int omap_zoom_debugboard_detect(void)
104 106
105 if (gpio_request_one(debug_board_detect, GPIOF_IN, 107 if (gpio_request_one(debug_board_detect, GPIOF_IN,
106 "Zoom debug board detect") < 0) { 108 "Zoom debug board detect") < 0) {
107 printk(KERN_ERR "Failed to request GPIO%d for Zoom debug" 109 pr_err("Failed to request GPIO%d for Zoom debug board detect\n",
108 "board detect\n", debug_board_detect); 110 debug_board_detect);
109 return 0; 111 return 0;
110 } 112 }
111 113
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c
index 28187f134ff..b940ab2259f 100644
--- a/arch/arm/mach-omap2/board-zoom-display.c
+++ b/arch/arm/mach-omap2/board-zoom-display.c
@@ -14,10 +14,12 @@
14#include <linux/gpio.h> 14#include <linux/gpio.h>
15#include <linux/i2c/twl.h> 15#include <linux/i2c/twl.h>
16#include <linux/spi/spi.h> 16#include <linux/spi/spi.h>
17#include <plat/mcspi.h> 17#include <linux/platform_data/spi-omap2-mcspi.h>
18#include <video/omapdss.h> 18#include <video/omapdss.h>
19#include <mach/board-zoom.h> 19#include <mach/board-zoom.h>
20 20
21#include "common.h"
22
21#define LCD_PANEL_RESET_GPIO_PROD 96 23#define LCD_PANEL_RESET_GPIO_PROD 96
22#define LCD_PANEL_RESET_GPIO_PILOT 55 24#define LCD_PANEL_RESET_GPIO_PILOT 55
23#define LCD_PANEL_QVGA_GPIO 56 25#define LCD_PANEL_QVGA_GPIO 56
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index b797cb27961..c166fe1fdff 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -19,6 +19,7 @@
19#include <linux/regulator/fixed.h> 19#include <linux/regulator/fixed.h>
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 23
23#include <asm/mach-types.h> 24#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
@@ -34,6 +35,7 @@
34#include "common-board-devices.h" 35#include "common-board-devices.h"
35 36
36#define OMAP_ZOOM_WLAN_PMENA_GPIO (101) 37#define OMAP_ZOOM_WLAN_PMENA_GPIO (101)
38#define ZOOM2_HEADSET_EXTMUTE_GPIO (153)
37#define OMAP_ZOOM_WLAN_IRQ_GPIO (162) 39#define OMAP_ZOOM_WLAN_IRQ_GPIO (162)
38 40
39#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES) 41#define LCD_PANEL_ENABLE_GPIO (7 + OMAP_MAX_GPIO_LINES)
@@ -193,8 +195,7 @@ static struct platform_device omap_vwlan_device = {
193}; 195};
194 196
195static struct wl12xx_platform_data omap_zoom_wlan_data __initdata = { 197static struct wl12xx_platform_data omap_zoom_wlan_data __initdata = {
196 /* ZOOM ref clock is 26 MHz */ 198 .board_ref_clock = WL12XX_REFCLOCK_26, /* 26 MHz */
197 .board_ref_clock = 1,
198}; 199};
199 200
200static struct omap2_hsmmc_info mmc[] = { 201static struct omap2_hsmmc_info mmc[] = {
@@ -244,16 +245,7 @@ static int zoom_twl_gpio_setup(struct device *dev,
244 return ret; 245 return ret;
245} 246}
246 247
247/* EXTMUTE callback function */
248static void zoom2_set_hs_extmute(int mute)
249{
250 gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute);
251}
252
253static struct twl4030_gpio_platform_data zoom_gpio_data = { 248static struct twl4030_gpio_platform_data zoom_gpio_data = {
254 .gpio_base = OMAP_MAX_GPIO_LINES,
255 .irq_base = TWL4030_GPIO_IRQ_BASE,
256 .irq_end = TWL4030_GPIO_IRQ_END,
257 .setup = zoom_twl_gpio_setup, 249 .setup = zoom_twl_gpio_setup,
258}; 250};
259 251
@@ -279,9 +271,9 @@ static int __init omap_i2c_init(void)
279 271
280 codec_data->ramp_delay_value = 3; /* 161 ms */ 272 codec_data->ramp_delay_value = 3; /* 161 ms */
281 codec_data->hs_extmute = 1; 273 codec_data->hs_extmute = 1;
282 codec_data->set_hs_extmute = zoom2_set_hs_extmute; 274 codec_data->hs_extmute_gpio = ZOOM2_HEADSET_EXTMUTE_GPIO;
283 } 275 }
284 omap_pmic_init(1, 2400, "twl5030", INT_34XX_SYS_NIRQ, &zoom_twldata); 276 omap_pmic_init(1, 2400, "twl5030", 7 + OMAP_INTC_START, &zoom_twldata);
285 omap_register_i2c_bus(2, 400, NULL, 0); 277 omap_register_i2c_bus(2, 400, NULL, 0);
286 omap_register_i2c_bus(3, 400, NULL, 0); 278 omap_register_i2c_bus(3, 400, NULL, 0);
287 return 0; 279 return 0;
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 4e7e56142e6..4994438e1f4 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -22,7 +22,6 @@
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23 23
24#include "common.h" 24#include "common.h"
25#include <plat/board.h>
26#include <plat/usb.h> 25#include <plat/usb.h>
27 26
28#include <mach/board-zoom.h> 27#include <mach/board-zoom.h>
diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c
index b19a1f7234a..c2d15212d64 100644
--- a/arch/arm/mach-omap2/clkt2xxx_apll.c
+++ b/arch/arm/mach-omap2/clkt2xxx_apll.c
@@ -59,7 +59,7 @@ static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask)
59 omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); 59 omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
60 60
61 omap2_cm_wait_idlest(cm_idlest_pll, status_mask, 61 omap2_cm_wait_idlest(cm_idlest_pll, status_mask,
62 OMAP24XX_CM_IDLEST_VAL, clk->name); 62 OMAP24XX_CM_IDLEST_VAL, __clk_get_name(clk));
63 63
64 /* 64 /*
65 * REVISIT: Should we return an error code if omap2_wait_clock_ready() 65 * REVISIT: Should we return an error code if omap2_wait_clock_ready()
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
index 3d9d746b221..3524f0e7b6d 100644
--- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
+++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
@@ -33,11 +33,11 @@
33#include <linux/cpufreq.h> 33#include <linux/cpufreq.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35 35
36#include <plat/cpu.h>
37#include <plat/clock.h> 36#include <plat/clock.h>
38#include <plat/sram.h> 37#include <plat/sram.h>
39#include <plat/sdrc.h> 38#include <plat/sdrc.h>
40 39
40#include "soc.h"
41#include "clock.h" 41#include "clock.h"
42#include "clock2xxx.h" 42#include "clock2xxx.h"
43#include "opp2xxx.h" 43#include "opp2xxx.h"
@@ -68,14 +68,15 @@ unsigned long omap2_table_mpu_recalc(struct clk *clk)
68long omap2_round_to_table_rate(struct clk *clk, unsigned long rate) 68long omap2_round_to_table_rate(struct clk *clk, unsigned long rate)
69{ 69{
70 const struct prcm_config *ptr; 70 const struct prcm_config *ptr;
71 long highest_rate; 71 long highest_rate, sys_clk_rate;
72 72
73 highest_rate = -EINVAL; 73 highest_rate = -EINVAL;
74 sys_clk_rate = __clk_get_rate(sclk);
74 75
75 for (ptr = rate_table; ptr->mpu_speed; ptr++) { 76 for (ptr = rate_table; ptr->mpu_speed; ptr++) {
76 if (!(ptr->flags & cpu_mask)) 77 if (!(ptr->flags & cpu_mask))
77 continue; 78 continue;
78 if (ptr->xtal_speed != sclk->rate) 79 if (ptr->xtal_speed != sys_clk_rate)
79 continue; 80 continue;
80 81
81 highest_rate = ptr->mpu_speed; 82 highest_rate = ptr->mpu_speed;
@@ -94,12 +95,15 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate)
94 const struct prcm_config *prcm; 95 const struct prcm_config *prcm;
95 unsigned long found_speed = 0; 96 unsigned long found_speed = 0;
96 unsigned long flags; 97 unsigned long flags;
98 long sys_clk_rate;
99
100 sys_clk_rate = __clk_get_rate(sclk);
97 101
98 for (prcm = rate_table; prcm->mpu_speed; prcm++) { 102 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
99 if (!(prcm->flags & cpu_mask)) 103 if (!(prcm->flags & cpu_mask))
100 continue; 104 continue;
101 105
102 if (prcm->xtal_speed != sclk->rate) 106 if (prcm->xtal_speed != sys_clk_rate)
103 continue; 107 continue;
104 108
105 if (prcm->mpu_speed <= rate) { 109 if (prcm->mpu_speed <= rate) {
diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
index d6e34dd9e7e..7c6da2f731d 100644
--- a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
+++ b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
@@ -56,6 +56,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
56 struct omap_sdrc_params *sdrc_cs0; 56 struct omap_sdrc_params *sdrc_cs0;
57 struct omap_sdrc_params *sdrc_cs1; 57 struct omap_sdrc_params *sdrc_cs1;
58 int ret; 58 int ret;
59 unsigned long clkrate;
59 60
60 if (!clk || !rate) 61 if (!clk || !rate)
61 return -EINVAL; 62 return -EINVAL;
@@ -64,11 +65,12 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
64 if (validrate != rate) 65 if (validrate != rate)
65 return -EINVAL; 66 return -EINVAL;
66 67
67 sdrcrate = sdrc_ick_p->rate; 68 sdrcrate = __clk_get_rate(sdrc_ick_p);
68 if (rate > clk->rate) 69 clkrate = __clk_get_rate(clk);
69 sdrcrate <<= ((rate / clk->rate) >> 1); 70 if (rate > clkrate)
71 sdrcrate <<= ((rate / clkrate) >> 1);
70 else 72 else
71 sdrcrate >>= ((clk->rate / rate) >> 1); 73 sdrcrate >>= ((clkrate / rate) >> 1);
72 74
73 ret = omap2_sdrc_get_params(sdrcrate, &sdrc_cs0, &sdrc_cs1); 75 ret = omap2_sdrc_get_params(sdrcrate, &sdrc_cs0, &sdrc_cs1);
74 if (ret) 76 if (ret)
@@ -82,7 +84,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
82 /* 84 /*
83 * XXX This only needs to be done when the CPU frequency changes 85 * XXX This only needs to be done when the CPU frequency changes
84 */ 86 */
85 _mpurate = arm_fck_p->rate / CYCLES_PER_MHZ; 87 _mpurate = __clk_get_rate(arm_fck_p) / CYCLES_PER_MHZ;
86 c = (_mpurate << SDRC_MPURATE_SCALE) >> SDRC_MPURATE_BASE_SHIFT; 88 c = (_mpurate << SDRC_MPURATE_SCALE) >> SDRC_MPURATE_BASE_SHIFT;
87 c += 1; /* for safety */ 89 c += 1; /* for safety */
88 c *= SDRC_MPURATE_LOOPS; 90 c *= SDRC_MPURATE_LOOPS;
@@ -90,28 +92,26 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
90 if (c == 0) 92 if (c == 0)
91 c = 1; 93 c = 1;
92 94
93 pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate, 95 pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n",
94 validrate); 96 clkrate, validrate);
95 pr_debug("clock: SDRC CS0 timing params used:" 97 pr_debug("clock: SDRC CS0 timing params used: RFR %08x CTRLA %08x CTRLB %08x MR %08x\n",
96 " RFR %08x CTRLA %08x CTRLB %08x MR %08x\n",
97 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, 98 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
98 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr); 99 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr);
99 if (sdrc_cs1) 100 if (sdrc_cs1)
100 pr_debug("clock: SDRC CS1 timing params used: " 101 pr_debug("clock: SDRC CS1 timing params used: RFR %08x CTRLA %08x CTRLB %08x MR %08x\n",
101 " RFR %08x CTRLA %08x CTRLB %08x MR %08x\n", 102 sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla,
102 sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla, 103 sdrc_cs1->actim_ctrlb, sdrc_cs1->mr);
103 sdrc_cs1->actim_ctrlb, sdrc_cs1->mr);
104 104
105 if (sdrc_cs1) 105 if (sdrc_cs1)
106 omap3_configure_core_dpll( 106 omap3_configure_core_dpll(
107 new_div, unlock_dll, c, rate > clk->rate, 107 new_div, unlock_dll, c, rate > clkrate,
108 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, 108 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
109 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr, 109 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr,
110 sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla, 110 sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla,
111 sdrc_cs1->actim_ctrlb, sdrc_cs1->mr); 111 sdrc_cs1->actim_ctrlb, sdrc_cs1->mr);
112 else 112 else
113 omap3_configure_core_dpll( 113 omap3_configure_core_dpll(
114 new_div, unlock_dll, c, rate > clk->rate, 114 new_div, unlock_dll, c, rate > clkrate,
115 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, 115 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
116 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr, 116 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr,
117 0, 0, 0, 0); 117 0, 0, 0, 0);
diff --git a/arch/arm/mach-omap2/clkt_clksel.c b/arch/arm/mach-omap2/clkt_clksel.c
index 04d551b1f7f..3ff22114d70 100644
--- a/arch/arm/mach-omap2/clkt_clksel.c
+++ b/arch/arm/mach-omap2/clkt_clksel.c
@@ -71,8 +71,8 @@ static const struct clksel *_get_clksel_by_parent(struct clk *clk,
71 71
72 if (!clks->parent) { 72 if (!clks->parent) {
73 /* This indicates a data problem */ 73 /* This indicates a data problem */
74 WARN(1, "clock: Could not find parent clock %s in clksel array " 74 WARN(1, "clock: %s: could not find parent clock %s in clksel array\n",
75 "of clock %s\n", src_clk->name, clk->name); 75 __clk_get_name(clk), __clk_get_name(src_clk));
76 return NULL; 76 return NULL;
77 } 77 }
78 78
@@ -126,8 +126,9 @@ static u8 _get_div_and_fieldval(struct clk *src_clk, struct clk *clk,
126 126
127 if (max_div == 0) { 127 if (max_div == 0) {
128 /* This indicates an error in the clksel data */ 128 /* This indicates an error in the clksel data */
129 WARN(1, "clock: Could not find divisor for clock %s parent %s" 129 WARN(1, "clock: %s: could not find divisor for parent %s\n",
130 "\n", clk->name, src_clk->parent->name); 130 __clk_get_name(clk),
131 __clk_get_name(__clk_get_parent(src_clk)));
131 return 0; 132 return 0;
132 } 133 }
133 134
@@ -176,8 +177,10 @@ static u32 _clksel_to_divisor(struct clk *clk, u32 field_val)
176{ 177{
177 const struct clksel *clks; 178 const struct clksel *clks;
178 const struct clksel_rate *clkr; 179 const struct clksel_rate *clkr;
180 struct clk *parent;
179 181
180 clks = _get_clksel_by_parent(clk, clk->parent); 182 parent = __clk_get_parent(clk);
183 clks = _get_clksel_by_parent(clk, parent);
181 if (!clks) 184 if (!clks)
182 return 0; 185 return 0;
183 186
@@ -191,8 +194,8 @@ static u32 _clksel_to_divisor(struct clk *clk, u32 field_val)
191 194
192 if (!clkr->div) { 195 if (!clkr->div) {
193 /* This indicates a data error */ 196 /* This indicates a data error */
194 WARN(1, "clock: Could not find fieldval %d for clock %s parent " 197 WARN(1, "clock: %s: could not find fieldval %d for parent %s\n",
195 "%s\n", field_val, clk->name, clk->parent->name); 198 __clk_get_name(clk), field_val, __clk_get_name(parent));
196 return 0; 199 return 0;
197 } 200 }
198 201
@@ -213,11 +216,13 @@ static u32 _divisor_to_clksel(struct clk *clk, u32 div)
213{ 216{
214 const struct clksel *clks; 217 const struct clksel *clks;
215 const struct clksel_rate *clkr; 218 const struct clksel_rate *clkr;
219 struct clk *parent;
216 220
217 /* should never happen */ 221 /* should never happen */
218 WARN_ON(div == 0); 222 WARN_ON(div == 0);
219 223
220 clks = _get_clksel_by_parent(clk, clk->parent); 224 parent = __clk_get_parent(clk);
225 clks = _get_clksel_by_parent(clk, parent);
221 if (!clks) 226 if (!clks)
222 return ~0; 227 return ~0;
223 228
@@ -230,8 +235,8 @@ static u32 _divisor_to_clksel(struct clk *clk, u32 div)
230 } 235 }
231 236
232 if (!clkr->div) { 237 if (!clkr->div) {
233 pr_err("clock: Could not find divisor %d for clock %s parent " 238 pr_err("clock: %s: could not find divisor %d for parent %s\n",
234 "%s\n", div, clk->name, clk->parent->name); 239 __clk_get_name(clk), div, __clk_get_name(parent));
235 return ~0; 240 return ~0;
236 } 241 }
237 242
@@ -281,16 +286,23 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
281 const struct clksel *clks; 286 const struct clksel *clks;
282 const struct clksel_rate *clkr; 287 const struct clksel_rate *clkr;
283 u32 last_div = 0; 288 u32 last_div = 0;
289 struct clk *parent;
290 unsigned long parent_rate;
291 const char *clk_name;
292
293 parent = __clk_get_parent(clk);
294 parent_rate = __clk_get_rate(parent);
295 clk_name = __clk_get_name(clk);
284 296
285 if (!clk->clksel || !clk->clksel_mask) 297 if (!clk->clksel || !clk->clksel_mask)
286 return ~0; 298 return ~0;
287 299
288 pr_debug("clock: clksel_round_rate_div: %s target_rate %ld\n", 300 pr_debug("clock: clksel_round_rate_div: %s target_rate %ld\n",
289 clk->name, target_rate); 301 clk_name, target_rate);
290 302
291 *new_div = 1; 303 *new_div = 1;
292 304
293 clks = _get_clksel_by_parent(clk, clk->parent); 305 clks = _get_clksel_by_parent(clk, parent);
294 if (!clks) 306 if (!clks)
295 return ~0; 307 return ~0;
296 308
@@ -300,30 +312,29 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
300 312
301 /* Sanity check */ 313 /* Sanity check */
302 if (clkr->div <= last_div) 314 if (clkr->div <= last_div)
303 pr_err("clock: clksel_rate table not sorted " 315 pr_err("clock: %s: clksel_rate table not sorted\n",
304 "for clock %s", clk->name); 316 clk_name);
305 317
306 last_div = clkr->div; 318 last_div = clkr->div;
307 319
308 test_rate = clk->parent->rate / clkr->div; 320 test_rate = parent_rate / clkr->div;
309 321
310 if (test_rate <= target_rate) 322 if (test_rate <= target_rate)
311 break; /* found it */ 323 break; /* found it */
312 } 324 }
313 325
314 if (!clkr->div) { 326 if (!clkr->div) {
315 pr_err("clock: Could not find divisor for target " 327 pr_err("clock: %s: could not find divisor for target rate %ld for parent %s\n",
316 "rate %ld for clock %s parent %s\n", target_rate, 328 clk_name, target_rate, __clk_get_name(parent));
317 clk->name, clk->parent->name);
318 return ~0; 329 return ~0;
319 } 330 }
320 331
321 *new_div = clkr->div; 332 *new_div = clkr->div;
322 333
323 pr_debug("clock: new_div = %d, new_rate = %ld\n", *new_div, 334 pr_debug("clock: new_div = %d, new_rate = %ld\n", *new_div,
324 (clk->parent->rate / clkr->div)); 335 (parent_rate / clkr->div));
325 336
326 return clk->parent->rate / clkr->div; 337 return parent_rate / clkr->div;
327} 338}
328 339
329/* 340/*
@@ -345,10 +356,15 @@ void omap2_init_clksel_parent(struct clk *clk)
345 const struct clksel *clks; 356 const struct clksel *clks;
346 const struct clksel_rate *clkr; 357 const struct clksel_rate *clkr;
347 u32 r, found = 0; 358 u32 r, found = 0;
359 struct clk *parent;
360 const char *clk_name;
348 361
349 if (!clk->clksel || !clk->clksel_mask) 362 if (!clk->clksel || !clk->clksel_mask)
350 return; 363 return;
351 364
365 parent = __clk_get_parent(clk);
366 clk_name = __clk_get_name(clk);
367
352 r = __raw_readl(clk->clksel_reg) & clk->clksel_mask; 368 r = __raw_readl(clk->clksel_reg) & clk->clksel_mask;
353 r >>= __ffs(clk->clksel_mask); 369 r >>= __ffs(clk->clksel_mask);
354 370
@@ -358,14 +374,15 @@ void omap2_init_clksel_parent(struct clk *clk)
358 continue; 374 continue;
359 375
360 if (clkr->val == r) { 376 if (clkr->val == r) {
361 if (clk->parent != clks->parent) { 377 if (parent != clks->parent) {
362 pr_debug("clock: inited %s parent " 378 pr_debug("clock: %s: inited parent to %s (was %s)\n",
363 "to %s (was %s)\n", 379 clk_name,
364 clk->name, clks->parent->name, 380 __clk_get_name(clks->parent),
365 ((clk->parent) ? 381 ((parent) ?
366 clk->parent->name : "NULL")); 382 __clk_get_name(parent) :
383 "NULL"));
367 clk_reparent(clk, clks->parent); 384 clk_reparent(clk, clks->parent);
368 }; 385 }
369 found = 1; 386 found = 1;
370 } 387 }
371 } 388 }
@@ -373,7 +390,7 @@ void omap2_init_clksel_parent(struct clk *clk)
373 390
374 /* This indicates a data error */ 391 /* This indicates a data error */
375 WARN(!found, "clock: %s: init parent: could not find regval %0x\n", 392 WARN(!found, "clock: %s: init parent: could not find regval %0x\n",
376 clk->name, r); 393 clk_name, r);
377 394
378 return; 395 return;
379} 396}
@@ -391,15 +408,17 @@ unsigned long omap2_clksel_recalc(struct clk *clk)
391{ 408{
392 unsigned long rate; 409 unsigned long rate;
393 u32 div = 0; 410 u32 div = 0;
411 struct clk *parent;
394 412
395 div = _read_divisor(clk); 413 div = _read_divisor(clk);
396 if (div == 0) 414 if (div == 0)
397 return clk->rate; 415 return __clk_get_rate(clk);
398 416
399 rate = clk->parent->rate / div; 417 parent = __clk_get_parent(clk);
418 rate = __clk_get_rate(parent) / div;
400 419
401 pr_debug("clock: %s: recalc'd rate is %ld (div %d)\n", clk->name, 420 pr_debug("clock: %s: recalc'd rate is %ld (div %d)\n",
402 rate, div); 421 __clk_get_name(clk), rate, div);
403 422
404 return rate; 423 return rate;
405} 424}
@@ -454,9 +473,10 @@ int omap2_clksel_set_rate(struct clk *clk, unsigned long rate)
454 473
455 _write_clksel_reg(clk, field_val); 474 _write_clksel_reg(clk, field_val);
456 475
457 clk->rate = clk->parent->rate / new_div; 476 clk->rate = __clk_get_rate(__clk_get_parent(clk)) / new_div;
458 477
459 pr_debug("clock: %s: set rate to %ld\n", clk->name, clk->rate); 478 pr_debug("clock: %s: set rate to %ld\n", __clk_get_name(clk),
479 __clk_get_rate(clk));
460 480
461 return 0; 481 return 0;
462} 482}
@@ -498,13 +518,15 @@ int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent)
498 clk_reparent(clk, new_parent); 518 clk_reparent(clk, new_parent);
499 519
500 /* CLKSEL clocks follow their parents' rates, divided by a divisor */ 520 /* CLKSEL clocks follow their parents' rates, divided by a divisor */
501 clk->rate = new_parent->rate; 521 clk->rate = __clk_get_rate(new_parent);
502 522
503 if (parent_div > 0) 523 if (parent_div > 0)
504 clk->rate /= parent_div; 524 __clk_get_rate(clk) /= parent_div;
505 525
506 pr_debug("clock: %s: set parent to %s (new rate %ld)\n", 526 pr_debug("clock: %s: set parent to %s (new rate %ld)\n",
507 clk->name, clk->parent->name, clk->rate); 527 __clk_get_name(clk),
528 __clk_get_name(__clk_get_parent(clk)),
529 __clk_get_rate(clk));
508 530
509 return 0; 531 return 0;
510} 532}
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c
index cd7fd0f9114..80411142f48 100644
--- a/arch/arm/mach-omap2/clkt_dpll.c
+++ b/arch/arm/mach-omap2/clkt_dpll.c
@@ -22,8 +22,8 @@
22#include <asm/div64.h> 22#include <asm/div64.h>
23 23
24#include <plat/clock.h> 24#include <plat/clock.h>
25#include <plat/cpu.h>
26 25
26#include "soc.h"
27#include "clock.h" 27#include "clock.h"
28#include "cm-regbits-24xx.h" 28#include "cm-regbits-24xx.h"
29#include "cm-regbits-34xx.h" 29#include "cm-regbits-34xx.h"
@@ -87,7 +87,7 @@ static int _dpll_test_fint(struct clk *clk, u8 n)
87 dd = clk->dpll_data; 87 dd = clk->dpll_data;
88 88
89 /* DPLL divider must result in a valid jitter correction val */ 89 /* DPLL divider must result in a valid jitter correction val */
90 fint = clk->parent->rate / n; 90 fint = __clk_get_rate(__clk_get_parent(clk)) / n;
91 91
92 if (cpu_is_omap24xx()) { 92 if (cpu_is_omap24xx()) {
93 /* Should not be called for OMAP2, so warn if it is called */ 93 /* Should not be called for OMAP2, so warn if it is called */
@@ -105,13 +105,13 @@ static int _dpll_test_fint(struct clk *clk, u8 n)
105 } 105 }
106 106
107 if (fint < fint_min) { 107 if (fint < fint_min) {
108 pr_debug("rejecting n=%d due to Fint failure, " 108 pr_debug("rejecting n=%d due to Fint failure, lowering max_divider\n",
109 "lowering max_divider\n", n); 109 n);
110 dd->max_divider = n; 110 dd->max_divider = n;
111 ret = DPLL_FINT_UNDERFLOW; 111 ret = DPLL_FINT_UNDERFLOW;
112 } else if (fint > fint_max) { 112 } else if (fint > fint_max) {
113 pr_debug("rejecting n=%d due to Fint failure, " 113 pr_debug("rejecting n=%d due to Fint failure, boosting min_divider\n",
114 "boosting min_divider\n", n); 114 n);
115 dd->min_divider = n; 115 dd->min_divider = n;
116 ret = DPLL_FINT_INVALID; 116 ret = DPLL_FINT_INVALID;
117 } else if (cpu_is_omap3430() && fint > OMAP3430_DPLL_FINT_BAND1_MAX && 117 } else if (cpu_is_omap3430() && fint > OMAP3430_DPLL_FINT_BAND1_MAX &&
@@ -211,7 +211,7 @@ void omap2_init_dpll_parent(struct clk *clk)
211 if (v == OMAP3XXX_EN_DPLL_LPBYPASS || 211 if (v == OMAP3XXX_EN_DPLL_LPBYPASS ||
212 v == OMAP3XXX_EN_DPLL_FRBYPASS) 212 v == OMAP3XXX_EN_DPLL_FRBYPASS)
213 clk_reparent(clk, dd->clk_bypass); 213 clk_reparent(clk, dd->clk_bypass);
214 } else if (cpu_is_omap44xx()) { 214 } else if (soc_is_am33xx() || cpu_is_omap44xx()) {
215 if (v == OMAP4XXX_EN_DPLL_LPBYPASS || 215 if (v == OMAP4XXX_EN_DPLL_LPBYPASS ||
216 v == OMAP4XXX_EN_DPLL_FRBYPASS || 216 v == OMAP4XXX_EN_DPLL_FRBYPASS ||
217 v == OMAP4XXX_EN_DPLL_MNBYPASS) 217 v == OMAP4XXX_EN_DPLL_MNBYPASS)
@@ -252,16 +252,16 @@ u32 omap2_get_dpll_rate(struct clk *clk)
252 if (cpu_is_omap24xx()) { 252 if (cpu_is_omap24xx()) {
253 if (v == OMAP2XXX_EN_DPLL_LPBYPASS || 253 if (v == OMAP2XXX_EN_DPLL_LPBYPASS ||
254 v == OMAP2XXX_EN_DPLL_FRBYPASS) 254 v == OMAP2XXX_EN_DPLL_FRBYPASS)
255 return dd->clk_bypass->rate; 255 return __clk_get_rate(dd->clk_bypass);
256 } else if (cpu_is_omap34xx()) { 256 } else if (cpu_is_omap34xx()) {
257 if (v == OMAP3XXX_EN_DPLL_LPBYPASS || 257 if (v == OMAP3XXX_EN_DPLL_LPBYPASS ||
258 v == OMAP3XXX_EN_DPLL_FRBYPASS) 258 v == OMAP3XXX_EN_DPLL_FRBYPASS)
259 return dd->clk_bypass->rate; 259 return __clk_get_rate(dd->clk_bypass);
260 } else if (cpu_is_omap44xx()) { 260 } else if (soc_is_am33xx() || cpu_is_omap44xx()) {
261 if (v == OMAP4XXX_EN_DPLL_LPBYPASS || 261 if (v == OMAP4XXX_EN_DPLL_LPBYPASS ||
262 v == OMAP4XXX_EN_DPLL_FRBYPASS || 262 v == OMAP4XXX_EN_DPLL_FRBYPASS ||
263 v == OMAP4XXX_EN_DPLL_MNBYPASS) 263 v == OMAP4XXX_EN_DPLL_MNBYPASS)
264 return dd->clk_bypass->rate; 264 return __clk_get_rate(dd->clk_bypass);
265 } 265 }
266 266
267 v = __raw_readl(dd->mult_div1_reg); 267 v = __raw_readl(dd->mult_div1_reg);
@@ -270,7 +270,7 @@ u32 omap2_get_dpll_rate(struct clk *clk)
270 dpll_div = v & dd->div1_mask; 270 dpll_div = v & dd->div1_mask;
271 dpll_div >>= __ffs(dd->div1_mask); 271 dpll_div >>= __ffs(dd->div1_mask);
272 272
273 dpll_clk = (long long)dd->clk_ref->rate * dpll_mult; 273 dpll_clk = (long long) __clk_get_rate(dd->clk_ref) * dpll_mult;
274 do_div(dpll_clk, dpll_div + 1); 274 do_div(dpll_clk, dpll_div + 1);
275 275
276 return dpll_clk; 276 return dpll_clk;
@@ -296,16 +296,20 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
296 unsigned long scaled_rt_rp; 296 unsigned long scaled_rt_rp;
297 unsigned long new_rate = 0; 297 unsigned long new_rate = 0;
298 struct dpll_data *dd; 298 struct dpll_data *dd;
299 unsigned long ref_rate;
300 const char *clk_name;
299 301
300 if (!clk || !clk->dpll_data) 302 if (!clk || !clk->dpll_data)
301 return ~0; 303 return ~0;
302 304
303 dd = clk->dpll_data; 305 dd = clk->dpll_data;
304 306
307 ref_rate = __clk_get_rate(dd->clk_ref);
308 clk_name = __clk_get_name(clk);
305 pr_debug("clock: %s: starting DPLL round_rate, target rate %ld\n", 309 pr_debug("clock: %s: starting DPLL round_rate, target rate %ld\n",
306 clk->name, target_rate); 310 clk_name, target_rate);
307 311
308 scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR); 312 scaled_rt_rp = target_rate / (ref_rate / DPLL_SCALE_FACTOR);
309 scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR; 313 scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR;
310 314
311 dd->last_rounded_rate = 0; 315 dd->last_rounded_rate = 0;
@@ -332,14 +336,14 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
332 break; 336 break;
333 337
334 r = _dpll_test_mult(&m, n, &new_rate, target_rate, 338 r = _dpll_test_mult(&m, n, &new_rate, target_rate,
335 dd->clk_ref->rate); 339 ref_rate);
336 340
337 /* m can't be set low enough for this n - try with a larger n */ 341 /* m can't be set low enough for this n - try with a larger n */
338 if (r == DPLL_MULT_UNDERFLOW) 342 if (r == DPLL_MULT_UNDERFLOW)
339 continue; 343 continue;
340 344
341 pr_debug("clock: %s: m = %d: n = %d: new_rate = %ld\n", 345 pr_debug("clock: %s: m = %d: n = %d: new_rate = %ld\n",
342 clk->name, m, n, new_rate); 346 clk_name, m, n, new_rate);
343 347
344 if (target_rate == new_rate) { 348 if (target_rate == new_rate) {
345 dd->last_rounded_m = m; 349 dd->last_rounded_m = m;
@@ -350,8 +354,8 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
350 } 354 }
351 355
352 if (target_rate != new_rate) { 356 if (target_rate != new_rate) {
353 pr_debug("clock: %s: cannot round to rate %ld\n", clk->name, 357 pr_debug("clock: %s: cannot round to rate %ld\n",
354 target_rate); 358 clk_name, target_rate);
355 return ~0; 359 return ~0;
356 } 360 }
357 361
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index ea3f565ba1a..961ac8f7e13 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -22,14 +22,16 @@
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <trace/events/power.h>
26 25
27#include <asm/cpu.h> 26#include <asm/cpu.h>
27
28#include <plat/clock.h> 28#include <plat/clock.h>
29#include "clockdomain.h"
30#include <plat/cpu.h>
31#include <plat/prcm.h> 29#include <plat/prcm.h>
32 30
31#include <trace/events/power.h>
32
33#include "soc.h"
34#include "clockdomain.h"
33#include "clock.h" 35#include "clock.h"
34#include "cm2xxx_3xxx.h" 36#include "cm2xxx_3xxx.h"
35#include "cm-regbits-24xx.h" 37#include "cm-regbits-24xx.h"
@@ -76,7 +78,7 @@ static void _omap2_module_wait_ready(struct clk *clk)
76 clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit, &idlest_val); 78 clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit, &idlest_val);
77 79
78 omap2_cm_wait_idlest(idlest_reg, (1 << idlest_bit), idlest_val, 80 omap2_cm_wait_idlest(idlest_reg, (1 << idlest_bit), idlest_val,
79 clk->name); 81 __clk_get_name(clk));
80} 82}
81 83
82/* Public functions */ 84/* Public functions */
@@ -92,18 +94,21 @@ static void _omap2_module_wait_ready(struct clk *clk)
92void omap2_init_clk_clkdm(struct clk *clk) 94void omap2_init_clk_clkdm(struct clk *clk)
93{ 95{
94 struct clockdomain *clkdm; 96 struct clockdomain *clkdm;
97 const char *clk_name;
95 98
96 if (!clk->clkdm_name) 99 if (!clk->clkdm_name)
97 return; 100 return;
98 101
102 clk_name = __clk_get_name(clk);
103
99 clkdm = clkdm_lookup(clk->clkdm_name); 104 clkdm = clkdm_lookup(clk->clkdm_name);
100 if (clkdm) { 105 if (clkdm) {
101 pr_debug("clock: associated clk %s to clkdm %s\n", 106 pr_debug("clock: associated clk %s to clkdm %s\n",
102 clk->name, clk->clkdm_name); 107 clk_name, clk->clkdm_name);
103 clk->clkdm = clkdm; 108 clk->clkdm = clkdm;
104 } else { 109 } else {
105 pr_debug("clock: could not associate clk %s to " 110 pr_debug("clock: could not associate clk %s to clkdm %s\n",
106 "clkdm %s\n", clk->name, clk->clkdm_name); 111 clk_name, clk->clkdm_name);
107 } 112 }
108} 113}
109 114
@@ -226,8 +231,7 @@ void omap2_dflt_clk_disable(struct clk *clk)
226 * 'Independent' here refers to a clock which is not 231 * 'Independent' here refers to a clock which is not
227 * controlled by its parent. 232 * controlled by its parent.
228 */ 233 */
229 printk(KERN_ERR "clock: clk_disable called on independent " 234 pr_err("clock: clk_disable called on independent clock %s which has no enable_reg\n", clk->name);
230 "clock %s which has no enable_reg\n", clk->name);
231 return; 235 return;
232 } 236 }
233 237
@@ -270,8 +274,7 @@ const struct clkops clkops_omap2_dflt = {
270void omap2_clk_disable(struct clk *clk) 274void omap2_clk_disable(struct clk *clk)
271{ 275{
272 if (clk->usecount == 0) { 276 if (clk->usecount == 0) {
273 WARN(1, "clock: %s: omap2_clk_disable() called, but usecount " 277 WARN(1, "clock: %s: omap2_clk_disable() called, but usecount already 0?", clk->name);
274 "already 0?", clk->name);
275 return; 278 return;
276 } 279 }
277 280
@@ -332,8 +335,8 @@ int omap2_clk_enable(struct clk *clk)
332 if (clkdm_control && clk->clkdm) { 335 if (clkdm_control && clk->clkdm) {
333 ret = clkdm_clk_enable(clk->clkdm, clk); 336 ret = clkdm_clk_enable(clk->clkdm, clk);
334 if (ret) { 337 if (ret) {
335 WARN(1, "clock: %s: could not enable clockdomain %s: " 338 WARN(1, "clock: %s: could not enable clockdomain %s: %d\n",
336 "%d\n", clk->name, clk->clkdm->name, ret); 339 clk->name, clk->clkdm->name, ret);
337 goto oce_err2; 340 goto oce_err2;
338 } 341 }
339 } 342 }
@@ -501,10 +504,8 @@ void __init omap2_clk_print_new_rates(const char *hfclkin_ck_name,
501 504
502 hfclkin_rate = clk_get_rate(hfclkin_ck); 505 hfclkin_rate = clk_get_rate(hfclkin_ck);
503 506
504 pr_info("Switched to new clocking rate (Crystal/Core/MPU): " 507 pr_info("Switched to new clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n",
505 "%ld.%01ld/%ld/%ld MHz\n", 508 (hfclkin_rate / 1000000), ((hfclkin_rate / 100000) % 10),
506 (hfclkin_rate / 1000000),
507 ((hfclkin_rate / 100000) % 10),
508 (clk_get_rate(core_ck) / 1000000), 509 (clk_get_rate(core_ck) / 1000000),
509 (clk_get_rate(mpu_ck) / 1000000)); 510 (clk_get_rate(mpu_ck) / 1000000));
510} 511}
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c
index 002745181ad..c3cde1a2b6d 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -18,9 +18,9 @@
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/list.h> 19#include <linux/list.h>
20 20
21#include <plat/hardware.h>
22#include <plat/clkdev_omap.h> 21#include <plat/clkdev_omap.h>
23 22
23#include "soc.h"
24#include "iomap.h" 24#include "iomap.h"
25#include "clock.h" 25#include "clock.h"
26#include "clock2xxx.h" 26#include "clock2xxx.h"
@@ -1804,6 +1804,7 @@ static struct omap_clk omap2420_clks[] = {
1804 CLK(NULL, "gfx_ick", &gfx_ick, CK_242X), 1804 CLK(NULL, "gfx_ick", &gfx_ick, CK_242X),
1805 /* DSS domain clocks */ 1805 /* DSS domain clocks */
1806 CLK("omapdss_dss", "ick", &dss_ick, CK_242X), 1806 CLK("omapdss_dss", "ick", &dss_ick, CK_242X),
1807 CLK(NULL, "dss_ick", &dss_ick, CK_242X),
1807 CLK(NULL, "dss1_fck", &dss1_fck, CK_242X), 1808 CLK(NULL, "dss1_fck", &dss1_fck, CK_242X),
1808 CLK(NULL, "dss2_fck", &dss2_fck, CK_242X), 1809 CLK(NULL, "dss2_fck", &dss2_fck, CK_242X),
1809 CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_242X), 1810 CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_242X),
@@ -1843,12 +1844,16 @@ static struct omap_clk omap2420_clks[] = {
1843 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_242X), 1844 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_242X),
1844 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_242X), 1845 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_242X),
1845 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_242X), 1846 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_242X),
1847 CLK(NULL, "mcbsp1_ick", &mcbsp1_ick, CK_242X),
1846 CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_242X), 1848 CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_242X),
1847 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_242X), 1849 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_242X),
1850 CLK(NULL, "mcbsp2_ick", &mcbsp2_ick, CK_242X),
1848 CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_242X), 1851 CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_242X),
1849 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_242X), 1852 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_242X),
1853 CLK(NULL, "mcspi1_ick", &mcspi1_ick, CK_242X),
1850 CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_242X), 1854 CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_242X),
1851 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_242X), 1855 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_242X),
1856 CLK(NULL, "mcspi2_ick", &mcspi2_ick, CK_242X),
1852 CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_242X), 1857 CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_242X),
1853 CLK(NULL, "uart1_ick", &uart1_ick, CK_242X), 1858 CLK(NULL, "uart1_ick", &uart1_ick, CK_242X),
1854 CLK(NULL, "uart1_fck", &uart1_fck, CK_242X), 1859 CLK(NULL, "uart1_fck", &uart1_fck, CK_242X),
@@ -1859,12 +1864,15 @@ static struct omap_clk omap2420_clks[] = {
1859 CLK(NULL, "gpios_ick", &gpios_ick, CK_242X), 1864 CLK(NULL, "gpios_ick", &gpios_ick, CK_242X),
1860 CLK(NULL, "gpios_fck", &gpios_fck, CK_242X), 1865 CLK(NULL, "gpios_fck", &gpios_fck, CK_242X),
1861 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_242X), 1866 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_242X),
1867 CLK(NULL, "mpu_wdt_ick", &mpu_wdt_ick, CK_242X),
1862 CLK(NULL, "mpu_wdt_fck", &mpu_wdt_fck, CK_242X), 1868 CLK(NULL, "mpu_wdt_fck", &mpu_wdt_fck, CK_242X),
1863 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_242X), 1869 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_242X),
1864 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_242X), 1870 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_242X),
1865 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_242X), 1871 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_242X),
1866 CLK("omap24xxcam", "fck", &cam_fck, CK_242X), 1872 CLK("omap24xxcam", "fck", &cam_fck, CK_242X),
1873 CLK(NULL, "cam_fck", &cam_fck, CK_242X),
1867 CLK("omap24xxcam", "ick", &cam_ick, CK_242X), 1874 CLK("omap24xxcam", "ick", &cam_ick, CK_242X),
1875 CLK(NULL, "cam_ick", &cam_ick, CK_242X),
1868 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_242X), 1876 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_242X),
1869 CLK(NULL, "wdt4_ick", &wdt4_ick, CK_242X), 1877 CLK(NULL, "wdt4_ick", &wdt4_ick, CK_242X),
1870 CLK(NULL, "wdt4_fck", &wdt4_fck, CK_242X), 1878 CLK(NULL, "wdt4_fck", &wdt4_fck, CK_242X),
@@ -1873,16 +1881,22 @@ static struct omap_clk omap2420_clks[] = {
1873 CLK(NULL, "mspro_ick", &mspro_ick, CK_242X), 1881 CLK(NULL, "mspro_ick", &mspro_ick, CK_242X),
1874 CLK(NULL, "mspro_fck", &mspro_fck, CK_242X), 1882 CLK(NULL, "mspro_fck", &mspro_fck, CK_242X),
1875 CLK("mmci-omap.0", "ick", &mmc_ick, CK_242X), 1883 CLK("mmci-omap.0", "ick", &mmc_ick, CK_242X),
1884 CLK(NULL, "mmc_ick", &mmc_ick, CK_242X),
1876 CLK("mmci-omap.0", "fck", &mmc_fck, CK_242X), 1885 CLK("mmci-omap.0", "fck", &mmc_fck, CK_242X),
1886 CLK(NULL, "mmc_fck", &mmc_fck, CK_242X),
1877 CLK(NULL, "fac_ick", &fac_ick, CK_242X), 1887 CLK(NULL, "fac_ick", &fac_ick, CK_242X),
1878 CLK(NULL, "fac_fck", &fac_fck, CK_242X), 1888 CLK(NULL, "fac_fck", &fac_fck, CK_242X),
1879 CLK(NULL, "eac_ick", &eac_ick, CK_242X), 1889 CLK(NULL, "eac_ick", &eac_ick, CK_242X),
1880 CLK(NULL, "eac_fck", &eac_fck, CK_242X), 1890 CLK(NULL, "eac_fck", &eac_fck, CK_242X),
1881 CLK("omap_hdq.0", "ick", &hdq_ick, CK_242X), 1891 CLK("omap_hdq.0", "ick", &hdq_ick, CK_242X),
1892 CLK(NULL, "hdq_ick", &hdq_ick, CK_242X),
1882 CLK("omap_hdq.0", "fck", &hdq_fck, CK_242X), 1893 CLK("omap_hdq.0", "fck", &hdq_fck, CK_242X),
1894 CLK(NULL, "hdq_fck", &hdq_fck, CK_242X),
1883 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_242X), 1895 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_242X),
1896 CLK(NULL, "i2c1_ick", &i2c1_ick, CK_242X),
1884 CLK(NULL, "i2c1_fck", &i2c1_fck, CK_242X), 1897 CLK(NULL, "i2c1_fck", &i2c1_fck, CK_242X),
1885 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_242X), 1898 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_242X),
1899 CLK(NULL, "i2c2_ick", &i2c2_ick, CK_242X),
1886 CLK(NULL, "i2c2_fck", &i2c2_fck, CK_242X), 1900 CLK(NULL, "i2c2_fck", &i2c2_fck, CK_242X),
1887 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X), 1901 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X),
1888 CLK(NULL, "sdma_fck", &sdma_fck, CK_242X), 1902 CLK(NULL, "sdma_fck", &sdma_fck, CK_242X),
@@ -1892,14 +1906,18 @@ static struct omap_clk omap2420_clks[] = {
1892 CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), 1906 CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X),
1893 CLK(NULL, "des_ick", &des_ick, CK_242X), 1907 CLK(NULL, "des_ick", &des_ick, CK_242X),
1894 CLK("omap-sham", "ick", &sha_ick, CK_242X), 1908 CLK("omap-sham", "ick", &sha_ick, CK_242X),
1909 CLK(NULL, "sha_ick", &sha_ick, CK_242X),
1895 CLK("omap_rng", "ick", &rng_ick, CK_242X), 1910 CLK("omap_rng", "ick", &rng_ick, CK_242X),
1911 CLK(NULL, "rng_ick", &rng_ick, CK_242X),
1896 CLK("omap-aes", "ick", &aes_ick, CK_242X), 1912 CLK("omap-aes", "ick", &aes_ick, CK_242X),
1913 CLK(NULL, "aes_ick", &aes_ick, CK_242X),
1897 CLK(NULL, "pka_ick", &pka_ick, CK_242X), 1914 CLK(NULL, "pka_ick", &pka_ick, CK_242X),
1898 CLK(NULL, "usb_fck", &usb_fck, CK_242X), 1915 CLK(NULL, "usb_fck", &usb_fck, CK_242X),
1899 CLK("musb-hdrc", "fck", &osc_ck, CK_242X), 1916 CLK("musb-hdrc", "fck", &osc_ck, CK_242X),
1900 CLK(NULL, "timer_32k_ck", &func_32k_ck, CK_243X), 1917 CLK(NULL, "timer_32k_ck", &func_32k_ck, CK_242X),
1901 CLK(NULL, "timer_sys_ck", &sys_ck, CK_243X), 1918 CLK(NULL, "timer_sys_ck", &sys_ck, CK_242X),
1902 CLK(NULL, "timer_ext_ck", &alt_ck, CK_243X), 1919 CLK(NULL, "timer_ext_ck", &alt_ck, CK_242X),
1920 CLK(NULL, "cpufreq_ck", &virt_prcm_set, CK_242X),
1903}; 1921};
1904 1922
1905/* 1923/*
diff --git a/arch/arm/mach-omap2/clock2430.c b/arch/arm/mach-omap2/clock2430.c
index dfda9a3f2cb..a8e32617746 100644
--- a/arch/arm/mach-omap2/clock2430.c
+++ b/arch/arm/mach-omap2/clock2430.c
@@ -21,9 +21,9 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <plat/hardware.h>
25#include <plat/clock.h> 24#include <plat/clock.h>
26 25
26#include "soc.h"
27#include "iomap.h" 27#include "iomap.h"
28#include "clock.h" 28#include "clock.h"
29#include "clock2xxx.h" 29#include "clock2xxx.h"
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c
index cacabb070e2..22404fe435e 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -17,9 +17,9 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/list.h> 18#include <linux/list.h>
19 19
20#include <plat/hardware.h>
21#include <plat/clkdev_omap.h> 20#include <plat/clkdev_omap.h>
22 21
22#include "soc.h"
23#include "iomap.h" 23#include "iomap.h"
24#include "clock.h" 24#include "clock.h"
25#include "clock2xxx.h" 25#include "clock2xxx.h"
@@ -1856,6 +1856,7 @@ static struct omap_clk omap2430_clks[] = {
1856 CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X), 1856 CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X),
1857 CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X), 1857 CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X),
1858 CLK(NULL, "osc_ck", &osc_ck, CK_243X), 1858 CLK(NULL, "osc_ck", &osc_ck, CK_243X),
1859 CLK("twl", "fck", &osc_ck, CK_243X),
1859 CLK(NULL, "sys_ck", &sys_ck, CK_243X), 1860 CLK(NULL, "sys_ck", &sys_ck, CK_243X),
1860 CLK(NULL, "alt_ck", &alt_ck, CK_243X), 1861 CLK(NULL, "alt_ck", &alt_ck, CK_243X),
1861 CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_243X), 1862 CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_243X),
@@ -1887,6 +1888,7 @@ static struct omap_clk omap2430_clks[] = {
1887 CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X), 1888 CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X),
1888 /* DSS domain clocks */ 1889 /* DSS domain clocks */
1889 CLK("omapdss_dss", "ick", &dss_ick, CK_243X), 1890 CLK("omapdss_dss", "ick", &dss_ick, CK_243X),
1891 CLK(NULL, "dss_ick", &dss_ick, CK_243X),
1890 CLK(NULL, "dss1_fck", &dss1_fck, CK_243X), 1892 CLK(NULL, "dss1_fck", &dss1_fck, CK_243X),
1891 CLK(NULL, "dss2_fck", &dss2_fck, CK_243X), 1893 CLK(NULL, "dss2_fck", &dss2_fck, CK_243X),
1892 CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_243X), 1894 CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_243X),
@@ -1926,20 +1928,28 @@ static struct omap_clk omap2430_clks[] = {
1926 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X), 1928 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X),
1927 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X), 1929 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X),
1928 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X), 1930 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X),
1931 CLK(NULL, "mcbsp1_ick", &mcbsp1_ick, CK_243X),
1929 CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_243X), 1932 CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_243X),
1930 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X), 1933 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X),
1934 CLK(NULL, "mcbsp2_ick", &mcbsp2_ick, CK_243X),
1931 CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_243X), 1935 CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_243X),
1932 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X), 1936 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X),
1937 CLK(NULL, "mcbsp3_ick", &mcbsp3_ick, CK_243X),
1933 CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_243X), 1938 CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_243X),
1934 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X), 1939 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X),
1940 CLK(NULL, "mcbsp4_ick", &mcbsp4_ick, CK_243X),
1935 CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_243X), 1941 CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_243X),
1936 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X), 1942 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X),
1943 CLK(NULL, "mcbsp5_ick", &mcbsp5_ick, CK_243X),
1937 CLK(NULL, "mcbsp5_fck", &mcbsp5_fck, CK_243X), 1944 CLK(NULL, "mcbsp5_fck", &mcbsp5_fck, CK_243X),
1938 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X), 1945 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X),
1946 CLK(NULL, "mcspi1_ick", &mcspi1_ick, CK_243X),
1939 CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_243X), 1947 CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_243X),
1940 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X), 1948 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X),
1949 CLK(NULL, "mcspi2_ick", &mcspi2_ick, CK_243X),
1941 CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_243X), 1950 CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_243X),
1942 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X), 1951 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X),
1952 CLK(NULL, "mcspi3_ick", &mcspi3_ick, CK_243X),
1943 CLK(NULL, "mcspi3_fck", &mcspi3_fck, CK_243X), 1953 CLK(NULL, "mcspi3_fck", &mcspi3_fck, CK_243X),
1944 CLK(NULL, "uart1_ick", &uart1_ick, CK_243X), 1954 CLK(NULL, "uart1_ick", &uart1_ick, CK_243X),
1945 CLK(NULL, "uart1_fck", &uart1_fck, CK_243X), 1955 CLK(NULL, "uart1_fck", &uart1_fck, CK_243X),
@@ -1950,13 +1960,16 @@ static struct omap_clk omap2430_clks[] = {
1950 CLK(NULL, "gpios_ick", &gpios_ick, CK_243X), 1960 CLK(NULL, "gpios_ick", &gpios_ick, CK_243X),
1951 CLK(NULL, "gpios_fck", &gpios_fck, CK_243X), 1961 CLK(NULL, "gpios_fck", &gpios_fck, CK_243X),
1952 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X), 1962 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X),
1963 CLK(NULL, "mpu_wdt_ick", &mpu_wdt_ick, CK_243X),
1953 CLK(NULL, "mpu_wdt_fck", &mpu_wdt_fck, CK_243X), 1964 CLK(NULL, "mpu_wdt_fck", &mpu_wdt_fck, CK_243X),
1954 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X), 1965 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X),
1955 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X), 1966 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X),
1956 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X), 1967 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X),
1957 CLK(NULL, "icr_ick", &icr_ick, CK_243X), 1968 CLK(NULL, "icr_ick", &icr_ick, CK_243X),
1958 CLK("omap24xxcam", "fck", &cam_fck, CK_243X), 1969 CLK("omap24xxcam", "fck", &cam_fck, CK_243X),
1970 CLK(NULL, "cam_fck", &cam_fck, CK_243X),
1959 CLK("omap24xxcam", "ick", &cam_ick, CK_243X), 1971 CLK("omap24xxcam", "ick", &cam_ick, CK_243X),
1972 CLK(NULL, "cam_ick", &cam_ick, CK_243X),
1960 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X), 1973 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X),
1961 CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X), 1974 CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X),
1962 CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X), 1975 CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X),
@@ -1965,10 +1978,14 @@ static struct omap_clk omap2430_clks[] = {
1965 CLK(NULL, "fac_ick", &fac_ick, CK_243X), 1978 CLK(NULL, "fac_ick", &fac_ick, CK_243X),
1966 CLK(NULL, "fac_fck", &fac_fck, CK_243X), 1979 CLK(NULL, "fac_fck", &fac_fck, CK_243X),
1967 CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X), 1980 CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X),
1981 CLK(NULL, "hdq_ick", &hdq_ick, CK_243X),
1968 CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X), 1982 CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X),
1983 CLK(NULL, "hdq_fck", &hdq_fck, CK_243X),
1969 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_243X), 1984 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_243X),
1985 CLK(NULL, "i2c1_ick", &i2c1_ick, CK_243X),
1970 CLK(NULL, "i2chs1_fck", &i2chs1_fck, CK_243X), 1986 CLK(NULL, "i2chs1_fck", &i2chs1_fck, CK_243X),
1971 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_243X), 1987 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_243X),
1988 CLK(NULL, "i2c2_ick", &i2c2_ick, CK_243X),
1972 CLK(NULL, "i2chs2_fck", &i2chs2_fck, CK_243X), 1989 CLK(NULL, "i2chs2_fck", &i2chs2_fck, CK_243X),
1973 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X), 1990 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X),
1974 CLK(NULL, "sdma_fck", &sdma_fck, CK_243X), 1991 CLK(NULL, "sdma_fck", &sdma_fck, CK_243X),
@@ -1977,22 +1994,29 @@ static struct omap_clk omap2430_clks[] = {
1977 CLK(NULL, "des_ick", &des_ick, CK_243X), 1994 CLK(NULL, "des_ick", &des_ick, CK_243X),
1978 CLK("omap-sham", "ick", &sha_ick, CK_243X), 1995 CLK("omap-sham", "ick", &sha_ick, CK_243X),
1979 CLK("omap_rng", "ick", &rng_ick, CK_243X), 1996 CLK("omap_rng", "ick", &rng_ick, CK_243X),
1997 CLK(NULL, "rng_ick", &rng_ick, CK_243X),
1980 CLK("omap-aes", "ick", &aes_ick, CK_243X), 1998 CLK("omap-aes", "ick", &aes_ick, CK_243X),
1981 CLK(NULL, "pka_ick", &pka_ick, CK_243X), 1999 CLK(NULL, "pka_ick", &pka_ick, CK_243X),
1982 CLK(NULL, "usb_fck", &usb_fck, CK_243X), 2000 CLK(NULL, "usb_fck", &usb_fck, CK_243X),
1983 CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X), 2001 CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X),
2002 CLK(NULL, "usbhs_ick", &usbhs_ick, CK_243X),
1984 CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_243X), 2003 CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_243X),
2004 CLK(NULL, "mmchs1_ick", &mmchs1_ick, CK_243X),
1985 CLK(NULL, "mmchs1_fck", &mmchs1_fck, CK_243X), 2005 CLK(NULL, "mmchs1_fck", &mmchs1_fck, CK_243X),
1986 CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_243X), 2006 CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_243X),
2007 CLK(NULL, "mmchs2_ick", &mmchs2_ick, CK_243X),
1987 CLK(NULL, "mmchs2_fck", &mmchs2_fck, CK_243X), 2008 CLK(NULL, "mmchs2_fck", &mmchs2_fck, CK_243X),
1988 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X), 2009 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X),
1989 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X), 2010 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X),
1990 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X), 2011 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
1991 CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X), 2012 CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
2013 CLK(NULL, "mmchsdb1_fck", &mmchsdb1_fck, CK_243X),
1992 CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X), 2014 CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
2015 CLK(NULL, "mmchsdb2_fck", &mmchsdb2_fck, CK_243X),
1993 CLK(NULL, "timer_32k_ck", &func_32k_ck, CK_243X), 2016 CLK(NULL, "timer_32k_ck", &func_32k_ck, CK_243X),
1994 CLK(NULL, "timer_sys_ck", &sys_ck, CK_243X), 2017 CLK(NULL, "timer_sys_ck", &sys_ck, CK_243X),
1995 CLK(NULL, "timer_ext_ck", &alt_ck, CK_243X), 2018 CLK(NULL, "timer_ext_ck", &alt_ck, CK_243X),
2019 CLK(NULL, "cpufreq_ck", &virt_prcm_set, CK_243X),
1996}; 2020};
1997 2021
1998/* 2022/*
diff --git a/arch/arm/mach-omap2/clock2xxx.c b/arch/arm/mach-omap2/clock2xxx.c
index 12500097378..e92be1fc1a0 100644
--- a/arch/arm/mach-omap2/clock2xxx.c
+++ b/arch/arm/mach-omap2/clock2xxx.c
@@ -22,9 +22,9 @@
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <plat/cpu.h>
26#include <plat/clock.h> 25#include <plat/clock.h>
27 26
27#include "soc.h"
28#include "clock.h" 28#include "clock.h"
29#include "clock2xxx.h" 29#include "clock2xxx.h"
30#include "cm.h" 30#include "cm.h"
diff --git a/arch/arm/mach-omap2/clock33xx_data.c b/arch/arm/mach-omap2/clock33xx_data.c
index 25bbcc7ca4d..114ab4b8e0e 100644
--- a/arch/arm/mach-omap2/clock33xx_data.c
+++ b/arch/arm/mach-omap2/clock33xx_data.c
@@ -18,8 +18,8 @@
18#include <linux/list.h> 18#include <linux/list.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <plat/clkdev_omap.h> 20#include <plat/clkdev_omap.h>
21#include <plat/am33xx.h>
22 21
22#include "am33xx.h"
23#include "iomap.h" 23#include "iomap.h"
24#include "control.h" 24#include "control.h"
25#include "clock.h" 25#include "clock.h"
@@ -1013,6 +1013,7 @@ static struct omap_clk am33xx_clks[] = {
1013 CLK(NULL, "dpll_core_m5_ck", &dpll_core_m5_ck, CK_AM33XX), 1013 CLK(NULL, "dpll_core_m5_ck", &dpll_core_m5_ck, CK_AM33XX),
1014 CLK(NULL, "dpll_core_m6_ck", &dpll_core_m6_ck, CK_AM33XX), 1014 CLK(NULL, "dpll_core_m6_ck", &dpll_core_m6_ck, CK_AM33XX),
1015 CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck, CK_AM33XX), 1015 CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck, CK_AM33XX),
1016 CLK("cpu0", NULL, &dpll_mpu_ck, CK_AM33XX),
1016 CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck, CK_AM33XX), 1017 CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck, CK_AM33XX),
1017 CLK(NULL, "dpll_ddr_ck", &dpll_ddr_ck, CK_AM33XX), 1018 CLK(NULL, "dpll_ddr_ck", &dpll_ddr_ck, CK_AM33XX),
1018 CLK(NULL, "dpll_ddr_m2_ck", &dpll_ddr_m2_ck, CK_AM33XX), 1019 CLK(NULL, "dpll_ddr_m2_ck", &dpll_ddr_m2_ck, CK_AM33XX),
@@ -1027,22 +1028,26 @@ static struct omap_clk am33xx_clks[] = {
1027 CLK(NULL, "cefuse_fck", &cefuse_fck, CK_AM33XX), 1028 CLK(NULL, "cefuse_fck", &cefuse_fck, CK_AM33XX),
1028 CLK(NULL, "clkdiv32k_ick", &clkdiv32k_ick, CK_AM33XX), 1029 CLK(NULL, "clkdiv32k_ick", &clkdiv32k_ick, CK_AM33XX),
1029 CLK(NULL, "dcan0_fck", &dcan0_fck, CK_AM33XX), 1030 CLK(NULL, "dcan0_fck", &dcan0_fck, CK_AM33XX),
1031 CLK("481cc000.d_can", NULL, &dcan0_fck, CK_AM33XX),
1030 CLK(NULL, "dcan1_fck", &dcan1_fck, CK_AM33XX), 1032 CLK(NULL, "dcan1_fck", &dcan1_fck, CK_AM33XX),
1033 CLK("481d0000.d_can", NULL, &dcan1_fck, CK_AM33XX),
1031 CLK(NULL, "debugss_ick", &debugss_ick, CK_AM33XX), 1034 CLK(NULL, "debugss_ick", &debugss_ick, CK_AM33XX),
1032 CLK(NULL, "pruss_ocp_gclk", &pruss_ocp_gclk, CK_AM33XX), 1035 CLK(NULL, "pruss_ocp_gclk", &pruss_ocp_gclk, CK_AM33XX),
1033 CLK("davinci-mcasp.0", NULL, &mcasp0_fck, CK_AM33XX), 1036 CLK("davinci-mcasp.0", NULL, &mcasp0_fck, CK_AM33XX),
1034 CLK("davinci-mcasp.1", NULL, &mcasp1_fck, CK_AM33XX), 1037 CLK("davinci-mcasp.1", NULL, &mcasp1_fck, CK_AM33XX),
1038 CLK(NULL, "mcasp0_fck", &mcasp0_fck, CK_AM33XX),
1039 CLK(NULL, "mcasp1_fck", &mcasp1_fck, CK_AM33XX),
1035 CLK("NULL", "mmc2_fck", &mmc2_fck, CK_AM33XX), 1040 CLK("NULL", "mmc2_fck", &mmc2_fck, CK_AM33XX),
1036 CLK(NULL, "mmu_fck", &mmu_fck, CK_AM33XX), 1041 CLK(NULL, "mmu_fck", &mmu_fck, CK_AM33XX),
1037 CLK(NULL, "smartreflex0_fck", &smartreflex0_fck, CK_AM33XX), 1042 CLK(NULL, "smartreflex0_fck", &smartreflex0_fck, CK_AM33XX),
1038 CLK(NULL, "smartreflex1_fck", &smartreflex1_fck, CK_AM33XX), 1043 CLK(NULL, "smartreflex1_fck", &smartreflex1_fck, CK_AM33XX),
1039 CLK(NULL, "gpt1_fck", &timer1_fck, CK_AM33XX), 1044 CLK(NULL, "timer1_fck", &timer1_fck, CK_AM33XX),
1040 CLK(NULL, "gpt2_fck", &timer2_fck, CK_AM33XX), 1045 CLK(NULL, "timer2_fck", &timer2_fck, CK_AM33XX),
1041 CLK(NULL, "gpt3_fck", &timer3_fck, CK_AM33XX), 1046 CLK(NULL, "timer3_fck", &timer3_fck, CK_AM33XX),
1042 CLK(NULL, "gpt4_fck", &timer4_fck, CK_AM33XX), 1047 CLK(NULL, "timer4_fck", &timer4_fck, CK_AM33XX),
1043 CLK(NULL, "gpt5_fck", &timer5_fck, CK_AM33XX), 1048 CLK(NULL, "timer5_fck", &timer5_fck, CK_AM33XX),
1044 CLK(NULL, "gpt6_fck", &timer6_fck, CK_AM33XX), 1049 CLK(NULL, "timer6_fck", &timer6_fck, CK_AM33XX),
1045 CLK(NULL, "gpt7_fck", &timer7_fck, CK_AM33XX), 1050 CLK(NULL, "timer7_fck", &timer7_fck, CK_AM33XX),
1046 CLK(NULL, "usbotg_fck", &usbotg_fck, CK_AM33XX), 1051 CLK(NULL, "usbotg_fck", &usbotg_fck, CK_AM33XX),
1047 CLK(NULL, "ieee5000_fck", &ieee5000_fck, CK_AM33XX), 1052 CLK(NULL, "ieee5000_fck", &ieee5000_fck, CK_AM33XX),
1048 CLK(NULL, "wdt1_fck", &wdt1_fck, CK_AM33XX), 1053 CLK(NULL, "wdt1_fck", &wdt1_fck, CK_AM33XX),
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c
index 794d82702c8..83bb01427d4 100644
--- a/arch/arm/mach-omap2/clock3xxx.c
+++ b/arch/arm/mach-omap2/clock3xxx.c
@@ -21,9 +21,9 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <plat/hardware.h>
25#include <plat/clock.h> 24#include <plat/clock.h>
26 25
26#include "soc.h"
27#include "clock.h" 27#include "clock.h"
28#include "clock3xxx.h" 28#include "clock3xxx.h"
29#include "prm2xxx_3xxx.h" 29#include "prm2xxx_3xxx.h"
@@ -49,8 +49,7 @@ int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate)
49 * on DPLL4. 49 * on DPLL4.
50 */ 50 */
51 if (omap_rev() == OMAP3430_REV_ES1_0) { 51 if (omap_rev() == OMAP3430_REV_ES1_0) {
52 pr_err("clock: DPLL4 cannot change rate due to " 52 pr_err("clock: DPLL4 cannot change rate due to silicon 'Limitation 2.5' on 3430ES1.\n");
53 "silicon 'Limitation 2.5' on 3430ES1.\n");
54 return -EINVAL; 53 return -EINVAL;
55 } 54 }
56 55
@@ -64,15 +63,15 @@ void __init omap3_clk_lock_dpll5(void)
64 63
65 dpll5_clk = clk_get(NULL, "dpll5_ck"); 64 dpll5_clk = clk_get(NULL, "dpll5_ck");
66 clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST); 65 clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST);
67 clk_enable(dpll5_clk); 66 clk_prepare_enable(dpll5_clk);
68 67
69 /* Program dpll5_m2_clk divider for no division */ 68 /* Program dpll5_m2_clk divider for no division */
70 dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck"); 69 dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck");
71 clk_enable(dpll5_m2_clk); 70 clk_prepare_enable(dpll5_m2_clk);
72 clk_set_rate(dpll5_m2_clk, DPLL5_FREQ_FOR_USBHOST); 71 clk_set_rate(dpll5_m2_clk, DPLL5_FREQ_FOR_USBHOST);
73 72
74 clk_disable(dpll5_m2_clk); 73 clk_disable_unprepare(dpll5_m2_clk);
75 clk_disable(dpll5_clk); 74 clk_disable_unprepare(dpll5_clk);
76 return; 75 return;
77} 76}
78 77
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index 83bed9ad301..1f42c9d5ecf 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -21,9 +21,9 @@
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <plat/hardware.h>
25#include <plat/clkdev_omap.h> 24#include <plat/clkdev_omap.h>
26 25
26#include "soc.h"
27#include "iomap.h" 27#include "iomap.h"
28#include "clock.h" 28#include "clock.h"
29#include "clock3xxx.h" 29#include "clock3xxx.h"
@@ -3215,7 +3215,6 @@ static struct clk dummy_apb_pclk = {
3215 * clkdev 3215 * clkdev
3216 */ 3216 */
3217 3217
3218/* XXX At some point we should rename this file to clock3xxx_data.c */
3219static struct omap_clk omap3xxx_clks[] = { 3218static struct omap_clk omap3xxx_clks[] = {
3220 CLK(NULL, "apb_pclk", &dummy_apb_pclk, CK_3XXX), 3219 CLK(NULL, "apb_pclk", &dummy_apb_pclk, CK_3XXX),
3221 CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_3XXX), 3220 CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_3XXX),
@@ -3226,6 +3225,7 @@ static struct omap_clk omap3xxx_clks[] = {
3226 CLK(NULL, "virt_26000000_ck", &virt_26000000_ck, CK_3XXX), 3225 CLK(NULL, "virt_26000000_ck", &virt_26000000_ck, CK_3XXX),
3227 CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_3XXX), 3226 CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_3XXX),
3228 CLK(NULL, "osc_sys_ck", &osc_sys_ck, CK_3XXX), 3227 CLK(NULL, "osc_sys_ck", &osc_sys_ck, CK_3XXX),
3228 CLK("twl", "fck", &osc_sys_ck, CK_3XXX),
3229 CLK(NULL, "sys_ck", &sys_ck, CK_3XXX), 3229 CLK(NULL, "sys_ck", &sys_ck, CK_3XXX),
3230 CLK(NULL, "sys_altclk", &sys_altclk, CK_3XXX), 3230 CLK(NULL, "sys_altclk", &sys_altclk, CK_3XXX),
3231 CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_3XXX), 3231 CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_3XXX),
@@ -3242,11 +3242,13 @@ static struct omap_clk omap3xxx_clks[] = {
3242 CLK(NULL, "dpll3_m2x2_ck", &dpll3_m2x2_ck, CK_3XXX), 3242 CLK(NULL, "dpll3_m2x2_ck", &dpll3_m2x2_ck, CK_3XXX),
3243 CLK(NULL, "dpll3_m3_ck", &dpll3_m3_ck, CK_3XXX), 3243 CLK(NULL, "dpll3_m3_ck", &dpll3_m3_ck, CK_3XXX),
3244 CLK(NULL, "dpll3_m3x2_ck", &dpll3_m3x2_ck, CK_3XXX), 3244 CLK(NULL, "dpll3_m3x2_ck", &dpll3_m3x2_ck, CK_3XXX),
3245 CLK(NULL, "emu_core_alwon_ck", &emu_core_alwon_ck, CK_3XXX),
3245 CLK("etb", "emu_core_alwon_ck", &emu_core_alwon_ck, CK_3XXX), 3246 CLK("etb", "emu_core_alwon_ck", &emu_core_alwon_ck, CK_3XXX),
3246 CLK(NULL, "dpll4_ck", &dpll4_ck, CK_3XXX), 3247 CLK(NULL, "dpll4_ck", &dpll4_ck, CK_3XXX),
3247 CLK(NULL, "dpll4_x2_ck", &dpll4_x2_ck, CK_3XXX), 3248 CLK(NULL, "dpll4_x2_ck", &dpll4_x2_ck, CK_3XXX),
3248 CLK(NULL, "omap_192m_alwon_fck", &omap_192m_alwon_fck, CK_36XX), 3249 CLK(NULL, "omap_192m_alwon_fck", &omap_192m_alwon_fck, CK_36XX),
3249 CLK(NULL, "omap_96m_alwon_fck", &omap_96m_alwon_fck, CK_3XXX), 3250 CLK(NULL, "omap_96m_alwon_fck", &omap_96m_alwon_fck, CK_3XXX),
3251 CLK(NULL, "omap_96m_alwon_fck_3630", &omap_96m_alwon_fck_3630, CK_36XX),
3250 CLK(NULL, "omap_96m_fck", &omap_96m_fck, CK_3XXX), 3252 CLK(NULL, "omap_96m_fck", &omap_96m_fck, CK_3XXX),
3251 CLK(NULL, "cm_96m_fck", &cm_96m_fck, CK_3XXX), 3253 CLK(NULL, "cm_96m_fck", &cm_96m_fck, CK_3XXX),
3252 CLK(NULL, "omap_54m_fck", &omap_54m_fck, CK_3XXX), 3254 CLK(NULL, "omap_54m_fck", &omap_54m_fck, CK_3XXX),
@@ -3262,6 +3264,7 @@ static struct omap_clk omap3xxx_clks[] = {
3262 CLK(NULL, "dpll4_m5x2_ck", &dpll4_m5x2_ck, CK_3XXX), 3264 CLK(NULL, "dpll4_m5x2_ck", &dpll4_m5x2_ck, CK_3XXX),
3263 CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_3XXX), 3265 CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_3XXX),
3264 CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_3XXX), 3266 CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_3XXX),
3267 CLK(NULL, "emu_per_alwon_ck", &emu_per_alwon_ck, CK_3XXX),
3265 CLK("etb", "emu_per_alwon_ck", &emu_per_alwon_ck, CK_3XXX), 3268 CLK("etb", "emu_per_alwon_ck", &emu_per_alwon_ck, CK_3XXX),
3266 CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3269 CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3267 CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3270 CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
@@ -3271,6 +3274,7 @@ static struct omap_clk omap3xxx_clks[] = {
3271 CLK(NULL, "dpll1_fck", &dpll1_fck, CK_3XXX), 3274 CLK(NULL, "dpll1_fck", &dpll1_fck, CK_3XXX),
3272 CLK(NULL, "mpu_ck", &mpu_ck, CK_3XXX), 3275 CLK(NULL, "mpu_ck", &mpu_ck, CK_3XXX),
3273 CLK(NULL, "arm_fck", &arm_fck, CK_3XXX), 3276 CLK(NULL, "arm_fck", &arm_fck, CK_3XXX),
3277 CLK(NULL, "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_3XXX),
3274 CLK("etb", "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_3XXX), 3278 CLK("etb", "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_3XXX),
3275 CLK(NULL, "dpll2_fck", &dpll2_fck, CK_34XX | CK_36XX), 3279 CLK(NULL, "dpll2_fck", &dpll2_fck, CK_34XX | CK_36XX),
3276 CLK(NULL, "iva2_ck", &iva2_ck, CK_34XX | CK_36XX), 3280 CLK(NULL, "iva2_ck", &iva2_ck, CK_34XX | CK_36XX),
@@ -3294,6 +3298,7 @@ static struct omap_clk omap3xxx_clks[] = {
3294 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3298 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3295 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3299 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3296 CLK("usbhs_omap", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3300 CLK("usbhs_omap", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3301 CLK("usbhs_tll", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3297 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), 3302 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX),
3298 CLK(NULL, "mmchs3_fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3303 CLK(NULL, "mmchs3_fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3299 CLK(NULL, "mmchs2_fck", &mmchs2_fck, CK_3XXX), 3304 CLK(NULL, "mmchs2_fck", &mmchs2_fck, CK_3XXX),
@@ -3314,6 +3319,7 @@ static struct omap_clk omap3xxx_clks[] = {
3314 CLK(NULL, "fshostusb_fck", &fshostusb_fck, CK_3430ES1), 3319 CLK(NULL, "fshostusb_fck", &fshostusb_fck, CK_3430ES1),
3315 CLK(NULL, "core_12m_fck", &core_12m_fck, CK_3XXX), 3320 CLK(NULL, "core_12m_fck", &core_12m_fck, CK_3XXX),
3316 CLK("omap_hdq.0", "fck", &hdq_fck, CK_3XXX), 3321 CLK("omap_hdq.0", "fck", &hdq_fck, CK_3XXX),
3322 CLK(NULL, "hdq_fck", &hdq_fck, CK_3XXX),
3317 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1, CK_3430ES1), 3323 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1, CK_3430ES1),
3318 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2, CK_3430ES2PLUS | CK_36XX), 3324 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2, CK_3430ES2PLUS | CK_36XX),
3319 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1), 3325 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1),
@@ -3321,6 +3327,8 @@ static struct omap_clk omap3xxx_clks[] = {
3321 CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX), 3327 CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX),
3322 CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es1, CK_3430ES1), 3328 CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es1, CK_3430ES1),
3323 CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es2, CK_3430ES2PLUS | CK_36XX), 3329 CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es2, CK_3430ES2PLUS | CK_36XX),
3330 CLK(NULL, "hsotgusb_ick", &hsotgusb_ick_3430es1, CK_3430ES1),
3331 CLK(NULL, "hsotgusb_ick", &hsotgusb_ick_3430es2, CK_3430ES2PLUS | CK_36XX),
3324 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX), 3332 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX),
3325 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX), 3333 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX),
3326 CLK(NULL, "security_l3_ick", &security_l3_ick, CK_34XX | CK_36XX), 3334 CLK(NULL, "security_l3_ick", &security_l3_ick, CK_34XX | CK_36XX),
@@ -3328,28 +3336,42 @@ static struct omap_clk omap3xxx_clks[] = {
3328 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), 3336 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX),
3329 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3337 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3330 CLK("usbhs_omap", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3338 CLK("usbhs_omap", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3339 CLK("usbhs_tll", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3331 CLK("omap_hsmmc.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3340 CLK("omap_hsmmc.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3341 CLK(NULL, "mmchs3_ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3332 CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX), 3342 CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX),
3333 CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX), 3343 CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX),
3334 CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX), 3344 CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX),
3335 CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX), 3345 CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX),
3336 CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_3XXX), 3346 CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_3XXX),
3337 CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_3XXX), 3347 CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_3XXX),
3348 CLK(NULL, "mmchs2_ick", &mmchs2_ick, CK_3XXX),
3349 CLK(NULL, "mmchs1_ick", &mmchs1_ick, CK_3XXX),
3338 CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX), 3350 CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX),
3339 CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX), 3351 CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX),
3352 CLK(NULL, "hdq_ick", &hdq_ick, CK_3XXX),
3340 CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX), 3353 CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX),
3341 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_3XXX), 3354 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_3XXX),
3342 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_3XXX), 3355 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_3XXX),
3343 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_3XXX), 3356 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_3XXX),
3357 CLK(NULL, "mcspi4_ick", &mcspi4_ick, CK_3XXX),
3358 CLK(NULL, "mcspi3_ick", &mcspi3_ick, CK_3XXX),
3359 CLK(NULL, "mcspi2_ick", &mcspi2_ick, CK_3XXX),
3360 CLK(NULL, "mcspi1_ick", &mcspi1_ick, CK_3XXX),
3344 CLK("omap_i2c.3", "ick", &i2c3_ick, CK_3XXX), 3361 CLK("omap_i2c.3", "ick", &i2c3_ick, CK_3XXX),
3345 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_3XXX), 3362 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_3XXX),
3346 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_3XXX), 3363 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_3XXX),
3364 CLK(NULL, "i2c3_ick", &i2c3_ick, CK_3XXX),
3365 CLK(NULL, "i2c2_ick", &i2c2_ick, CK_3XXX),
3366 CLK(NULL, "i2c1_ick", &i2c1_ick, CK_3XXX),
3347 CLK(NULL, "uart2_ick", &uart2_ick, CK_3XXX), 3367 CLK(NULL, "uart2_ick", &uart2_ick, CK_3XXX),
3348 CLK(NULL, "uart1_ick", &uart1_ick, CK_3XXX), 3368 CLK(NULL, "uart1_ick", &uart1_ick, CK_3XXX),
3349 CLK(NULL, "gpt11_ick", &gpt11_ick, CK_3XXX), 3369 CLK(NULL, "gpt11_ick", &gpt11_ick, CK_3XXX),
3350 CLK(NULL, "gpt10_ick", &gpt10_ick, CK_3XXX), 3370 CLK(NULL, "gpt10_ick", &gpt10_ick, CK_3XXX),
3351 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_3XXX), 3371 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_3XXX),
3352 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_3XXX), 3372 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_3XXX),
3373 CLK(NULL, "mcbsp5_ick", &mcbsp5_ick, CK_3XXX),
3374 CLK(NULL, "mcbsp1_ick", &mcbsp1_ick, CK_3XXX),
3353 CLK(NULL, "fac_ick", &fac_ick, CK_3430ES1), 3375 CLK(NULL, "fac_ick", &fac_ick, CK_3430ES1),
3354 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_34XX | CK_36XX), 3376 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_34XX | CK_36XX),
3355 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_3XXX), 3377 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_3XXX),
@@ -3368,7 +3390,9 @@ static struct omap_clk omap3xxx_clks[] = {
3368 CLK(NULL, "dss_96m_fck", &dss_96m_fck, CK_3XXX), 3390 CLK(NULL, "dss_96m_fck", &dss_96m_fck, CK_3XXX),
3369 CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck, CK_3XXX), 3391 CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck, CK_3XXX),
3370 CLK("omapdss_dss", "ick", &dss_ick_3430es1, CK_3430ES1), 3392 CLK("omapdss_dss", "ick", &dss_ick_3430es1, CK_3430ES1),
3393 CLK(NULL, "dss_ick", &dss_ick_3430es1, CK_3430ES1),
3371 CLK("omapdss_dss", "ick", &dss_ick_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3394 CLK("omapdss_dss", "ick", &dss_ick_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3395 CLK(NULL, "dss_ick", &dss_ick_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3372 CLK(NULL, "cam_mclk", &cam_mclk, CK_34XX | CK_36XX), 3396 CLK(NULL, "cam_mclk", &cam_mclk, CK_34XX | CK_36XX),
3373 CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX), 3397 CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX),
3374 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX), 3398 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX),
@@ -3384,6 +3408,8 @@ static struct omap_clk omap3xxx_clks[] = {
3384 CLK(NULL, "usb_host_hs_utmi_p2_clk", &dummy_ck, CK_3XXX), 3408 CLK(NULL, "usb_host_hs_utmi_p2_clk", &dummy_ck, CK_3XXX),
3385 CLK("usbhs_omap", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX), 3409 CLK("usbhs_omap", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX),
3386 CLK("usbhs_omap", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX), 3410 CLK("usbhs_omap", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX),
3411 CLK("usbhs_tll", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX),
3412 CLK("usbhs_tll", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX),
3387 CLK(NULL, "init_60m_fclk", &dummy_ck, CK_3XXX), 3413 CLK(NULL, "init_60m_fclk", &dummy_ck, CK_3XXX),
3388 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX), 3414 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX),
3389 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX), 3415 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX),
@@ -3393,6 +3419,7 @@ static struct omap_clk omap3xxx_clks[] = {
3393 CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_34XX | CK_36XX), 3419 CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_34XX | CK_36XX),
3394 CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2PLUS | CK_36XX), 3420 CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2PLUS | CK_36XX),
3395 CLK("omap_wdt", "ick", &wdt2_ick, CK_3XXX), 3421 CLK("omap_wdt", "ick", &wdt2_ick, CK_3XXX),
3422 CLK(NULL, "wdt2_ick", &wdt2_ick, CK_3XXX),
3396 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_3XXX), 3423 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_3XXX),
3397 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_3XXX), 3424 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_3XXX),
3398 CLK(NULL, "omap_32ksync_ick", &omap_32ksync_ick, CK_3XXX), 3425 CLK(NULL, "omap_32ksync_ick", &omap_32ksync_ick, CK_3XXX),
@@ -3438,9 +3465,13 @@ static struct omap_clk omap3xxx_clks[] = {
3438 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_3XXX), 3465 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_3XXX),
3439 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_3XXX), 3466 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_3XXX),
3440 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_3XXX), 3467 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_3XXX),
3468 CLK(NULL, "mcbsp4_ick", &mcbsp2_ick, CK_3XXX),
3469 CLK(NULL, "mcbsp3_ick", &mcbsp3_ick, CK_3XXX),
3470 CLK(NULL, "mcbsp2_ick", &mcbsp4_ick, CK_3XXX),
3441 CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_3XXX), 3471 CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_3XXX),
3442 CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_3XXX), 3472 CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_3XXX),
3443 CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_3XXX), 3473 CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_3XXX),
3474 CLK(NULL, "emu_src_ck", &emu_src_ck, CK_3XXX),
3444 CLK("etb", "emu_src_ck", &emu_src_ck, CK_3XXX), 3475 CLK("etb", "emu_src_ck", &emu_src_ck, CK_3XXX),
3445 CLK(NULL, "pclk_fck", &pclk_fck, CK_3XXX), 3476 CLK(NULL, "pclk_fck", &pclk_fck, CK_3XXX),
3446 CLK(NULL, "pclkx2_fck", &pclkx2_fck, CK_3XXX), 3477 CLK(NULL, "pclkx2_fck", &pclkx2_fck, CK_3XXX),
@@ -3456,8 +3487,12 @@ static struct omap_clk omap3xxx_clks[] = {
3456 CLK(NULL, "ipss_ick", &ipss_ick, CK_AM35XX), 3487 CLK(NULL, "ipss_ick", &ipss_ick, CK_AM35XX),
3457 CLK(NULL, "rmii_ck", &rmii_ck, CK_AM35XX), 3488 CLK(NULL, "rmii_ck", &rmii_ck, CK_AM35XX),
3458 CLK(NULL, "pclk_ck", &pclk_ck, CK_AM35XX), 3489 CLK(NULL, "pclk_ck", &pclk_ck, CK_AM35XX),
3490 CLK(NULL, "emac_ick", &emac_ick, CK_AM35XX),
3491 CLK(NULL, "emac_fck", &emac_fck, CK_AM35XX),
3459 CLK("davinci_emac.0", NULL, &emac_ick, CK_AM35XX), 3492 CLK("davinci_emac.0", NULL, &emac_ick, CK_AM35XX),
3460 CLK("davinci_mdio.0", NULL, &emac_fck, CK_AM35XX), 3493 CLK("davinci_mdio.0", NULL, &emac_fck, CK_AM35XX),
3494 CLK(NULL, "vpfe_ick", &emac_ick, CK_AM35XX),
3495 CLK(NULL, "vpfe_fck", &emac_fck, CK_AM35XX),
3461 CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX), 3496 CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX),
3462 CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX), 3497 CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX),
3463 CLK(NULL, "hsotgusb_ick", &hsotgusb_ick_am35xx, CK_AM35XX), 3498 CLK(NULL, "hsotgusb_ick", &hsotgusb_ick_am35xx, CK_AM35XX),
@@ -3466,6 +3501,7 @@ static struct omap_clk omap3xxx_clks[] = {
3466 CLK(NULL, "uart4_ick", &uart4_ick_am35xx, CK_AM35XX), 3501 CLK(NULL, "uart4_ick", &uart4_ick_am35xx, CK_AM35XX),
3467 CLK(NULL, "timer_32k_ck", &omap_32k_fck, CK_3XXX), 3502 CLK(NULL, "timer_32k_ck", &omap_32k_fck, CK_3XXX),
3468 CLK(NULL, "timer_sys_ck", &sys_ck, CK_3XXX), 3503 CLK(NULL, "timer_sys_ck", &sys_ck, CK_3XXX),
3504 CLK(NULL, "cpufreq_ck", &dpll1_ck, CK_3XXX),
3469}; 3505};
3470 3506
3471 3507
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index d7f55e43b76..d661d138f27 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -28,9 +28,9 @@
28#include <linux/clk.h> 28#include <linux/clk.h>
29#include <linux/io.h> 29#include <linux/io.h>
30 30
31#include <plat/hardware.h>
32#include <plat/clkdev_omap.h> 31#include <plat/clkdev_omap.h>
33 32
33#include "soc.h"
34#include "iomap.h" 34#include "iomap.h"
35#include "clock.h" 35#include "clock.h"
36#include "clock44xx.h" 36#include "clock44xx.h"
@@ -3156,6 +3156,7 @@ static struct omap_clk omap44xx_clks[] = {
3156 CLK(NULL, "dss_tv_clk", &dss_tv_clk, CK_443X), 3156 CLK(NULL, "dss_tv_clk", &dss_tv_clk, CK_443X),
3157 CLK(NULL, "dss_48mhz_clk", &dss_48mhz_clk, CK_443X), 3157 CLK(NULL, "dss_48mhz_clk", &dss_48mhz_clk, CK_443X),
3158 CLK(NULL, "dss_dss_clk", &dss_dss_clk, CK_443X), 3158 CLK(NULL, "dss_dss_clk", &dss_dss_clk, CK_443X),
3159 CLK(NULL, "dss_fck", &dss_fck, CK_443X),
3159 CLK("omapdss_dss", "ick", &dss_fck, CK_443X), 3160 CLK("omapdss_dss", "ick", &dss_fck, CK_443X),
3160 CLK(NULL, "efuse_ctrl_cust_fck", &efuse_ctrl_cust_fck, CK_443X), 3161 CLK(NULL, "efuse_ctrl_cust_fck", &efuse_ctrl_cust_fck, CK_443X),
3161 CLK(NULL, "emif1_fck", &emif1_fck, CK_443X), 3162 CLK(NULL, "emif1_fck", &emif1_fck, CK_443X),
@@ -3212,6 +3213,7 @@ static struct omap_clk omap44xx_clks[] = {
3212 CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X), 3213 CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X),
3213 CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X), 3214 CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X),
3214 CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X), 3215 CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X),
3216 CLK(NULL, "rng_ick", &rng_ick, CK_443X),
3215 CLK("omap_rng", "ick", &rng_ick, CK_443X), 3217 CLK("omap_rng", "ick", &rng_ick, CK_443X),
3216 CLK(NULL, "sha2md5_fck", &sha2md5_fck, CK_443X), 3218 CLK(NULL, "sha2md5_fck", &sha2md5_fck, CK_443X),
3217 CLK(NULL, "sl2if_ick", &sl2if_ick, CK_443X), 3219 CLK(NULL, "sl2if_ick", &sl2if_ick, CK_443X),
@@ -3243,6 +3245,7 @@ static struct omap_clk omap44xx_clks[] = {
3243 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X), 3245 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X),
3244 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X), 3246 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X),
3245 CLK("usbhs_omap", "fs_fck", &usb_host_fs_fck, CK_443X), 3247 CLK("usbhs_omap", "fs_fck", &usb_host_fs_fck, CK_443X),
3248 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X),
3246 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X), 3249 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X),
3247 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X), 3250 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X),
3248 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X), 3251 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X),
@@ -3253,15 +3256,19 @@ static struct omap_clk omap44xx_clks[] = {
3253 CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X), 3256 CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X),
3254 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X), 3257 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X),
3255 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X), 3258 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X),
3259 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X),
3256 CLK("usbhs_omap", "hs_fck", &usb_host_hs_fck, CK_443X), 3260 CLK("usbhs_omap", "hs_fck", &usb_host_hs_fck, CK_443X),
3257 CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X), 3261 CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X),
3258 CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X), 3262 CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X),
3263 CLK(NULL, "usb_otg_hs_ick", &usb_otg_hs_ick, CK_443X),
3259 CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X), 3264 CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X),
3260 CLK(NULL, "usb_phy_cm_clk32k", &usb_phy_cm_clk32k, CK_443X), 3265 CLK(NULL, "usb_phy_cm_clk32k", &usb_phy_cm_clk32k, CK_443X),
3261 CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X), 3266 CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X),
3262 CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X), 3267 CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X),
3263 CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X), 3268 CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X),
3269 CLK(NULL, "usb_tll_hs_ick", &usb_tll_hs_ick, CK_443X),
3264 CLK("usbhs_omap", "usbtll_ick", &usb_tll_hs_ick, CK_443X), 3270 CLK("usbhs_omap", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
3271 CLK("usbhs_tll", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
3265 CLK(NULL, "usim_ck", &usim_ck, CK_443X), 3272 CLK(NULL, "usim_ck", &usim_ck, CK_443X),
3266 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X), 3273 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
3267 CLK(NULL, "usim_fck", &usim_fck, CK_443X), 3274 CLK(NULL, "usim_fck", &usim_fck, CK_443X),
@@ -3312,8 +3319,10 @@ static struct omap_clk omap44xx_clks[] = {
3312 CLK(NULL, "uart4_ick", &dummy_ck, CK_443X), 3319 CLK(NULL, "uart4_ick", &dummy_ck, CK_443X),
3313 CLK("usbhs_omap", "usbhost_ick", &dummy_ck, CK_443X), 3320 CLK("usbhs_omap", "usbhost_ick", &dummy_ck, CK_443X),
3314 CLK("usbhs_omap", "usbtll_fck", &dummy_ck, CK_443X), 3321 CLK("usbhs_omap", "usbtll_fck", &dummy_ck, CK_443X),
3322 CLK("usbhs_tll", "usbtll_fck", &dummy_ck, CK_443X),
3315 CLK("omap_wdt", "ick", &dummy_ck, CK_443X), 3323 CLK("omap_wdt", "ick", &dummy_ck, CK_443X),
3316 CLK(NULL, "timer_32k_ck", &sys_32k_ck, CK_443X), 3324 CLK(NULL, "timer_32k_ck", &sys_32k_ck, CK_443X),
3325 /* TODO: Remove "omap_timer.X" aliases once DT migration is complete */
3317 CLK("omap_timer.1", "timer_sys_ck", &sys_clkin_ck, CK_443X), 3326 CLK("omap_timer.1", "timer_sys_ck", &sys_clkin_ck, CK_443X),
3318 CLK("omap_timer.2", "timer_sys_ck", &sys_clkin_ck, CK_443X), 3327 CLK("omap_timer.2", "timer_sys_ck", &sys_clkin_ck, CK_443X),
3319 CLK("omap_timer.3", "timer_sys_ck", &sys_clkin_ck, CK_443X), 3328 CLK("omap_timer.3", "timer_sys_ck", &sys_clkin_ck, CK_443X),
@@ -3325,6 +3334,18 @@ static struct omap_clk omap44xx_clks[] = {
3325 CLK("omap_timer.6", "timer_sys_ck", &syc_clk_div_ck, CK_443X), 3334 CLK("omap_timer.6", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
3326 CLK("omap_timer.7", "timer_sys_ck", &syc_clk_div_ck, CK_443X), 3335 CLK("omap_timer.7", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
3327 CLK("omap_timer.8", "timer_sys_ck", &syc_clk_div_ck, CK_443X), 3336 CLK("omap_timer.8", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
3337 CLK("4a318000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
3338 CLK("48032000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
3339 CLK("48034000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
3340 CLK("48036000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
3341 CLK("4803e000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
3342 CLK("48086000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
3343 CLK("48088000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
3344 CLK("49038000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
3345 CLK("4903a000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
3346 CLK("4903c000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
3347 CLK("4903e000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
3348 CLK(NULL, "cpufreq_ck", &dpll_mpu_ck, CK_443X),
3328}; 3349};
3329 3350
3330int __init omap4xxx_clk_init(void) 3351int __init omap4xxx_clk_init(void)
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 8664f5a8bfb..cbb879139c5 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -174,9 +174,8 @@ void _clkdm_add_autodeps(struct clockdomain *clkdm)
174 if (IS_ERR(autodep->clkdm.ptr)) 174 if (IS_ERR(autodep->clkdm.ptr))
175 continue; 175 continue;
176 176
177 pr_debug("clockdomain: adding %s sleepdep/wkdep for " 177 pr_debug("clockdomain: %s: adding %s sleepdep/wkdep\n",
178 "clkdm %s\n", autodep->clkdm.ptr->name, 178 clkdm->name, autodep->clkdm.ptr->name);
179 clkdm->name);
180 179
181 clkdm_add_sleepdep(clkdm, autodep->clkdm.ptr); 180 clkdm_add_sleepdep(clkdm, autodep->clkdm.ptr);
182 clkdm_add_wkdep(clkdm, autodep->clkdm.ptr); 181 clkdm_add_wkdep(clkdm, autodep->clkdm.ptr);
@@ -205,9 +204,8 @@ void _clkdm_del_autodeps(struct clockdomain *clkdm)
205 if (IS_ERR(autodep->clkdm.ptr)) 204 if (IS_ERR(autodep->clkdm.ptr))
206 continue; 205 continue;
207 206
208 pr_debug("clockdomain: removing %s sleepdep/wkdep for " 207 pr_debug("clockdomain: %s: removing %s sleepdep/wkdep\n",
209 "clkdm %s\n", autodep->clkdm.ptr->name, 208 clkdm->name, autodep->clkdm.ptr->name);
210 clkdm->name);
211 209
212 clkdm_del_sleepdep(clkdm, autodep->clkdm.ptr); 210 clkdm_del_sleepdep(clkdm, autodep->clkdm.ptr);
213 clkdm_del_wkdep(clkdm, autodep->clkdm.ptr); 211 clkdm_del_wkdep(clkdm, autodep->clkdm.ptr);
@@ -469,14 +467,14 @@ int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
469 ret = -EINVAL; 467 ret = -EINVAL;
470 468
471 if (ret) { 469 if (ret) {
472 pr_debug("clockdomain: hardware cannot set/clear wake up of " 470 pr_debug("clockdomain: hardware cannot set/clear wake up of %s when %s wakes up\n",
473 "%s when %s wakes up\n", clkdm1->name, clkdm2->name); 471 clkdm1->name, clkdm2->name);
474 return ret; 472 return ret;
475 } 473 }
476 474
477 if (atomic_inc_return(&cd->wkdep_usecount) == 1) { 475 if (atomic_inc_return(&cd->wkdep_usecount) == 1) {
478 pr_debug("clockdomain: hardware will wake up %s when %s wakes " 476 pr_debug("clockdomain: hardware will wake up %s when %s wakes up\n",
479 "up\n", clkdm1->name, clkdm2->name); 477 clkdm1->name, clkdm2->name);
480 478
481 ret = arch_clkdm->clkdm_add_wkdep(clkdm1, clkdm2); 479 ret = arch_clkdm->clkdm_add_wkdep(clkdm1, clkdm2);
482 } 480 }
@@ -510,14 +508,14 @@ int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
510 ret = -EINVAL; 508 ret = -EINVAL;
511 509
512 if (ret) { 510 if (ret) {
513 pr_debug("clockdomain: hardware cannot set/clear wake up of " 511 pr_debug("clockdomain: hardware cannot set/clear wake up of %s when %s wakes up\n",
514 "%s when %s wakes up\n", clkdm1->name, clkdm2->name); 512 clkdm1->name, clkdm2->name);
515 return ret; 513 return ret;
516 } 514 }
517 515
518 if (atomic_dec_return(&cd->wkdep_usecount) == 0) { 516 if (atomic_dec_return(&cd->wkdep_usecount) == 0) {
519 pr_debug("clockdomain: hardware will no longer wake up %s " 517 pr_debug("clockdomain: hardware will no longer wake up %s after %s wakes up\n",
520 "after %s wakes up\n", clkdm1->name, clkdm2->name); 518 clkdm1->name, clkdm2->name);
521 519
522 ret = arch_clkdm->clkdm_del_wkdep(clkdm1, clkdm2); 520 ret = arch_clkdm->clkdm_del_wkdep(clkdm1, clkdm2);
523 } 521 }
@@ -555,8 +553,8 @@ int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
555 ret = -EINVAL; 553 ret = -EINVAL;
556 554
557 if (ret) { 555 if (ret) {
558 pr_debug("clockdomain: hardware cannot set/clear wake up of " 556 pr_debug("clockdomain: hardware cannot set/clear wake up of %s when %s wakes up\n",
559 "%s when %s wakes up\n", clkdm1->name, clkdm2->name); 557 clkdm1->name, clkdm2->name);
560 return ret; 558 return ret;
561 } 559 }
562 560
@@ -613,15 +611,14 @@ int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
613 ret = -EINVAL; 611 ret = -EINVAL;
614 612
615 if (ret) { 613 if (ret) {
616 pr_debug("clockdomain: hardware cannot set/clear sleep " 614 pr_debug("clockdomain: hardware cannot set/clear sleep dependency affecting %s from %s\n",
617 "dependency affecting %s from %s\n", clkdm1->name, 615 clkdm1->name, clkdm2->name);
618 clkdm2->name);
619 return ret; 616 return ret;
620 } 617 }
621 618
622 if (atomic_inc_return(&cd->sleepdep_usecount) == 1) { 619 if (atomic_inc_return(&cd->sleepdep_usecount) == 1) {
623 pr_debug("clockdomain: will prevent %s from sleeping if %s " 620 pr_debug("clockdomain: will prevent %s from sleeping if %s is active\n",
624 "is active\n", clkdm1->name, clkdm2->name); 621 clkdm1->name, clkdm2->name);
625 622
626 ret = arch_clkdm->clkdm_add_sleepdep(clkdm1, clkdm2); 623 ret = arch_clkdm->clkdm_add_sleepdep(clkdm1, clkdm2);
627 } 624 }
@@ -657,16 +654,14 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
657 ret = -EINVAL; 654 ret = -EINVAL;
658 655
659 if (ret) { 656 if (ret) {
660 pr_debug("clockdomain: hardware cannot set/clear sleep " 657 pr_debug("clockdomain: hardware cannot set/clear sleep dependency affecting %s from %s\n",
661 "dependency affecting %s from %s\n", clkdm1->name, 658 clkdm1->name, clkdm2->name);
662 clkdm2->name);
663 return ret; 659 return ret;
664 } 660 }
665 661
666 if (atomic_dec_return(&cd->sleepdep_usecount) == 0) { 662 if (atomic_dec_return(&cd->sleepdep_usecount) == 0) {
667 pr_debug("clockdomain: will no longer prevent %s from " 663 pr_debug("clockdomain: will no longer prevent %s from sleeping if %s is active\n",
668 "sleeping if %s is active\n", clkdm1->name, 664 clkdm1->name, clkdm2->name);
669 clkdm2->name);
670 665
671 ret = arch_clkdm->clkdm_del_sleepdep(clkdm1, clkdm2); 666 ret = arch_clkdm->clkdm_del_sleepdep(clkdm1, clkdm2);
672 } 667 }
@@ -706,9 +701,8 @@ int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
706 ret = -EINVAL; 701 ret = -EINVAL;
707 702
708 if (ret) { 703 if (ret) {
709 pr_debug("clockdomain: hardware cannot set/clear sleep " 704 pr_debug("clockdomain: hardware cannot set/clear sleep dependency affecting %s from %s\n",
710 "dependency affecting %s from %s\n", clkdm1->name, 705 clkdm1->name, clkdm2->name);
711 clkdm2->name);
712 return ret; 706 return ret;
713 } 707 }
714 708
@@ -755,8 +749,8 @@ int clkdm_sleep(struct clockdomain *clkdm)
755 return -EINVAL; 749 return -EINVAL;
756 750
757 if (!(clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) { 751 if (!(clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) {
758 pr_debug("clockdomain: %s does not support forcing " 752 pr_debug("clockdomain: %s does not support forcing sleep via software\n",
759 "sleep via software\n", clkdm->name); 753 clkdm->name);
760 return -EINVAL; 754 return -EINVAL;
761 } 755 }
762 756
@@ -790,8 +784,8 @@ int clkdm_wakeup(struct clockdomain *clkdm)
790 return -EINVAL; 784 return -EINVAL;
791 785
792 if (!(clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)) { 786 if (!(clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)) {
793 pr_debug("clockdomain: %s does not support forcing " 787 pr_debug("clockdomain: %s does not support forcing wakeup via software\n",
794 "wakeup via software\n", clkdm->name); 788 clkdm->name);
795 return -EINVAL; 789 return -EINVAL;
796 } 790 }
797 791
@@ -826,8 +820,8 @@ void clkdm_allow_idle(struct clockdomain *clkdm)
826 return; 820 return;
827 821
828 if (!(clkdm->flags & CLKDM_CAN_ENABLE_AUTO)) { 822 if (!(clkdm->flags & CLKDM_CAN_ENABLE_AUTO)) {
829 pr_debug("clock: automatic idle transitions cannot be enabled " 823 pr_debug("clock: %s: automatic idle transitions cannot be enabled\n",
830 "on clockdomain %s\n", clkdm->name); 824 clkdm->name);
831 return; 825 return;
832 } 826 }
833 827
@@ -861,8 +855,8 @@ void clkdm_deny_idle(struct clockdomain *clkdm)
861 return; 855 return;
862 856
863 if (!(clkdm->flags & CLKDM_CAN_DISABLE_AUTO)) { 857 if (!(clkdm->flags & CLKDM_CAN_DISABLE_AUTO)) {
864 pr_debug("clockdomain: automatic idle transitions cannot be " 858 pr_debug("clockdomain: %s: automatic idle transitions cannot be disabled\n",
865 "disabled on %s\n", clkdm->name); 859 clkdm->name);
866 return; 860 return;
867 } 861 }
868 862
@@ -905,6 +899,23 @@ bool clkdm_in_hwsup(struct clockdomain *clkdm)
905 return ret; 899 return ret;
906} 900}
907 901
902/**
903 * clkdm_missing_idle_reporting - can @clkdm enter autoidle even if in use?
904 * @clkdm: struct clockdomain *
905 *
906 * Returns true if clockdomain @clkdm has the
907 * CLKDM_MISSING_IDLE_REPORTING flag set, or false if not or @clkdm is
908 * null. More information is available in the documentation for the
909 * CLKDM_MISSING_IDLE_REPORTING macro.
910 */
911bool clkdm_missing_idle_reporting(struct clockdomain *clkdm)
912{
913 if (!clkdm)
914 return false;
915
916 return (clkdm->flags & CLKDM_MISSING_IDLE_REPORTING) ? true : false;
917}
918
908/* Clockdomain-to-clock/hwmod framework interface code */ 919/* Clockdomain-to-clock/hwmod framework interface code */
909 920
910static int _clkdm_clk_hwmod_enable(struct clockdomain *clkdm) 921static int _clkdm_clk_hwmod_enable(struct clockdomain *clkdm)
@@ -927,7 +938,7 @@ static int _clkdm_clk_hwmod_enable(struct clockdomain *clkdm)
927 pwrdm_state_switch(clkdm->pwrdm.ptr); 938 pwrdm_state_switch(clkdm->pwrdm.ptr);
928 spin_unlock_irqrestore(&clkdm->lock, flags); 939 spin_unlock_irqrestore(&clkdm->lock, flags);
929 940
930 pr_debug("clockdomain: clkdm %s: enabled\n", clkdm->name); 941 pr_debug("clockdomain: %s: enabled\n", clkdm->name);
931 942
932 return 0; 943 return 0;
933} 944}
@@ -952,7 +963,7 @@ static int _clkdm_clk_hwmod_disable(struct clockdomain *clkdm)
952 pwrdm_state_switch(clkdm->pwrdm.ptr); 963 pwrdm_state_switch(clkdm->pwrdm.ptr);
953 spin_unlock_irqrestore(&clkdm->lock, flags); 964 spin_unlock_irqrestore(&clkdm->lock, flags);
954 965
955 pr_debug("clockdomain: clkdm %s: disabled\n", clkdm->name); 966 pr_debug("clockdomain: %s: disabled\n", clkdm->name);
956 967
957 return 0; 968 return 0;
958} 969}
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h
index 5601dc13785..629576be744 100644
--- a/arch/arm/mach-omap2/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -1,9 +1,7 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/clockdomain.h
3 *
4 * OMAP2/3 clockdomain framework functions 2 * OMAP2/3 clockdomain framework functions
5 * 3 *
6 * Copyright (C) 2008 Texas Instruments, Inc. 4 * Copyright (C) 2008, 2012 Texas Instruments, Inc.
7 * Copyright (C) 2008-2011 Nokia Corporation 5 * Copyright (C) 2008-2011 Nokia Corporation
8 * 6 *
9 * Paul Walmsley 7 * Paul Walmsley
@@ -34,6 +32,20 @@
34 * CLKDM_ACTIVE_WITH_MPU: The PRCM guarantees that this clockdomain is 32 * CLKDM_ACTIVE_WITH_MPU: The PRCM guarantees that this clockdomain is
35 * active whenever the MPU is active. True for interconnects and 33 * active whenever the MPU is active. True for interconnects and
36 * the WKUP clockdomains. 34 * the WKUP clockdomains.
35 * CLKDM_MISSING_IDLE_REPORTING: The idle status of the IP blocks and
36 * clocks inside this clockdomain are not taken into account by
37 * the PRCM when determining whether the clockdomain is idle.
38 * Without this flag, if the clockdomain is set to
39 * hardware-supervised idle mode, the PRCM may transition the
40 * enclosing powerdomain to a low power state, even when devices
41 * inside the clockdomain and powerdomain are in use. (An example
42 * of such a clockdomain is the EMU clockdomain on OMAP3/4.) If
43 * this flag is set, and the clockdomain does not support the
44 * force-sleep mode, then the HW_AUTO mode will be used to put the
45 * clockdomain to sleep. Similarly, if the clockdomain supports
46 * the force-wakeup mode, then it will be used whenever a clock or
47 * IP block inside the clockdomain is active, rather than the
48 * HW_AUTO mode.
37 */ 49 */
38#define CLKDM_CAN_FORCE_SLEEP (1 << 0) 50#define CLKDM_CAN_FORCE_SLEEP (1 << 0)
39#define CLKDM_CAN_FORCE_WAKEUP (1 << 1) 51#define CLKDM_CAN_FORCE_WAKEUP (1 << 1)
@@ -41,6 +53,7 @@
41#define CLKDM_CAN_DISABLE_AUTO (1 << 3) 53#define CLKDM_CAN_DISABLE_AUTO (1 << 3)
42#define CLKDM_NO_AUTODEPS (1 << 4) 54#define CLKDM_NO_AUTODEPS (1 << 4)
43#define CLKDM_ACTIVE_WITH_MPU (1 << 5) 55#define CLKDM_ACTIVE_WITH_MPU (1 << 5)
56#define CLKDM_MISSING_IDLE_REPORTING (1 << 6)
44 57
45#define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) 58#define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO)
46#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) 59#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP)
@@ -187,6 +200,7 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm);
187void clkdm_allow_idle(struct clockdomain *clkdm); 200void clkdm_allow_idle(struct clockdomain *clkdm);
188void clkdm_deny_idle(struct clockdomain *clkdm); 201void clkdm_deny_idle(struct clockdomain *clkdm);
189bool clkdm_in_hwsup(struct clockdomain *clkdm); 202bool clkdm_in_hwsup(struct clockdomain *clkdm);
203bool clkdm_missing_idle_reporting(struct clockdomain *clkdm);
190 204
191int clkdm_wakeup(struct clockdomain *clkdm); 205int clkdm_wakeup(struct clockdomain *clkdm);
192int clkdm_sleep(struct clockdomain *clkdm); 206int clkdm_sleep(struct clockdomain *clkdm);
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
index a0d68dbecfa..70294f54e35 100644
--- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
@@ -162,6 +162,19 @@ static void _disable_hwsup(struct clockdomain *clkdm)
162 clkdm->clktrctrl_mask); 162 clkdm->clktrctrl_mask);
163} 163}
164 164
165static int omap3_clkdm_sleep(struct clockdomain *clkdm)
166{
167 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs,
168 clkdm->clktrctrl_mask);
169 return 0;
170}
171
172static int omap3_clkdm_wakeup(struct clockdomain *clkdm)
173{
174 omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs,
175 clkdm->clktrctrl_mask);
176 return 0;
177}
165 178
166static int omap2_clkdm_clk_enable(struct clockdomain *clkdm) 179static int omap2_clkdm_clk_enable(struct clockdomain *clkdm)
167{ 180{
@@ -209,36 +222,90 @@ static int omap2_clkdm_clk_disable(struct clockdomain *clkdm)
209 return 0; 222 return 0;
210} 223}
211 224
212static int omap3_clkdm_sleep(struct clockdomain *clkdm) 225static void omap3_clkdm_allow_idle(struct clockdomain *clkdm)
213{ 226{
214 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs, 227 if (atomic_read(&clkdm->usecount) > 0)
228 _clkdm_add_autodeps(clkdm);
229
230 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
215 clkdm->clktrctrl_mask); 231 clkdm->clktrctrl_mask);
216 return 0;
217} 232}
218 233
219static int omap3_clkdm_wakeup(struct clockdomain *clkdm) 234static void omap3_clkdm_deny_idle(struct clockdomain *clkdm)
220{ 235{
221 omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs, 236 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
222 clkdm->clktrctrl_mask); 237 clkdm->clktrctrl_mask);
223 return 0; 238
239 if (atomic_read(&clkdm->usecount) > 0)
240 _clkdm_del_autodeps(clkdm);
224} 241}
225 242
226static void omap3_clkdm_allow_idle(struct clockdomain *clkdm) 243static int omap3xxx_clkdm_clk_enable(struct clockdomain *clkdm)
227{ 244{
228 if (atomic_read(&clkdm->usecount) > 0) 245 bool hwsup = false;
229 _clkdm_add_autodeps(clkdm);
230 246
231 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 247 if (!clkdm->clktrctrl_mask)
248 return 0;
249
250 /*
251 * The CLKDM_MISSING_IDLE_REPORTING flag documentation has
252 * more details on the unpleasant problem this is working
253 * around
254 */
255 if ((clkdm->flags & CLKDM_MISSING_IDLE_REPORTING) &&
256 (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)) {
257 omap3_clkdm_wakeup(clkdm);
258 return 0;
259 }
260
261 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
232 clkdm->clktrctrl_mask); 262 clkdm->clktrctrl_mask);
263
264 if (hwsup) {
265 /* Disable HW transitions when we are changing deps */
266 _disable_hwsup(clkdm);
267 _clkdm_add_autodeps(clkdm);
268 _enable_hwsup(clkdm);
269 } else {
270 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
271 omap3_clkdm_wakeup(clkdm);
272 }
273
274 return 0;
233} 275}
234 276
235static void omap3_clkdm_deny_idle(struct clockdomain *clkdm) 277static int omap3xxx_clkdm_clk_disable(struct clockdomain *clkdm)
236{ 278{
237 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 279 bool hwsup = false;
280
281 if (!clkdm->clktrctrl_mask)
282 return 0;
283
284 /*
285 * The CLKDM_MISSING_IDLE_REPORTING flag documentation has
286 * more details on the unpleasant problem this is working
287 * around
288 */
289 if (clkdm->flags & CLKDM_MISSING_IDLE_REPORTING &&
290 !(clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) {
291 _enable_hwsup(clkdm);
292 return 0;
293 }
294
295 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
238 clkdm->clktrctrl_mask); 296 clkdm->clktrctrl_mask);
239 297
240 if (atomic_read(&clkdm->usecount) > 0) 298 if (hwsup) {
299 /* Disable HW transitions when we are changing deps */
300 _disable_hwsup(clkdm);
241 _clkdm_del_autodeps(clkdm); 301 _clkdm_del_autodeps(clkdm);
302 _enable_hwsup(clkdm);
303 } else {
304 if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP)
305 omap3_clkdm_sleep(clkdm);
306 }
307
308 return 0;
242} 309}
243 310
244struct clkdm_ops omap2_clkdm_operations = { 311struct clkdm_ops omap2_clkdm_operations = {
@@ -267,6 +334,6 @@ struct clkdm_ops omap3_clkdm_operations = {
267 .clkdm_wakeup = omap3_clkdm_wakeup, 334 .clkdm_wakeup = omap3_clkdm_wakeup,
268 .clkdm_allow_idle = omap3_clkdm_allow_idle, 335 .clkdm_allow_idle = omap3_clkdm_allow_idle,
269 .clkdm_deny_idle = omap3_clkdm_deny_idle, 336 .clkdm_deny_idle = omap3_clkdm_deny_idle,
270 .clkdm_clk_enable = omap2_clkdm_clk_enable, 337 .clkdm_clk_enable = omap3xxx_clkdm_clk_enable,
271 .clkdm_clk_disable = omap2_clkdm_clk_disable, 338 .clkdm_clk_disable = omap3xxx_clkdm_clk_disable,
272}; 339};
diff --git a/arch/arm/mach-omap2/clockdomain44xx.c b/arch/arm/mach-omap2/clockdomain44xx.c
index 762f2cc542c..6fc6155625b 100644
--- a/arch/arm/mach-omap2/clockdomain44xx.c
+++ b/arch/arm/mach-omap2/clockdomain44xx.c
@@ -113,6 +113,17 @@ static int omap4_clkdm_clk_disable(struct clockdomain *clkdm)
113 if (!clkdm->prcm_partition) 113 if (!clkdm->prcm_partition)
114 return 0; 114 return 0;
115 115
116 /*
117 * The CLKDM_MISSING_IDLE_REPORTING flag documentation has
118 * more details on the unpleasant problem this is working
119 * around
120 */
121 if (clkdm->flags & CLKDM_MISSING_IDLE_REPORTING &&
122 !(clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) {
123 omap4_clkdm_allow_idle(clkdm);
124 return 0;
125 }
126
116 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition, 127 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
117 clkdm->cm_inst, clkdm->clkdm_offs); 128 clkdm->cm_inst, clkdm->clkdm_offs);
118 129
diff --git a/arch/arm/mach-omap2/clockdomains3xxx_data.c b/arch/arm/mach-omap2/clockdomains3xxx_data.c
index 56089c49142..933a35cd124 100644
--- a/arch/arm/mach-omap2/clockdomains3xxx_data.c
+++ b/arch/arm/mach-omap2/clockdomains3xxx_data.c
@@ -387,14 +387,11 @@ static struct clockdomain per_am35x_clkdm = {
387 .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK, 387 .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK,
388}; 388};
389 389
390/*
391 * Disable hw supervised mode for emu_clkdm, because emu_pwrdm is
392 * switched of even if sdti is in use
393 */
394static struct clockdomain emu_clkdm = { 390static struct clockdomain emu_clkdm = {
395 .name = "emu_clkdm", 391 .name = "emu_clkdm",
396 .pwrdm = { .name = "emu_pwrdm" }, 392 .pwrdm = { .name = "emu_pwrdm" },
397 .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP, 393 .flags = (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_SWSUP |
394 CLKDM_MISSING_IDLE_REPORTING),
398 .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, 395 .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK,
399}; 396};
400 397
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c
index 63d60a773d3..b56d06b4878 100644
--- a/arch/arm/mach-omap2/clockdomains44xx_data.c
+++ b/arch/arm/mach-omap2/clockdomains44xx_data.c
@@ -390,7 +390,8 @@ static struct clockdomain emu_sys_44xx_clkdm = {
390 .prcm_partition = OMAP4430_PRM_PARTITION, 390 .prcm_partition = OMAP4430_PRM_PARTITION,
391 .cm_inst = OMAP4430_PRM_EMU_CM_INST, 391 .cm_inst = OMAP4430_PRM_EMU_CM_INST,
392 .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS, 392 .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS,
393 .flags = CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_FORCE_WAKEUP, 393 .flags = (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_FORCE_WAKEUP |
394 CLKDM_MISSING_IDLE_REPORTING),
394}; 395};
395 396
396static struct clockdomain l3_dma_44xx_clkdm = { 397static struct clockdomain l3_dma_44xx_clkdm = {
diff --git a/arch/arm/mach-omap2/cm-regbits-33xx.h b/arch/arm/mach-omap2/cm-regbits-33xx.h
index 532027ee3d8..adf7bb79b18 100644
--- a/arch/arm/mach-omap2/cm-regbits-33xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-33xx.h
@@ -25,263 +25,328 @@
25 * CM_AUTOIDLE_DPLL_MPU, CM_AUTOIDLE_DPLL_PER 25 * CM_AUTOIDLE_DPLL_MPU, CM_AUTOIDLE_DPLL_PER
26 */ 26 */
27#define AM33XX_AUTO_DPLL_MODE_SHIFT 0 27#define AM33XX_AUTO_DPLL_MODE_SHIFT 0
28#define AM33XX_AUTO_DPLL_MODE_WIDTH 3
28#define AM33XX_AUTO_DPLL_MODE_MASK (0x7 << 0) 29#define AM33XX_AUTO_DPLL_MODE_MASK (0x7 << 0)
29 30
30/* Used by CM_WKUP_CLKSTCTRL */ 31/* Used by CM_WKUP_CLKSTCTRL */
31#define AM33XX_CLKACTIVITY_ADC_FCLK_SHIFT 14 32#define AM33XX_CLKACTIVITY_ADC_FCLK_SHIFT 14
33#define AM33XX_CLKACTIVITY_ADC_FCLK_WIDTH 1
32#define AM33XX_CLKACTIVITY_ADC_FCLK_MASK (1 << 16) 34#define AM33XX_CLKACTIVITY_ADC_FCLK_MASK (1 << 16)
33 35
34/* Used by CM_PER_L4LS_CLKSTCTRL */ 36/* Used by CM_PER_L4LS_CLKSTCTRL */
35#define AM33XX_CLKACTIVITY_CAN_CLK_SHIFT 11 37#define AM33XX_CLKACTIVITY_CAN_CLK_SHIFT 11
38#define AM33XX_CLKACTIVITY_CAN_CLK_WIDTH 1
36#define AM33XX_CLKACTIVITY_CAN_CLK_MASK (1 << 11) 39#define AM33XX_CLKACTIVITY_CAN_CLK_MASK (1 << 11)
37 40
38/* Used by CM_PER_CLK_24MHZ_CLKSTCTRL */ 41/* Used by CM_PER_CLK_24MHZ_CLKSTCTRL */
39#define AM33XX_CLKACTIVITY_CLK_24MHZ_GCLK_SHIFT 4 42#define AM33XX_CLKACTIVITY_CLK_24MHZ_GCLK_SHIFT 4
43#define AM33XX_CLKACTIVITY_CLK_24MHZ_GCLK_WIDTH 1
40#define AM33XX_CLKACTIVITY_CLK_24MHZ_GCLK_MASK (1 << 4) 44#define AM33XX_CLKACTIVITY_CLK_24MHZ_GCLK_MASK (1 << 4)
41 45
42/* Used by CM_PER_CPSW_CLKSTCTRL */ 46/* Used by CM_PER_CPSW_CLKSTCTRL */
43#define AM33XX_CLKACTIVITY_CPSW_125MHZ_GCLK_SHIFT 4 47#define AM33XX_CLKACTIVITY_CPSW_125MHZ_GCLK_SHIFT 4
48#define AM33XX_CLKACTIVITY_CPSW_125MHZ_GCLK_WIDTH 1
44#define AM33XX_CLKACTIVITY_CPSW_125MHZ_GCLK_MASK (1 << 4) 49#define AM33XX_CLKACTIVITY_CPSW_125MHZ_GCLK_MASK (1 << 4)
45 50
46/* Used by CM_PER_L4HS_CLKSTCTRL */ 51/* Used by CM_PER_L4HS_CLKSTCTRL */
47#define AM33XX_CLKACTIVITY_CPSW_250MHZ_GCLK_SHIFT 4 52#define AM33XX_CLKACTIVITY_CPSW_250MHZ_GCLK_SHIFT 4
53#define AM33XX_CLKACTIVITY_CPSW_250MHZ_GCLK_WIDTH 1
48#define AM33XX_CLKACTIVITY_CPSW_250MHZ_GCLK_MASK (1 << 4) 54#define AM33XX_CLKACTIVITY_CPSW_250MHZ_GCLK_MASK (1 << 4)
49 55
50/* Used by CM_PER_L4HS_CLKSTCTRL */ 56/* Used by CM_PER_L4HS_CLKSTCTRL */
51#define AM33XX_CLKACTIVITY_CPSW_50MHZ_GCLK_SHIFT 5 57#define AM33XX_CLKACTIVITY_CPSW_50MHZ_GCLK_SHIFT 5
58#define AM33XX_CLKACTIVITY_CPSW_50MHZ_GCLK_WIDTH 1
52#define AM33XX_CLKACTIVITY_CPSW_50MHZ_GCLK_MASK (1 << 5) 59#define AM33XX_CLKACTIVITY_CPSW_50MHZ_GCLK_MASK (1 << 5)
53 60
54/* Used by CM_PER_L4HS_CLKSTCTRL */ 61/* Used by CM_PER_L4HS_CLKSTCTRL */
55#define AM33XX_CLKACTIVITY_CPSW_5MHZ_GCLK_SHIFT 6 62#define AM33XX_CLKACTIVITY_CPSW_5MHZ_GCLK_SHIFT 6
63#define AM33XX_CLKACTIVITY_CPSW_5MHZ_GCLK_WIDTH 1
56#define AM33XX_CLKACTIVITY_CPSW_5MHZ_GCLK_MASK (1 << 6) 64#define AM33XX_CLKACTIVITY_CPSW_5MHZ_GCLK_MASK (1 << 6)
57 65
58/* Used by CM_PER_L3_CLKSTCTRL */ 66/* Used by CM_PER_L3_CLKSTCTRL */
59#define AM33XX_CLKACTIVITY_CPTS_RFT_GCLK_SHIFT 6 67#define AM33XX_CLKACTIVITY_CPTS_RFT_GCLK_SHIFT 6
68#define AM33XX_CLKACTIVITY_CPTS_RFT_GCLK_WIDTH 1
60#define AM33XX_CLKACTIVITY_CPTS_RFT_GCLK_MASK (1 << 6) 69#define AM33XX_CLKACTIVITY_CPTS_RFT_GCLK_MASK (1 << 6)
61 70
62/* Used by CM_CEFUSE_CLKSTCTRL */ 71/* Used by CM_CEFUSE_CLKSTCTRL */
63#define AM33XX_CLKACTIVITY_CUST_EFUSE_SYS_CLK_SHIFT 9 72#define AM33XX_CLKACTIVITY_CUST_EFUSE_SYS_CLK_SHIFT 9
73#define AM33XX_CLKACTIVITY_CUST_EFUSE_SYS_CLK_WIDTH 1
64#define AM33XX_CLKACTIVITY_CUST_EFUSE_SYS_CLK_MASK (1 << 9) 74#define AM33XX_CLKACTIVITY_CUST_EFUSE_SYS_CLK_MASK (1 << 9)
65 75
66/* Used by CM_L3_AON_CLKSTCTRL */ 76/* Used by CM_L3_AON_CLKSTCTRL */
67#define AM33XX_CLKACTIVITY_DBGSYSCLK_SHIFT 2 77#define AM33XX_CLKACTIVITY_DBGSYSCLK_SHIFT 2
78#define AM33XX_CLKACTIVITY_DBGSYSCLK_WIDTH 1
68#define AM33XX_CLKACTIVITY_DBGSYSCLK_MASK (1 << 2) 79#define AM33XX_CLKACTIVITY_DBGSYSCLK_MASK (1 << 2)
69 80
70/* Used by CM_L3_AON_CLKSTCTRL */ 81/* Used by CM_L3_AON_CLKSTCTRL */
71#define AM33XX_CLKACTIVITY_DEBUG_CLKA_SHIFT 4 82#define AM33XX_CLKACTIVITY_DEBUG_CLKA_SHIFT 4
83#define AM33XX_CLKACTIVITY_DEBUG_CLKA_WIDTH 1
72#define AM33XX_CLKACTIVITY_DEBUG_CLKA_MASK (1 << 4) 84#define AM33XX_CLKACTIVITY_DEBUG_CLKA_MASK (1 << 4)
73 85
74/* Used by CM_PER_L3_CLKSTCTRL */ 86/* Used by CM_PER_L3_CLKSTCTRL */
75#define AM33XX_CLKACTIVITY_EMIF_GCLK_SHIFT 2 87#define AM33XX_CLKACTIVITY_EMIF_GCLK_SHIFT 2
88#define AM33XX_CLKACTIVITY_EMIF_GCLK_WIDTH 1
76#define AM33XX_CLKACTIVITY_EMIF_GCLK_MASK (1 << 2) 89#define AM33XX_CLKACTIVITY_EMIF_GCLK_MASK (1 << 2)
77 90
78/* Used by CM_GFX_L3_CLKSTCTRL */ 91/* Used by CM_GFX_L3_CLKSTCTRL */
79#define AM33XX_CLKACTIVITY_GFX_FCLK_SHIFT 9 92#define AM33XX_CLKACTIVITY_GFX_FCLK_SHIFT 9
93#define AM33XX_CLKACTIVITY_GFX_FCLK_WIDTH 1
80#define AM33XX_CLKACTIVITY_GFX_FCLK_MASK (1 << 9) 94#define AM33XX_CLKACTIVITY_GFX_FCLK_MASK (1 << 9)
81 95
82/* Used by CM_GFX_L3_CLKSTCTRL */ 96/* Used by CM_GFX_L3_CLKSTCTRL */
83#define AM33XX_CLKACTIVITY_GFX_L3_GCLK_SHIFT 8 97#define AM33XX_CLKACTIVITY_GFX_L3_GCLK_SHIFT 8
98#define AM33XX_CLKACTIVITY_GFX_L3_GCLK_WIDTH 1
84#define AM33XX_CLKACTIVITY_GFX_L3_GCLK_MASK (1 << 8) 99#define AM33XX_CLKACTIVITY_GFX_L3_GCLK_MASK (1 << 8)
85 100
86/* Used by CM_WKUP_CLKSTCTRL */ 101/* Used by CM_WKUP_CLKSTCTRL */
87#define AM33XX_CLKACTIVITY_GPIO0_GDBCLK_SHIFT 8 102#define AM33XX_CLKACTIVITY_GPIO0_GDBCLK_SHIFT 8
103#define AM33XX_CLKACTIVITY_GPIO0_GDBCLK_WIDTH 1
88#define AM33XX_CLKACTIVITY_GPIO0_GDBCLK_MASK (1 << 8) 104#define AM33XX_CLKACTIVITY_GPIO0_GDBCLK_MASK (1 << 8)
89 105
90/* Used by CM_PER_L4LS_CLKSTCTRL */ 106/* Used by CM_PER_L4LS_CLKSTCTRL */
91#define AM33XX_CLKACTIVITY_GPIO_1_GDBCLK_SHIFT 19 107#define AM33XX_CLKACTIVITY_GPIO_1_GDBCLK_SHIFT 19
108#define AM33XX_CLKACTIVITY_GPIO_1_GDBCLK_WIDTH 1
92#define AM33XX_CLKACTIVITY_GPIO_1_GDBCLK_MASK (1 << 19) 109#define AM33XX_CLKACTIVITY_GPIO_1_GDBCLK_MASK (1 << 19)
93 110
94/* Used by CM_PER_L4LS_CLKSTCTRL */ 111/* Used by CM_PER_L4LS_CLKSTCTRL */
95#define AM33XX_CLKACTIVITY_GPIO_2_GDBCLK_SHIFT 20 112#define AM33XX_CLKACTIVITY_GPIO_2_GDBCLK_SHIFT 20
113#define AM33XX_CLKACTIVITY_GPIO_2_GDBCLK_WIDTH 1
96#define AM33XX_CLKACTIVITY_GPIO_2_GDBCLK_MASK (1 << 20) 114#define AM33XX_CLKACTIVITY_GPIO_2_GDBCLK_MASK (1 << 20)
97 115
98/* Used by CM_PER_L4LS_CLKSTCTRL */ 116/* Used by CM_PER_L4LS_CLKSTCTRL */
99#define AM33XX_CLKACTIVITY_GPIO_3_GDBCLK_SHIFT 21 117#define AM33XX_CLKACTIVITY_GPIO_3_GDBCLK_SHIFT 21
118#define AM33XX_CLKACTIVITY_GPIO_3_GDBCLK_WIDTH 1
100#define AM33XX_CLKACTIVITY_GPIO_3_GDBCLK_MASK (1 << 21) 119#define AM33XX_CLKACTIVITY_GPIO_3_GDBCLK_MASK (1 << 21)
101 120
102/* Used by CM_PER_L4LS_CLKSTCTRL */ 121/* Used by CM_PER_L4LS_CLKSTCTRL */
103#define AM33XX_CLKACTIVITY_GPIO_4_GDBCLK_SHIFT 22 122#define AM33XX_CLKACTIVITY_GPIO_4_GDBCLK_SHIFT 22
123#define AM33XX_CLKACTIVITY_GPIO_4_GDBCLK_WIDTH 1
104#define AM33XX_CLKACTIVITY_GPIO_4_GDBCLK_MASK (1 << 22) 124#define AM33XX_CLKACTIVITY_GPIO_4_GDBCLK_MASK (1 << 22)
105 125
106/* Used by CM_PER_L4LS_CLKSTCTRL */ 126/* Used by CM_PER_L4LS_CLKSTCTRL */
107#define AM33XX_CLKACTIVITY_GPIO_5_GDBCLK_SHIFT 26 127#define AM33XX_CLKACTIVITY_GPIO_5_GDBCLK_SHIFT 26
128#define AM33XX_CLKACTIVITY_GPIO_5_GDBCLK_WIDTH 1
108#define AM33XX_CLKACTIVITY_GPIO_5_GDBCLK_MASK (1 << 26) 129#define AM33XX_CLKACTIVITY_GPIO_5_GDBCLK_MASK (1 << 26)
109 130
110/* Used by CM_PER_L4LS_CLKSTCTRL */ 131/* Used by CM_PER_L4LS_CLKSTCTRL */
111#define AM33XX_CLKACTIVITY_GPIO_6_GDBCLK_SHIFT 18 132#define AM33XX_CLKACTIVITY_GPIO_6_GDBCLK_SHIFT 18
133#define AM33XX_CLKACTIVITY_GPIO_6_GDBCLK_WIDTH 1
112#define AM33XX_CLKACTIVITY_GPIO_6_GDBCLK_MASK (1 << 18) 134#define AM33XX_CLKACTIVITY_GPIO_6_GDBCLK_MASK (1 << 18)
113 135
114/* Used by CM_WKUP_CLKSTCTRL */ 136/* Used by CM_WKUP_CLKSTCTRL */
115#define AM33XX_CLKACTIVITY_I2C0_GFCLK_SHIFT 11 137#define AM33XX_CLKACTIVITY_I2C0_GFCLK_SHIFT 11
138#define AM33XX_CLKACTIVITY_I2C0_GFCLK_WIDTH 1
116#define AM33XX_CLKACTIVITY_I2C0_GFCLK_MASK (1 << 11) 139#define AM33XX_CLKACTIVITY_I2C0_GFCLK_MASK (1 << 11)
117 140
118/* Used by CM_PER_L4LS_CLKSTCTRL */ 141/* Used by CM_PER_L4LS_CLKSTCTRL */
119#define AM33XX_CLKACTIVITY_I2C_FCLK_SHIFT 24 142#define AM33XX_CLKACTIVITY_I2C_FCLK_SHIFT 24
143#define AM33XX_CLKACTIVITY_I2C_FCLK_WIDTH 1
120#define AM33XX_CLKACTIVITY_I2C_FCLK_MASK (1 << 24) 144#define AM33XX_CLKACTIVITY_I2C_FCLK_MASK (1 << 24)
121 145
122/* Used by CM_PER_PRUSS_CLKSTCTRL */ 146/* Used by CM_PER_PRUSS_CLKSTCTRL */
123#define AM33XX_CLKACTIVITY_PRUSS_IEP_GCLK_SHIFT 5 147#define AM33XX_CLKACTIVITY_PRUSS_IEP_GCLK_SHIFT 5
148#define AM33XX_CLKACTIVITY_PRUSS_IEP_GCLK_WIDTH 1
124#define AM33XX_CLKACTIVITY_PRUSS_IEP_GCLK_MASK (1 << 5) 149#define AM33XX_CLKACTIVITY_PRUSS_IEP_GCLK_MASK (1 << 5)
125 150
126/* Used by CM_PER_PRUSS_CLKSTCTRL */ 151/* Used by CM_PER_PRUSS_CLKSTCTRL */
127#define AM33XX_CLKACTIVITY_PRUSS_OCP_GCLK_SHIFT 4 152#define AM33XX_CLKACTIVITY_PRUSS_OCP_GCLK_SHIFT 4
153#define AM33XX_CLKACTIVITY_PRUSS_OCP_GCLK_WIDTH 1
128#define AM33XX_CLKACTIVITY_PRUSS_OCP_GCLK_MASK (1 << 4) 154#define AM33XX_CLKACTIVITY_PRUSS_OCP_GCLK_MASK (1 << 4)
129 155
130/* Used by CM_PER_PRUSS_CLKSTCTRL */ 156/* Used by CM_PER_PRUSS_CLKSTCTRL */
131#define AM33XX_CLKACTIVITY_PRUSS_UART_GCLK_SHIFT 6 157#define AM33XX_CLKACTIVITY_PRUSS_UART_GCLK_SHIFT 6
158#define AM33XX_CLKACTIVITY_PRUSS_UART_GCLK_WIDTH 1
132#define AM33XX_CLKACTIVITY_PRUSS_UART_GCLK_MASK (1 << 6) 159#define AM33XX_CLKACTIVITY_PRUSS_UART_GCLK_MASK (1 << 6)
133 160
134/* Used by CM_PER_L3S_CLKSTCTRL */ 161/* Used by CM_PER_L3S_CLKSTCTRL */
135#define AM33XX_CLKACTIVITY_L3S_GCLK_SHIFT 3 162#define AM33XX_CLKACTIVITY_L3S_GCLK_SHIFT 3
163#define AM33XX_CLKACTIVITY_L3S_GCLK_WIDTH 1
136#define AM33XX_CLKACTIVITY_L3S_GCLK_MASK (1 << 3) 164#define AM33XX_CLKACTIVITY_L3S_GCLK_MASK (1 << 3)
137 165
138/* Used by CM_L3_AON_CLKSTCTRL */ 166/* Used by CM_L3_AON_CLKSTCTRL */
139#define AM33XX_CLKACTIVITY_L3_AON_GCLK_SHIFT 3 167#define AM33XX_CLKACTIVITY_L3_AON_GCLK_SHIFT 3
168#define AM33XX_CLKACTIVITY_L3_AON_GCLK_WIDTH 1
140#define AM33XX_CLKACTIVITY_L3_AON_GCLK_MASK (1 << 3) 169#define AM33XX_CLKACTIVITY_L3_AON_GCLK_MASK (1 << 3)
141 170
142/* Used by CM_PER_L3_CLKSTCTRL */ 171/* Used by CM_PER_L3_CLKSTCTRL */
143#define AM33XX_CLKACTIVITY_L3_GCLK_SHIFT 4 172#define AM33XX_CLKACTIVITY_L3_GCLK_SHIFT 4
173#define AM33XX_CLKACTIVITY_L3_GCLK_WIDTH 1
144#define AM33XX_CLKACTIVITY_L3_GCLK_MASK (1 << 4) 174#define AM33XX_CLKACTIVITY_L3_GCLK_MASK (1 << 4)
145 175
146/* Used by CM_PER_L4FW_CLKSTCTRL */ 176/* Used by CM_PER_L4FW_CLKSTCTRL */
147#define AM33XX_CLKACTIVITY_L4FW_GCLK_SHIFT 8 177#define AM33XX_CLKACTIVITY_L4FW_GCLK_SHIFT 8
178#define AM33XX_CLKACTIVITY_L4FW_GCLK_WIDTH 1
148#define AM33XX_CLKACTIVITY_L4FW_GCLK_MASK (1 << 8) 179#define AM33XX_CLKACTIVITY_L4FW_GCLK_MASK (1 << 8)
149 180
150/* Used by CM_PER_L4HS_CLKSTCTRL */ 181/* Used by CM_PER_L4HS_CLKSTCTRL */
151#define AM33XX_CLKACTIVITY_L4HS_GCLK_SHIFT 3 182#define AM33XX_CLKACTIVITY_L4HS_GCLK_SHIFT 3
183#define AM33XX_CLKACTIVITY_L4HS_GCLK_WIDTH 1
152#define AM33XX_CLKACTIVITY_L4HS_GCLK_MASK (1 << 3) 184#define AM33XX_CLKACTIVITY_L4HS_GCLK_MASK (1 << 3)
153 185
154/* Used by CM_PER_L4LS_CLKSTCTRL */ 186/* Used by CM_PER_L4LS_CLKSTCTRL */
155#define AM33XX_CLKACTIVITY_L4LS_GCLK_SHIFT 8 187#define AM33XX_CLKACTIVITY_L4LS_GCLK_SHIFT 8
188#define AM33XX_CLKACTIVITY_L4LS_GCLK_WIDTH 1
156#define AM33XX_CLKACTIVITY_L4LS_GCLK_MASK (1 << 8) 189#define AM33XX_CLKACTIVITY_L4LS_GCLK_MASK (1 << 8)
157 190
158/* Used by CM_GFX_L4LS_GFX_CLKSTCTRL__1 */ 191/* Used by CM_GFX_L4LS_GFX_CLKSTCTRL__1 */
159#define AM33XX_CLKACTIVITY_L4LS_GFX_GCLK_SHIFT 8 192#define AM33XX_CLKACTIVITY_L4LS_GFX_GCLK_SHIFT 8
193#define AM33XX_CLKACTIVITY_L4LS_GFX_GCLK_WIDTH 1
160#define AM33XX_CLKACTIVITY_L4LS_GFX_GCLK_MASK (1 << 8) 194#define AM33XX_CLKACTIVITY_L4LS_GFX_GCLK_MASK (1 << 8)
161 195
162/* Used by CM_CEFUSE_CLKSTCTRL */ 196/* Used by CM_CEFUSE_CLKSTCTRL */
163#define AM33XX_CLKACTIVITY_L4_CEFUSE_GICLK_SHIFT 8 197#define AM33XX_CLKACTIVITY_L4_CEFUSE_GICLK_SHIFT 8
198#define AM33XX_CLKACTIVITY_L4_CEFUSE_GICLK_WIDTH 1
164#define AM33XX_CLKACTIVITY_L4_CEFUSE_GICLK_MASK (1 << 8) 199#define AM33XX_CLKACTIVITY_L4_CEFUSE_GICLK_MASK (1 << 8)
165 200
166/* Used by CM_RTC_CLKSTCTRL */ 201/* Used by CM_RTC_CLKSTCTRL */
167#define AM33XX_CLKACTIVITY_L4_RTC_GCLK_SHIFT 8 202#define AM33XX_CLKACTIVITY_L4_RTC_GCLK_SHIFT 8
203#define AM33XX_CLKACTIVITY_L4_RTC_GCLK_WIDTH 1
168#define AM33XX_CLKACTIVITY_L4_RTC_GCLK_MASK (1 << 8) 204#define AM33XX_CLKACTIVITY_L4_RTC_GCLK_MASK (1 << 8)
169 205
170/* Used by CM_L4_WKUP_AON_CLKSTCTRL */ 206/* Used by CM_L4_WKUP_AON_CLKSTCTRL */
171#define AM33XX_CLKACTIVITY_L4_WKUP_AON_GCLK_SHIFT 2 207#define AM33XX_CLKACTIVITY_L4_WKUP_AON_GCLK_SHIFT 2
208#define AM33XX_CLKACTIVITY_L4_WKUP_AON_GCLK_WIDTH 1
172#define AM33XX_CLKACTIVITY_L4_WKUP_AON_GCLK_MASK (1 << 2) 209#define AM33XX_CLKACTIVITY_L4_WKUP_AON_GCLK_MASK (1 << 2)
173 210
174/* Used by CM_WKUP_CLKSTCTRL */ 211/* Used by CM_WKUP_CLKSTCTRL */
175#define AM33XX_CLKACTIVITY_L4_WKUP_GCLK_SHIFT 2 212#define AM33XX_CLKACTIVITY_L4_WKUP_GCLK_SHIFT 2
213#define AM33XX_CLKACTIVITY_L4_WKUP_GCLK_WIDTH 1
176#define AM33XX_CLKACTIVITY_L4_WKUP_GCLK_MASK (1 << 2) 214#define AM33XX_CLKACTIVITY_L4_WKUP_GCLK_MASK (1 << 2)
177 215
178/* Used by CM_PER_L4LS_CLKSTCTRL */ 216/* Used by CM_PER_L4LS_CLKSTCTRL */
179#define AM33XX_CLKACTIVITY_LCDC_GCLK_SHIFT 17 217#define AM33XX_CLKACTIVITY_LCDC_GCLK_SHIFT 17
218#define AM33XX_CLKACTIVITY_LCDC_GCLK_WIDTH 1
180#define AM33XX_CLKACTIVITY_LCDC_GCLK_MASK (1 << 17) 219#define AM33XX_CLKACTIVITY_LCDC_GCLK_MASK (1 << 17)
181 220
182/* Used by CM_PER_LCDC_CLKSTCTRL */ 221/* Used by CM_PER_LCDC_CLKSTCTRL */
183#define AM33XX_CLKACTIVITY_LCDC_L3_OCP_GCLK_SHIFT 4 222#define AM33XX_CLKACTIVITY_LCDC_L3_OCP_GCLK_SHIFT 4
223#define AM33XX_CLKACTIVITY_LCDC_L3_OCP_GCLK_WIDTH 1
184#define AM33XX_CLKACTIVITY_LCDC_L3_OCP_GCLK_MASK (1 << 4) 224#define AM33XX_CLKACTIVITY_LCDC_L3_OCP_GCLK_MASK (1 << 4)
185 225
186/* Used by CM_PER_LCDC_CLKSTCTRL */ 226/* Used by CM_PER_LCDC_CLKSTCTRL */
187#define AM33XX_CLKACTIVITY_LCDC_L4_OCP_GCLK_SHIFT 5 227#define AM33XX_CLKACTIVITY_LCDC_L4_OCP_GCLK_SHIFT 5
228#define AM33XX_CLKACTIVITY_LCDC_L4_OCP_GCLK_WIDTH 1
188#define AM33XX_CLKACTIVITY_LCDC_L4_OCP_GCLK_MASK (1 << 5) 229#define AM33XX_CLKACTIVITY_LCDC_L4_OCP_GCLK_MASK (1 << 5)
189 230
190/* Used by CM_PER_L3_CLKSTCTRL */ 231/* Used by CM_PER_L3_CLKSTCTRL */
191#define AM33XX_CLKACTIVITY_MCASP_GCLK_SHIFT 7 232#define AM33XX_CLKACTIVITY_MCASP_GCLK_SHIFT 7
233#define AM33XX_CLKACTIVITY_MCASP_GCLK_WIDTH 1
192#define AM33XX_CLKACTIVITY_MCASP_GCLK_MASK (1 << 7) 234#define AM33XX_CLKACTIVITY_MCASP_GCLK_MASK (1 << 7)
193 235
194/* Used by CM_PER_L3_CLKSTCTRL */ 236/* Used by CM_PER_L3_CLKSTCTRL */
195#define AM33XX_CLKACTIVITY_MMC_FCLK_SHIFT 3 237#define AM33XX_CLKACTIVITY_MMC_FCLK_SHIFT 3
238#define AM33XX_CLKACTIVITY_MMC_FCLK_WIDTH 1
196#define AM33XX_CLKACTIVITY_MMC_FCLK_MASK (1 << 3) 239#define AM33XX_CLKACTIVITY_MMC_FCLK_MASK (1 << 3)
197 240
198/* Used by CM_MPU_CLKSTCTRL */ 241/* Used by CM_MPU_CLKSTCTRL */
199#define AM33XX_CLKACTIVITY_MPU_CLK_SHIFT 2 242#define AM33XX_CLKACTIVITY_MPU_CLK_SHIFT 2
243#define AM33XX_CLKACTIVITY_MPU_CLK_WIDTH 1
200#define AM33XX_CLKACTIVITY_MPU_CLK_MASK (1 << 2) 244#define AM33XX_CLKACTIVITY_MPU_CLK_MASK (1 << 2)
201 245
202/* Used by CM_PER_OCPWP_L3_CLKSTCTRL */ 246/* Used by CM_PER_OCPWP_L3_CLKSTCTRL */
203#define AM33XX_CLKACTIVITY_OCPWP_L3_GCLK_SHIFT 4 247#define AM33XX_CLKACTIVITY_OCPWP_L3_GCLK_SHIFT 4
248#define AM33XX_CLKACTIVITY_OCPWP_L3_GCLK_WIDTH 1
204#define AM33XX_CLKACTIVITY_OCPWP_L3_GCLK_MASK (1 << 4) 249#define AM33XX_CLKACTIVITY_OCPWP_L3_GCLK_MASK (1 << 4)
205 250
206/* Used by CM_PER_OCPWP_L3_CLKSTCTRL */ 251/* Used by CM_PER_OCPWP_L3_CLKSTCTRL */
207#define AM33XX_CLKACTIVITY_OCPWP_L4_GCLK_SHIFT 5 252#define AM33XX_CLKACTIVITY_OCPWP_L4_GCLK_SHIFT 5
253#define AM33XX_CLKACTIVITY_OCPWP_L4_GCLK_WIDTH 1
208#define AM33XX_CLKACTIVITY_OCPWP_L4_GCLK_MASK (1 << 5) 254#define AM33XX_CLKACTIVITY_OCPWP_L4_GCLK_MASK (1 << 5)
209 255
210/* Used by CM_RTC_CLKSTCTRL */ 256/* Used by CM_RTC_CLKSTCTRL */
211#define AM33XX_CLKACTIVITY_RTC_32KCLK_SHIFT 9 257#define AM33XX_CLKACTIVITY_RTC_32KCLK_SHIFT 9
258#define AM33XX_CLKACTIVITY_RTC_32KCLK_WIDTH 1
212#define AM33XX_CLKACTIVITY_RTC_32KCLK_MASK (1 << 9) 259#define AM33XX_CLKACTIVITY_RTC_32KCLK_MASK (1 << 9)
213 260
214/* Used by CM_PER_L4LS_CLKSTCTRL */ 261/* Used by CM_PER_L4LS_CLKSTCTRL */
215#define AM33XX_CLKACTIVITY_SPI_GCLK_SHIFT 25 262#define AM33XX_CLKACTIVITY_SPI_GCLK_SHIFT 25
263#define AM33XX_CLKACTIVITY_SPI_GCLK_WIDTH 1
216#define AM33XX_CLKACTIVITY_SPI_GCLK_MASK (1 << 25) 264#define AM33XX_CLKACTIVITY_SPI_GCLK_MASK (1 << 25)
217 265
218/* Used by CM_WKUP_CLKSTCTRL */ 266/* Used by CM_WKUP_CLKSTCTRL */
219#define AM33XX_CLKACTIVITY_SR_SYSCLK_SHIFT 3 267#define AM33XX_CLKACTIVITY_SR_SYSCLK_SHIFT 3
268#define AM33XX_CLKACTIVITY_SR_SYSCLK_WIDTH 1
220#define AM33XX_CLKACTIVITY_SR_SYSCLK_MASK (1 << 3) 269#define AM33XX_CLKACTIVITY_SR_SYSCLK_MASK (1 << 3)
221 270
222/* Used by CM_WKUP_CLKSTCTRL */ 271/* Used by CM_WKUP_CLKSTCTRL */
223#define AM33XX_CLKACTIVITY_TIMER0_GCLK_SHIFT 10 272#define AM33XX_CLKACTIVITY_TIMER0_GCLK_SHIFT 10
273#define AM33XX_CLKACTIVITY_TIMER0_GCLK_WIDTH 1
224#define AM33XX_CLKACTIVITY_TIMER0_GCLK_MASK (1 << 10) 274#define AM33XX_CLKACTIVITY_TIMER0_GCLK_MASK (1 << 10)
225 275
226/* Used by CM_WKUP_CLKSTCTRL */ 276/* Used by CM_WKUP_CLKSTCTRL */
227#define AM33XX_CLKACTIVITY_TIMER1_GCLK_SHIFT 13 277#define AM33XX_CLKACTIVITY_TIMER1_GCLK_SHIFT 13
278#define AM33XX_CLKACTIVITY_TIMER1_GCLK_WIDTH 1
228#define AM33XX_CLKACTIVITY_TIMER1_GCLK_MASK (1 << 13) 279#define AM33XX_CLKACTIVITY_TIMER1_GCLK_MASK (1 << 13)
229 280
230/* Used by CM_PER_L4LS_CLKSTCTRL */ 281/* Used by CM_PER_L4LS_CLKSTCTRL */
231#define AM33XX_CLKACTIVITY_TIMER2_GCLK_SHIFT 14 282#define AM33XX_CLKACTIVITY_TIMER2_GCLK_SHIFT 14
283#define AM33XX_CLKACTIVITY_TIMER2_GCLK_WIDTH 1
232#define AM33XX_CLKACTIVITY_TIMER2_GCLK_MASK (1 << 14) 284#define AM33XX_CLKACTIVITY_TIMER2_GCLK_MASK (1 << 14)
233 285
234/* Used by CM_PER_L4LS_CLKSTCTRL */ 286/* Used by CM_PER_L4LS_CLKSTCTRL */
235#define AM33XX_CLKACTIVITY_TIMER3_GCLK_SHIFT 15 287#define AM33XX_CLKACTIVITY_TIMER3_GCLK_SHIFT 15
288#define AM33XX_CLKACTIVITY_TIMER3_GCLK_WIDTH 1
236#define AM33XX_CLKACTIVITY_TIMER3_GCLK_MASK (1 << 15) 289#define AM33XX_CLKACTIVITY_TIMER3_GCLK_MASK (1 << 15)
237 290
238/* Used by CM_PER_L4LS_CLKSTCTRL */ 291/* Used by CM_PER_L4LS_CLKSTCTRL */
239#define AM33XX_CLKACTIVITY_TIMER4_GCLK_SHIFT 16 292#define AM33XX_CLKACTIVITY_TIMER4_GCLK_SHIFT 16
293#define AM33XX_CLKACTIVITY_TIMER4_GCLK_WIDTH 1
240#define AM33XX_CLKACTIVITY_TIMER4_GCLK_MASK (1 << 16) 294#define AM33XX_CLKACTIVITY_TIMER4_GCLK_MASK (1 << 16)
241 295
242/* Used by CM_PER_L4LS_CLKSTCTRL */ 296/* Used by CM_PER_L4LS_CLKSTCTRL */
243#define AM33XX_CLKACTIVITY_TIMER5_GCLK_SHIFT 27 297#define AM33XX_CLKACTIVITY_TIMER5_GCLK_SHIFT 27
298#define AM33XX_CLKACTIVITY_TIMER5_GCLK_WIDTH 1
244#define AM33XX_CLKACTIVITY_TIMER5_GCLK_MASK (1 << 27) 299#define AM33XX_CLKACTIVITY_TIMER5_GCLK_MASK (1 << 27)
245 300
246/* Used by CM_PER_L4LS_CLKSTCTRL */ 301/* Used by CM_PER_L4LS_CLKSTCTRL */
247#define AM33XX_CLKACTIVITY_TIMER6_GCLK_SHIFT 28 302#define AM33XX_CLKACTIVITY_TIMER6_GCLK_SHIFT 28
303#define AM33XX_CLKACTIVITY_TIMER6_GCLK_WIDTH 1
248#define AM33XX_CLKACTIVITY_TIMER6_GCLK_MASK (1 << 28) 304#define AM33XX_CLKACTIVITY_TIMER6_GCLK_MASK (1 << 28)
249 305
250/* Used by CM_PER_L4LS_CLKSTCTRL */ 306/* Used by CM_PER_L4LS_CLKSTCTRL */
251#define AM33XX_CLKACTIVITY_TIMER7_GCLK_SHIFT 13 307#define AM33XX_CLKACTIVITY_TIMER7_GCLK_SHIFT 13
308#define AM33XX_CLKACTIVITY_TIMER7_GCLK_WIDTH 1
252#define AM33XX_CLKACTIVITY_TIMER7_GCLK_MASK (1 << 13) 309#define AM33XX_CLKACTIVITY_TIMER7_GCLK_MASK (1 << 13)
253 310
254/* Used by CM_WKUP_CLKSTCTRL */ 311/* Used by CM_WKUP_CLKSTCTRL */
255#define AM33XX_CLKACTIVITY_UART0_GFCLK_SHIFT 12 312#define AM33XX_CLKACTIVITY_UART0_GFCLK_SHIFT 12
313#define AM33XX_CLKACTIVITY_UART0_GFCLK_WIDTH 1
256#define AM33XX_CLKACTIVITY_UART0_GFCLK_MASK (1 << 12) 314#define AM33XX_CLKACTIVITY_UART0_GFCLK_MASK (1 << 12)
257 315
258/* Used by CM_PER_L4LS_CLKSTCTRL */ 316/* Used by CM_PER_L4LS_CLKSTCTRL */
259#define AM33XX_CLKACTIVITY_UART_GFCLK_SHIFT 10 317#define AM33XX_CLKACTIVITY_UART_GFCLK_SHIFT 10
318#define AM33XX_CLKACTIVITY_UART_GFCLK_WIDTH 1
260#define AM33XX_CLKACTIVITY_UART_GFCLK_MASK (1 << 10) 319#define AM33XX_CLKACTIVITY_UART_GFCLK_MASK (1 << 10)
261 320
262/* Used by CM_WKUP_CLKSTCTRL */ 321/* Used by CM_WKUP_CLKSTCTRL */
263#define AM33XX_CLKACTIVITY_WDT0_GCLK_SHIFT 9 322#define AM33XX_CLKACTIVITY_WDT0_GCLK_SHIFT 9
323#define AM33XX_CLKACTIVITY_WDT0_GCLK_WIDTH 1
264#define AM33XX_CLKACTIVITY_WDT0_GCLK_MASK (1 << 9) 324#define AM33XX_CLKACTIVITY_WDT0_GCLK_MASK (1 << 9)
265 325
266/* Used by CM_WKUP_CLKSTCTRL */ 326/* Used by CM_WKUP_CLKSTCTRL */
267#define AM33XX_CLKACTIVITY_WDT1_GCLK_SHIFT 4 327#define AM33XX_CLKACTIVITY_WDT1_GCLK_SHIFT 4
328#define AM33XX_CLKACTIVITY_WDT1_GCLK_WIDTH 1
268#define AM33XX_CLKACTIVITY_WDT1_GCLK_MASK (1 << 4) 329#define AM33XX_CLKACTIVITY_WDT1_GCLK_MASK (1 << 4)
269 330
270/* Used by CLKSEL_GFX_FCLK */ 331/* Used by CLKSEL_GFX_FCLK */
271#define AM33XX_CLKDIV_SEL_GFX_FCLK_SHIFT 0 332#define AM33XX_CLKDIV_SEL_GFX_FCLK_SHIFT 0
333#define AM33XX_CLKDIV_SEL_GFX_FCLK_WIDTH 1
272#define AM33XX_CLKDIV_SEL_GFX_FCLK_MASK (1 << 0) 334#define AM33XX_CLKDIV_SEL_GFX_FCLK_MASK (1 << 0)
273 335
274/* Used by CM_CLKOUT_CTRL */ 336/* Used by CM_CLKOUT_CTRL */
275#define AM33XX_CLKOUT2DIV_SHIFT 3 337#define AM33XX_CLKOUT2DIV_SHIFT 3
276#define AM33XX_CLKOUT2DIV_MASK (0x05 << 3) 338#define AM33XX_CLKOUT2DIV_WIDTH 3
339#define AM33XX_CLKOUT2DIV_MASK (0x7 << 3)
277 340
278/* Used by CM_CLKOUT_CTRL */ 341/* Used by CM_CLKOUT_CTRL */
279#define AM33XX_CLKOUT2EN_SHIFT 7 342#define AM33XX_CLKOUT2EN_SHIFT 7
343#define AM33XX_CLKOUT2EN_WIDTH 1
280#define AM33XX_CLKOUT2EN_MASK (1 << 7) 344#define AM33XX_CLKOUT2EN_MASK (1 << 7)
281 345
282/* Used by CM_CLKOUT_CTRL */ 346/* Used by CM_CLKOUT_CTRL */
283#define AM33XX_CLKOUT2SOURCE_SHIFT 0 347#define AM33XX_CLKOUT2SOURCE_SHIFT 0
284#define AM33XX_CLKOUT2SOURCE_MASK (0x02 << 0) 348#define AM33XX_CLKOUT2SOURCE_WIDTH 3
349#define AM33XX_CLKOUT2SOURCE_MASK (0x7 << 0)
285 350
286/* 351/*
287 * Used by CLKSEL_GPIO0_DBCLK, CLKSEL_LCDC_PIXEL_CLK, CLKSEL_TIMER2_CLK, 352 * Used by CLKSEL_GPIO0_DBCLK, CLKSEL_LCDC_PIXEL_CLK, CLKSEL_TIMER2_CLK,
@@ -289,6 +354,7 @@
289 * CLKSEL_TIMER7_CLK 354 * CLKSEL_TIMER7_CLK
290 */ 355 */
291#define AM33XX_CLKSEL_SHIFT 0 356#define AM33XX_CLKSEL_SHIFT 0
357#define AM33XX_CLKSEL_WIDTH 1
292#define AM33XX_CLKSEL_MASK (0x01 << 0) 358#define AM33XX_CLKSEL_MASK (0x01 << 0)
293 359
294/* 360/*
@@ -296,17 +362,21 @@
296 * CM_CPTS_RFT_CLKSEL 362 * CM_CPTS_RFT_CLKSEL
297 */ 363 */
298#define AM33XX_CLKSEL_0_0_SHIFT 0 364#define AM33XX_CLKSEL_0_0_SHIFT 0
365#define AM33XX_CLKSEL_0_0_WIDTH 1
299#define AM33XX_CLKSEL_0_0_MASK (1 << 0) 366#define AM33XX_CLKSEL_0_0_MASK (1 << 0)
300 367
301#define AM33XX_CLKSEL_0_1_SHIFT 0 368#define AM33XX_CLKSEL_0_1_SHIFT 0
369#define AM33XX_CLKSEL_0_1_WIDTH 2
302#define AM33XX_CLKSEL_0_1_MASK (3 << 0) 370#define AM33XX_CLKSEL_0_1_MASK (3 << 0)
303 371
304/* Renamed from CLKSEL Used by CLKSEL_TIMER1MS_CLK */ 372/* Renamed from CLKSEL Used by CLKSEL_TIMER1MS_CLK */
305#define AM33XX_CLKSEL_0_2_SHIFT 0 373#define AM33XX_CLKSEL_0_2_SHIFT 0
374#define AM33XX_CLKSEL_0_2_WIDTH 3
306#define AM33XX_CLKSEL_0_2_MASK (7 << 0) 375#define AM33XX_CLKSEL_0_2_MASK (7 << 0)
307 376
308/* Used by CLKSEL_GFX_FCLK */ 377/* Used by CLKSEL_GFX_FCLK */
309#define AM33XX_CLKSEL_GFX_FCLK_SHIFT 1 378#define AM33XX_CLKSEL_GFX_FCLK_SHIFT 1
379#define AM33XX_CLKSEL_GFX_FCLK_WIDTH 1
310#define AM33XX_CLKSEL_GFX_FCLK_MASK (1 << 1) 380#define AM33XX_CLKSEL_GFX_FCLK_MASK (1 << 1)
311 381
312/* 382/*
@@ -318,6 +388,7 @@
318 * CM_GFX_L3_CLKSTCTRL, CM_GFX_L4LS_GFX_CLKSTCTRL__1, CM_CEFUSE_CLKSTCTRL 388 * CM_GFX_L3_CLKSTCTRL, CM_GFX_L4LS_GFX_CLKSTCTRL__1, CM_CEFUSE_CLKSTCTRL
319 */ 389 */
320#define AM33XX_CLKTRCTRL_SHIFT 0 390#define AM33XX_CLKTRCTRL_SHIFT 0
391#define AM33XX_CLKTRCTRL_WIDTH 2
321#define AM33XX_CLKTRCTRL_MASK (0x3 << 0) 392#define AM33XX_CLKTRCTRL_MASK (0x3 << 0)
322 393
323/* 394/*
@@ -326,34 +397,42 @@
326 * CM_SSC_DELTAMSTEP_DPLL_PER 397 * CM_SSC_DELTAMSTEP_DPLL_PER
327 */ 398 */
328#define AM33XX_DELTAMSTEP_SHIFT 0 399#define AM33XX_DELTAMSTEP_SHIFT 0
329#define AM33XX_DELTAMSTEP_MASK (0x19 << 0) 400#define AM33XX_DELTAMSTEP_WIDTH 20
401#define AM33XX_DELTAMSTEP_MASK (0xfffff << 0)
330 402
331/* Used by CM_CLKSEL_DPLL_DDR, CM_CLKSEL_DPLL_DISP, CM_CLKSEL_DPLL_MPU */ 403/* Used by CM_CLKSEL_DPLL_DDR, CM_CLKSEL_DPLL_DISP, CM_CLKSEL_DPLL_MPU */
332#define AM33XX_DPLL_BYP_CLKSEL_SHIFT 23 404#define AM33XX_DPLL_BYP_CLKSEL_SHIFT 23
405#define AM33XX_DPLL_BYP_CLKSEL_WIDTH 1
333#define AM33XX_DPLL_BYP_CLKSEL_MASK (1 << 23) 406#define AM33XX_DPLL_BYP_CLKSEL_MASK (1 << 23)
334 407
335/* Used by CM_CLKDCOLDO_DPLL_PER */ 408/* Used by CM_CLKDCOLDO_DPLL_PER */
336#define AM33XX_DPLL_CLKDCOLDO_GATE_CTRL_SHIFT 8 409#define AM33XX_DPLL_CLKDCOLDO_GATE_CTRL_SHIFT 8
410#define AM33XX_DPLL_CLKDCOLDO_GATE_CTRL_WIDTH 1
337#define AM33XX_DPLL_CLKDCOLDO_GATE_CTRL_MASK (1 << 8) 411#define AM33XX_DPLL_CLKDCOLDO_GATE_CTRL_MASK (1 << 8)
338 412
339/* Used by CM_CLKDCOLDO_DPLL_PER */ 413/* Used by CM_CLKDCOLDO_DPLL_PER */
340#define AM33XX_DPLL_CLKDCOLDO_PWDN_SHIFT 12 414#define AM33XX_DPLL_CLKDCOLDO_PWDN_SHIFT 12
415#define AM33XX_DPLL_CLKDCOLDO_PWDN_WIDTH 1
341#define AM33XX_DPLL_CLKDCOLDO_PWDN_MASK (1 << 12) 416#define AM33XX_DPLL_CLKDCOLDO_PWDN_MASK (1 << 12)
342 417
343/* Used by CM_DIV_M2_DPLL_DDR, CM_DIV_M2_DPLL_DISP, CM_DIV_M2_DPLL_MPU */ 418/* Used by CM_DIV_M2_DPLL_DDR, CM_DIV_M2_DPLL_DISP, CM_DIV_M2_DPLL_MPU */
344#define AM33XX_DPLL_CLKOUT_DIV_SHIFT 0 419#define AM33XX_DPLL_CLKOUT_DIV_SHIFT 0
420#define AM33XX_DPLL_CLKOUT_DIV_WIDTH 5
345#define AM33XX_DPLL_CLKOUT_DIV_MASK (0x1f << 0) 421#define AM33XX_DPLL_CLKOUT_DIV_MASK (0x1f << 0)
346 422
347/* Renamed from DPLL_CLKOUT_DIV Used by CM_DIV_M2_DPLL_PER */ 423/* Renamed from DPLL_CLKOUT_DIV Used by CM_DIV_M2_DPLL_PER */
348#define AM33XX_DPLL_CLKOUT_DIV_0_6_SHIFT 0 424#define AM33XX_DPLL_CLKOUT_DIV_0_6_SHIFT 0
349#define AM33XX_DPLL_CLKOUT_DIV_0_6_MASK (0x06 << 0) 425#define AM33XX_DPLL_CLKOUT_DIV_0_6_WIDTH 7
426#define AM33XX_DPLL_CLKOUT_DIV_0_6_MASK (0x7f << 0)
350 427
351/* Used by CM_DIV_M2_DPLL_DDR, CM_DIV_M2_DPLL_DISP, CM_DIV_M2_DPLL_MPU */ 428/* Used by CM_DIV_M2_DPLL_DDR, CM_DIV_M2_DPLL_DISP, CM_DIV_M2_DPLL_MPU */
352#define AM33XX_DPLL_CLKOUT_DIVCHACK_SHIFT 5 429#define AM33XX_DPLL_CLKOUT_DIVCHACK_SHIFT 5
430#define AM33XX_DPLL_CLKOUT_DIVCHACK_WIDTH 1
353#define AM33XX_DPLL_CLKOUT_DIVCHACK_MASK (1 << 5) 431#define AM33XX_DPLL_CLKOUT_DIVCHACK_MASK (1 << 5)
354 432
355/* Renamed from DPLL_CLKOUT_DIVCHACK Used by CM_DIV_M2_DPLL_PER */ 433/* Renamed from DPLL_CLKOUT_DIVCHACK Used by CM_DIV_M2_DPLL_PER */
356#define AM33XX_DPLL_CLKOUT_DIVCHACK_M2_PER_SHIFT 7 434#define AM33XX_DPLL_CLKOUT_DIVCHACK_M2_PER_SHIFT 7
435#define AM33XX_DPLL_CLKOUT_DIVCHACK_M2_PER_WIDTH 1
357#define AM33XX_DPLL_CLKOUT_DIVCHACK_M2_PER_MASK (1 << 7) 436#define AM33XX_DPLL_CLKOUT_DIVCHACK_M2_PER_MASK (1 << 7)
358 437
359/* 438/*
@@ -361,6 +440,7 @@
361 * CM_DIV_M2_DPLL_PER 440 * CM_DIV_M2_DPLL_PER
362 */ 441 */
363#define AM33XX_DPLL_CLKOUT_GATE_CTRL_SHIFT 8 442#define AM33XX_DPLL_CLKOUT_GATE_CTRL_SHIFT 8
443#define AM33XX_DPLL_CLKOUT_GATE_CTRL_WIDTH 1
364#define AM33XX_DPLL_CLKOUT_GATE_CTRL_MASK (1 << 8) 444#define AM33XX_DPLL_CLKOUT_GATE_CTRL_MASK (1 << 8)
365 445
366/* 446/*
@@ -368,19 +448,22 @@
368 * CM_CLKSEL_DPLL_MPU 448 * CM_CLKSEL_DPLL_MPU
369 */ 449 */
370#define AM33XX_DPLL_DIV_SHIFT 0 450#define AM33XX_DPLL_DIV_SHIFT 0
451#define AM33XX_DPLL_DIV_WIDTH 7
371#define AM33XX_DPLL_DIV_MASK (0x7f << 0) 452#define AM33XX_DPLL_DIV_MASK (0x7f << 0)
372 453
373#define AM33XX_DPLL_PER_DIV_MASK (0xff << 0) 454#define AM33XX_DPLL_PER_DIV_MASK (0xff << 0)
374 455
375/* Renamed from DPLL_DIV Used by CM_CLKSEL_DPLL_PERIPH */ 456/* Renamed from DPLL_DIV Used by CM_CLKSEL_DPLL_PERIPH */
376#define AM33XX_DPLL_DIV_0_7_SHIFT 0 457#define AM33XX_DPLL_DIV_0_7_SHIFT 0
377#define AM33XX_DPLL_DIV_0_7_MASK (0x07 << 0) 458#define AM33XX_DPLL_DIV_0_7_WIDTH 8
459#define AM33XX_DPLL_DIV_0_7_MASK (0xff << 0)
378 460
379/* 461/*
380 * Used by CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDR, CM_CLKMODE_DPLL_DISP, 462 * Used by CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDR, CM_CLKMODE_DPLL_DISP,
381 * CM_CLKMODE_DPLL_MPU 463 * CM_CLKMODE_DPLL_MPU
382 */ 464 */
383#define AM33XX_DPLL_DRIFTGUARD_EN_SHIFT 8 465#define AM33XX_DPLL_DRIFTGUARD_EN_SHIFT 8
466#define AM33XX_DPLL_DRIFTGUARD_EN_WIDTH 1
384#define AM33XX_DPLL_DRIFTGUARD_EN_MASK (1 << 8) 467#define AM33XX_DPLL_DRIFTGUARD_EN_MASK (1 << 8)
385 468
386/* 469/*
@@ -388,6 +471,7 @@
388 * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER 471 * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
389 */ 472 */
390#define AM33XX_DPLL_EN_SHIFT 0 473#define AM33XX_DPLL_EN_SHIFT 0
474#define AM33XX_DPLL_EN_WIDTH 3
391#define AM33XX_DPLL_EN_MASK (0x7 << 0) 475#define AM33XX_DPLL_EN_MASK (0x7 << 0)
392 476
393/* 477/*
@@ -395,6 +479,7 @@
395 * CM_CLKMODE_DPLL_MPU 479 * CM_CLKMODE_DPLL_MPU
396 */ 480 */
397#define AM33XX_DPLL_LPMODE_EN_SHIFT 10 481#define AM33XX_DPLL_LPMODE_EN_SHIFT 10
482#define AM33XX_DPLL_LPMODE_EN_WIDTH 1
398#define AM33XX_DPLL_LPMODE_EN_MASK (1 << 10) 483#define AM33XX_DPLL_LPMODE_EN_MASK (1 << 10)
399 484
400/* 485/*
@@ -402,10 +487,12 @@
402 * CM_CLKSEL_DPLL_MPU 487 * CM_CLKSEL_DPLL_MPU
403 */ 488 */
404#define AM33XX_DPLL_MULT_SHIFT 8 489#define AM33XX_DPLL_MULT_SHIFT 8
490#define AM33XX_DPLL_MULT_WIDTH 11
405#define AM33XX_DPLL_MULT_MASK (0x7ff << 8) 491#define AM33XX_DPLL_MULT_MASK (0x7ff << 8)
406 492
407/* Renamed from DPLL_MULT Used by CM_CLKSEL_DPLL_PERIPH */ 493/* Renamed from DPLL_MULT Used by CM_CLKSEL_DPLL_PERIPH */
408#define AM33XX_DPLL_MULT_PERIPH_SHIFT 8 494#define AM33XX_DPLL_MULT_PERIPH_SHIFT 8
495#define AM33XX_DPLL_MULT_PERIPH_WIDTH 12
409#define AM33XX_DPLL_MULT_PERIPH_MASK (0xfff << 8) 496#define AM33XX_DPLL_MULT_PERIPH_MASK (0xfff << 8)
410 497
411/* 498/*
@@ -413,17 +500,20 @@
413 * CM_CLKMODE_DPLL_MPU 500 * CM_CLKMODE_DPLL_MPU
414 */ 501 */
415#define AM33XX_DPLL_REGM4XEN_SHIFT 11 502#define AM33XX_DPLL_REGM4XEN_SHIFT 11
503#define AM33XX_DPLL_REGM4XEN_WIDTH 1
416#define AM33XX_DPLL_REGM4XEN_MASK (1 << 11) 504#define AM33XX_DPLL_REGM4XEN_MASK (1 << 11)
417 505
418/* Used by CM_CLKSEL_DPLL_PERIPH */ 506/* Used by CM_CLKSEL_DPLL_PERIPH */
419#define AM33XX_DPLL_SD_DIV_SHIFT 24 507#define AM33XX_DPLL_SD_DIV_SHIFT 24
420#define AM33XX_DPLL_SD_DIV_MASK (24, 31) 508#define AM33XX_DPLL_SD_DIV_WIDTH 8
509#define AM33XX_DPLL_SD_DIV_MASK (0xff << 24)
421 510
422/* 511/*
423 * Used by CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDR, CM_CLKMODE_DPLL_DISP, 512 * Used by CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDR, CM_CLKMODE_DPLL_DISP,
424 * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER 513 * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
425 */ 514 */
426#define AM33XX_DPLL_SSC_ACK_SHIFT 13 515#define AM33XX_DPLL_SSC_ACK_SHIFT 13
516#define AM33XX_DPLL_SSC_ACK_WIDTH 1
427#define AM33XX_DPLL_SSC_ACK_MASK (1 << 13) 517#define AM33XX_DPLL_SSC_ACK_MASK (1 << 13)
428 518
429/* 519/*
@@ -431,6 +521,7 @@
431 * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER 521 * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
432 */ 522 */
433#define AM33XX_DPLL_SSC_DOWNSPREAD_SHIFT 14 523#define AM33XX_DPLL_SSC_DOWNSPREAD_SHIFT 14
524#define AM33XX_DPLL_SSC_DOWNSPREAD_WIDTH 1
434#define AM33XX_DPLL_SSC_DOWNSPREAD_MASK (1 << 14) 525#define AM33XX_DPLL_SSC_DOWNSPREAD_MASK (1 << 14)
435 526
436/* 527/*
@@ -438,54 +529,67 @@
438 * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER 529 * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
439 */ 530 */
440#define AM33XX_DPLL_SSC_EN_SHIFT 12 531#define AM33XX_DPLL_SSC_EN_SHIFT 12
532#define AM33XX_DPLL_SSC_EN_WIDTH 1
441#define AM33XX_DPLL_SSC_EN_MASK (1 << 12) 533#define AM33XX_DPLL_SSC_EN_MASK (1 << 12)
442 534
443/* Used by CM_DIV_M4_DPLL_CORE */ 535/* Used by CM_DIV_M4_DPLL_CORE */
444#define AM33XX_HSDIVIDER_CLKOUT1_DIV_SHIFT 0 536#define AM33XX_HSDIVIDER_CLKOUT1_DIV_SHIFT 0
537#define AM33XX_HSDIVIDER_CLKOUT1_DIV_WIDTH 5
445#define AM33XX_HSDIVIDER_CLKOUT1_DIV_MASK (0x1f << 0) 538#define AM33XX_HSDIVIDER_CLKOUT1_DIV_MASK (0x1f << 0)
446 539
447/* Used by CM_DIV_M4_DPLL_CORE */ 540/* Used by CM_DIV_M4_DPLL_CORE */
448#define AM33XX_HSDIVIDER_CLKOUT1_DIVCHACK_SHIFT 5 541#define AM33XX_HSDIVIDER_CLKOUT1_DIVCHACK_SHIFT 5
542#define AM33XX_HSDIVIDER_CLKOUT1_DIVCHACK_WIDTH 1
449#define AM33XX_HSDIVIDER_CLKOUT1_DIVCHACK_MASK (1 << 5) 543#define AM33XX_HSDIVIDER_CLKOUT1_DIVCHACK_MASK (1 << 5)
450 544
451/* Used by CM_DIV_M4_DPLL_CORE */ 545/* Used by CM_DIV_M4_DPLL_CORE */
452#define AM33XX_HSDIVIDER_CLKOUT1_GATE_CTRL_SHIFT 8 546#define AM33XX_HSDIVIDER_CLKOUT1_GATE_CTRL_SHIFT 8
547#define AM33XX_HSDIVIDER_CLKOUT1_GATE_CTRL_WIDTH 1
453#define AM33XX_HSDIVIDER_CLKOUT1_GATE_CTRL_MASK (1 << 8) 548#define AM33XX_HSDIVIDER_CLKOUT1_GATE_CTRL_MASK (1 << 8)
454 549
455/* Used by CM_DIV_M4_DPLL_CORE */ 550/* Used by CM_DIV_M4_DPLL_CORE */
456#define AM33XX_HSDIVIDER_CLKOUT1_PWDN_SHIFT 12 551#define AM33XX_HSDIVIDER_CLKOUT1_PWDN_SHIFT 12
552#define AM33XX_HSDIVIDER_CLKOUT1_PWDN_WIDTH 1
457#define AM33XX_HSDIVIDER_CLKOUT1_PWDN_MASK (1 << 12) 553#define AM33XX_HSDIVIDER_CLKOUT1_PWDN_MASK (1 << 12)
458 554
459/* Used by CM_DIV_M5_DPLL_CORE */ 555/* Used by CM_DIV_M5_DPLL_CORE */
460#define AM33XX_HSDIVIDER_CLKOUT2_DIV_SHIFT 0 556#define AM33XX_HSDIVIDER_CLKOUT2_DIV_SHIFT 0
557#define AM33XX_HSDIVIDER_CLKOUT2_DIV_WIDTH 5
461#define AM33XX_HSDIVIDER_CLKOUT2_DIV_MASK (0x1f << 0) 558#define AM33XX_HSDIVIDER_CLKOUT2_DIV_MASK (0x1f << 0)
462 559
463/* Used by CM_DIV_M5_DPLL_CORE */ 560/* Used by CM_DIV_M5_DPLL_CORE */
464#define AM33XX_HSDIVIDER_CLKOUT2_DIVCHACK_SHIFT 5 561#define AM33XX_HSDIVIDER_CLKOUT2_DIVCHACK_SHIFT 5
562#define AM33XX_HSDIVIDER_CLKOUT2_DIVCHACK_WIDTH 1
465#define AM33XX_HSDIVIDER_CLKOUT2_DIVCHACK_MASK (1 << 5) 563#define AM33XX_HSDIVIDER_CLKOUT2_DIVCHACK_MASK (1 << 5)
466 564
467/* Used by CM_DIV_M5_DPLL_CORE */ 565/* Used by CM_DIV_M5_DPLL_CORE */
468#define AM33XX_HSDIVIDER_CLKOUT2_GATE_CTRL_SHIFT 8 566#define AM33XX_HSDIVIDER_CLKOUT2_GATE_CTRL_SHIFT 8
567#define AM33XX_HSDIVIDER_CLKOUT2_GATE_CTRL_WIDTH 1
469#define AM33XX_HSDIVIDER_CLKOUT2_GATE_CTRL_MASK (1 << 8) 568#define AM33XX_HSDIVIDER_CLKOUT2_GATE_CTRL_MASK (1 << 8)
470 569
471/* Used by CM_DIV_M5_DPLL_CORE */ 570/* Used by CM_DIV_M5_DPLL_CORE */
472#define AM33XX_HSDIVIDER_CLKOUT2_PWDN_SHIFT 12 571#define AM33XX_HSDIVIDER_CLKOUT2_PWDN_SHIFT 12
572#define AM33XX_HSDIVIDER_CLKOUT2_PWDN_WIDTH 1
473#define AM33XX_HSDIVIDER_CLKOUT2_PWDN_MASK (1 << 12) 573#define AM33XX_HSDIVIDER_CLKOUT2_PWDN_MASK (1 << 12)
474 574
475/* Used by CM_DIV_M6_DPLL_CORE */ 575/* Used by CM_DIV_M6_DPLL_CORE */
476#define AM33XX_HSDIVIDER_CLKOUT3_DIV_SHIFT 0 576#define AM33XX_HSDIVIDER_CLKOUT3_DIV_SHIFT 0
477#define AM33XX_HSDIVIDER_CLKOUT3_DIV_MASK (0x04 << 0) 577#define AM33XX_HSDIVIDER_CLKOUT3_DIV_WIDTH 5
578#define AM33XX_HSDIVIDER_CLKOUT3_DIV_MASK (0x1f << 0)
478 579
479/* Used by CM_DIV_M6_DPLL_CORE */ 580/* Used by CM_DIV_M6_DPLL_CORE */
480#define AM33XX_HSDIVIDER_CLKOUT3_DIVCHACK_SHIFT 5 581#define AM33XX_HSDIVIDER_CLKOUT3_DIVCHACK_SHIFT 5
582#define AM33XX_HSDIVIDER_CLKOUT3_DIVCHACK_WIDTH 1
481#define AM33XX_HSDIVIDER_CLKOUT3_DIVCHACK_MASK (1 << 5) 583#define AM33XX_HSDIVIDER_CLKOUT3_DIVCHACK_MASK (1 << 5)
482 584
483/* Used by CM_DIV_M6_DPLL_CORE */ 585/* Used by CM_DIV_M6_DPLL_CORE */
484#define AM33XX_HSDIVIDER_CLKOUT3_GATE_CTRL_SHIFT 8 586#define AM33XX_HSDIVIDER_CLKOUT3_GATE_CTRL_SHIFT 8
587#define AM33XX_HSDIVIDER_CLKOUT3_GATE_CTRL_WIDTH 1
485#define AM33XX_HSDIVIDER_CLKOUT3_GATE_CTRL_MASK (1 << 8) 588#define AM33XX_HSDIVIDER_CLKOUT3_GATE_CTRL_MASK (1 << 8)
486 589
487/* Used by CM_DIV_M6_DPLL_CORE */ 590/* Used by CM_DIV_M6_DPLL_CORE */
488#define AM33XX_HSDIVIDER_CLKOUT3_PWDN_SHIFT 12 591#define AM33XX_HSDIVIDER_CLKOUT3_PWDN_SHIFT 12
592#define AM33XX_HSDIVIDER_CLKOUT3_PWDN_WIDTH 1
489#define AM33XX_HSDIVIDER_CLKOUT3_PWDN_MASK (1 << 12) 593#define AM33XX_HSDIVIDER_CLKOUT3_PWDN_MASK (1 << 12)
490 594
491/* 595/*
@@ -522,11 +626,12 @@
522 * CM_GFX_MMUCFG_CLKCTRL, CM_GFX_MMUDATA_CLKCTRL, CM_CEFUSE_CEFUSE_CLKCTRL 626 * CM_GFX_MMUCFG_CLKCTRL, CM_GFX_MMUDATA_CLKCTRL, CM_CEFUSE_CEFUSE_CLKCTRL
523 */ 627 */
524#define AM33XX_IDLEST_SHIFT 16 628#define AM33XX_IDLEST_SHIFT 16
629#define AM33XX_IDLEST_WIDTH 2
525#define AM33XX_IDLEST_MASK (0x3 << 16) 630#define AM33XX_IDLEST_MASK (0x3 << 16)
526#define AM33XX_IDLEST_VAL 0x3
527 631
528/* Used by CM_MAC_CLKSEL */ 632/* Used by CM_MAC_CLKSEL */
529#define AM33XX_MII_CLK_SEL_SHIFT 2 633#define AM33XX_MII_CLK_SEL_SHIFT 2
634#define AM33XX_MII_CLK_SEL_WIDTH 1
530#define AM33XX_MII_CLK_SEL_MASK (1 << 2) 635#define AM33XX_MII_CLK_SEL_MASK (1 << 2)
531 636
532/* 637/*
@@ -535,7 +640,8 @@
535 * CM_SSC_MODFREQDIV_DPLL_PER 640 * CM_SSC_MODFREQDIV_DPLL_PER
536 */ 641 */
537#define AM33XX_MODFREQDIV_EXPONENT_SHIFT 8 642#define AM33XX_MODFREQDIV_EXPONENT_SHIFT 8
538#define AM33XX_MODFREQDIV_EXPONENT_MASK (0x10 << 8) 643#define AM33XX_MODFREQDIV_EXPONENT_WIDTH 3
644#define AM33XX_MODFREQDIV_EXPONENT_MASK (0x7 << 8)
539 645
540/* 646/*
541 * Used by CM_SSC_MODFREQDIV_DPLL_CORE, CM_SSC_MODFREQDIV_DPLL_DDR, 647 * Used by CM_SSC_MODFREQDIV_DPLL_CORE, CM_SSC_MODFREQDIV_DPLL_DDR,
@@ -543,7 +649,8 @@
543 * CM_SSC_MODFREQDIV_DPLL_PER 649 * CM_SSC_MODFREQDIV_DPLL_PER
544 */ 650 */
545#define AM33XX_MODFREQDIV_MANTISSA_SHIFT 0 651#define AM33XX_MODFREQDIV_MANTISSA_SHIFT 0
546#define AM33XX_MODFREQDIV_MANTISSA_MASK (0x06 << 0) 652#define AM33XX_MODFREQDIV_MANTISSA_WIDTH 7
653#define AM33XX_MODFREQDIV_MANTISSA_MASK (0x7f << 0)
547 654
548/* 655/*
549 * Used by CM_MPU_MPU_CLKCTRL, CM_RTC_RTC_CLKCTRL, CM_PER_AES0_CLKCTRL, 656 * Used by CM_MPU_MPU_CLKCTRL, CM_RTC_RTC_CLKCTRL, CM_PER_AES0_CLKCTRL,
@@ -580,42 +687,52 @@
580 * CM_CEFUSE_CEFUSE_CLKCTRL 687 * CM_CEFUSE_CEFUSE_CLKCTRL
581 */ 688 */
582#define AM33XX_MODULEMODE_SHIFT 0 689#define AM33XX_MODULEMODE_SHIFT 0
690#define AM33XX_MODULEMODE_WIDTH 2
583#define AM33XX_MODULEMODE_MASK (0x3 << 0) 691#define AM33XX_MODULEMODE_MASK (0x3 << 0)
584 692
585/* Used by CM_WKUP_DEBUGSS_CLKCTRL */ 693/* Used by CM_WKUP_DEBUGSS_CLKCTRL */
586#define AM33XX_OPTCLK_DEBUG_CLKA_SHIFT 30 694#define AM33XX_OPTCLK_DEBUG_CLKA_SHIFT 30
695#define AM33XX_OPTCLK_DEBUG_CLKA_WIDTH 1
587#define AM33XX_OPTCLK_DEBUG_CLKA_MASK (1 << 30) 696#define AM33XX_OPTCLK_DEBUG_CLKA_MASK (1 << 30)
588 697
589/* Used by CM_WKUP_DEBUGSS_CLKCTRL */ 698/* Used by CM_WKUP_DEBUGSS_CLKCTRL */
590#define AM33XX_OPTFCLKEN_DBGSYSCLK_SHIFT 19 699#define AM33XX_OPTFCLKEN_DBGSYSCLK_SHIFT 19
700#define AM33XX_OPTFCLKEN_DBGSYSCLK_WIDTH 1
591#define AM33XX_OPTFCLKEN_DBGSYSCLK_MASK (1 << 19) 701#define AM33XX_OPTFCLKEN_DBGSYSCLK_MASK (1 << 19)
592 702
593/* Used by CM_WKUP_GPIO0_CLKCTRL */ 703/* Used by CM_WKUP_GPIO0_CLKCTRL */
594#define AM33XX_OPTFCLKEN_GPIO0_GDBCLK_SHIFT 18 704#define AM33XX_OPTFCLKEN_GPIO0_GDBCLK_SHIFT 18
705#define AM33XX_OPTFCLKEN_GPIO0_GDBCLK_WIDTH 1
595#define AM33XX_OPTFCLKEN_GPIO0_GDBCLK_MASK (1 << 18) 706#define AM33XX_OPTFCLKEN_GPIO0_GDBCLK_MASK (1 << 18)
596 707
597/* Used by CM_PER_GPIO1_CLKCTRL */ 708/* Used by CM_PER_GPIO1_CLKCTRL */
598#define AM33XX_OPTFCLKEN_GPIO_1_GDBCLK_SHIFT 18 709#define AM33XX_OPTFCLKEN_GPIO_1_GDBCLK_SHIFT 18
710#define AM33XX_OPTFCLKEN_GPIO_1_GDBCLK_WIDTH 1
599#define AM33XX_OPTFCLKEN_GPIO_1_GDBCLK_MASK (1 << 18) 711#define AM33XX_OPTFCLKEN_GPIO_1_GDBCLK_MASK (1 << 18)
600 712
601/* Used by CM_PER_GPIO2_CLKCTRL */ 713/* Used by CM_PER_GPIO2_CLKCTRL */
602#define AM33XX_OPTFCLKEN_GPIO_2_GDBCLK_SHIFT 18 714#define AM33XX_OPTFCLKEN_GPIO_2_GDBCLK_SHIFT 18
715#define AM33XX_OPTFCLKEN_GPIO_2_GDBCLK_WIDTH 1
603#define AM33XX_OPTFCLKEN_GPIO_2_GDBCLK_MASK (1 << 18) 716#define AM33XX_OPTFCLKEN_GPIO_2_GDBCLK_MASK (1 << 18)
604 717
605/* Used by CM_PER_GPIO3_CLKCTRL */ 718/* Used by CM_PER_GPIO3_CLKCTRL */
606#define AM33XX_OPTFCLKEN_GPIO_3_GDBCLK_SHIFT 18 719#define AM33XX_OPTFCLKEN_GPIO_3_GDBCLK_SHIFT 18
720#define AM33XX_OPTFCLKEN_GPIO_3_GDBCLK_WIDTH 1
607#define AM33XX_OPTFCLKEN_GPIO_3_GDBCLK_MASK (1 << 18) 721#define AM33XX_OPTFCLKEN_GPIO_3_GDBCLK_MASK (1 << 18)
608 722
609/* Used by CM_PER_GPIO4_CLKCTRL */ 723/* Used by CM_PER_GPIO4_CLKCTRL */
610#define AM33XX_OPTFCLKEN_GPIO_4_GDBCLK_SHIFT 18 724#define AM33XX_OPTFCLKEN_GPIO_4_GDBCLK_SHIFT 18
725#define AM33XX_OPTFCLKEN_GPIO_4_GDBCLK_WIDTH 1
611#define AM33XX_OPTFCLKEN_GPIO_4_GDBCLK_MASK (1 << 18) 726#define AM33XX_OPTFCLKEN_GPIO_4_GDBCLK_MASK (1 << 18)
612 727
613/* Used by CM_PER_GPIO5_CLKCTRL */ 728/* Used by CM_PER_GPIO5_CLKCTRL */
614#define AM33XX_OPTFCLKEN_GPIO_5_GDBCLK_SHIFT 18 729#define AM33XX_OPTFCLKEN_GPIO_5_GDBCLK_SHIFT 18
730#define AM33XX_OPTFCLKEN_GPIO_5_GDBCLK_WIDTH 1
615#define AM33XX_OPTFCLKEN_GPIO_5_GDBCLK_MASK (1 << 18) 731#define AM33XX_OPTFCLKEN_GPIO_5_GDBCLK_MASK (1 << 18)
616 732
617/* Used by CM_PER_GPIO6_CLKCTRL */ 733/* Used by CM_PER_GPIO6_CLKCTRL */
618#define AM33XX_OPTFCLKEN_GPIO_6_GDBCLK_SHIFT 18 734#define AM33XX_OPTFCLKEN_GPIO_6_GDBCLK_SHIFT 18
735#define AM33XX_OPTFCLKEN_GPIO_6_GDBCLK_WIDTH 1
619#define AM33XX_OPTFCLKEN_GPIO_6_GDBCLK_MASK (1 << 18) 736#define AM33XX_OPTFCLKEN_GPIO_6_GDBCLK_MASK (1 << 18)
620 737
621/* 738/*
@@ -627,25 +744,30 @@
627 * CM_WKUP_WKUP_M3_CLKCTRL, CM_GFX_BITBLT_CLKCTRL, CM_GFX_GFX_CLKCTRL 744 * CM_WKUP_WKUP_M3_CLKCTRL, CM_GFX_BITBLT_CLKCTRL, CM_GFX_GFX_CLKCTRL
628 */ 745 */
629#define AM33XX_STBYST_SHIFT 18 746#define AM33XX_STBYST_SHIFT 18
747#define AM33XX_STBYST_WIDTH 1
630#define AM33XX_STBYST_MASK (1 << 18) 748#define AM33XX_STBYST_MASK (1 << 18)
631 749
632/* Used by CM_WKUP_DEBUGSS_CLKCTRL */ 750/* Used by CM_WKUP_DEBUGSS_CLKCTRL */
633#define AM33XX_STM_PMD_CLKDIVSEL_SHIFT 27 751#define AM33XX_STM_PMD_CLKDIVSEL_SHIFT 27
634#define AM33XX_STM_PMD_CLKDIVSEL_MASK (0x29 << 27) 752#define AM33XX_STM_PMD_CLKDIVSEL_WIDTH 3
753#define AM33XX_STM_PMD_CLKDIVSEL_MASK (0x7 << 27)
635 754
636/* Used by CM_WKUP_DEBUGSS_CLKCTRL */ 755/* Used by CM_WKUP_DEBUGSS_CLKCTRL */
637#define AM33XX_STM_PMD_CLKSEL_SHIFT 22 756#define AM33XX_STM_PMD_CLKSEL_SHIFT 22
638#define AM33XX_STM_PMD_CLKSEL_MASK (0x23 << 22) 757#define AM33XX_STM_PMD_CLKSEL_WIDTH 2
758#define AM33XX_STM_PMD_CLKSEL_MASK (0x3 << 22)
639 759
640/* 760/*
641 * Used by CM_IDLEST_DPLL_CORE, CM_IDLEST_DPLL_DDR, CM_IDLEST_DPLL_DISP, 761 * Used by CM_IDLEST_DPLL_CORE, CM_IDLEST_DPLL_DDR, CM_IDLEST_DPLL_DISP,
642 * CM_IDLEST_DPLL_MPU, CM_IDLEST_DPLL_PER 762 * CM_IDLEST_DPLL_MPU, CM_IDLEST_DPLL_PER
643 */ 763 */
644#define AM33XX_ST_DPLL_CLK_SHIFT 0 764#define AM33XX_ST_DPLL_CLK_SHIFT 0
765#define AM33XX_ST_DPLL_CLK_WIDTH 1
645#define AM33XX_ST_DPLL_CLK_MASK (1 << 0) 766#define AM33XX_ST_DPLL_CLK_MASK (1 << 0)
646 767
647/* Used by CM_CLKDCOLDO_DPLL_PER */ 768/* Used by CM_CLKDCOLDO_DPLL_PER */
648#define AM33XX_ST_DPLL_CLKDCOLDO_SHIFT 8 769#define AM33XX_ST_DPLL_CLKDCOLDO_SHIFT 8
770#define AM33XX_ST_DPLL_CLKDCOLDO_WIDTH 1
649#define AM33XX_ST_DPLL_CLKDCOLDO_MASK (1 << 8) 771#define AM33XX_ST_DPLL_CLKDCOLDO_MASK (1 << 8)
650 772
651/* 773/*
@@ -653,18 +775,22 @@
653 * CM_DIV_M2_DPLL_PER 775 * CM_DIV_M2_DPLL_PER
654 */ 776 */
655#define AM33XX_ST_DPLL_CLKOUT_SHIFT 9 777#define AM33XX_ST_DPLL_CLKOUT_SHIFT 9
778#define AM33XX_ST_DPLL_CLKOUT_WIDTH 1
656#define AM33XX_ST_DPLL_CLKOUT_MASK (1 << 9) 779#define AM33XX_ST_DPLL_CLKOUT_MASK (1 << 9)
657 780
658/* Used by CM_DIV_M4_DPLL_CORE */ 781/* Used by CM_DIV_M4_DPLL_CORE */
659#define AM33XX_ST_HSDIVIDER_CLKOUT1_SHIFT 9 782#define AM33XX_ST_HSDIVIDER_CLKOUT1_SHIFT 9
783#define AM33XX_ST_HSDIVIDER_CLKOUT1_WIDTH 1
660#define AM33XX_ST_HSDIVIDER_CLKOUT1_MASK (1 << 9) 784#define AM33XX_ST_HSDIVIDER_CLKOUT1_MASK (1 << 9)
661 785
662/* Used by CM_DIV_M5_DPLL_CORE */ 786/* Used by CM_DIV_M5_DPLL_CORE */
663#define AM33XX_ST_HSDIVIDER_CLKOUT2_SHIFT 9 787#define AM33XX_ST_HSDIVIDER_CLKOUT2_SHIFT 9
788#define AM33XX_ST_HSDIVIDER_CLKOUT2_WIDTH 1
664#define AM33XX_ST_HSDIVIDER_CLKOUT2_MASK (1 << 9) 789#define AM33XX_ST_HSDIVIDER_CLKOUT2_MASK (1 << 9)
665 790
666/* Used by CM_DIV_M6_DPLL_CORE */ 791/* Used by CM_DIV_M6_DPLL_CORE */
667#define AM33XX_ST_HSDIVIDER_CLKOUT3_SHIFT 9 792#define AM33XX_ST_HSDIVIDER_CLKOUT3_SHIFT 9
793#define AM33XX_ST_HSDIVIDER_CLKOUT3_WIDTH 1
668#define AM33XX_ST_HSDIVIDER_CLKOUT3_MASK (1 << 9) 794#define AM33XX_ST_HSDIVIDER_CLKOUT3_MASK (1 << 9)
669 795
670/* 796/*
@@ -672,16 +798,20 @@
672 * CM_IDLEST_DPLL_MPU, CM_IDLEST_DPLL_PER 798 * CM_IDLEST_DPLL_MPU, CM_IDLEST_DPLL_PER
673 */ 799 */
674#define AM33XX_ST_MN_BYPASS_SHIFT 8 800#define AM33XX_ST_MN_BYPASS_SHIFT 8
801#define AM33XX_ST_MN_BYPASS_WIDTH 1
675#define AM33XX_ST_MN_BYPASS_MASK (1 << 8) 802#define AM33XX_ST_MN_BYPASS_MASK (1 << 8)
676 803
677/* Used by CM_WKUP_DEBUGSS_CLKCTRL */ 804/* Used by CM_WKUP_DEBUGSS_CLKCTRL */
678#define AM33XX_TRC_PMD_CLKDIVSEL_SHIFT 24 805#define AM33XX_TRC_PMD_CLKDIVSEL_SHIFT 24
679#define AM33XX_TRC_PMD_CLKDIVSEL_MASK (0x26 << 24) 806#define AM33XX_TRC_PMD_CLKDIVSEL_WIDTH 3
807#define AM33XX_TRC_PMD_CLKDIVSEL_MASK (0x7 << 24)
680 808
681/* Used by CM_WKUP_DEBUGSS_CLKCTRL */ 809/* Used by CM_WKUP_DEBUGSS_CLKCTRL */
682#define AM33XX_TRC_PMD_CLKSEL_SHIFT 20 810#define AM33XX_TRC_PMD_CLKSEL_SHIFT 20
683#define AM33XX_TRC_PMD_CLKSEL_MASK (0x21 << 20) 811#define AM33XX_TRC_PMD_CLKSEL_WIDTH 2
812#define AM33XX_TRC_PMD_CLKSEL_MASK (0x3 << 20)
684 813
685/* Used by CONTROL_SEC_CLK_CTRL */ 814/* Used by CONTROL_SEC_CLK_CTRL */
815#define AM33XX_TIMER0_CLKSEL_WIDTH 2
686#define AM33XX_TIMER0_CLKSEL_MASK (0x3 << 4) 816#define AM33XX_TIMER0_CLKSEL_MASK (0x3 << 4)
687#endif 817#endif
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h
index 766338fe4d3..59598ffd878 100644
--- a/arch/arm/mach-omap2/cm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-34xx.h
@@ -67,6 +67,7 @@
67#define OMAP3430_EN_IVA2_DPLL_MASK (0x7 << 0) 67#define OMAP3430_EN_IVA2_DPLL_MASK (0x7 << 0)
68 68
69/* CM_IDLEST_IVA2 */ 69/* CM_IDLEST_IVA2 */
70#define OMAP3430_ST_IVA2_SHIFT 0
70#define OMAP3430_ST_IVA2_MASK (1 << 0) 71#define OMAP3430_ST_IVA2_MASK (1 << 0)
71 72
72/* CM_IDLEST_PLL_IVA2 */ 73/* CM_IDLEST_PLL_IVA2 */
@@ -217,6 +218,8 @@
217#define OMAP3430_ST_MAILBOXES_MASK (1 << 7) 218#define OMAP3430_ST_MAILBOXES_MASK (1 << 7)
218#define OMAP3430_ST_OMAPCTRL_SHIFT 6 219#define OMAP3430_ST_OMAPCTRL_SHIFT 6
219#define OMAP3430_ST_OMAPCTRL_MASK (1 << 6) 220#define OMAP3430_ST_OMAPCTRL_MASK (1 << 6)
221#define OMAP3430_ST_SAD2D_SHIFT 3
222#define OMAP3430_ST_SAD2D_MASK (1 << 3)
220#define OMAP3430_ST_SDMA_SHIFT 2 223#define OMAP3430_ST_SDMA_SHIFT 2
221#define OMAP3430_ST_SDMA_MASK (1 << 2) 224#define OMAP3430_ST_SDMA_MASK (1 << 2)
222#define OMAP3430_ST_SDRC_SHIFT 1 225#define OMAP3430_ST_SDRC_SHIFT 1
diff --git a/arch/arm/mach-omap2/cm-regbits-44xx.h b/arch/arm/mach-omap2/cm-regbits-44xx.h
index 65597a74563..4c6c2f7de65 100644
--- a/arch/arm/mach-omap2/cm-regbits-44xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-44xx.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP44xx Clock Management register bits 2 * OMAP44xx Clock Management register bits
3 * 3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc. 4 * Copyright (C) 2009-2012 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation 5 * Copyright (C) 2009-2010 Nokia Corporation
6 * 6 *
7 * Paul Walmsley (paul@pwsan.com) 7 * Paul Walmsley (paul@pwsan.com)
@@ -24,6 +24,7 @@
24 24
25/* Used by CM_L3_1_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP */ 25/* Used by CM_L3_1_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP */
26#define OMAP4430_ABE_DYNDEP_SHIFT 3 26#define OMAP4430_ABE_DYNDEP_SHIFT 3
27#define OMAP4430_ABE_DYNDEP_WIDTH 0x1
27#define OMAP4430_ABE_DYNDEP_MASK (1 << 3) 28#define OMAP4430_ABE_DYNDEP_MASK (1 << 3)
28 29
29/* 30/*
@@ -31,14 +32,17 @@
31 * CM_MPU_STATICDEP, CM_SDMA_STATICDEP, CM_TESLA_STATICDEP 32 * CM_MPU_STATICDEP, CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
32 */ 33 */
33#define OMAP4430_ABE_STATDEP_SHIFT 3 34#define OMAP4430_ABE_STATDEP_SHIFT 3
35#define OMAP4430_ABE_STATDEP_WIDTH 0x1
34#define OMAP4430_ABE_STATDEP_MASK (1 << 3) 36#define OMAP4430_ABE_STATDEP_MASK (1 << 3)
35 37
36/* Used by CM_L4CFG_DYNAMICDEP */ 38/* Used by CM_L4CFG_DYNAMICDEP */
37#define OMAP4430_ALWONCORE_DYNDEP_SHIFT 16 39#define OMAP4430_ALWONCORE_DYNDEP_SHIFT 16
40#define OMAP4430_ALWONCORE_DYNDEP_WIDTH 0x1
38#define OMAP4430_ALWONCORE_DYNDEP_MASK (1 << 16) 41#define OMAP4430_ALWONCORE_DYNDEP_MASK (1 << 16)
39 42
40/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_TESLA_STATICDEP */ 43/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_TESLA_STATICDEP */
41#define OMAP4430_ALWONCORE_STATDEP_SHIFT 16 44#define OMAP4430_ALWONCORE_STATDEP_SHIFT 16
45#define OMAP4430_ALWONCORE_STATDEP_WIDTH 0x1
42#define OMAP4430_ALWONCORE_STATDEP_MASK (1 << 16) 46#define OMAP4430_ALWONCORE_STATDEP_MASK (1 << 16)
43 47
44/* 48/*
@@ -47,294 +51,367 @@
47 * CM_AUTOIDLE_DPLL_PER, CM_AUTOIDLE_DPLL_UNIPRO, CM_AUTOIDLE_DPLL_USB 51 * CM_AUTOIDLE_DPLL_PER, CM_AUTOIDLE_DPLL_UNIPRO, CM_AUTOIDLE_DPLL_USB
48 */ 52 */
49#define OMAP4430_AUTO_DPLL_MODE_SHIFT 0 53#define OMAP4430_AUTO_DPLL_MODE_SHIFT 0
54#define OMAP4430_AUTO_DPLL_MODE_WIDTH 0x3
50#define OMAP4430_AUTO_DPLL_MODE_MASK (0x7 << 0) 55#define OMAP4430_AUTO_DPLL_MODE_MASK (0x7 << 0)
51 56
52/* Used by CM_L4CFG_DYNAMICDEP */ 57/* Used by CM_L4CFG_DYNAMICDEP */
53#define OMAP4430_CEFUSE_DYNDEP_SHIFT 17 58#define OMAP4430_CEFUSE_DYNDEP_SHIFT 17
59#define OMAP4430_CEFUSE_DYNDEP_WIDTH 0x1
54#define OMAP4430_CEFUSE_DYNDEP_MASK (1 << 17) 60#define OMAP4430_CEFUSE_DYNDEP_MASK (1 << 17)
55 61
56/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_TESLA_STATICDEP */ 62/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_TESLA_STATICDEP */
57#define OMAP4430_CEFUSE_STATDEP_SHIFT 17 63#define OMAP4430_CEFUSE_STATDEP_SHIFT 17
64#define OMAP4430_CEFUSE_STATDEP_WIDTH 0x1
58#define OMAP4430_CEFUSE_STATDEP_MASK (1 << 17) 65#define OMAP4430_CEFUSE_STATDEP_MASK (1 << 17)
59 66
60/* Used by CM1_ABE_CLKSTCTRL */ 67/* Used by CM1_ABE_CLKSTCTRL */
61#define OMAP4430_CLKACTIVITY_ABE_24M_GFCLK_SHIFT 13 68#define OMAP4430_CLKACTIVITY_ABE_24M_GFCLK_SHIFT 13
69#define OMAP4430_CLKACTIVITY_ABE_24M_GFCLK_WIDTH 0x1
62#define OMAP4430_CLKACTIVITY_ABE_24M_GFCLK_MASK (1 << 13) 70#define OMAP4430_CLKACTIVITY_ABE_24M_GFCLK_MASK (1 << 13)
63 71
64/* Used by CM1_ABE_CLKSTCTRL */ 72/* Used by CM1_ABE_CLKSTCTRL */
65#define OMAP4430_CLKACTIVITY_ABE_ALWON_32K_CLK_SHIFT 12 73#define OMAP4430_CLKACTIVITY_ABE_ALWON_32K_CLK_SHIFT 12
74#define OMAP4430_CLKACTIVITY_ABE_ALWON_32K_CLK_WIDTH 0x1
66#define OMAP4430_CLKACTIVITY_ABE_ALWON_32K_CLK_MASK (1 << 12) 75#define OMAP4430_CLKACTIVITY_ABE_ALWON_32K_CLK_MASK (1 << 12)
67 76
68/* Used by CM_WKUP_CLKSTCTRL */ 77/* Used by CM_WKUP_CLKSTCTRL */
69#define OMAP4430_CLKACTIVITY_ABE_LP_CLK_SHIFT 9 78#define OMAP4430_CLKACTIVITY_ABE_LP_CLK_SHIFT 9
79#define OMAP4430_CLKACTIVITY_ABE_LP_CLK_WIDTH 0x1
70#define OMAP4430_CLKACTIVITY_ABE_LP_CLK_MASK (1 << 9) 80#define OMAP4430_CLKACTIVITY_ABE_LP_CLK_MASK (1 << 9)
71 81
72/* Used by CM1_ABE_CLKSTCTRL */ 82/* Used by CM1_ABE_CLKSTCTRL */
73#define OMAP4430_CLKACTIVITY_ABE_SYSCLK_SHIFT 11 83#define OMAP4430_CLKACTIVITY_ABE_SYSCLK_SHIFT 11
84#define OMAP4430_CLKACTIVITY_ABE_SYSCLK_WIDTH 0x1
74#define OMAP4430_CLKACTIVITY_ABE_SYSCLK_MASK (1 << 11) 85#define OMAP4430_CLKACTIVITY_ABE_SYSCLK_MASK (1 << 11)
75 86
76/* Used by CM1_ABE_CLKSTCTRL */ 87/* Used by CM1_ABE_CLKSTCTRL */
77#define OMAP4430_CLKACTIVITY_ABE_X2_CLK_SHIFT 8 88#define OMAP4430_CLKACTIVITY_ABE_X2_CLK_SHIFT 8
89#define OMAP4430_CLKACTIVITY_ABE_X2_CLK_WIDTH 0x1
78#define OMAP4430_CLKACTIVITY_ABE_X2_CLK_MASK (1 << 8) 90#define OMAP4430_CLKACTIVITY_ABE_X2_CLK_MASK (1 << 8)
79 91
80/* Used by CM_MEMIF_CLKSTCTRL */ 92/* Used by CM_MEMIF_CLKSTCTRL */
81#define OMAP4430_CLKACTIVITY_ASYNC_DLL_CLK_SHIFT 11 93#define OMAP4430_CLKACTIVITY_ASYNC_DLL_CLK_SHIFT 11
94#define OMAP4430_CLKACTIVITY_ASYNC_DLL_CLK_WIDTH 0x1
82#define OMAP4430_CLKACTIVITY_ASYNC_DLL_CLK_MASK (1 << 11) 95#define OMAP4430_CLKACTIVITY_ASYNC_DLL_CLK_MASK (1 << 11)
83 96
84/* Used by CM_MEMIF_CLKSTCTRL */ 97/* Used by CM_MEMIF_CLKSTCTRL */
85#define OMAP4430_CLKACTIVITY_ASYNC_PHY1_CLK_SHIFT 12 98#define OMAP4430_CLKACTIVITY_ASYNC_PHY1_CLK_SHIFT 12
99#define OMAP4430_CLKACTIVITY_ASYNC_PHY1_CLK_WIDTH 0x1
86#define OMAP4430_CLKACTIVITY_ASYNC_PHY1_CLK_MASK (1 << 12) 100#define OMAP4430_CLKACTIVITY_ASYNC_PHY1_CLK_MASK (1 << 12)
87 101
88/* Used by CM_MEMIF_CLKSTCTRL */ 102/* Used by CM_MEMIF_CLKSTCTRL */
89#define OMAP4430_CLKACTIVITY_ASYNC_PHY2_CLK_SHIFT 13 103#define OMAP4430_CLKACTIVITY_ASYNC_PHY2_CLK_SHIFT 13
104#define OMAP4430_CLKACTIVITY_ASYNC_PHY2_CLK_WIDTH 0x1
90#define OMAP4430_CLKACTIVITY_ASYNC_PHY2_CLK_MASK (1 << 13) 105#define OMAP4430_CLKACTIVITY_ASYNC_PHY2_CLK_MASK (1 << 13)
91 106
92/* Used by CM_CAM_CLKSTCTRL */ 107/* Used by CM_CAM_CLKSTCTRL */
93#define OMAP4430_CLKACTIVITY_CAM_PHY_CTRL_GCLK_SHIFT 9 108#define OMAP4430_CLKACTIVITY_CAM_PHY_CTRL_GCLK_SHIFT 9
109#define OMAP4430_CLKACTIVITY_CAM_PHY_CTRL_GCLK_WIDTH 0x1
94#define OMAP4430_CLKACTIVITY_CAM_PHY_CTRL_GCLK_MASK (1 << 9) 110#define OMAP4430_CLKACTIVITY_CAM_PHY_CTRL_GCLK_MASK (1 << 9)
95 111
96/* Used by CM_ALWON_CLKSTCTRL */ 112/* Used by CM_ALWON_CLKSTCTRL */
97#define OMAP4430_CLKACTIVITY_CORE_ALWON_32K_GFCLK_SHIFT 12 113#define OMAP4430_CLKACTIVITY_CORE_ALWON_32K_GFCLK_SHIFT 12
114#define OMAP4430_CLKACTIVITY_CORE_ALWON_32K_GFCLK_WIDTH 0x1
98#define OMAP4430_CLKACTIVITY_CORE_ALWON_32K_GFCLK_MASK (1 << 12) 115#define OMAP4430_CLKACTIVITY_CORE_ALWON_32K_GFCLK_MASK (1 << 12)
99 116
100/* Used by CM_EMU_CLKSTCTRL */ 117/* Used by CM_EMU_CLKSTCTRL */
101#define OMAP4430_CLKACTIVITY_CORE_DPLL_EMU_CLK_SHIFT 9 118#define OMAP4430_CLKACTIVITY_CORE_DPLL_EMU_CLK_SHIFT 9
119#define OMAP4430_CLKACTIVITY_CORE_DPLL_EMU_CLK_WIDTH 0x1
102#define OMAP4430_CLKACTIVITY_CORE_DPLL_EMU_CLK_MASK (1 << 9) 120#define OMAP4430_CLKACTIVITY_CORE_DPLL_EMU_CLK_MASK (1 << 9)
103 121
104/* Used by CM_L4CFG_CLKSTCTRL */ 122/* Used by CM_L4CFG_CLKSTCTRL */
105#define OMAP4460_CLKACTIVITY_CORE_TS_GFCLK_SHIFT 9 123#define OMAP4460_CLKACTIVITY_CORE_TS_GFCLK_SHIFT 9
124#define OMAP4460_CLKACTIVITY_CORE_TS_GFCLK_WIDTH 0x1
106#define OMAP4460_CLKACTIVITY_CORE_TS_GFCLK_MASK (1 << 9) 125#define OMAP4460_CLKACTIVITY_CORE_TS_GFCLK_MASK (1 << 9)
107 126
108/* Used by CM_CEFUSE_CLKSTCTRL */ 127/* Used by CM_CEFUSE_CLKSTCTRL */
109#define OMAP4430_CLKACTIVITY_CUST_EFUSE_SYS_CLK_SHIFT 9 128#define OMAP4430_CLKACTIVITY_CUST_EFUSE_SYS_CLK_SHIFT 9
129#define OMAP4430_CLKACTIVITY_CUST_EFUSE_SYS_CLK_WIDTH 0x1
110#define OMAP4430_CLKACTIVITY_CUST_EFUSE_SYS_CLK_MASK (1 << 9) 130#define OMAP4430_CLKACTIVITY_CUST_EFUSE_SYS_CLK_MASK (1 << 9)
111 131
112/* Used by CM_MEMIF_CLKSTCTRL */ 132/* Used by CM_MEMIF_CLKSTCTRL */
113#define OMAP4430_CLKACTIVITY_DLL_CLK_SHIFT 9 133#define OMAP4430_CLKACTIVITY_DLL_CLK_SHIFT 9
134#define OMAP4430_CLKACTIVITY_DLL_CLK_WIDTH 0x1
114#define OMAP4430_CLKACTIVITY_DLL_CLK_MASK (1 << 9) 135#define OMAP4430_CLKACTIVITY_DLL_CLK_MASK (1 << 9)
115 136
116/* Used by CM_L4PER_CLKSTCTRL */ 137/* Used by CM_L4PER_CLKSTCTRL */
117#define OMAP4430_CLKACTIVITY_DMT10_GFCLK_SHIFT 9 138#define OMAP4430_CLKACTIVITY_DMT10_GFCLK_SHIFT 9
139#define OMAP4430_CLKACTIVITY_DMT10_GFCLK_WIDTH 0x1
118#define OMAP4430_CLKACTIVITY_DMT10_GFCLK_MASK (1 << 9) 140#define OMAP4430_CLKACTIVITY_DMT10_GFCLK_MASK (1 << 9)
119 141
120/* Used by CM_L4PER_CLKSTCTRL */ 142/* Used by CM_L4PER_CLKSTCTRL */
121#define OMAP4430_CLKACTIVITY_DMT11_GFCLK_SHIFT 10 143#define OMAP4430_CLKACTIVITY_DMT11_GFCLK_SHIFT 10
144#define OMAP4430_CLKACTIVITY_DMT11_GFCLK_WIDTH 0x1
122#define OMAP4430_CLKACTIVITY_DMT11_GFCLK_MASK (1 << 10) 145#define OMAP4430_CLKACTIVITY_DMT11_GFCLK_MASK (1 << 10)
123 146
124/* Used by CM_L4PER_CLKSTCTRL */ 147/* Used by CM_L4PER_CLKSTCTRL */
125#define OMAP4430_CLKACTIVITY_DMT2_GFCLK_SHIFT 11 148#define OMAP4430_CLKACTIVITY_DMT2_GFCLK_SHIFT 11
149#define OMAP4430_CLKACTIVITY_DMT2_GFCLK_WIDTH 0x1
126#define OMAP4430_CLKACTIVITY_DMT2_GFCLK_MASK (1 << 11) 150#define OMAP4430_CLKACTIVITY_DMT2_GFCLK_MASK (1 << 11)
127 151
128/* Used by CM_L4PER_CLKSTCTRL */ 152/* Used by CM_L4PER_CLKSTCTRL */
129#define OMAP4430_CLKACTIVITY_DMT3_GFCLK_SHIFT 12 153#define OMAP4430_CLKACTIVITY_DMT3_GFCLK_SHIFT 12
154#define OMAP4430_CLKACTIVITY_DMT3_GFCLK_WIDTH 0x1
130#define OMAP4430_CLKACTIVITY_DMT3_GFCLK_MASK (1 << 12) 155#define OMAP4430_CLKACTIVITY_DMT3_GFCLK_MASK (1 << 12)
131 156
132/* Used by CM_L4PER_CLKSTCTRL */ 157/* Used by CM_L4PER_CLKSTCTRL */
133#define OMAP4430_CLKACTIVITY_DMT4_GFCLK_SHIFT 13 158#define OMAP4430_CLKACTIVITY_DMT4_GFCLK_SHIFT 13
159#define OMAP4430_CLKACTIVITY_DMT4_GFCLK_WIDTH 0x1
134#define OMAP4430_CLKACTIVITY_DMT4_GFCLK_MASK (1 << 13) 160#define OMAP4430_CLKACTIVITY_DMT4_GFCLK_MASK (1 << 13)
135 161
136/* Used by CM_L4PER_CLKSTCTRL */ 162/* Used by CM_L4PER_CLKSTCTRL */
137#define OMAP4430_CLKACTIVITY_DMT9_GFCLK_SHIFT 14 163#define OMAP4430_CLKACTIVITY_DMT9_GFCLK_SHIFT 14
164#define OMAP4430_CLKACTIVITY_DMT9_GFCLK_WIDTH 0x1
138#define OMAP4430_CLKACTIVITY_DMT9_GFCLK_MASK (1 << 14) 165#define OMAP4430_CLKACTIVITY_DMT9_GFCLK_MASK (1 << 14)
139 166
140/* Used by CM_DSS_CLKSTCTRL */ 167/* Used by CM_DSS_CLKSTCTRL */
141#define OMAP4430_CLKACTIVITY_DSS_ALWON_SYS_CLK_SHIFT 10 168#define OMAP4430_CLKACTIVITY_DSS_ALWON_SYS_CLK_SHIFT 10
169#define OMAP4430_CLKACTIVITY_DSS_ALWON_SYS_CLK_WIDTH 0x1
142#define OMAP4430_CLKACTIVITY_DSS_ALWON_SYS_CLK_MASK (1 << 10) 170#define OMAP4430_CLKACTIVITY_DSS_ALWON_SYS_CLK_MASK (1 << 10)
143 171
144/* Used by CM_DSS_CLKSTCTRL */ 172/* Used by CM_DSS_CLKSTCTRL */
145#define OMAP4430_CLKACTIVITY_DSS_FCLK_SHIFT 9 173#define OMAP4430_CLKACTIVITY_DSS_FCLK_SHIFT 9
174#define OMAP4430_CLKACTIVITY_DSS_FCLK_WIDTH 0x1
146#define OMAP4430_CLKACTIVITY_DSS_FCLK_MASK (1 << 9) 175#define OMAP4430_CLKACTIVITY_DSS_FCLK_MASK (1 << 9)
147 176
148/* Used by CM_DUCATI_CLKSTCTRL */ 177/* Used by CM_DUCATI_CLKSTCTRL */
149#define OMAP4430_CLKACTIVITY_DUCATI_GCLK_SHIFT 8 178#define OMAP4430_CLKACTIVITY_DUCATI_GCLK_SHIFT 8
179#define OMAP4430_CLKACTIVITY_DUCATI_GCLK_WIDTH 0x1
150#define OMAP4430_CLKACTIVITY_DUCATI_GCLK_MASK (1 << 8) 180#define OMAP4430_CLKACTIVITY_DUCATI_GCLK_MASK (1 << 8)
151 181
152/* Used by CM_EMU_CLKSTCTRL */ 182/* Used by CM_EMU_CLKSTCTRL */
153#define OMAP4430_CLKACTIVITY_EMU_SYS_CLK_SHIFT 8 183#define OMAP4430_CLKACTIVITY_EMU_SYS_CLK_SHIFT 8
184#define OMAP4430_CLKACTIVITY_EMU_SYS_CLK_WIDTH 0x1
154#define OMAP4430_CLKACTIVITY_EMU_SYS_CLK_MASK (1 << 8) 185#define OMAP4430_CLKACTIVITY_EMU_SYS_CLK_MASK (1 << 8)
155 186
156/* Used by CM_CAM_CLKSTCTRL */ 187/* Used by CM_CAM_CLKSTCTRL */
157#define OMAP4430_CLKACTIVITY_FDIF_GFCLK_SHIFT 10 188#define OMAP4430_CLKACTIVITY_FDIF_GFCLK_SHIFT 10
189#define OMAP4430_CLKACTIVITY_FDIF_GFCLK_WIDTH 0x1
158#define OMAP4430_CLKACTIVITY_FDIF_GFCLK_MASK (1 << 10) 190#define OMAP4430_CLKACTIVITY_FDIF_GFCLK_MASK (1 << 10)
159 191
160/* Used by CM_L4PER_CLKSTCTRL */ 192/* Used by CM_L4PER_CLKSTCTRL */
161#define OMAP4430_CLKACTIVITY_FUNC_12M_GFCLK_SHIFT 15 193#define OMAP4430_CLKACTIVITY_FUNC_12M_GFCLK_SHIFT 15
194#define OMAP4430_CLKACTIVITY_FUNC_12M_GFCLK_WIDTH 0x1
162#define OMAP4430_CLKACTIVITY_FUNC_12M_GFCLK_MASK (1 << 15) 195#define OMAP4430_CLKACTIVITY_FUNC_12M_GFCLK_MASK (1 << 15)
163 196
164/* Used by CM1_ABE_CLKSTCTRL */ 197/* Used by CM1_ABE_CLKSTCTRL */
165#define OMAP4430_CLKACTIVITY_FUNC_24M_GFCLK_SHIFT 10 198#define OMAP4430_CLKACTIVITY_FUNC_24M_GFCLK_SHIFT 10
199#define OMAP4430_CLKACTIVITY_FUNC_24M_GFCLK_WIDTH 0x1
166#define OMAP4430_CLKACTIVITY_FUNC_24M_GFCLK_MASK (1 << 10) 200#define OMAP4430_CLKACTIVITY_FUNC_24M_GFCLK_MASK (1 << 10)
167 201
168/* Used by CM_DSS_CLKSTCTRL */ 202/* Used by CM_DSS_CLKSTCTRL */
169#define OMAP4430_CLKACTIVITY_HDMI_PHY_48MHZ_GFCLK_SHIFT 11 203#define OMAP4430_CLKACTIVITY_HDMI_PHY_48MHZ_GFCLK_SHIFT 11
204#define OMAP4430_CLKACTIVITY_HDMI_PHY_48MHZ_GFCLK_WIDTH 0x1
170#define OMAP4430_CLKACTIVITY_HDMI_PHY_48MHZ_GFCLK_MASK (1 << 11) 205#define OMAP4430_CLKACTIVITY_HDMI_PHY_48MHZ_GFCLK_MASK (1 << 11)
171 206
172/* Used by CM_L3INIT_CLKSTCTRL */ 207/* Used by CM_L3INIT_CLKSTCTRL */
173#define OMAP4430_CLKACTIVITY_HSIC_P1_480M_GFCLK_SHIFT 20 208#define OMAP4430_CLKACTIVITY_HSIC_P1_480M_GFCLK_SHIFT 20
209#define OMAP4430_CLKACTIVITY_HSIC_P1_480M_GFCLK_WIDTH 0x1
174#define OMAP4430_CLKACTIVITY_HSIC_P1_480M_GFCLK_MASK (1 << 20) 210#define OMAP4430_CLKACTIVITY_HSIC_P1_480M_GFCLK_MASK (1 << 20)
175 211
176/* Used by CM_L3INIT_CLKSTCTRL */ 212/* Used by CM_L3INIT_CLKSTCTRL */
177#define OMAP4430_CLKACTIVITY_HSIC_P1_GFCLK_SHIFT 26 213#define OMAP4430_CLKACTIVITY_HSIC_P1_GFCLK_SHIFT 26
214#define OMAP4430_CLKACTIVITY_HSIC_P1_GFCLK_WIDTH 0x1
178#define OMAP4430_CLKACTIVITY_HSIC_P1_GFCLK_MASK (1 << 26) 215#define OMAP4430_CLKACTIVITY_HSIC_P1_GFCLK_MASK (1 << 26)
179 216
180/* Used by CM_L3INIT_CLKSTCTRL */ 217/* Used by CM_L3INIT_CLKSTCTRL */
181#define OMAP4430_CLKACTIVITY_HSIC_P2_480M_GFCLK_SHIFT 21 218#define OMAP4430_CLKACTIVITY_HSIC_P2_480M_GFCLK_SHIFT 21
219#define OMAP4430_CLKACTIVITY_HSIC_P2_480M_GFCLK_WIDTH 0x1
182#define OMAP4430_CLKACTIVITY_HSIC_P2_480M_GFCLK_MASK (1 << 21) 220#define OMAP4430_CLKACTIVITY_HSIC_P2_480M_GFCLK_MASK (1 << 21)
183 221
184/* Used by CM_L3INIT_CLKSTCTRL */ 222/* Used by CM_L3INIT_CLKSTCTRL */
185#define OMAP4430_CLKACTIVITY_HSIC_P2_GFCLK_SHIFT 27 223#define OMAP4430_CLKACTIVITY_HSIC_P2_GFCLK_SHIFT 27
224#define OMAP4430_CLKACTIVITY_HSIC_P2_GFCLK_WIDTH 0x1
186#define OMAP4430_CLKACTIVITY_HSIC_P2_GFCLK_MASK (1 << 27) 225#define OMAP4430_CLKACTIVITY_HSIC_P2_GFCLK_MASK (1 << 27)
187 226
188/* Used by CM_L3INIT_CLKSTCTRL */ 227/* Used by CM_L3INIT_CLKSTCTRL */
189#define OMAP4430_CLKACTIVITY_INIT_48MC_GFCLK_SHIFT 13 228#define OMAP4430_CLKACTIVITY_INIT_48MC_GFCLK_SHIFT 13
229#define OMAP4430_CLKACTIVITY_INIT_48MC_GFCLK_WIDTH 0x1
190#define OMAP4430_CLKACTIVITY_INIT_48MC_GFCLK_MASK (1 << 13) 230#define OMAP4430_CLKACTIVITY_INIT_48MC_GFCLK_MASK (1 << 13)
191 231
192/* Used by CM_L3INIT_CLKSTCTRL */ 232/* Used by CM_L3INIT_CLKSTCTRL */
193#define OMAP4430_CLKACTIVITY_INIT_48M_GFCLK_SHIFT 12 233#define OMAP4430_CLKACTIVITY_INIT_48M_GFCLK_SHIFT 12
234#define OMAP4430_CLKACTIVITY_INIT_48M_GFCLK_WIDTH 0x1
194#define OMAP4430_CLKACTIVITY_INIT_48M_GFCLK_MASK (1 << 12) 235#define OMAP4430_CLKACTIVITY_INIT_48M_GFCLK_MASK (1 << 12)
195 236
196/* Used by CM_L3INIT_CLKSTCTRL */ 237/* Used by CM_L3INIT_CLKSTCTRL */
197#define OMAP4430_CLKACTIVITY_INIT_60M_P1_GFCLK_SHIFT 28 238#define OMAP4430_CLKACTIVITY_INIT_60M_P1_GFCLK_SHIFT 28
239#define OMAP4430_CLKACTIVITY_INIT_60M_P1_GFCLK_WIDTH 0x1
198#define OMAP4430_CLKACTIVITY_INIT_60M_P1_GFCLK_MASK (1 << 28) 240#define OMAP4430_CLKACTIVITY_INIT_60M_P1_GFCLK_MASK (1 << 28)
199 241
200/* Used by CM_L3INIT_CLKSTCTRL */ 242/* Used by CM_L3INIT_CLKSTCTRL */
201#define OMAP4430_CLKACTIVITY_INIT_60M_P2_GFCLK_SHIFT 29 243#define OMAP4430_CLKACTIVITY_INIT_60M_P2_GFCLK_SHIFT 29
244#define OMAP4430_CLKACTIVITY_INIT_60M_P2_GFCLK_WIDTH 0x1
202#define OMAP4430_CLKACTIVITY_INIT_60M_P2_GFCLK_MASK (1 << 29) 245#define OMAP4430_CLKACTIVITY_INIT_60M_P2_GFCLK_MASK (1 << 29)
203 246
204/* Used by CM_L3INIT_CLKSTCTRL */ 247/* Used by CM_L3INIT_CLKSTCTRL */
205#define OMAP4430_CLKACTIVITY_INIT_96M_GFCLK_SHIFT 11 248#define OMAP4430_CLKACTIVITY_INIT_96M_GFCLK_SHIFT 11
249#define OMAP4430_CLKACTIVITY_INIT_96M_GFCLK_WIDTH 0x1
206#define OMAP4430_CLKACTIVITY_INIT_96M_GFCLK_MASK (1 << 11) 250#define OMAP4430_CLKACTIVITY_INIT_96M_GFCLK_MASK (1 << 11)
207 251
208/* Used by CM_L3INIT_CLKSTCTRL */ 252/* Used by CM_L3INIT_CLKSTCTRL */
209#define OMAP4430_CLKACTIVITY_INIT_HSI_GFCLK_SHIFT 16 253#define OMAP4430_CLKACTIVITY_INIT_HSI_GFCLK_SHIFT 16
254#define OMAP4430_CLKACTIVITY_INIT_HSI_GFCLK_WIDTH 0x1
210#define OMAP4430_CLKACTIVITY_INIT_HSI_GFCLK_MASK (1 << 16) 255#define OMAP4430_CLKACTIVITY_INIT_HSI_GFCLK_MASK (1 << 16)
211 256
212/* Used by CM_L3INIT_CLKSTCTRL */ 257/* Used by CM_L3INIT_CLKSTCTRL */
213#define OMAP4430_CLKACTIVITY_INIT_HSMMC1_GFCLK_SHIFT 17 258#define OMAP4430_CLKACTIVITY_INIT_HSMMC1_GFCLK_SHIFT 17
259#define OMAP4430_CLKACTIVITY_INIT_HSMMC1_GFCLK_WIDTH 0x1
214#define OMAP4430_CLKACTIVITY_INIT_HSMMC1_GFCLK_MASK (1 << 17) 260#define OMAP4430_CLKACTIVITY_INIT_HSMMC1_GFCLK_MASK (1 << 17)
215 261
216/* Used by CM_L3INIT_CLKSTCTRL */ 262/* Used by CM_L3INIT_CLKSTCTRL */
217#define OMAP4430_CLKACTIVITY_INIT_HSMMC2_GFCLK_SHIFT 18 263#define OMAP4430_CLKACTIVITY_INIT_HSMMC2_GFCLK_SHIFT 18
264#define OMAP4430_CLKACTIVITY_INIT_HSMMC2_GFCLK_WIDTH 0x1
218#define OMAP4430_CLKACTIVITY_INIT_HSMMC2_GFCLK_MASK (1 << 18) 265#define OMAP4430_CLKACTIVITY_INIT_HSMMC2_GFCLK_MASK (1 << 18)
219 266
220/* Used by CM_L3INIT_CLKSTCTRL */ 267/* Used by CM_L3INIT_CLKSTCTRL */
221#define OMAP4430_CLKACTIVITY_INIT_HSMMC6_GFCLK_SHIFT 19 268#define OMAP4430_CLKACTIVITY_INIT_HSMMC6_GFCLK_SHIFT 19
269#define OMAP4430_CLKACTIVITY_INIT_HSMMC6_GFCLK_WIDTH 0x1
222#define OMAP4430_CLKACTIVITY_INIT_HSMMC6_GFCLK_MASK (1 << 19) 270#define OMAP4430_CLKACTIVITY_INIT_HSMMC6_GFCLK_MASK (1 << 19)
223 271
224/* Used by CM_CAM_CLKSTCTRL */ 272/* Used by CM_CAM_CLKSTCTRL */
225#define OMAP4430_CLKACTIVITY_ISS_GCLK_SHIFT 8 273#define OMAP4430_CLKACTIVITY_ISS_GCLK_SHIFT 8
274#define OMAP4430_CLKACTIVITY_ISS_GCLK_WIDTH 0x1
226#define OMAP4430_CLKACTIVITY_ISS_GCLK_MASK (1 << 8) 275#define OMAP4430_CLKACTIVITY_ISS_GCLK_MASK (1 << 8)
227 276
228/* Used by CM_IVAHD_CLKSTCTRL */ 277/* Used by CM_IVAHD_CLKSTCTRL */
229#define OMAP4430_CLKACTIVITY_IVAHD_ROOT_CLK_SHIFT 8 278#define OMAP4430_CLKACTIVITY_IVAHD_ROOT_CLK_SHIFT 8
279#define OMAP4430_CLKACTIVITY_IVAHD_ROOT_CLK_WIDTH 0x1
230#define OMAP4430_CLKACTIVITY_IVAHD_ROOT_CLK_MASK (1 << 8) 280#define OMAP4430_CLKACTIVITY_IVAHD_ROOT_CLK_MASK (1 << 8)
231 281
232/* Used by CM_D2D_CLKSTCTRL */ 282/* Used by CM_D2D_CLKSTCTRL */
233#define OMAP4430_CLKACTIVITY_L3X2_D2D_GICLK_SHIFT 10 283#define OMAP4430_CLKACTIVITY_L3X2_D2D_GICLK_SHIFT 10
284#define OMAP4430_CLKACTIVITY_L3X2_D2D_GICLK_WIDTH 0x1
234#define OMAP4430_CLKACTIVITY_L3X2_D2D_GICLK_MASK (1 << 10) 285#define OMAP4430_CLKACTIVITY_L3X2_D2D_GICLK_MASK (1 << 10)
235 286
236/* Used by CM_L3_1_CLKSTCTRL */ 287/* Used by CM_L3_1_CLKSTCTRL */
237#define OMAP4430_CLKACTIVITY_L3_1_GICLK_SHIFT 8 288#define OMAP4430_CLKACTIVITY_L3_1_GICLK_SHIFT 8
289#define OMAP4430_CLKACTIVITY_L3_1_GICLK_WIDTH 0x1
238#define OMAP4430_CLKACTIVITY_L3_1_GICLK_MASK (1 << 8) 290#define OMAP4430_CLKACTIVITY_L3_1_GICLK_MASK (1 << 8)
239 291
240/* Used by CM_L3_2_CLKSTCTRL */ 292/* Used by CM_L3_2_CLKSTCTRL */
241#define OMAP4430_CLKACTIVITY_L3_2_GICLK_SHIFT 8 293#define OMAP4430_CLKACTIVITY_L3_2_GICLK_SHIFT 8
294#define OMAP4430_CLKACTIVITY_L3_2_GICLK_WIDTH 0x1
242#define OMAP4430_CLKACTIVITY_L3_2_GICLK_MASK (1 << 8) 295#define OMAP4430_CLKACTIVITY_L3_2_GICLK_MASK (1 << 8)
243 296
244/* Used by CM_D2D_CLKSTCTRL */ 297/* Used by CM_D2D_CLKSTCTRL */
245#define OMAP4430_CLKACTIVITY_L3_D2D_GICLK_SHIFT 8 298#define OMAP4430_CLKACTIVITY_L3_D2D_GICLK_SHIFT 8
299#define OMAP4430_CLKACTIVITY_L3_D2D_GICLK_WIDTH 0x1
246#define OMAP4430_CLKACTIVITY_L3_D2D_GICLK_MASK (1 << 8) 300#define OMAP4430_CLKACTIVITY_L3_D2D_GICLK_MASK (1 << 8)
247 301
248/* Used by CM_SDMA_CLKSTCTRL */ 302/* Used by CM_SDMA_CLKSTCTRL */
249#define OMAP4430_CLKACTIVITY_L3_DMA_GICLK_SHIFT 8 303#define OMAP4430_CLKACTIVITY_L3_DMA_GICLK_SHIFT 8
304#define OMAP4430_CLKACTIVITY_L3_DMA_GICLK_WIDTH 0x1
250#define OMAP4430_CLKACTIVITY_L3_DMA_GICLK_MASK (1 << 8) 305#define OMAP4430_CLKACTIVITY_L3_DMA_GICLK_MASK (1 << 8)
251 306
252/* Used by CM_DSS_CLKSTCTRL */ 307/* Used by CM_DSS_CLKSTCTRL */
253#define OMAP4430_CLKACTIVITY_L3_DSS_GICLK_SHIFT 8 308#define OMAP4430_CLKACTIVITY_L3_DSS_GICLK_SHIFT 8
309#define OMAP4430_CLKACTIVITY_L3_DSS_GICLK_WIDTH 0x1
254#define OMAP4430_CLKACTIVITY_L3_DSS_GICLK_MASK (1 << 8) 310#define OMAP4430_CLKACTIVITY_L3_DSS_GICLK_MASK (1 << 8)
255 311
256/* Used by CM_MEMIF_CLKSTCTRL */ 312/* Used by CM_MEMIF_CLKSTCTRL */
257#define OMAP4430_CLKACTIVITY_L3_EMIF_GICLK_SHIFT 8 313#define OMAP4430_CLKACTIVITY_L3_EMIF_GICLK_SHIFT 8
314#define OMAP4430_CLKACTIVITY_L3_EMIF_GICLK_WIDTH 0x1
258#define OMAP4430_CLKACTIVITY_L3_EMIF_GICLK_MASK (1 << 8) 315#define OMAP4430_CLKACTIVITY_L3_EMIF_GICLK_MASK (1 << 8)
259 316
260/* Used by CM_GFX_CLKSTCTRL */ 317/* Used by CM_GFX_CLKSTCTRL */
261#define OMAP4430_CLKACTIVITY_L3_GFX_GICLK_SHIFT 8 318#define OMAP4430_CLKACTIVITY_L3_GFX_GICLK_SHIFT 8
319#define OMAP4430_CLKACTIVITY_L3_GFX_GICLK_WIDTH 0x1
262#define OMAP4430_CLKACTIVITY_L3_GFX_GICLK_MASK (1 << 8) 320#define OMAP4430_CLKACTIVITY_L3_GFX_GICLK_MASK (1 << 8)
263 321
264/* Used by CM_L3INIT_CLKSTCTRL */ 322/* Used by CM_L3INIT_CLKSTCTRL */
265#define OMAP4430_CLKACTIVITY_L3_INIT_GICLK_SHIFT 8 323#define OMAP4430_CLKACTIVITY_L3_INIT_GICLK_SHIFT 8
324#define OMAP4430_CLKACTIVITY_L3_INIT_GICLK_WIDTH 0x1
266#define OMAP4430_CLKACTIVITY_L3_INIT_GICLK_MASK (1 << 8) 325#define OMAP4430_CLKACTIVITY_L3_INIT_GICLK_MASK (1 << 8)
267 326
268/* Used by CM_L3INSTR_CLKSTCTRL */ 327/* Used by CM_L3INSTR_CLKSTCTRL */
269#define OMAP4430_CLKACTIVITY_L3_INSTR_GICLK_SHIFT 8 328#define OMAP4430_CLKACTIVITY_L3_INSTR_GICLK_SHIFT 8
329#define OMAP4430_CLKACTIVITY_L3_INSTR_GICLK_WIDTH 0x1
270#define OMAP4430_CLKACTIVITY_L3_INSTR_GICLK_MASK (1 << 8) 330#define OMAP4430_CLKACTIVITY_L3_INSTR_GICLK_MASK (1 << 8)
271 331
272/* Used by CM_L4SEC_CLKSTCTRL */ 332/* Used by CM_L4SEC_CLKSTCTRL */
273#define OMAP4430_CLKACTIVITY_L3_SECURE_GICLK_SHIFT 8 333#define OMAP4430_CLKACTIVITY_L3_SECURE_GICLK_SHIFT 8
334#define OMAP4430_CLKACTIVITY_L3_SECURE_GICLK_WIDTH 0x1
274#define OMAP4430_CLKACTIVITY_L3_SECURE_GICLK_MASK (1 << 8) 335#define OMAP4430_CLKACTIVITY_L3_SECURE_GICLK_MASK (1 << 8)
275 336
276/* Used by CM_ALWON_CLKSTCTRL */ 337/* Used by CM_ALWON_CLKSTCTRL */
277#define OMAP4430_CLKACTIVITY_L4_AO_ICLK_SHIFT 8 338#define OMAP4430_CLKACTIVITY_L4_AO_ICLK_SHIFT 8
339#define OMAP4430_CLKACTIVITY_L4_AO_ICLK_WIDTH 0x1
278#define OMAP4430_CLKACTIVITY_L4_AO_ICLK_MASK (1 << 8) 340#define OMAP4430_CLKACTIVITY_L4_AO_ICLK_MASK (1 << 8)
279 341
280/* Used by CM_CEFUSE_CLKSTCTRL */ 342/* Used by CM_CEFUSE_CLKSTCTRL */
281#define OMAP4430_CLKACTIVITY_L4_CEFUSE_GICLK_SHIFT 8 343#define OMAP4430_CLKACTIVITY_L4_CEFUSE_GICLK_SHIFT 8
344#define OMAP4430_CLKACTIVITY_L4_CEFUSE_GICLK_WIDTH 0x1
282#define OMAP4430_CLKACTIVITY_L4_CEFUSE_GICLK_MASK (1 << 8) 345#define OMAP4430_CLKACTIVITY_L4_CEFUSE_GICLK_MASK (1 << 8)
283 346
284/* Used by CM_L4CFG_CLKSTCTRL */ 347/* Used by CM_L4CFG_CLKSTCTRL */
285#define OMAP4430_CLKACTIVITY_L4_CFG_GICLK_SHIFT 8 348#define OMAP4430_CLKACTIVITY_L4_CFG_GICLK_SHIFT 8
349#define OMAP4430_CLKACTIVITY_L4_CFG_GICLK_WIDTH 0x1
286#define OMAP4430_CLKACTIVITY_L4_CFG_GICLK_MASK (1 << 8) 350#define OMAP4430_CLKACTIVITY_L4_CFG_GICLK_MASK (1 << 8)
287 351
288/* Used by CM_D2D_CLKSTCTRL */ 352/* Used by CM_D2D_CLKSTCTRL */
289#define OMAP4430_CLKACTIVITY_L4_D2D_GICLK_SHIFT 9 353#define OMAP4430_CLKACTIVITY_L4_D2D_GICLK_SHIFT 9
354#define OMAP4430_CLKACTIVITY_L4_D2D_GICLK_WIDTH 0x1
290#define OMAP4430_CLKACTIVITY_L4_D2D_GICLK_MASK (1 << 9) 355#define OMAP4430_CLKACTIVITY_L4_D2D_GICLK_MASK (1 << 9)
291 356
292/* Used by CM_L3INIT_CLKSTCTRL */ 357/* Used by CM_L3INIT_CLKSTCTRL */
293#define OMAP4430_CLKACTIVITY_L4_INIT_GICLK_SHIFT 9 358#define OMAP4430_CLKACTIVITY_L4_INIT_GICLK_SHIFT 9
359#define OMAP4430_CLKACTIVITY_L4_INIT_GICLK_WIDTH 0x1
294#define OMAP4430_CLKACTIVITY_L4_INIT_GICLK_MASK (1 << 9) 360#define OMAP4430_CLKACTIVITY_L4_INIT_GICLK_MASK (1 << 9)
295 361
296/* Used by CM_L4PER_CLKSTCTRL */ 362/* Used by CM_L4PER_CLKSTCTRL */
297#define OMAP4430_CLKACTIVITY_L4_PER_GICLK_SHIFT 8 363#define OMAP4430_CLKACTIVITY_L4_PER_GICLK_SHIFT 8
364#define OMAP4430_CLKACTIVITY_L4_PER_GICLK_WIDTH 0x1
298#define OMAP4430_CLKACTIVITY_L4_PER_GICLK_MASK (1 << 8) 365#define OMAP4430_CLKACTIVITY_L4_PER_GICLK_MASK (1 << 8)
299 366
300/* Used by CM_L4SEC_CLKSTCTRL */ 367/* Used by CM_L4SEC_CLKSTCTRL */
301#define OMAP4430_CLKACTIVITY_L4_SECURE_GICLK_SHIFT 9 368#define OMAP4430_CLKACTIVITY_L4_SECURE_GICLK_SHIFT 9
369#define OMAP4430_CLKACTIVITY_L4_SECURE_GICLK_WIDTH 0x1
302#define OMAP4430_CLKACTIVITY_L4_SECURE_GICLK_MASK (1 << 9) 370#define OMAP4430_CLKACTIVITY_L4_SECURE_GICLK_MASK (1 << 9)
303 371
304/* Used by CM_WKUP_CLKSTCTRL */ 372/* Used by CM_WKUP_CLKSTCTRL */
305#define OMAP4430_CLKACTIVITY_L4_WKUP_GICLK_SHIFT 12 373#define OMAP4430_CLKACTIVITY_L4_WKUP_GICLK_SHIFT 12
374#define OMAP4430_CLKACTIVITY_L4_WKUP_GICLK_WIDTH 0x1
306#define OMAP4430_CLKACTIVITY_L4_WKUP_GICLK_MASK (1 << 12) 375#define OMAP4430_CLKACTIVITY_L4_WKUP_GICLK_MASK (1 << 12)
307 376
308/* Used by CM_MPU_CLKSTCTRL */ 377/* Used by CM_MPU_CLKSTCTRL */
309#define OMAP4430_CLKACTIVITY_MPU_DPLL_CLK_SHIFT 8 378#define OMAP4430_CLKACTIVITY_MPU_DPLL_CLK_SHIFT 8
379#define OMAP4430_CLKACTIVITY_MPU_DPLL_CLK_WIDTH 0x1
310#define OMAP4430_CLKACTIVITY_MPU_DPLL_CLK_MASK (1 << 8) 380#define OMAP4430_CLKACTIVITY_MPU_DPLL_CLK_MASK (1 << 8)
311 381
312/* Used by CM1_ABE_CLKSTCTRL */ 382/* Used by CM1_ABE_CLKSTCTRL */
313#define OMAP4430_CLKACTIVITY_OCP_ABE_GICLK_SHIFT 9 383#define OMAP4430_CLKACTIVITY_OCP_ABE_GICLK_SHIFT 9
384#define OMAP4430_CLKACTIVITY_OCP_ABE_GICLK_WIDTH 0x1
314#define OMAP4430_CLKACTIVITY_OCP_ABE_GICLK_MASK (1 << 9) 385#define OMAP4430_CLKACTIVITY_OCP_ABE_GICLK_MASK (1 << 9)
315 386
316/* Used by CM_L4PER_CLKSTCTRL */ 387/* Used by CM_L4PER_CLKSTCTRL */
317#define OMAP4430_CLKACTIVITY_PER_24MC_GFCLK_SHIFT 16 388#define OMAP4430_CLKACTIVITY_PER_24MC_GFCLK_SHIFT 16
389#define OMAP4430_CLKACTIVITY_PER_24MC_GFCLK_WIDTH 0x1
318#define OMAP4430_CLKACTIVITY_PER_24MC_GFCLK_MASK (1 << 16) 390#define OMAP4430_CLKACTIVITY_PER_24MC_GFCLK_MASK (1 << 16)
319 391
320/* Used by CM_L4PER_CLKSTCTRL */ 392/* Used by CM_L4PER_CLKSTCTRL */
321#define OMAP4430_CLKACTIVITY_PER_32K_GFCLK_SHIFT 17 393#define OMAP4430_CLKACTIVITY_PER_32K_GFCLK_SHIFT 17
394#define OMAP4430_CLKACTIVITY_PER_32K_GFCLK_WIDTH 0x1
322#define OMAP4430_CLKACTIVITY_PER_32K_GFCLK_MASK (1 << 17) 395#define OMAP4430_CLKACTIVITY_PER_32K_GFCLK_MASK (1 << 17)
323 396
324/* Used by CM_L4PER_CLKSTCTRL */ 397/* Used by CM_L4PER_CLKSTCTRL */
325#define OMAP4430_CLKACTIVITY_PER_48M_GFCLK_SHIFT 18 398#define OMAP4430_CLKACTIVITY_PER_48M_GFCLK_SHIFT 18
399#define OMAP4430_CLKACTIVITY_PER_48M_GFCLK_WIDTH 0x1
326#define OMAP4430_CLKACTIVITY_PER_48M_GFCLK_MASK (1 << 18) 400#define OMAP4430_CLKACTIVITY_PER_48M_GFCLK_MASK (1 << 18)
327 401
328/* Used by CM_L4PER_CLKSTCTRL */ 402/* Used by CM_L4PER_CLKSTCTRL */
329#define OMAP4430_CLKACTIVITY_PER_96M_GFCLK_SHIFT 19 403#define OMAP4430_CLKACTIVITY_PER_96M_GFCLK_SHIFT 19
404#define OMAP4430_CLKACTIVITY_PER_96M_GFCLK_WIDTH 0x1
330#define OMAP4430_CLKACTIVITY_PER_96M_GFCLK_MASK (1 << 19) 405#define OMAP4430_CLKACTIVITY_PER_96M_GFCLK_MASK (1 << 19)
331 406
332/* Used by CM_L4PER_CLKSTCTRL */ 407/* Used by CM_L4PER_CLKSTCTRL */
333#define OMAP4430_CLKACTIVITY_PER_ABE_24M_GFCLK_SHIFT 25 408#define OMAP4430_CLKACTIVITY_PER_ABE_24M_GFCLK_SHIFT 25
409#define OMAP4430_CLKACTIVITY_PER_ABE_24M_GFCLK_WIDTH 0x1
334#define OMAP4430_CLKACTIVITY_PER_ABE_24M_GFCLK_MASK (1 << 25) 410#define OMAP4430_CLKACTIVITY_PER_ABE_24M_GFCLK_MASK (1 << 25)
335 411
336/* Used by CM_L4PER_CLKSTCTRL */ 412/* Used by CM_L4PER_CLKSTCTRL */
337#define OMAP4430_CLKACTIVITY_PER_MCASP2_GFCLK_SHIFT 20 413#define OMAP4430_CLKACTIVITY_PER_MCASP2_GFCLK_SHIFT 20
414#define OMAP4430_CLKACTIVITY_PER_MCASP2_GFCLK_WIDTH 0x1
338#define OMAP4430_CLKACTIVITY_PER_MCASP2_GFCLK_MASK (1 << 20) 415#define OMAP4430_CLKACTIVITY_PER_MCASP2_GFCLK_MASK (1 << 20)
339 416
340/* Used by CM_L4PER_CLKSTCTRL */ 417/* Used by CM_L4PER_CLKSTCTRL */
@@ -343,94 +420,114 @@
343 420
344/* Used by CM_L4PER_CLKSTCTRL */ 421/* Used by CM_L4PER_CLKSTCTRL */
345#define OMAP4430_CLKACTIVITY_PER_MCBSP4_GFCLK_SHIFT 22 422#define OMAP4430_CLKACTIVITY_PER_MCBSP4_GFCLK_SHIFT 22
423#define OMAP4430_CLKACTIVITY_PER_MCBSP4_GFCLK_WIDTH 0x1
346#define OMAP4430_CLKACTIVITY_PER_MCBSP4_GFCLK_MASK (1 << 22) 424#define OMAP4430_CLKACTIVITY_PER_MCBSP4_GFCLK_MASK (1 << 22)
347 425
348/* Used by CM_L4PER_CLKSTCTRL */ 426/* Used by CM_L4PER_CLKSTCTRL */
349#define OMAP4430_CLKACTIVITY_PER_SYS_GFCLK_SHIFT 24 427#define OMAP4430_CLKACTIVITY_PER_SYS_GFCLK_SHIFT 24
428#define OMAP4430_CLKACTIVITY_PER_SYS_GFCLK_WIDTH 0x1
350#define OMAP4430_CLKACTIVITY_PER_SYS_GFCLK_MASK (1 << 24) 429#define OMAP4430_CLKACTIVITY_PER_SYS_GFCLK_MASK (1 << 24)
351 430
352/* Used by CM_MEMIF_CLKSTCTRL */ 431/* Used by CM_MEMIF_CLKSTCTRL */
353#define OMAP4430_CLKACTIVITY_PHY_ROOT_CLK_SHIFT 10 432#define OMAP4430_CLKACTIVITY_PHY_ROOT_CLK_SHIFT 10
433#define OMAP4430_CLKACTIVITY_PHY_ROOT_CLK_WIDTH 0x1
354#define OMAP4430_CLKACTIVITY_PHY_ROOT_CLK_MASK (1 << 10) 434#define OMAP4430_CLKACTIVITY_PHY_ROOT_CLK_MASK (1 << 10)
355 435
356/* Used by CM_GFX_CLKSTCTRL */ 436/* Used by CM_GFX_CLKSTCTRL */
357#define OMAP4430_CLKACTIVITY_SGX_GFCLK_SHIFT 9 437#define OMAP4430_CLKACTIVITY_SGX_GFCLK_SHIFT 9
438#define OMAP4430_CLKACTIVITY_SGX_GFCLK_WIDTH 0x1
358#define OMAP4430_CLKACTIVITY_SGX_GFCLK_MASK (1 << 9) 439#define OMAP4430_CLKACTIVITY_SGX_GFCLK_MASK (1 << 9)
359 440
360/* Used by CM_ALWON_CLKSTCTRL */ 441/* Used by CM_ALWON_CLKSTCTRL */
361#define OMAP4430_CLKACTIVITY_SR_CORE_SYSCLK_SHIFT 11 442#define OMAP4430_CLKACTIVITY_SR_CORE_SYSCLK_SHIFT 11
443#define OMAP4430_CLKACTIVITY_SR_CORE_SYSCLK_WIDTH 0x1
362#define OMAP4430_CLKACTIVITY_SR_CORE_SYSCLK_MASK (1 << 11) 444#define OMAP4430_CLKACTIVITY_SR_CORE_SYSCLK_MASK (1 << 11)
363 445
364/* Used by CM_ALWON_CLKSTCTRL */ 446/* Used by CM_ALWON_CLKSTCTRL */
365#define OMAP4430_CLKACTIVITY_SR_IVA_SYSCLK_SHIFT 10 447#define OMAP4430_CLKACTIVITY_SR_IVA_SYSCLK_SHIFT 10
448#define OMAP4430_CLKACTIVITY_SR_IVA_SYSCLK_WIDTH 0x1
366#define OMAP4430_CLKACTIVITY_SR_IVA_SYSCLK_MASK (1 << 10) 449#define OMAP4430_CLKACTIVITY_SR_IVA_SYSCLK_MASK (1 << 10)
367 450
368/* Used by CM_ALWON_CLKSTCTRL */ 451/* Used by CM_ALWON_CLKSTCTRL */
369#define OMAP4430_CLKACTIVITY_SR_MPU_SYSCLK_SHIFT 9 452#define OMAP4430_CLKACTIVITY_SR_MPU_SYSCLK_SHIFT 9
453#define OMAP4430_CLKACTIVITY_SR_MPU_SYSCLK_WIDTH 0x1
370#define OMAP4430_CLKACTIVITY_SR_MPU_SYSCLK_MASK (1 << 9) 454#define OMAP4430_CLKACTIVITY_SR_MPU_SYSCLK_MASK (1 << 9)
371 455
372/* Used by CM_WKUP_CLKSTCTRL */ 456/* Used by CM_WKUP_CLKSTCTRL */
373#define OMAP4430_CLKACTIVITY_SYS_CLK_SHIFT 8 457#define OMAP4430_CLKACTIVITY_SYS_CLK_SHIFT 8
458#define OMAP4430_CLKACTIVITY_SYS_CLK_WIDTH 0x1
374#define OMAP4430_CLKACTIVITY_SYS_CLK_MASK (1 << 8) 459#define OMAP4430_CLKACTIVITY_SYS_CLK_MASK (1 << 8)
375 460
376/* Used by CM_TESLA_CLKSTCTRL */ 461/* Used by CM_TESLA_CLKSTCTRL */
377#define OMAP4430_CLKACTIVITY_TESLA_ROOT_CLK_SHIFT 8 462#define OMAP4430_CLKACTIVITY_TESLA_ROOT_CLK_SHIFT 8
463#define OMAP4430_CLKACTIVITY_TESLA_ROOT_CLK_WIDTH 0x1
378#define OMAP4430_CLKACTIVITY_TESLA_ROOT_CLK_MASK (1 << 8) 464#define OMAP4430_CLKACTIVITY_TESLA_ROOT_CLK_MASK (1 << 8)
379 465
380/* Used by CM_L3INIT_CLKSTCTRL */ 466/* Used by CM_L3INIT_CLKSTCTRL */
381#define OMAP4430_CLKACTIVITY_TLL_CH0_GFCLK_SHIFT 22 467#define OMAP4430_CLKACTIVITY_TLL_CH0_GFCLK_SHIFT 22
468#define OMAP4430_CLKACTIVITY_TLL_CH0_GFCLK_WIDTH 0x1
382#define OMAP4430_CLKACTIVITY_TLL_CH0_GFCLK_MASK (1 << 22) 469#define OMAP4430_CLKACTIVITY_TLL_CH0_GFCLK_MASK (1 << 22)
383 470
384/* Used by CM_L3INIT_CLKSTCTRL */ 471/* Used by CM_L3INIT_CLKSTCTRL */
385#define OMAP4430_CLKACTIVITY_TLL_CH1_GFCLK_SHIFT 23 472#define OMAP4430_CLKACTIVITY_TLL_CH1_GFCLK_SHIFT 23
473#define OMAP4430_CLKACTIVITY_TLL_CH1_GFCLK_WIDTH 0x1
386#define OMAP4430_CLKACTIVITY_TLL_CH1_GFCLK_MASK (1 << 23) 474#define OMAP4430_CLKACTIVITY_TLL_CH1_GFCLK_MASK (1 << 23)
387 475
388/* Used by CM_L3INIT_CLKSTCTRL */ 476/* Used by CM_L3INIT_CLKSTCTRL */
389#define OMAP4430_CLKACTIVITY_TLL_CH2_GFCLK_SHIFT 24 477#define OMAP4430_CLKACTIVITY_TLL_CH2_GFCLK_SHIFT 24
478#define OMAP4430_CLKACTIVITY_TLL_CH2_GFCLK_WIDTH 0x1
390#define OMAP4430_CLKACTIVITY_TLL_CH2_GFCLK_MASK (1 << 24) 479#define OMAP4430_CLKACTIVITY_TLL_CH2_GFCLK_MASK (1 << 24)
391 480
392/* Used by CM_L3INIT_CLKSTCTRL */ 481/* Used by CM_L3INIT_CLKSTCTRL */
393#define OMAP4430_CLKACTIVITY_UNIPRO_DPLL_CLK_SHIFT 10 482#define OMAP4430_CLKACTIVITY_UNIPRO_DPLL_CLK_SHIFT 10
483#define OMAP4430_CLKACTIVITY_UNIPRO_DPLL_CLK_WIDTH 0x1
394#define OMAP4430_CLKACTIVITY_UNIPRO_DPLL_CLK_MASK (1 << 10) 484#define OMAP4430_CLKACTIVITY_UNIPRO_DPLL_CLK_MASK (1 << 10)
395 485
396/* Used by CM_L3INIT_CLKSTCTRL */ 486/* Used by CM_L3INIT_CLKSTCTRL */
397#define OMAP4430_CLKACTIVITY_USB_DPLL_CLK_SHIFT 14 487#define OMAP4430_CLKACTIVITY_USB_DPLL_CLK_SHIFT 14
488#define OMAP4430_CLKACTIVITY_USB_DPLL_CLK_WIDTH 0x1
398#define OMAP4430_CLKACTIVITY_USB_DPLL_CLK_MASK (1 << 14) 489#define OMAP4430_CLKACTIVITY_USB_DPLL_CLK_MASK (1 << 14)
399 490
400/* Used by CM_L3INIT_CLKSTCTRL */ 491/* Used by CM_L3INIT_CLKSTCTRL */
401#define OMAP4430_CLKACTIVITY_USB_DPLL_HS_CLK_SHIFT 15 492#define OMAP4430_CLKACTIVITY_USB_DPLL_HS_CLK_SHIFT 15
493#define OMAP4430_CLKACTIVITY_USB_DPLL_HS_CLK_WIDTH 0x1
402#define OMAP4430_CLKACTIVITY_USB_DPLL_HS_CLK_MASK (1 << 15) 494#define OMAP4430_CLKACTIVITY_USB_DPLL_HS_CLK_MASK (1 << 15)
403 495
404/* Used by CM_WKUP_CLKSTCTRL */ 496/* Used by CM_WKUP_CLKSTCTRL */
405#define OMAP4430_CLKACTIVITY_USIM_GFCLK_SHIFT 10 497#define OMAP4430_CLKACTIVITY_USIM_GFCLK_SHIFT 10
498#define OMAP4430_CLKACTIVITY_USIM_GFCLK_WIDTH 0x1
406#define OMAP4430_CLKACTIVITY_USIM_GFCLK_MASK (1 << 10) 499#define OMAP4430_CLKACTIVITY_USIM_GFCLK_MASK (1 << 10)
407 500
408/* Used by CM_L3INIT_CLKSTCTRL */ 501/* Used by CM_L3INIT_CLKSTCTRL */
409#define OMAP4430_CLKACTIVITY_UTMI_P3_GFCLK_SHIFT 30 502#define OMAP4430_CLKACTIVITY_UTMI_P3_GFCLK_SHIFT 30
503#define OMAP4430_CLKACTIVITY_UTMI_P3_GFCLK_WIDTH 0x1
410#define OMAP4430_CLKACTIVITY_UTMI_P3_GFCLK_MASK (1 << 30) 504#define OMAP4430_CLKACTIVITY_UTMI_P3_GFCLK_MASK (1 << 30)
411 505
412/* Used by CM_L3INIT_CLKSTCTRL */ 506/* Used by CM_L3INIT_CLKSTCTRL */
413#define OMAP4430_CLKACTIVITY_UTMI_ROOT_GFCLK_SHIFT 25 507#define OMAP4430_CLKACTIVITY_UTMI_ROOT_GFCLK_SHIFT 25
508#define OMAP4430_CLKACTIVITY_UTMI_ROOT_GFCLK_WIDTH 0x1
414#define OMAP4430_CLKACTIVITY_UTMI_ROOT_GFCLK_MASK (1 << 25) 509#define OMAP4430_CLKACTIVITY_UTMI_ROOT_GFCLK_MASK (1 << 25)
415 510
416/* Used by CM_WKUP_CLKSTCTRL */ 511/* Used by CM_WKUP_CLKSTCTRL */
417#define OMAP4430_CLKACTIVITY_WKUP_32K_GFCLK_SHIFT 11 512#define OMAP4430_CLKACTIVITY_WKUP_32K_GFCLK_SHIFT 11
513#define OMAP4430_CLKACTIVITY_WKUP_32K_GFCLK_WIDTH 0x1
418#define OMAP4430_CLKACTIVITY_WKUP_32K_GFCLK_MASK (1 << 11) 514#define OMAP4430_CLKACTIVITY_WKUP_32K_GFCLK_MASK (1 << 11)
419 515
420/* Used by CM_WKUP_CLKSTCTRL */ 516/* Used by CM_WKUP_CLKSTCTRL */
421#define OMAP4460_CLKACTIVITY_WKUP_TS_GFCLK_SHIFT 13 517#define OMAP4460_CLKACTIVITY_WKUP_TS_GFCLK_SHIFT 13
518#define OMAP4460_CLKACTIVITY_WKUP_TS_GFCLK_WIDTH 0x1
422#define OMAP4460_CLKACTIVITY_WKUP_TS_GFCLK_MASK (1 << 13) 519#define OMAP4460_CLKACTIVITY_WKUP_TS_GFCLK_MASK (1 << 13)
423 520
424/* 521/*
425 * Used by CM1_ABE_TIMER5_CLKCTRL, CM1_ABE_TIMER6_CLKCTRL, 522 * Used by CM1_ABE_TIMER5_CLKCTRL, CM1_ABE_TIMER6_CLKCTRL,
426 * CM1_ABE_TIMER7_CLKCTRL, CM1_ABE_TIMER8_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL, 523 * CM1_ABE_TIMER7_CLKCTRL, CM1_ABE_TIMER8_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL,
427 * CM_L3INIT_MMC2_CLKCTRL, CM_L3INIT_MMC6_CLKCTRL, CM_L4PER_DMTIMER10_CLKCTRL, 524 * CM_L3INIT_MMC2_CLKCTRL, CM_L4PER_DMTIMER10_CLKCTRL,
428 * CM_L4PER_DMTIMER11_CLKCTRL, CM_L4PER_DMTIMER2_CLKCTRL, 525 * CM_L4PER_DMTIMER11_CLKCTRL, CM_L4PER_DMTIMER2_CLKCTRL,
429 * CM_L4PER_DMTIMER3_CLKCTRL, CM_L4PER_DMTIMER4_CLKCTRL, 526 * CM_L4PER_DMTIMER3_CLKCTRL, CM_L4PER_DMTIMER4_CLKCTRL,
430 * CM_L4PER_DMTIMER9_CLKCTRL, CM_L4PER_MCASP2_CLKCTRL, CM_L4PER_MCASP3_CLKCTRL, 527 * CM_L4PER_DMTIMER9_CLKCTRL, CM_WKUP_TIMER1_CLKCTRL
431 * CM_WKUP_TIMER1_CLKCTRL
432 */ 528 */
433#define OMAP4430_CLKSEL_SHIFT 24 529#define OMAP4430_CLKSEL_SHIFT 24
530#define OMAP4430_CLKSEL_WIDTH 0x1
434#define OMAP4430_CLKSEL_MASK (1 << 24) 531#define OMAP4430_CLKSEL_MASK (1 << 24)
435 532
436/* 533/*
@@ -438,50 +535,62 @@
438 * CM_CLKSEL_DUCATI_ISS_ROOT, CM_CLKSEL_USB_60MHZ, CM_L4_WKUP_CLKSEL 535 * CM_CLKSEL_DUCATI_ISS_ROOT, CM_CLKSEL_USB_60MHZ, CM_L4_WKUP_CLKSEL
439 */ 536 */
440#define OMAP4430_CLKSEL_0_0_SHIFT 0 537#define OMAP4430_CLKSEL_0_0_SHIFT 0
538#define OMAP4430_CLKSEL_0_0_WIDTH 0x1
441#define OMAP4430_CLKSEL_0_0_MASK (1 << 0) 539#define OMAP4430_CLKSEL_0_0_MASK (1 << 0)
442 540
443/* Renamed from CLKSEL Used by CM_BYPCLK_DPLL_IVA, CM_BYPCLK_DPLL_MPU */ 541/* Renamed from CLKSEL Used by CM_BYPCLK_DPLL_IVA, CM_BYPCLK_DPLL_MPU */
444#define OMAP4430_CLKSEL_0_1_SHIFT 0 542#define OMAP4430_CLKSEL_0_1_SHIFT 0
543#define OMAP4430_CLKSEL_0_1_WIDTH 0x2
445#define OMAP4430_CLKSEL_0_1_MASK (0x3 << 0) 544#define OMAP4430_CLKSEL_0_1_MASK (0x3 << 0)
446 545
447/* Renamed from CLKSEL Used by CM_L3INIT_HSI_CLKCTRL */ 546/* Renamed from CLKSEL Used by CM_L3INIT_HSI_CLKCTRL */
448#define OMAP4430_CLKSEL_24_25_SHIFT 24 547#define OMAP4430_CLKSEL_24_25_SHIFT 24
548#define OMAP4430_CLKSEL_24_25_WIDTH 0x2
449#define OMAP4430_CLKSEL_24_25_MASK (0x3 << 24) 549#define OMAP4430_CLKSEL_24_25_MASK (0x3 << 24)
450 550
451/* Used by CM_L3INIT_USB_OTG_CLKCTRL */ 551/* Used by CM_L3INIT_USB_OTG_CLKCTRL */
452#define OMAP4430_CLKSEL_60M_SHIFT 24 552#define OMAP4430_CLKSEL_60M_SHIFT 24
553#define OMAP4430_CLKSEL_60M_WIDTH 0x1
453#define OMAP4430_CLKSEL_60M_MASK (1 << 24) 554#define OMAP4430_CLKSEL_60M_MASK (1 << 24)
454 555
455/* Used by CM_MPU_MPU_CLKCTRL */ 556/* Used by CM_MPU_MPU_CLKCTRL */
456#define OMAP4460_CLKSEL_ABE_DIV_MODE_SHIFT 25 557#define OMAP4460_CLKSEL_ABE_DIV_MODE_SHIFT 25
558#define OMAP4460_CLKSEL_ABE_DIV_MODE_WIDTH 0x1
457#define OMAP4460_CLKSEL_ABE_DIV_MODE_MASK (1 << 25) 559#define OMAP4460_CLKSEL_ABE_DIV_MODE_MASK (1 << 25)
458 560
459/* Used by CM1_ABE_AESS_CLKCTRL */ 561/* Used by CM1_ABE_AESS_CLKCTRL */
460#define OMAP4430_CLKSEL_AESS_FCLK_SHIFT 24 562#define OMAP4430_CLKSEL_AESS_FCLK_SHIFT 24
563#define OMAP4430_CLKSEL_AESS_FCLK_WIDTH 0x1
461#define OMAP4430_CLKSEL_AESS_FCLK_MASK (1 << 24) 564#define OMAP4430_CLKSEL_AESS_FCLK_MASK (1 << 24)
462 565
463/* Used by CM_CLKSEL_CORE */ 566/* Used by CM_CLKSEL_CORE */
464#define OMAP4430_CLKSEL_CORE_SHIFT 0 567#define OMAP4430_CLKSEL_CORE_SHIFT 0
568#define OMAP4430_CLKSEL_CORE_WIDTH 0x1
465#define OMAP4430_CLKSEL_CORE_MASK (1 << 0) 569#define OMAP4430_CLKSEL_CORE_MASK (1 << 0)
466 570
467/* Renamed from CLKSEL_CORE Used by CM_SHADOW_FREQ_CONFIG2 */ 571/* Renamed from CLKSEL_CORE Used by CM_SHADOW_FREQ_CONFIG2 */
468#define OMAP4430_CLKSEL_CORE_1_1_SHIFT 1 572#define OMAP4430_CLKSEL_CORE_1_1_SHIFT 1
573#define OMAP4430_CLKSEL_CORE_1_1_WIDTH 0x1
469#define OMAP4430_CLKSEL_CORE_1_1_MASK (1 << 1) 574#define OMAP4430_CLKSEL_CORE_1_1_MASK (1 << 1)
470 575
471/* Used by CM_WKUP_USIM_CLKCTRL */ 576/* Used by CM_WKUP_USIM_CLKCTRL */
472#define OMAP4430_CLKSEL_DIV_SHIFT 24 577#define OMAP4430_CLKSEL_DIV_SHIFT 24
578#define OMAP4430_CLKSEL_DIV_WIDTH 0x1
473#define OMAP4430_CLKSEL_DIV_MASK (1 << 24) 579#define OMAP4430_CLKSEL_DIV_MASK (1 << 24)
474 580
475/* Used by CM_MPU_MPU_CLKCTRL */ 581/* Used by CM_MPU_MPU_CLKCTRL */
476#define OMAP4460_CLKSEL_EMIF_DIV_MODE_SHIFT 24 582#define OMAP4460_CLKSEL_EMIF_DIV_MODE_SHIFT 24
583#define OMAP4460_CLKSEL_EMIF_DIV_MODE_WIDTH 0x1
477#define OMAP4460_CLKSEL_EMIF_DIV_MODE_MASK (1 << 24) 584#define OMAP4460_CLKSEL_EMIF_DIV_MODE_MASK (1 << 24)
478 585
479/* Used by CM_CAM_FDIF_CLKCTRL */ 586/* Used by CM_CAM_FDIF_CLKCTRL */
480#define OMAP4430_CLKSEL_FCLK_SHIFT 24 587#define OMAP4430_CLKSEL_FCLK_SHIFT 24
588#define OMAP4430_CLKSEL_FCLK_WIDTH 0x2
481#define OMAP4430_CLKSEL_FCLK_MASK (0x3 << 24) 589#define OMAP4430_CLKSEL_FCLK_MASK (0x3 << 24)
482 590
483/* Used by CM_L4PER_MCBSP4_CLKCTRL */ 591/* Used by CM_L4PER_MCBSP4_CLKCTRL */
484#define OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT 25 592#define OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT 25
593#define OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH 0x1
485#define OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK (1 << 25) 594#define OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK (1 << 25)
486 595
487/* 596/*
@@ -490,34 +599,42 @@
490 * CM1_ABE_MCBSP3_CLKCTRL 599 * CM1_ABE_MCBSP3_CLKCTRL
491 */ 600 */
492#define OMAP4430_CLKSEL_INTERNAL_SOURCE_CM1_ABE_DMIC_SHIFT 26 601#define OMAP4430_CLKSEL_INTERNAL_SOURCE_CM1_ABE_DMIC_SHIFT 26
602#define OMAP4430_CLKSEL_INTERNAL_SOURCE_CM1_ABE_DMIC_WIDTH 0x2
493#define OMAP4430_CLKSEL_INTERNAL_SOURCE_CM1_ABE_DMIC_MASK (0x3 << 26) 603#define OMAP4430_CLKSEL_INTERNAL_SOURCE_CM1_ABE_DMIC_MASK (0x3 << 26)
494 604
495/* Used by CM_CLKSEL_CORE */ 605/* Used by CM_CLKSEL_CORE */
496#define OMAP4430_CLKSEL_L3_SHIFT 4 606#define OMAP4430_CLKSEL_L3_SHIFT 4
607#define OMAP4430_CLKSEL_L3_WIDTH 0x1
497#define OMAP4430_CLKSEL_L3_MASK (1 << 4) 608#define OMAP4430_CLKSEL_L3_MASK (1 << 4)
498 609
499/* Renamed from CLKSEL_L3 Used by CM_SHADOW_FREQ_CONFIG2 */ 610/* Renamed from CLKSEL_L3 Used by CM_SHADOW_FREQ_CONFIG2 */
500#define OMAP4430_CLKSEL_L3_SHADOW_SHIFT 2 611#define OMAP4430_CLKSEL_L3_SHADOW_SHIFT 2
612#define OMAP4430_CLKSEL_L3_SHADOW_WIDTH 0x1
501#define OMAP4430_CLKSEL_L3_SHADOW_MASK (1 << 2) 613#define OMAP4430_CLKSEL_L3_SHADOW_MASK (1 << 2)
502 614
503/* Used by CM_CLKSEL_CORE */ 615/* Used by CM_CLKSEL_CORE */
504#define OMAP4430_CLKSEL_L4_SHIFT 8 616#define OMAP4430_CLKSEL_L4_SHIFT 8
617#define OMAP4430_CLKSEL_L4_WIDTH 0x1
505#define OMAP4430_CLKSEL_L4_MASK (1 << 8) 618#define OMAP4430_CLKSEL_L4_MASK (1 << 8)
506 619
507/* Used by CM_CLKSEL_ABE */ 620/* Used by CM_CLKSEL_ABE */
508#define OMAP4430_CLKSEL_OPP_SHIFT 0 621#define OMAP4430_CLKSEL_OPP_SHIFT 0
622#define OMAP4430_CLKSEL_OPP_WIDTH 0x2
509#define OMAP4430_CLKSEL_OPP_MASK (0x3 << 0) 623#define OMAP4430_CLKSEL_OPP_MASK (0x3 << 0)
510 624
511/* Used by CM_EMU_DEBUGSS_CLKCTRL */ 625/* Used by CM_EMU_DEBUGSS_CLKCTRL */
512#define OMAP4430_CLKSEL_PMD_STM_CLK_SHIFT 27 626#define OMAP4430_CLKSEL_PMD_STM_CLK_SHIFT 27
627#define OMAP4430_CLKSEL_PMD_STM_CLK_WIDTH 0x3
513#define OMAP4430_CLKSEL_PMD_STM_CLK_MASK (0x7 << 27) 628#define OMAP4430_CLKSEL_PMD_STM_CLK_MASK (0x7 << 27)
514 629
515/* Used by CM_EMU_DEBUGSS_CLKCTRL */ 630/* Used by CM_EMU_DEBUGSS_CLKCTRL */
516#define OMAP4430_CLKSEL_PMD_TRACE_CLK_SHIFT 24 631#define OMAP4430_CLKSEL_PMD_TRACE_CLK_SHIFT 24
632#define OMAP4430_CLKSEL_PMD_TRACE_CLK_WIDTH 0x3
517#define OMAP4430_CLKSEL_PMD_TRACE_CLK_MASK (0x7 << 24) 633#define OMAP4430_CLKSEL_PMD_TRACE_CLK_MASK (0x7 << 24)
518 634
519/* Used by CM_GFX_GFX_CLKCTRL */ 635/* Used by CM_GFX_GFX_CLKCTRL */
520#define OMAP4430_CLKSEL_SGX_FCLK_SHIFT 24 636#define OMAP4430_CLKSEL_SGX_FCLK_SHIFT 24
637#define OMAP4430_CLKSEL_SGX_FCLK_WIDTH 0x1
521#define OMAP4430_CLKSEL_SGX_FCLK_MASK (1 << 24) 638#define OMAP4430_CLKSEL_SGX_FCLK_MASK (1 << 24)
522 639
523/* 640/*
@@ -525,18 +642,22 @@
525 * CM1_ABE_MCBSP2_CLKCTRL, CM1_ABE_MCBSP3_CLKCTRL 642 * CM1_ABE_MCBSP2_CLKCTRL, CM1_ABE_MCBSP3_CLKCTRL
526 */ 643 */
527#define OMAP4430_CLKSEL_SOURCE_SHIFT 24 644#define OMAP4430_CLKSEL_SOURCE_SHIFT 24
645#define OMAP4430_CLKSEL_SOURCE_WIDTH 0x2
528#define OMAP4430_CLKSEL_SOURCE_MASK (0x3 << 24) 646#define OMAP4430_CLKSEL_SOURCE_MASK (0x3 << 24)
529 647
530/* Renamed from CLKSEL_SOURCE Used by CM_L4PER_MCBSP4_CLKCTRL */ 648/* Renamed from CLKSEL_SOURCE Used by CM_L4PER_MCBSP4_CLKCTRL */
531#define OMAP4430_CLKSEL_SOURCE_24_24_SHIFT 24 649#define OMAP4430_CLKSEL_SOURCE_24_24_SHIFT 24
650#define OMAP4430_CLKSEL_SOURCE_24_24_WIDTH 0x1
532#define OMAP4430_CLKSEL_SOURCE_24_24_MASK (1 << 24) 651#define OMAP4430_CLKSEL_SOURCE_24_24_MASK (1 << 24)
533 652
534/* Used by CM_L3INIT_USB_HOST_CLKCTRL */ 653/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
535#define OMAP4430_CLKSEL_UTMI_P1_SHIFT 24 654#define OMAP4430_CLKSEL_UTMI_P1_SHIFT 24
655#define OMAP4430_CLKSEL_UTMI_P1_WIDTH 0x1
536#define OMAP4430_CLKSEL_UTMI_P1_MASK (1 << 24) 656#define OMAP4430_CLKSEL_UTMI_P1_MASK (1 << 24)
537 657
538/* Used by CM_L3INIT_USB_HOST_CLKCTRL */ 658/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
539#define OMAP4430_CLKSEL_UTMI_P2_SHIFT 25 659#define OMAP4430_CLKSEL_UTMI_P2_SHIFT 25
660#define OMAP4430_CLKSEL_UTMI_P2_WIDTH 0x1
540#define OMAP4430_CLKSEL_UTMI_P2_MASK (1 << 25) 661#define OMAP4430_CLKSEL_UTMI_P2_MASK (1 << 25)
541 662
542/* 663/*
@@ -549,30 +670,37 @@
549 * CM_TESLA_CLKSTCTRL, CM_WKUP_CLKSTCTRL 670 * CM_TESLA_CLKSTCTRL, CM_WKUP_CLKSTCTRL
550 */ 671 */
551#define OMAP4430_CLKTRCTRL_SHIFT 0 672#define OMAP4430_CLKTRCTRL_SHIFT 0
673#define OMAP4430_CLKTRCTRL_WIDTH 0x2
552#define OMAP4430_CLKTRCTRL_MASK (0x3 << 0) 674#define OMAP4430_CLKTRCTRL_MASK (0x3 << 0)
553 675
554/* Used by CM_EMU_OVERRIDE_DPLL_CORE */ 676/* Used by CM_EMU_OVERRIDE_DPLL_CORE */
555#define OMAP4430_CORE_DPLL_EMU_DIV_SHIFT 0 677#define OMAP4430_CORE_DPLL_EMU_DIV_SHIFT 0
678#define OMAP4430_CORE_DPLL_EMU_DIV_WIDTH 0x7
556#define OMAP4430_CORE_DPLL_EMU_DIV_MASK (0x7f << 0) 679#define OMAP4430_CORE_DPLL_EMU_DIV_MASK (0x7f << 0)
557 680
558/* Used by CM_EMU_OVERRIDE_DPLL_CORE */ 681/* Used by CM_EMU_OVERRIDE_DPLL_CORE */
559#define OMAP4430_CORE_DPLL_EMU_MULT_SHIFT 8 682#define OMAP4430_CORE_DPLL_EMU_MULT_SHIFT 8
683#define OMAP4430_CORE_DPLL_EMU_MULT_WIDTH 0xb
560#define OMAP4430_CORE_DPLL_EMU_MULT_MASK (0x7ff << 8) 684#define OMAP4430_CORE_DPLL_EMU_MULT_MASK (0x7ff << 8)
561 685
562/* Used by REVISION_CM1, REVISION_CM2 */ 686/* Used by REVISION_CM1, REVISION_CM2 */
563#define OMAP4430_CUSTOM_SHIFT 6 687#define OMAP4430_CUSTOM_SHIFT 6
688#define OMAP4430_CUSTOM_WIDTH 0x2
564#define OMAP4430_CUSTOM_MASK (0x3 << 6) 689#define OMAP4430_CUSTOM_MASK (0x3 << 6)
565 690
566/* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */ 691/* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */
567#define OMAP4430_D2D_DYNDEP_SHIFT 18 692#define OMAP4430_D2D_DYNDEP_SHIFT 18
693#define OMAP4430_D2D_DYNDEP_WIDTH 0x1
568#define OMAP4430_D2D_DYNDEP_MASK (1 << 18) 694#define OMAP4430_D2D_DYNDEP_MASK (1 << 18)
569 695
570/* Used by CM_MPU_STATICDEP */ 696/* Used by CM_MPU_STATICDEP */
571#define OMAP4430_D2D_STATDEP_SHIFT 18 697#define OMAP4430_D2D_STATDEP_SHIFT 18
698#define OMAP4430_D2D_STATDEP_WIDTH 0x1
572#define OMAP4430_D2D_STATDEP_MASK (1 << 18) 699#define OMAP4430_D2D_STATDEP_MASK (1 << 18)
573 700
574/* Used by CM_CLKSEL_DPLL_MPU */ 701/* Used by CM_CLKSEL_DPLL_MPU */
575#define OMAP4460_DCC_COUNT_MAX_SHIFT 24 702#define OMAP4460_DCC_COUNT_MAX_SHIFT 24
703#define OMAP4460_DCC_COUNT_MAX_WIDTH 0x8
576#define OMAP4460_DCC_COUNT_MAX_MASK (0xff << 24) 704#define OMAP4460_DCC_COUNT_MAX_MASK (0xff << 24)
577 705
578/* Used by CM_CLKSEL_DPLL_MPU */ 706/* Used by CM_CLKSEL_DPLL_MPU */
@@ -586,22 +714,27 @@
586 * CM_SSC_DELTAMSTEP_DPLL_UNIPRO, CM_SSC_DELTAMSTEP_DPLL_USB 714 * CM_SSC_DELTAMSTEP_DPLL_UNIPRO, CM_SSC_DELTAMSTEP_DPLL_USB
587 */ 715 */
588#define OMAP4430_DELTAMSTEP_SHIFT 0 716#define OMAP4430_DELTAMSTEP_SHIFT 0
717#define OMAP4430_DELTAMSTEP_WIDTH 0x14
589#define OMAP4430_DELTAMSTEP_MASK (0xfffff << 0) 718#define OMAP4430_DELTAMSTEP_MASK (0xfffff << 0)
590 719
591/* Renamed from DELTAMSTEP Used by CM_SSC_DELTAMSTEP_DPLL_USB */ 720/* Renamed from DELTAMSTEP Used by CM_SSC_DELTAMSTEP_DPLL_USB */
592#define OMAP4460_DELTAMSTEP_0_20_SHIFT 0 721#define OMAP4460_DELTAMSTEP_0_20_SHIFT 0
722#define OMAP4460_DELTAMSTEP_0_20_WIDTH 0x15
593#define OMAP4460_DELTAMSTEP_0_20_MASK (0x1fffff << 0) 723#define OMAP4460_DELTAMSTEP_0_20_MASK (0x1fffff << 0)
594 724
595/* Used by CM_DLL_CTRL */ 725/* Used by CM_DLL_CTRL */
596#define OMAP4430_DLL_OVERRIDE_SHIFT 0 726#define OMAP4430_DLL_OVERRIDE_SHIFT 0
727#define OMAP4430_DLL_OVERRIDE_WIDTH 0x1
597#define OMAP4430_DLL_OVERRIDE_MASK (1 << 0) 728#define OMAP4430_DLL_OVERRIDE_MASK (1 << 0)
598 729
599/* Renamed from DLL_OVERRIDE Used by CM_SHADOW_FREQ_CONFIG1 */ 730/* Renamed from DLL_OVERRIDE Used by CM_SHADOW_FREQ_CONFIG1 */
600#define OMAP4430_DLL_OVERRIDE_2_2_SHIFT 2 731#define OMAP4430_DLL_OVERRIDE_2_2_SHIFT 2
732#define OMAP4430_DLL_OVERRIDE_2_2_WIDTH 0x1
601#define OMAP4430_DLL_OVERRIDE_2_2_MASK (1 << 2) 733#define OMAP4430_DLL_OVERRIDE_2_2_MASK (1 << 2)
602 734
603/* Used by CM_SHADOW_FREQ_CONFIG1 */ 735/* Used by CM_SHADOW_FREQ_CONFIG1 */
604#define OMAP4430_DLL_RESET_SHIFT 3 736#define OMAP4430_DLL_RESET_SHIFT 3
737#define OMAP4430_DLL_RESET_WIDTH 0x1
605#define OMAP4430_DLL_RESET_MASK (1 << 3) 738#define OMAP4430_DLL_RESET_MASK (1 << 3)
606 739
607/* 740/*
@@ -610,30 +743,37 @@
610 * CM_CLKSEL_DPLL_UNIPRO, CM_CLKSEL_DPLL_USB 743 * CM_CLKSEL_DPLL_UNIPRO, CM_CLKSEL_DPLL_USB
611 */ 744 */
612#define OMAP4430_DPLL_BYP_CLKSEL_SHIFT 23 745#define OMAP4430_DPLL_BYP_CLKSEL_SHIFT 23
746#define OMAP4430_DPLL_BYP_CLKSEL_WIDTH 0x1
613#define OMAP4430_DPLL_BYP_CLKSEL_MASK (1 << 23) 747#define OMAP4430_DPLL_BYP_CLKSEL_MASK (1 << 23)
614 748
615/* Used by CM_CLKDCOLDO_DPLL_USB */ 749/* Used by CM_CLKDCOLDO_DPLL_USB */
616#define OMAP4430_DPLL_CLKDCOLDO_GATE_CTRL_SHIFT 8 750#define OMAP4430_DPLL_CLKDCOLDO_GATE_CTRL_SHIFT 8
751#define OMAP4430_DPLL_CLKDCOLDO_GATE_CTRL_WIDTH 0x1
617#define OMAP4430_DPLL_CLKDCOLDO_GATE_CTRL_MASK (1 << 8) 752#define OMAP4430_DPLL_CLKDCOLDO_GATE_CTRL_MASK (1 << 8)
618 753
619/* Used by CM_CLKSEL_DPLL_CORE */ 754/* Used by CM_CLKSEL_DPLL_CORE */
620#define OMAP4430_DPLL_CLKOUTHIF_CLKSEL_SHIFT 20 755#define OMAP4430_DPLL_CLKOUTHIF_CLKSEL_SHIFT 20
756#define OMAP4430_DPLL_CLKOUTHIF_CLKSEL_WIDTH 0x1
621#define OMAP4430_DPLL_CLKOUTHIF_CLKSEL_MASK (1 << 20) 757#define OMAP4430_DPLL_CLKOUTHIF_CLKSEL_MASK (1 << 20)
622 758
623/* Used by CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER */ 759/* Used by CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER */
624#define OMAP4430_DPLL_CLKOUTHIF_DIV_SHIFT 0 760#define OMAP4430_DPLL_CLKOUTHIF_DIV_SHIFT 0
761#define OMAP4430_DPLL_CLKOUTHIF_DIV_WIDTH 0x5
625#define OMAP4430_DPLL_CLKOUTHIF_DIV_MASK (0x1f << 0) 762#define OMAP4430_DPLL_CLKOUTHIF_DIV_MASK (0x1f << 0)
626 763
627/* Used by CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER */ 764/* Used by CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER */
628#define OMAP4430_DPLL_CLKOUTHIF_DIVCHACK_SHIFT 5 765#define OMAP4430_DPLL_CLKOUTHIF_DIVCHACK_SHIFT 5
766#define OMAP4430_DPLL_CLKOUTHIF_DIVCHACK_WIDTH 0x1
629#define OMAP4430_DPLL_CLKOUTHIF_DIVCHACK_MASK (1 << 5) 767#define OMAP4430_DPLL_CLKOUTHIF_DIVCHACK_MASK (1 << 5)
630 768
631/* Used by CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER */ 769/* Used by CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER */
632#define OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT 8 770#define OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT 8
771#define OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_WIDTH 0x1
633#define OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_MASK (1 << 8) 772#define OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_MASK (1 << 8)
634 773
635/* Used by CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO */ 774/* Used by CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO */
636#define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_SHIFT 10 775#define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_SHIFT 10
776#define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_WIDTH 0x1
637#define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK (1 << 10) 777#define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK (1 << 10)
638 778
639/* 779/*
@@ -641,10 +781,12 @@
641 * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO 781 * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO
642 */ 782 */
643#define OMAP4430_DPLL_CLKOUT_DIV_SHIFT 0 783#define OMAP4430_DPLL_CLKOUT_DIV_SHIFT 0
784#define OMAP4430_DPLL_CLKOUT_DIV_WIDTH 0x5
644#define OMAP4430_DPLL_CLKOUT_DIV_MASK (0x1f << 0) 785#define OMAP4430_DPLL_CLKOUT_DIV_MASK (0x1f << 0)
645 786
646/* Renamed from DPLL_CLKOUT_DIV Used by CM_DIV_M2_DPLL_USB */ 787/* Renamed from DPLL_CLKOUT_DIV Used by CM_DIV_M2_DPLL_USB */
647#define OMAP4430_DPLL_CLKOUT_DIV_0_6_SHIFT 0 788#define OMAP4430_DPLL_CLKOUT_DIV_0_6_SHIFT 0
789#define OMAP4430_DPLL_CLKOUT_DIV_0_6_WIDTH 0x7
648#define OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK (0x7f << 0) 790#define OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK (0x7f << 0)
649 791
650/* 792/*
@@ -652,10 +794,12 @@
652 * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO 794 * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO
653 */ 795 */
654#define OMAP4430_DPLL_CLKOUT_DIVCHACK_SHIFT 5 796#define OMAP4430_DPLL_CLKOUT_DIVCHACK_SHIFT 5
797#define OMAP4430_DPLL_CLKOUT_DIVCHACK_WIDTH 0x1
655#define OMAP4430_DPLL_CLKOUT_DIVCHACK_MASK (1 << 5) 798#define OMAP4430_DPLL_CLKOUT_DIVCHACK_MASK (1 << 5)
656 799
657/* Renamed from DPLL_CLKOUT_DIVCHACK Used by CM_DIV_M2_DPLL_USB */ 800/* Renamed from DPLL_CLKOUT_DIVCHACK Used by CM_DIV_M2_DPLL_USB */
658#define OMAP4430_DPLL_CLKOUT_DIVCHACK_M2_USB_SHIFT 7 801#define OMAP4430_DPLL_CLKOUT_DIVCHACK_M2_USB_SHIFT 7
802#define OMAP4430_DPLL_CLKOUT_DIVCHACK_M2_USB_WIDTH 0x1
659#define OMAP4430_DPLL_CLKOUT_DIVCHACK_M2_USB_MASK (1 << 7) 803#define OMAP4430_DPLL_CLKOUT_DIVCHACK_M2_USB_MASK (1 << 7)
660 804
661/* 805/*
@@ -663,18 +807,22 @@
663 * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_USB 807 * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_USB
664 */ 808 */
665#define OMAP4430_DPLL_CLKOUT_GATE_CTRL_SHIFT 8 809#define OMAP4430_DPLL_CLKOUT_GATE_CTRL_SHIFT 8
810#define OMAP4430_DPLL_CLKOUT_GATE_CTRL_WIDTH 0x1
666#define OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK (1 << 8) 811#define OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK (1 << 8)
667 812
668/* Used by CM_SHADOW_FREQ_CONFIG1 */ 813/* Used by CM_SHADOW_FREQ_CONFIG1 */
669#define OMAP4430_DPLL_CORE_DPLL_EN_SHIFT 8 814#define OMAP4430_DPLL_CORE_DPLL_EN_SHIFT 8
815#define OMAP4430_DPLL_CORE_DPLL_EN_WIDTH 0x3
670#define OMAP4430_DPLL_CORE_DPLL_EN_MASK (0x7 << 8) 816#define OMAP4430_DPLL_CORE_DPLL_EN_MASK (0x7 << 8)
671 817
672/* Used by CM_SHADOW_FREQ_CONFIG1 */ 818/* Used by CM_SHADOW_FREQ_CONFIG1 */
673#define OMAP4430_DPLL_CORE_M2_DIV_SHIFT 11 819#define OMAP4430_DPLL_CORE_M2_DIV_SHIFT 11
820#define OMAP4430_DPLL_CORE_M2_DIV_WIDTH 0x5
674#define OMAP4430_DPLL_CORE_M2_DIV_MASK (0x1f << 11) 821#define OMAP4430_DPLL_CORE_M2_DIV_MASK (0x1f << 11)
675 822
676/* Used by CM_SHADOW_FREQ_CONFIG2 */ 823/* Used by CM_SHADOW_FREQ_CONFIG2 */
677#define OMAP4430_DPLL_CORE_M5_DIV_SHIFT 3 824#define OMAP4430_DPLL_CORE_M5_DIV_SHIFT 3
825#define OMAP4430_DPLL_CORE_M5_DIV_WIDTH 0x5
678#define OMAP4430_DPLL_CORE_M5_DIV_MASK (0x1f << 3) 826#define OMAP4430_DPLL_CORE_M5_DIV_MASK (0x1f << 3)
679 827
680/* 828/*
@@ -683,10 +831,12 @@
683 * CM_CLKSEL_DPLL_UNIPRO 831 * CM_CLKSEL_DPLL_UNIPRO
684 */ 832 */
685#define OMAP4430_DPLL_DIV_SHIFT 0 833#define OMAP4430_DPLL_DIV_SHIFT 0
834#define OMAP4430_DPLL_DIV_WIDTH 0x7
686#define OMAP4430_DPLL_DIV_MASK (0x7f << 0) 835#define OMAP4430_DPLL_DIV_MASK (0x7f << 0)
687 836
688/* Renamed from DPLL_DIV Used by CM_CLKSEL_DPLL_USB */ 837/* Renamed from DPLL_DIV Used by CM_CLKSEL_DPLL_USB */
689#define OMAP4430_DPLL_DIV_0_7_SHIFT 0 838#define OMAP4430_DPLL_DIV_0_7_SHIFT 0
839#define OMAP4430_DPLL_DIV_0_7_WIDTH 0x8
690#define OMAP4430_DPLL_DIV_0_7_MASK (0xff << 0) 840#define OMAP4430_DPLL_DIV_0_7_MASK (0xff << 0)
691 841
692/* 842/*
@@ -694,10 +844,12 @@
694 * CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER 844 * CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
695 */ 845 */
696#define OMAP4430_DPLL_DRIFTGUARD_EN_SHIFT 8 846#define OMAP4430_DPLL_DRIFTGUARD_EN_SHIFT 8
847#define OMAP4430_DPLL_DRIFTGUARD_EN_WIDTH 0x1
697#define OMAP4430_DPLL_DRIFTGUARD_EN_MASK (1 << 8) 848#define OMAP4430_DPLL_DRIFTGUARD_EN_MASK (1 << 8)
698 849
699/* Renamed from DPLL_DRIFTGUARD_EN Used by CM_CLKMODE_DPLL_UNIPRO */ 850/* Renamed from DPLL_DRIFTGUARD_EN Used by CM_CLKMODE_DPLL_UNIPRO */
700#define OMAP4430_DPLL_DRIFTGUARD_EN_3_3_SHIFT 3 851#define OMAP4430_DPLL_DRIFTGUARD_EN_3_3_SHIFT 3
852#define OMAP4430_DPLL_DRIFTGUARD_EN_3_3_WIDTH 0x1
701#define OMAP4430_DPLL_DRIFTGUARD_EN_3_3_MASK (1 << 3) 853#define OMAP4430_DPLL_DRIFTGUARD_EN_3_3_MASK (1 << 3)
702 854
703/* 855/*
@@ -706,6 +858,7 @@
706 * CM_CLKMODE_DPLL_UNIPRO, CM_CLKMODE_DPLL_USB 858 * CM_CLKMODE_DPLL_UNIPRO, CM_CLKMODE_DPLL_USB
707 */ 859 */
708#define OMAP4430_DPLL_EN_SHIFT 0 860#define OMAP4430_DPLL_EN_SHIFT 0
861#define OMAP4430_DPLL_EN_WIDTH 0x3
709#define OMAP4430_DPLL_EN_MASK (0x7 << 0) 862#define OMAP4430_DPLL_EN_MASK (0x7 << 0)
710 863
711/* 864/*
@@ -714,6 +867,7 @@
714 * CM_CLKMODE_DPLL_UNIPRO 867 * CM_CLKMODE_DPLL_UNIPRO
715 */ 868 */
716#define OMAP4430_DPLL_LPMODE_EN_SHIFT 10 869#define OMAP4430_DPLL_LPMODE_EN_SHIFT 10
870#define OMAP4430_DPLL_LPMODE_EN_WIDTH 0x1
717#define OMAP4430_DPLL_LPMODE_EN_MASK (1 << 10) 871#define OMAP4430_DPLL_LPMODE_EN_MASK (1 << 10)
718 872
719/* 873/*
@@ -722,10 +876,12 @@
722 * CM_CLKSEL_DPLL_UNIPRO 876 * CM_CLKSEL_DPLL_UNIPRO
723 */ 877 */
724#define OMAP4430_DPLL_MULT_SHIFT 8 878#define OMAP4430_DPLL_MULT_SHIFT 8
879#define OMAP4430_DPLL_MULT_WIDTH 0xb
725#define OMAP4430_DPLL_MULT_MASK (0x7ff << 8) 880#define OMAP4430_DPLL_MULT_MASK (0x7ff << 8)
726 881
727/* Renamed from DPLL_MULT Used by CM_CLKSEL_DPLL_USB */ 882/* Renamed from DPLL_MULT Used by CM_CLKSEL_DPLL_USB */
728#define OMAP4430_DPLL_MULT_USB_SHIFT 8 883#define OMAP4430_DPLL_MULT_USB_SHIFT 8
884#define OMAP4430_DPLL_MULT_USB_WIDTH 0xc
729#define OMAP4430_DPLL_MULT_USB_MASK (0xfff << 8) 885#define OMAP4430_DPLL_MULT_USB_MASK (0xfff << 8)
730 886
731/* 887/*
@@ -734,10 +890,12 @@
734 * CM_CLKMODE_DPLL_UNIPRO 890 * CM_CLKMODE_DPLL_UNIPRO
735 */ 891 */
736#define OMAP4430_DPLL_REGM4XEN_SHIFT 11 892#define OMAP4430_DPLL_REGM4XEN_SHIFT 11
893#define OMAP4430_DPLL_REGM4XEN_WIDTH 0x1
737#define OMAP4430_DPLL_REGM4XEN_MASK (1 << 11) 894#define OMAP4430_DPLL_REGM4XEN_MASK (1 << 11)
738 895
739/* Used by CM_CLKSEL_DPLL_USB */ 896/* Used by CM_CLKSEL_DPLL_USB */
740#define OMAP4430_DPLL_SD_DIV_SHIFT 24 897#define OMAP4430_DPLL_SD_DIV_SHIFT 24
898#define OMAP4430_DPLL_SD_DIV_WIDTH 0x8
741#define OMAP4430_DPLL_SD_DIV_MASK (0xff << 24) 899#define OMAP4430_DPLL_SD_DIV_MASK (0xff << 24)
742 900
743/* 901/*
@@ -746,6 +904,7 @@
746 * CM_CLKMODE_DPLL_UNIPRO, CM_CLKMODE_DPLL_USB 904 * CM_CLKMODE_DPLL_UNIPRO, CM_CLKMODE_DPLL_USB
747 */ 905 */
748#define OMAP4430_DPLL_SSC_ACK_SHIFT 13 906#define OMAP4430_DPLL_SSC_ACK_SHIFT 13
907#define OMAP4430_DPLL_SSC_ACK_WIDTH 0x1
749#define OMAP4430_DPLL_SSC_ACK_MASK (1 << 13) 908#define OMAP4430_DPLL_SSC_ACK_MASK (1 << 13)
750 909
751/* 910/*
@@ -754,6 +913,7 @@
754 * CM_CLKMODE_DPLL_UNIPRO, CM_CLKMODE_DPLL_USB 913 * CM_CLKMODE_DPLL_UNIPRO, CM_CLKMODE_DPLL_USB
755 */ 914 */
756#define OMAP4430_DPLL_SSC_DOWNSPREAD_SHIFT 14 915#define OMAP4430_DPLL_SSC_DOWNSPREAD_SHIFT 14
916#define OMAP4430_DPLL_SSC_DOWNSPREAD_WIDTH 0x1
757#define OMAP4430_DPLL_SSC_DOWNSPREAD_MASK (1 << 14) 917#define OMAP4430_DPLL_SSC_DOWNSPREAD_MASK (1 << 14)
758 918
759/* 919/*
@@ -762,42 +922,52 @@
762 * CM_CLKMODE_DPLL_UNIPRO, CM_CLKMODE_DPLL_USB 922 * CM_CLKMODE_DPLL_UNIPRO, CM_CLKMODE_DPLL_USB
763 */ 923 */
764#define OMAP4430_DPLL_SSC_EN_SHIFT 12 924#define OMAP4430_DPLL_SSC_EN_SHIFT 12
925#define OMAP4430_DPLL_SSC_EN_WIDTH 0x1
765#define OMAP4430_DPLL_SSC_EN_MASK (1 << 12) 926#define OMAP4430_DPLL_SSC_EN_MASK (1 << 12)
766 927
767/* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_L4PER_DYNAMICDEP */ 928/* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_L4PER_DYNAMICDEP */
768#define OMAP4430_DSS_DYNDEP_SHIFT 8 929#define OMAP4430_DSS_DYNDEP_SHIFT 8
930#define OMAP4430_DSS_DYNDEP_WIDTH 0x1
769#define OMAP4430_DSS_DYNDEP_MASK (1 << 8) 931#define OMAP4430_DSS_DYNDEP_MASK (1 << 8)
770 932
771/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_SDMA_STATICDEP */ 933/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_SDMA_STATICDEP */
772#define OMAP4430_DSS_STATDEP_SHIFT 8 934#define OMAP4430_DSS_STATDEP_SHIFT 8
935#define OMAP4430_DSS_STATDEP_WIDTH 0x1
773#define OMAP4430_DSS_STATDEP_MASK (1 << 8) 936#define OMAP4430_DSS_STATDEP_MASK (1 << 8)
774 937
775/* Used by CM_L3_2_DYNAMICDEP */ 938/* Used by CM_L3_2_DYNAMICDEP */
776#define OMAP4430_DUCATI_DYNDEP_SHIFT 0 939#define OMAP4430_DUCATI_DYNDEP_SHIFT 0
940#define OMAP4430_DUCATI_DYNDEP_WIDTH 0x1
777#define OMAP4430_DUCATI_DYNDEP_MASK (1 << 0) 941#define OMAP4430_DUCATI_DYNDEP_MASK (1 << 0)
778 942
779/* Used by CM_MPU_STATICDEP, CM_SDMA_STATICDEP */ 943/* Used by CM_MPU_STATICDEP, CM_SDMA_STATICDEP */
780#define OMAP4430_DUCATI_STATDEP_SHIFT 0 944#define OMAP4430_DUCATI_STATDEP_SHIFT 0
945#define OMAP4430_DUCATI_STATDEP_WIDTH 0x1
781#define OMAP4430_DUCATI_STATDEP_MASK (1 << 0) 946#define OMAP4430_DUCATI_STATDEP_MASK (1 << 0)
782 947
783/* Used by CM_SHADOW_FREQ_CONFIG1 */ 948/* Used by CM_SHADOW_FREQ_CONFIG1 */
784#define OMAP4430_FREQ_UPDATE_SHIFT 0 949#define OMAP4430_FREQ_UPDATE_SHIFT 0
950#define OMAP4430_FREQ_UPDATE_WIDTH 0x1
785#define OMAP4430_FREQ_UPDATE_MASK (1 << 0) 951#define OMAP4430_FREQ_UPDATE_MASK (1 << 0)
786 952
787/* Used by REVISION_CM1, REVISION_CM2 */ 953/* Used by REVISION_CM1, REVISION_CM2 */
788#define OMAP4430_FUNC_SHIFT 16 954#define OMAP4430_FUNC_SHIFT 16
955#define OMAP4430_FUNC_WIDTH 0xc
789#define OMAP4430_FUNC_MASK (0xfff << 16) 956#define OMAP4430_FUNC_MASK (0xfff << 16)
790 957
791/* Used by CM_L3_2_DYNAMICDEP */ 958/* Used by CM_L3_2_DYNAMICDEP */
792#define OMAP4430_GFX_DYNDEP_SHIFT 10 959#define OMAP4430_GFX_DYNDEP_SHIFT 10
960#define OMAP4430_GFX_DYNDEP_WIDTH 0x1
793#define OMAP4430_GFX_DYNDEP_MASK (1 << 10) 961#define OMAP4430_GFX_DYNDEP_MASK (1 << 10)
794 962
795/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */ 963/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */
796#define OMAP4430_GFX_STATDEP_SHIFT 10 964#define OMAP4430_GFX_STATDEP_SHIFT 10
965#define OMAP4430_GFX_STATDEP_WIDTH 0x1
797#define OMAP4430_GFX_STATDEP_MASK (1 << 10) 966#define OMAP4430_GFX_STATDEP_MASK (1 << 10)
798 967
799/* Used by CM_SHADOW_FREQ_CONFIG2 */ 968/* Used by CM_SHADOW_FREQ_CONFIG2 */
800#define OMAP4430_GPMC_FREQ_UPDATE_SHIFT 0 969#define OMAP4430_GPMC_FREQ_UPDATE_SHIFT 0
970#define OMAP4430_GPMC_FREQ_UPDATE_WIDTH 0x1
801#define OMAP4430_GPMC_FREQ_UPDATE_MASK (1 << 0) 971#define OMAP4430_GPMC_FREQ_UPDATE_MASK (1 << 0)
802 972
803/* 973/*
@@ -805,6 +975,7 @@
805 * CM_DIV_M4_DPLL_PER 975 * CM_DIV_M4_DPLL_PER
806 */ 976 */
807#define OMAP4430_HSDIVIDER_CLKOUT1_DIV_SHIFT 0 977#define OMAP4430_HSDIVIDER_CLKOUT1_DIV_SHIFT 0
978#define OMAP4430_HSDIVIDER_CLKOUT1_DIV_WIDTH 0x5
808#define OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK (0x1f << 0) 979#define OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK (0x1f << 0)
809 980
810/* 981/*
@@ -812,6 +983,7 @@
812 * CM_DIV_M4_DPLL_PER 983 * CM_DIV_M4_DPLL_PER
813 */ 984 */
814#define OMAP4430_HSDIVIDER_CLKOUT1_DIVCHACK_SHIFT 5 985#define OMAP4430_HSDIVIDER_CLKOUT1_DIVCHACK_SHIFT 5
986#define OMAP4430_HSDIVIDER_CLKOUT1_DIVCHACK_WIDTH 0x1
815#define OMAP4430_HSDIVIDER_CLKOUT1_DIVCHACK_MASK (1 << 5) 987#define OMAP4430_HSDIVIDER_CLKOUT1_DIVCHACK_MASK (1 << 5)
816 988
817/* 989/*
@@ -819,6 +991,7 @@
819 * CM_DIV_M4_DPLL_PER 991 * CM_DIV_M4_DPLL_PER
820 */ 992 */
821#define OMAP4430_HSDIVIDER_CLKOUT1_GATE_CTRL_SHIFT 8 993#define OMAP4430_HSDIVIDER_CLKOUT1_GATE_CTRL_SHIFT 8
994#define OMAP4430_HSDIVIDER_CLKOUT1_GATE_CTRL_WIDTH 0x1
822#define OMAP4430_HSDIVIDER_CLKOUT1_GATE_CTRL_MASK (1 << 8) 995#define OMAP4430_HSDIVIDER_CLKOUT1_GATE_CTRL_MASK (1 << 8)
823 996
824/* 997/*
@@ -826,6 +999,7 @@
826 * CM_DIV_M4_DPLL_PER 999 * CM_DIV_M4_DPLL_PER
827 */ 1000 */
828#define OMAP4430_HSDIVIDER_CLKOUT1_PWDN_SHIFT 12 1001#define OMAP4430_HSDIVIDER_CLKOUT1_PWDN_SHIFT 12
1002#define OMAP4430_HSDIVIDER_CLKOUT1_PWDN_WIDTH 0x1
829#define OMAP4430_HSDIVIDER_CLKOUT1_PWDN_MASK (1 << 12) 1003#define OMAP4430_HSDIVIDER_CLKOUT1_PWDN_MASK (1 << 12)
830 1004
831/* 1005/*
@@ -833,6 +1007,7 @@
833 * CM_DIV_M5_DPLL_PER 1007 * CM_DIV_M5_DPLL_PER
834 */ 1008 */
835#define OMAP4430_HSDIVIDER_CLKOUT2_DIV_SHIFT 0 1009#define OMAP4430_HSDIVIDER_CLKOUT2_DIV_SHIFT 0
1010#define OMAP4430_HSDIVIDER_CLKOUT2_DIV_WIDTH 0x5
836#define OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK (0x1f << 0) 1011#define OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK (0x1f << 0)
837 1012
838/* 1013/*
@@ -840,6 +1015,7 @@
840 * CM_DIV_M5_DPLL_PER 1015 * CM_DIV_M5_DPLL_PER
841 */ 1016 */
842#define OMAP4430_HSDIVIDER_CLKOUT2_DIVCHACK_SHIFT 5 1017#define OMAP4430_HSDIVIDER_CLKOUT2_DIVCHACK_SHIFT 5
1018#define OMAP4430_HSDIVIDER_CLKOUT2_DIVCHACK_WIDTH 0x1
843#define OMAP4430_HSDIVIDER_CLKOUT2_DIVCHACK_MASK (1 << 5) 1019#define OMAP4430_HSDIVIDER_CLKOUT2_DIVCHACK_MASK (1 << 5)
844 1020
845/* 1021/*
@@ -847,6 +1023,7 @@
847 * CM_DIV_M5_DPLL_PER 1023 * CM_DIV_M5_DPLL_PER
848 */ 1024 */
849#define OMAP4430_HSDIVIDER_CLKOUT2_GATE_CTRL_SHIFT 8 1025#define OMAP4430_HSDIVIDER_CLKOUT2_GATE_CTRL_SHIFT 8
1026#define OMAP4430_HSDIVIDER_CLKOUT2_GATE_CTRL_WIDTH 0x1
850#define OMAP4430_HSDIVIDER_CLKOUT2_GATE_CTRL_MASK (1 << 8) 1027#define OMAP4430_HSDIVIDER_CLKOUT2_GATE_CTRL_MASK (1 << 8)
851 1028
852/* 1029/*
@@ -854,38 +1031,47 @@
854 * CM_DIV_M5_DPLL_PER 1031 * CM_DIV_M5_DPLL_PER
855 */ 1032 */
856#define OMAP4430_HSDIVIDER_CLKOUT2_PWDN_SHIFT 12 1033#define OMAP4430_HSDIVIDER_CLKOUT2_PWDN_SHIFT 12
1034#define OMAP4430_HSDIVIDER_CLKOUT2_PWDN_WIDTH 0x1
857#define OMAP4430_HSDIVIDER_CLKOUT2_PWDN_MASK (1 << 12) 1035#define OMAP4430_HSDIVIDER_CLKOUT2_PWDN_MASK (1 << 12)
858 1036
859/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */ 1037/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */
860#define OMAP4430_HSDIVIDER_CLKOUT3_DIV_SHIFT 0 1038#define OMAP4430_HSDIVIDER_CLKOUT3_DIV_SHIFT 0
1039#define OMAP4430_HSDIVIDER_CLKOUT3_DIV_WIDTH 0x5
861#define OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK (0x1f << 0) 1040#define OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK (0x1f << 0)
862 1041
863/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */ 1042/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */
864#define OMAP4430_HSDIVIDER_CLKOUT3_DIVCHACK_SHIFT 5 1043#define OMAP4430_HSDIVIDER_CLKOUT3_DIVCHACK_SHIFT 5
1044#define OMAP4430_HSDIVIDER_CLKOUT3_DIVCHACK_WIDTH 0x1
865#define OMAP4430_HSDIVIDER_CLKOUT3_DIVCHACK_MASK (1 << 5) 1045#define OMAP4430_HSDIVIDER_CLKOUT3_DIVCHACK_MASK (1 << 5)
866 1046
867/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */ 1047/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */
868#define OMAP4430_HSDIVIDER_CLKOUT3_GATE_CTRL_SHIFT 8 1048#define OMAP4430_HSDIVIDER_CLKOUT3_GATE_CTRL_SHIFT 8
1049#define OMAP4430_HSDIVIDER_CLKOUT3_GATE_CTRL_WIDTH 0x1
869#define OMAP4430_HSDIVIDER_CLKOUT3_GATE_CTRL_MASK (1 << 8) 1050#define OMAP4430_HSDIVIDER_CLKOUT3_GATE_CTRL_MASK (1 << 8)
870 1051
871/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */ 1052/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */
872#define OMAP4430_HSDIVIDER_CLKOUT3_PWDN_SHIFT 12 1053#define OMAP4430_HSDIVIDER_CLKOUT3_PWDN_SHIFT 12
1054#define OMAP4430_HSDIVIDER_CLKOUT3_PWDN_WIDTH 0x1
873#define OMAP4430_HSDIVIDER_CLKOUT3_PWDN_MASK (1 << 12) 1055#define OMAP4430_HSDIVIDER_CLKOUT3_PWDN_MASK (1 << 12)
874 1056
875/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */ 1057/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */
876#define OMAP4430_HSDIVIDER_CLKOUT4_DIV_SHIFT 0 1058#define OMAP4430_HSDIVIDER_CLKOUT4_DIV_SHIFT 0
1059#define OMAP4430_HSDIVIDER_CLKOUT4_DIV_WIDTH 0x5
877#define OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK (0x1f << 0) 1060#define OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK (0x1f << 0)
878 1061
879/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */ 1062/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */
880#define OMAP4430_HSDIVIDER_CLKOUT4_DIVCHACK_SHIFT 5 1063#define OMAP4430_HSDIVIDER_CLKOUT4_DIVCHACK_SHIFT 5
1064#define OMAP4430_HSDIVIDER_CLKOUT4_DIVCHACK_WIDTH 0x1
881#define OMAP4430_HSDIVIDER_CLKOUT4_DIVCHACK_MASK (1 << 5) 1065#define OMAP4430_HSDIVIDER_CLKOUT4_DIVCHACK_MASK (1 << 5)
882 1066
883/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */ 1067/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */
884#define OMAP4430_HSDIVIDER_CLKOUT4_GATE_CTRL_SHIFT 8 1068#define OMAP4430_HSDIVIDER_CLKOUT4_GATE_CTRL_SHIFT 8
1069#define OMAP4430_HSDIVIDER_CLKOUT4_GATE_CTRL_WIDTH 0x1
885#define OMAP4430_HSDIVIDER_CLKOUT4_GATE_CTRL_MASK (1 << 8) 1070#define OMAP4430_HSDIVIDER_CLKOUT4_GATE_CTRL_MASK (1 << 8)
886 1071
887/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */ 1072/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */
888#define OMAP4430_HSDIVIDER_CLKOUT4_PWDN_SHIFT 12 1073#define OMAP4430_HSDIVIDER_CLKOUT4_PWDN_SHIFT 12
1074#define OMAP4430_HSDIVIDER_CLKOUT4_PWDN_WIDTH 0x1
889#define OMAP4430_HSDIVIDER_CLKOUT4_PWDN_MASK (1 << 12) 1075#define OMAP4430_HSDIVIDER_CLKOUT4_PWDN_MASK (1 << 12)
890 1076
891/* 1077/*
@@ -893,53 +1079,48 @@
893 * CM1_ABE_MCASP_CLKCTRL, CM1_ABE_MCBSP1_CLKCTRL, CM1_ABE_MCBSP2_CLKCTRL, 1079 * CM1_ABE_MCASP_CLKCTRL, CM1_ABE_MCBSP1_CLKCTRL, CM1_ABE_MCBSP2_CLKCTRL,
894 * CM1_ABE_MCBSP3_CLKCTRL, CM1_ABE_PDM_CLKCTRL, CM1_ABE_SLIMBUS_CLKCTRL, 1080 * CM1_ABE_MCBSP3_CLKCTRL, CM1_ABE_PDM_CLKCTRL, CM1_ABE_SLIMBUS_CLKCTRL,
895 * CM1_ABE_TIMER5_CLKCTRL, CM1_ABE_TIMER6_CLKCTRL, CM1_ABE_TIMER7_CLKCTRL, 1081 * CM1_ABE_TIMER5_CLKCTRL, CM1_ABE_TIMER6_CLKCTRL, CM1_ABE_TIMER7_CLKCTRL,
896 * CM1_ABE_TIMER8_CLKCTRL, CM1_ABE_WDT3_CLKCTRL, CM_ALWON_MDMINTC_CLKCTRL, 1082 * CM1_ABE_TIMER8_CLKCTRL, CM1_ABE_WDT3_CLKCTRL, CM_ALWON_SR_CORE_CLKCTRL,
897 * CM_ALWON_SR_CORE_CLKCTRL, CM_ALWON_SR_IVA_CLKCTRL, CM_ALWON_SR_MPU_CLKCTRL, 1083 * CM_ALWON_SR_IVA_CLKCTRL, CM_ALWON_SR_MPU_CLKCTRL, CM_CAM_FDIF_CLKCTRL,
898 * CM_CAM_FDIF_CLKCTRL, CM_CAM_ISS_CLKCTRL, CM_CEFUSE_CEFUSE_CLKCTRL, 1084 * CM_CAM_ISS_CLKCTRL, CM_CEFUSE_CEFUSE_CLKCTRL, CM_CM1_PROFILING_CLKCTRL,
899 * CM_CM1_PROFILING_CLKCTRL, CM_CM2_PROFILING_CLKCTRL, 1085 * CM_CM2_PROFILING_CLKCTRL, CM_D2D_MODEM_ICR_CLKCTRL, CM_D2D_SAD2D_CLKCTRL,
900 * CM_D2D_MODEM_ICR_CLKCTRL, CM_D2D_SAD2D_CLKCTRL, CM_D2D_SAD2D_FW_CLKCTRL, 1086 * CM_D2D_SAD2D_FW_CLKCTRL, CM_DSS_DSS_CLKCTRL, CM_DUCATI_DUCATI_CLKCTRL,
901 * CM_DSS_DEISS_CLKCTRL, CM_DSS_DSS_CLKCTRL, CM_DUCATI_DUCATI_CLKCTRL,
902 * CM_EMU_DEBUGSS_CLKCTRL, CM_GFX_GFX_CLKCTRL, CM_IVAHD_IVAHD_CLKCTRL, 1087 * CM_EMU_DEBUGSS_CLKCTRL, CM_GFX_GFX_CLKCTRL, CM_IVAHD_IVAHD_CLKCTRL,
903 * CM_IVAHD_SL2_CLKCTRL, CM_L3INIT_CCPTX_CLKCTRL, CM_L3INIT_EMAC_CLKCTRL, 1088 * CM_IVAHD_SL2_CLKCTRL, CM_L3INIT_HSI_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL,
904 * CM_L3INIT_HSI_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL, CM_L3INIT_MMC2_CLKCTRL, 1089 * CM_L3INIT_MMC2_CLKCTRL, CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
905 * CM_L3INIT_MMC6_CLKCTRL, CM_L3INIT_P1500_CLKCTRL, CM_L3INIT_PCIESS_CLKCTRL, 1090 * CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_FS_CLKCTRL,
906 * CM_L3INIT_SATA_CLKCTRL, CM_L3INIT_TPPSS_CLKCTRL, CM_L3INIT_UNIPRO1_CLKCTRL, 1091 * CM_L3INIT_USB_OTG_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL,
907 * CM_L3INIT_USBPHYOCP2SCP_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL, 1092 * CM_L3INSTR_L3_3_CLKCTRL, CM_L3INSTR_L3_INSTR_CLKCTRL,
908 * CM_L3INIT_USB_HOST_FS_CLKCTRL, CM_L3INIT_USB_OTG_CLKCTRL, 1093 * CM_L3INSTR_OCP_WP1_CLKCTRL, CM_L3_1_L3_1_CLKCTRL, CM_L3_2_GPMC_CLKCTRL,
909 * CM_L3INIT_USB_TLL_CLKCTRL, CM_L3INIT_XHPI_CLKCTRL, CM_L3INSTR_L3_3_CLKCTRL, 1094 * CM_L3_2_L3_2_CLKCTRL, CM_L3_2_OCMC_RAM_CLKCTRL, CM_L4CFG_HW_SEM_CLKCTRL,
910 * CM_L3INSTR_L3_INSTR_CLKCTRL, CM_L3INSTR_OCP_WP1_CLKCTRL, 1095 * CM_L4CFG_L4_CFG_CLKCTRL, CM_L4CFG_MAILBOX_CLKCTRL, CM_L4CFG_SAR_ROM_CLKCTRL,
911 * CM_L3_1_L3_1_CLKCTRL, CM_L3_2_GPMC_CLKCTRL, CM_L3_2_L3_2_CLKCTRL,
912 * CM_L3_2_OCMC_RAM_CLKCTRL, CM_L4CFG_HW_SEM_CLKCTRL, CM_L4CFG_L4_CFG_CLKCTRL,
913 * CM_L4CFG_MAILBOX_CLKCTRL, CM_L4CFG_SAR_ROM_CLKCTRL, CM_L4PER_ADC_CLKCTRL,
914 * CM_L4PER_DMTIMER10_CLKCTRL, CM_L4PER_DMTIMER11_CLKCTRL, 1096 * CM_L4PER_DMTIMER10_CLKCTRL, CM_L4PER_DMTIMER11_CLKCTRL,
915 * CM_L4PER_DMTIMER2_CLKCTRL, CM_L4PER_DMTIMER3_CLKCTRL, 1097 * CM_L4PER_DMTIMER2_CLKCTRL, CM_L4PER_DMTIMER3_CLKCTRL,
916 * CM_L4PER_DMTIMER4_CLKCTRL, CM_L4PER_DMTIMER9_CLKCTRL, CM_L4PER_ELM_CLKCTRL, 1098 * CM_L4PER_DMTIMER4_CLKCTRL, CM_L4PER_DMTIMER9_CLKCTRL, CM_L4PER_ELM_CLKCTRL,
917 * CM_L4PER_GPIO2_CLKCTRL, CM_L4PER_GPIO3_CLKCTRL, CM_L4PER_GPIO4_CLKCTRL, 1099 * CM_L4PER_GPIO2_CLKCTRL, CM_L4PER_GPIO3_CLKCTRL, CM_L4PER_GPIO4_CLKCTRL,
918 * CM_L4PER_GPIO5_CLKCTRL, CM_L4PER_GPIO6_CLKCTRL, CM_L4PER_HDQ1W_CLKCTRL, 1100 * CM_L4PER_GPIO5_CLKCTRL, CM_L4PER_GPIO6_CLKCTRL, CM_L4PER_HDQ1W_CLKCTRL,
919 * CM_L4PER_HECC1_CLKCTRL, CM_L4PER_HECC2_CLKCTRL, CM_L4PER_I2C1_CLKCTRL, 1101 * CM_L4PER_I2C1_CLKCTRL, CM_L4PER_I2C2_CLKCTRL, CM_L4PER_I2C3_CLKCTRL,
920 * CM_L4PER_I2C2_CLKCTRL, CM_L4PER_I2C3_CLKCTRL, CM_L4PER_I2C4_CLKCTRL, 1102 * CM_L4PER_I2C4_CLKCTRL, CM_L4PER_I2C5_CLKCTRL, CM_L4PER_L4PER_CLKCTRL,
921 * CM_L4PER_I2C5_CLKCTRL, CM_L4PER_L4PER_CLKCTRL, CM_L4PER_MCASP2_CLKCTRL, 1103 * CM_L4PER_MCBSP4_CLKCTRL, CM_L4PER_MCSPI1_CLKCTRL, CM_L4PER_MCSPI2_CLKCTRL,
922 * CM_L4PER_MCASP3_CLKCTRL, CM_L4PER_MCBSP4_CLKCTRL, CM_L4PER_MCSPI1_CLKCTRL, 1104 * CM_L4PER_MCSPI3_CLKCTRL, CM_L4PER_MCSPI4_CLKCTRL, CM_L4PER_MMCSD3_CLKCTRL,
923 * CM_L4PER_MCSPI2_CLKCTRL, CM_L4PER_MCSPI3_CLKCTRL, CM_L4PER_MCSPI4_CLKCTRL, 1105 * CM_L4PER_MMCSD4_CLKCTRL, CM_L4PER_MMCSD5_CLKCTRL, CM_L4PER_SLIMBUS2_CLKCTRL,
924 * CM_L4PER_MGATE_CLKCTRL, CM_L4PER_MMCSD3_CLKCTRL, CM_L4PER_MMCSD4_CLKCTRL, 1106 * CM_L4PER_UART1_CLKCTRL, CM_L4PER_UART2_CLKCTRL, CM_L4PER_UART3_CLKCTRL,
925 * CM_L4PER_MMCSD5_CLKCTRL, CM_L4PER_MSPROHG_CLKCTRL, 1107 * CM_L4PER_UART4_CLKCTRL, CM_L4SEC_AES1_CLKCTRL, CM_L4SEC_AES2_CLKCTRL,
926 * CM_L4PER_SLIMBUS2_CLKCTRL, CM_L4PER_UART1_CLKCTRL, CM_L4PER_UART2_CLKCTRL, 1108 * CM_L4SEC_CRYPTODMA_CLKCTRL, CM_L4SEC_DES3DES_CLKCTRL,
927 * CM_L4PER_UART3_CLKCTRL, CM_L4PER_UART4_CLKCTRL, CM_L4SEC_AES1_CLKCTRL,
928 * CM_L4SEC_AES2_CLKCTRL, CM_L4SEC_CRYPTODMA_CLKCTRL, CM_L4SEC_DES3DES_CLKCTRL,
929 * CM_L4SEC_PKAEIP29_CLKCTRL, CM_L4SEC_RNG_CLKCTRL, CM_L4SEC_SHA2MD51_CLKCTRL, 1109 * CM_L4SEC_PKAEIP29_CLKCTRL, CM_L4SEC_RNG_CLKCTRL, CM_L4SEC_SHA2MD51_CLKCTRL,
930 * CM_MEMIF_DMM_CLKCTRL, CM_MEMIF_EMIF_1_CLKCTRL, CM_MEMIF_EMIF_2_CLKCTRL, 1110 * CM_MEMIF_DMM_CLKCTRL, CM_MEMIF_EMIF_1_CLKCTRL, CM_MEMIF_EMIF_2_CLKCTRL,
931 * CM_MEMIF_EMIF_FW_CLKCTRL, CM_MEMIF_EMIF_H1_CLKCTRL, 1111 * CM_MEMIF_EMIF_FW_CLKCTRL, CM_MPU_MPU_CLKCTRL, CM_SDMA_SDMA_CLKCTRL,
932 * CM_MEMIF_EMIF_H2_CLKCTRL, CM_MPU_MPU_CLKCTRL, CM_SDMA_SDMA_CLKCTRL,
933 * CM_TESLA_TESLA_CLKCTRL, CM_WKUP_GPIO1_CLKCTRL, CM_WKUP_KEYBOARD_CLKCTRL, 1112 * CM_TESLA_TESLA_CLKCTRL, CM_WKUP_GPIO1_CLKCTRL, CM_WKUP_KEYBOARD_CLKCTRL,
934 * CM_WKUP_L4WKUP_CLKCTRL, CM_WKUP_RTC_CLKCTRL, CM_WKUP_SARRAM_CLKCTRL, 1113 * CM_WKUP_L4WKUP_CLKCTRL, CM_WKUP_SARRAM_CLKCTRL, CM_WKUP_SYNCTIMER_CLKCTRL,
935 * CM_WKUP_SYNCTIMER_CLKCTRL, CM_WKUP_TIMER12_CLKCTRL, CM_WKUP_TIMER1_CLKCTRL, 1114 * CM_WKUP_TIMER12_CLKCTRL, CM_WKUP_TIMER1_CLKCTRL, CM_WKUP_USIM_CLKCTRL,
936 * CM_WKUP_USIM_CLKCTRL, CM_WKUP_WDT1_CLKCTRL, CM_WKUP_WDT2_CLKCTRL 1115 * CM_WKUP_WDT1_CLKCTRL, CM_WKUP_WDT2_CLKCTRL
937 */ 1116 */
938#define OMAP4430_IDLEST_SHIFT 16 1117#define OMAP4430_IDLEST_SHIFT 16
1118#define OMAP4430_IDLEST_WIDTH 0x2
939#define OMAP4430_IDLEST_MASK (0x3 << 16) 1119#define OMAP4430_IDLEST_MASK (0x3 << 16)
940 1120
941/* Used by CM_DUCATI_DYNAMICDEP, CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */ 1121/* Used by CM_DUCATI_DYNAMICDEP, CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */
942#define OMAP4430_ISS_DYNDEP_SHIFT 9 1122#define OMAP4430_ISS_DYNDEP_SHIFT 9
1123#define OMAP4430_ISS_DYNDEP_WIDTH 0x1
943#define OMAP4430_ISS_DYNDEP_MASK (1 << 9) 1124#define OMAP4430_ISS_DYNDEP_MASK (1 << 9)
944 1125
945/* 1126/*
@@ -947,10 +1128,12 @@
947 * CM_TESLA_STATICDEP 1128 * CM_TESLA_STATICDEP
948 */ 1129 */
949#define OMAP4430_ISS_STATDEP_SHIFT 9 1130#define OMAP4430_ISS_STATDEP_SHIFT 9
1131#define OMAP4430_ISS_STATDEP_WIDTH 0x1
950#define OMAP4430_ISS_STATDEP_MASK (1 << 9) 1132#define OMAP4430_ISS_STATDEP_MASK (1 << 9)
951 1133
952/* Used by CM_L3_2_DYNAMICDEP, CM_TESLA_DYNAMICDEP */ 1134/* Used by CM_L3_2_DYNAMICDEP, CM_TESLA_DYNAMICDEP */
953#define OMAP4430_IVAHD_DYNDEP_SHIFT 2 1135#define OMAP4430_IVAHD_DYNDEP_SHIFT 2
1136#define OMAP4430_IVAHD_DYNDEP_WIDTH 0x1
954#define OMAP4430_IVAHD_DYNDEP_MASK (1 << 2) 1137#define OMAP4430_IVAHD_DYNDEP_MASK (1 << 2)
955 1138
956/* 1139/*
@@ -959,10 +1142,12 @@
959 * CM_MPU_STATICDEP, CM_SDMA_STATICDEP, CM_TESLA_STATICDEP 1142 * CM_MPU_STATICDEP, CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
960 */ 1143 */
961#define OMAP4430_IVAHD_STATDEP_SHIFT 2 1144#define OMAP4430_IVAHD_STATDEP_SHIFT 2
1145#define OMAP4430_IVAHD_STATDEP_WIDTH 0x1
962#define OMAP4430_IVAHD_STATDEP_MASK (1 << 2) 1146#define OMAP4430_IVAHD_STATDEP_MASK (1 << 2)
963 1147
964/* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_L4PER_DYNAMICDEP */ 1148/* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_L4PER_DYNAMICDEP */
965#define OMAP4430_L3INIT_DYNDEP_SHIFT 7 1149#define OMAP4430_L3INIT_DYNDEP_SHIFT 7
1150#define OMAP4430_L3INIT_DYNDEP_WIDTH 0x1
966#define OMAP4430_L3INIT_DYNDEP_MASK (1 << 7) 1151#define OMAP4430_L3INIT_DYNDEP_MASK (1 << 7)
967 1152
968/* 1153/*
@@ -970,6 +1155,7 @@
970 * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP 1155 * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
971 */ 1156 */
972#define OMAP4430_L3INIT_STATDEP_SHIFT 7 1157#define OMAP4430_L3INIT_STATDEP_SHIFT 7
1158#define OMAP4430_L3INIT_STATDEP_WIDTH 0x1
973#define OMAP4430_L3INIT_STATDEP_MASK (1 << 7) 1159#define OMAP4430_L3INIT_STATDEP_MASK (1 << 7)
974 1160
975/* 1161/*
@@ -977,6 +1163,7 @@
977 * CM_L4CFG_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP 1163 * CM_L4CFG_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP
978 */ 1164 */
979#define OMAP4430_L3_1_DYNDEP_SHIFT 5 1165#define OMAP4430_L3_1_DYNDEP_SHIFT 5
1166#define OMAP4430_L3_1_DYNDEP_WIDTH 0x1
980#define OMAP4430_L3_1_DYNDEP_MASK (1 << 5) 1167#define OMAP4430_L3_1_DYNDEP_MASK (1 << 5)
981 1168
982/* 1169/*
@@ -986,6 +1173,7 @@
986 * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP 1173 * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
987 */ 1174 */
988#define OMAP4430_L3_1_STATDEP_SHIFT 5 1175#define OMAP4430_L3_1_STATDEP_SHIFT 5
1176#define OMAP4430_L3_1_STATDEP_WIDTH 0x1
989#define OMAP4430_L3_1_STATDEP_MASK (1 << 5) 1177#define OMAP4430_L3_1_STATDEP_MASK (1 << 5)
990 1178
991/* 1179/*
@@ -995,6 +1183,7 @@
995 * CM_L4SEC_DYNAMICDEP, CM_SDMA_DYNAMICDEP 1183 * CM_L4SEC_DYNAMICDEP, CM_SDMA_DYNAMICDEP
996 */ 1184 */
997#define OMAP4430_L3_2_DYNDEP_SHIFT 6 1185#define OMAP4430_L3_2_DYNDEP_SHIFT 6
1186#define OMAP4430_L3_2_DYNDEP_WIDTH 0x1
998#define OMAP4430_L3_2_DYNDEP_MASK (1 << 6) 1187#define OMAP4430_L3_2_DYNDEP_MASK (1 << 6)
999 1188
1000/* 1189/*
@@ -1004,10 +1193,12 @@
1004 * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP 1193 * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
1005 */ 1194 */
1006#define OMAP4430_L3_2_STATDEP_SHIFT 6 1195#define OMAP4430_L3_2_STATDEP_SHIFT 6
1196#define OMAP4430_L3_2_STATDEP_WIDTH 0x1
1007#define OMAP4430_L3_2_STATDEP_MASK (1 << 6) 1197#define OMAP4430_L3_2_STATDEP_MASK (1 << 6)
1008 1198
1009/* Used by CM_L3_1_DYNAMICDEP */ 1199/* Used by CM_L3_1_DYNAMICDEP */
1010#define OMAP4430_L4CFG_DYNDEP_SHIFT 12 1200#define OMAP4430_L4CFG_DYNDEP_SHIFT 12
1201#define OMAP4430_L4CFG_DYNDEP_WIDTH 0x1
1011#define OMAP4430_L4CFG_DYNDEP_MASK (1 << 12) 1202#define OMAP4430_L4CFG_DYNDEP_MASK (1 << 12)
1012 1203
1013/* 1204/*
@@ -1015,10 +1206,12 @@
1015 * CM_MPU_STATICDEP, CM_SDMA_STATICDEP, CM_TESLA_STATICDEP 1206 * CM_MPU_STATICDEP, CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
1016 */ 1207 */
1017#define OMAP4430_L4CFG_STATDEP_SHIFT 12 1208#define OMAP4430_L4CFG_STATDEP_SHIFT 12
1209#define OMAP4430_L4CFG_STATDEP_WIDTH 0x1
1018#define OMAP4430_L4CFG_STATDEP_MASK (1 << 12) 1210#define OMAP4430_L4CFG_STATDEP_MASK (1 << 12)
1019 1211
1020/* Used by CM_L3_2_DYNAMICDEP */ 1212/* Used by CM_L3_2_DYNAMICDEP */
1021#define OMAP4430_L4PER_DYNDEP_SHIFT 13 1213#define OMAP4430_L4PER_DYNDEP_SHIFT 13
1214#define OMAP4430_L4PER_DYNDEP_WIDTH 0x1
1022#define OMAP4430_L4PER_DYNDEP_MASK (1 << 13) 1215#define OMAP4430_L4PER_DYNDEP_MASK (1 << 13)
1023 1216
1024/* 1217/*
@@ -1026,10 +1219,12 @@
1026 * CM_L4SEC_STATICDEP, CM_MPU_STATICDEP, CM_SDMA_STATICDEP, CM_TESLA_STATICDEP 1219 * CM_L4SEC_STATICDEP, CM_MPU_STATICDEP, CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
1027 */ 1220 */
1028#define OMAP4430_L4PER_STATDEP_SHIFT 13 1221#define OMAP4430_L4PER_STATDEP_SHIFT 13
1222#define OMAP4430_L4PER_STATDEP_WIDTH 0x1
1029#define OMAP4430_L4PER_STATDEP_MASK (1 << 13) 1223#define OMAP4430_L4PER_STATDEP_MASK (1 << 13)
1030 1224
1031/* Used by CM_L3_2_DYNAMICDEP, CM_L4PER_DYNAMICDEP */ 1225/* Used by CM_L3_2_DYNAMICDEP, CM_L4PER_DYNAMICDEP */
1032#define OMAP4430_L4SEC_DYNDEP_SHIFT 14 1226#define OMAP4430_L4SEC_DYNDEP_SHIFT 14
1227#define OMAP4430_L4SEC_DYNDEP_WIDTH 0x1
1033#define OMAP4430_L4SEC_DYNDEP_MASK (1 << 14) 1228#define OMAP4430_L4SEC_DYNDEP_MASK (1 << 14)
1034 1229
1035/* 1230/*
@@ -1037,10 +1232,12 @@
1037 * CM_SDMA_STATICDEP 1232 * CM_SDMA_STATICDEP
1038 */ 1233 */
1039#define OMAP4430_L4SEC_STATDEP_SHIFT 14 1234#define OMAP4430_L4SEC_STATDEP_SHIFT 14
1235#define OMAP4430_L4SEC_STATDEP_WIDTH 0x1
1040#define OMAP4430_L4SEC_STATDEP_MASK (1 << 14) 1236#define OMAP4430_L4SEC_STATDEP_MASK (1 << 14)
1041 1237
1042/* Used by CM_L4CFG_DYNAMICDEP */ 1238/* Used by CM_L4CFG_DYNAMICDEP */
1043#define OMAP4430_L4WKUP_DYNDEP_SHIFT 15 1239#define OMAP4430_L4WKUP_DYNDEP_SHIFT 15
1240#define OMAP4430_L4WKUP_DYNDEP_WIDTH 0x1
1044#define OMAP4430_L4WKUP_DYNDEP_MASK (1 << 15) 1241#define OMAP4430_L4WKUP_DYNDEP_MASK (1 << 15)
1045 1242
1046/* 1243/*
@@ -1048,6 +1245,7 @@
1048 * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP 1245 * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
1049 */ 1246 */
1050#define OMAP4430_L4WKUP_STATDEP_SHIFT 15 1247#define OMAP4430_L4WKUP_STATDEP_SHIFT 15
1248#define OMAP4430_L4WKUP_STATDEP_WIDTH 0x1
1051#define OMAP4430_L4WKUP_STATDEP_MASK (1 << 15) 1249#define OMAP4430_L4WKUP_STATDEP_MASK (1 << 15)
1052 1250
1053/* 1251/*
@@ -1055,6 +1253,7 @@
1055 * CM_MPU_DYNAMICDEP 1253 * CM_MPU_DYNAMICDEP
1056 */ 1254 */
1057#define OMAP4430_MEMIF_DYNDEP_SHIFT 4 1255#define OMAP4430_MEMIF_DYNDEP_SHIFT 4
1256#define OMAP4430_MEMIF_DYNDEP_WIDTH 0x1
1058#define OMAP4430_MEMIF_DYNDEP_MASK (1 << 4) 1257#define OMAP4430_MEMIF_DYNDEP_MASK (1 << 4)
1059 1258
1060/* 1259/*
@@ -1064,6 +1263,7 @@
1064 * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP 1263 * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
1065 */ 1264 */
1066#define OMAP4430_MEMIF_STATDEP_SHIFT 4 1265#define OMAP4430_MEMIF_STATDEP_SHIFT 4
1266#define OMAP4430_MEMIF_STATDEP_WIDTH 0x1
1067#define OMAP4430_MEMIF_STATDEP_MASK (1 << 4) 1267#define OMAP4430_MEMIF_STATDEP_MASK (1 << 4)
1068 1268
1069/* 1269/*
@@ -1073,6 +1273,7 @@
1073 * CM_SSC_MODFREQDIV_DPLL_UNIPRO, CM_SSC_MODFREQDIV_DPLL_USB 1273 * CM_SSC_MODFREQDIV_DPLL_UNIPRO, CM_SSC_MODFREQDIV_DPLL_USB
1074 */ 1274 */
1075#define OMAP4430_MODFREQDIV_EXPONENT_SHIFT 8 1275#define OMAP4430_MODFREQDIV_EXPONENT_SHIFT 8
1276#define OMAP4430_MODFREQDIV_EXPONENT_WIDTH 0x3
1076#define OMAP4430_MODFREQDIV_EXPONENT_MASK (0x7 << 8) 1277#define OMAP4430_MODFREQDIV_EXPONENT_MASK (0x7 << 8)
1077 1278
1078/* 1279/*
@@ -1082,6 +1283,7 @@
1082 * CM_SSC_MODFREQDIV_DPLL_UNIPRO, CM_SSC_MODFREQDIV_DPLL_USB 1283 * CM_SSC_MODFREQDIV_DPLL_UNIPRO, CM_SSC_MODFREQDIV_DPLL_USB
1083 */ 1284 */
1084#define OMAP4430_MODFREQDIV_MANTISSA_SHIFT 0 1285#define OMAP4430_MODFREQDIV_MANTISSA_SHIFT 0
1286#define OMAP4430_MODFREQDIV_MANTISSA_WIDTH 0x7
1085#define OMAP4430_MODFREQDIV_MANTISSA_MASK (0x7f << 0) 1287#define OMAP4430_MODFREQDIV_MANTISSA_MASK (0x7f << 0)
1086 1288
1087/* 1289/*
@@ -1089,69 +1291,68 @@
1089 * CM1_ABE_MCASP_CLKCTRL, CM1_ABE_MCBSP1_CLKCTRL, CM1_ABE_MCBSP2_CLKCTRL, 1291 * CM1_ABE_MCASP_CLKCTRL, CM1_ABE_MCBSP1_CLKCTRL, CM1_ABE_MCBSP2_CLKCTRL,
1090 * CM1_ABE_MCBSP3_CLKCTRL, CM1_ABE_PDM_CLKCTRL, CM1_ABE_SLIMBUS_CLKCTRL, 1292 * CM1_ABE_MCBSP3_CLKCTRL, CM1_ABE_PDM_CLKCTRL, CM1_ABE_SLIMBUS_CLKCTRL,
1091 * CM1_ABE_TIMER5_CLKCTRL, CM1_ABE_TIMER6_CLKCTRL, CM1_ABE_TIMER7_CLKCTRL, 1293 * CM1_ABE_TIMER5_CLKCTRL, CM1_ABE_TIMER6_CLKCTRL, CM1_ABE_TIMER7_CLKCTRL,
1092 * CM1_ABE_TIMER8_CLKCTRL, CM1_ABE_WDT3_CLKCTRL, CM_ALWON_MDMINTC_CLKCTRL, 1294 * CM1_ABE_TIMER8_CLKCTRL, CM1_ABE_WDT3_CLKCTRL, CM_ALWON_SR_CORE_CLKCTRL,
1093 * CM_ALWON_SR_CORE_CLKCTRL, CM_ALWON_SR_IVA_CLKCTRL, CM_ALWON_SR_MPU_CLKCTRL, 1295 * CM_ALWON_SR_IVA_CLKCTRL, CM_ALWON_SR_MPU_CLKCTRL, CM_CAM_FDIF_CLKCTRL,
1094 * CM_CAM_FDIF_CLKCTRL, CM_CAM_ISS_CLKCTRL, CM_CEFUSE_CEFUSE_CLKCTRL, 1296 * CM_CAM_ISS_CLKCTRL, CM_CEFUSE_CEFUSE_CLKCTRL, CM_CM1_PROFILING_CLKCTRL,
1095 * CM_CM1_PROFILING_CLKCTRL, CM_CM2_PROFILING_CLKCTRL, 1297 * CM_CM2_PROFILING_CLKCTRL, CM_D2D_MODEM_ICR_CLKCTRL, CM_D2D_SAD2D_CLKCTRL,
1096 * CM_D2D_MODEM_ICR_CLKCTRL, CM_D2D_SAD2D_CLKCTRL, CM_D2D_SAD2D_FW_CLKCTRL, 1298 * CM_D2D_SAD2D_FW_CLKCTRL, CM_DSS_DSS_CLKCTRL, CM_DUCATI_DUCATI_CLKCTRL,
1097 * CM_DSS_DEISS_CLKCTRL, CM_DSS_DSS_CLKCTRL, CM_DUCATI_DUCATI_CLKCTRL,
1098 * CM_EMU_DEBUGSS_CLKCTRL, CM_GFX_GFX_CLKCTRL, CM_IVAHD_IVAHD_CLKCTRL, 1299 * CM_EMU_DEBUGSS_CLKCTRL, CM_GFX_GFX_CLKCTRL, CM_IVAHD_IVAHD_CLKCTRL,
1099 * CM_IVAHD_SL2_CLKCTRL, CM_L3INIT_CCPTX_CLKCTRL, CM_L3INIT_EMAC_CLKCTRL, 1300 * CM_IVAHD_SL2_CLKCTRL, CM_L3INIT_HSI_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL,
1100 * CM_L3INIT_HSI_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL, CM_L3INIT_MMC2_CLKCTRL, 1301 * CM_L3INIT_MMC2_CLKCTRL, CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
1101 * CM_L3INIT_MMC6_CLKCTRL, CM_L3INIT_P1500_CLKCTRL, CM_L3INIT_PCIESS_CLKCTRL, 1302 * CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_FS_CLKCTRL,
1102 * CM_L3INIT_SATA_CLKCTRL, CM_L3INIT_TPPSS_CLKCTRL, CM_L3INIT_UNIPRO1_CLKCTRL, 1303 * CM_L3INIT_USB_OTG_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL,
1103 * CM_L3INIT_USBPHYOCP2SCP_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL, 1304 * CM_L3INSTR_L3_3_CLKCTRL, CM_L3INSTR_L3_INSTR_CLKCTRL,
1104 * CM_L3INIT_USB_HOST_FS_CLKCTRL, CM_L3INIT_USB_OTG_CLKCTRL, 1305 * CM_L3INSTR_OCP_WP1_CLKCTRL, CM_L3_1_L3_1_CLKCTRL, CM_L3_2_GPMC_CLKCTRL,
1105 * CM_L3INIT_USB_TLL_CLKCTRL, CM_L3INIT_XHPI_CLKCTRL, CM_L3INSTR_L3_3_CLKCTRL, 1306 * CM_L3_2_L3_2_CLKCTRL, CM_L3_2_OCMC_RAM_CLKCTRL, CM_L4CFG_HW_SEM_CLKCTRL,
1106 * CM_L3INSTR_L3_INSTR_CLKCTRL, CM_L3INSTR_OCP_WP1_CLKCTRL, 1307 * CM_L4CFG_L4_CFG_CLKCTRL, CM_L4CFG_MAILBOX_CLKCTRL, CM_L4CFG_SAR_ROM_CLKCTRL,
1107 * CM_L3_1_L3_1_CLKCTRL, CM_L3_2_GPMC_CLKCTRL, CM_L3_2_L3_2_CLKCTRL,
1108 * CM_L3_2_OCMC_RAM_CLKCTRL, CM_L4CFG_HW_SEM_CLKCTRL, CM_L4CFG_L4_CFG_CLKCTRL,
1109 * CM_L4CFG_MAILBOX_CLKCTRL, CM_L4CFG_SAR_ROM_CLKCTRL, CM_L4PER_ADC_CLKCTRL,
1110 * CM_L4PER_DMTIMER10_CLKCTRL, CM_L4PER_DMTIMER11_CLKCTRL, 1308 * CM_L4PER_DMTIMER10_CLKCTRL, CM_L4PER_DMTIMER11_CLKCTRL,
1111 * CM_L4PER_DMTIMER2_CLKCTRL, CM_L4PER_DMTIMER3_CLKCTRL, 1309 * CM_L4PER_DMTIMER2_CLKCTRL, CM_L4PER_DMTIMER3_CLKCTRL,
1112 * CM_L4PER_DMTIMER4_CLKCTRL, CM_L4PER_DMTIMER9_CLKCTRL, CM_L4PER_ELM_CLKCTRL, 1310 * CM_L4PER_DMTIMER4_CLKCTRL, CM_L4PER_DMTIMER9_CLKCTRL, CM_L4PER_ELM_CLKCTRL,
1113 * CM_L4PER_GPIO2_CLKCTRL, CM_L4PER_GPIO3_CLKCTRL, CM_L4PER_GPIO4_CLKCTRL, 1311 * CM_L4PER_GPIO2_CLKCTRL, CM_L4PER_GPIO3_CLKCTRL, CM_L4PER_GPIO4_CLKCTRL,
1114 * CM_L4PER_GPIO5_CLKCTRL, CM_L4PER_GPIO6_CLKCTRL, CM_L4PER_HDQ1W_CLKCTRL, 1312 * CM_L4PER_GPIO5_CLKCTRL, CM_L4PER_GPIO6_CLKCTRL, CM_L4PER_HDQ1W_CLKCTRL,
1115 * CM_L4PER_HECC1_CLKCTRL, CM_L4PER_HECC2_CLKCTRL, CM_L4PER_I2C1_CLKCTRL, 1313 * CM_L4PER_I2C1_CLKCTRL, CM_L4PER_I2C2_CLKCTRL, CM_L4PER_I2C3_CLKCTRL,
1116 * CM_L4PER_I2C2_CLKCTRL, CM_L4PER_I2C3_CLKCTRL, CM_L4PER_I2C4_CLKCTRL, 1314 * CM_L4PER_I2C4_CLKCTRL, CM_L4PER_I2C5_CLKCTRL, CM_L4PER_L4PER_CLKCTRL,
1117 * CM_L4PER_I2C5_CLKCTRL, CM_L4PER_L4PER_CLKCTRL, CM_L4PER_MCASP2_CLKCTRL, 1315 * CM_L4PER_MCBSP4_CLKCTRL, CM_L4PER_MCSPI1_CLKCTRL, CM_L4PER_MCSPI2_CLKCTRL,
1118 * CM_L4PER_MCASP3_CLKCTRL, CM_L4PER_MCBSP4_CLKCTRL, CM_L4PER_MCSPI1_CLKCTRL, 1316 * CM_L4PER_MCSPI3_CLKCTRL, CM_L4PER_MCSPI4_CLKCTRL, CM_L4PER_MMCSD3_CLKCTRL,
1119 * CM_L4PER_MCSPI2_CLKCTRL, CM_L4PER_MCSPI3_CLKCTRL, CM_L4PER_MCSPI4_CLKCTRL, 1317 * CM_L4PER_MMCSD4_CLKCTRL, CM_L4PER_MMCSD5_CLKCTRL, CM_L4PER_SLIMBUS2_CLKCTRL,
1120 * CM_L4PER_MGATE_CLKCTRL, CM_L4PER_MMCSD3_CLKCTRL, CM_L4PER_MMCSD4_CLKCTRL, 1318 * CM_L4PER_UART1_CLKCTRL, CM_L4PER_UART2_CLKCTRL, CM_L4PER_UART3_CLKCTRL,
1121 * CM_L4PER_MMCSD5_CLKCTRL, CM_L4PER_MSPROHG_CLKCTRL, 1319 * CM_L4PER_UART4_CLKCTRL, CM_L4SEC_AES1_CLKCTRL, CM_L4SEC_AES2_CLKCTRL,
1122 * CM_L4PER_SLIMBUS2_CLKCTRL, CM_L4PER_UART1_CLKCTRL, CM_L4PER_UART2_CLKCTRL, 1320 * CM_L4SEC_CRYPTODMA_CLKCTRL, CM_L4SEC_DES3DES_CLKCTRL,
1123 * CM_L4PER_UART3_CLKCTRL, CM_L4PER_UART4_CLKCTRL, CM_L4SEC_AES1_CLKCTRL,
1124 * CM_L4SEC_AES2_CLKCTRL, CM_L4SEC_CRYPTODMA_CLKCTRL, CM_L4SEC_DES3DES_CLKCTRL,
1125 * CM_L4SEC_PKAEIP29_CLKCTRL, CM_L4SEC_RNG_CLKCTRL, CM_L4SEC_SHA2MD51_CLKCTRL, 1321 * CM_L4SEC_PKAEIP29_CLKCTRL, CM_L4SEC_RNG_CLKCTRL, CM_L4SEC_SHA2MD51_CLKCTRL,
1126 * CM_MEMIF_DMM_CLKCTRL, CM_MEMIF_EMIF_1_CLKCTRL, CM_MEMIF_EMIF_2_CLKCTRL, 1322 * CM_MEMIF_DMM_CLKCTRL, CM_MEMIF_EMIF_1_CLKCTRL, CM_MEMIF_EMIF_2_CLKCTRL,
1127 * CM_MEMIF_EMIF_FW_CLKCTRL, CM_MEMIF_EMIF_H1_CLKCTRL, 1323 * CM_MEMIF_EMIF_FW_CLKCTRL, CM_MPU_MPU_CLKCTRL, CM_SDMA_SDMA_CLKCTRL,
1128 * CM_MEMIF_EMIF_H2_CLKCTRL, CM_MPU_MPU_CLKCTRL, CM_SDMA_SDMA_CLKCTRL,
1129 * CM_TESLA_TESLA_CLKCTRL, CM_WKUP_GPIO1_CLKCTRL, CM_WKUP_KEYBOARD_CLKCTRL, 1324 * CM_TESLA_TESLA_CLKCTRL, CM_WKUP_GPIO1_CLKCTRL, CM_WKUP_KEYBOARD_CLKCTRL,
1130 * CM_WKUP_L4WKUP_CLKCTRL, CM_WKUP_RTC_CLKCTRL, CM_WKUP_SARRAM_CLKCTRL, 1325 * CM_WKUP_L4WKUP_CLKCTRL, CM_WKUP_SARRAM_CLKCTRL, CM_WKUP_SYNCTIMER_CLKCTRL,
1131 * CM_WKUP_SYNCTIMER_CLKCTRL, CM_WKUP_TIMER12_CLKCTRL, CM_WKUP_TIMER1_CLKCTRL, 1326 * CM_WKUP_TIMER12_CLKCTRL, CM_WKUP_TIMER1_CLKCTRL, CM_WKUP_USIM_CLKCTRL,
1132 * CM_WKUP_USIM_CLKCTRL, CM_WKUP_WDT1_CLKCTRL, CM_WKUP_WDT2_CLKCTRL 1327 * CM_WKUP_WDT1_CLKCTRL, CM_WKUP_WDT2_CLKCTRL
1133 */ 1328 */
1134#define OMAP4430_MODULEMODE_SHIFT 0 1329#define OMAP4430_MODULEMODE_SHIFT 0
1330#define OMAP4430_MODULEMODE_WIDTH 0x2
1135#define OMAP4430_MODULEMODE_MASK (0x3 << 0) 1331#define OMAP4430_MODULEMODE_MASK (0x3 << 0)
1136 1332
1137/* Used by CM_L4CFG_DYNAMICDEP */ 1333/* Used by CM_L4CFG_DYNAMICDEP */
1138#define OMAP4460_MPU_DYNDEP_SHIFT 19 1334#define OMAP4460_MPU_DYNDEP_SHIFT 19
1335#define OMAP4460_MPU_DYNDEP_WIDTH 0x1
1139#define OMAP4460_MPU_DYNDEP_MASK (1 << 19) 1336#define OMAP4460_MPU_DYNDEP_MASK (1 << 19)
1140 1337
1141/* Used by CM_DSS_DSS_CLKCTRL */ 1338/* Used by CM_DSS_DSS_CLKCTRL */
1142#define OMAP4430_OPTFCLKEN_48MHZ_CLK_SHIFT 9 1339#define OMAP4430_OPTFCLKEN_48MHZ_CLK_SHIFT 9
1340#define OMAP4430_OPTFCLKEN_48MHZ_CLK_WIDTH 0x1
1143#define OMAP4430_OPTFCLKEN_48MHZ_CLK_MASK (1 << 9) 1341#define OMAP4430_OPTFCLKEN_48MHZ_CLK_MASK (1 << 9)
1144 1342
1145/* Used by CM_WKUP_BANDGAP_CLKCTRL */ 1343/* Used by CM_WKUP_BANDGAP_CLKCTRL */
1146#define OMAP4430_OPTFCLKEN_BGAP_32K_SHIFT 8 1344#define OMAP4430_OPTFCLKEN_BGAP_32K_SHIFT 8
1345#define OMAP4430_OPTFCLKEN_BGAP_32K_WIDTH 0x1
1147#define OMAP4430_OPTFCLKEN_BGAP_32K_MASK (1 << 8) 1346#define OMAP4430_OPTFCLKEN_BGAP_32K_MASK (1 << 8)
1148 1347
1149/* Used by CM_ALWON_USBPHY_CLKCTRL */ 1348/* Used by CM_ALWON_USBPHY_CLKCTRL */
1150#define OMAP4430_OPTFCLKEN_CLK32K_SHIFT 8 1349#define OMAP4430_OPTFCLKEN_CLK32K_SHIFT 8
1350#define OMAP4430_OPTFCLKEN_CLK32K_WIDTH 0x1
1151#define OMAP4430_OPTFCLKEN_CLK32K_MASK (1 << 8) 1351#define OMAP4430_OPTFCLKEN_CLK32K_MASK (1 << 8)
1152 1352
1153/* Used by CM_CAM_ISS_CLKCTRL */ 1353/* Used by CM_CAM_ISS_CLKCTRL */
1154#define OMAP4430_OPTFCLKEN_CTRLCLK_SHIFT 8 1354#define OMAP4430_OPTFCLKEN_CTRLCLK_SHIFT 8
1355#define OMAP4430_OPTFCLKEN_CTRLCLK_WIDTH 0x1
1155#define OMAP4430_OPTFCLKEN_CTRLCLK_MASK (1 << 8) 1356#define OMAP4430_OPTFCLKEN_CTRLCLK_MASK (1 << 8)
1156 1357
1157/* 1358/*
@@ -1160,126 +1361,157 @@
1160 * CM_WKUP_GPIO1_CLKCTRL 1361 * CM_WKUP_GPIO1_CLKCTRL
1161 */ 1362 */
1162#define OMAP4430_OPTFCLKEN_DBCLK_SHIFT 8 1363#define OMAP4430_OPTFCLKEN_DBCLK_SHIFT 8
1364#define OMAP4430_OPTFCLKEN_DBCLK_WIDTH 0x1
1163#define OMAP4430_OPTFCLKEN_DBCLK_MASK (1 << 8) 1365#define OMAP4430_OPTFCLKEN_DBCLK_MASK (1 << 8)
1164 1366
1165/* Used by CM_MEMIF_DLL_CLKCTRL, CM_MEMIF_DLL_H_CLKCTRL */ 1367/* Used by CM_MEMIF_DLL_CLKCTRL, CM_MEMIF_DLL_H_CLKCTRL */
1166#define OMAP4430_OPTFCLKEN_DLL_CLK_SHIFT 8 1368#define OMAP4430_OPTFCLKEN_DLL_CLK_SHIFT 8
1369#define OMAP4430_OPTFCLKEN_DLL_CLK_WIDTH 0x1
1167#define OMAP4430_OPTFCLKEN_DLL_CLK_MASK (1 << 8) 1370#define OMAP4430_OPTFCLKEN_DLL_CLK_MASK (1 << 8)
1168 1371
1169/* Used by CM_DSS_DSS_CLKCTRL */ 1372/* Used by CM_DSS_DSS_CLKCTRL */
1170#define OMAP4430_OPTFCLKEN_DSSCLK_SHIFT 8 1373#define OMAP4430_OPTFCLKEN_DSSCLK_SHIFT 8
1374#define OMAP4430_OPTFCLKEN_DSSCLK_WIDTH 0x1
1171#define OMAP4430_OPTFCLKEN_DSSCLK_MASK (1 << 8) 1375#define OMAP4430_OPTFCLKEN_DSSCLK_MASK (1 << 8)
1172 1376
1173/* Used by CM_WKUP_USIM_CLKCTRL */ 1377/* Used by CM_WKUP_USIM_CLKCTRL */
1174#define OMAP4430_OPTFCLKEN_FCLK_SHIFT 8 1378#define OMAP4430_OPTFCLKEN_FCLK_SHIFT 8
1379#define OMAP4430_OPTFCLKEN_FCLK_WIDTH 0x1
1175#define OMAP4430_OPTFCLKEN_FCLK_MASK (1 << 8) 1380#define OMAP4430_OPTFCLKEN_FCLK_MASK (1 << 8)
1176 1381
1177/* Used by CM1_ABE_SLIMBUS_CLKCTRL */ 1382/* Used by CM1_ABE_SLIMBUS_CLKCTRL */
1178#define OMAP4430_OPTFCLKEN_FCLK0_SHIFT 8 1383#define OMAP4430_OPTFCLKEN_FCLK0_SHIFT 8
1384#define OMAP4430_OPTFCLKEN_FCLK0_WIDTH 0x1
1179#define OMAP4430_OPTFCLKEN_FCLK0_MASK (1 << 8) 1385#define OMAP4430_OPTFCLKEN_FCLK0_MASK (1 << 8)
1180 1386
1181/* Used by CM1_ABE_SLIMBUS_CLKCTRL */ 1387/* Used by CM1_ABE_SLIMBUS_CLKCTRL */
1182#define OMAP4430_OPTFCLKEN_FCLK1_SHIFT 9 1388#define OMAP4430_OPTFCLKEN_FCLK1_SHIFT 9
1389#define OMAP4430_OPTFCLKEN_FCLK1_WIDTH 0x1
1183#define OMAP4430_OPTFCLKEN_FCLK1_MASK (1 << 9) 1390#define OMAP4430_OPTFCLKEN_FCLK1_MASK (1 << 9)
1184 1391
1185/* Used by CM1_ABE_SLIMBUS_CLKCTRL */ 1392/* Used by CM1_ABE_SLIMBUS_CLKCTRL */
1186#define OMAP4430_OPTFCLKEN_FCLK2_SHIFT 10 1393#define OMAP4430_OPTFCLKEN_FCLK2_SHIFT 10
1394#define OMAP4430_OPTFCLKEN_FCLK2_WIDTH 0x1
1187#define OMAP4430_OPTFCLKEN_FCLK2_MASK (1 << 10) 1395#define OMAP4430_OPTFCLKEN_FCLK2_MASK (1 << 10)
1188 1396
1189/* Used by CM_L3INIT_USB_HOST_CLKCTRL */ 1397/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
1190#define OMAP4430_OPTFCLKEN_FUNC48MCLK_SHIFT 15 1398#define OMAP4430_OPTFCLKEN_FUNC48MCLK_SHIFT 15
1399#define OMAP4430_OPTFCLKEN_FUNC48MCLK_WIDTH 0x1
1191#define OMAP4430_OPTFCLKEN_FUNC48MCLK_MASK (1 << 15) 1400#define OMAP4430_OPTFCLKEN_FUNC48MCLK_MASK (1 << 15)
1192 1401
1193/* Used by CM_L3INIT_USB_HOST_CLKCTRL */ 1402/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
1194#define OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_SHIFT 13 1403#define OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_SHIFT 13
1404#define OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_WIDTH 0x1
1195#define OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_MASK (1 << 13) 1405#define OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_MASK (1 << 13)
1196 1406
1197/* Used by CM_L3INIT_USB_HOST_CLKCTRL */ 1407/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
1198#define OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_SHIFT 14 1408#define OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_SHIFT 14
1409#define OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_WIDTH 0x1
1199#define OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_MASK (1 << 14) 1410#define OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_MASK (1 << 14)
1200 1411
1201/* Used by CM_L3INIT_USB_HOST_CLKCTRL */ 1412/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
1202#define OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT 11 1413#define OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT 11
1414#define OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_WIDTH 0x1
1203#define OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_MASK (1 << 11) 1415#define OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_MASK (1 << 11)
1204 1416
1205/* Used by CM_L3INIT_USB_HOST_CLKCTRL */ 1417/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
1206#define OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT 12 1418#define OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT 12
1419#define OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_WIDTH 0x1
1207#define OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_MASK (1 << 12) 1420#define OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_MASK (1 << 12)
1208 1421
1209/* Used by CM_L4PER_SLIMBUS2_CLKCTRL */ 1422/* Used by CM_L4PER_SLIMBUS2_CLKCTRL */
1210#define OMAP4430_OPTFCLKEN_PER24MC_GFCLK_SHIFT 8 1423#define OMAP4430_OPTFCLKEN_PER24MC_GFCLK_SHIFT 8
1424#define OMAP4430_OPTFCLKEN_PER24MC_GFCLK_WIDTH 0x1
1211#define OMAP4430_OPTFCLKEN_PER24MC_GFCLK_MASK (1 << 8) 1425#define OMAP4430_OPTFCLKEN_PER24MC_GFCLK_MASK (1 << 8)
1212 1426
1213/* Used by CM_L4PER_SLIMBUS2_CLKCTRL */ 1427/* Used by CM_L4PER_SLIMBUS2_CLKCTRL */
1214#define OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_SHIFT 9 1428#define OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_SHIFT 9
1429#define OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_WIDTH 0x1
1215#define OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_MASK (1 << 9) 1430#define OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_MASK (1 << 9)
1216 1431
1217/* Used by CM_L3INIT_USBPHYOCP2SCP_CLKCTRL */ 1432/* Used by CM_L3INIT_USBPHYOCP2SCP_CLKCTRL */
1218#define OMAP4430_OPTFCLKEN_PHY_48M_SHIFT 8 1433#define OMAP4430_OPTFCLKEN_PHY_48M_SHIFT 8
1434#define OMAP4430_OPTFCLKEN_PHY_48M_WIDTH 0x1
1219#define OMAP4430_OPTFCLKEN_PHY_48M_MASK (1 << 8) 1435#define OMAP4430_OPTFCLKEN_PHY_48M_MASK (1 << 8)
1220 1436
1221/* Used by CM_L4PER_SLIMBUS2_CLKCTRL */ 1437/* Used by CM_L4PER_SLIMBUS2_CLKCTRL */
1222#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_SHIFT 10 1438#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_SHIFT 10
1439#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_WIDTH 0x1
1223#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_MASK (1 << 10) 1440#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_MASK (1 << 10)
1224 1441
1225/* Renamed from OPTFCLKEN_SLIMBUS_CLK Used by CM1_ABE_SLIMBUS_CLKCTRL */ 1442/* Renamed from OPTFCLKEN_SLIMBUS_CLK Used by CM1_ABE_SLIMBUS_CLKCTRL */
1226#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_SHIFT 11 1443#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_SHIFT 11
1444#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_WIDTH 0x1
1227#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_MASK (1 << 11) 1445#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_MASK (1 << 11)
1228 1446
1229/* Used by CM_DSS_DSS_CLKCTRL */ 1447/* Used by CM_DSS_DSS_CLKCTRL */
1230#define OMAP4430_OPTFCLKEN_SYS_CLK_SHIFT 10 1448#define OMAP4430_OPTFCLKEN_SYS_CLK_SHIFT 10
1449#define OMAP4430_OPTFCLKEN_SYS_CLK_WIDTH 0x1
1231#define OMAP4430_OPTFCLKEN_SYS_CLK_MASK (1 << 10) 1450#define OMAP4430_OPTFCLKEN_SYS_CLK_MASK (1 << 10)
1232 1451
1233/* Used by CM_WKUP_BANDGAP_CLKCTRL */ 1452/* Used by CM_WKUP_BANDGAP_CLKCTRL */
1234#define OMAP4460_OPTFCLKEN_TS_FCLK_SHIFT 8 1453#define OMAP4460_OPTFCLKEN_TS_FCLK_SHIFT 8
1454#define OMAP4460_OPTFCLKEN_TS_FCLK_WIDTH 0x1
1235#define OMAP4460_OPTFCLKEN_TS_FCLK_MASK (1 << 8) 1455#define OMAP4460_OPTFCLKEN_TS_FCLK_MASK (1 << 8)
1236 1456
1237/* Used by CM_DSS_DSS_CLKCTRL */ 1457/* Used by CM_DSS_DSS_CLKCTRL */
1238#define OMAP4430_OPTFCLKEN_TV_CLK_SHIFT 11 1458#define OMAP4430_OPTFCLKEN_TV_CLK_SHIFT 11
1459#define OMAP4430_OPTFCLKEN_TV_CLK_WIDTH 0x1
1239#define OMAP4430_OPTFCLKEN_TV_CLK_MASK (1 << 11) 1460#define OMAP4430_OPTFCLKEN_TV_CLK_MASK (1 << 11)
1240 1461
1241/* Used by CM_L3INIT_UNIPRO1_CLKCTRL */ 1462/* Used by CM_L3INIT_UNIPRO1_CLKCTRL */
1242#define OMAP4430_OPTFCLKEN_TXPHYCLK_SHIFT 8 1463#define OMAP4430_OPTFCLKEN_TXPHYCLK_SHIFT 8
1464#define OMAP4430_OPTFCLKEN_TXPHYCLK_WIDTH 0x1
1243#define OMAP4430_OPTFCLKEN_TXPHYCLK_MASK (1 << 8) 1465#define OMAP4430_OPTFCLKEN_TXPHYCLK_MASK (1 << 8)
1244 1466
1245/* Used by CM_L3INIT_USB_TLL_CLKCTRL */ 1467/* Used by CM_L3INIT_USB_TLL_CLKCTRL */
1246#define OMAP4430_OPTFCLKEN_USB_CH0_CLK_SHIFT 8 1468#define OMAP4430_OPTFCLKEN_USB_CH0_CLK_SHIFT 8
1469#define OMAP4430_OPTFCLKEN_USB_CH0_CLK_WIDTH 0x1
1247#define OMAP4430_OPTFCLKEN_USB_CH0_CLK_MASK (1 << 8) 1470#define OMAP4430_OPTFCLKEN_USB_CH0_CLK_MASK (1 << 8)
1248 1471
1249/* Used by CM_L3INIT_USB_TLL_CLKCTRL */ 1472/* Used by CM_L3INIT_USB_TLL_CLKCTRL */
1250#define OMAP4430_OPTFCLKEN_USB_CH1_CLK_SHIFT 9 1473#define OMAP4430_OPTFCLKEN_USB_CH1_CLK_SHIFT 9
1474#define OMAP4430_OPTFCLKEN_USB_CH1_CLK_WIDTH 0x1
1251#define OMAP4430_OPTFCLKEN_USB_CH1_CLK_MASK (1 << 9) 1475#define OMAP4430_OPTFCLKEN_USB_CH1_CLK_MASK (1 << 9)
1252 1476
1253/* Used by CM_L3INIT_USB_TLL_CLKCTRL */ 1477/* Used by CM_L3INIT_USB_TLL_CLKCTRL */
1254#define OMAP4430_OPTFCLKEN_USB_CH2_CLK_SHIFT 10 1478#define OMAP4430_OPTFCLKEN_USB_CH2_CLK_SHIFT 10
1479#define OMAP4430_OPTFCLKEN_USB_CH2_CLK_WIDTH 0x1
1255#define OMAP4430_OPTFCLKEN_USB_CH2_CLK_MASK (1 << 10) 1480#define OMAP4430_OPTFCLKEN_USB_CH2_CLK_MASK (1 << 10)
1256 1481
1257/* Used by CM_L3INIT_USB_HOST_CLKCTRL */ 1482/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
1258#define OMAP4430_OPTFCLKEN_UTMI_P1_CLK_SHIFT 8 1483#define OMAP4430_OPTFCLKEN_UTMI_P1_CLK_SHIFT 8
1484#define OMAP4430_OPTFCLKEN_UTMI_P1_CLK_WIDTH 0x1
1259#define OMAP4430_OPTFCLKEN_UTMI_P1_CLK_MASK (1 << 8) 1485#define OMAP4430_OPTFCLKEN_UTMI_P1_CLK_MASK (1 << 8)
1260 1486
1261/* Used by CM_L3INIT_USB_HOST_CLKCTRL */ 1487/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
1262#define OMAP4430_OPTFCLKEN_UTMI_P2_CLK_SHIFT 9 1488#define OMAP4430_OPTFCLKEN_UTMI_P2_CLK_SHIFT 9
1489#define OMAP4430_OPTFCLKEN_UTMI_P2_CLK_WIDTH 0x1
1263#define OMAP4430_OPTFCLKEN_UTMI_P2_CLK_MASK (1 << 9) 1490#define OMAP4430_OPTFCLKEN_UTMI_P2_CLK_MASK (1 << 9)
1264 1491
1265/* Used by CM_L3INIT_USB_HOST_CLKCTRL */ 1492/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
1266#define OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT 10 1493#define OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT 10
1494#define OMAP4430_OPTFCLKEN_UTMI_P3_CLK_WIDTH 0x1
1267#define OMAP4430_OPTFCLKEN_UTMI_P3_CLK_MASK (1 << 10) 1495#define OMAP4430_OPTFCLKEN_UTMI_P3_CLK_MASK (1 << 10)
1268 1496
1269/* Used by CM_L3INIT_USB_OTG_CLKCTRL */ 1497/* Used by CM_L3INIT_USB_OTG_CLKCTRL */
1270#define OMAP4430_OPTFCLKEN_XCLK_SHIFT 8 1498#define OMAP4430_OPTFCLKEN_XCLK_SHIFT 8
1499#define OMAP4430_OPTFCLKEN_XCLK_WIDTH 0x1
1271#define OMAP4430_OPTFCLKEN_XCLK_MASK (1 << 8) 1500#define OMAP4430_OPTFCLKEN_XCLK_MASK (1 << 8)
1272 1501
1273/* Used by CM_EMU_OVERRIDE_DPLL_CORE */ 1502/* Used by CM_EMU_OVERRIDE_DPLL_CORE */
1274#define OMAP4430_OVERRIDE_ENABLE_SHIFT 19 1503#define OMAP4430_OVERRIDE_ENABLE_SHIFT 19
1504#define OMAP4430_OVERRIDE_ENABLE_WIDTH 0x1
1275#define OMAP4430_OVERRIDE_ENABLE_MASK (1 << 19) 1505#define OMAP4430_OVERRIDE_ENABLE_MASK (1 << 19)
1276 1506
1277/* Used by CM_CLKSEL_ABE */ 1507/* Used by CM_CLKSEL_ABE */
1278#define OMAP4430_PAD_CLKS_GATE_SHIFT 8 1508#define OMAP4430_PAD_CLKS_GATE_SHIFT 8
1509#define OMAP4430_PAD_CLKS_GATE_WIDTH 0x1
1279#define OMAP4430_PAD_CLKS_GATE_MASK (1 << 8) 1510#define OMAP4430_PAD_CLKS_GATE_MASK (1 << 8)
1280 1511
1281/* Used by CM_CORE_DVFS_CURRENT, CM_IVA_DVFS_CURRENT */ 1512/* Used by CM_CORE_DVFS_CURRENT, CM_IVA_DVFS_CURRENT */
1282#define OMAP4430_PERF_CURRENT_SHIFT 0 1513#define OMAP4430_PERF_CURRENT_SHIFT 0
1514#define OMAP4430_PERF_CURRENT_WIDTH 0x8
1283#define OMAP4430_PERF_CURRENT_MASK (0xff << 0) 1515#define OMAP4430_PERF_CURRENT_MASK (0xff << 0)
1284 1516
1285/* 1517/*
@@ -1288,74 +1520,85 @@
1288 * CM_IVA_DVFS_PERF_TESLA 1520 * CM_IVA_DVFS_PERF_TESLA
1289 */ 1521 */
1290#define OMAP4430_PERF_REQ_SHIFT 0 1522#define OMAP4430_PERF_REQ_SHIFT 0
1523#define OMAP4430_PERF_REQ_WIDTH 0x8
1291#define OMAP4430_PERF_REQ_MASK (0xff << 0) 1524#define OMAP4430_PERF_REQ_MASK (0xff << 0)
1292 1525
1293/* Used by CM_RESTORE_ST */ 1526/* Used by CM_RESTORE_ST */
1294#define OMAP4430_PHASE1_COMPLETED_SHIFT 0 1527#define OMAP4430_PHASE1_COMPLETED_SHIFT 0
1528#define OMAP4430_PHASE1_COMPLETED_WIDTH 0x1
1295#define OMAP4430_PHASE1_COMPLETED_MASK (1 << 0) 1529#define OMAP4430_PHASE1_COMPLETED_MASK (1 << 0)
1296 1530
1297/* Used by CM_RESTORE_ST */ 1531/* Used by CM_RESTORE_ST */
1298#define OMAP4430_PHASE2A_COMPLETED_SHIFT 1 1532#define OMAP4430_PHASE2A_COMPLETED_SHIFT 1
1533#define OMAP4430_PHASE2A_COMPLETED_WIDTH 0x1
1299#define OMAP4430_PHASE2A_COMPLETED_MASK (1 << 1) 1534#define OMAP4430_PHASE2A_COMPLETED_MASK (1 << 1)
1300 1535
1301/* Used by CM_RESTORE_ST */ 1536/* Used by CM_RESTORE_ST */
1302#define OMAP4430_PHASE2B_COMPLETED_SHIFT 2 1537#define OMAP4430_PHASE2B_COMPLETED_SHIFT 2
1538#define OMAP4430_PHASE2B_COMPLETED_WIDTH 0x1
1303#define OMAP4430_PHASE2B_COMPLETED_MASK (1 << 2) 1539#define OMAP4430_PHASE2B_COMPLETED_MASK (1 << 2)
1304 1540
1305/* Used by CM_EMU_DEBUGSS_CLKCTRL */ 1541/* Used by CM_EMU_DEBUGSS_CLKCTRL */
1306#define OMAP4430_PMD_STM_MUX_CTRL_SHIFT 20 1542#define OMAP4430_PMD_STM_MUX_CTRL_SHIFT 20
1543#define OMAP4430_PMD_STM_MUX_CTRL_WIDTH 0x2
1307#define OMAP4430_PMD_STM_MUX_CTRL_MASK (0x3 << 20) 1544#define OMAP4430_PMD_STM_MUX_CTRL_MASK (0x3 << 20)
1308 1545
1309/* Used by CM_EMU_DEBUGSS_CLKCTRL */ 1546/* Used by CM_EMU_DEBUGSS_CLKCTRL */
1310#define OMAP4430_PMD_TRACE_MUX_CTRL_SHIFT 22 1547#define OMAP4430_PMD_TRACE_MUX_CTRL_SHIFT 22
1548#define OMAP4430_PMD_TRACE_MUX_CTRL_WIDTH 0x2
1311#define OMAP4430_PMD_TRACE_MUX_CTRL_MASK (0x3 << 22) 1549#define OMAP4430_PMD_TRACE_MUX_CTRL_MASK (0x3 << 22)
1312 1550
1313/* Used by CM_DYN_DEP_PRESCAL */ 1551/* Used by CM_DYN_DEP_PRESCAL */
1314#define OMAP4430_PRESCAL_SHIFT 0 1552#define OMAP4430_PRESCAL_SHIFT 0
1553#define OMAP4430_PRESCAL_WIDTH 0x6
1315#define OMAP4430_PRESCAL_MASK (0x3f << 0) 1554#define OMAP4430_PRESCAL_MASK (0x3f << 0)
1316 1555
1317/* Used by REVISION_CM1, REVISION_CM2 */ 1556/* Used by REVISION_CM1, REVISION_CM2 */
1318#define OMAP4430_R_RTL_SHIFT 11 1557#define OMAP4430_R_RTL_SHIFT 11
1558#define OMAP4430_R_RTL_WIDTH 0x5
1319#define OMAP4430_R_RTL_MASK (0x1f << 11) 1559#define OMAP4430_R_RTL_MASK (0x1f << 11)
1320 1560
1321/* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL */ 1561/* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL */
1322#define OMAP4430_SAR_MODE_SHIFT 4 1562#define OMAP4430_SAR_MODE_SHIFT 4
1563#define OMAP4430_SAR_MODE_WIDTH 0x1
1323#define OMAP4430_SAR_MODE_MASK (1 << 4) 1564#define OMAP4430_SAR_MODE_MASK (1 << 4)
1324 1565
1325/* Used by CM_SCALE_FCLK */ 1566/* Used by CM_SCALE_FCLK */
1326#define OMAP4430_SCALE_FCLK_SHIFT 0 1567#define OMAP4430_SCALE_FCLK_SHIFT 0
1568#define OMAP4430_SCALE_FCLK_WIDTH 0x1
1327#define OMAP4430_SCALE_FCLK_MASK (1 << 0) 1569#define OMAP4430_SCALE_FCLK_MASK (1 << 0)
1328 1570
1329/* Used by REVISION_CM1, REVISION_CM2 */ 1571/* Used by REVISION_CM1, REVISION_CM2 */
1330#define OMAP4430_SCHEME_SHIFT 30 1572#define OMAP4430_SCHEME_SHIFT 30
1573#define OMAP4430_SCHEME_WIDTH 0x2
1331#define OMAP4430_SCHEME_MASK (0x3 << 30) 1574#define OMAP4430_SCHEME_MASK (0x3 << 30)
1332 1575
1333/* Used by CM_L4CFG_DYNAMICDEP */ 1576/* Used by CM_L4CFG_DYNAMICDEP */
1334#define OMAP4430_SDMA_DYNDEP_SHIFT 11 1577#define OMAP4430_SDMA_DYNDEP_SHIFT 11
1578#define OMAP4430_SDMA_DYNDEP_WIDTH 0x1
1335#define OMAP4430_SDMA_DYNDEP_MASK (1 << 11) 1579#define OMAP4430_SDMA_DYNDEP_MASK (1 << 11)
1336 1580
1337/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */ 1581/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */
1338#define OMAP4430_SDMA_STATDEP_SHIFT 11 1582#define OMAP4430_SDMA_STATDEP_SHIFT 11
1583#define OMAP4430_SDMA_STATDEP_WIDTH 0x1
1339#define OMAP4430_SDMA_STATDEP_MASK (1 << 11) 1584#define OMAP4430_SDMA_STATDEP_MASK (1 << 11)
1340 1585
1341/* Used by CM_CLKSEL_ABE */ 1586/* Used by CM_CLKSEL_ABE */
1342#define OMAP4430_SLIMBUS_CLK_GATE_SHIFT 10 1587#define OMAP4430_SLIMBUS_CLK_GATE_SHIFT 10
1588#define OMAP4430_SLIMBUS_CLK_GATE_WIDTH 0x1
1343#define OMAP4430_SLIMBUS_CLK_GATE_MASK (1 << 10) 1589#define OMAP4430_SLIMBUS_CLK_GATE_MASK (1 << 10)
1344 1590
1345/* 1591/*
1346 * Used by CM1_ABE_AESS_CLKCTRL, CM_CAM_FDIF_CLKCTRL, CM_CAM_ISS_CLKCTRL, 1592 * Used by CM1_ABE_AESS_CLKCTRL, CM_CAM_FDIF_CLKCTRL, CM_CAM_ISS_CLKCTRL,
1347 * CM_D2D_SAD2D_CLKCTRL, CM_DSS_DEISS_CLKCTRL, CM_DSS_DSS_CLKCTRL, 1593 * CM_D2D_SAD2D_CLKCTRL, CM_DSS_DSS_CLKCTRL, CM_DUCATI_DUCATI_CLKCTRL,
1348 * CM_DUCATI_DUCATI_CLKCTRL, CM_EMU_DEBUGSS_CLKCTRL, CM_GFX_GFX_CLKCTRL, 1594 * CM_EMU_DEBUGSS_CLKCTRL, CM_GFX_GFX_CLKCTRL, CM_IVAHD_IVAHD_CLKCTRL,
1349 * CM_IVAHD_IVAHD_CLKCTRL, CM_L3INIT_CCPTX_CLKCTRL, CM_L3INIT_EMAC_CLKCTRL,
1350 * CM_L3INIT_HSI_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL, CM_L3INIT_MMC2_CLKCTRL, 1595 * CM_L3INIT_HSI_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL, CM_L3INIT_MMC2_CLKCTRL,
1351 * CM_L3INIT_MMC6_CLKCTRL, CM_L3INIT_P1500_CLKCTRL, CM_L3INIT_PCIESS_CLKCTRL,
1352 * CM_L3INIT_SATA_CLKCTRL, CM_L3INIT_TPPSS_CLKCTRL, CM_L3INIT_UNIPRO1_CLKCTRL,
1353 * CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_FS_CLKCTRL, 1596 * CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_FS_CLKCTRL,
1354 * CM_L3INIT_USB_OTG_CLKCTRL, CM_L3INIT_XHPI_CLKCTRL, 1597 * CM_L3INIT_USB_OTG_CLKCTRL, CM_L4SEC_CRYPTODMA_CLKCTRL, CM_MPU_MPU_CLKCTRL,
1355 * CM_L4SEC_CRYPTODMA_CLKCTRL, CM_MPU_MPU_CLKCTRL, CM_SDMA_SDMA_CLKCTRL, 1598 * CM_SDMA_SDMA_CLKCTRL, CM_TESLA_TESLA_CLKCTRL
1356 * CM_TESLA_TESLA_CLKCTRL
1357 */ 1599 */
1358#define OMAP4430_STBYST_SHIFT 18 1600#define OMAP4430_STBYST_SHIFT 18
1601#define OMAP4430_STBYST_WIDTH 0x1
1359#define OMAP4430_STBYST_MASK (1 << 18) 1602#define OMAP4430_STBYST_MASK (1 << 18)
1360 1603
1361/* 1604/*
@@ -1364,10 +1607,12 @@
1364 * CM_IDLEST_DPLL_UNIPRO, CM_IDLEST_DPLL_USB 1607 * CM_IDLEST_DPLL_UNIPRO, CM_IDLEST_DPLL_USB
1365 */ 1608 */
1366#define OMAP4430_ST_DPLL_CLK_SHIFT 0 1609#define OMAP4430_ST_DPLL_CLK_SHIFT 0
1610#define OMAP4430_ST_DPLL_CLK_WIDTH 0x1
1367#define OMAP4430_ST_DPLL_CLK_MASK (1 << 0) 1611#define OMAP4430_ST_DPLL_CLK_MASK (1 << 0)
1368 1612
1369/* Used by CM_CLKDCOLDO_DPLL_USB */ 1613/* Used by CM_CLKDCOLDO_DPLL_USB */
1370#define OMAP4430_ST_DPLL_CLKDCOLDO_SHIFT 9 1614#define OMAP4430_ST_DPLL_CLKDCOLDO_SHIFT 9
1615#define OMAP4430_ST_DPLL_CLKDCOLDO_WIDTH 0x1
1371#define OMAP4430_ST_DPLL_CLKDCOLDO_MASK (1 << 9) 1616#define OMAP4430_ST_DPLL_CLKDCOLDO_MASK (1 << 9)
1372 1617
1373/* 1618/*
@@ -1375,14 +1620,17 @@
1375 * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_USB 1620 * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_USB
1376 */ 1621 */
1377#define OMAP4430_ST_DPLL_CLKOUT_SHIFT 9 1622#define OMAP4430_ST_DPLL_CLKOUT_SHIFT 9
1623#define OMAP4430_ST_DPLL_CLKOUT_WIDTH 0x1
1378#define OMAP4430_ST_DPLL_CLKOUT_MASK (1 << 9) 1624#define OMAP4430_ST_DPLL_CLKOUT_MASK (1 << 9)
1379 1625
1380/* Used by CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER */ 1626/* Used by CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER */
1381#define OMAP4430_ST_DPLL_CLKOUTHIF_SHIFT 9 1627#define OMAP4430_ST_DPLL_CLKOUTHIF_SHIFT 9
1628#define OMAP4430_ST_DPLL_CLKOUTHIF_WIDTH 0x1
1382#define OMAP4430_ST_DPLL_CLKOUTHIF_MASK (1 << 9) 1629#define OMAP4430_ST_DPLL_CLKOUTHIF_MASK (1 << 9)
1383 1630
1384/* Used by CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO */ 1631/* Used by CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO */
1385#define OMAP4430_ST_DPLL_CLKOUTX2_SHIFT 11 1632#define OMAP4430_ST_DPLL_CLKOUTX2_SHIFT 11
1633#define OMAP4430_ST_DPLL_CLKOUTX2_WIDTH 0x1
1386#define OMAP4430_ST_DPLL_CLKOUTX2_MASK (1 << 11) 1634#define OMAP4430_ST_DPLL_CLKOUTX2_MASK (1 << 11)
1387 1635
1388/* 1636/*
@@ -1390,6 +1638,7 @@
1390 * CM_DIV_M4_DPLL_PER 1638 * CM_DIV_M4_DPLL_PER
1391 */ 1639 */
1392#define OMAP4430_ST_HSDIVIDER_CLKOUT1_SHIFT 9 1640#define OMAP4430_ST_HSDIVIDER_CLKOUT1_SHIFT 9
1641#define OMAP4430_ST_HSDIVIDER_CLKOUT1_WIDTH 0x1
1393#define OMAP4430_ST_HSDIVIDER_CLKOUT1_MASK (1 << 9) 1642#define OMAP4430_ST_HSDIVIDER_CLKOUT1_MASK (1 << 9)
1394 1643
1395/* 1644/*
@@ -1397,14 +1646,17 @@
1397 * CM_DIV_M5_DPLL_PER 1646 * CM_DIV_M5_DPLL_PER
1398 */ 1647 */
1399#define OMAP4430_ST_HSDIVIDER_CLKOUT2_SHIFT 9 1648#define OMAP4430_ST_HSDIVIDER_CLKOUT2_SHIFT 9
1649#define OMAP4430_ST_HSDIVIDER_CLKOUT2_WIDTH 0x1
1400#define OMAP4430_ST_HSDIVIDER_CLKOUT2_MASK (1 << 9) 1650#define OMAP4430_ST_HSDIVIDER_CLKOUT2_MASK (1 << 9)
1401 1651
1402/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */ 1652/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */
1403#define OMAP4430_ST_HSDIVIDER_CLKOUT3_SHIFT 9 1653#define OMAP4430_ST_HSDIVIDER_CLKOUT3_SHIFT 9
1654#define OMAP4430_ST_HSDIVIDER_CLKOUT3_WIDTH 0x1
1404#define OMAP4430_ST_HSDIVIDER_CLKOUT3_MASK (1 << 9) 1655#define OMAP4430_ST_HSDIVIDER_CLKOUT3_MASK (1 << 9)
1405 1656
1406/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */ 1657/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */
1407#define OMAP4430_ST_HSDIVIDER_CLKOUT4_SHIFT 9 1658#define OMAP4430_ST_HSDIVIDER_CLKOUT4_SHIFT 9
1659#define OMAP4430_ST_HSDIVIDER_CLKOUT4_WIDTH 0x1
1408#define OMAP4430_ST_HSDIVIDER_CLKOUT4_MASK (1 << 9) 1660#define OMAP4430_ST_HSDIVIDER_CLKOUT4_MASK (1 << 9)
1409 1661
1410/* 1662/*
@@ -1413,18 +1665,22 @@
1413 * CM_IDLEST_DPLL_UNIPRO, CM_IDLEST_DPLL_USB 1665 * CM_IDLEST_DPLL_UNIPRO, CM_IDLEST_DPLL_USB
1414 */ 1666 */
1415#define OMAP4430_ST_MN_BYPASS_SHIFT 8 1667#define OMAP4430_ST_MN_BYPASS_SHIFT 8
1668#define OMAP4430_ST_MN_BYPASS_WIDTH 0x1
1416#define OMAP4430_ST_MN_BYPASS_MASK (1 << 8) 1669#define OMAP4430_ST_MN_BYPASS_MASK (1 << 8)
1417 1670
1418/* Used by CM_SYS_CLKSEL */ 1671/* Used by CM_SYS_CLKSEL */
1419#define OMAP4430_SYS_CLKSEL_SHIFT 0 1672#define OMAP4430_SYS_CLKSEL_SHIFT 0
1673#define OMAP4430_SYS_CLKSEL_WIDTH 0x3
1420#define OMAP4430_SYS_CLKSEL_MASK (0x7 << 0) 1674#define OMAP4430_SYS_CLKSEL_MASK (0x7 << 0)
1421 1675
1422/* Used by CM_L4CFG_DYNAMICDEP */ 1676/* Used by CM_L4CFG_DYNAMICDEP */
1423#define OMAP4430_TESLA_DYNDEP_SHIFT 1 1677#define OMAP4430_TESLA_DYNDEP_SHIFT 1
1678#define OMAP4430_TESLA_DYNDEP_WIDTH 0x1
1424#define OMAP4430_TESLA_DYNDEP_MASK (1 << 1) 1679#define OMAP4430_TESLA_DYNDEP_MASK (1 << 1)
1425 1680
1426/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */ 1681/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */
1427#define OMAP4430_TESLA_STATDEP_SHIFT 1 1682#define OMAP4430_TESLA_STATDEP_SHIFT 1
1683#define OMAP4430_TESLA_STATDEP_WIDTH 0x1
1428#define OMAP4430_TESLA_STATDEP_MASK (1 << 1) 1684#define OMAP4430_TESLA_STATDEP_MASK (1 << 1)
1429 1685
1430/* 1686/*
@@ -1433,13 +1689,16 @@
1433 * CM_L4PER_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP 1689 * CM_L4PER_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP
1434 */ 1690 */
1435#define OMAP4430_WINDOWSIZE_SHIFT 24 1691#define OMAP4430_WINDOWSIZE_SHIFT 24
1692#define OMAP4430_WINDOWSIZE_WIDTH 0x4
1436#define OMAP4430_WINDOWSIZE_MASK (0xf << 24) 1693#define OMAP4430_WINDOWSIZE_MASK (0xf << 24)
1437 1694
1438/* Used by REVISION_CM1, REVISION_CM2 */ 1695/* Used by REVISION_CM1, REVISION_CM2 */
1439#define OMAP4430_X_MAJOR_SHIFT 8 1696#define OMAP4430_X_MAJOR_SHIFT 8
1697#define OMAP4430_X_MAJOR_WIDTH 0x3
1440#define OMAP4430_X_MAJOR_MASK (0x7 << 8) 1698#define OMAP4430_X_MAJOR_MASK (0x7 << 8)
1441 1699
1442/* Used by REVISION_CM1, REVISION_CM2 */ 1700/* Used by REVISION_CM1, REVISION_CM2 */
1443#define OMAP4430_Y_MINOR_SHIFT 0 1701#define OMAP4430_Y_MINOR_SHIFT 0
1702#define OMAP4430_Y_MINOR_WIDTH 0x6
1444#define OMAP4430_Y_MINOR_MASK (0x3f << 0) 1703#define OMAP4430_Y_MINOR_MASK (0x3f << 0)
1445#endif 1704#endif
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c
index 389f9f8b570..7f07ab02a5b 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c
@@ -18,8 +18,7 @@
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/io.h> 19#include <linux/io.h>
20 20
21#include <plat/hardware.h> 21#include "soc.h"
22
23#include "iomap.h" 22#include "iomap.h"
24#include "common.h" 23#include "common.h"
25#include "cm.h" 24#include "cm.h"
@@ -36,7 +35,7 @@
36#define OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP 0x3 35#define OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP 0x3
37 36
38static const u8 cm_idlest_offs[] = { 37static const u8 cm_idlest_offs[] = {
39 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3 38 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3, OMAP24XX_CM_IDLEST4
40}; 39};
41 40
42u32 omap2_cm_read_mod_reg(s16 module, u16 idx) 41u32 omap2_cm_read_mod_reg(s16 module, u16 idx)
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h b/arch/arm/mach-omap2/cm2xxx_3xxx.h
index 088bbad73db..57b2f3c2fbf 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.h
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h
@@ -71,6 +71,7 @@
71#define OMAP24XX_CM_FCLKEN2 0x0004 71#define OMAP24XX_CM_FCLKEN2 0x0004
72#define OMAP24XX_CM_ICLKEN4 0x001c 72#define OMAP24XX_CM_ICLKEN4 0x001c
73#define OMAP24XX_CM_AUTOIDLE4 0x003c 73#define OMAP24XX_CM_AUTOIDLE4 0x003c
74#define OMAP24XX_CM_IDLEST4 0x002c
74 75
75#define OMAP2430_CM_IDLEST3 0x0028 76#define OMAP2430_CM_IDLEST3 0x0028
76 77
diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
index c1875862679..48daac2581b 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -24,9 +24,10 @@
24#include <linux/spi/spi.h> 24#include <linux/spi/spi.h>
25#include <linux/spi/ads7846.h> 25#include <linux/spi/ads7846.h>
26 26
27#include <plat/mcspi.h> 27#include <linux/platform_data/spi-omap2-mcspi.h>
28#include <plat/nand.h> 28#include <linux/platform_data/mtd-nand-omap2.h>
29 29
30#include "common.h"
30#include "common-board-devices.h" 31#include "common-board-devices.h"
31 32
32#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ 33#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
@@ -119,8 +120,7 @@ void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
119 } 120 }
120 121
121 if (nandcs > GPMC_CS_NUM) { 122 if (nandcs > GPMC_CS_NUM) {
122 printk(KERN_INFO "NAND: Unable to find configuration " 123 pr_info("NAND: Unable to find configuration in GPMC\n");
123 "in GPMC\n ");
124 return; 124 return;
125 } 125 }
126 126
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 069f9725b1c..17950c6e130 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -17,11 +17,9 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <plat/hardware.h>
21#include <plat/board.h>
22#include <plat/mux.h>
23#include <plat/clock.h> 20#include <plat/clock.h>
24 21
22#include "soc.h"
25#include "iomap.h" 23#include "iomap.h"
26#include "common.h" 24#include "common.h"
27#include "sdrc.h" 25#include "sdrc.h"
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 1f65b1871c2..7045e4d61ac 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -26,11 +26,18 @@
26#define __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H 26#define __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H
27#ifndef __ASSEMBLER__ 27#ifndef __ASSEMBLER__
28 28
29#include <linux/irq.h>
29#include <linux/delay.h> 30#include <linux/delay.h>
30#include <linux/i2c/twl.h> 31#include <linux/i2c/twl.h>
31#include <plat/common.h> 32
32#include <asm/proc-fns.h> 33#include <asm/proc-fns.h>
33 34
35#include <plat/cpu.h>
36#include <plat/serial.h>
37#include <plat/common.h>
38
39#define OMAP_INTC_START NR_IRQS
40
34#ifdef CONFIG_SOC_OMAP2420 41#ifdef CONFIG_SOC_OMAP2420
35extern void omap242x_map_common_io(void); 42extern void omap242x_map_common_io(void);
36#else 43#else
@@ -278,6 +285,11 @@ extern void omap_secondary_startup(void);
278extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask); 285extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);
279extern void omap_auxcoreboot_addr(u32 cpu_addr); 286extern void omap_auxcoreboot_addr(u32 cpu_addr);
280extern u32 omap_read_auxcoreboot0(void); 287extern u32 omap_read_auxcoreboot0(void);
288
289extern void omap4_cpu_die(unsigned int cpu);
290
291extern struct smp_operations omap4_smp_ops;
292
281extern void omap5_secondary_startup(void); 293extern void omap5_secondary_startup(void);
282#endif 294#endif
283 295
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index 3223b81e753..d1ff8399a22 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -15,9 +15,9 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#include <plat/hardware.h>
19#include <plat/sdrc.h> 18#include <plat/sdrc.h>
20 19
20#include "soc.h"
21#include "iomap.h" 21#include "iomap.h"
22#include "common.h" 22#include "common.h"
23#include "cm-regbits-34xx.h" 23#include "cm-regbits-34xx.h"
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index b8cdc8531b6..a89e8256fd0 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -16,12 +16,12 @@
16#ifndef __ARCH_ARM_MACH_OMAP2_CONTROL_H 16#ifndef __ARCH_ARM_MACH_OMAP2_CONTROL_H
17#define __ARCH_ARM_MACH_OMAP2_CONTROL_H 17#define __ARCH_ARM_MACH_OMAP2_CONTROL_H
18 18
19#include <mach/ctrl_module_core_44xx.h> 19#include "ctrl_module_core_44xx.h"
20#include <mach/ctrl_module_wkup_44xx.h> 20#include "ctrl_module_wkup_44xx.h"
21#include <mach/ctrl_module_pad_core_44xx.h> 21#include "ctrl_module_pad_core_44xx.h"
22#include <mach/ctrl_module_pad_wkup_44xx.h> 22#include "ctrl_module_pad_wkup_44xx.h"
23 23
24#include <plat/am33xx.h> 24#include "am33xx.h"
25 25
26#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
27#define OMAP242X_CTRL_REGADDR(reg) \ 27#define OMAP242X_CTRL_REGADDR(reg) \
@@ -354,6 +354,7 @@
354 354
355/* AM33XX CONTROL_STATUS bitfields (partial) */ 355/* AM33XX CONTROL_STATUS bitfields (partial) */
356#define AM33XX_CONTROL_STATUS_SYSBOOT1_SHIFT 22 356#define AM33XX_CONTROL_STATUS_SYSBOOT1_SHIFT 22
357#define AM33XX_CONTROL_STATUS_SYSBOOT1_WIDTH 0x2
357#define AM33XX_CONTROL_STATUS_SYSBOOT1_MASK (0x3 << 22) 358#define AM33XX_CONTROL_STATUS_SYSBOOT1_MASK (0x3 << 22)
358 359
359/* CONTROL OMAP STATUS register to identify OMAP3 features */ 360/* CONTROL OMAP STATUS register to identify OMAP3 features */
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index f2a49a48ef5..bc2756959be 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -28,7 +28,6 @@
28#include <linux/cpu_pm.h> 28#include <linux/cpu_pm.h>
29 29
30#include <plat/prcm.h> 30#include <plat/prcm.h>
31#include <plat/irqs.h>
32#include "powerdomain.h" 31#include "powerdomain.h"
33#include "clockdomain.h" 32#include "clockdomain.h"
34 33
diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h b/arch/arm/mach-omap2/ctrl_module_core_44xx.h
index 01970824e0e..01970824e0e 100644
--- a/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h
+++ b/arch/arm/mach-omap2/ctrl_module_core_44xx.h
diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h b/arch/arm/mach-omap2/ctrl_module_pad_core_44xx.h
index c88420de115..c88420de115 100644
--- a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h
+++ b/arch/arm/mach-omap2/ctrl_module_pad_core_44xx.h
diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_wkup_44xx.h b/arch/arm/mach-omap2/ctrl_module_pad_wkup_44xx.h
index 17c9b37042c..17c9b37042c 100644
--- a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_wkup_44xx.h
+++ b/arch/arm/mach-omap2/ctrl_module_pad_wkup_44xx.h
diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_wkup_44xx.h b/arch/arm/mach-omap2/ctrl_module_wkup_44xx.h
index a0af9baec3f..a0af9baec3f 100644
--- a/arch/arm/mach-omap2/include/mach/ctrl_module_wkup_44xx.h
+++ b/arch/arm/mach-omap2/ctrl_module_wkup_44xx.h
diff --git a/arch/arm/mach-omap2/debug-devices.h b/arch/arm/mach-omap2/debug-devices.h
new file mode 100644
index 00000000000..a4edbd2f748
--- /dev/null
+++ b/arch/arm/mach-omap2/debug-devices.h
@@ -0,0 +1,9 @@
1#ifndef _OMAP_DEBUG_DEVICES_H
2#define _OMAP_DEBUG_DEVICES_H
3
4#include <linux/types.h>
5
6/* for TI reference platforms sharing the same debug card */
7extern int debug_card_init(u32 addr, unsigned gpio);
8
9#endif
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index c00c68961bb..c8c211731d2 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -17,21 +17,20 @@
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/of.h> 19#include <linux/of.h>
20#include <linux/pinctrl/machine.h>
20#include <linux/platform_data/omap4-keypad.h> 21#include <linux/platform_data/omap4-keypad.h>
21 22
22#include <mach/hardware.h>
23#include <mach/irqs.h>
24#include <asm/mach-types.h> 23#include <asm/mach-types.h>
25#include <asm/mach/map.h> 24#include <asm/mach/map.h>
26#include <asm/pmu.h>
27 25
28#include "iomap.h" 26#include "iomap.h"
29#include <plat/board.h>
30#include <plat/dma.h> 27#include <plat/dma.h>
31#include <plat/omap_hwmod.h> 28#include <plat/omap_hwmod.h>
32#include <plat/omap_device.h> 29#include <plat/omap_device.h>
33#include <plat/omap4-keypad.h> 30#include "omap4-keypad.h"
34 31
32#include "soc.h"
33#include "common.h"
35#include "mux.h" 34#include "mux.h"
36#include "control.h" 35#include "control.h"
37#include "devices.h" 36#include "devices.h"
@@ -112,7 +111,7 @@ static struct resource omap2cam_resources[] = {
112 .flags = IORESOURCE_MEM, 111 .flags = IORESOURCE_MEM,
113 }, 112 },
114 { 113 {
115 .start = INT_24XX_CAM_IRQ, 114 .start = 24 + OMAP_INTC_START,
116 .flags = IORESOURCE_IRQ, 115 .flags = IORESOURCE_IRQ,
117 } 116 }
118}; 117};
@@ -201,7 +200,7 @@ static struct resource omap3isp_resources[] = {
201 .flags = IORESOURCE_MEM, 200 .flags = IORESOURCE_MEM,
202 }, 201 },
203 { 202 {
204 .start = INT_34XX_CAM_IRQ, 203 .start = 24 + OMAP_INTC_START,
205 .flags = IORESOURCE_IRQ, 204 .flags = IORESOURCE_IRQ,
206 } 205 }
207}; 206};
@@ -385,7 +384,7 @@ static inline void omap_init_hdmi_audio(void) {}
385 384
386#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) 385#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
387 386
388#include <plat/mcspi.h> 387#include <linux/platform_data/spi-omap2-mcspi.h>
389 388
390static int __init omap_mcspi_init(struct omap_hwmod *oh, void *unused) 389static int __init omap_mcspi_init(struct omap_hwmod *oh, void *unused)
391{ 390{
@@ -434,37 +433,24 @@ static void omap_init_mcspi(void)
434static inline void omap_init_mcspi(void) {} 433static inline void omap_init_mcspi(void) {}
435#endif 434#endif
436 435
437static struct resource omap2_pmu_resource = { 436/**
438 .start = 3, 437 * omap_init_rng - bind the RNG hwmod to the RNG omap_device
439 .end = 3, 438 *
440 .flags = IORESOURCE_IRQ, 439 * Bind the RNG hwmod to the RNG omap_device. No return value.
441}; 440 */
442 441static void omap_init_rng(void)
443static struct resource omap3_pmu_resource = {
444 .start = INT_34XX_BENCH_MPU_EMUL,
445 .end = INT_34XX_BENCH_MPU_EMUL,
446 .flags = IORESOURCE_IRQ,
447};
448
449static struct platform_device omap_pmu_device = {
450 .name = "arm-pmu",
451 .id = ARM_PMU_DEVICE_CPU,
452 .num_resources = 1,
453};
454
455static void omap_init_pmu(void)
456{ 442{
457 if (cpu_is_omap24xx()) 443 struct omap_hwmod *oh;
458 omap_pmu_device.resource = &omap2_pmu_resource; 444 struct platform_device *pdev;
459 else if (cpu_is_omap34xx()) 445
460 omap_pmu_device.resource = &omap3_pmu_resource; 446 oh = omap_hwmod_lookup("rng");
461 else 447 if (!oh)
462 return; 448 return;
463 449
464 platform_device_register(&omap_pmu_device); 450 pdev = omap_device_build("omap_rng", -1, oh, NULL, 0, NULL, 0, 0);
451 WARN(IS_ERR(pdev), "Can't build omap_device for omap_rng\n");
465} 452}
466 453
467
468#if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE) 454#if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE)
469 455
470#ifdef CONFIG_ARCH_OMAP2 456#ifdef CONFIG_ARCH_OMAP2
@@ -475,7 +461,7 @@ static struct resource omap2_sham_resources[] = {
475 .flags = IORESOURCE_MEM, 461 .flags = IORESOURCE_MEM,
476 }, 462 },
477 { 463 {
478 .start = INT_24XX_SHA1MD5, 464 .start = 51 + OMAP_INTC_START,
479 .flags = IORESOURCE_IRQ, 465 .flags = IORESOURCE_IRQ,
480 } 466 }
481}; 467};
@@ -493,7 +479,7 @@ static struct resource omap3_sham_resources[] = {
493 .flags = IORESOURCE_MEM, 479 .flags = IORESOURCE_MEM,
494 }, 480 },
495 { 481 {
496 .start = INT_34XX_SHA1MD52_IRQ, 482 .start = 49 + OMAP_INTC_START,
497 .flags = IORESOURCE_IRQ, 483 .flags = IORESOURCE_IRQ,
498 }, 484 },
499 { 485 {
@@ -631,6 +617,10 @@ static inline void omap_init_vout(void) {}
631 617
632static int __init omap2_init_devices(void) 618static int __init omap2_init_devices(void)
633{ 619{
620 /* Enable dummy states for those platforms without pinctrl support */
621 if (!of_have_populated_dt())
622 pinctrl_provide_dummies();
623
634 /* 624 /*
635 * please keep these calls, and their implementations above, 625 * please keep these calls, and their implementations above,
636 * in alphabetical order so they're easier to sort through. 626 * in alphabetical order so they're easier to sort through.
@@ -645,8 +635,8 @@ static int __init omap2_init_devices(void)
645 omap_init_mcpdm(); 635 omap_init_mcpdm();
646 omap_init_mcspi(); 636 omap_init_mcspi();
647 } 637 }
648 omap_init_pmu();
649 omap_init_sti(); 638 omap_init_sti();
639 omap_init_rng();
650 omap_init_sham(); 640 omap_init_sham();
651 omap_init_aes(); 641 omap_init_aes();
652 omap_init_vout(); 642 omap_init_vout();
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index af1ed7d24a1..1011995f150 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -76,14 +76,14 @@ struct omap_dss_hwmod_data {
76 const int id; 76 const int id;
77}; 77};
78 78
79static const struct omap_dss_hwmod_data omap2_dss_hwmod_data[] __initdata = { 79static const struct omap_dss_hwmod_data omap2_dss_hwmod_data[] __initconst = {
80 { "dss_core", "omapdss_dss", -1 }, 80 { "dss_core", "omapdss_dss", -1 },
81 { "dss_dispc", "omapdss_dispc", -1 }, 81 { "dss_dispc", "omapdss_dispc", -1 },
82 { "dss_rfbi", "omapdss_rfbi", -1 }, 82 { "dss_rfbi", "omapdss_rfbi", -1 },
83 { "dss_venc", "omapdss_venc", -1 }, 83 { "dss_venc", "omapdss_venc", -1 },
84}; 84};
85 85
86static const struct omap_dss_hwmod_data omap3_dss_hwmod_data[] __initdata = { 86static const struct omap_dss_hwmod_data omap3_dss_hwmod_data[] __initconst = {
87 { "dss_core", "omapdss_dss", -1 }, 87 { "dss_core", "omapdss_dss", -1 },
88 { "dss_dispc", "omapdss_dispc", -1 }, 88 { "dss_dispc", "omapdss_dispc", -1 },
89 { "dss_rfbi", "omapdss_rfbi", -1 }, 89 { "dss_rfbi", "omapdss_rfbi", -1 },
@@ -91,11 +91,10 @@ static const struct omap_dss_hwmod_data omap3_dss_hwmod_data[] __initdata = {
91 { "dss_dsi1", "omapdss_dsi", 0 }, 91 { "dss_dsi1", "omapdss_dsi", 0 },
92}; 92};
93 93
94static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = { 94static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initconst = {
95 { "dss_core", "omapdss_dss", -1 }, 95 { "dss_core", "omapdss_dss", -1 },
96 { "dss_dispc", "omapdss_dispc", -1 }, 96 { "dss_dispc", "omapdss_dispc", -1 },
97 { "dss_rfbi", "omapdss_rfbi", -1 }, 97 { "dss_rfbi", "omapdss_rfbi", -1 },
98 { "dss_venc", "omapdss_venc", -1 },
99 { "dss_dsi1", "omapdss_dsi", 0 }, 98 { "dss_dsi1", "omapdss_dsi", 0 },
100 { "dss_dsi2", "omapdss_dsi", 1 }, 99 { "dss_dsi2", "omapdss_dsi", 1 },
101 { "dss_hdmi", "omapdss_hdmi", -1 }, 100 { "dss_hdmi", "omapdss_hdmi", -1 },
@@ -221,7 +220,7 @@ static struct platform_device *create_dss_pdev(const char *pdev_name,
221 220
222 ohs[0] = oh; 221 ohs[0] = oh;
223 od = omap_device_alloc(pdev, ohs, 1, NULL, 0); 222 od = omap_device_alloc(pdev, ohs, 1, NULL, 0);
224 if (!od) { 223 if (IS_ERR(od)) {
225 pr_err("Could not alloc omap_device for %s\n", pdev_name); 224 pr_err("Could not alloc omap_device for %s\n", pdev_name);
226 r = -ENOMEM; 225 r = -ENOMEM;
227 goto err; 226 goto err;
@@ -488,7 +487,7 @@ int omap_dss_reset(struct omap_hwmod *oh)
488 487
489 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) 488 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
490 if (oc->_clk) 489 if (oc->_clk)
491 clk_enable(oc->_clk); 490 clk_prepare_enable(oc->_clk);
492 491
493 dispc_disable_outputs(); 492 dispc_disable_outputs();
494 493
@@ -515,7 +514,7 @@ int omap_dss_reset(struct omap_hwmod *oh)
515 514
516 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) 515 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
517 if (oc->_clk) 516 if (oc->_clk)
518 clk_disable(oc->_clk); 517 clk_disable_unprepare(oc->_clk);
519 518
520 r = (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 0; 519 r = (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 0;
521 520
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index b9c8d2f6a81..814e1808e15 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -28,9 +28,9 @@
28#include <linux/bitops.h> 28#include <linux/bitops.h>
29#include <linux/clkdev.h> 29#include <linux/clkdev.h>
30 30
31#include <plat/cpu.h>
32#include <plat/clock.h> 31#include <plat/clock.h>
33 32
33#include "soc.h"
34#include "clock.h" 34#include "clock.h"
35#include "cm2xxx_3xxx.h" 35#include "cm2xxx_3xxx.h"
36#include "cm-regbits-34xx.h" 36#include "cm-regbits-34xx.h"
@@ -63,8 +63,10 @@ static int _omap3_wait_dpll_status(struct clk *clk, u8 state)
63 const struct dpll_data *dd; 63 const struct dpll_data *dd;
64 int i = 0; 64 int i = 0;
65 int ret = -EINVAL; 65 int ret = -EINVAL;
66 const char *clk_name;
66 67
67 dd = clk->dpll_data; 68 dd = clk->dpll_data;
69 clk_name = __clk_get_name(clk);
68 70
69 state <<= __ffs(dd->idlest_mask); 71 state <<= __ffs(dd->idlest_mask);
70 72
@@ -76,10 +78,10 @@ static int _omap3_wait_dpll_status(struct clk *clk, u8 state)
76 78
77 if (i == MAX_DPLL_WAIT_TRIES) { 79 if (i == MAX_DPLL_WAIT_TRIES) {
78 printk(KERN_ERR "clock: %s failed transition to '%s'\n", 80 printk(KERN_ERR "clock: %s failed transition to '%s'\n",
79 clk->name, (state) ? "locked" : "bypassed"); 81 clk_name, (state) ? "locked" : "bypassed");
80 } else { 82 } else {
81 pr_debug("clock: %s transition to '%s' in %d loops\n", 83 pr_debug("clock: %s transition to '%s' in %d loops\n",
82 clk->name, (state) ? "locked" : "bypassed", i); 84 clk_name, (state) ? "locked" : "bypassed", i);
83 85
84 ret = 0; 86 ret = 0;
85 } 87 }
@@ -93,7 +95,7 @@ static u16 _omap3_dpll_compute_freqsel(struct clk *clk, u8 n)
93 unsigned long fint; 95 unsigned long fint;
94 u16 f = 0; 96 u16 f = 0;
95 97
96 fint = clk->dpll_data->clk_ref->rate / n; 98 fint = __clk_get_rate(clk->dpll_data->clk_ref) / n;
97 99
98 pr_debug("clock: fint is %lu\n", fint); 100 pr_debug("clock: fint is %lu\n", fint);
99 101
@@ -140,7 +142,7 @@ static int _omap3_noncore_dpll_lock(struct clk *clk)
140 u8 state = 1; 142 u8 state = 1;
141 int r = 0; 143 int r = 0;
142 144
143 pr_debug("clock: locking DPLL %s\n", clk->name); 145 pr_debug("clock: locking DPLL %s\n", __clk_get_name(clk));
144 146
145 dd = clk->dpll_data; 147 dd = clk->dpll_data;
146 state <<= __ffs(dd->idlest_mask); 148 state <<= __ffs(dd->idlest_mask);
@@ -187,7 +189,7 @@ static int _omap3_noncore_dpll_bypass(struct clk *clk)
187 return -EINVAL; 189 return -EINVAL;
188 190
189 pr_debug("clock: configuring DPLL %s for low-power bypass\n", 191 pr_debug("clock: configuring DPLL %s for low-power bypass\n",
190 clk->name); 192 __clk_get_name(clk));
191 193
192 ai = omap3_dpll_autoidle_read(clk); 194 ai = omap3_dpll_autoidle_read(clk);
193 195
@@ -217,7 +219,7 @@ static int _omap3_noncore_dpll_stop(struct clk *clk)
217 if (!(clk->dpll_data->modes & (1 << DPLL_LOW_POWER_STOP))) 219 if (!(clk->dpll_data->modes & (1 << DPLL_LOW_POWER_STOP)))
218 return -EINVAL; 220 return -EINVAL;
219 221
220 pr_debug("clock: stopping DPLL %s\n", clk->name); 222 pr_debug("clock: stopping DPLL %s\n", __clk_get_name(clk));
221 223
222 ai = omap3_dpll_autoidle_read(clk); 224 ai = omap3_dpll_autoidle_read(clk);
223 225
@@ -245,7 +247,7 @@ static void _lookup_dco(struct clk *clk, u8 *dco, u16 m, u8 n)
245{ 247{
246 unsigned long fint, clkinp; /* watch out for overflow */ 248 unsigned long fint, clkinp; /* watch out for overflow */
247 249
248 clkinp = clk->parent->rate; 250 clkinp = __clk_get_rate(__clk_get_parent(clk));
249 fint = (clkinp / n) * m; 251 fint = (clkinp / n) * m;
250 252
251 if (fint < 1000000000) 253 if (fint < 1000000000)
@@ -271,7 +273,7 @@ static void _lookup_sddiv(struct clk *clk, u8 *sd_div, u16 m, u8 n)
271 unsigned long clkinp, sd; /* watch out for overflow */ 273 unsigned long clkinp, sd; /* watch out for overflow */
272 int mod1, mod2; 274 int mod1, mod2;
273 275
274 clkinp = clk->parent->rate; 276 clkinp = __clk_get_rate(__clk_get_parent(clk));
275 277
276 /* 278 /*
277 * target sigma-delta to near 250MHz 279 * target sigma-delta to near 250MHz
@@ -311,7 +313,7 @@ static int omap3_noncore_dpll_program(struct clk *clk, u16 m, u8 n, u16 freqsel)
311 * Set jitter correction. No jitter correction for OMAP4 and 3630 313 * Set jitter correction. No jitter correction for OMAP4 and 3630
312 * since freqsel field is no longer present 314 * since freqsel field is no longer present
313 */ 315 */
314 if (!cpu_is_omap44xx() && !cpu_is_omap3630()) { 316 if (!soc_is_am33xx() && !cpu_is_omap44xx() && !cpu_is_omap3630()) {
315 v = __raw_readl(dd->control_reg); 317 v = __raw_readl(dd->control_reg);
316 v &= ~dd->freqsel_mask; 318 v &= ~dd->freqsel_mask;
317 v |= freqsel << __ffs(dd->freqsel_mask); 319 v |= freqsel << __ffs(dd->freqsel_mask);
@@ -380,16 +382,19 @@ int omap3_noncore_dpll_enable(struct clk *clk)
380{ 382{
381 int r; 383 int r;
382 struct dpll_data *dd; 384 struct dpll_data *dd;
385 struct clk *parent;
383 386
384 dd = clk->dpll_data; 387 dd = clk->dpll_data;
385 if (!dd) 388 if (!dd)
386 return -EINVAL; 389 return -EINVAL;
387 390
388 if (clk->rate == dd->clk_bypass->rate) { 391 parent = __clk_get_parent(clk);
389 WARN_ON(clk->parent != dd->clk_bypass); 392
393 if (__clk_get_rate(clk) == __clk_get_rate(dd->clk_bypass)) {
394 WARN_ON(parent != dd->clk_bypass);
390 r = _omap3_noncore_dpll_bypass(clk); 395 r = _omap3_noncore_dpll_bypass(clk);
391 } else { 396 } else {
392 WARN_ON(clk->parent != dd->clk_ref); 397 WARN_ON(parent != dd->clk_ref);
393 r = _omap3_noncore_dpll_lock(clk); 398 r = _omap3_noncore_dpll_lock(clk);
394 } 399 }
395 /* 400 /*
@@ -432,7 +437,7 @@ void omap3_noncore_dpll_disable(struct clk *clk)
432int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate) 437int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
433{ 438{
434 struct clk *new_parent = NULL; 439 struct clk *new_parent = NULL;
435 unsigned long hw_rate; 440 unsigned long hw_rate, bypass_rate;
436 u16 freqsel = 0; 441 u16 freqsel = 0;
437 struct dpll_data *dd; 442 struct dpll_data *dd;
438 int ret; 443 int ret;
@@ -456,7 +461,8 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
456 omap2_clk_enable(dd->clk_bypass); 461 omap2_clk_enable(dd->clk_bypass);
457 omap2_clk_enable(dd->clk_ref); 462 omap2_clk_enable(dd->clk_ref);
458 463
459 if (dd->clk_bypass->rate == rate && 464 bypass_rate = __clk_get_rate(dd->clk_bypass);
465 if (bypass_rate == rate &&
460 (clk->dpll_data->modes & (1 << DPLL_LOW_POWER_BYPASS))) { 466 (clk->dpll_data->modes & (1 << DPLL_LOW_POWER_BYPASS))) {
461 pr_debug("clock: %s: set rate: entering bypass.\n", clk->name); 467 pr_debug("clock: %s: set rate: entering bypass.\n", clk->name);
462 468
@@ -471,7 +477,7 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
471 return -EINVAL; 477 return -EINVAL;
472 478
473 /* No freqsel on OMAP4 and OMAP3630 */ 479 /* No freqsel on OMAP4 and OMAP3630 */
474 if (!cpu_is_omap44xx() && !cpu_is_omap3630()) { 480 if (!soc_is_am33xx() && !cpu_is_omap44xx() && !cpu_is_omap3630()) {
475 freqsel = _omap3_dpll_compute_freqsel(clk, 481 freqsel = _omap3_dpll_compute_freqsel(clk,
476 dd->last_rounded_n); 482 dd->last_rounded_n);
477 if (!freqsel) 483 if (!freqsel)
@@ -479,7 +485,7 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
479 } 485 }
480 486
481 pr_debug("clock: %s: set rate: locking rate to %lu.\n", 487 pr_debug("clock: %s: set rate: locking rate to %lu.\n",
482 clk->name, rate); 488 __clk_get_name(clk), rate);
483 489
484 ret = omap3_noncore_dpll_program(clk, dd->last_rounded_m, 490 ret = omap3_noncore_dpll_program(clk, dd->last_rounded_m,
485 dd->last_rounded_n, freqsel); 491 dd->last_rounded_n, freqsel);
@@ -557,7 +563,7 @@ void omap3_dpll_allow_idle(struct clk *clk)
557 563
558 if (!dd->autoidle_reg) { 564 if (!dd->autoidle_reg) {
559 pr_debug("clock: DPLL %s: autoidle not supported\n", 565 pr_debug("clock: DPLL %s: autoidle not supported\n",
560 clk->name); 566 __clk_get_name(clk));
561 return; 567 return;
562 } 568 }
563 569
@@ -591,7 +597,7 @@ void omap3_dpll_deny_idle(struct clk *clk)
591 597
592 if (!dd->autoidle_reg) { 598 if (!dd->autoidle_reg) {
593 pr_debug("clock: DPLL %s: autoidle not supported\n", 599 pr_debug("clock: DPLL %s: autoidle not supported\n",
594 clk->name); 600 __clk_get_name(clk));
595 return; 601 return;
596 } 602 }
597 603
@@ -617,25 +623,30 @@ unsigned long omap3_clkoutx2_recalc(struct clk *clk)
617 unsigned long rate; 623 unsigned long rate;
618 u32 v; 624 u32 v;
619 struct clk *pclk; 625 struct clk *pclk;
626 unsigned long parent_rate;
620 627
621 /* Walk up the parents of clk, looking for a DPLL */ 628 /* Walk up the parents of clk, looking for a DPLL */
622 pclk = clk->parent; 629 pclk = __clk_get_parent(clk);
623 while (pclk && !pclk->dpll_data) 630 while (pclk && !pclk->dpll_data)
624 pclk = pclk->parent; 631 pclk = __clk_get_parent(pclk);
625 632
626 /* clk does not have a DPLL as a parent? */ 633 /* clk does not have a DPLL as a parent? error in the clock data */
627 WARN_ON(!pclk); 634 if (!pclk) {
635 WARN_ON(1);
636 return 0;
637 }
628 638
629 dd = pclk->dpll_data; 639 dd = pclk->dpll_data;
630 640
631 WARN_ON(!dd->enable_mask); 641 WARN_ON(!dd->enable_mask);
632 642
643 parent_rate = __clk_get_rate(__clk_get_parent(clk));
633 v = __raw_readl(dd->control_reg) & dd->enable_mask; 644 v = __raw_readl(dd->control_reg) & dd->enable_mask;
634 v >>= __ffs(dd->enable_mask); 645 v >>= __ffs(dd->enable_mask);
635 if ((v != OMAP3XXX_EN_DPLL_LOCKED) || (dd->flags & DPLL_J_TYPE)) 646 if ((v != OMAP3XXX_EN_DPLL_LOCKED) || (dd->flags & DPLL_J_TYPE))
636 rate = clk->parent->rate; 647 rate = parent_rate;
637 else 648 else
638 rate = clk->parent->rate * 2; 649 rate = parent_rate * 2;
639 return rate; 650 return rate;
640} 651}
641 652
diff --git a/arch/arm/mach-omap2/dpll44xx.c b/arch/arm/mach-omap2/dpll44xx.c
index 9c6a296b3dc..09d0ccccb86 100644
--- a/arch/arm/mach-omap2/dpll44xx.c
+++ b/arch/arm/mach-omap2/dpll44xx.c
@@ -15,9 +15,9 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17 17
18#include <plat/cpu.h>
19#include <plat/clock.h> 18#include <plat/clock.h>
20 19
20#include "soc.h"
21#include "clock.h" 21#include "clock.h"
22#include "clock44xx.h" 22#include "clock44xx.h"
23#include "cm-regbits-44xx.h" 23#include "cm-regbits-44xx.h"
diff --git a/arch/arm/mach-omap2/dsp.c b/arch/arm/mach-omap2/dsp.c
index a636ebc16b3..98388109f22 100644
--- a/arch/arm/mach-omap2/dsp.c
+++ b/arch/arm/mach-omap2/dsp.c
@@ -30,7 +30,7 @@
30#include <plat/omap-pm.h> 30#include <plat/omap-pm.h>
31#endif 31#endif
32 32
33#include <plat/dsp.h> 33#include <linux/platform_data/dsp-omap.h>
34 34
35static struct platform_device *omap_dsp_pdev; 35static struct platform_device *omap_dsp_pdev;
36 36
diff --git a/arch/arm/mach-omap2/emu.c b/arch/arm/mach-omap2/emu.c
index e28e761b7ab..b3566f68a55 100644
--- a/arch/arm/mach-omap2/emu.c
+++ b/arch/arm/mach-omap2/emu.c
@@ -21,8 +21,7 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/err.h> 22#include <linux/err.h>
23 23
24#include <mach/hardware.h> 24#include "soc.h"
25
26#include "iomap.h" 25#include "iomap.h"
27 26
28MODULE_LICENSE("GPL"); 27MODULE_LICENSE("GPL");
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 9ad7d489b0d..d1058f16fb4 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -21,6 +21,7 @@
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/platform_data/gpio-omap.h>
24 25
25#include <plat/omap_hwmod.h> 26#include <plat/omap_hwmod.h>
26#include <plat/omap_device.h> 27#include <plat/omap_device.h>
@@ -60,6 +61,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
60 pdata->regs = kzalloc(sizeof(struct omap_gpio_reg_offs), GFP_KERNEL); 61 pdata->regs = kzalloc(sizeof(struct omap_gpio_reg_offs), GFP_KERNEL);
61 if (!pdata->regs) { 62 if (!pdata->regs) {
62 pr_err("gpio%d: Memory allocation failed\n", id); 63 pr_err("gpio%d: Memory allocation failed\n", id);
64 kfree(pdata);
63 return -ENOMEM; 65 return -ENOMEM;
64 } 66 }
65 67
@@ -121,6 +123,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
121 break; 123 break;
122 default: 124 default:
123 WARN(1, "Invalid gpio bank_type\n"); 125 WARN(1, "Invalid gpio bank_type\n");
126 kfree(pdata->regs);
124 kfree(pdata); 127 kfree(pdata);
125 return -EINVAL; 128 return -EINVAL;
126 } 129 }
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 386dec8d235..4acf497faeb 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -13,23 +13,31 @@
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/mtd/nand.h> 15#include <linux/mtd/nand.h>
16#include <linux/platform_data/mtd-nand-omap2.h>
16 17
17#include <asm/mach/flash.h> 18#include <asm/mach/flash.h>
18 19
19#include <plat/cpu.h>
20#include <plat/nand.h>
21#include <plat/board.h>
22#include <plat/gpmc.h> 20#include <plat/gpmc.h>
23 21
24static struct resource gpmc_nand_resource = { 22#include "soc.h"
25 .flags = IORESOURCE_MEM, 23
24static struct resource gpmc_nand_resource[] = {
25 {
26 .flags = IORESOURCE_MEM,
27 },
28 {
29 .flags = IORESOURCE_IRQ,
30 },
31 {
32 .flags = IORESOURCE_IRQ,
33 },
26}; 34};
27 35
28static struct platform_device gpmc_nand_device = { 36static struct platform_device gpmc_nand_device = {
29 .name = "omap2-nand", 37 .name = "omap2-nand",
30 .id = 0, 38 .id = 0,
31 .num_resources = 1, 39 .num_resources = ARRAY_SIZE(gpmc_nand_resource),
32 .resource = &gpmc_nand_resource, 40 .resource = gpmc_nand_resource,
33}; 41};
34 42
35static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data) 43static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data)
@@ -75,6 +83,7 @@ static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data
75 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0); 83 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
76 gpmc_cs_configure(gpmc_nand_data->cs, 84 gpmc_cs_configure(gpmc_nand_data->cs,
77 GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND); 85 GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
86 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_WP, 0);
78 err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); 87 err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t);
79 if (err) 88 if (err)
80 return err; 89 return err;
@@ -90,12 +99,19 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data)
90 gpmc_nand_device.dev.platform_data = gpmc_nand_data; 99 gpmc_nand_device.dev.platform_data = gpmc_nand_data;
91 100
92 err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE, 101 err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE,
93 &gpmc_nand_data->phys_base); 102 (unsigned long *)&gpmc_nand_resource[0].start);
94 if (err < 0) { 103 if (err < 0) {
95 dev_err(dev, "Cannot request GPMC CS\n"); 104 dev_err(dev, "Cannot request GPMC CS\n");
96 return err; 105 return err;
97 } 106 }
98 107
108 gpmc_nand_resource[0].end = gpmc_nand_resource[0].start +
109 NAND_IO_SIZE - 1;
110
111 gpmc_nand_resource[1].start =
112 gpmc_get_client_irq(GPMC_IRQ_FIFOEVENTENABLE);
113 gpmc_nand_resource[2].start =
114 gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT);
99 /* Set timings in GPMC */ 115 /* Set timings in GPMC */
100 err = omap2_nand_gpmc_retime(gpmc_nand_data); 116 err = omap2_nand_gpmc_retime(gpmc_nand_data);
101 if (err < 0) { 117 if (err < 0) {
@@ -108,6 +124,8 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data)
108 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_RDY_BSY, 1); 124 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_RDY_BSY, 1);
109 } 125 }
110 126
127 gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs);
128
111 err = platform_device_register(&gpmc_nand_device); 129 err = platform_device_register(&gpmc_nand_device);
112 if (err < 0) { 130 if (err < 0) {
113 dev_err(dev, "Unable to register NAND device\n"); 131 dev_err(dev, "Unable to register NAND device\n");
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index a0fa9bb2bda..916716e1da3 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -15,19 +15,27 @@
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/mtd/onenand_regs.h> 16#include <linux/mtd/onenand_regs.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/platform_data/mtd-onenand-omap2.h>
18 19
19#include <asm/mach/flash.h> 20#include <asm/mach/flash.h>
20 21
21#include <plat/cpu.h>
22#include <plat/onenand.h>
23#include <plat/board.h>
24#include <plat/gpmc.h> 22#include <plat/gpmc.h>
25 23
24#include "soc.h"
25
26#define ONENAND_IO_SIZE SZ_128K
27
26static struct omap_onenand_platform_data *gpmc_onenand_data; 28static struct omap_onenand_platform_data *gpmc_onenand_data;
27 29
30static struct resource gpmc_onenand_resource = {
31 .flags = IORESOURCE_MEM,
32};
33
28static struct platform_device gpmc_onenand_device = { 34static struct platform_device gpmc_onenand_device = {
29 .name = "omap2-onenand", 35 .name = "omap2-onenand",
30 .id = -1, 36 .id = -1,
37 .num_resources = 1,
38 .resource = &gpmc_onenand_resource,
31}; 39};
32 40
33static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) 41static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
@@ -390,6 +398,8 @@ static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr)
390 398
391void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data) 399void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
392{ 400{
401 int err;
402
393 gpmc_onenand_data = _onenand_data; 403 gpmc_onenand_data = _onenand_data;
394 gpmc_onenand_data->onenand_setup = gpmc_onenand_setup; 404 gpmc_onenand_data->onenand_setup = gpmc_onenand_setup;
395 gpmc_onenand_device.dev.platform_data = gpmc_onenand_data; 405 gpmc_onenand_device.dev.platform_data = gpmc_onenand_data;
@@ -401,8 +411,19 @@ void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
401 gpmc_onenand_data->flags |= ONENAND_SYNC_READ; 411 gpmc_onenand_data->flags |= ONENAND_SYNC_READ;
402 } 412 }
403 413
414 err = gpmc_cs_request(gpmc_onenand_data->cs, ONENAND_IO_SIZE,
415 (unsigned long *)&gpmc_onenand_resource.start);
416 if (err < 0) {
417 pr_err("%s: Cannot request GPMC CS\n", __func__);
418 return;
419 }
420
421 gpmc_onenand_resource.end = gpmc_onenand_resource.start +
422 ONENAND_IO_SIZE - 1;
423
404 if (platform_device_register(&gpmc_onenand_device) < 0) { 424 if (platform_device_register(&gpmc_onenand_device) < 0) {
405 printk(KERN_ERR "Unable to register OneNAND device\n"); 425 pr_err("%s: Unable to register OneNAND device\n", __func__);
426 gpmc_cs_free(gpmc_onenand_data->cs);
406 return; 427 return;
407 } 428 }
408} 429}
diff --git a/arch/arm/mach-omap2/gpmc-smc91x.c b/arch/arm/mach-omap2/gpmc-smc91x.c
index ba10c24f3d8..56547531037 100644
--- a/arch/arm/mach-omap2/gpmc-smc91x.c
+++ b/arch/arm/mach-omap2/gpmc-smc91x.c
@@ -17,9 +17,10 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/smc91x.h> 18#include <linux/smc91x.h>
19 19
20#include <plat/board.h>
21#include <plat/gpmc.h> 20#include <plat/gpmc.h>
22#include <plat/gpmc-smc91x.h> 21#include "gpmc-smc91x.h"
22
23#include "soc.h"
23 24
24static struct omap_smc91x_platform_data *gpmc_cfg; 25static struct omap_smc91x_platform_data *gpmc_cfg;
25 26
diff --git a/arch/arm/plat-omap/include/plat/gpmc-smc91x.h b/arch/arm/mach-omap2/gpmc-smc91x.h
index b64fbee4d56..b64fbee4d56 100644
--- a/arch/arm/plat-omap/include/plat/gpmc-smc91x.h
+++ b/arch/arm/mach-omap2/gpmc-smc91x.h
diff --git a/arch/arm/mach-omap2/gpmc-smsc911x.c b/arch/arm/mach-omap2/gpmc-smsc911x.c
index b6c77be3e8f..249a0b440cd 100644
--- a/arch/arm/mach-omap2/gpmc-smsc911x.c
+++ b/arch/arm/mach-omap2/gpmc-smsc911x.c
@@ -20,9 +20,8 @@
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/smsc911x.h> 21#include <linux/smsc911x.h>
22 22
23#include <plat/board.h>
24#include <plat/gpmc.h> 23#include <plat/gpmc.h>
25#include <plat/gpmc-smsc911x.h> 24#include "gpmc-smsc911x.h"
26 25
27static struct resource gpmc_smsc911x_resources[] = { 26static struct resource gpmc_smsc911x_resources[] = {
28 [0] = { 27 [0] = {
diff --git a/arch/arm/plat-omap/include/plat/gpmc-smsc911x.h b/arch/arm/mach-omap2/gpmc-smsc911x.h
index ea6c9c88c72..ea6c9c88c72 100644
--- a/arch/arm/plat-omap/include/plat/gpmc-smsc911x.h
+++ b/arch/arm/mach-omap2/gpmc-smsc911x.h
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index b2b5759ab0f..5ac5cf30406 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -24,11 +24,20 @@
24#include <linux/io.h> 24#include <linux/io.h>
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 28
28#include <asm/mach-types.h> 29#include <asm/mach-types.h>
29#include <plat/gpmc.h> 30#include <plat/gpmc.h>
30 31
32#include <plat/cpu.h>
33#include <plat/gpmc.h>
31#include <plat/sdrc.h> 34#include <plat/sdrc.h>
35#include <plat/omap_device.h>
36
37#include "soc.h"
38#include "common.h"
39
40#define DEVICE_NAME "omap-gpmc"
32 41
33/* GPMC register offsets */ 42/* GPMC register offsets */
34#define GPMC_REVISION 0x00 43#define GPMC_REVISION 0x00
@@ -78,6 +87,21 @@
78#define ENABLE_PREFETCH (0x1 << 7) 87#define ENABLE_PREFETCH (0x1 << 7)
79#define DMA_MPU_MODE 2 88#define DMA_MPU_MODE 2
80 89
90#define GPMC_REVISION_MAJOR(l) ((l >> 4) & 0xf)
91#define GPMC_REVISION_MINOR(l) (l & 0xf)
92
93#define GPMC_HAS_WR_ACCESS 0x1
94#define GPMC_HAS_WR_DATA_MUX_BUS 0x2
95
96/* XXX: Only NAND irq has been considered,currently these are the only ones used
97 */
98#define GPMC_NR_IRQ 2
99
100struct gpmc_client_irq {
101 unsigned irq;
102 u32 bitmask;
103};
104
81/* Structure to save gpmc cs context */ 105/* Structure to save gpmc cs context */
82struct gpmc_cs_config { 106struct gpmc_cs_config {
83 u32 config1; 107 u32 config1;
@@ -105,12 +129,19 @@ struct omap3_gpmc_regs {
105 struct gpmc_cs_config cs_context[GPMC_CS_NUM]; 129 struct gpmc_cs_config cs_context[GPMC_CS_NUM];
106}; 130};
107 131
132static struct gpmc_client_irq gpmc_client_irq[GPMC_NR_IRQ];
133static struct irq_chip gpmc_irq_chip;
134static unsigned gpmc_irq_start;
135
108static struct resource gpmc_mem_root; 136static struct resource gpmc_mem_root;
109static struct resource gpmc_cs_mem[GPMC_CS_NUM]; 137static struct resource gpmc_cs_mem[GPMC_CS_NUM];
110static DEFINE_SPINLOCK(gpmc_mem_lock); 138static DEFINE_SPINLOCK(gpmc_mem_lock);
111static unsigned int gpmc_cs_map; /* flag for cs which are initialized */ 139static unsigned int gpmc_cs_map; /* flag for cs which are initialized */
112static int gpmc_ecc_used = -EINVAL; /* cs using ecc engine */ 140static int gpmc_ecc_used = -EINVAL; /* cs using ecc engine */
113 141static struct device *gpmc_dev;
142static int gpmc_irq;
143static resource_size_t phys_base, mem_size;
144static unsigned gpmc_capability;
114static void __iomem *gpmc_base; 145static void __iomem *gpmc_base;
115 146
116static struct clk *gpmc_l3_clk; 147static struct clk *gpmc_l3_clk;
@@ -279,7 +310,7 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
279 310
280 div = gpmc_cs_calc_divider(cs, t->sync_clk); 311 div = gpmc_cs_calc_divider(cs, t->sync_clk);
281 if (div < 0) 312 if (div < 0)
282 return -1; 313 return div;
283 314
284 GPMC_SET_ONE(GPMC_CS_CONFIG2, 0, 3, cs_on); 315 GPMC_SET_ONE(GPMC_CS_CONFIG2, 0, 3, cs_on);
285 GPMC_SET_ONE(GPMC_CS_CONFIG2, 8, 12, cs_rd_off); 316 GPMC_SET_ONE(GPMC_CS_CONFIG2, 8, 12, cs_rd_off);
@@ -300,10 +331,10 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
300 331
301 GPMC_SET_ONE(GPMC_CS_CONFIG5, 24, 27, page_burst_access); 332 GPMC_SET_ONE(GPMC_CS_CONFIG5, 24, 27, page_burst_access);
302 333
303 if (cpu_is_omap34xx()) { 334 if (gpmc_capability & GPMC_HAS_WR_DATA_MUX_BUS)
304 GPMC_SET_ONE(GPMC_CS_CONFIG6, 16, 19, wr_data_mux_bus); 335 GPMC_SET_ONE(GPMC_CS_CONFIG6, 16, 19, wr_data_mux_bus);
336 if (gpmc_capability & GPMC_HAS_WR_ACCESS)
305 GPMC_SET_ONE(GPMC_CS_CONFIG6, 24, 28, wr_access); 337 GPMC_SET_ONE(GPMC_CS_CONFIG6, 24, 28, wr_access);
306 }
307 338
308 /* caller is expected to have initialized CONFIG1 to cover 339 /* caller is expected to have initialized CONFIG1 to cover
309 * at least sync vs async 340 * at least sync vs async
@@ -413,6 +444,20 @@ static int gpmc_cs_insert_mem(int cs, unsigned long base, unsigned long size)
413 return r; 444 return r;
414} 445}
415 446
447static int gpmc_cs_delete_mem(int cs)
448{
449 struct resource *res = &gpmc_cs_mem[cs];
450 int r;
451
452 spin_lock(&gpmc_mem_lock);
453 r = release_resource(&gpmc_cs_mem[cs]);
454 res->start = 0;
455 res->end = 0;
456 spin_unlock(&gpmc_mem_lock);
457
458 return r;
459}
460
416int gpmc_cs_request(int cs, unsigned long size, unsigned long *base) 461int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)
417{ 462{
418 struct resource *res = &gpmc_cs_mem[cs]; 463 struct resource *res = &gpmc_cs_mem[cs];
@@ -682,7 +727,148 @@ int gpmc_prefetch_reset(int cs)
682} 727}
683EXPORT_SYMBOL(gpmc_prefetch_reset); 728EXPORT_SYMBOL(gpmc_prefetch_reset);
684 729
685static void __init gpmc_mem_init(void) 730void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
731{
732 reg->gpmc_status = gpmc_base + GPMC_STATUS;
733 reg->gpmc_nand_command = gpmc_base + GPMC_CS0_OFFSET +
734 GPMC_CS_NAND_COMMAND + GPMC_CS_SIZE * cs;
735 reg->gpmc_nand_address = gpmc_base + GPMC_CS0_OFFSET +
736 GPMC_CS_NAND_ADDRESS + GPMC_CS_SIZE * cs;
737 reg->gpmc_nand_data = gpmc_base + GPMC_CS0_OFFSET +
738 GPMC_CS_NAND_DATA + GPMC_CS_SIZE * cs;
739 reg->gpmc_prefetch_config1 = gpmc_base + GPMC_PREFETCH_CONFIG1;
740 reg->gpmc_prefetch_config2 = gpmc_base + GPMC_PREFETCH_CONFIG2;
741 reg->gpmc_prefetch_control = gpmc_base + GPMC_PREFETCH_CONTROL;
742 reg->gpmc_prefetch_status = gpmc_base + GPMC_PREFETCH_STATUS;
743 reg->gpmc_ecc_config = gpmc_base + GPMC_ECC_CONFIG;
744 reg->gpmc_ecc_control = gpmc_base + GPMC_ECC_CONTROL;
745 reg->gpmc_ecc_size_config = gpmc_base + GPMC_ECC_SIZE_CONFIG;
746 reg->gpmc_ecc1_result = gpmc_base + GPMC_ECC1_RESULT;
747 reg->gpmc_bch_result0 = gpmc_base + GPMC_ECC_BCH_RESULT_0;
748}
749
750int gpmc_get_client_irq(unsigned irq_config)
751{
752 int i;
753
754 if (hweight32(irq_config) > 1)
755 return 0;
756
757 for (i = 0; i < GPMC_NR_IRQ; i++)
758 if (gpmc_client_irq[i].bitmask & irq_config)
759 return gpmc_client_irq[i].irq;
760
761 return 0;
762}
763
764static int gpmc_irq_endis(unsigned irq, bool endis)
765{
766 int i;
767 u32 regval;
768
769 for (i = 0; i < GPMC_NR_IRQ; i++)
770 if (irq == gpmc_client_irq[i].irq) {
771 regval = gpmc_read_reg(GPMC_IRQENABLE);
772 if (endis)
773 regval |= gpmc_client_irq[i].bitmask;
774 else
775 regval &= ~gpmc_client_irq[i].bitmask;
776 gpmc_write_reg(GPMC_IRQENABLE, regval);
777 break;
778 }
779
780 return 0;
781}
782
783static void gpmc_irq_disable(struct irq_data *p)
784{
785 gpmc_irq_endis(p->irq, false);
786}
787
788static void gpmc_irq_enable(struct irq_data *p)
789{
790 gpmc_irq_endis(p->irq, true);
791}
792
793static void gpmc_irq_noop(struct irq_data *data) { }
794
795static unsigned int gpmc_irq_noop_ret(struct irq_data *data) { return 0; }
796
797static int gpmc_setup_irq(void)
798{
799 int i;
800 u32 regval;
801
802 if (!gpmc_irq)
803 return -EINVAL;
804
805 gpmc_irq_start = irq_alloc_descs(-1, 0, GPMC_NR_IRQ, 0);
806 if (IS_ERR_VALUE(gpmc_irq_start)) {
807 pr_err("irq_alloc_descs failed\n");
808 return gpmc_irq_start;
809 }
810
811 gpmc_irq_chip.name = "gpmc";
812 gpmc_irq_chip.irq_startup = gpmc_irq_noop_ret;
813 gpmc_irq_chip.irq_enable = gpmc_irq_enable;
814 gpmc_irq_chip.irq_disable = gpmc_irq_disable;
815 gpmc_irq_chip.irq_shutdown = gpmc_irq_noop;
816 gpmc_irq_chip.irq_ack = gpmc_irq_noop;
817 gpmc_irq_chip.irq_mask = gpmc_irq_noop;
818 gpmc_irq_chip.irq_unmask = gpmc_irq_noop;
819
820 gpmc_client_irq[0].bitmask = GPMC_IRQ_FIFOEVENTENABLE;
821 gpmc_client_irq[1].bitmask = GPMC_IRQ_COUNT_EVENT;
822
823 for (i = 0; i < GPMC_NR_IRQ; i++) {
824 gpmc_client_irq[i].irq = gpmc_irq_start + i;
825 irq_set_chip_and_handler(gpmc_client_irq[i].irq,
826 &gpmc_irq_chip, handle_simple_irq);
827 set_irq_flags(gpmc_client_irq[i].irq,
828 IRQF_VALID | IRQF_NOAUTOEN);
829 }
830
831 /* Disable interrupts */
832 gpmc_write_reg(GPMC_IRQENABLE, 0);
833
834 /* clear interrupts */
835 regval = gpmc_read_reg(GPMC_IRQSTATUS);
836 gpmc_write_reg(GPMC_IRQSTATUS, regval);
837
838 return request_irq(gpmc_irq, gpmc_handle_irq, 0, "gpmc", NULL);
839}
840
841static __devexit int gpmc_free_irq(void)
842{
843 int i;
844
845 if (gpmc_irq)
846 free_irq(gpmc_irq, NULL);
847
848 for (i = 0; i < GPMC_NR_IRQ; i++) {
849 irq_set_handler(gpmc_client_irq[i].irq, NULL);
850 irq_set_chip(gpmc_client_irq[i].irq, &no_irq_chip);
851 irq_modify_status(gpmc_client_irq[i].irq, 0, 0);
852 }
853
854 irq_free_descs(gpmc_irq_start, GPMC_NR_IRQ);
855
856 return 0;
857}
858
859static void __devexit gpmc_mem_exit(void)
860{
861 int cs;
862
863 for (cs = 0; cs < GPMC_CS_NUM; cs++) {
864 if (!gpmc_cs_mem_enabled(cs))
865 continue;
866 gpmc_cs_delete_mem(cs);
867 }
868
869}
870
871static void __devinit gpmc_mem_init(void)
686{ 872{
687 int cs; 873 int cs;
688 unsigned long boot_rom_space = 0; 874 unsigned long boot_rom_space = 0;
@@ -709,83 +895,120 @@ static void __init gpmc_mem_init(void)
709 } 895 }
710} 896}
711 897
712static int __init gpmc_init(void) 898static __devinit int gpmc_probe(struct platform_device *pdev)
713{ 899{
714 u32 l, irq; 900 u32 l;
715 int cs, ret = -EINVAL; 901 struct resource *res;
716 int gpmc_irq; 902
717 char *ck = NULL; 903 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
718 904 if (res == NULL)
719 if (cpu_is_omap24xx()) { 905 return -ENOENT;
720 ck = "core_l3_ck"; 906
721 if (cpu_is_omap2420()) 907 phys_base = res->start;
722 l = OMAP2420_GPMC_BASE; 908 mem_size = resource_size(res);
723 else 909
724 l = OMAP34XX_GPMC_BASE; 910 gpmc_base = devm_request_and_ioremap(&pdev->dev, res);
725 gpmc_irq = INT_34XX_GPMC_IRQ; 911 if (!gpmc_base) {
726 } else if (cpu_is_omap34xx()) { 912 dev_err(&pdev->dev, "error: request memory / ioremap\n");
727 ck = "gpmc_fck"; 913 return -EADDRNOTAVAIL;
728 l = OMAP34XX_GPMC_BASE;
729 gpmc_irq = INT_34XX_GPMC_IRQ;
730 } else if (cpu_is_omap44xx() || soc_is_omap54xx()) {
731 /* Base address and irq number are same for OMAP4/5 */
732 ck = "gpmc_ck";
733 l = OMAP44XX_GPMC_BASE;
734 gpmc_irq = OMAP44XX_IRQ_GPMC;
735 } 914 }
736 915
737 if (WARN_ON(!ck)) 916 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
738 return ret; 917 if (res == NULL)
918 dev_warn(&pdev->dev, "Failed to get resource: irq\n");
919 else
920 gpmc_irq = res->start;
739 921
740 gpmc_l3_clk = clk_get(NULL, ck); 922 gpmc_l3_clk = clk_get(&pdev->dev, "fck");
741 if (IS_ERR(gpmc_l3_clk)) { 923 if (IS_ERR(gpmc_l3_clk)) {
742 printk(KERN_ERR "Could not get GPMC clock %s\n", ck); 924 dev_err(&pdev->dev, "error: clk_get\n");
743 BUG(); 925 gpmc_irq = 0;
926 return PTR_ERR(gpmc_l3_clk);
744 } 927 }
745 928
746 gpmc_base = ioremap(l, SZ_4K); 929 clk_prepare_enable(gpmc_l3_clk);
747 if (!gpmc_base) {
748 clk_put(gpmc_l3_clk);
749 printk(KERN_ERR "Could not get GPMC register memory\n");
750 BUG();
751 }
752 930
753 clk_enable(gpmc_l3_clk); 931 gpmc_dev = &pdev->dev;
754 932
755 l = gpmc_read_reg(GPMC_REVISION); 933 l = gpmc_read_reg(GPMC_REVISION);
756 printk(KERN_INFO "GPMC revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f); 934 if (GPMC_REVISION_MAJOR(l) > 0x4)
757 /* Set smart idle mode and automatic L3 clock gating */ 935 gpmc_capability = GPMC_HAS_WR_ACCESS | GPMC_HAS_WR_DATA_MUX_BUS;
758 l = gpmc_read_reg(GPMC_SYSCONFIG); 936 dev_info(gpmc_dev, "GPMC revision %d.%d\n", GPMC_REVISION_MAJOR(l),
759 l &= 0x03 << 3; 937 GPMC_REVISION_MINOR(l));
760 l |= (0x02 << 3) | (1 << 0); 938
761 gpmc_write_reg(GPMC_SYSCONFIG, l);
762 gpmc_mem_init(); 939 gpmc_mem_init();
763 940
764 /* initalize the irq_chained */ 941 if (IS_ERR_VALUE(gpmc_setup_irq()))
765 irq = OMAP_GPMC_IRQ_BASE; 942 dev_warn(gpmc_dev, "gpmc_setup_irq failed\n");
766 for (cs = 0; cs < GPMC_CS_NUM; cs++) { 943
767 irq_set_chip_and_handler(irq, &dummy_irq_chip, 944 return 0;
768 handle_simple_irq); 945}
769 set_irq_flags(irq, IRQF_VALID); 946
770 irq++; 947static __devexit int gpmc_remove(struct platform_device *pdev)
771 } 948{
949 gpmc_free_irq();
950 gpmc_mem_exit();
951 gpmc_dev = NULL;
952 return 0;
953}
954
955static struct platform_driver gpmc_driver = {
956 .probe = gpmc_probe,
957 .remove = __devexit_p(gpmc_remove),
958 .driver = {
959 .name = DEVICE_NAME,
960 .owner = THIS_MODULE,
961 },
962};
772 963
773 ret = request_irq(gpmc_irq, gpmc_handle_irq, IRQF_SHARED, "gpmc", NULL); 964static __init int gpmc_init(void)
774 if (ret) 965{
775 pr_err("gpmc: irq-%d could not claim: err %d\n", 966 return platform_driver_register(&gpmc_driver);
776 gpmc_irq, ret);
777 return ret;
778} 967}
968
969static __exit void gpmc_exit(void)
970{
971 platform_driver_unregister(&gpmc_driver);
972
973}
974
779postcore_initcall(gpmc_init); 975postcore_initcall(gpmc_init);
976module_exit(gpmc_exit);
977
978static int __init omap_gpmc_init(void)
979{
980 struct omap_hwmod *oh;
981 struct platform_device *pdev;
982 char *oh_name = "gpmc";
983
984 oh = omap_hwmod_lookup(oh_name);
985 if (!oh) {
986 pr_err("Could not look up %s\n", oh_name);
987 return -ENODEV;
988 }
989
990 pdev = omap_device_build(DEVICE_NAME, -1, oh, NULL, 0, NULL, 0, 0);
991 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
992
993 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
994}
995postcore_initcall(omap_gpmc_init);
780 996
781static irqreturn_t gpmc_handle_irq(int irq, void *dev) 997static irqreturn_t gpmc_handle_irq(int irq, void *dev)
782{ 998{
783 u8 cs; 999 int i;
1000 u32 regval;
1001
1002 regval = gpmc_read_reg(GPMC_IRQSTATUS);
1003
1004 if (!regval)
1005 return IRQ_NONE;
1006
1007 for (i = 0; i < GPMC_NR_IRQ; i++)
1008 if (regval & gpmc_client_irq[i].bitmask)
1009 generic_handle_irq(gpmc_client_irq[i].irq);
784 1010
785 /* check cs to invoke the irq */ 1011 gpmc_write_reg(GPMC_IRQSTATUS, regval);
786 cs = ((gpmc_read_reg(GPMC_PREFETCH_CONFIG1)) >> CS_NUM_SHIFT) & 0x7;
787 if (OMAP_GPMC_IRQ_BASE+cs <= OMAP_GPMC_IRQ_END)
788 generic_handle_irq(OMAP_GPMC_IRQ_BASE+cs);
789 1012
790 return IRQ_HANDLED; 1013 return IRQ_HANDLED;
791} 1014}
diff --git a/arch/arm/mach-omap2/hdq1w.c b/arch/arm/mach-omap2/hdq1w.c
index cdd6dda0382..e003f2bba30 100644
--- a/arch/arm/mach-omap2/hdq1w.c
+++ b/arch/arm/mach-omap2/hdq1w.c
@@ -29,7 +29,7 @@
29 29
30#include <plat/omap_hwmod.h> 30#include <plat/omap_hwmod.h>
31#include <plat/omap_device.h> 31#include <plat/omap_device.h>
32#include <plat/hdq1w.h> 32#include "hdq1w.h"
33 33
34#include "common.h" 34#include "common.h"
35 35
diff --git a/arch/arm/plat-omap/include/plat/hdq1w.h b/arch/arm/mach-omap2/hdq1w.h
index 0c1efc846d8..0c1efc846d8 100644
--- a/arch/arm/plat-omap/include/plat/hdq1w.h
+++ b/arch/arm/mach-omap2/hdq1w.h
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index a9675d8d182..4d3a6324155 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -15,9 +15,10 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <linux/platform_data/gpio-omap.h>
19
18#include <plat/mmc.h> 20#include <plat/mmc.h>
19#include <plat/omap-pm.h> 21#include <plat/omap-pm.h>
20#include <plat/mux.h>
21#include <plat/omap_device.h> 22#include <plat/omap_device.h>
22 23
23#include "mux.h" 24#include "mux.h"
@@ -522,7 +523,7 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo,
522 dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); 523 dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id);
523 524
524 od = omap_device_alloc(pdev, ohs, 1, NULL, 0); 525 od = omap_device_alloc(pdev, ohs, 1, NULL, 0);
525 if (!od) { 526 if (IS_ERR(od)) {
526 pr_err("Could not allocate od for %s\n", name); 527 pr_err("Could not allocate od for %s\n", name);
527 goto put_pdev; 528 goto put_pdev;
528 } 529 }
diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c
index a12e224eb97..fc57e67b321 100644
--- a/arch/arm/mach-omap2/i2c.c
+++ b/arch/arm/mach-omap2/i2c.c
@@ -19,7 +19,6 @@
19 * 19 *
20 */ 20 */
21 21
22#include <plat/cpu.h>
23#include <plat/i2c.h> 22#include <plat/i2c.h>
24#include "common.h" 23#include "common.h"
25#include <plat/omap_hwmod.h> 24#include <plat/omap_hwmod.h>
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 40373db649a..cf2362ccb23 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -22,10 +22,10 @@
22#include <asm/cputype.h> 22#include <asm/cputype.h>
23 23
24#include "common.h" 24#include "common.h"
25#include <plat/cpu.h>
26 25
27#include <mach/id.h> 26#include "id.h"
28 27
28#include "soc.h"
29#include "control.h" 29#include "control.h"
30 30
31static unsigned int omap_revision; 31static unsigned int omap_revision;
@@ -161,9 +161,8 @@ void __init omap2xxx_check_revision(void)
161 } 161 }
162 162
163 if (j == ARRAY_SIZE(omap_ids)) { 163 if (j == ARRAY_SIZE(omap_ids)) {
164 printk(KERN_ERR "Unknown OMAP device type. " 164 pr_err("Unknown OMAP device type. Handling it as OMAP%04x\n",
165 "Handling it as OMAP%04x\n", 165 omap_ids[i].type >> 16);
166 omap_ids[i].type >> 16);
167 j = i; 166 j = i;
168 } 167 }
169 168
diff --git a/arch/arm/mach-omap2/include/mach/id.h b/arch/arm/mach-omap2/id.h
index 02ed3aa56f1..02ed3aa56f1 100644
--- a/arch/arm/mach-omap2/include/mach/id.h
+++ b/arch/arm/mach-omap2/id.h
diff --git a/arch/arm/mach-omap2/include/mach/board-zoom.h b/arch/arm/mach-omap2/include/mach/board-zoom.h
index 775fdc3b000..2e9486940ea 100644
--- a/arch/arm/mach-omap2/include/mach/board-zoom.h
+++ b/arch/arm/mach-omap2/include/mach/board-zoom.h
@@ -8,5 +8,3 @@
8extern int __init zoom_debugboard_init(void); 8extern int __init zoom_debugboard_init(void);
9extern void __init zoom_peripherals_init(void); 9extern void __init zoom_peripherals_init(void);
10extern void __init zoom_display_init(void); 10extern void __init zoom_display_init(void);
11
12#define ZOOM2_HEADSET_EXTMUTE_GPIO 153
diff --git a/arch/arm/mach-omap2/include/mach/gpio.h b/arch/arm/mach-omap2/include/mach/gpio.h
index be4d290d57e..5621cc59c9f 100644
--- a/arch/arm/mach-omap2/include/mach/gpio.h
+++ b/arch/arm/mach-omap2/include/mach/gpio.h
@@ -1,5 +1,3 @@
1/* 1/*
2 * arch/arm/mach-omap2/include/mach/gpio.h 2 * arch/arm/mach-omap2/include/mach/gpio.h
3 */ 3 */
4
5#include <plat/gpio.h>
diff --git a/arch/arm/mach-omap2/include/mach/hardware.h b/arch/arm/mach-omap2/include/mach/hardware.h
index 78edf9d33f7..54492dbf697 100644
--- a/arch/arm/mach-omap2/include/mach/hardware.h
+++ b/arch/arm/mach-omap2/include/mach/hardware.h
@@ -1,5 +1,3 @@
1/* 1/*
2 * arch/arm/mach-omap2/include/mach/hardware.h 2 * arch/arm/mach-omap2/include/mach/hardware.h
3 */ 3 */
4
5#include <plat/hardware.h>
diff --git a/arch/arm/mach-omap2/include/mach/irqs.h b/arch/arm/mach-omap2/include/mach/irqs.h
index 44dab772569..ba5282cafa4 100644
--- a/arch/arm/mach-omap2/include/mach/irqs.h
+++ b/arch/arm/mach-omap2/include/mach/irqs.h
@@ -1,5 +1,3 @@
1/* 1/*
2 * arch/arm/mach-omap2/include/mach/irqs.h 2 * arch/arm/mach-omap2/include/mach/irqs.h
3 */ 3 */
4
5#include <plat/irqs.h>
diff --git a/arch/arm/mach-omap2/include/mach/smp.h b/arch/arm/mach-omap2/include/mach/smp.h
deleted file mode 100644
index 323675f21b6..00000000000
--- a/arch/arm/mach-omap2/include/mach/smp.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-omap2/include/mach/smp.h
3 */
4
5#include <plat/smp.h>
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 4d2d981ff5c..4234d28dc17 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -33,6 +33,7 @@
33#include <plat/multi.h> 33#include <plat/multi.h>
34#include <plat/dma.h> 34#include <plat/dma.h>
35 35
36#include "soc.h"
36#include "iomap.h" 37#include "iomap.h"
37#include "voltage.h" 38#include "voltage.h"
38#include "powerdomain.h" 39#include "powerdomain.h"
@@ -523,6 +524,8 @@ void __init am33xx_init_early(void)
523 am33xx_voltagedomains_init(); 524 am33xx_voltagedomains_init();
524 am33xx_powerdomains_init(); 525 am33xx_powerdomains_init();
525 am33xx_clockdomains_init(); 526 am33xx_clockdomains_init();
527 am33xx_hwmod_init();
528 omap_hwmod_init_postsetup();
526 am33xx_clk_init(); 529 am33xx_clk_init();
527} 530}
528#endif 531#endif
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index bcd83db41bb..3926f370448 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -23,8 +23,7 @@
23#include <linux/of_address.h> 23#include <linux/of_address.h>
24#include <linux/of_irq.h> 24#include <linux/of_irq.h>
25 25
26#include <mach/hardware.h> 26#include "soc.h"
27
28#include "iomap.h" 27#include "iomap.h"
29#include "common.h" 28#include "common.h"
30 29
@@ -49,6 +48,8 @@
49#define OMAP3_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE) 48#define OMAP3_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
50#define INTCPS_SIR_IRQ_OFFSET 0x0040 /* omap2/3 active interrupt offset */ 49#define INTCPS_SIR_IRQ_OFFSET 0x0040 /* omap2/3 active interrupt offset */
51#define ACTIVEIRQ_MASK 0x7f /* omap2/3 active interrupt bits */ 50#define ACTIVEIRQ_MASK 0x7f /* omap2/3 active interrupt bits */
51#define INTCPS_NR_MIR_REGS 3
52#define INTCPS_NR_IRQS 96
52 53
53/* 54/*
54 * OMAP2 has a number of different interrupt controllers, each interrupt 55 * OMAP2 has a number of different interrupt controllers, each interrupt
@@ -107,9 +108,8 @@ static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
107 unsigned long tmp; 108 unsigned long tmp;
108 109
109 tmp = intc_bank_read_reg(bank, INTC_REVISION) & 0xff; 110 tmp = intc_bank_read_reg(bank, INTC_REVISION) & 0xff;
110 printk(KERN_INFO "IRQ: Found an INTC at 0x%p " 111 pr_info("IRQ: Found an INTC at 0x%p (revision %ld.%ld) with %d interrupts\n",
111 "(revision %ld.%ld) with %d interrupts\n", 112 bank->base_reg, tmp >> 4, tmp & 0xf, bank->nr_irqs);
112 bank->base_reg, tmp >> 4, tmp & 0xf, bank->nr_irqs);
113 113
114 tmp = intc_bank_read_reg(bank, INTC_SYSCONFIG); 114 tmp = intc_bank_read_reg(bank, INTC_SYSCONFIG);
115 tmp |= 1 << 1; /* soft reset */ 115 tmp |= 1 << 1; /* soft reset */
diff --git a/arch/arm/plat-omap/include/plat/l3_2xxx.h b/arch/arm/mach-omap2/l3_2xxx.h
index b8b5641379b..b8b5641379b 100644
--- a/arch/arm/plat-omap/include/plat/l3_2xxx.h
+++ b/arch/arm/mach-omap2/l3_2xxx.h
diff --git a/arch/arm/plat-omap/include/plat/l3_3xxx.h b/arch/arm/mach-omap2/l3_3xxx.h
index cde1938c5f8..cde1938c5f8 100644
--- a/arch/arm/plat-omap/include/plat/l3_3xxx.h
+++ b/arch/arm/mach-omap2/l3_3xxx.h
diff --git a/arch/arm/plat-omap/include/plat/l4_2xxx.h b/arch/arm/mach-omap2/l4_2xxx.h
index 3f39cf8a35c..3f39cf8a35c 100644
--- a/arch/arm/plat-omap/include/plat/l4_2xxx.h
+++ b/arch/arm/mach-omap2/l4_2xxx.h
diff --git a/arch/arm/plat-omap/include/plat/l4_3xxx.h b/arch/arm/mach-omap2/l4_3xxx.h
index 881a858b1ff..881a858b1ff 100644
--- a/arch/arm/plat-omap/include/plat/l4_3xxx.h
+++ b/arch/arm/mach-omap2/l4_3xxx.h
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 6875be837d9..0d974565f8c 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -16,8 +16,10 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/pm_runtime.h> 18#include <linux/pm_runtime.h>
19
19#include <plat/mailbox.h> 20#include <plat/mailbox.h>
20#include <mach/irqs.h> 21
22#include "soc.h"
21 23
22#define MAILBOX_REVISION 0x000 24#define MAILBOX_REVISION 0x000
23#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) 25#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m))
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index 577cb77db26..37f8f948047 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -15,18 +15,15 @@
15#include <linux/clk.h> 15#include <linux/clk.h>
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/of.h>
18#include <linux/platform_device.h> 19#include <linux/platform_device.h>
19#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/platform_data/asoc-ti-mcbsp.h>
20 22
21#include <mach/irqs.h>
22#include <plat/dma.h> 23#include <plat/dma.h>
23#include <plat/cpu.h>
24#include <plat/mcbsp.h>
25#include <plat/omap_device.h> 24#include <plat/omap_device.h>
26#include <linux/pm_runtime.h> 25#include <linux/pm_runtime.h>
27 26
28#include "control.h"
29
30/* 27/*
31 * FIXME: Find a mechanism to enable/disable runtime the McBSP ICLK autoidle. 28 * FIXME: Find a mechanism to enable/disable runtime the McBSP ICLK autoidle.
32 * Sidetone needs non-gated ICLK and sidetone autoidle is broken. 29 * Sidetone needs non-gated ICLK and sidetone autoidle is broken.
@@ -34,112 +31,6 @@
34#include "cm2xxx_3xxx.h" 31#include "cm2xxx_3xxx.h"
35#include "cm-regbits-34xx.h" 32#include "cm-regbits-34xx.h"
36 33
37/* McBSP1 internal signal muxing function for OMAP2/3 */
38static int omap2_mcbsp1_mux_rx_clk(struct device *dev, const char *signal,
39 const char *src)
40{
41 u32 v;
42
43 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
44
45 if (!strcmp(signal, "clkr")) {
46 if (!strcmp(src, "clkr"))
47 v &= ~OMAP2_MCBSP1_CLKR_MASK;
48 else if (!strcmp(src, "clkx"))
49 v |= OMAP2_MCBSP1_CLKR_MASK;
50 else
51 return -EINVAL;
52 } else if (!strcmp(signal, "fsr")) {
53 if (!strcmp(src, "fsr"))
54 v &= ~OMAP2_MCBSP1_FSR_MASK;
55 else if (!strcmp(src, "fsx"))
56 v |= OMAP2_MCBSP1_FSR_MASK;
57 else
58 return -EINVAL;
59 } else {
60 return -EINVAL;
61 }
62
63 omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
64
65 return 0;
66}
67
68/* McBSP4 internal signal muxing function for OMAP4 */
69#define OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_FSX (1 << 31)
70#define OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_CLKX (1 << 30)
71static int omap4_mcbsp4_mux_rx_clk(struct device *dev, const char *signal,
72 const char *src)
73{
74 u32 v;
75
76 /*
77 * In CONTROL_MCBSPLP register only bit 30 (CLKR mux), and bit 31 (FSR
78 * mux) is used */
79 v = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MCBSPLP);
80
81 if (!strcmp(signal, "clkr")) {
82 if (!strcmp(src, "clkr"))
83 v &= ~OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_CLKX;
84 else if (!strcmp(src, "clkx"))
85 v |= OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_CLKX;
86 else
87 return -EINVAL;
88 } else if (!strcmp(signal, "fsr")) {
89 if (!strcmp(src, "fsr"))
90 v &= ~OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_FSX;
91 else if (!strcmp(src, "fsx"))
92 v |= OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_FSX;
93 else
94 return -EINVAL;
95 } else {
96 return -EINVAL;
97 }
98
99 omap4_ctrl_pad_writel(v, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MCBSPLP);
100
101 return 0;
102}
103
104/* McBSP CLKS source switching function */
105static int omap2_mcbsp_set_clk_src(struct device *dev, struct clk *clk,
106 const char *src)
107{
108 struct clk *fck_src;
109 char *fck_src_name;
110 int r;
111
112 if (!strcmp(src, "clks_ext"))
113 fck_src_name = "pad_fck";
114 else if (!strcmp(src, "clks_fclk"))
115 fck_src_name = "prcm_fck";
116 else
117 return -EINVAL;
118
119 fck_src = clk_get(dev, fck_src_name);
120 if (IS_ERR_OR_NULL(fck_src)) {
121 pr_err("omap-mcbsp: %s: could not clk_get() %s\n", "clks",
122 fck_src_name);
123 return -EINVAL;
124 }
125
126 pm_runtime_put_sync(dev);
127
128 r = clk_set_parent(clk, fck_src);
129 if (IS_ERR_VALUE(r)) {
130 pr_err("omap-mcbsp: %s: could not clk_set_parent() to %s\n",
131 "clks", fck_src_name);
132 clk_put(fck_src);
133 return -EINVAL;
134 }
135
136 pm_runtime_get_sync(dev);
137
138 clk_put(fck_src);
139
140 return 0;
141}
142
143static int omap3_enable_st_clock(unsigned int id, bool enable) 34static int omap3_enable_st_clock(unsigned int id, bool enable)
144{ 35{
145 unsigned int w; 36 unsigned int w;
@@ -181,17 +72,11 @@ static int __init omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
181 pdata->reg_size = 4; 72 pdata->reg_size = 4;
182 pdata->has_ccr = true; 73 pdata->has_ccr = true;
183 } 74 }
184 pdata->set_clk_src = omap2_mcbsp_set_clk_src;
185
186 /* On OMAP2/3 the McBSP1 port has 6 pin configuration */
187 if (id == 1 && oh->class->rev < MCBSP_CONFIG_TYPE4)
188 pdata->mux_signal = omap2_mcbsp1_mux_rx_clk;
189 75
190 /* On OMAP4 the McBSP4 port has 6 pin configuration */ 76 if (oh->class->rev == MCBSP_CONFIG_TYPE2) {
191 if (id == 4 && oh->class->rev == MCBSP_CONFIG_TYPE4) 77 /* The FIFO has 128 locations */
192 pdata->mux_signal = omap4_mcbsp4_mux_rx_clk; 78 pdata->buffer_size = 0x80;
193 79 } else if (oh->class->rev == MCBSP_CONFIG_TYPE3) {
194 if (oh->class->rev == MCBSP_CONFIG_TYPE3) {
195 if (id == 2) 80 if (id == 2)
196 /* The FIFO has 1024 + 256 locations */ 81 /* The FIFO has 1024 + 256 locations */
197 pdata->buffer_size = 0x500; 82 pdata->buffer_size = 0x500;
@@ -227,7 +112,8 @@ static int __init omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
227 112
228static int __init omap2_mcbsp_init(void) 113static int __init omap2_mcbsp_init(void)
229{ 114{
230 omap_hwmod_for_each_by_class("mcbsp", omap_init_mcbsp, NULL); 115 if (!of_have_populated_dt())
116 omap_hwmod_for_each_by_class("mcbsp", omap_init_mcbsp, NULL);
231 117
232 return 0; 118 return 0;
233} 119}
diff --git a/arch/arm/mach-omap2/msdi.c b/arch/arm/mach-omap2/msdi.c
index fb5bc6cf377..9e57b4aadb0 100644
--- a/arch/arm/mach-omap2/msdi.c
+++ b/arch/arm/mach-omap2/msdi.c
@@ -23,6 +23,7 @@
23 23
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25#include <linux/err.h> 25#include <linux/err.h>
26#include <linux/platform_data/gpio-omap.h>
26 27
27#include <plat/omap_hwmod.h> 28#include <plat/omap_hwmod.h>
28#include <plat/omap_device.h> 29#include <plat/omap_device.h>
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 9fe6829f4c1..701e17cba46 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -486,7 +486,7 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
486 default: 486 default:
487 /* Nothing to be done */ 487 /* Nothing to be done */
488 break; 488 break;
489 }; 489 }
490 490
491 if (val >= 0) { 491 if (val >= 0) {
492 omap_mux_write(pad->partition, val, 492 omap_mux_write(pad->partition, val,
diff --git a/arch/arm/mach-omap2/omap-hotplug.c b/arch/arm/mach-omap2/omap-hotplug.c
index 414083b427d..e712d1725a8 100644
--- a/arch/arm/mach-omap2/omap-hotplug.c
+++ b/arch/arm/mach-omap2/omap-hotplug.c
@@ -20,22 +20,17 @@
20#include <linux/io.h> 20#include <linux/io.h>
21 21
22#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
23#include <mach/omap-wakeupgen.h> 23#include "omap-wakeupgen.h"
24 24
25#include "common.h" 25#include "common.h"
26 26
27#include "powerdomain.h" 27#include "powerdomain.h"
28 28
29int platform_cpu_kill(unsigned int cpu)
30{
31 return 1;
32}
33
34/* 29/*
35 * platform-specific code to shutdown a CPU 30 * platform-specific code to shutdown a CPU
36 * Called with IRQs disabled 31 * Called with IRQs disabled
37 */ 32 */
38void __ref platform_cpu_die(unsigned int cpu) 33void __ref omap4_cpu_die(unsigned int cpu)
39{ 34{
40 unsigned int boot_cpu = 0; 35 unsigned int boot_cpu = 0;
41 void __iomem *base = omap_get_wakeupgen_base(); 36 void __iomem *base = omap_get_wakeupgen_base();
@@ -75,12 +70,3 @@ void __ref platform_cpu_die(unsigned int cpu)
75 pr_debug("CPU%u: spurious wakeup call\n", cpu); 70 pr_debug("CPU%u: spurious wakeup call\n", cpu);
76 } 71 }
77} 72}
78
79int platform_cpu_disable(unsigned int cpu)
80{
81 /*
82 * we don't allow CPU 0 to be shutdown (it is still too special
83 * e.g. clock tick interrupts)
84 */
85 return cpu == 0 ? -EPERM : 0;
86}
diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c
index 1be8bcb52e9..df298d46707 100644
--- a/arch/arm/mach-omap2/omap-iommu.c
+++ b/arch/arm/mach-omap2/omap-iommu.c
@@ -14,7 +14,9 @@
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15 15
16#include <plat/iommu.h> 16#include <plat/iommu.h>
17#include <plat/irqs.h> 17
18#include "soc.h"
19#include "common.h"
18 20
19struct iommu_device { 21struct iommu_device {
20 resource_size_t base; 22 resource_size_t base;
@@ -29,7 +31,7 @@ static int num_iommu_devices;
29static struct iommu_device omap3_devices[] = { 31static struct iommu_device omap3_devices[] = {
30 { 32 {
31 .base = 0x480bd400, 33 .base = 0x480bd400,
32 .irq = 24, 34 .irq = 24 + OMAP_INTC_START,
33 .pdata = { 35 .pdata = {
34 .name = "isp", 36 .name = "isp",
35 .nr_tlb_entries = 8, 37 .nr_tlb_entries = 8,
@@ -41,7 +43,7 @@ static struct iommu_device omap3_devices[] = {
41#if defined(CONFIG_OMAP_IOMMU_IVA2) 43#if defined(CONFIG_OMAP_IOMMU_IVA2)
42 { 44 {
43 .base = 0x5d000000, 45 .base = 0x5d000000,
44 .irq = 28, 46 .irq = 28 + OMAP_INTC_START,
45 .pdata = { 47 .pdata = {
46 .name = "iva2", 48 .name = "iva2",
47 .nr_tlb_entries = 32, 49 .nr_tlb_entries = 32,
@@ -64,7 +66,7 @@ static struct platform_device *omap3_iommu_pdev[NR_OMAP3_IOMMU_DEVICES];
64static struct iommu_device omap4_devices[] = { 66static struct iommu_device omap4_devices[] = {
65 { 67 {
66 .base = OMAP4_MMU1_BASE, 68 .base = OMAP4_MMU1_BASE,
67 .irq = OMAP44XX_IRQ_DUCATI_MMU, 69 .irq = 100 + OMAP44XX_IRQ_GIC_START,
68 .pdata = { 70 .pdata = {
69 .name = "ducati", 71 .name = "ducati",
70 .nr_tlb_entries = 32, 72 .nr_tlb_entries = 32,
@@ -75,7 +77,7 @@ static struct iommu_device omap4_devices[] = {
75 }, 77 },
76 { 78 {
77 .base = OMAP4_MMU2_BASE, 79 .base = OMAP4_MMU2_BASE,
78 .irq = OMAP44XX_IRQ_TESLA_MMU, 80 .irq = 28 + OMAP44XX_IRQ_GIC_START,
79 .pdata = { 81 .pdata = {
80 .name = "tesla", 82 .name = "tesla",
81 .nr_tlb_entries = 32, 83 .nr_tlb_entries = 32,
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
index 637a1bdf2ac..ff4e6a0e9c7 100644
--- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c
+++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
@@ -50,9 +50,8 @@
50#include <asm/suspend.h> 50#include <asm/suspend.h>
51#include <asm/hardware/cache-l2x0.h> 51#include <asm/hardware/cache-l2x0.h>
52 52
53#include <plat/omap44xx.h>
54
55#include "common.h" 53#include "common.h"
54#include "omap44xx.h"
56#include "omap4-sar-layout.h" 55#include "omap4-sar-layout.h"
57#include "pm.h" 56#include "pm.h"
58#include "prcm_mpu44xx.h" 57#include "prcm_mpu44xx.h"
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
index d9ae4a53d81..e089e4d1ae3 100644
--- a/arch/arm/mach-omap2/omap-secure.c
+++ b/arch/arm/mach-omap2/omap-secure.c
@@ -19,7 +19,7 @@
19#include <asm/memblock.h> 19#include <asm/memblock.h>
20 20
21#include <plat/omap-secure.h> 21#include <plat/omap-secure.h>
22#include <mach/omap-secure.h> 22#include "omap-secure.h"
23 23
24static phys_addr_t omap_secure_memblock_base; 24static phys_addr_t omap_secure_memblock_base;
25 25
@@ -61,8 +61,8 @@ int __init omap_secure_ram_reserve_memblock(void)
61{ 61{
62 u32 size = OMAP_SECURE_RAM_STORAGE; 62 u32 size = OMAP_SECURE_RAM_STORAGE;
63 63
64 size = ALIGN(size, SZ_1M); 64 size = ALIGN(size, SECTION_SIZE);
65 omap_secure_memblock_base = arm_memblock_steal(size, SZ_1M); 65 omap_secure_memblock_base = arm_memblock_steal(size, SECTION_SIZE);
66 66
67 return 0; 67 return 0;
68} 68}
diff --git a/arch/arm/mach-omap2/include/mach/omap-secure.h b/arch/arm/mach-omap2/omap-secure.h
index c90a43589ab..c90a43589ab 100644
--- a/arch/arm/mach-omap2/include/mach/omap-secure.h
+++ b/arch/arm/mach-omap2/omap-secure.h
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index 9a35adf9123..4d05fa8a4e4 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -24,11 +24,11 @@
24#include <asm/hardware/gic.h> 24#include <asm/hardware/gic.h>
25#include <asm/smp_scu.h> 25#include <asm/smp_scu.h>
26 26
27#include <mach/hardware.h> 27#include "omap-secure.h"
28#include <mach/omap-secure.h> 28#include "omap-wakeupgen.h"
29#include <mach/omap-wakeupgen.h>
30#include <asm/cputype.h> 29#include <asm/cputype.h>
31 30
31#include "soc.h"
32#include "iomap.h" 32#include "iomap.h"
33#include "common.h" 33#include "common.h"
34#include "clockdomain.h" 34#include "clockdomain.h"
@@ -49,7 +49,7 @@ void __iomem *omap4_get_scu_base(void)
49 return scu_base; 49 return scu_base;
50} 50}
51 51
52void __cpuinit platform_secondary_init(unsigned int cpu) 52static void __cpuinit omap4_secondary_init(unsigned int cpu)
53{ 53{
54 /* 54 /*
55 * Configure ACTRL and enable NS SMP bit access on CPU1 on HS device. 55 * Configure ACTRL and enable NS SMP bit access on CPU1 on HS device.
@@ -77,7 +77,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
77 spin_unlock(&boot_lock); 77 spin_unlock(&boot_lock);
78} 78}
79 79
80int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 80static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *idle)
81{ 81{
82 static struct clockdomain *cpu1_clkdm; 82 static struct clockdomain *cpu1_clkdm;
83 static bool booted; 83 static bool booted;
@@ -165,7 +165,7 @@ static void __init wakeup_secondary(void)
165 * Initialise the CPU possible map early - this describes the CPUs 165 * Initialise the CPU possible map early - this describes the CPUs
166 * which may be present or become present in the system. 166 * which may be present or become present in the system.
167 */ 167 */
168void __init smp_init_cpus(void) 168static void __init omap4_smp_init_cpus(void)
169{ 169{
170 unsigned int i = 0, ncores = 1, cpu_id; 170 unsigned int i = 0, ncores = 1, cpu_id;
171 171
@@ -196,7 +196,7 @@ void __init smp_init_cpus(void)
196 set_smp_cross_call(gic_raise_softirq); 196 set_smp_cross_call(gic_raise_softirq);
197} 197}
198 198
199void __init platform_smp_prepare_cpus(unsigned int max_cpus) 199static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
200{ 200{
201 201
202 /* 202 /*
@@ -207,3 +207,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
207 scu_enable(scu_base); 207 scu_enable(scu_base);
208 wakeup_secondary(); 208 wakeup_secondary();
209} 209}
210
211struct smp_operations omap4_smp_ops __initdata = {
212 .smp_init_cpus = omap4_smp_init_cpus,
213 .smp_prepare_cpus = omap4_smp_prepare_cpus,
214 .smp_secondary_init = omap4_secondary_init,
215 .smp_boot_secondary = omap4_boot_secondary,
216#ifdef CONFIG_HOTPLUG_CPU
217 .cpu_die = omap4_cpu_die,
218#endif
219};
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index 05fdebfaa19..5d3b4f4f81a 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -27,9 +27,10 @@
27 27
28#include <asm/hardware/gic.h> 28#include <asm/hardware/gic.h>
29 29
30#include <mach/omap-wakeupgen.h> 30#include "omap-wakeupgen.h"
31#include <mach/omap-secure.h> 31#include "omap-secure.h"
32 32
33#include "soc.h"
33#include "omap4-sar-layout.h" 34#include "omap4-sar-layout.h"
34#include "common.h" 35#include "common.h"
35 36
@@ -46,7 +47,7 @@
46static void __iomem *wakeupgen_base; 47static void __iomem *wakeupgen_base;
47static void __iomem *sar_base; 48static void __iomem *sar_base;
48static DEFINE_SPINLOCK(wakeupgen_lock); 49static DEFINE_SPINLOCK(wakeupgen_lock);
49static unsigned int irq_target_cpu[NR_IRQS]; 50static unsigned int irq_target_cpu[MAX_IRQS];
50static unsigned int irq_banks = MAX_NR_REG_BANKS; 51static unsigned int irq_banks = MAX_NR_REG_BANKS;
51static unsigned int max_irqs = MAX_IRQS; 52static unsigned int max_irqs = MAX_IRQS;
52static unsigned int omap_secure_apis; 53static unsigned int omap_secure_apis;
@@ -229,13 +230,7 @@ static inline void omap4_irq_save_context(void)
229 /* Save AuxBoot* registers */ 230 /* Save AuxBoot* registers */
230 val = __raw_readl(wakeupgen_base + OMAP_AUX_CORE_BOOT_0); 231 val = __raw_readl(wakeupgen_base + OMAP_AUX_CORE_BOOT_0);
231 __raw_writel(val, sar_base + AUXCOREBOOT0_OFFSET); 232 __raw_writel(val, sar_base + AUXCOREBOOT0_OFFSET);
232 val = __raw_readl(wakeupgen_base + OMAP_AUX_CORE_BOOT_0); 233 val = __raw_readl(wakeupgen_base + OMAP_AUX_CORE_BOOT_1);
233 __raw_writel(val, sar_base + AUXCOREBOOT1_OFFSET);
234
235 /* Save SyncReq generation logic */
236 val = __raw_readl(wakeupgen_base + OMAP_AUX_CORE_BOOT_0);
237 __raw_writel(val, sar_base + AUXCOREBOOT0_OFFSET);
238 val = __raw_readl(wakeupgen_base + OMAP_AUX_CORE_BOOT_0);
239 __raw_writel(val, sar_base + AUXCOREBOOT1_OFFSET); 234 __raw_writel(val, sar_base + AUXCOREBOOT1_OFFSET);
240 235
241 /* Save SyncReq generation logic */ 236 /* Save SyncReq generation logic */
diff --git a/arch/arm/mach-omap2/include/mach/omap-wakeupgen.h b/arch/arm/mach-omap2/omap-wakeupgen.h
index b0fd16f5c39..b0fd16f5c39 100644
--- a/arch/arm/mach-omap2/include/mach/omap-wakeupgen.h
+++ b/arch/arm/mach-omap2/omap-wakeupgen.h
diff --git a/arch/arm/plat-omap/include/plat/omap24xx.h b/arch/arm/mach-omap2/omap24xx.h
index 92df9e27cc5..641a2c8d2ee 100644
--- a/arch/arm/plat-omap/include/plat/omap24xx.h
+++ b/arch/arm/mach-omap2/omap24xx.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/omap24xx.h
3 *
4 * This file contains the processor specific definitions 2 * This file contains the processor specific definitions
5 * of the TI OMAP24XX. 3 * of the TI OMAP24XX.
6 * 4 *
diff --git a/arch/arm/plat-omap/include/plat/omap34xx.h b/arch/arm/mach-omap2/omap34xx.h
index 0d818acf391..c0d1b4b1653 100644
--- a/arch/arm/plat-omap/include/plat/omap34xx.h
+++ b/arch/arm/mach-omap2/omap34xx.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/omap34xx.h
3 *
4 * This file contains the processor specific definitions of the TI OMAP34XX. 2 * This file contains the processor specific definitions of the TI OMAP34XX.
5 * 3 *
6 * Copyright (C) 2007 Texas Instruments. 4 * Copyright (C) 2007 Texas Instruments.
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index c29dee998a7..e1f289748c5 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -16,26 +16,25 @@
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/memblock.h> 18#include <linux/memblock.h>
19#include <linux/of_irq.h>
20#include <linux/of_platform.h>
21#include <linux/export.h>
19 22
20#include <asm/hardware/gic.h> 23#include <asm/hardware/gic.h>
21#include <asm/hardware/cache-l2x0.h> 24#include <asm/hardware/cache-l2x0.h>
22#include <asm/mach/map.h> 25#include <asm/mach/map.h>
23#include <asm/memblock.h> 26#include <asm/memblock.h>
24#include <linux/of_irq.h>
25#include <linux/of_platform.h>
26 27
27#include <plat/irqs.h>
28#include <plat/sram.h> 28#include <plat/sram.h>
29#include <plat/omap-secure.h> 29#include <plat/omap-secure.h>
30#include <plat/mmc.h> 30#include <plat/mmc.h>
31 31
32#include <mach/hardware.h> 32#include "omap-wakeupgen.h"
33#include <mach/omap-wakeupgen.h>
34 33
34#include "soc.h"
35#include "common.h" 35#include "common.h"
36#include "hsmmc.h" 36#include "hsmmc.h"
37#include "omap4-sar-layout.h" 37#include "omap4-sar-layout.h"
38#include <linux/export.h>
39 38
40#ifdef CONFIG_CACHE_L2X0 39#ifdef CONFIG_CACHE_L2X0
41static void __iomem *l2cache_base; 40static void __iomem *l2cache_base;
@@ -171,7 +170,10 @@ static int __init omap_l2_cache_init(void)
171 /* Enable PL310 L2 Cache controller */ 170 /* Enable PL310 L2 Cache controller */
172 omap_smc1(0x102, 0x1); 171 omap_smc1(0x102, 0x1);
173 172
174 l2x0_init(l2cache_base, aux_ctrl, L2X0_AUX_CTRL_MASK); 173 if (of_have_populated_dt())
174 l2x0_of_init(aux_ctrl, L2X0_AUX_CTRL_MASK);
175 else
176 l2x0_init(l2cache_base, aux_ctrl, L2X0_AUX_CTRL_MASK);
175 177
176 /* 178 /*
177 * Override default outer_cache.disable with a OMAP4 179 * Override default outer_cache.disable with a OMAP4
diff --git a/arch/arm/plat-omap/include/plat/omap4-keypad.h b/arch/arm/mach-omap2/omap4-keypad.h
index 8ad0a377a54..20de0d5a7e7 100644
--- a/arch/arm/plat-omap/include/plat/omap4-keypad.h
+++ b/arch/arm/mach-omap2/omap4-keypad.h
@@ -1,6 +1,8 @@
1#ifndef ARCH_ARM_PLAT_OMAP4_KEYPAD_H 1#ifndef ARCH_ARM_PLAT_OMAP4_KEYPAD_H
2#define ARCH_ARM_PLAT_OMAP4_KEYPAD_H 2#define ARCH_ARM_PLAT_OMAP4_KEYPAD_H
3 3
4struct omap_board_data;
5
4extern int omap4_keyboard_init(struct omap4_keypad_platform_data *, 6extern int omap4_keyboard_init(struct omap4_keypad_platform_data *,
5 struct omap_board_data *); 7 struct omap_board_data *);
6#endif 8#endif
diff --git a/arch/arm/plat-omap/include/plat/omap44xx.h b/arch/arm/mach-omap2/omap44xx.h
index c0d478e55c8..43b927b2e2e 100644
--- a/arch/arm/plat-omap/include/plat/omap44xx.h
+++ b/arch/arm/mach-omap2/omap44xx.h
@@ -39,12 +39,12 @@
39#define IRQ_SIR_IRQ 0x0040 39#define IRQ_SIR_IRQ 0x0040
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_SCU_BASE 0x48240000 43#define OMAP44XX_SCU_BASE 0x48240000
43#define OMAP44XX_LOCAL_TWD_BASE 0x48240600 44#define OMAP44XX_LOCAL_TWD_BASE 0x48240600
44#define OMAP44XX_L2CACHE_BASE 0x48242000 45#define OMAP44XX_L2CACHE_BASE 0x48242000
45#define OMAP44XX_WKUPGEN_BASE 0x48281000 46#define OMAP44XX_WKUPGEN_BASE 0x48281000
46#define OMAP44XX_MCPDM_BASE 0x40132000 47#define OMAP44XX_MCPDM_BASE 0x40132000
47#define OMAP44XX_MCPDM_L3_BASE 0x49032000
48#define OMAP44XX_SAR_RAM_BASE 0x4a326000 48#define OMAP44XX_SAR_RAM_BASE 0x4a326000
49 49
50#define OMAP44XX_MAILBOX_BASE (L4_44XX_BASE + 0xF4000) 50#define OMAP44XX_MAILBOX_BASE (L4_44XX_BASE + 0xF4000)
diff --git a/arch/arm/plat-omap/include/plat/omap54xx.h b/arch/arm/mach-omap2/omap54xx.h
index a2582bb3cab..a2582bb3cab 100644
--- a/arch/arm/plat-omap/include/plat/omap54xx.h
+++ b/arch/arm/mach-omap2/omap54xx.h
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 6ca8e519968..b969ab1d258 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -139,18 +139,20 @@
139#include <linux/slab.h> 139#include <linux/slab.h>
140#include <linux/bootmem.h> 140#include <linux/bootmem.h>
141 141
142#include "common.h"
143#include <plat/cpu.h>
144#include "clockdomain.h"
145#include "powerdomain.h"
146#include <plat/clock.h> 142#include <plat/clock.h>
147#include <plat/omap_hwmod.h> 143#include <plat/omap_hwmod.h>
148#include <plat/prcm.h> 144#include <plat/prcm.h>
149 145
146#include "soc.h"
147#include "common.h"
148#include "clockdomain.h"
149#include "powerdomain.h"
150#include "cm2xxx_3xxx.h" 150#include "cm2xxx_3xxx.h"
151#include "cminst44xx.h" 151#include "cminst44xx.h"
152#include "cm33xx.h"
152#include "prm2xxx_3xxx.h" 153#include "prm2xxx_3xxx.h"
153#include "prm44xx.h" 154#include "prm44xx.h"
155#include "prm33xx.h"
154#include "prminst44xx.h" 156#include "prminst44xx.h"
155#include "mux.h" 157#include "mux.h"
156#include "pm.h" 158#include "pm.h"
@@ -677,16 +679,25 @@ static int _init_main_clk(struct omap_hwmod *oh)
677 if (!oh->main_clk) 679 if (!oh->main_clk)
678 return 0; 680 return 0;
679 681
680 oh->_clk = omap_clk_get_by_name(oh->main_clk); 682 oh->_clk = clk_get(NULL, oh->main_clk);
681 if (!oh->_clk) { 683 if (IS_ERR(oh->_clk)) {
682 pr_warning("omap_hwmod: %s: cannot clk_get main_clk %s\n", 684 pr_warning("omap_hwmod: %s: cannot clk_get main_clk %s\n",
683 oh->name, oh->main_clk); 685 oh->name, oh->main_clk);
684 return -EINVAL; 686 return -EINVAL;
685 } 687 }
688 /*
689 * HACK: This needs a re-visit once clk_prepare() is implemented
690 * to do something meaningful. Today its just a no-op.
691 * If clk_prepare() is used at some point to do things like
692 * voltage scaling etc, then this would have to be moved to
693 * some point where subsystems like i2c and pmic become
694 * available.
695 */
696 clk_prepare(oh->_clk);
686 697
687 if (!oh->_clk->clkdm) 698 if (!oh->_clk->clkdm)
688 pr_warning("omap_hwmod: %s: missing clockdomain for %s.\n", 699 pr_debug("omap_hwmod: %s: missing clockdomain for %s.\n",
689 oh->main_clk, oh->_clk->name); 700 oh->name, oh->main_clk);
690 701
691 return ret; 702 return ret;
692} 703}
@@ -713,13 +724,22 @@ static int _init_interface_clks(struct omap_hwmod *oh)
713 if (!os->clk) 724 if (!os->clk)
714 continue; 725 continue;
715 726
716 c = omap_clk_get_by_name(os->clk); 727 c = clk_get(NULL, os->clk);
717 if (!c) { 728 if (IS_ERR(c)) {
718 pr_warning("omap_hwmod: %s: cannot clk_get interface_clk %s\n", 729 pr_warning("omap_hwmod: %s: cannot clk_get interface_clk %s\n",
719 oh->name, os->clk); 730 oh->name, os->clk);
720 ret = -EINVAL; 731 ret = -EINVAL;
721 } 732 }
722 os->_clk = c; 733 os->_clk = c;
734 /*
735 * HACK: This needs a re-visit once clk_prepare() is implemented
736 * to do something meaningful. Today its just a no-op.
737 * If clk_prepare() is used at some point to do things like
738 * voltage scaling etc, then this would have to be moved to
739 * some point where subsystems like i2c and pmic become
740 * available.
741 */
742 clk_prepare(os->_clk);
723 } 743 }
724 744
725 return ret; 745 return ret;
@@ -740,13 +760,22 @@ static int _init_opt_clks(struct omap_hwmod *oh)
740 int ret = 0; 760 int ret = 0;
741 761
742 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) { 762 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) {
743 c = omap_clk_get_by_name(oc->clk); 763 c = clk_get(NULL, oc->clk);
744 if (!c) { 764 if (IS_ERR(c)) {
745 pr_warning("omap_hwmod: %s: cannot clk_get opt_clk %s\n", 765 pr_warning("omap_hwmod: %s: cannot clk_get opt_clk %s\n",
746 oh->name, oc->clk); 766 oh->name, oc->clk);
747 ret = -EINVAL; 767 ret = -EINVAL;
748 } 768 }
749 oc->_clk = c; 769 oc->_clk = c;
770 /*
771 * HACK: This needs a re-visit once clk_prepare() is implemented
772 * to do something meaningful. Today its just a no-op.
773 * If clk_prepare() is used at some point to do things like
774 * voltage scaling etc, then this would have to be moved to
775 * some point where subsystems like i2c and pmic become
776 * available.
777 */
778 clk_prepare(oc->_clk);
750 } 779 }
751 780
752 return ret; 781 return ret;
@@ -825,7 +854,7 @@ static void _enable_optional_clocks(struct omap_hwmod *oh)
825 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) 854 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
826 if (oc->_clk) { 855 if (oc->_clk) {
827 pr_debug("omap_hwmod: enable %s:%s\n", oc->role, 856 pr_debug("omap_hwmod: enable %s:%s\n", oc->role,
828 oc->_clk->name); 857 __clk_get_name(oc->_clk));
829 clk_enable(oc->_clk); 858 clk_enable(oc->_clk);
830 } 859 }
831} 860}
@@ -840,7 +869,7 @@ static void _disable_optional_clocks(struct omap_hwmod *oh)
840 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) 869 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
841 if (oc->_clk) { 870 if (oc->_clk) {
842 pr_debug("omap_hwmod: disable %s:%s\n", oc->role, 871 pr_debug("omap_hwmod: disable %s:%s\n", oc->role,
843 oc->_clk->name); 872 __clk_get_name(oc->_clk));
844 clk_disable(oc->_clk); 873 clk_disable(oc->_clk);
845 } 874 }
846} 875}
@@ -868,6 +897,26 @@ static void _omap4_enable_module(struct omap_hwmod *oh)
868} 897}
869 898
870/** 899/**
900 * _am33xx_enable_module - enable CLKCTRL modulemode on AM33XX
901 * @oh: struct omap_hwmod *
902 *
903 * Enables the PRCM module mode related to the hwmod @oh.
904 * No return value.
905 */
906static void _am33xx_enable_module(struct omap_hwmod *oh)
907{
908 if (!oh->clkdm || !oh->prcm.omap4.modulemode)
909 return;
910
911 pr_debug("omap_hwmod: %s: %s: %d\n",
912 oh->name, __func__, oh->prcm.omap4.modulemode);
913
914 am33xx_cm_module_enable(oh->prcm.omap4.modulemode, oh->clkdm->cm_inst,
915 oh->clkdm->clkdm_offs,
916 oh->prcm.omap4.clkctrl_offs);
917}
918
919/**
871 * _omap4_wait_target_disable - wait for a module to be disabled on OMAP4 920 * _omap4_wait_target_disable - wait for a module to be disabled on OMAP4
872 * @oh: struct omap_hwmod * 921 * @oh: struct omap_hwmod *
873 * 922 *
@@ -878,10 +927,10 @@ static void _omap4_enable_module(struct omap_hwmod *oh)
878 */ 927 */
879static int _omap4_wait_target_disable(struct omap_hwmod *oh) 928static int _omap4_wait_target_disable(struct omap_hwmod *oh)
880{ 929{
881 if (!oh || !oh->clkdm) 930 if (!oh)
882 return -EINVAL; 931 return -EINVAL;
883 932
884 if (oh->_int_flags & _HWMOD_NO_MPU_PORT) 933 if (oh->_int_flags & _HWMOD_NO_MPU_PORT || !oh->clkdm)
885 return 0; 934 return 0;
886 935
887 if (oh->flags & HWMOD_NO_IDLEST) 936 if (oh->flags & HWMOD_NO_IDLEST)
@@ -894,6 +943,31 @@ static int _omap4_wait_target_disable(struct omap_hwmod *oh)
894} 943}
895 944
896/** 945/**
946 * _am33xx_wait_target_disable - wait for a module to be disabled on AM33XX
947 * @oh: struct omap_hwmod *
948 *
949 * Wait for a module @oh to enter slave idle. Returns 0 if the module
950 * does not have an IDLEST bit or if the module successfully enters
951 * slave idle; otherwise, pass along the return value of the
952 * appropriate *_cm*_wait_module_idle() function.
953 */
954static int _am33xx_wait_target_disable(struct omap_hwmod *oh)
955{
956 if (!oh)
957 return -EINVAL;
958
959 if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
960 return 0;
961
962 if (oh->flags & HWMOD_NO_IDLEST)
963 return 0;
964
965 return am33xx_cm_wait_module_idle(oh->clkdm->cm_inst,
966 oh->clkdm->clkdm_offs,
967 oh->prcm.omap4.clkctrl_offs);
968}
969
970/**
897 * _count_mpu_irqs - count the number of MPU IRQ lines associated with @oh 971 * _count_mpu_irqs - count the number of MPU IRQ lines associated with @oh
898 * @oh: struct omap_hwmod *oh 972 * @oh: struct omap_hwmod *oh
899 * 973 *
@@ -1380,8 +1454,10 @@ static struct omap_hwmod *_lookup(const char *name)
1380 */ 1454 */
1381static int _init_clkdm(struct omap_hwmod *oh) 1455static int _init_clkdm(struct omap_hwmod *oh)
1382{ 1456{
1383 if (!oh->clkdm_name) 1457 if (!oh->clkdm_name) {
1458 pr_debug("omap_hwmod: %s: missing clockdomain\n", oh->name);
1384 return 0; 1459 return 0;
1460 }
1385 1461
1386 oh->clkdm = clkdm_lookup(oh->clkdm_name); 1462 oh->clkdm = clkdm_lookup(oh->clkdm_name);
1387 if (!oh->clkdm) { 1463 if (!oh->clkdm) {
@@ -1438,8 +1514,8 @@ static int _init_clocks(struct omap_hwmod *oh, void *data)
1438 * Return the bit position of the reset line that match the 1514 * Return the bit position of the reset line that match the
1439 * input name. Return -ENOENT if not found. 1515 * input name. Return -ENOENT if not found.
1440 */ 1516 */
1441static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name, 1517static int _lookup_hardreset(struct omap_hwmod *oh, const char *name,
1442 struct omap_hwmod_rst_info *ohri) 1518 struct omap_hwmod_rst_info *ohri)
1443{ 1519{
1444 int i; 1520 int i;
1445 1521
@@ -1475,7 +1551,7 @@ static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name,
1475static int _assert_hardreset(struct omap_hwmod *oh, const char *name) 1551static int _assert_hardreset(struct omap_hwmod *oh, const char *name)
1476{ 1552{
1477 struct omap_hwmod_rst_info ohri; 1553 struct omap_hwmod_rst_info ohri;
1478 u8 ret = -EINVAL; 1554 int ret = -EINVAL;
1479 1555
1480 if (!oh) 1556 if (!oh)
1481 return -EINVAL; 1557 return -EINVAL;
@@ -1484,7 +1560,7 @@ static int _assert_hardreset(struct omap_hwmod *oh, const char *name)
1484 return -ENOSYS; 1560 return -ENOSYS;
1485 1561
1486 ret = _lookup_hardreset(oh, name, &ohri); 1562 ret = _lookup_hardreset(oh, name, &ohri);
1487 if (IS_ERR_VALUE(ret)) 1563 if (ret < 0)
1488 return ret; 1564 return ret;
1489 1565
1490 ret = soc_ops.assert_hardreset(oh, &ohri); 1566 ret = soc_ops.assert_hardreset(oh, &ohri);
@@ -1509,6 +1585,7 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
1509{ 1585{
1510 struct omap_hwmod_rst_info ohri; 1586 struct omap_hwmod_rst_info ohri;
1511 int ret = -EINVAL; 1587 int ret = -EINVAL;
1588 int hwsup = 0;
1512 1589
1513 if (!oh) 1590 if (!oh)
1514 return -EINVAL; 1591 return -EINVAL;
@@ -1520,10 +1597,46 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
1520 if (IS_ERR_VALUE(ret)) 1597 if (IS_ERR_VALUE(ret))
1521 return ret; 1598 return ret;
1522 1599
1600 if (oh->clkdm) {
1601 /*
1602 * A clockdomain must be in SW_SUP otherwise reset
1603 * might not be completed. The clockdomain can be set
1604 * in HW_AUTO only when the module become ready.
1605 */
1606 hwsup = clkdm_in_hwsup(oh->clkdm);
1607 ret = clkdm_hwmod_enable(oh->clkdm, oh);
1608 if (ret) {
1609 WARN(1, "omap_hwmod: %s: could not enable clockdomain %s: %d\n",
1610 oh->name, oh->clkdm->name, ret);
1611 return ret;
1612 }
1613 }
1614
1615 _enable_clocks(oh);
1616 if (soc_ops.enable_module)
1617 soc_ops.enable_module(oh);
1618
1523 ret = soc_ops.deassert_hardreset(oh, &ohri); 1619 ret = soc_ops.deassert_hardreset(oh, &ohri);
1620
1621 if (soc_ops.disable_module)
1622 soc_ops.disable_module(oh);
1623 _disable_clocks(oh);
1624
1524 if (ret == -EBUSY) 1625 if (ret == -EBUSY)
1525 pr_warning("omap_hwmod: %s: failed to hardreset\n", oh->name); 1626 pr_warning("omap_hwmod: %s: failed to hardreset\n", oh->name);
1526 1627
1628 if (!ret) {
1629 /*
1630 * Set the clockdomain to HW_AUTO, assuming that the
1631 * previous state was HW_AUTO.
1632 */
1633 if (oh->clkdm && hwsup)
1634 clkdm_allow_idle(oh->clkdm);
1635 } else {
1636 if (oh->clkdm)
1637 clkdm_hwmod_disable(oh->clkdm, oh);
1638 }
1639
1527 return ret; 1640 return ret;
1528} 1641}
1529 1642
@@ -1542,7 +1655,7 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
1542static int _read_hardreset(struct omap_hwmod *oh, const char *name) 1655static int _read_hardreset(struct omap_hwmod *oh, const char *name)
1543{ 1656{
1544 struct omap_hwmod_rst_info ohri; 1657 struct omap_hwmod_rst_info ohri;
1545 u8 ret = -EINVAL; 1658 int ret = -EINVAL;
1546 1659
1547 if (!oh) 1660 if (!oh)
1548 return -EINVAL; 1661 return -EINVAL;
@@ -1551,37 +1664,63 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
1551 return -ENOSYS; 1664 return -ENOSYS;
1552 1665
1553 ret = _lookup_hardreset(oh, name, &ohri); 1666 ret = _lookup_hardreset(oh, name, &ohri);
1554 if (IS_ERR_VALUE(ret)) 1667 if (ret < 0)
1555 return ret; 1668 return ret;
1556 1669
1557 return soc_ops.is_hardreset_asserted(oh, &ohri); 1670 return soc_ops.is_hardreset_asserted(oh, &ohri);
1558} 1671}
1559 1672
1560/** 1673/**
1561 * _are_any_hardreset_lines_asserted - return true if part of @oh is hard-reset 1674 * _are_all_hardreset_lines_asserted - return true if the @oh is hard-reset
1562 * @oh: struct omap_hwmod * 1675 * @oh: struct omap_hwmod *
1563 * 1676 *
1564 * If any hardreset line associated with @oh is asserted, then return true. 1677 * If all hardreset lines associated with @oh are asserted, then return true.
1565 * Otherwise, if @oh has no hardreset lines associated with it, or if 1678 * Otherwise, if part of @oh is out hardreset or if no hardreset lines
1566 * no hardreset lines associated with @oh are asserted, then return false. 1679 * associated with @oh are asserted, then return false.
1567 * This function is used to avoid executing some parts of the IP block 1680 * This function is used to avoid executing some parts of the IP block
1568 * enable/disable sequence if a hardreset line is set. 1681 * enable/disable sequence if its hardreset line is set.
1569 */ 1682 */
1570static bool _are_any_hardreset_lines_asserted(struct omap_hwmod *oh) 1683static bool _are_all_hardreset_lines_asserted(struct omap_hwmod *oh)
1571{ 1684{
1572 int i; 1685 int i, rst_cnt = 0;
1573 1686
1574 if (oh->rst_lines_cnt == 0) 1687 if (oh->rst_lines_cnt == 0)
1575 return false; 1688 return false;
1576 1689
1577 for (i = 0; i < oh->rst_lines_cnt; i++) 1690 for (i = 0; i < oh->rst_lines_cnt; i++)
1578 if (_read_hardreset(oh, oh->rst_lines[i].name) > 0) 1691 if (_read_hardreset(oh, oh->rst_lines[i].name) > 0)
1579 return true; 1692 rst_cnt++;
1693
1694 if (oh->rst_lines_cnt == rst_cnt)
1695 return true;
1580 1696
1581 return false; 1697 return false;
1582} 1698}
1583 1699
1584/** 1700/**
1701 * _are_any_hardreset_lines_asserted - return true if any part of @oh is
1702 * hard-reset
1703 * @oh: struct omap_hwmod *
1704 *
1705 * If any hardreset lines associated with @oh are asserted, then
1706 * return true. Otherwise, if no hardreset lines associated with @oh
1707 * are asserted, or if @oh has no hardreset lines, then return false.
1708 * This function is used to avoid executing some parts of the IP block
1709 * enable/disable sequence if any hardreset line is set.
1710 */
1711static bool _are_any_hardreset_lines_asserted(struct omap_hwmod *oh)
1712{
1713 int rst_cnt = 0;
1714 int i;
1715
1716 for (i = 0; i < oh->rst_lines_cnt && rst_cnt == 0; i++)
1717 if (_read_hardreset(oh, oh->rst_lines[i].name) > 0)
1718 rst_cnt++;
1719
1720 return (rst_cnt) ? true : false;
1721}
1722
1723/**
1585 * _omap4_disable_module - enable CLKCTRL modulemode on OMAP4 1724 * _omap4_disable_module - enable CLKCTRL modulemode on OMAP4
1586 * @oh: struct omap_hwmod * 1725 * @oh: struct omap_hwmod *
1587 * 1726 *
@@ -1595,6 +1734,13 @@ static int _omap4_disable_module(struct omap_hwmod *oh)
1595 if (!oh->clkdm || !oh->prcm.omap4.modulemode) 1734 if (!oh->clkdm || !oh->prcm.omap4.modulemode)
1596 return -EINVAL; 1735 return -EINVAL;
1597 1736
1737 /*
1738 * Since integration code might still be doing something, only
1739 * disable if all lines are under hardreset.
1740 */
1741 if (_are_any_hardreset_lines_asserted(oh))
1742 return 0;
1743
1598 pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__); 1744 pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__);
1599 1745
1600 omap4_cminst_module_disable(oh->clkdm->prcm_partition, 1746 omap4_cminst_module_disable(oh->clkdm->prcm_partition,
@@ -1602,10 +1748,37 @@ static int _omap4_disable_module(struct omap_hwmod *oh)
1602 oh->clkdm->clkdm_offs, 1748 oh->clkdm->clkdm_offs,
1603 oh->prcm.omap4.clkctrl_offs); 1749 oh->prcm.omap4.clkctrl_offs);
1604 1750
1751 v = _omap4_wait_target_disable(oh);
1752 if (v)
1753 pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
1754 oh->name);
1755
1756 return 0;
1757}
1758
1759/**
1760 * _am33xx_disable_module - enable CLKCTRL modulemode on AM33XX
1761 * @oh: struct omap_hwmod *
1762 *
1763 * Disable the PRCM module mode related to the hwmod @oh.
1764 * Return EINVAL if the modulemode is not supported and 0 in case of success.
1765 */
1766static int _am33xx_disable_module(struct omap_hwmod *oh)
1767{
1768 int v;
1769
1770 if (!oh->clkdm || !oh->prcm.omap4.modulemode)
1771 return -EINVAL;
1772
1773 pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__);
1774
1605 if (_are_any_hardreset_lines_asserted(oh)) 1775 if (_are_any_hardreset_lines_asserted(oh))
1606 return 0; 1776 return 0;
1607 1777
1608 v = _omap4_wait_target_disable(oh); 1778 am33xx_cm_module_disable(oh->clkdm->cm_inst, oh->clkdm->clkdm_offs,
1779 oh->prcm.omap4.clkctrl_offs);
1780
1781 v = _am33xx_wait_target_disable(oh);
1609 if (v) 1782 if (v)
1610 pr_warn("omap_hwmod: %s: _wait_target_disable failed\n", 1783 pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
1611 oh->name); 1784 oh->name);
@@ -1641,8 +1814,8 @@ static int _ocp_softreset(struct omap_hwmod *oh)
1641 1814
1642 /* clocks must be on for this operation */ 1815 /* clocks must be on for this operation */
1643 if (oh->_state != _HWMOD_STATE_ENABLED) { 1816 if (oh->_state != _HWMOD_STATE_ENABLED) {
1644 pr_warning("omap_hwmod: %s: reset can only be entered from " 1817 pr_warn("omap_hwmod: %s: reset can only be entered from enabled state\n",
1645 "enabled state\n", oh->name); 1818 oh->name);
1646 return -EINVAL; 1819 return -EINVAL;
1647 } 1820 }
1648 1821
@@ -1830,7 +2003,7 @@ static int _enable(struct omap_hwmod *oh)
1830 } 2003 }
1831 2004
1832 /* 2005 /*
1833 * If an IP block contains HW reset lines and any of them are 2006 * If an IP block contains HW reset lines and all of them are
1834 * asserted, we let integration code associated with that 2007 * asserted, we let integration code associated with that
1835 * block handle the enable. We've received very little 2008 * block handle the enable. We've received very little
1836 * information on what those driver authors need, and until 2009 * information on what those driver authors need, and until
@@ -1838,7 +2011,7 @@ static int _enable(struct omap_hwmod *oh)
1838 * posted to the public lists, this is probably the best we 2011 * posted to the public lists, this is probably the best we
1839 * can do. 2012 * can do.
1840 */ 2013 */
1841 if (_are_any_hardreset_lines_asserted(oh)) 2014 if (_are_all_hardreset_lines_asserted(oh))
1842 return 0; 2015 return 0;
1843 2016
1844 /* Mux pins for device runtime if populated */ 2017 /* Mux pins for device runtime if populated */
@@ -1857,7 +2030,8 @@ static int _enable(struct omap_hwmod *oh)
1857 * completely the module. The clockdomain can be set 2030 * completely the module. The clockdomain can be set
1858 * in HW_AUTO only when the module become ready. 2031 * in HW_AUTO only when the module become ready.
1859 */ 2032 */
1860 hwsup = clkdm_in_hwsup(oh->clkdm); 2033 hwsup = clkdm_in_hwsup(oh->clkdm) &&
2034 !clkdm_missing_idle_reporting(oh->clkdm);
1861 r = clkdm_hwmod_enable(oh->clkdm, oh); 2035 r = clkdm_hwmod_enable(oh->clkdm, oh);
1862 if (r) { 2036 if (r) {
1863 WARN(1, "omap_hwmod: %s: could not enable clockdomain %s: %d\n", 2037 WARN(1, "omap_hwmod: %s: could not enable clockdomain %s: %d\n",
@@ -1889,6 +2063,7 @@ static int _enable(struct omap_hwmod *oh)
1889 _enable_sysc(oh); 2063 _enable_sysc(oh);
1890 } 2064 }
1891 } else { 2065 } else {
2066 _omap4_disable_module(oh);
1892 _disable_clocks(oh); 2067 _disable_clocks(oh);
1893 pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n", 2068 pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n",
1894 oh->name, r); 2069 oh->name, r);
@@ -1918,7 +2093,7 @@ static int _idle(struct omap_hwmod *oh)
1918 return -EINVAL; 2093 return -EINVAL;
1919 } 2094 }
1920 2095
1921 if (_are_any_hardreset_lines_asserted(oh)) 2096 if (_are_all_hardreset_lines_asserted(oh))
1922 return 0; 2097 return 0;
1923 2098
1924 if (oh->class->sysc) 2099 if (oh->class->sysc)
@@ -2006,7 +2181,7 @@ static int _shutdown(struct omap_hwmod *oh)
2006 return -EINVAL; 2181 return -EINVAL;
2007 } 2182 }
2008 2183
2009 if (_are_any_hardreset_lines_asserted(oh)) 2184 if (_are_all_hardreset_lines_asserted(oh))
2010 return 0; 2185 return 0;
2011 2186
2012 pr_debug("omap_hwmod: %s: disabling\n", oh->name); 2187 pr_debug("omap_hwmod: %s: disabling\n", oh->name);
@@ -2530,10 +2705,10 @@ static int _omap2_wait_target_ready(struct omap_hwmod *oh)
2530 */ 2705 */
2531static int _omap4_wait_target_ready(struct omap_hwmod *oh) 2706static int _omap4_wait_target_ready(struct omap_hwmod *oh)
2532{ 2707{
2533 if (!oh || !oh->clkdm) 2708 if (!oh)
2534 return -EINVAL; 2709 return -EINVAL;
2535 2710
2536 if (oh->flags & HWMOD_NO_IDLEST) 2711 if (oh->flags & HWMOD_NO_IDLEST || !oh->clkdm)
2537 return 0; 2712 return 0;
2538 2713
2539 if (!_find_mpu_rt_port(oh)) 2714 if (!_find_mpu_rt_port(oh))
@@ -2548,6 +2723,33 @@ static int _omap4_wait_target_ready(struct omap_hwmod *oh)
2548} 2723}
2549 2724
2550/** 2725/**
2726 * _am33xx_wait_target_ready - wait for a module to leave slave idle
2727 * @oh: struct omap_hwmod *
2728 *
2729 * Wait for a module @oh to leave slave idle. Returns 0 if the module
2730 * does not have an IDLEST bit or if the module successfully leaves
2731 * slave idle; otherwise, pass along the return value of the
2732 * appropriate *_cm*_wait_module_ready() function.
2733 */
2734static int _am33xx_wait_target_ready(struct omap_hwmod *oh)
2735{
2736 if (!oh || !oh->clkdm)
2737 return -EINVAL;
2738
2739 if (oh->flags & HWMOD_NO_IDLEST)
2740 return 0;
2741
2742 if (!_find_mpu_rt_port(oh))
2743 return 0;
2744
2745 /* XXX check module SIDLEMODE, hardreset status */
2746
2747 return am33xx_cm_wait_module_ready(oh->clkdm->cm_inst,
2748 oh->clkdm->clkdm_offs,
2749 oh->prcm.omap4.clkctrl_offs);
2750}
2751
2752/**
2551 * _omap2_assert_hardreset - call OMAP2 PRM hardreset fn with hwmod args 2753 * _omap2_assert_hardreset - call OMAP2 PRM hardreset fn with hwmod args
2552 * @oh: struct omap_hwmod * to assert hardreset 2754 * @oh: struct omap_hwmod * to assert hardreset
2553 * @ohri: hardreset line data 2755 * @ohri: hardreset line data
@@ -2678,6 +2880,72 @@ static int _omap4_is_hardreset_asserted(struct omap_hwmod *oh,
2678 oh->prcm.omap4.rstctrl_offs); 2880 oh->prcm.omap4.rstctrl_offs);
2679} 2881}
2680 2882
2883/**
2884 * _am33xx_assert_hardreset - call AM33XX PRM hardreset fn with hwmod args
2885 * @oh: struct omap_hwmod * to assert hardreset
2886 * @ohri: hardreset line data
2887 *
2888 * Call am33xx_prminst_assert_hardreset() with parameters extracted
2889 * from the hwmod @oh and the hardreset line data @ohri. Only
2890 * intended for use as an soc_ops function pointer. Passes along the
2891 * return value from am33xx_prminst_assert_hardreset(). XXX This
2892 * function is scheduled for removal when the PRM code is moved into
2893 * drivers/.
2894 */
2895static int _am33xx_assert_hardreset(struct omap_hwmod *oh,
2896 struct omap_hwmod_rst_info *ohri)
2897
2898{
2899 return am33xx_prm_assert_hardreset(ohri->rst_shift,
2900 oh->clkdm->pwrdm.ptr->prcm_offs,
2901 oh->prcm.omap4.rstctrl_offs);
2902}
2903
2904/**
2905 * _am33xx_deassert_hardreset - call AM33XX PRM hardreset fn with hwmod args
2906 * @oh: struct omap_hwmod * to deassert hardreset
2907 * @ohri: hardreset line data
2908 *
2909 * Call am33xx_prminst_deassert_hardreset() with parameters extracted
2910 * from the hwmod @oh and the hardreset line data @ohri. Only
2911 * intended for use as an soc_ops function pointer. Passes along the
2912 * return value from am33xx_prminst_deassert_hardreset(). XXX This
2913 * function is scheduled for removal when the PRM code is moved into
2914 * drivers/.
2915 */
2916static int _am33xx_deassert_hardreset(struct omap_hwmod *oh,
2917 struct omap_hwmod_rst_info *ohri)
2918{
2919 if (ohri->st_shift)
2920 pr_err("omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
2921 oh->name, ohri->name);
2922
2923 return am33xx_prm_deassert_hardreset(ohri->rst_shift,
2924 oh->clkdm->pwrdm.ptr->prcm_offs,
2925 oh->prcm.omap4.rstctrl_offs,
2926 oh->prcm.omap4.rstst_offs);
2927}
2928
2929/**
2930 * _am33xx_is_hardreset_asserted - call AM33XX PRM hardreset fn with hwmod args
2931 * @oh: struct omap_hwmod * to test hardreset
2932 * @ohri: hardreset line data
2933 *
2934 * Call am33xx_prminst_is_hardreset_asserted() with parameters
2935 * extracted from the hwmod @oh and the hardreset line data @ohri.
2936 * Only intended for use as an soc_ops function pointer. Passes along
2937 * the return value from am33xx_prminst_is_hardreset_asserted(). XXX
2938 * This function is scheduled for removal when the PRM code is moved
2939 * into drivers/.
2940 */
2941static int _am33xx_is_hardreset_asserted(struct omap_hwmod *oh,
2942 struct omap_hwmod_rst_info *ohri)
2943{
2944 return am33xx_prm_is_hardreset_asserted(ohri->rst_shift,
2945 oh->clkdm->pwrdm.ptr->prcm_offs,
2946 oh->prcm.omap4.rstctrl_offs);
2947}
2948
2681/* Public functions */ 2949/* Public functions */
2682 2950
2683u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs) 2951u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs)
@@ -3158,6 +3426,33 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
3158} 3426}
3159 3427
3160/** 3428/**
3429 * omap_hwmod_fill_dma_resources - fill struct resource array with dma data
3430 * @oh: struct omap_hwmod *
3431 * @res: pointer to the array of struct resource to fill
3432 *
3433 * Fill the struct resource array @res with dma resource data from the
3434 * omap_hwmod @oh. Intended to be called by code that registers
3435 * omap_devices. See also omap_hwmod_count_resources(). Returns the
3436 * number of array elements filled.
3437 */
3438int omap_hwmod_fill_dma_resources(struct omap_hwmod *oh, struct resource *res)
3439{
3440 int i, sdma_reqs_cnt;
3441 int r = 0;
3442
3443 sdma_reqs_cnt = _count_sdma_reqs(oh);
3444 for (i = 0; i < sdma_reqs_cnt; i++) {
3445 (res + r)->name = (oh->sdma_reqs + i)->name;
3446 (res + r)->start = (oh->sdma_reqs + i)->dma_req;
3447 (res + r)->end = (oh->sdma_reqs + i)->dma_req;
3448 (res + r)->flags = IORESOURCE_DMA;
3449 r++;
3450 }
3451
3452 return r;
3453}
3454
3455/**
3161 * omap_hwmod_get_resource_byname - fetch IP block integration data by name 3456 * omap_hwmod_get_resource_byname - fetch IP block integration data by name
3162 * @oh: struct omap_hwmod * to operate on 3457 * @oh: struct omap_hwmod * to operate on
3163 * @type: one of the IORESOURCE_* constants from include/linux/ioport.h 3458 * @type: one of the IORESOURCE_* constants from include/linux/ioport.h
@@ -3677,6 +3972,14 @@ void __init omap_hwmod_init(void)
3677 soc_ops.deassert_hardreset = _omap4_deassert_hardreset; 3972 soc_ops.deassert_hardreset = _omap4_deassert_hardreset;
3678 soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted; 3973 soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted;
3679 soc_ops.init_clkdm = _init_clkdm; 3974 soc_ops.init_clkdm = _init_clkdm;
3975 } else if (soc_is_am33xx()) {
3976 soc_ops.enable_module = _am33xx_enable_module;
3977 soc_ops.disable_module = _am33xx_disable_module;
3978 soc_ops.wait_target_ready = _am33xx_wait_target_ready;
3979 soc_ops.assert_hardreset = _am33xx_assert_hardreset;
3980 soc_ops.deassert_hardreset = _am33xx_deassert_hardreset;
3981 soc_ops.is_hardreset_asserted = _am33xx_is_hardreset_asserted;
3982 soc_ops.init_clkdm = _init_clkdm;
3680 } else { 3983 } else {
3681 WARN(1, "omap_hwmod: unknown SoC type\n"); 3984 WARN(1, "omap_hwmod: unknown SoC type\n");
3682 } 3985 }
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index 50cfab61b0e..b5db6007c52 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -12,17 +12,15 @@
12 * XXX handle crossbar/shared link difference for L3? 12 * XXX handle crossbar/shared link difference for L3?
13 * XXX these should be marked initdata for multi-OMAP kernels 13 * XXX these should be marked initdata for multi-OMAP kernels
14 */ 14 */
15#include <linux/platform_data/spi-omap2-mcspi.h>
16
15#include <plat/omap_hwmod.h> 17#include <plat/omap_hwmod.h>
16#include <mach/irqs.h>
17#include <plat/cpu.h>
18#include <plat/dma.h> 18#include <plat/dma.h>
19#include <plat/serial.h> 19#include <plat/serial.h>
20#include <plat/i2c.h> 20#include <plat/i2c.h>
21#include <plat/gpio.h>
22#include <plat/mcspi.h>
23#include <plat/dmtimer.h> 21#include <plat/dmtimer.h>
24#include <plat/l3_2xxx.h> 22#include "l3_2xxx.h"
25#include <plat/l4_2xxx.h> 23#include "l4_2xxx.h"
26#include <plat/mmc.h> 24#include <plat/mmc.h>
27 25
28#include "omap_hwmod_common_data.h" 26#include "omap_hwmod_common_data.h"
@@ -162,9 +160,9 @@ static struct omap_hwmod omap2420_dma_system_hwmod = {
162 160
163/* mailbox */ 161/* mailbox */
164static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = { 162static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = {
165 { .name = "dsp", .irq = 26 }, 163 { .name = "dsp", .irq = 26 + OMAP_INTC_START, },
166 { .name = "iva", .irq = 34 }, 164 { .name = "iva", .irq = 34 + OMAP_INTC_START, },
167 { .irq = -1 } 165 { .irq = -1 },
168}; 166};
169 167
170static struct omap_hwmod omap2420_mailbox_hwmod = { 168static struct omap_hwmod omap2420_mailbox_hwmod = {
@@ -199,9 +197,9 @@ static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = {
199 197
200/* mcbsp1 */ 198/* mcbsp1 */
201static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = { 199static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = {
202 { .name = "tx", .irq = 59 }, 200 { .name = "tx", .irq = 59 + OMAP_INTC_START, },
203 { .name = "rx", .irq = 60 }, 201 { .name = "rx", .irq = 60 + OMAP_INTC_START, },
204 { .irq = -1 } 202 { .irq = -1 },
205}; 203};
206 204
207static struct omap_hwmod omap2420_mcbsp1_hwmod = { 205static struct omap_hwmod omap2420_mcbsp1_hwmod = {
@@ -225,9 +223,9 @@ static struct omap_hwmod omap2420_mcbsp1_hwmod = {
225 223
226/* mcbsp2 */ 224/* mcbsp2 */
227static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = { 225static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = {
228 { .name = "tx", .irq = 62 }, 226 { .name = "tx", .irq = 62 + OMAP_INTC_START, },
229 { .name = "rx", .irq = 63 }, 227 { .name = "rx", .irq = 63 + OMAP_INTC_START, },
230 { .irq = -1 } 228 { .irq = -1 },
231}; 229};
232 230
233static struct omap_hwmod omap2420_mcbsp2_hwmod = { 231static struct omap_hwmod omap2420_mcbsp2_hwmod = {
@@ -265,8 +263,8 @@ static struct omap_hwmod_class omap2420_msdi_hwmod_class = {
265 263
266/* msdi1 */ 264/* msdi1 */
267static struct omap_hwmod_irq_info omap2420_msdi1_irqs[] = { 265static struct omap_hwmod_irq_info omap2420_msdi1_irqs[] = {
268 { .irq = 83 }, 266 { .irq = 83 + OMAP_INTC_START, },
269 { .irq = -1 } 267 { .irq = -1 },
270}; 268};
271 269
272static struct omap_hwmod_dma_info omap2420_msdi1_sdma_reqs[] = { 270static struct omap_hwmod_dma_info omap2420_msdi1_sdma_reqs[] = {
@@ -538,6 +536,15 @@ static struct omap_hwmod_addr_space omap2420_counter_32k_addrs[] = {
538 { } 536 { }
539}; 537};
540 538
539static struct omap_hwmod_addr_space omap2420_gpmc_addrs[] = {
540 {
541 .pa_start = 0x6800a000,
542 .pa_end = 0x6800afff,
543 .flags = ADDR_TYPE_RT
544 },
545 { }
546};
547
541static struct omap_hwmod_ocp_if omap2420_l4_wkup__counter_32k = { 548static struct omap_hwmod_ocp_if omap2420_l4_wkup__counter_32k = {
542 .master = &omap2xxx_l4_wkup_hwmod, 549 .master = &omap2xxx_l4_wkup_hwmod,
543 .slave = &omap2xxx_counter_32k_hwmod, 550 .slave = &omap2xxx_counter_32k_hwmod,
@@ -546,6 +553,14 @@ static struct omap_hwmod_ocp_if omap2420_l4_wkup__counter_32k = {
546 .user = OCP_USER_MPU | OCP_USER_SDMA, 553 .user = OCP_USER_MPU | OCP_USER_SDMA,
547}; 554};
548 555
556static struct omap_hwmod_ocp_if omap2420_l3__gpmc = {
557 .master = &omap2xxx_l3_main_hwmod,
558 .slave = &omap2xxx_gpmc_hwmod,
559 .clk = "core_l3_ck",
560 .addr = omap2420_gpmc_addrs,
561 .user = OCP_USER_MPU | OCP_USER_SDMA,
562};
563
549static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = { 564static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = {
550 &omap2xxx_l3_main__l4_core, 565 &omap2xxx_l3_main__l4_core,
551 &omap2xxx_mpu__l3_main, 566 &omap2xxx_mpu__l3_main,
@@ -587,8 +602,10 @@ static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = {
587 &omap2420_l4_core__mcbsp1, 602 &omap2420_l4_core__mcbsp1,
588 &omap2420_l4_core__mcbsp2, 603 &omap2420_l4_core__mcbsp2,
589 &omap2420_l4_core__msdi1, 604 &omap2420_l4_core__msdi1,
605 &omap2xxx_l4_core__rng,
590 &omap2420_l4_core__hdq1w, 606 &omap2420_l4_core__hdq1w,
591 &omap2420_l4_wkup__counter_32k, 607 &omap2420_l4_wkup__counter_32k,
608 &omap2420_l3__gpmc,
592 NULL, 609 NULL,
593}; 610};
594 611
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 58b5bc196d3..c455e41b023 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -12,21 +12,19 @@
12 * XXX handle crossbar/shared link difference for L3? 12 * XXX handle crossbar/shared link difference for L3?
13 * XXX these should be marked initdata for multi-OMAP kernels 13 * XXX these should be marked initdata for multi-OMAP kernels
14 */ 14 */
15#include <linux/platform_data/asoc-ti-mcbsp.h>
16#include <linux/platform_data/spi-omap2-mcspi.h>
17
15#include <plat/omap_hwmod.h> 18#include <plat/omap_hwmod.h>
16#include <mach/irqs.h>
17#include <plat/cpu.h>
18#include <plat/dma.h> 19#include <plat/dma.h>
19#include <plat/serial.h> 20#include <plat/serial.h>
20#include <plat/i2c.h> 21#include <plat/i2c.h>
21#include <plat/gpio.h>
22#include <plat/mcbsp.h>
23#include <plat/mcspi.h>
24#include <plat/dmtimer.h> 22#include <plat/dmtimer.h>
25#include <plat/mmc.h> 23#include <plat/mmc.h>
26#include <plat/l3_2xxx.h> 24#include "l3_2xxx.h"
27 25
26#include "soc.h"
28#include "omap_hwmod_common_data.h" 27#include "omap_hwmod_common_data.h"
29
30#include "prm-regbits-24xx.h" 28#include "prm-regbits-24xx.h"
31#include "cm-regbits-24xx.h" 29#include "cm-regbits-24xx.h"
32#include "wd_timer.h" 30#include "wd_timer.h"
@@ -133,8 +131,8 @@ static struct omap_hwmod omap2430_i2c2_hwmod = {
133 131
134/* gpio5 */ 132/* gpio5 */
135static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = { 133static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = {
136 { .irq = 33 }, /* INT_24XX_GPIO_BANK5 */ 134 { .irq = 33 + OMAP_INTC_START, }, /* INT_24XX_GPIO_BANK5 */
137 { .irq = -1 } 135 { .irq = -1 },
138}; 136};
139 137
140static struct omap_hwmod omap2430_gpio5_hwmod = { 138static struct omap_hwmod omap2430_gpio5_hwmod = {
@@ -173,8 +171,8 @@ static struct omap_hwmod omap2430_dma_system_hwmod = {
173 171
174/* mailbox */ 172/* mailbox */
175static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = { 173static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = {
176 { .irq = 26 }, 174 { .irq = 26 + OMAP_INTC_START, },
177 { .irq = -1 } 175 { .irq = -1 },
178}; 176};
179 177
180static struct omap_hwmod omap2430_mailbox_hwmod = { 178static struct omap_hwmod omap2430_mailbox_hwmod = {
@@ -195,8 +193,8 @@ static struct omap_hwmod omap2430_mailbox_hwmod = {
195 193
196/* mcspi3 */ 194/* mcspi3 */
197static struct omap_hwmod_irq_info omap2430_mcspi3_mpu_irqs[] = { 195static struct omap_hwmod_irq_info omap2430_mcspi3_mpu_irqs[] = {
198 { .irq = 91 }, 196 { .irq = 91 + OMAP_INTC_START, },
199 { .irq = -1 } 197 { .irq = -1 },
200}; 198};
201 199
202static struct omap_hwmod_dma_info omap2430_mcspi3_sdma_reqs[] = { 200static struct omap_hwmod_dma_info omap2430_mcspi3_sdma_reqs[] = {
@@ -250,9 +248,9 @@ static struct omap_hwmod_class usbotg_class = {
250/* usb_otg_hs */ 248/* usb_otg_hs */
251static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = { 249static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = {
252 250
253 { .name = "mc", .irq = 92 }, 251 { .name = "mc", .irq = 92 + OMAP_INTC_START, },
254 { .name = "dma", .irq = 93 }, 252 { .name = "dma", .irq = 93 + OMAP_INTC_START, },
255 { .irq = -1 } 253 { .irq = -1 },
256}; 254};
257 255
258static struct omap_hwmod omap2430_usbhsotg_hwmod = { 256static struct omap_hwmod omap2430_usbhsotg_hwmod = {
@@ -303,11 +301,11 @@ static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = {
303 301
304/* mcbsp1 */ 302/* mcbsp1 */
305static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = { 303static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = {
306 { .name = "tx", .irq = 59 }, 304 { .name = "tx", .irq = 59 + OMAP_INTC_START, },
307 { .name = "rx", .irq = 60 }, 305 { .name = "rx", .irq = 60 + OMAP_INTC_START, },
308 { .name = "ovr", .irq = 61 }, 306 { .name = "ovr", .irq = 61 + OMAP_INTC_START, },
309 { .name = "common", .irq = 64 }, 307 { .name = "common", .irq = 64 + OMAP_INTC_START, },
310 { .irq = -1 } 308 { .irq = -1 },
311}; 309};
312 310
313static struct omap_hwmod omap2430_mcbsp1_hwmod = { 311static struct omap_hwmod omap2430_mcbsp1_hwmod = {
@@ -331,10 +329,10 @@ static struct omap_hwmod omap2430_mcbsp1_hwmod = {
331 329
332/* mcbsp2 */ 330/* mcbsp2 */
333static struct omap_hwmod_irq_info omap2430_mcbsp2_irqs[] = { 331static struct omap_hwmod_irq_info omap2430_mcbsp2_irqs[] = {
334 { .name = "tx", .irq = 62 }, 332 { .name = "tx", .irq = 62 + OMAP_INTC_START, },
335 { .name = "rx", .irq = 63 }, 333 { .name = "rx", .irq = 63 + OMAP_INTC_START, },
336 { .name = "common", .irq = 16 }, 334 { .name = "common", .irq = 16 + OMAP_INTC_START, },
337 { .irq = -1 } 335 { .irq = -1 },
338}; 336};
339 337
340static struct omap_hwmod omap2430_mcbsp2_hwmod = { 338static struct omap_hwmod omap2430_mcbsp2_hwmod = {
@@ -358,10 +356,10 @@ static struct omap_hwmod omap2430_mcbsp2_hwmod = {
358 356
359/* mcbsp3 */ 357/* mcbsp3 */
360static struct omap_hwmod_irq_info omap2430_mcbsp3_irqs[] = { 358static struct omap_hwmod_irq_info omap2430_mcbsp3_irqs[] = {
361 { .name = "tx", .irq = 89 }, 359 { .name = "tx", .irq = 89 + OMAP_INTC_START, },
362 { .name = "rx", .irq = 90 }, 360 { .name = "rx", .irq = 90 + OMAP_INTC_START, },
363 { .name = "common", .irq = 17 }, 361 { .name = "common", .irq = 17 + OMAP_INTC_START, },
364 { .irq = -1 } 362 { .irq = -1 },
365}; 363};
366 364
367static struct omap_hwmod omap2430_mcbsp3_hwmod = { 365static struct omap_hwmod omap2430_mcbsp3_hwmod = {
@@ -385,10 +383,10 @@ static struct omap_hwmod omap2430_mcbsp3_hwmod = {
385 383
386/* mcbsp4 */ 384/* mcbsp4 */
387static struct omap_hwmod_irq_info omap2430_mcbsp4_irqs[] = { 385static struct omap_hwmod_irq_info omap2430_mcbsp4_irqs[] = {
388 { .name = "tx", .irq = 54 }, 386 { .name = "tx", .irq = 54 + OMAP_INTC_START, },
389 { .name = "rx", .irq = 55 }, 387 { .name = "rx", .irq = 55 + OMAP_INTC_START, },
390 { .name = "common", .irq = 18 }, 388 { .name = "common", .irq = 18 + OMAP_INTC_START, },
391 { .irq = -1 } 389 { .irq = -1 },
392}; 390};
393 391
394static struct omap_hwmod_dma_info omap2430_mcbsp4_sdma_chs[] = { 392static struct omap_hwmod_dma_info omap2430_mcbsp4_sdma_chs[] = {
@@ -418,10 +416,10 @@ static struct omap_hwmod omap2430_mcbsp4_hwmod = {
418 416
419/* mcbsp5 */ 417/* mcbsp5 */
420static struct omap_hwmod_irq_info omap2430_mcbsp5_irqs[] = { 418static struct omap_hwmod_irq_info omap2430_mcbsp5_irqs[] = {
421 { .name = "tx", .irq = 81 }, 419 { .name = "tx", .irq = 81 + OMAP_INTC_START, },
422 { .name = "rx", .irq = 82 }, 420 { .name = "rx", .irq = 82 + OMAP_INTC_START, },
423 { .name = "common", .irq = 19 }, 421 { .name = "common", .irq = 19 + OMAP_INTC_START, },
424 { .irq = -1 } 422 { .irq = -1 },
425}; 423};
426 424
427static struct omap_hwmod_dma_info omap2430_mcbsp5_sdma_chs[] = { 425static struct omap_hwmod_dma_info omap2430_mcbsp5_sdma_chs[] = {
@@ -468,8 +466,8 @@ static struct omap_hwmod_class omap2430_mmc_class = {
468 466
469/* MMC/SD/SDIO1 */ 467/* MMC/SD/SDIO1 */
470static struct omap_hwmod_irq_info omap2430_mmc1_mpu_irqs[] = { 468static struct omap_hwmod_irq_info omap2430_mmc1_mpu_irqs[] = {
471 { .irq = 83 }, 469 { .irq = 83 + OMAP_INTC_START, },
472 { .irq = -1 } 470 { .irq = -1 },
473}; 471};
474 472
475static struct omap_hwmod_dma_info omap2430_mmc1_sdma_reqs[] = { 473static struct omap_hwmod_dma_info omap2430_mmc1_sdma_reqs[] = {
@@ -509,8 +507,8 @@ static struct omap_hwmod omap2430_mmc1_hwmod = {
509 507
510/* MMC/SD/SDIO2 */ 508/* MMC/SD/SDIO2 */
511static struct omap_hwmod_irq_info omap2430_mmc2_mpu_irqs[] = { 509static struct omap_hwmod_irq_info omap2430_mmc2_mpu_irqs[] = {
512 { .irq = 86 }, 510 { .irq = 86 + OMAP_INTC_START, },
513 { .irq = -1 } 511 { .irq = -1 },
514}; 512};
515 513
516static struct omap_hwmod_dma_info omap2430_mmc2_sdma_reqs[] = { 514static struct omap_hwmod_dma_info omap2430_mmc2_sdma_reqs[] = {
@@ -890,6 +888,15 @@ static struct omap_hwmod_addr_space omap2430_counter_32k_addrs[] = {
890 { } 888 { }
891}; 889};
892 890
891static struct omap_hwmod_addr_space omap2430_gpmc_addrs[] = {
892 {
893 .pa_start = 0x6e000000,
894 .pa_end = 0x6e000fff,
895 .flags = ADDR_TYPE_RT
896 },
897 { }
898};
899
893static struct omap_hwmod_ocp_if omap2430_l4_wkup__counter_32k = { 900static struct omap_hwmod_ocp_if omap2430_l4_wkup__counter_32k = {
894 .master = &omap2xxx_l4_wkup_hwmod, 901 .master = &omap2xxx_l4_wkup_hwmod,
895 .slave = &omap2xxx_counter_32k_hwmod, 902 .slave = &omap2xxx_counter_32k_hwmod,
@@ -898,6 +905,14 @@ static struct omap_hwmod_ocp_if omap2430_l4_wkup__counter_32k = {
898 .user = OCP_USER_MPU | OCP_USER_SDMA, 905 .user = OCP_USER_MPU | OCP_USER_SDMA,
899}; 906};
900 907
908static struct omap_hwmod_ocp_if omap2430_l3__gpmc = {
909 .master = &omap2xxx_l3_main_hwmod,
910 .slave = &omap2xxx_gpmc_hwmod,
911 .clk = "core_l3_ck",
912 .addr = omap2430_gpmc_addrs,
913 .user = OCP_USER_MPU | OCP_USER_SDMA,
914};
915
901static struct omap_hwmod_ocp_if *omap2430_hwmod_ocp_ifs[] __initdata = { 916static struct omap_hwmod_ocp_if *omap2430_hwmod_ocp_ifs[] __initdata = {
902 &omap2xxx_l3_main__l4_core, 917 &omap2xxx_l3_main__l4_core,
903 &omap2xxx_mpu__l3_main, 918 &omap2xxx_mpu__l3_main,
@@ -947,7 +962,9 @@ static struct omap_hwmod_ocp_if *omap2430_hwmod_ocp_ifs[] __initdata = {
947 &omap2430_l4_core__mcbsp4, 962 &omap2430_l4_core__mcbsp4,
948 &omap2430_l4_core__mcbsp5, 963 &omap2430_l4_core__mcbsp5,
949 &omap2430_l4_core__hdq1w, 964 &omap2430_l4_core__hdq1w,
965 &omap2xxx_l4_core__rng,
950 &omap2430_l4_wkup__counter_32k, 966 &omap2430_l4_wkup__counter_32k,
967 &omap2430_l3__gpmc,
951 NULL, 968 NULL,
952}; 969};
953 970
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
index 102d76e9e9e..8851bbb6bb2 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
@@ -13,9 +13,7 @@
13#include <plat/serial.h> 13#include <plat/serial.h>
14#include <plat/dma.h> 14#include <plat/dma.h>
15#include <plat/common.h> 15#include <plat/common.h>
16#include <plat/hdq1w.h> 16#include "hdq1w.h"
17
18#include <mach/irqs.h>
19 17
20#include "omap_hwmod_common_data.h" 18#include "omap_hwmod_common_data.h"
21 19
@@ -182,126 +180,126 @@ struct omap_hwmod_class iva_hwmod_class = {
182/* Common MPU IRQ line data */ 180/* Common MPU IRQ line data */
183 181
184struct omap_hwmod_irq_info omap2_timer1_mpu_irqs[] = { 182struct omap_hwmod_irq_info omap2_timer1_mpu_irqs[] = {
185 { .irq = 37, }, 183 { .irq = 37 + OMAP_INTC_START, },
186 { .irq = -1 } 184 { .irq = -1 },
187}; 185};
188 186
189struct omap_hwmod_irq_info omap2_timer2_mpu_irqs[] = { 187struct omap_hwmod_irq_info omap2_timer2_mpu_irqs[] = {
190 { .irq = 38, }, 188 { .irq = 38 + OMAP_INTC_START, },
191 { .irq = -1 } 189 { .irq = -1 },
192}; 190};
193 191
194struct omap_hwmod_irq_info omap2_timer3_mpu_irqs[] = { 192struct omap_hwmod_irq_info omap2_timer3_mpu_irqs[] = {
195 { .irq = 39, }, 193 { .irq = 39 + OMAP_INTC_START, },
196 { .irq = -1 } 194 { .irq = -1 },
197}; 195};
198 196
199struct omap_hwmod_irq_info omap2_timer4_mpu_irqs[] = { 197struct omap_hwmod_irq_info omap2_timer4_mpu_irqs[] = {
200 { .irq = 40, }, 198 { .irq = 40 + OMAP_INTC_START, },
201 { .irq = -1 } 199 { .irq = -1 },
202}; 200};
203 201
204struct omap_hwmod_irq_info omap2_timer5_mpu_irqs[] = { 202struct omap_hwmod_irq_info omap2_timer5_mpu_irqs[] = {
205 { .irq = 41, }, 203 { .irq = 41 + OMAP_INTC_START, },
206 { .irq = -1 } 204 { .irq = -1 },
207}; 205};
208 206
209struct omap_hwmod_irq_info omap2_timer6_mpu_irqs[] = { 207struct omap_hwmod_irq_info omap2_timer6_mpu_irqs[] = {
210 { .irq = 42, }, 208 { .irq = 42 + OMAP_INTC_START, },
211 { .irq = -1 } 209 { .irq = -1 },
212}; 210};
213 211
214struct omap_hwmod_irq_info omap2_timer7_mpu_irqs[] = { 212struct omap_hwmod_irq_info omap2_timer7_mpu_irqs[] = {
215 { .irq = 43, }, 213 { .irq = 43 + OMAP_INTC_START, },
216 { .irq = -1 } 214 { .irq = -1 },
217}; 215};
218 216
219struct omap_hwmod_irq_info omap2_timer8_mpu_irqs[] = { 217struct omap_hwmod_irq_info omap2_timer8_mpu_irqs[] = {
220 { .irq = 44, }, 218 { .irq = 44 + OMAP_INTC_START, },
221 { .irq = -1 } 219 { .irq = -1 },
222}; 220};
223 221
224struct omap_hwmod_irq_info omap2_timer9_mpu_irqs[] = { 222struct omap_hwmod_irq_info omap2_timer9_mpu_irqs[] = {
225 { .irq = 45, }, 223 { .irq = 45 + OMAP_INTC_START, },
226 { .irq = -1 } 224 { .irq = -1 },
227}; 225};
228 226
229struct omap_hwmod_irq_info omap2_timer10_mpu_irqs[] = { 227struct omap_hwmod_irq_info omap2_timer10_mpu_irqs[] = {
230 { .irq = 46, }, 228 { .irq = 46 + OMAP_INTC_START, },
231 { .irq = -1 } 229 { .irq = -1 },
232}; 230};
233 231
234struct omap_hwmod_irq_info omap2_timer11_mpu_irqs[] = { 232struct omap_hwmod_irq_info omap2_timer11_mpu_irqs[] = {
235 { .irq = 47, }, 233 { .irq = 47 + OMAP_INTC_START, },
236 { .irq = -1 } 234 { .irq = -1 },
237}; 235};
238 236
239struct omap_hwmod_irq_info omap2_uart1_mpu_irqs[] = { 237struct omap_hwmod_irq_info omap2_uart1_mpu_irqs[] = {
240 { .irq = INT_24XX_UART1_IRQ, }, 238 { .irq = 72 + OMAP_INTC_START, },
241 { .irq = -1 } 239 { .irq = -1 },
242}; 240};
243 241
244struct omap_hwmod_irq_info omap2_uart2_mpu_irqs[] = { 242struct omap_hwmod_irq_info omap2_uart2_mpu_irqs[] = {
245 { .irq = INT_24XX_UART2_IRQ, }, 243 { .irq = 73 + OMAP_INTC_START, },
246 { .irq = -1 } 244 { .irq = -1 },
247}; 245};
248 246
249struct omap_hwmod_irq_info omap2_uart3_mpu_irqs[] = { 247struct omap_hwmod_irq_info omap2_uart3_mpu_irqs[] = {
250 { .irq = INT_24XX_UART3_IRQ, }, 248 { .irq = 74 + OMAP_INTC_START, },
251 { .irq = -1 } 249 { .irq = -1 },
252}; 250};
253 251
254struct omap_hwmod_irq_info omap2_dispc_irqs[] = { 252struct omap_hwmod_irq_info omap2_dispc_irqs[] = {
255 { .irq = 25 }, 253 { .irq = 25 + OMAP_INTC_START, },
256 { .irq = -1 } 254 { .irq = -1 },
257}; 255};
258 256
259struct omap_hwmod_irq_info omap2_i2c1_mpu_irqs[] = { 257struct omap_hwmod_irq_info omap2_i2c1_mpu_irqs[] = {
260 { .irq = INT_24XX_I2C1_IRQ, }, 258 { .irq = 56 + OMAP_INTC_START, },
261 { .irq = -1 } 259 { .irq = -1 },
262}; 260};
263 261
264struct omap_hwmod_irq_info omap2_i2c2_mpu_irqs[] = { 262struct omap_hwmod_irq_info omap2_i2c2_mpu_irqs[] = {
265 { .irq = INT_24XX_I2C2_IRQ, }, 263 { .irq = 57 + OMAP_INTC_START, },
266 { .irq = -1 } 264 { .irq = -1 },
267}; 265};
268 266
269struct omap_hwmod_irq_info omap2_gpio1_irqs[] = { 267struct omap_hwmod_irq_info omap2_gpio1_irqs[] = {
270 { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */ 268 { .irq = 29 + OMAP_INTC_START, }, /* INT_24XX_GPIO_BANK1 */
271 { .irq = -1 } 269 { .irq = -1 },
272}; 270};
273 271
274struct omap_hwmod_irq_info omap2_gpio2_irqs[] = { 272struct omap_hwmod_irq_info omap2_gpio2_irqs[] = {
275 { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */ 273 { .irq = 30 + OMAP_INTC_START, }, /* INT_24XX_GPIO_BANK2 */
276 { .irq = -1 } 274 { .irq = -1 },
277}; 275};
278 276
279struct omap_hwmod_irq_info omap2_gpio3_irqs[] = { 277struct omap_hwmod_irq_info omap2_gpio3_irqs[] = {
280 { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */ 278 { .irq = 31 + OMAP_INTC_START, }, /* INT_24XX_GPIO_BANK3 */
281 { .irq = -1 } 279 { .irq = -1 },
282}; 280};
283 281
284struct omap_hwmod_irq_info omap2_gpio4_irqs[] = { 282struct omap_hwmod_irq_info omap2_gpio4_irqs[] = {
285 { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */ 283 { .irq = 32 + OMAP_INTC_START, }, /* INT_24XX_GPIO_BANK4 */
286 { .irq = -1 } 284 { .irq = -1 },
287}; 285};
288 286
289struct omap_hwmod_irq_info omap2_dma_system_irqs[] = { 287struct omap_hwmod_irq_info omap2_dma_system_irqs[] = {
290 { .name = "0", .irq = 12 }, /* INT_24XX_SDMA_IRQ0 */ 288 { .name = "0", .irq = 12 + OMAP_INTC_START, }, /* INT_24XX_SDMA_IRQ0 */
291 { .name = "1", .irq = 13 }, /* INT_24XX_SDMA_IRQ1 */ 289 { .name = "1", .irq = 13 + OMAP_INTC_START, }, /* INT_24XX_SDMA_IRQ1 */
292 { .name = "2", .irq = 14 }, /* INT_24XX_SDMA_IRQ2 */ 290 { .name = "2", .irq = 14 + OMAP_INTC_START, }, /* INT_24XX_SDMA_IRQ2 */
293 { .name = "3", .irq = 15 }, /* INT_24XX_SDMA_IRQ3 */ 291 { .name = "3", .irq = 15 + OMAP_INTC_START, }, /* INT_24XX_SDMA_IRQ3 */
294 { .irq = -1 } 292 { .irq = -1 },
295}; 293};
296 294
297struct omap_hwmod_irq_info omap2_mcspi1_mpu_irqs[] = { 295struct omap_hwmod_irq_info omap2_mcspi1_mpu_irqs[] = {
298 { .irq = 65 }, 296 { .irq = 65 + OMAP_INTC_START, },
299 { .irq = -1 } 297 { .irq = -1 },
300}; 298};
301 299
302struct omap_hwmod_irq_info omap2_mcspi2_mpu_irqs[] = { 300struct omap_hwmod_irq_info omap2_mcspi2_mpu_irqs[] = {
303 { .irq = 66 }, 301 { .irq = 66 + OMAP_INTC_START, },
304 { .irq = -1 } 302 { .irq = -1 },
305}; 303};
306 304
307struct omap_hwmod_class_sysconfig omap2_hdq1w_sysc = { 305struct omap_hwmod_class_sysconfig omap2_hdq1w_sysc = {
@@ -320,7 +318,7 @@ struct omap_hwmod_class omap2_hdq1w_class = {
320}; 318};
321 319
322struct omap_hwmod_irq_info omap2_hdq1w_mpu_irqs[] = { 320struct omap_hwmod_irq_info omap2_hdq1w_mpu_irqs[] = {
323 { .irq = 58, }, 321 { .irq = 58 + OMAP_INTC_START, },
324 { .irq = -1 } 322 { .irq = -1 },
325}; 323};
326 324
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c
index 5178e40e84f..1a1287d6264 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c
@@ -15,8 +15,8 @@
15 15
16#include <plat/omap_hwmod.h> 16#include <plat/omap_hwmod.h>
17#include <plat/serial.h> 17#include <plat/serial.h>
18#include <plat/l3_2xxx.h> 18#include "l3_2xxx.h"
19#include <plat/l4_2xxx.h> 19#include "l4_2xxx.h"
20 20
21#include "omap_hwmod_common_data.h" 21#include "omap_hwmod_common_data.h"
22 22
@@ -129,6 +129,15 @@ struct omap_hwmod_addr_space omap2xxx_mcbsp2_addrs[] = {
129 { } 129 { }
130}; 130};
131 131
132static struct omap_hwmod_addr_space omap2_rng_addr_space[] = {
133 {
134 .pa_start = 0x480a0000,
135 .pa_end = 0x480a004f,
136 .flags = ADDR_TYPE_RT
137 },
138 { }
139};
140
132/* 141/*
133 * Common interconnect data 142 * Common interconnect data
134 */ 143 */
@@ -372,3 +381,11 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_venc = {
372 .user = OCP_USER_MPU | OCP_USER_SDMA, 381 .user = OCP_USER_MPU | OCP_USER_SDMA,
373}; 382};
374 383
384/* l4_core -> rng */
385struct omap_hwmod_ocp_if omap2xxx_l4_core__rng = {
386 .master = &omap2xxx_l4_core_hwmod,
387 .slave = &omap2xxx_rng_hwmod,
388 .clk = "rng_ick",
389 .addr = omap2_rng_addr_space,
390 .user = OCP_USER_MPU | OCP_USER_SDMA,
391};
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
index afad69c6ba6..bd9220ed5ab 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
@@ -10,12 +10,10 @@
10 */ 10 */
11#include <plat/omap_hwmod.h> 11#include <plat/omap_hwmod.h>
12#include <plat/serial.h> 12#include <plat/serial.h>
13#include <plat/gpio.h> 13#include <linux/platform_data/gpio-omap.h>
14#include <plat/dma.h> 14#include <plat/dma.h>
15#include <plat/dmtimer.h> 15#include <plat/dmtimer.h>
16#include <plat/mcspi.h> 16#include <linux/platform_data/spi-omap2-mcspi.h>
17
18#include <mach/irqs.h>
19 17
20#include "omap_hwmod_common_data.h" 18#include "omap_hwmod_common_data.h"
21#include "cm-regbits-24xx.h" 19#include "cm-regbits-24xx.h"
@@ -23,8 +21,8 @@
23#include "wd_timer.h" 21#include "wd_timer.h"
24 22
25struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[] = { 23struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[] = {
26 { .irq = 48, }, 24 { .irq = 48 + OMAP_INTC_START, },
27 { .irq = -1 } 25 { .irq = -1 },
28}; 26};
29 27
30struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = { 28struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = {
@@ -175,6 +173,26 @@ struct omap_hwmod_class omap2xxx_mcspi_class = {
175}; 173};
176 174
177/* 175/*
176 * 'gpmc' class
177 * general purpose memory controller
178 */
179
180static struct omap_hwmod_class_sysconfig omap2xxx_gpmc_sysc = {
181 .rev_offs = 0x0000,
182 .sysc_offs = 0x0010,
183 .syss_offs = 0x0014,
184 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
185 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
186 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
187 .sysc_fields = &omap_hwmod_sysc_type1,
188};
189
190static struct omap_hwmod_class omap2xxx_gpmc_hwmod_class = {
191 .name = "gpmc",
192 .sysc = &omap2xxx_gpmc_sysc,
193};
194
195/*
178 * IP blocks 196 * IP blocks
179 */ 197 */
180 198
@@ -200,8 +218,14 @@ struct omap_hwmod omap2xxx_l4_wkup_hwmod = {
200}; 218};
201 219
202/* MPU */ 220/* MPU */
221static struct omap_hwmod_irq_info omap2xxx_mpu_irqs[] = {
222 { .name = "pmu", .irq = 3 + OMAP_INTC_START },
223 { .irq = -1 }
224};
225
203struct omap_hwmod omap2xxx_mpu_hwmod = { 226struct omap_hwmod omap2xxx_mpu_hwmod = {
204 .name = "mpu", 227 .name = "mpu",
228 .mpu_irqs = omap2xxx_mpu_irqs,
205 .class = &mpu_hwmod_class, 229 .class = &mpu_hwmod_class,
206 .main_clk = "mpu_ck", 230 .main_clk = "mpu_ck",
207}; 231};
@@ -222,6 +246,11 @@ static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
222 .timer_capability = OMAP_TIMER_HAS_PWM, 246 .timer_capability = OMAP_TIMER_HAS_PWM,
223}; 247};
224 248
249/* timers with DSP interrupt dev attribute */
250static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = {
251 .timer_capability = OMAP_TIMER_HAS_DSP_IRQ,
252};
253
225/* timer1 */ 254/* timer1 */
226 255
227struct omap_hwmod omap2xxx_timer1_hwmod = { 256struct omap_hwmod omap2xxx_timer1_hwmod = {
@@ -310,6 +339,7 @@ struct omap_hwmod omap2xxx_timer5_hwmod = {
310 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT, 339 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
311 }, 340 },
312 }, 341 },
342 .dev_attr = &capability_dsp_dev_attr,
313 .class = &omap2xxx_timer_hwmod_class, 343 .class = &omap2xxx_timer_hwmod_class,
314}; 344};
315 345
@@ -328,6 +358,7 @@ struct omap_hwmod omap2xxx_timer6_hwmod = {
328 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT, 358 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
329 }, 359 },
330 }, 360 },
361 .dev_attr = &capability_dsp_dev_attr,
331 .class = &omap2xxx_timer_hwmod_class, 362 .class = &omap2xxx_timer_hwmod_class,
332}; 363};
333 364
@@ -346,6 +377,7 @@ struct omap_hwmod omap2xxx_timer7_hwmod = {
346 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT, 377 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
347 }, 378 },
348 }, 379 },
380 .dev_attr = &capability_dsp_dev_attr,
349 .class = &omap2xxx_timer_hwmod_class, 381 .class = &omap2xxx_timer_hwmod_class,
350}; 382};
351 383
@@ -364,6 +396,7 @@ struct omap_hwmod omap2xxx_timer8_hwmod = {
364 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT, 396 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
365 }, 397 },
366 }, 398 },
399 .dev_attr = &capability_dsp_dev_attr,
367 .class = &omap2xxx_timer_hwmod_class, 400 .class = &omap2xxx_timer_hwmod_class,
368}; 401};
369 402
@@ -726,7 +759,6 @@ struct omap_hwmod omap2xxx_mcspi2_hwmod = {
726 .dev_attr = &omap_mcspi2_dev_attr, 759 .dev_attr = &omap_mcspi2_dev_attr,
727}; 760};
728 761
729
730static struct omap_hwmod_class omap2xxx_counter_hwmod_class = { 762static struct omap_hwmod_class omap2xxx_counter_hwmod_class = {
731 .name = "counter", 763 .name = "counter",
732}; 764};
@@ -745,3 +777,77 @@ struct omap_hwmod omap2xxx_counter_32k_hwmod = {
745 }, 777 },
746 .class = &omap2xxx_counter_hwmod_class, 778 .class = &omap2xxx_counter_hwmod_class,
747}; 779};
780
781/* gpmc */
782static struct omap_hwmod_irq_info omap2xxx_gpmc_irqs[] = {
783 { .irq = 20 },
784 { .irq = -1 }
785};
786
787struct omap_hwmod omap2xxx_gpmc_hwmod = {
788 .name = "gpmc",
789 .class = &omap2xxx_gpmc_hwmod_class,
790 .mpu_irqs = omap2xxx_gpmc_irqs,
791 .main_clk = "gpmc_fck",
792 /*
793 * XXX HWMOD_INIT_NO_RESET should not be needed for this IP
794 * block. It is not being added due to any known bugs with
795 * resetting the GPMC IP block, but rather because any timings
796 * set by the bootloader are not being correctly programmed by
797 * the kernel from the board file or DT data.
798 * HWMOD_INIT_NO_RESET should be removed ASAP.
799 */
800 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET |
801 HWMOD_NO_IDLEST),
802 .prcm = {
803 .omap2 = {
804 .prcm_reg_id = 3,
805 .module_bit = OMAP24XX_EN_GPMC_MASK,
806 .module_offs = CORE_MOD,
807 },
808 },
809};
810
811/* RNG */
812
813static struct omap_hwmod_class_sysconfig omap2_rng_sysc = {
814 .rev_offs = 0x3c,
815 .sysc_offs = 0x40,
816 .syss_offs = 0x44,
817 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
818 SYSS_HAS_RESET_STATUS),
819 .sysc_fields = &omap_hwmod_sysc_type1,
820};
821
822static struct omap_hwmod_class omap2_rng_hwmod_class = {
823 .name = "rng",
824 .sysc = &omap2_rng_sysc,
825};
826
827static struct omap_hwmod_irq_info omap2_rng_mpu_irqs[] = {
828 { .irq = 52 },
829 { .irq = -1 }
830};
831
832struct omap_hwmod omap2xxx_rng_hwmod = {
833 .name = "rng",
834 .mpu_irqs = omap2_rng_mpu_irqs,
835 .main_clk = "l4_ck",
836 .prcm = {
837 .omap2 = {
838 .module_offs = CORE_MOD,
839 .prcm_reg_id = 4,
840 .module_bit = OMAP24XX_EN_RNG_SHIFT,
841 .idlest_reg_id = 4,
842 .idlest_idle_bit = OMAP24XX_ST_RNG_SHIFT,
843 },
844 },
845 /*
846 * XXX The first read from the SYSSTATUS register of the RNG
847 * after the SYSCONFIG SOFTRESET bit is set triggers an
848 * imprecise external abort. It's unclear why this happens.
849 * Until this is analyzed, skip the IP block reset.
850 */
851 .flags = HWMOD_INIT_NO_RESET,
852 .class = &omap2_rng_hwmod_class,
853};
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
new file mode 100644
index 00000000000..59d5c1cd316
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -0,0 +1,3381 @@
1/*
2 * omap_hwmod_33xx_data.c: Hardware modules present on the AM33XX chips
3 *
4 * Copyright (C) {2012} Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This file is automatically generated from the AM33XX hardware databases.
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.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <plat/omap_hwmod.h>
18#include <plat/cpu.h>
19#include <linux/platform_data/gpio-omap.h>
20#include <linux/platform_data/spi-omap2-mcspi.h>
21#include <plat/dma.h>
22#include <plat/mmc.h>
23#include <plat/i2c.h>
24
25#include "omap_hwmod_common_data.h"
26
27#include "control.h"
28#include "cm33xx.h"
29#include "prm33xx.h"
30#include "prm-regbits-33xx.h"
31
32/*
33 * IP blocks
34 */
35
36/*
37 * 'emif_fw' class
38 * instance(s): emif_fw
39 */
40static struct omap_hwmod_class am33xx_emif_fw_hwmod_class = {
41 .name = "emif_fw",
42};
43
44/* emif_fw */
45static struct omap_hwmod am33xx_emif_fw_hwmod = {
46 .name = "emif_fw",
47 .class = &am33xx_emif_fw_hwmod_class,
48 .clkdm_name = "l4fw_clkdm",
49 .main_clk = "l4fw_gclk",
50 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
51 .prcm = {
52 .omap4 = {
53 .clkctrl_offs = AM33XX_CM_PER_EMIF_FW_CLKCTRL_OFFSET,
54 .modulemode = MODULEMODE_SWCTRL,
55 },
56 },
57};
58
59/*
60 * 'emif' class
61 * instance(s): emif
62 */
63static struct omap_hwmod_class_sysconfig am33xx_emif_sysc = {
64 .rev_offs = 0x0000,
65};
66
67static struct omap_hwmod_class am33xx_emif_hwmod_class = {
68 .name = "emif",
69 .sysc = &am33xx_emif_sysc,
70};
71
72static struct omap_hwmod_irq_info am33xx_emif_irqs[] = {
73 { .name = "ddrerr0", .irq = 101 + OMAP_INTC_START, },
74 { .irq = -1 },
75};
76
77/* emif */
78static struct omap_hwmod am33xx_emif_hwmod = {
79 .name = "emif",
80 .class = &am33xx_emif_hwmod_class,
81 .clkdm_name = "l3_clkdm",
82 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
83 .mpu_irqs = am33xx_emif_irqs,
84 .main_clk = "dpll_ddr_m2_div2_ck",
85 .prcm = {
86 .omap4 = {
87 .clkctrl_offs = AM33XX_CM_PER_EMIF_CLKCTRL_OFFSET,
88 .modulemode = MODULEMODE_SWCTRL,
89 },
90 },
91};
92
93/*
94 * 'l3' class
95 * instance(s): l3_main, l3_s, l3_instr
96 */
97static struct omap_hwmod_class am33xx_l3_hwmod_class = {
98 .name = "l3",
99};
100
101/* l3_main (l3_fast) */
102static struct omap_hwmod_irq_info am33xx_l3_main_irqs[] = {
103 { .name = "l3debug", .irq = 9 + OMAP_INTC_START, },
104 { .name = "l3appint", .irq = 10 + OMAP_INTC_START, },
105 { .irq = -1 },
106};
107
108static struct omap_hwmod am33xx_l3_main_hwmod = {
109 .name = "l3_main",
110 .class = &am33xx_l3_hwmod_class,
111 .clkdm_name = "l3_clkdm",
112 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
113 .mpu_irqs = am33xx_l3_main_irqs,
114 .main_clk = "l3_gclk",
115 .prcm = {
116 .omap4 = {
117 .clkctrl_offs = AM33XX_CM_PER_L3_CLKCTRL_OFFSET,
118 .modulemode = MODULEMODE_SWCTRL,
119 },
120 },
121};
122
123/* l3_s */
124static struct omap_hwmod am33xx_l3_s_hwmod = {
125 .name = "l3_s",
126 .class = &am33xx_l3_hwmod_class,
127 .clkdm_name = "l3s_clkdm",
128};
129
130/* l3_instr */
131static struct omap_hwmod am33xx_l3_instr_hwmod = {
132 .name = "l3_instr",
133 .class = &am33xx_l3_hwmod_class,
134 .clkdm_name = "l3_clkdm",
135 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
136 .main_clk = "l3_gclk",
137 .prcm = {
138 .omap4 = {
139 .clkctrl_offs = AM33XX_CM_PER_L3_INSTR_CLKCTRL_OFFSET,
140 .modulemode = MODULEMODE_SWCTRL,
141 },
142 },
143};
144
145/*
146 * 'l4' class
147 * instance(s): l4_ls, l4_hs, l4_wkup, l4_fw
148 */
149static struct omap_hwmod_class am33xx_l4_hwmod_class = {
150 .name = "l4",
151};
152
153/* l4_ls */
154static struct omap_hwmod am33xx_l4_ls_hwmod = {
155 .name = "l4_ls",
156 .class = &am33xx_l4_hwmod_class,
157 .clkdm_name = "l4ls_clkdm",
158 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
159 .main_clk = "l4ls_gclk",
160 .prcm = {
161 .omap4 = {
162 .clkctrl_offs = AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET,
163 .modulemode = MODULEMODE_SWCTRL,
164 },
165 },
166};
167
168/* l4_hs */
169static struct omap_hwmod am33xx_l4_hs_hwmod = {
170 .name = "l4_hs",
171 .class = &am33xx_l4_hwmod_class,
172 .clkdm_name = "l4hs_clkdm",
173 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
174 .main_clk = "l4hs_gclk",
175 .prcm = {
176 .omap4 = {
177 .clkctrl_offs = AM33XX_CM_PER_L4HS_CLKCTRL_OFFSET,
178 .modulemode = MODULEMODE_SWCTRL,
179 },
180 },
181};
182
183
184/* l4_wkup */
185static struct omap_hwmod am33xx_l4_wkup_hwmod = {
186 .name = "l4_wkup",
187 .class = &am33xx_l4_hwmod_class,
188 .clkdm_name = "l4_wkup_clkdm",
189 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
190 .prcm = {
191 .omap4 = {
192 .clkctrl_offs = AM33XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET,
193 .modulemode = MODULEMODE_SWCTRL,
194 },
195 },
196};
197
198/* l4_fw */
199static struct omap_hwmod am33xx_l4_fw_hwmod = {
200 .name = "l4_fw",
201 .class = &am33xx_l4_hwmod_class,
202 .clkdm_name = "l4fw_clkdm",
203 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
204 .prcm = {
205 .omap4 = {
206 .clkctrl_offs = AM33XX_CM_PER_L4FW_CLKCTRL_OFFSET,
207 .modulemode = MODULEMODE_SWCTRL,
208 },
209 },
210};
211
212/*
213 * 'mpu' class
214 */
215static struct omap_hwmod_class am33xx_mpu_hwmod_class = {
216 .name = "mpu",
217};
218
219/* mpu */
220static struct omap_hwmod_irq_info am33xx_mpu_irqs[] = {
221 { .name = "emuint", .irq = 0 + OMAP_INTC_START, },
222 { .name = "commtx", .irq = 1 + OMAP_INTC_START, },
223 { .name = "commrx", .irq = 2 + OMAP_INTC_START, },
224 { .name = "bench", .irq = 3 + OMAP_INTC_START, },
225 { .irq = -1 },
226};
227
228static struct omap_hwmod am33xx_mpu_hwmod = {
229 .name = "mpu",
230 .class = &am33xx_mpu_hwmod_class,
231 .clkdm_name = "mpu_clkdm",
232 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
233 .mpu_irqs = am33xx_mpu_irqs,
234 .main_clk = "dpll_mpu_m2_ck",
235 .prcm = {
236 .omap4 = {
237 .clkctrl_offs = AM33XX_CM_MPU_MPU_CLKCTRL_OFFSET,
238 .modulemode = MODULEMODE_SWCTRL,
239 },
240 },
241};
242
243/*
244 * 'wakeup m3' class
245 * Wakeup controller sub-system under wakeup domain
246 */
247static struct omap_hwmod_class am33xx_wkup_m3_hwmod_class = {
248 .name = "wkup_m3",
249};
250
251static struct omap_hwmod_rst_info am33xx_wkup_m3_resets[] = {
252 { .name = "wkup_m3", .rst_shift = 3, .st_shift = 5 },
253};
254
255static struct omap_hwmod_irq_info am33xx_wkup_m3_irqs[] = {
256 { .name = "txev", .irq = 78 + OMAP_INTC_START, },
257 { .irq = -1 },
258};
259
260/* wkup_m3 */
261static struct omap_hwmod am33xx_wkup_m3_hwmod = {
262 .name = "wkup_m3",
263 .class = &am33xx_wkup_m3_hwmod_class,
264 .clkdm_name = "l4_wkup_aon_clkdm",
265 .flags = HWMOD_INIT_NO_RESET, /* Keep hardreset asserted */
266 .mpu_irqs = am33xx_wkup_m3_irqs,
267 .main_clk = "dpll_core_m4_div2_ck",
268 .prcm = {
269 .omap4 = {
270 .clkctrl_offs = AM33XX_CM_WKUP_WKUP_M3_CLKCTRL_OFFSET,
271 .rstctrl_offs = AM33XX_RM_WKUP_RSTCTRL_OFFSET,
272 .modulemode = MODULEMODE_SWCTRL,
273 },
274 },
275 .rst_lines = am33xx_wkup_m3_resets,
276 .rst_lines_cnt = ARRAY_SIZE(am33xx_wkup_m3_resets),
277};
278
279/*
280 * 'pru-icss' class
281 * Programmable Real-Time Unit and Industrial Communication Subsystem
282 */
283static struct omap_hwmod_class am33xx_pruss_hwmod_class = {
284 .name = "pruss",
285};
286
287static struct omap_hwmod_rst_info am33xx_pruss_resets[] = {
288 { .name = "pruss", .rst_shift = 1 },
289};
290
291static struct omap_hwmod_irq_info am33xx_pruss_irqs[] = {
292 { .name = "evtout0", .irq = 20 + OMAP_INTC_START, },
293 { .name = "evtout1", .irq = 21 + OMAP_INTC_START, },
294 { .name = "evtout2", .irq = 22 + OMAP_INTC_START, },
295 { .name = "evtout3", .irq = 23 + OMAP_INTC_START, },
296 { .name = "evtout4", .irq = 24 + OMAP_INTC_START, },
297 { .name = "evtout5", .irq = 25 + OMAP_INTC_START, },
298 { .name = "evtout6", .irq = 26 + OMAP_INTC_START, },
299 { .name = "evtout7", .irq = 27 + OMAP_INTC_START, },
300 { .irq = -1 },
301};
302
303/* pru-icss */
304/* Pseudo hwmod for reset control purpose only */
305static struct omap_hwmod am33xx_pruss_hwmod = {
306 .name = "pruss",
307 .class = &am33xx_pruss_hwmod_class,
308 .clkdm_name = "pruss_ocp_clkdm",
309 .mpu_irqs = am33xx_pruss_irqs,
310 .main_clk = "pruss_ocp_gclk",
311 .prcm = {
312 .omap4 = {
313 .clkctrl_offs = AM33XX_CM_PER_PRUSS_CLKCTRL_OFFSET,
314 .rstctrl_offs = AM33XX_RM_PER_RSTCTRL_OFFSET,
315 .modulemode = MODULEMODE_SWCTRL,
316 },
317 },
318 .rst_lines = am33xx_pruss_resets,
319 .rst_lines_cnt = ARRAY_SIZE(am33xx_pruss_resets),
320};
321
322/* gfx */
323/* Pseudo hwmod for reset control purpose only */
324static struct omap_hwmod_class am33xx_gfx_hwmod_class = {
325 .name = "gfx",
326};
327
328static struct omap_hwmod_rst_info am33xx_gfx_resets[] = {
329 { .name = "gfx", .rst_shift = 0 },
330};
331
332static struct omap_hwmod_irq_info am33xx_gfx_irqs[] = {
333 { .name = "gfxint", .irq = 37 + OMAP_INTC_START, },
334 { .irq = -1 },
335};
336
337static struct omap_hwmod am33xx_gfx_hwmod = {
338 .name = "gfx",
339 .class = &am33xx_gfx_hwmod_class,
340 .clkdm_name = "gfx_l3_clkdm",
341 .mpu_irqs = am33xx_gfx_irqs,
342 .main_clk = "gfx_fck_div_ck",
343 .prcm = {
344 .omap4 = {
345 .clkctrl_offs = AM33XX_CM_GFX_GFX_CLKCTRL_OFFSET,
346 .rstctrl_offs = AM33XX_RM_GFX_RSTCTRL_OFFSET,
347 .modulemode = MODULEMODE_SWCTRL,
348 },
349 },
350 .rst_lines = am33xx_gfx_resets,
351 .rst_lines_cnt = ARRAY_SIZE(am33xx_gfx_resets),
352};
353
354/*
355 * 'prcm' class
356 * power and reset manager (whole prcm infrastructure)
357 */
358static struct omap_hwmod_class am33xx_prcm_hwmod_class = {
359 .name = "prcm",
360};
361
362/* prcm */
363static struct omap_hwmod am33xx_prcm_hwmod = {
364 .name = "prcm",
365 .class = &am33xx_prcm_hwmod_class,
366 .clkdm_name = "l4_wkup_clkdm",
367};
368
369/*
370 * 'adc/tsc' class
371 * TouchScreen Controller (Anolog-To-Digital Converter)
372 */
373static struct omap_hwmod_class_sysconfig am33xx_adc_tsc_sysc = {
374 .rev_offs = 0x00,
375 .sysc_offs = 0x10,
376 .sysc_flags = SYSC_HAS_SIDLEMODE,
377 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
378 SIDLE_SMART_WKUP),
379 .sysc_fields = &omap_hwmod_sysc_type2,
380};
381
382static struct omap_hwmod_class am33xx_adc_tsc_hwmod_class = {
383 .name = "adc_tsc",
384 .sysc = &am33xx_adc_tsc_sysc,
385};
386
387static struct omap_hwmod_irq_info am33xx_adc_tsc_irqs[] = {
388 { .irq = 16 + OMAP_INTC_START, },
389 { .irq = -1 },
390};
391
392static struct omap_hwmod am33xx_adc_tsc_hwmod = {
393 .name = "adc_tsc",
394 .class = &am33xx_adc_tsc_hwmod_class,
395 .clkdm_name = "l4_wkup_clkdm",
396 .mpu_irqs = am33xx_adc_tsc_irqs,
397 .main_clk = "adc_tsc_fck",
398 .prcm = {
399 .omap4 = {
400 .clkctrl_offs = AM33XX_CM_WKUP_ADC_TSC_CLKCTRL_OFFSET,
401 .modulemode = MODULEMODE_SWCTRL,
402 },
403 },
404};
405
406/*
407 * Modules omap_hwmod structures
408 *
409 * The following IPs are excluded for the moment because:
410 * - They do not need an explicit SW control using omap_hwmod API.
411 * - They still need to be validated with the driver
412 * properly adapted to omap_hwmod / omap_device
413 *
414 * - cEFUSE (doesn't fall under any ocp_if)
415 * - clkdiv32k
416 * - debugss
417 * - ocmc ram
418 * - ocp watch point
419 * - aes0
420 * - sha0
421 */
422#if 0
423/*
424 * 'cefuse' class
425 */
426static struct omap_hwmod_class am33xx_cefuse_hwmod_class = {
427 .name = "cefuse",
428};
429
430static struct omap_hwmod am33xx_cefuse_hwmod = {
431 .name = "cefuse",
432 .class = &am33xx_cefuse_hwmod_class,
433 .clkdm_name = "l4_cefuse_clkdm",
434 .main_clk = "cefuse_fck",
435 .prcm = {
436 .omap4 = {
437 .clkctrl_offs = AM33XX_CM_CEFUSE_CEFUSE_CLKCTRL_OFFSET,
438 .modulemode = MODULEMODE_SWCTRL,
439 },
440 },
441};
442
443/*
444 * 'clkdiv32k' class
445 */
446static struct omap_hwmod_class am33xx_clkdiv32k_hwmod_class = {
447 .name = "clkdiv32k",
448};
449
450static struct omap_hwmod am33xx_clkdiv32k_hwmod = {
451 .name = "clkdiv32k",
452 .class = &am33xx_clkdiv32k_hwmod_class,
453 .clkdm_name = "clk_24mhz_clkdm",
454 .main_clk = "clkdiv32k_ick",
455 .prcm = {
456 .omap4 = {
457 .clkctrl_offs = AM33XX_CM_PER_CLKDIV32K_CLKCTRL_OFFSET,
458 .modulemode = MODULEMODE_SWCTRL,
459 },
460 },
461};
462
463/*
464 * 'debugss' class
465 * debug sub system
466 */
467static struct omap_hwmod_class am33xx_debugss_hwmod_class = {
468 .name = "debugss",
469};
470
471static struct omap_hwmod am33xx_debugss_hwmod = {
472 .name = "debugss",
473 .class = &am33xx_debugss_hwmod_class,
474 .clkdm_name = "l3_aon_clkdm",
475 .main_clk = "debugss_ick",
476 .prcm = {
477 .omap4 = {
478 .clkctrl_offs = AM33XX_CM_WKUP_DEBUGSS_CLKCTRL_OFFSET,
479 .modulemode = MODULEMODE_SWCTRL,
480 },
481 },
482};
483
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 */
504static struct omap_hwmod_class am33xx_ocpwp_hwmod_class = {
505 .name = "ocpwp",
506};
507
508static struct omap_hwmod am33xx_ocpwp_hwmod = {
509 .name = "ocpwp",
510 .class = &am33xx_ocpwp_hwmod_class,
511 .clkdm_name = "l4ls_clkdm",
512 .main_clk = "l4ls_gclk",
513 .prcm = {
514 .omap4 = {
515 .clkctrl_offs = AM33XX_CM_PER_OCPWP_CLKCTRL_OFFSET,
516 .modulemode = MODULEMODE_SWCTRL,
517 },
518 },
519};
520
521/*
522 * 'aes' class
523 */
524static struct omap_hwmod_class am33xx_aes_hwmod_class = {
525 .name = "aes",
526};
527
528static struct omap_hwmod_irq_info am33xx_aes0_irqs[] = {
529 { .irq = 102 + OMAP_INTC_START, },
530 { .irq = -1 },
531};
532
533static struct omap_hwmod am33xx_aes0_hwmod = {
534 .name = "aes0",
535 .class = &am33xx_aes_hwmod_class,
536 .clkdm_name = "l3_clkdm",
537 .mpu_irqs = am33xx_aes0_irqs,
538 .main_clk = "l3_gclk",
539 .prcm = {
540 .omap4 = {
541 .clkctrl_offs = AM33XX_CM_PER_AES0_CLKCTRL_OFFSET,
542 .modulemode = MODULEMODE_SWCTRL,
543 },
544 },
545};
546
547/* sha0 */
548static struct omap_hwmod_class am33xx_sha0_hwmod_class = {
549 .name = "sha0",
550};
551
552static struct omap_hwmod_irq_info am33xx_sha0_irqs[] = {
553 { .irq = 108 + OMAP_INTC_START, },
554 { .irq = -1 },
555};
556
557static struct omap_hwmod am33xx_sha0_hwmod = {
558 .name = "sha0",
559 .class = &am33xx_sha0_hwmod_class,
560 .clkdm_name = "l3_clkdm",
561 .mpu_irqs = am33xx_sha0_irqs,
562 .main_clk = "l3_gclk",
563 .prcm = {
564 .omap4 = {
565 .clkctrl_offs = AM33XX_CM_PER_SHA0_CLKCTRL_OFFSET,
566 .modulemode = MODULEMODE_SWCTRL,
567 },
568 },
569};
570
571#endif
572
573/* 'smartreflex' class */
574static struct omap_hwmod_class am33xx_smartreflex_hwmod_class = {
575 .name = "smartreflex",
576};
577
578/* smartreflex0 */
579static struct omap_hwmod_irq_info am33xx_smartreflex0_irqs[] = {
580 { .irq = 120 + OMAP_INTC_START, },
581 { .irq = -1 },
582};
583
584static struct omap_hwmod am33xx_smartreflex0_hwmod = {
585 .name = "smartreflex0",
586 .class = &am33xx_smartreflex_hwmod_class,
587 .clkdm_name = "l4_wkup_clkdm",
588 .mpu_irqs = am33xx_smartreflex0_irqs,
589 .main_clk = "smartreflex0_fck",
590 .prcm = {
591 .omap4 = {
592 .clkctrl_offs = AM33XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET,
593 .modulemode = MODULEMODE_SWCTRL,
594 },
595 },
596};
597
598/* smartreflex1 */
599static struct omap_hwmod_irq_info am33xx_smartreflex1_irqs[] = {
600 { .irq = 121 + OMAP_INTC_START, },
601 { .irq = -1 },
602};
603
604static struct omap_hwmod am33xx_smartreflex1_hwmod = {
605 .name = "smartreflex1",
606 .class = &am33xx_smartreflex_hwmod_class,
607 .clkdm_name = "l4_wkup_clkdm",
608 .mpu_irqs = am33xx_smartreflex1_irqs,
609 .main_clk = "smartreflex1_fck",
610 .prcm = {
611 .omap4 = {
612 .clkctrl_offs = AM33XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET,
613 .modulemode = MODULEMODE_SWCTRL,
614 },
615 },
616};
617
618/*
619 * 'control' module class
620 */
621static struct omap_hwmod_class am33xx_control_hwmod_class = {
622 .name = "control",
623};
624
625static struct omap_hwmod_irq_info am33xx_control_irqs[] = {
626 { .irq = 8 + OMAP_INTC_START, },
627 { .irq = -1 },
628};
629
630static struct omap_hwmod am33xx_control_hwmod = {
631 .name = "control",
632 .class = &am33xx_control_hwmod_class,
633 .clkdm_name = "l4_wkup_clkdm",
634 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
635 .mpu_irqs = am33xx_control_irqs,
636 .main_clk = "dpll_core_m4_div2_ck",
637 .prcm = {
638 .omap4 = {
639 .clkctrl_offs = AM33XX_CM_WKUP_CONTROL_CLKCTRL_OFFSET,
640 .modulemode = MODULEMODE_SWCTRL,
641 },
642 },
643};
644
645/*
646 * 'cpgmac' class
647 * cpsw/cpgmac sub system
648 */
649static struct omap_hwmod_class_sysconfig am33xx_cpgmac_sysc = {
650 .rev_offs = 0x0,
651 .sysc_offs = 0x8,
652 .syss_offs = 0x4,
653 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
654 SYSS_HAS_RESET_STATUS),
655 .idlemodes = (SIDLE_FORCE | SIDLE_NO | MSTANDBY_FORCE |
656 MSTANDBY_NO),
657 .sysc_fields = &omap_hwmod_sysc_type3,
658};
659
660static struct omap_hwmod_class am33xx_cpgmac0_hwmod_class = {
661 .name = "cpgmac0",
662 .sysc = &am33xx_cpgmac_sysc,
663};
664
665static struct omap_hwmod_irq_info am33xx_cpgmac0_irqs[] = {
666 { .name = "c0_rx_thresh_pend", .irq = 40 + OMAP_INTC_START, },
667 { .name = "c0_rx_pend", .irq = 41 + OMAP_INTC_START, },
668 { .name = "c0_tx_pend", .irq = 42 + OMAP_INTC_START, },
669 { .name = "c0_misc_pend", .irq = 43 + OMAP_INTC_START, },
670 { .irq = -1 },
671};
672
673static struct omap_hwmod am33xx_cpgmac0_hwmod = {
674 .name = "cpgmac0",
675 .class = &am33xx_cpgmac0_hwmod_class,
676 .clkdm_name = "cpsw_125mhz_clkdm",
677 .mpu_irqs = am33xx_cpgmac0_irqs,
678 .main_clk = "cpsw_125mhz_gclk",
679 .prcm = {
680 .omap4 = {
681 .clkctrl_offs = AM33XX_CM_PER_CPGMAC0_CLKCTRL_OFFSET,
682 .modulemode = MODULEMODE_SWCTRL,
683 },
684 },
685};
686
687/*
688 * dcan class
689 */
690static struct omap_hwmod_class am33xx_dcan_hwmod_class = {
691 .name = "d_can",
692};
693
694/* dcan0 */
695static struct omap_hwmod_irq_info am33xx_dcan0_irqs[] = {
696 { .name = "d_can_ms", .irq = 52 + OMAP_INTC_START, },
697 { .name = "d_can_mo", .irq = 53 + OMAP_INTC_START, },
698 { .irq = -1 },
699};
700
701static struct omap_hwmod am33xx_dcan0_hwmod = {
702 .name = "d_can0",
703 .class = &am33xx_dcan_hwmod_class,
704 .clkdm_name = "l4ls_clkdm",
705 .mpu_irqs = am33xx_dcan0_irqs,
706 .main_clk = "dcan0_fck",
707 .prcm = {
708 .omap4 = {
709 .clkctrl_offs = AM33XX_CM_PER_DCAN0_CLKCTRL_OFFSET,
710 .modulemode = MODULEMODE_SWCTRL,
711 },
712 },
713};
714
715/* dcan1 */
716static struct omap_hwmod_irq_info am33xx_dcan1_irqs[] = {
717 { .name = "d_can_ms", .irq = 55 + OMAP_INTC_START, },
718 { .name = "d_can_mo", .irq = 56 + OMAP_INTC_START, },
719 { .irq = -1 },
720};
721static struct omap_hwmod am33xx_dcan1_hwmod = {
722 .name = "d_can1",
723 .class = &am33xx_dcan_hwmod_class,
724 .clkdm_name = "l4ls_clkdm",
725 .mpu_irqs = am33xx_dcan1_irqs,
726 .main_clk = "dcan1_fck",
727 .prcm = {
728 .omap4 = {
729 .clkctrl_offs = AM33XX_CM_PER_DCAN1_CLKCTRL_OFFSET,
730 .modulemode = MODULEMODE_SWCTRL,
731 },
732 },
733};
734
735/* elm */
736static struct omap_hwmod_class_sysconfig am33xx_elm_sysc = {
737 .rev_offs = 0x0000,
738 .sysc_offs = 0x0010,
739 .syss_offs = 0x0014,
740 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
741 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
742 SYSS_HAS_RESET_STATUS),
743 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
744 .sysc_fields = &omap_hwmod_sysc_type1,
745};
746
747static struct omap_hwmod_class am33xx_elm_hwmod_class = {
748 .name = "elm",
749 .sysc = &am33xx_elm_sysc,
750};
751
752static struct omap_hwmod_irq_info am33xx_elm_irqs[] = {
753 { .irq = 4 + OMAP_INTC_START, },
754 { .irq = -1 },
755};
756
757static struct omap_hwmod am33xx_elm_hwmod = {
758 .name = "elm",
759 .class = &am33xx_elm_hwmod_class,
760 .clkdm_name = "l4ls_clkdm",
761 .mpu_irqs = am33xx_elm_irqs,
762 .main_clk = "l4ls_gclk",
763 .prcm = {
764 .omap4 = {
765 .clkctrl_offs = AM33XX_CM_PER_ELM_CLKCTRL_OFFSET,
766 .modulemode = MODULEMODE_SWCTRL,
767 },
768 },
769};
770
771/*
772 * 'epwmss' class: ecap0,1,2, ehrpwm0,1,2
773 */
774static struct omap_hwmod_class_sysconfig am33xx_epwmss_sysc = {
775 .rev_offs = 0x0,
776 .sysc_offs = 0x4,
777 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE),
778 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
779 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
780 MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
781 .sysc_fields = &omap_hwmod_sysc_type2,
782};
783
784static struct omap_hwmod_class am33xx_epwmss_hwmod_class = {
785 .name = "epwmss",
786 .sysc = &am33xx_epwmss_sysc,
787};
788
789/* ehrpwm0 */
790static struct omap_hwmod_irq_info am33xx_ehrpwm0_irqs[] = {
791 { .name = "int", .irq = 86 + OMAP_INTC_START, },
792 { .name = "tzint", .irq = 58 + OMAP_INTC_START, },
793 { .irq = -1 },
794};
795
796static struct omap_hwmod am33xx_ehrpwm0_hwmod = {
797 .name = "ehrpwm0",
798 .class = &am33xx_epwmss_hwmod_class,
799 .clkdm_name = "l4ls_clkdm",
800 .mpu_irqs = am33xx_ehrpwm0_irqs,
801 .main_clk = "l4ls_gclk",
802 .prcm = {
803 .omap4 = {
804 .clkctrl_offs = AM33XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET,
805 .modulemode = MODULEMODE_SWCTRL,
806 },
807 },
808};
809
810/* ehrpwm1 */
811static struct omap_hwmod_irq_info am33xx_ehrpwm1_irqs[] = {
812 { .name = "int", .irq = 87 + OMAP_INTC_START, },
813 { .name = "tzint", .irq = 59 + OMAP_INTC_START, },
814 { .irq = -1 },
815};
816
817static struct omap_hwmod am33xx_ehrpwm1_hwmod = {
818 .name = "ehrpwm1",
819 .class = &am33xx_epwmss_hwmod_class,
820 .clkdm_name = "l4ls_clkdm",
821 .mpu_irqs = am33xx_ehrpwm1_irqs,
822 .main_clk = "l4ls_gclk",
823 .prcm = {
824 .omap4 = {
825 .clkctrl_offs = AM33XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET,
826 .modulemode = MODULEMODE_SWCTRL,
827 },
828 },
829};
830
831/* ehrpwm2 */
832static struct omap_hwmod_irq_info am33xx_ehrpwm2_irqs[] = {
833 { .name = "int", .irq = 39 + OMAP_INTC_START, },
834 { .name = "tzint", .irq = 60 + OMAP_INTC_START, },
835 { .irq = -1 },
836};
837
838static struct omap_hwmod am33xx_ehrpwm2_hwmod = {
839 .name = "ehrpwm2",
840 .class = &am33xx_epwmss_hwmod_class,
841 .clkdm_name = "l4ls_clkdm",
842 .mpu_irqs = am33xx_ehrpwm2_irqs,
843 .main_clk = "l4ls_gclk",
844 .prcm = {
845 .omap4 = {
846 .clkctrl_offs = AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET,
847 .modulemode = MODULEMODE_SWCTRL,
848 },
849 },
850};
851
852/* ecap0 */
853static struct omap_hwmod_irq_info am33xx_ecap0_irqs[] = {
854 { .irq = 31 + OMAP_INTC_START, },
855 { .irq = -1 },
856};
857
858static struct omap_hwmod am33xx_ecap0_hwmod = {
859 .name = "ecap0",
860 .class = &am33xx_epwmss_hwmod_class,
861 .clkdm_name = "l4ls_clkdm",
862 .mpu_irqs = am33xx_ecap0_irqs,
863 .main_clk = "l4ls_gclk",
864 .prcm = {
865 .omap4 = {
866 .clkctrl_offs = AM33XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET,
867 .modulemode = MODULEMODE_SWCTRL,
868 },
869 },
870};
871
872/* ecap1 */
873static struct omap_hwmod_irq_info am33xx_ecap1_irqs[] = {
874 { .irq = 47 + OMAP_INTC_START, },
875 { .irq = -1 },
876};
877
878static struct omap_hwmod am33xx_ecap1_hwmod = {
879 .name = "ecap1",
880 .class = &am33xx_epwmss_hwmod_class,
881 .clkdm_name = "l4ls_clkdm",
882 .mpu_irqs = am33xx_ecap1_irqs,
883 .main_clk = "l4ls_gclk",
884 .prcm = {
885 .omap4 = {
886 .clkctrl_offs = AM33XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET,
887 .modulemode = MODULEMODE_SWCTRL,
888 },
889 },
890};
891
892/* ecap2 */
893static struct omap_hwmod_irq_info am33xx_ecap2_irqs[] = {
894 { .irq = 61 + OMAP_INTC_START, },
895 { .irq = -1 },
896};
897
898static struct omap_hwmod am33xx_ecap2_hwmod = {
899 .name = "ecap2",
900 .mpu_irqs = am33xx_ecap2_irqs,
901 .class = &am33xx_epwmss_hwmod_class,
902 .clkdm_name = "l4ls_clkdm",
903 .main_clk = "l4ls_gclk",
904 .prcm = {
905 .omap4 = {
906 .clkctrl_offs = AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET,
907 .modulemode = MODULEMODE_SWCTRL,
908 },
909 },
910};
911
912/*
913 * 'gpio' class: for gpio 0,1,2,3
914 */
915static struct omap_hwmod_class_sysconfig am33xx_gpio_sysc = {
916 .rev_offs = 0x0000,
917 .sysc_offs = 0x0010,
918 .syss_offs = 0x0114,
919 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
920 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
921 SYSS_HAS_RESET_STATUS),
922 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
923 SIDLE_SMART_WKUP),
924 .sysc_fields = &omap_hwmod_sysc_type1,
925};
926
927static struct omap_hwmod_class am33xx_gpio_hwmod_class = {
928 .name = "gpio",
929 .sysc = &am33xx_gpio_sysc,
930 .rev = 2,
931};
932
933static struct omap_gpio_dev_attr gpio_dev_attr = {
934 .bank_width = 32,
935 .dbck_flag = true,
936};
937
938/* gpio0 */
939static struct omap_hwmod_opt_clk gpio0_opt_clks[] = {
940 { .role = "dbclk", .clk = "gpio0_dbclk" },
941};
942
943static struct omap_hwmod_irq_info am33xx_gpio0_irqs[] = {
944 { .irq = 96 + OMAP_INTC_START, },
945 { .irq = -1 },
946};
947
948static struct omap_hwmod am33xx_gpio0_hwmod = {
949 .name = "gpio1",
950 .class = &am33xx_gpio_hwmod_class,
951 .clkdm_name = "l4_wkup_clkdm",
952 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
953 .mpu_irqs = am33xx_gpio0_irqs,
954 .main_clk = "dpll_core_m4_div2_ck",
955 .prcm = {
956 .omap4 = {
957 .clkctrl_offs = AM33XX_CM_WKUP_GPIO0_CLKCTRL_OFFSET,
958 .modulemode = MODULEMODE_SWCTRL,
959 },
960 },
961 .opt_clks = gpio0_opt_clks,
962 .opt_clks_cnt = ARRAY_SIZE(gpio0_opt_clks),
963 .dev_attr = &gpio_dev_attr,
964};
965
966/* gpio1 */
967static struct omap_hwmod_irq_info am33xx_gpio1_irqs[] = {
968 { .irq = 98 + OMAP_INTC_START, },
969 { .irq = -1 },
970};
971
972static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
973 { .role = "dbclk", .clk = "gpio1_dbclk" },
974};
975
976static struct omap_hwmod am33xx_gpio1_hwmod = {
977 .name = "gpio2",
978 .class = &am33xx_gpio_hwmod_class,
979 .clkdm_name = "l4ls_clkdm",
980 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
981 .mpu_irqs = am33xx_gpio1_irqs,
982 .main_clk = "l4ls_gclk",
983 .prcm = {
984 .omap4 = {
985 .clkctrl_offs = AM33XX_CM_PER_GPIO1_CLKCTRL_OFFSET,
986 .modulemode = MODULEMODE_SWCTRL,
987 },
988 },
989 .opt_clks = gpio1_opt_clks,
990 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
991 .dev_attr = &gpio_dev_attr,
992};
993
994/* gpio2 */
995static struct omap_hwmod_irq_info am33xx_gpio2_irqs[] = {
996 { .irq = 32 + OMAP_INTC_START, },
997 { .irq = -1 },
998};
999
1000static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
1001 { .role = "dbclk", .clk = "gpio2_dbclk" },
1002};
1003
1004static struct omap_hwmod am33xx_gpio2_hwmod = {
1005 .name = "gpio3",
1006 .class = &am33xx_gpio_hwmod_class,
1007 .clkdm_name = "l4ls_clkdm",
1008 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1009 .mpu_irqs = am33xx_gpio2_irqs,
1010 .main_clk = "l4ls_gclk",
1011 .prcm = {
1012 .omap4 = {
1013 .clkctrl_offs = AM33XX_CM_PER_GPIO2_CLKCTRL_OFFSET,
1014 .modulemode = MODULEMODE_SWCTRL,
1015 },
1016 },
1017 .opt_clks = gpio2_opt_clks,
1018 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
1019 .dev_attr = &gpio_dev_attr,
1020};
1021
1022/* gpio3 */
1023static struct omap_hwmod_irq_info am33xx_gpio3_irqs[] = {
1024 { .irq = 62 + OMAP_INTC_START, },
1025 { .irq = -1 },
1026};
1027
1028static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
1029 { .role = "dbclk", .clk = "gpio3_dbclk" },
1030};
1031
1032static struct omap_hwmod am33xx_gpio3_hwmod = {
1033 .name = "gpio4",
1034 .class = &am33xx_gpio_hwmod_class,
1035 .clkdm_name = "l4ls_clkdm",
1036 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1037 .mpu_irqs = am33xx_gpio3_irqs,
1038 .main_clk = "l4ls_gclk",
1039 .prcm = {
1040 .omap4 = {
1041 .clkctrl_offs = AM33XX_CM_PER_GPIO3_CLKCTRL_OFFSET,
1042 .modulemode = MODULEMODE_SWCTRL,
1043 },
1044 },
1045 .opt_clks = gpio3_opt_clks,
1046 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks),
1047 .dev_attr = &gpio_dev_attr,
1048};
1049
1050/* gpmc */
1051static struct omap_hwmod_class_sysconfig gpmc_sysc = {
1052 .rev_offs = 0x0,
1053 .sysc_offs = 0x10,
1054 .syss_offs = 0x14,
1055 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
1056 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1057 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1058 .sysc_fields = &omap_hwmod_sysc_type1,
1059};
1060
1061static struct omap_hwmod_class am33xx_gpmc_hwmod_class = {
1062 .name = "gpmc",
1063 .sysc = &gpmc_sysc,
1064};
1065
1066static struct omap_hwmod_irq_info am33xx_gpmc_irqs[] = {
1067 { .irq = 100 + OMAP_INTC_START, },
1068 { .irq = -1 },
1069};
1070
1071static struct omap_hwmod am33xx_gpmc_hwmod = {
1072 .name = "gpmc",
1073 .class = &am33xx_gpmc_hwmod_class,
1074 .clkdm_name = "l3s_clkdm",
1075 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
1076 .mpu_irqs = am33xx_gpmc_irqs,
1077 .main_clk = "l3s_gclk",
1078 .prcm = {
1079 .omap4 = {
1080 .clkctrl_offs = AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET,
1081 .modulemode = MODULEMODE_SWCTRL,
1082 },
1083 },
1084};
1085
1086/* 'i2c' class */
1087static struct omap_hwmod_class_sysconfig am33xx_i2c_sysc = {
1088 .sysc_offs = 0x0010,
1089 .syss_offs = 0x0090,
1090 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1091 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
1092 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1093 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1094 SIDLE_SMART_WKUP),
1095 .sysc_fields = &omap_hwmod_sysc_type1,
1096};
1097
1098static struct omap_hwmod_class i2c_class = {
1099 .name = "i2c",
1100 .sysc = &am33xx_i2c_sysc,
1101 .rev = OMAP_I2C_IP_VERSION_2,
1102 .reset = &omap_i2c_reset,
1103};
1104
1105static struct omap_i2c_dev_attr i2c_dev_attr = {
1106 .flags = OMAP_I2C_FLAG_BUS_SHIFT_NONE |
1107 OMAP_I2C_FLAG_RESET_REGS_POSTIDLE,
1108};
1109
1110/* i2c1 */
1111static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = {
1112 { .irq = 70 + OMAP_INTC_START, },
1113 { .irq = -1 },
1114};
1115
1116static struct omap_hwmod_dma_info i2c1_edma_reqs[] = {
1117 { .name = "tx", .dma_req = 0, },
1118 { .name = "rx", .dma_req = 0, },
1119 { .dma_req = -1 }
1120};
1121
1122static struct omap_hwmod am33xx_i2c1_hwmod = {
1123 .name = "i2c1",
1124 .class = &i2c_class,
1125 .clkdm_name = "l4_wkup_clkdm",
1126 .mpu_irqs = i2c1_mpu_irqs,
1127 .sdma_reqs = i2c1_edma_reqs,
1128 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1129 .main_clk = "dpll_per_m2_div4_wkupdm_ck",
1130 .prcm = {
1131 .omap4 = {
1132 .clkctrl_offs = AM33XX_CM_WKUP_I2C0_CLKCTRL_OFFSET,
1133 .modulemode = MODULEMODE_SWCTRL,
1134 },
1135 },
1136 .dev_attr = &i2c_dev_attr,
1137};
1138
1139/* i2c1 */
1140static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = {
1141 { .irq = 71 + OMAP_INTC_START, },
1142 { .irq = -1 },
1143};
1144
1145static struct omap_hwmod_dma_info i2c2_edma_reqs[] = {
1146 { .name = "tx", .dma_req = 0, },
1147 { .name = "rx", .dma_req = 0, },
1148 { .dma_req = -1 }
1149};
1150
1151static struct omap_hwmod am33xx_i2c2_hwmod = {
1152 .name = "i2c2",
1153 .class = &i2c_class,
1154 .clkdm_name = "l4ls_clkdm",
1155 .mpu_irqs = i2c2_mpu_irqs,
1156 .sdma_reqs = i2c2_edma_reqs,
1157 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1158 .main_clk = "dpll_per_m2_div4_ck",
1159 .prcm = {
1160 .omap4 = {
1161 .clkctrl_offs = AM33XX_CM_PER_I2C1_CLKCTRL_OFFSET,
1162 .modulemode = MODULEMODE_SWCTRL,
1163 },
1164 },
1165 .dev_attr = &i2c_dev_attr,
1166};
1167
1168/* i2c3 */
1169static struct omap_hwmod_dma_info i2c3_edma_reqs[] = {
1170 { .name = "tx", .dma_req = 0, },
1171 { .name = "rx", .dma_req = 0, },
1172 { .dma_req = -1 }
1173};
1174
1175static struct omap_hwmod_irq_info i2c3_mpu_irqs[] = {
1176 { .irq = 30 + OMAP_INTC_START, },
1177 { .irq = -1 },
1178};
1179
1180static struct omap_hwmod am33xx_i2c3_hwmod = {
1181 .name = "i2c3",
1182 .class = &i2c_class,
1183 .clkdm_name = "l4ls_clkdm",
1184 .mpu_irqs = i2c3_mpu_irqs,
1185 .sdma_reqs = i2c3_edma_reqs,
1186 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1187 .main_clk = "dpll_per_m2_div4_ck",
1188 .prcm = {
1189 .omap4 = {
1190 .clkctrl_offs = AM33XX_CM_PER_I2C2_CLKCTRL_OFFSET,
1191 .modulemode = MODULEMODE_SWCTRL,
1192 },
1193 },
1194 .dev_attr = &i2c_dev_attr,
1195};
1196
1197
1198/* lcdc */
1199static struct omap_hwmod_class_sysconfig lcdc_sysc = {
1200 .rev_offs = 0x0,
1201 .sysc_offs = 0x54,
1202 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE),
1203 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1204 .sysc_fields = &omap_hwmod_sysc_type2,
1205};
1206
1207static struct omap_hwmod_class am33xx_lcdc_hwmod_class = {
1208 .name = "lcdc",
1209 .sysc = &lcdc_sysc,
1210};
1211
1212static struct omap_hwmod_irq_info am33xx_lcdc_irqs[] = {
1213 { .irq = 36 + OMAP_INTC_START, },
1214 { .irq = -1 },
1215};
1216
1217static struct omap_hwmod am33xx_lcdc_hwmod = {
1218 .name = "lcdc",
1219 .class = &am33xx_lcdc_hwmod_class,
1220 .clkdm_name = "lcdc_clkdm",
1221 .mpu_irqs = am33xx_lcdc_irqs,
1222 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
1223 .main_clk = "lcd_gclk",
1224 .prcm = {
1225 .omap4 = {
1226 .clkctrl_offs = AM33XX_CM_PER_LCDC_CLKCTRL_OFFSET,
1227 .modulemode = MODULEMODE_SWCTRL,
1228 },
1229 },
1230};
1231
1232/*
1233 * 'mailbox' class
1234 * mailbox module allowing communication between the on-chip processors using a
1235 * queued mailbox-interrupt mechanism.
1236 */
1237static struct omap_hwmod_class_sysconfig am33xx_mailbox_sysc = {
1238 .rev_offs = 0x0000,
1239 .sysc_offs = 0x0010,
1240 .sysc_flags = (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
1241 SYSC_HAS_SOFTRESET),
1242 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1243 .sysc_fields = &omap_hwmod_sysc_type2,
1244};
1245
1246static struct omap_hwmod_class am33xx_mailbox_hwmod_class = {
1247 .name = "mailbox",
1248 .sysc = &am33xx_mailbox_sysc,
1249};
1250
1251static struct omap_hwmod_irq_info am33xx_mailbox_irqs[] = {
1252 { .irq = 77 + OMAP_INTC_START, },
1253 { .irq = -1 },
1254};
1255
1256static struct omap_hwmod am33xx_mailbox_hwmod = {
1257 .name = "mailbox",
1258 .class = &am33xx_mailbox_hwmod_class,
1259 .clkdm_name = "l4ls_clkdm",
1260 .mpu_irqs = am33xx_mailbox_irqs,
1261 .main_clk = "l4ls_gclk",
1262 .prcm = {
1263 .omap4 = {
1264 .clkctrl_offs = AM33XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET,
1265 .modulemode = MODULEMODE_SWCTRL,
1266 },
1267 },
1268};
1269
1270/*
1271 * 'mcasp' class
1272 */
1273static struct omap_hwmod_class_sysconfig am33xx_mcasp_sysc = {
1274 .rev_offs = 0x0,
1275 .sysc_offs = 0x4,
1276 .sysc_flags = SYSC_HAS_SIDLEMODE,
1277 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1278 .sysc_fields = &omap_hwmod_sysc_type3,
1279};
1280
1281static struct omap_hwmod_class am33xx_mcasp_hwmod_class = {
1282 .name = "mcasp",
1283 .sysc = &am33xx_mcasp_sysc,
1284};
1285
1286/* mcasp0 */
1287static struct omap_hwmod_irq_info am33xx_mcasp0_irqs[] = {
1288 { .name = "ax", .irq = 80 + OMAP_INTC_START, },
1289 { .name = "ar", .irq = 81 + OMAP_INTC_START, },
1290 { .irq = -1 },
1291};
1292
1293static struct omap_hwmod_dma_info am33xx_mcasp0_edma_reqs[] = {
1294 { .name = "tx", .dma_req = 8, },
1295 { .name = "rx", .dma_req = 9, },
1296 { .dma_req = -1 }
1297};
1298
1299static struct omap_hwmod am33xx_mcasp0_hwmod = {
1300 .name = "mcasp0",
1301 .class = &am33xx_mcasp_hwmod_class,
1302 .clkdm_name = "l3s_clkdm",
1303 .mpu_irqs = am33xx_mcasp0_irqs,
1304 .sdma_reqs = am33xx_mcasp0_edma_reqs,
1305 .main_clk = "mcasp0_fck",
1306 .prcm = {
1307 .omap4 = {
1308 .clkctrl_offs = AM33XX_CM_PER_MCASP0_CLKCTRL_OFFSET,
1309 .modulemode = MODULEMODE_SWCTRL,
1310 },
1311 },
1312};
1313
1314/* mcasp1 */
1315static struct omap_hwmod_irq_info am33xx_mcasp1_irqs[] = {
1316 { .name = "ax", .irq = 82 + OMAP_INTC_START, },
1317 { .name = "ar", .irq = 83 + OMAP_INTC_START, },
1318 { .irq = -1 },
1319};
1320
1321static struct omap_hwmod_dma_info am33xx_mcasp1_edma_reqs[] = {
1322 { .name = "tx", .dma_req = 10, },
1323 { .name = "rx", .dma_req = 11, },
1324 { .dma_req = -1 }
1325};
1326
1327static struct omap_hwmod am33xx_mcasp1_hwmod = {
1328 .name = "mcasp1",
1329 .class = &am33xx_mcasp_hwmod_class,
1330 .clkdm_name = "l3s_clkdm",
1331 .mpu_irqs = am33xx_mcasp1_irqs,
1332 .sdma_reqs = am33xx_mcasp1_edma_reqs,
1333 .main_clk = "mcasp1_fck",
1334 .prcm = {
1335 .omap4 = {
1336 .clkctrl_offs = AM33XX_CM_PER_MCASP1_CLKCTRL_OFFSET,
1337 .modulemode = MODULEMODE_SWCTRL,
1338 },
1339 },
1340};
1341
1342/* 'mmc' class */
1343static struct omap_hwmod_class_sysconfig am33xx_mmc_sysc = {
1344 .rev_offs = 0x1fc,
1345 .sysc_offs = 0x10,
1346 .syss_offs = 0x14,
1347 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
1348 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
1349 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
1350 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1351 .sysc_fields = &omap_hwmod_sysc_type1,
1352};
1353
1354static struct omap_hwmod_class am33xx_mmc_hwmod_class = {
1355 .name = "mmc",
1356 .sysc = &am33xx_mmc_sysc,
1357};
1358
1359/* mmc0 */
1360static struct omap_hwmod_irq_info am33xx_mmc0_irqs[] = {
1361 { .irq = 64 + OMAP_INTC_START, },
1362 { .irq = -1 },
1363};
1364
1365static struct omap_hwmod_dma_info am33xx_mmc0_edma_reqs[] = {
1366 { .name = "tx", .dma_req = 24, },
1367 { .name = "rx", .dma_req = 25, },
1368 { .dma_req = -1 }
1369};
1370
1371static struct omap_mmc_dev_attr am33xx_mmc0_dev_attr = {
1372 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
1373};
1374
1375static struct omap_hwmod am33xx_mmc0_hwmod = {
1376 .name = "mmc1",
1377 .class = &am33xx_mmc_hwmod_class,
1378 .clkdm_name = "l4ls_clkdm",
1379 .mpu_irqs = am33xx_mmc0_irqs,
1380 .sdma_reqs = am33xx_mmc0_edma_reqs,
1381 .main_clk = "mmc_clk",
1382 .prcm = {
1383 .omap4 = {
1384 .clkctrl_offs = AM33XX_CM_PER_MMC0_CLKCTRL_OFFSET,
1385 .modulemode = MODULEMODE_SWCTRL,
1386 },
1387 },
1388 .dev_attr = &am33xx_mmc0_dev_attr,
1389};
1390
1391/* mmc1 */
1392static struct omap_hwmod_irq_info am33xx_mmc1_irqs[] = {
1393 { .irq = 28 + OMAP_INTC_START, },
1394 { .irq = -1 },
1395};
1396
1397static struct omap_hwmod_dma_info am33xx_mmc1_edma_reqs[] = {
1398 { .name = "tx", .dma_req = 2, },
1399 { .name = "rx", .dma_req = 3, },
1400 { .dma_req = -1 }
1401};
1402
1403static struct omap_mmc_dev_attr am33xx_mmc1_dev_attr = {
1404 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
1405};
1406
1407static struct omap_hwmod am33xx_mmc1_hwmod = {
1408 .name = "mmc2",
1409 .class = &am33xx_mmc_hwmod_class,
1410 .clkdm_name = "l4ls_clkdm",
1411 .mpu_irqs = am33xx_mmc1_irqs,
1412 .sdma_reqs = am33xx_mmc1_edma_reqs,
1413 .main_clk = "mmc_clk",
1414 .prcm = {
1415 .omap4 = {
1416 .clkctrl_offs = AM33XX_CM_PER_MMC1_CLKCTRL_OFFSET,
1417 .modulemode = MODULEMODE_SWCTRL,
1418 },
1419 },
1420 .dev_attr = &am33xx_mmc1_dev_attr,
1421};
1422
1423/* mmc2 */
1424static struct omap_hwmod_irq_info am33xx_mmc2_irqs[] = {
1425 { .irq = 29 + OMAP_INTC_START, },
1426 { .irq = -1 },
1427};
1428
1429static struct omap_hwmod_dma_info am33xx_mmc2_edma_reqs[] = {
1430 { .name = "tx", .dma_req = 64, },
1431 { .name = "rx", .dma_req = 65, },
1432 { .dma_req = -1 }
1433};
1434
1435static struct omap_mmc_dev_attr am33xx_mmc2_dev_attr = {
1436 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
1437};
1438static struct omap_hwmod am33xx_mmc2_hwmod = {
1439 .name = "mmc3",
1440 .class = &am33xx_mmc_hwmod_class,
1441 .clkdm_name = "l3s_clkdm",
1442 .mpu_irqs = am33xx_mmc2_irqs,
1443 .sdma_reqs = am33xx_mmc2_edma_reqs,
1444 .main_clk = "mmc_clk",
1445 .prcm = {
1446 .omap4 = {
1447 .clkctrl_offs = AM33XX_CM_PER_MMC2_CLKCTRL_OFFSET,
1448 .modulemode = MODULEMODE_SWCTRL,
1449 },
1450 },
1451 .dev_attr = &am33xx_mmc2_dev_attr,
1452};
1453
1454/*
1455 * 'rtc' class
1456 * rtc subsystem
1457 */
1458static struct omap_hwmod_class_sysconfig am33xx_rtc_sysc = {
1459 .rev_offs = 0x0074,
1460 .sysc_offs = 0x0078,
1461 .sysc_flags = SYSC_HAS_SIDLEMODE,
1462 .idlemodes = (SIDLE_FORCE | SIDLE_NO |
1463 SIDLE_SMART | SIDLE_SMART_WKUP),
1464 .sysc_fields = &omap_hwmod_sysc_type3,
1465};
1466
1467static struct omap_hwmod_class am33xx_rtc_hwmod_class = {
1468 .name = "rtc",
1469 .sysc = &am33xx_rtc_sysc,
1470};
1471
1472static struct omap_hwmod_irq_info am33xx_rtc_irqs[] = {
1473 { .name = "rtcint", .irq = 75 + OMAP_INTC_START, },
1474 { .name = "rtcalarmint", .irq = 76 + OMAP_INTC_START, },
1475 { .irq = -1 },
1476};
1477
1478static struct omap_hwmod am33xx_rtc_hwmod = {
1479 .name = "rtc",
1480 .class = &am33xx_rtc_hwmod_class,
1481 .clkdm_name = "l4_rtc_clkdm",
1482 .mpu_irqs = am33xx_rtc_irqs,
1483 .main_clk = "clk_32768_ck",
1484 .prcm = {
1485 .omap4 = {
1486 .clkctrl_offs = AM33XX_CM_RTC_RTC_CLKCTRL_OFFSET,
1487 .modulemode = MODULEMODE_SWCTRL,
1488 },
1489 },
1490};
1491
1492/* 'spi' class */
1493static struct omap_hwmod_class_sysconfig am33xx_mcspi_sysc = {
1494 .rev_offs = 0x0000,
1495 .sysc_offs = 0x0110,
1496 .syss_offs = 0x0114,
1497 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
1498 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
1499 SYSS_HAS_RESET_STATUS),
1500 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1501 .sysc_fields = &omap_hwmod_sysc_type1,
1502};
1503
1504static struct omap_hwmod_class am33xx_spi_hwmod_class = {
1505 .name = "mcspi",
1506 .sysc = &am33xx_mcspi_sysc,
1507 .rev = OMAP4_MCSPI_REV,
1508};
1509
1510/* spi0 */
1511static struct omap_hwmod_irq_info am33xx_spi0_irqs[] = {
1512 { .irq = 65 + OMAP_INTC_START, },
1513 { .irq = -1 },
1514};
1515
1516static struct omap_hwmod_dma_info am33xx_mcspi0_edma_reqs[] = {
1517 { .name = "rx0", .dma_req = 17 },
1518 { .name = "tx0", .dma_req = 16 },
1519 { .name = "rx1", .dma_req = 19 },
1520 { .name = "tx1", .dma_req = 18 },
1521 { .dma_req = -1 }
1522};
1523
1524static struct omap2_mcspi_dev_attr mcspi_attrib = {
1525 .num_chipselect = 2,
1526};
1527static struct omap_hwmod am33xx_spi0_hwmod = {
1528 .name = "spi0",
1529 .class = &am33xx_spi_hwmod_class,
1530 .clkdm_name = "l4ls_clkdm",
1531 .mpu_irqs = am33xx_spi0_irqs,
1532 .sdma_reqs = am33xx_mcspi0_edma_reqs,
1533 .main_clk = "dpll_per_m2_div4_ck",
1534 .prcm = {
1535 .omap4 = {
1536 .clkctrl_offs = AM33XX_CM_PER_SPI0_CLKCTRL_OFFSET,
1537 .modulemode = MODULEMODE_SWCTRL,
1538 },
1539 },
1540 .dev_attr = &mcspi_attrib,
1541};
1542
1543/* spi1 */
1544static struct omap_hwmod_irq_info am33xx_spi1_irqs[] = {
1545 { .irq = 125 + OMAP_INTC_START, },
1546 { .irq = -1 },
1547};
1548
1549static struct omap_hwmod_dma_info am33xx_mcspi1_edma_reqs[] = {
1550 { .name = "rx0", .dma_req = 43 },
1551 { .name = "tx0", .dma_req = 42 },
1552 { .name = "rx1", .dma_req = 45 },
1553 { .name = "tx1", .dma_req = 44 },
1554 { .dma_req = -1 }
1555};
1556
1557static struct omap_hwmod am33xx_spi1_hwmod = {
1558 .name = "spi1",
1559 .class = &am33xx_spi_hwmod_class,
1560 .clkdm_name = "l4ls_clkdm",
1561 .mpu_irqs = am33xx_spi1_irqs,
1562 .sdma_reqs = am33xx_mcspi1_edma_reqs,
1563 .main_clk = "dpll_per_m2_div4_ck",
1564 .prcm = {
1565 .omap4 = {
1566 .clkctrl_offs = AM33XX_CM_PER_SPI1_CLKCTRL_OFFSET,
1567 .modulemode = MODULEMODE_SWCTRL,
1568 },
1569 },
1570 .dev_attr = &mcspi_attrib,
1571};
1572
1573/*
1574 * 'spinlock' class
1575 * spinlock provides hardware assistance for synchronizing the
1576 * processes running on multiple processors
1577 */
1578static struct omap_hwmod_class am33xx_spinlock_hwmod_class = {
1579 .name = "spinlock",
1580};
1581
1582static struct omap_hwmod am33xx_spinlock_hwmod = {
1583 .name = "spinlock",
1584 .class = &am33xx_spinlock_hwmod_class,
1585 .clkdm_name = "l4ls_clkdm",
1586 .main_clk = "l4ls_gclk",
1587 .prcm = {
1588 .omap4 = {
1589 .clkctrl_offs = AM33XX_CM_PER_SPINLOCK_CLKCTRL_OFFSET,
1590 .modulemode = MODULEMODE_SWCTRL,
1591 },
1592 },
1593};
1594
1595/* 'timer 2-7' class */
1596static struct omap_hwmod_class_sysconfig am33xx_timer_sysc = {
1597 .rev_offs = 0x0000,
1598 .sysc_offs = 0x0010,
1599 .syss_offs = 0x0014,
1600 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
1601 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1602 SIDLE_SMART_WKUP),
1603 .sysc_fields = &omap_hwmod_sysc_type2,
1604};
1605
1606static struct omap_hwmod_class am33xx_timer_hwmod_class = {
1607 .name = "timer",
1608 .sysc = &am33xx_timer_sysc,
1609};
1610
1611/* timer1 1ms */
1612static struct omap_hwmod_class_sysconfig am33xx_timer1ms_sysc = {
1613 .rev_offs = 0x0000,
1614 .sysc_offs = 0x0010,
1615 .syss_offs = 0x0014,
1616 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
1617 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
1618 SYSS_HAS_RESET_STATUS),
1619 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1620 .sysc_fields = &omap_hwmod_sysc_type1,
1621};
1622
1623static struct omap_hwmod_class am33xx_timer1ms_hwmod_class = {
1624 .name = "timer",
1625 .sysc = &am33xx_timer1ms_sysc,
1626};
1627
1628static struct omap_hwmod_irq_info am33xx_timer1_irqs[] = {
1629 { .irq = 67 + OMAP_INTC_START, },
1630 { .irq = -1 },
1631};
1632
1633static struct omap_hwmod am33xx_timer1_hwmod = {
1634 .name = "timer1",
1635 .class = &am33xx_timer1ms_hwmod_class,
1636 .clkdm_name = "l4_wkup_clkdm",
1637 .mpu_irqs = am33xx_timer1_irqs,
1638 .main_clk = "timer1_fck",
1639 .prcm = {
1640 .omap4 = {
1641 .clkctrl_offs = AM33XX_CM_WKUP_TIMER1_CLKCTRL_OFFSET,
1642 .modulemode = MODULEMODE_SWCTRL,
1643 },
1644 },
1645};
1646
1647static struct omap_hwmod_irq_info am33xx_timer2_irqs[] = {
1648 { .irq = 68 + OMAP_INTC_START, },
1649 { .irq = -1 },
1650};
1651
1652static struct omap_hwmod am33xx_timer2_hwmod = {
1653 .name = "timer2",
1654 .class = &am33xx_timer_hwmod_class,
1655 .clkdm_name = "l4ls_clkdm",
1656 .mpu_irqs = am33xx_timer2_irqs,
1657 .main_clk = "timer2_fck",
1658 .prcm = {
1659 .omap4 = {
1660 .clkctrl_offs = AM33XX_CM_PER_TIMER2_CLKCTRL_OFFSET,
1661 .modulemode = MODULEMODE_SWCTRL,
1662 },
1663 },
1664};
1665
1666static struct omap_hwmod_irq_info am33xx_timer3_irqs[] = {
1667 { .irq = 69 + OMAP_INTC_START, },
1668 { .irq = -1 },
1669};
1670
1671static struct omap_hwmod am33xx_timer3_hwmod = {
1672 .name = "timer3",
1673 .class = &am33xx_timer_hwmod_class,
1674 .clkdm_name = "l4ls_clkdm",
1675 .mpu_irqs = am33xx_timer3_irqs,
1676 .main_clk = "timer3_fck",
1677 .prcm = {
1678 .omap4 = {
1679 .clkctrl_offs = AM33XX_CM_PER_TIMER3_CLKCTRL_OFFSET,
1680 .modulemode = MODULEMODE_SWCTRL,
1681 },
1682 },
1683};
1684
1685static struct omap_hwmod_irq_info am33xx_timer4_irqs[] = {
1686 { .irq = 92 + OMAP_INTC_START, },
1687 { .irq = -1 },
1688};
1689
1690static struct omap_hwmod am33xx_timer4_hwmod = {
1691 .name = "timer4",
1692 .class = &am33xx_timer_hwmod_class,
1693 .clkdm_name = "l4ls_clkdm",
1694 .mpu_irqs = am33xx_timer4_irqs,
1695 .main_clk = "timer4_fck",
1696 .prcm = {
1697 .omap4 = {
1698 .clkctrl_offs = AM33XX_CM_PER_TIMER4_CLKCTRL_OFFSET,
1699 .modulemode = MODULEMODE_SWCTRL,
1700 },
1701 },
1702};
1703
1704static struct omap_hwmod_irq_info am33xx_timer5_irqs[] = {
1705 { .irq = 93 + OMAP_INTC_START, },
1706 { .irq = -1 },
1707};
1708
1709static struct omap_hwmod am33xx_timer5_hwmod = {
1710 .name = "timer5",
1711 .class = &am33xx_timer_hwmod_class,
1712 .clkdm_name = "l4ls_clkdm",
1713 .mpu_irqs = am33xx_timer5_irqs,
1714 .main_clk = "timer5_fck",
1715 .prcm = {
1716 .omap4 = {
1717 .clkctrl_offs = AM33XX_CM_PER_TIMER5_CLKCTRL_OFFSET,
1718 .modulemode = MODULEMODE_SWCTRL,
1719 },
1720 },
1721};
1722
1723static struct omap_hwmod_irq_info am33xx_timer6_irqs[] = {
1724 { .irq = 94 + OMAP_INTC_START, },
1725 { .irq = -1 },
1726};
1727
1728static struct omap_hwmod am33xx_timer6_hwmod = {
1729 .name = "timer6",
1730 .class = &am33xx_timer_hwmod_class,
1731 .clkdm_name = "l4ls_clkdm",
1732 .mpu_irqs = am33xx_timer6_irqs,
1733 .main_clk = "timer6_fck",
1734 .prcm = {
1735 .omap4 = {
1736 .clkctrl_offs = AM33XX_CM_PER_TIMER6_CLKCTRL_OFFSET,
1737 .modulemode = MODULEMODE_SWCTRL,
1738 },
1739 },
1740};
1741
1742static struct omap_hwmod_irq_info am33xx_timer7_irqs[] = {
1743 { .irq = 95 + OMAP_INTC_START, },
1744 { .irq = -1 },
1745};
1746
1747static struct omap_hwmod am33xx_timer7_hwmod = {
1748 .name = "timer7",
1749 .class = &am33xx_timer_hwmod_class,
1750 .clkdm_name = "l4ls_clkdm",
1751 .mpu_irqs = am33xx_timer7_irqs,
1752 .main_clk = "timer7_fck",
1753 .prcm = {
1754 .omap4 = {
1755 .clkctrl_offs = AM33XX_CM_PER_TIMER7_CLKCTRL_OFFSET,
1756 .modulemode = MODULEMODE_SWCTRL,
1757 },
1758 },
1759};
1760
1761/* tpcc */
1762static struct omap_hwmod_class am33xx_tpcc_hwmod_class = {
1763 .name = "tpcc",
1764};
1765
1766static struct omap_hwmod_irq_info am33xx_tpcc_irqs[] = {
1767 { .name = "edma0", .irq = 12 + OMAP_INTC_START, },
1768 { .name = "edma0_mperr", .irq = 13 + OMAP_INTC_START, },
1769 { .name = "edma0_err", .irq = 14 + OMAP_INTC_START, },
1770 { .irq = -1 },
1771};
1772
1773static struct omap_hwmod am33xx_tpcc_hwmod = {
1774 .name = "tpcc",
1775 .class = &am33xx_tpcc_hwmod_class,
1776 .clkdm_name = "l3_clkdm",
1777 .mpu_irqs = am33xx_tpcc_irqs,
1778 .main_clk = "l3_gclk",
1779 .prcm = {
1780 .omap4 = {
1781 .clkctrl_offs = AM33XX_CM_PER_TPCC_CLKCTRL_OFFSET,
1782 .modulemode = MODULEMODE_SWCTRL,
1783 },
1784 },
1785};
1786
1787static struct omap_hwmod_class_sysconfig am33xx_tptc_sysc = {
1788 .rev_offs = 0x0,
1789 .sysc_offs = 0x10,
1790 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1791 SYSC_HAS_MIDLEMODE),
1792 .idlemodes = (SIDLE_FORCE | SIDLE_SMART | MSTANDBY_FORCE),
1793 .sysc_fields = &omap_hwmod_sysc_type2,
1794};
1795
1796/* 'tptc' class */
1797static struct omap_hwmod_class am33xx_tptc_hwmod_class = {
1798 .name = "tptc",
1799 .sysc = &am33xx_tptc_sysc,
1800};
1801
1802/* tptc0 */
1803static struct omap_hwmod_irq_info am33xx_tptc0_irqs[] = {
1804 { .irq = 112 + OMAP_INTC_START, },
1805 { .irq = -1 },
1806};
1807
1808static struct omap_hwmod am33xx_tptc0_hwmod = {
1809 .name = "tptc0",
1810 .class = &am33xx_tptc_hwmod_class,
1811 .clkdm_name = "l3_clkdm",
1812 .mpu_irqs = am33xx_tptc0_irqs,
1813 .main_clk = "l3_gclk",
1814 .prcm = {
1815 .omap4 = {
1816 .clkctrl_offs = AM33XX_CM_PER_TPTC0_CLKCTRL_OFFSET,
1817 .modulemode = MODULEMODE_SWCTRL,
1818 },
1819 },
1820};
1821
1822/* tptc1 */
1823static struct omap_hwmod_irq_info am33xx_tptc1_irqs[] = {
1824 { .irq = 113 + OMAP_INTC_START, },
1825 { .irq = -1 },
1826};
1827
1828static struct omap_hwmod am33xx_tptc1_hwmod = {
1829 .name = "tptc1",
1830 .class = &am33xx_tptc_hwmod_class,
1831 .clkdm_name = "l3_clkdm",
1832 .mpu_irqs = am33xx_tptc1_irqs,
1833 .flags = (HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY),
1834 .main_clk = "l3_gclk",
1835 .prcm = {
1836 .omap4 = {
1837 .clkctrl_offs = AM33XX_CM_PER_TPTC1_CLKCTRL_OFFSET,
1838 .modulemode = MODULEMODE_SWCTRL,
1839 },
1840 },
1841};
1842
1843/* tptc2 */
1844static struct omap_hwmod_irq_info am33xx_tptc2_irqs[] = {
1845 { .irq = 114 + OMAP_INTC_START, },
1846 { .irq = -1 },
1847};
1848
1849static struct omap_hwmod am33xx_tptc2_hwmod = {
1850 .name = "tptc2",
1851 .class = &am33xx_tptc_hwmod_class,
1852 .clkdm_name = "l3_clkdm",
1853 .mpu_irqs = am33xx_tptc2_irqs,
1854 .flags = (HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY),
1855 .main_clk = "l3_gclk",
1856 .prcm = {
1857 .omap4 = {
1858 .clkctrl_offs = AM33XX_CM_PER_TPTC2_CLKCTRL_OFFSET,
1859 .modulemode = MODULEMODE_SWCTRL,
1860 },
1861 },
1862};
1863
1864/* 'uart' class */
1865static struct omap_hwmod_class_sysconfig uart_sysc = {
1866 .rev_offs = 0x50,
1867 .sysc_offs = 0x54,
1868 .syss_offs = 0x58,
1869 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP |
1870 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1871 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1872 SIDLE_SMART_WKUP),
1873 .sysc_fields = &omap_hwmod_sysc_type1,
1874};
1875
1876static struct omap_hwmod_class uart_class = {
1877 .name = "uart",
1878 .sysc = &uart_sysc,
1879};
1880
1881/* uart1 */
1882static struct omap_hwmod_dma_info uart1_edma_reqs[] = {
1883 { .name = "tx", .dma_req = 26, },
1884 { .name = "rx", .dma_req = 27, },
1885 { .dma_req = -1 }
1886};
1887
1888static struct omap_hwmod_irq_info am33xx_uart1_irqs[] = {
1889 { .irq = 72 + OMAP_INTC_START, },
1890 { .irq = -1 },
1891};
1892
1893static struct omap_hwmod am33xx_uart1_hwmod = {
1894 .name = "uart1",
1895 .class = &uart_class,
1896 .clkdm_name = "l4_wkup_clkdm",
1897 .mpu_irqs = am33xx_uart1_irqs,
1898 .sdma_reqs = uart1_edma_reqs,
1899 .main_clk = "dpll_per_m2_div4_wkupdm_ck",
1900 .prcm = {
1901 .omap4 = {
1902 .clkctrl_offs = AM33XX_CM_WKUP_UART0_CLKCTRL_OFFSET,
1903 .modulemode = MODULEMODE_SWCTRL,
1904 },
1905 },
1906};
1907
1908static struct omap_hwmod_irq_info am33xx_uart2_irqs[] = {
1909 { .irq = 73 + OMAP_INTC_START, },
1910 { .irq = -1 },
1911};
1912
1913static struct omap_hwmod am33xx_uart2_hwmod = {
1914 .name = "uart2",
1915 .class = &uart_class,
1916 .clkdm_name = "l4ls_clkdm",
1917 .mpu_irqs = am33xx_uart2_irqs,
1918 .sdma_reqs = uart1_edma_reqs,
1919 .main_clk = "dpll_per_m2_div4_ck",
1920 .prcm = {
1921 .omap4 = {
1922 .clkctrl_offs = AM33XX_CM_PER_UART1_CLKCTRL_OFFSET,
1923 .modulemode = MODULEMODE_SWCTRL,
1924 },
1925 },
1926};
1927
1928/* uart3 */
1929static struct omap_hwmod_dma_info uart3_edma_reqs[] = {
1930 { .name = "tx", .dma_req = 30, },
1931 { .name = "rx", .dma_req = 31, },
1932 { .dma_req = -1 }
1933};
1934
1935static struct omap_hwmod_irq_info am33xx_uart3_irqs[] = {
1936 { .irq = 74 + OMAP_INTC_START, },
1937 { .irq = -1 },
1938};
1939
1940static struct omap_hwmod am33xx_uart3_hwmod = {
1941 .name = "uart3",
1942 .class = &uart_class,
1943 .clkdm_name = "l4ls_clkdm",
1944 .mpu_irqs = am33xx_uart3_irqs,
1945 .sdma_reqs = uart3_edma_reqs,
1946 .main_clk = "dpll_per_m2_div4_ck",
1947 .prcm = {
1948 .omap4 = {
1949 .clkctrl_offs = AM33XX_CM_PER_UART2_CLKCTRL_OFFSET,
1950 .modulemode = MODULEMODE_SWCTRL,
1951 },
1952 },
1953};
1954
1955static struct omap_hwmod_irq_info am33xx_uart4_irqs[] = {
1956 { .irq = 44 + OMAP_INTC_START, },
1957 { .irq = -1 },
1958};
1959
1960static struct omap_hwmod am33xx_uart4_hwmod = {
1961 .name = "uart4",
1962 .class = &uart_class,
1963 .clkdm_name = "l4ls_clkdm",
1964 .mpu_irqs = am33xx_uart4_irqs,
1965 .sdma_reqs = uart1_edma_reqs,
1966 .main_clk = "dpll_per_m2_div4_ck",
1967 .prcm = {
1968 .omap4 = {
1969 .clkctrl_offs = AM33XX_CM_PER_UART3_CLKCTRL_OFFSET,
1970 .modulemode = MODULEMODE_SWCTRL,
1971 },
1972 },
1973};
1974
1975static struct omap_hwmod_irq_info am33xx_uart5_irqs[] = {
1976 { .irq = 45 + OMAP_INTC_START, },
1977 { .irq = -1 },
1978};
1979
1980static struct omap_hwmod am33xx_uart5_hwmod = {
1981 .name = "uart5",
1982 .class = &uart_class,
1983 .clkdm_name = "l4ls_clkdm",
1984 .mpu_irqs = am33xx_uart5_irqs,
1985 .sdma_reqs = uart1_edma_reqs,
1986 .main_clk = "dpll_per_m2_div4_ck",
1987 .prcm = {
1988 .omap4 = {
1989 .clkctrl_offs = AM33XX_CM_PER_UART4_CLKCTRL_OFFSET,
1990 .modulemode = MODULEMODE_SWCTRL,
1991 },
1992 },
1993};
1994
1995static struct omap_hwmod_irq_info am33xx_uart6_irqs[] = {
1996 { .irq = 46 + OMAP_INTC_START, },
1997 { .irq = -1 },
1998};
1999
2000static struct omap_hwmod am33xx_uart6_hwmod = {
2001 .name = "uart6",
2002 .class = &uart_class,
2003 .clkdm_name = "l4ls_clkdm",
2004 .mpu_irqs = am33xx_uart6_irqs,
2005 .sdma_reqs = uart1_edma_reqs,
2006 .main_clk = "dpll_per_m2_div4_ck",
2007 .prcm = {
2008 .omap4 = {
2009 .clkctrl_offs = AM33XX_CM_PER_UART5_CLKCTRL_OFFSET,
2010 .modulemode = MODULEMODE_SWCTRL,
2011 },
2012 },
2013};
2014
2015/* 'wd_timer' class */
2016static struct omap_hwmod_class am33xx_wd_timer_hwmod_class = {
2017 .name = "wd_timer",
2018};
2019
2020/*
2021 * XXX: device.c file uses hardcoded name for watchdog timer
2022 * driver "wd_timer2, so we are also using same name as of now...
2023 */
2024static struct omap_hwmod am33xx_wd_timer1_hwmod = {
2025 .name = "wd_timer2",
2026 .class = &am33xx_wd_timer_hwmod_class,
2027 .clkdm_name = "l4_wkup_clkdm",
2028 .main_clk = "wdt1_fck",
2029 .prcm = {
2030 .omap4 = {
2031 .clkctrl_offs = AM33XX_CM_WKUP_WDT1_CLKCTRL_OFFSET,
2032 .modulemode = MODULEMODE_SWCTRL,
2033 },
2034 },
2035};
2036
2037/*
2038 * 'usb_otg' class
2039 * high-speed on-the-go universal serial bus (usb_otg) controller
2040 */
2041static struct omap_hwmod_class_sysconfig am33xx_usbhsotg_sysc = {
2042 .rev_offs = 0x0,
2043 .sysc_offs = 0x10,
2044 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE),
2045 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
2046 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
2047 .sysc_fields = &omap_hwmod_sysc_type2,
2048};
2049
2050static struct omap_hwmod_class am33xx_usbotg_class = {
2051 .name = "usbotg",
2052 .sysc = &am33xx_usbhsotg_sysc,
2053};
2054
2055static struct omap_hwmod_irq_info am33xx_usbss_mpu_irqs[] = {
2056 { .name = "usbss-irq", .irq = 17 + OMAP_INTC_START, },
2057 { .name = "musb0-irq", .irq = 18 + OMAP_INTC_START, },
2058 { .name = "musb1-irq", .irq = 19 + OMAP_INTC_START, },
2059 { .irq = -1 + OMAP_INTC_START, },
2060};
2061
2062static struct omap_hwmod am33xx_usbss_hwmod = {
2063 .name = "usb_otg_hs",
2064 .class = &am33xx_usbotg_class,
2065 .clkdm_name = "l3s_clkdm",
2066 .mpu_irqs = am33xx_usbss_mpu_irqs,
2067 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
2068 .main_clk = "usbotg_fck",
2069 .prcm = {
2070 .omap4 = {
2071 .clkctrl_offs = AM33XX_CM_PER_USB0_CLKCTRL_OFFSET,
2072 .modulemode = MODULEMODE_SWCTRL,
2073 },
2074 },
2075};
2076
2077
2078/*
2079 * Interfaces
2080 */
2081
2082/* l4 fw -> emif fw */
2083static struct omap_hwmod_ocp_if am33xx_l4_fw__emif_fw = {
2084 .master = &am33xx_l4_fw_hwmod,
2085 .slave = &am33xx_emif_fw_hwmod,
2086 .clk = "l4fw_gclk",
2087 .user = OCP_USER_MPU,
2088};
2089
2090static struct omap_hwmod_addr_space am33xx_emif_addrs[] = {
2091 {
2092 .pa_start = 0x4c000000,
2093 .pa_end = 0x4c000fff,
2094 .flags = ADDR_TYPE_RT
2095 },
2096 { }
2097};
2098/* l3 main -> emif */
2099static struct omap_hwmod_ocp_if am33xx_l3_main__emif = {
2100 .master = &am33xx_l3_main_hwmod,
2101 .slave = &am33xx_emif_hwmod,
2102 .clk = "dpll_core_m4_ck",
2103 .addr = am33xx_emif_addrs,
2104 .user = OCP_USER_MPU | OCP_USER_SDMA,
2105};
2106
2107/* mpu -> l3 main */
2108static struct omap_hwmod_ocp_if am33xx_mpu__l3_main = {
2109 .master = &am33xx_mpu_hwmod,
2110 .slave = &am33xx_l3_main_hwmod,
2111 .clk = "dpll_mpu_m2_ck",
2112 .user = OCP_USER_MPU,
2113};
2114
2115/* l3 main -> l4 hs */
2116static struct omap_hwmod_ocp_if am33xx_l3_main__l4_hs = {
2117 .master = &am33xx_l3_main_hwmod,
2118 .slave = &am33xx_l4_hs_hwmod,
2119 .clk = "l3s_gclk",
2120 .user = OCP_USER_MPU | OCP_USER_SDMA,
2121};
2122
2123/* l3 main -> l3 s */
2124static struct omap_hwmod_ocp_if am33xx_l3_main__l3_s = {
2125 .master = &am33xx_l3_main_hwmod,
2126 .slave = &am33xx_l3_s_hwmod,
2127 .clk = "l3s_gclk",
2128 .user = OCP_USER_MPU | OCP_USER_SDMA,
2129};
2130
2131/* l3 s -> l4 per/ls */
2132static struct omap_hwmod_ocp_if am33xx_l3_s__l4_ls = {
2133 .master = &am33xx_l3_s_hwmod,
2134 .slave = &am33xx_l4_ls_hwmod,
2135 .clk = "l3s_gclk",
2136 .user = OCP_USER_MPU | OCP_USER_SDMA,
2137};
2138
2139/* l3 s -> l4 wkup */
2140static struct omap_hwmod_ocp_if am33xx_l3_s__l4_wkup = {
2141 .master = &am33xx_l3_s_hwmod,
2142 .slave = &am33xx_l4_wkup_hwmod,
2143 .clk = "l3s_gclk",
2144 .user = OCP_USER_MPU | OCP_USER_SDMA,
2145};
2146
2147/* l3 s -> l4 fw */
2148static struct omap_hwmod_ocp_if am33xx_l3_s__l4_fw = {
2149 .master = &am33xx_l3_s_hwmod,
2150 .slave = &am33xx_l4_fw_hwmod,
2151 .clk = "l3s_gclk",
2152 .user = OCP_USER_MPU | OCP_USER_SDMA,
2153};
2154
2155/* l3 main -> l3 instr */
2156static struct omap_hwmod_ocp_if am33xx_l3_main__l3_instr = {
2157 .master = &am33xx_l3_main_hwmod,
2158 .slave = &am33xx_l3_instr_hwmod,
2159 .clk = "l3s_gclk",
2160 .user = OCP_USER_MPU | OCP_USER_SDMA,
2161};
2162
2163/* mpu -> prcm */
2164static struct omap_hwmod_ocp_if am33xx_mpu__prcm = {
2165 .master = &am33xx_mpu_hwmod,
2166 .slave = &am33xx_prcm_hwmod,
2167 .clk = "dpll_mpu_m2_ck",
2168 .user = OCP_USER_MPU | OCP_USER_SDMA,
2169};
2170
2171/* l3 s -> l3 main*/
2172static struct omap_hwmod_ocp_if am33xx_l3_s__l3_main = {
2173 .master = &am33xx_l3_s_hwmod,
2174 .slave = &am33xx_l3_main_hwmod,
2175 .clk = "l3s_gclk",
2176 .user = OCP_USER_MPU | OCP_USER_SDMA,
2177};
2178
2179/* pru-icss -> l3 main */
2180static struct omap_hwmod_ocp_if am33xx_pruss__l3_main = {
2181 .master = &am33xx_pruss_hwmod,
2182 .slave = &am33xx_l3_main_hwmod,
2183 .clk = "l3_gclk",
2184 .user = OCP_USER_MPU | OCP_USER_SDMA,
2185};
2186
2187/* wkup m3 -> l4 wkup */
2188static struct omap_hwmod_ocp_if am33xx_wkup_m3__l4_wkup = {
2189 .master = &am33xx_wkup_m3_hwmod,
2190 .slave = &am33xx_l4_wkup_hwmod,
2191 .clk = "dpll_core_m4_div2_ck",
2192 .user = OCP_USER_MPU | OCP_USER_SDMA,
2193};
2194
2195/* gfx -> l3 main */
2196static struct omap_hwmod_ocp_if am33xx_gfx__l3_main = {
2197 .master = &am33xx_gfx_hwmod,
2198 .slave = &am33xx_l3_main_hwmod,
2199 .clk = "dpll_core_m4_ck",
2200 .user = OCP_USER_MPU | OCP_USER_SDMA,
2201};
2202
2203/* l4 wkup -> wkup m3 */
2204static struct omap_hwmod_addr_space am33xx_wkup_m3_addrs[] = {
2205 {
2206 .name = "umem",
2207 .pa_start = 0x44d00000,
2208 .pa_end = 0x44d00000 + SZ_16K - 1,
2209 .flags = ADDR_TYPE_RT
2210 },
2211 {
2212 .name = "dmem",
2213 .pa_start = 0x44d80000,
2214 .pa_end = 0x44d80000 + SZ_8K - 1,
2215 .flags = ADDR_TYPE_RT
2216 },
2217 { }
2218};
2219
2220static struct omap_hwmod_ocp_if am33xx_l4_wkup__wkup_m3 = {
2221 .master = &am33xx_l4_wkup_hwmod,
2222 .slave = &am33xx_wkup_m3_hwmod,
2223 .clk = "dpll_core_m4_div2_ck",
2224 .addr = am33xx_wkup_m3_addrs,
2225 .user = OCP_USER_MPU | OCP_USER_SDMA,
2226};
2227
2228/* l4 hs -> pru-icss */
2229static struct omap_hwmod_addr_space am33xx_pruss_addrs[] = {
2230 {
2231 .pa_start = 0x4a300000,
2232 .pa_end = 0x4a300000 + SZ_512K - 1,
2233 .flags = ADDR_TYPE_RT
2234 },
2235 { }
2236};
2237
2238static struct omap_hwmod_ocp_if am33xx_l4_hs__pruss = {
2239 .master = &am33xx_l4_hs_hwmod,
2240 .slave = &am33xx_pruss_hwmod,
2241 .clk = "dpll_core_m4_ck",
2242 .addr = am33xx_pruss_addrs,
2243 .user = OCP_USER_MPU | OCP_USER_SDMA,
2244};
2245
2246/* l3 main -> gfx */
2247static struct omap_hwmod_addr_space am33xx_gfx_addrs[] = {
2248 {
2249 .pa_start = 0x56000000,
2250 .pa_end = 0x56000000 + SZ_16M - 1,
2251 .flags = ADDR_TYPE_RT
2252 },
2253 { }
2254};
2255
2256static struct omap_hwmod_ocp_if am33xx_l3_main__gfx = {
2257 .master = &am33xx_l3_main_hwmod,
2258 .slave = &am33xx_gfx_hwmod,
2259 .clk = "dpll_core_m4_ck",
2260 .addr = am33xx_gfx_addrs,
2261 .user = OCP_USER_MPU | OCP_USER_SDMA,
2262};
2263
2264/* l4 wkup -> smartreflex0 */
2265static struct omap_hwmod_addr_space am33xx_smartreflex0_addrs[] = {
2266 {
2267 .pa_start = 0x44e37000,
2268 .pa_end = 0x44e37000 + SZ_4K - 1,
2269 .flags = ADDR_TYPE_RT
2270 },
2271 { }
2272};
2273
2274static struct omap_hwmod_ocp_if am33xx_l4_wkup__smartreflex0 = {
2275 .master = &am33xx_l4_wkup_hwmod,
2276 .slave = &am33xx_smartreflex0_hwmod,
2277 .clk = "dpll_core_m4_div2_ck",
2278 .addr = am33xx_smartreflex0_addrs,
2279 .user = OCP_USER_MPU,
2280};
2281
2282/* l4 wkup -> smartreflex1 */
2283static struct omap_hwmod_addr_space am33xx_smartreflex1_addrs[] = {
2284 {
2285 .pa_start = 0x44e39000,
2286 .pa_end = 0x44e39000 + SZ_4K - 1,
2287 .flags = ADDR_TYPE_RT
2288 },
2289 { }
2290};
2291
2292static struct omap_hwmod_ocp_if am33xx_l4_wkup__smartreflex1 = {
2293 .master = &am33xx_l4_wkup_hwmod,
2294 .slave = &am33xx_smartreflex1_hwmod,
2295 .clk = "dpll_core_m4_div2_ck",
2296 .addr = am33xx_smartreflex1_addrs,
2297 .user = OCP_USER_MPU,
2298};
2299
2300/* l4 wkup -> control */
2301static struct omap_hwmod_addr_space am33xx_control_addrs[] = {
2302 {
2303 .pa_start = 0x44e10000,
2304 .pa_end = 0x44e10000 + SZ_8K - 1,
2305 .flags = ADDR_TYPE_RT
2306 },
2307 { }
2308};
2309
2310static struct omap_hwmod_ocp_if am33xx_l4_wkup__control = {
2311 .master = &am33xx_l4_wkup_hwmod,
2312 .slave = &am33xx_control_hwmod,
2313 .clk = "dpll_core_m4_div2_ck",
2314 .addr = am33xx_control_addrs,
2315 .user = OCP_USER_MPU,
2316};
2317
2318/* l4 wkup -> rtc */
2319static struct omap_hwmod_addr_space am33xx_rtc_addrs[] = {
2320 {
2321 .pa_start = 0x44e3e000,
2322 .pa_end = 0x44e3e000 + SZ_4K - 1,
2323 .flags = ADDR_TYPE_RT
2324 },
2325 { }
2326};
2327
2328static struct omap_hwmod_ocp_if am33xx_l4_wkup__rtc = {
2329 .master = &am33xx_l4_wkup_hwmod,
2330 .slave = &am33xx_rtc_hwmod,
2331 .clk = "clkdiv32k_ick",
2332 .addr = am33xx_rtc_addrs,
2333 .user = OCP_USER_MPU,
2334};
2335
2336/* l4 per/ls -> DCAN0 */
2337static struct omap_hwmod_addr_space am33xx_dcan0_addrs[] = {
2338 {
2339 .pa_start = 0x481CC000,
2340 .pa_end = 0x481CC000 + SZ_4K - 1,
2341 .flags = ADDR_TYPE_RT
2342 },
2343 { }
2344};
2345
2346static struct omap_hwmod_ocp_if am33xx_l4_per__dcan0 = {
2347 .master = &am33xx_l4_ls_hwmod,
2348 .slave = &am33xx_dcan0_hwmod,
2349 .clk = "l4ls_gclk",
2350 .addr = am33xx_dcan0_addrs,
2351 .user = OCP_USER_MPU | OCP_USER_SDMA,
2352};
2353
2354/* l4 per/ls -> DCAN1 */
2355static struct omap_hwmod_addr_space am33xx_dcan1_addrs[] = {
2356 {
2357 .pa_start = 0x481D0000,
2358 .pa_end = 0x481D0000 + SZ_4K - 1,
2359 .flags = ADDR_TYPE_RT
2360 },
2361 { }
2362};
2363
2364static struct omap_hwmod_ocp_if am33xx_l4_per__dcan1 = {
2365 .master = &am33xx_l4_ls_hwmod,
2366 .slave = &am33xx_dcan1_hwmod,
2367 .clk = "l4ls_gclk",
2368 .addr = am33xx_dcan1_addrs,
2369 .user = OCP_USER_MPU | OCP_USER_SDMA,
2370};
2371
2372/* l4 per/ls -> GPIO2 */
2373static struct omap_hwmod_addr_space am33xx_gpio1_addrs[] = {
2374 {
2375 .pa_start = 0x4804C000,
2376 .pa_end = 0x4804C000 + SZ_4K - 1,
2377 .flags = ADDR_TYPE_RT,
2378 },
2379 { }
2380};
2381
2382static struct omap_hwmod_ocp_if am33xx_l4_per__gpio1 = {
2383 .master = &am33xx_l4_ls_hwmod,
2384 .slave = &am33xx_gpio1_hwmod,
2385 .clk = "l4ls_gclk",
2386 .addr = am33xx_gpio1_addrs,
2387 .user = OCP_USER_MPU | OCP_USER_SDMA,
2388};
2389
2390/* l4 per/ls -> gpio3 */
2391static struct omap_hwmod_addr_space am33xx_gpio2_addrs[] = {
2392 {
2393 .pa_start = 0x481AC000,
2394 .pa_end = 0x481AC000 + SZ_4K - 1,
2395 .flags = ADDR_TYPE_RT,
2396 },
2397 { }
2398};
2399
2400static struct omap_hwmod_ocp_if am33xx_l4_per__gpio2 = {
2401 .master = &am33xx_l4_ls_hwmod,
2402 .slave = &am33xx_gpio2_hwmod,
2403 .clk = "l4ls_gclk",
2404 .addr = am33xx_gpio2_addrs,
2405 .user = OCP_USER_MPU | OCP_USER_SDMA,
2406};
2407
2408/* l4 per/ls -> gpio4 */
2409static struct omap_hwmod_addr_space am33xx_gpio3_addrs[] = {
2410 {
2411 .pa_start = 0x481AE000,
2412 .pa_end = 0x481AE000 + SZ_4K - 1,
2413 .flags = ADDR_TYPE_RT,
2414 },
2415 { }
2416};
2417
2418static struct omap_hwmod_ocp_if am33xx_l4_per__gpio3 = {
2419 .master = &am33xx_l4_ls_hwmod,
2420 .slave = &am33xx_gpio3_hwmod,
2421 .clk = "l4ls_gclk",
2422 .addr = am33xx_gpio3_addrs,
2423 .user = OCP_USER_MPU | OCP_USER_SDMA,
2424};
2425
2426/* L4 WKUP -> I2C1 */
2427static struct omap_hwmod_addr_space am33xx_i2c1_addr_space[] = {
2428 {
2429 .pa_start = 0x44E0B000,
2430 .pa_end = 0x44E0B000 + SZ_4K - 1,
2431 .flags = ADDR_TYPE_RT,
2432 },
2433 { }
2434};
2435
2436static struct omap_hwmod_ocp_if am33xx_l4_wkup__i2c1 = {
2437 .master = &am33xx_l4_wkup_hwmod,
2438 .slave = &am33xx_i2c1_hwmod,
2439 .clk = "dpll_core_m4_div2_ck",
2440 .addr = am33xx_i2c1_addr_space,
2441 .user = OCP_USER_MPU,
2442};
2443
2444/* L4 WKUP -> GPIO1 */
2445static struct omap_hwmod_addr_space am33xx_gpio0_addrs[] = {
2446 {
2447 .pa_start = 0x44E07000,
2448 .pa_end = 0x44E07000 + SZ_4K - 1,
2449 .flags = ADDR_TYPE_RT,
2450 },
2451 { }
2452};
2453
2454static struct omap_hwmod_ocp_if am33xx_l4_wkup__gpio0 = {
2455 .master = &am33xx_l4_wkup_hwmod,
2456 .slave = &am33xx_gpio0_hwmod,
2457 .clk = "dpll_core_m4_div2_ck",
2458 .addr = am33xx_gpio0_addrs,
2459 .user = OCP_USER_MPU | OCP_USER_SDMA,
2460};
2461
2462/* L4 WKUP -> ADC_TSC */
2463static struct omap_hwmod_addr_space am33xx_adc_tsc_addrs[] = {
2464 {
2465 .pa_start = 0x44E0D000,
2466 .pa_end = 0x44E0D000 + SZ_8K - 1,
2467 .flags = ADDR_TYPE_RT
2468 },
2469 { }
2470};
2471
2472static struct omap_hwmod_ocp_if am33xx_l4_wkup__adc_tsc = {
2473 .master = &am33xx_l4_wkup_hwmod,
2474 .slave = &am33xx_adc_tsc_hwmod,
2475 .clk = "dpll_core_m4_div2_ck",
2476 .addr = am33xx_adc_tsc_addrs,
2477 .user = OCP_USER_MPU,
2478};
2479
2480static struct omap_hwmod_addr_space am33xx_cpgmac0_addr_space[] = {
2481 /* cpsw ss */
2482 {
2483 .pa_start = 0x4a100000,
2484 .pa_end = 0x4a100000 + SZ_2K - 1,
2485 .flags = ADDR_TYPE_RT,
2486 },
2487 /* cpsw wr */
2488 {
2489 .pa_start = 0x4a101200,
2490 .pa_end = 0x4a101200 + SZ_256 - 1,
2491 .flags = ADDR_TYPE_RT,
2492 },
2493 { }
2494};
2495
2496static struct omap_hwmod_ocp_if am33xx_l4_hs__cpgmac0 = {
2497 .master = &am33xx_l4_hs_hwmod,
2498 .slave = &am33xx_cpgmac0_hwmod,
2499 .clk = "cpsw_125mhz_gclk",
2500 .addr = am33xx_cpgmac0_addr_space,
2501 .user = OCP_USER_MPU,
2502};
2503
2504static struct omap_hwmod_addr_space am33xx_elm_addr_space[] = {
2505 {
2506 .pa_start = 0x48080000,
2507 .pa_end = 0x48080000 + SZ_8K - 1,
2508 .flags = ADDR_TYPE_RT
2509 },
2510 { }
2511};
2512
2513static struct omap_hwmod_ocp_if am33xx_l4_ls__elm = {
2514 .master = &am33xx_l4_ls_hwmod,
2515 .slave = &am33xx_elm_hwmod,
2516 .clk = "l4ls_gclk",
2517 .addr = am33xx_elm_addr_space,
2518 .user = OCP_USER_MPU,
2519};
2520
2521/*
2522 * Splitting the resources to handle access of PWMSS config space
2523 * and module specific part independently
2524 */
2525static struct omap_hwmod_addr_space am33xx_ehrpwm0_addr_space[] = {
2526 {
2527 .pa_start = 0x48300000,
2528 .pa_end = 0x48300000 + SZ_16 - 1,
2529 .flags = ADDR_TYPE_RT
2530 },
2531 {
2532 .pa_start = 0x48300200,
2533 .pa_end = 0x48300200 + SZ_256 - 1,
2534 .flags = ADDR_TYPE_RT
2535 },
2536 { }
2537};
2538
2539static struct omap_hwmod_ocp_if am33xx_l4_ls__ehrpwm0 = {
2540 .master = &am33xx_l4_ls_hwmod,
2541 .slave = &am33xx_ehrpwm0_hwmod,
2542 .clk = "l4ls_gclk",
2543 .addr = am33xx_ehrpwm0_addr_space,
2544 .user = OCP_USER_MPU,
2545};
2546
2547/*
2548 * Splitting the resources to handle access of PWMSS config space
2549 * and module specific part independently
2550 */
2551static struct omap_hwmod_addr_space am33xx_ehrpwm1_addr_space[] = {
2552 {
2553 .pa_start = 0x48302000,
2554 .pa_end = 0x48302000 + SZ_16 - 1,
2555 .flags = ADDR_TYPE_RT
2556 },
2557 {
2558 .pa_start = 0x48302200,
2559 .pa_end = 0x48302200 + SZ_256 - 1,
2560 .flags = ADDR_TYPE_RT
2561 },
2562 { }
2563};
2564
2565static struct omap_hwmod_ocp_if am33xx_l4_ls__ehrpwm1 = {
2566 .master = &am33xx_l4_ls_hwmod,
2567 .slave = &am33xx_ehrpwm1_hwmod,
2568 .clk = "l4ls_gclk",
2569 .addr = am33xx_ehrpwm1_addr_space,
2570 .user = OCP_USER_MPU,
2571};
2572
2573/*
2574 * Splitting the resources to handle access of PWMSS config space
2575 * and module specific part independently
2576 */
2577static struct omap_hwmod_addr_space am33xx_ehrpwm2_addr_space[] = {
2578 {
2579 .pa_start = 0x48304000,
2580 .pa_end = 0x48304000 + SZ_16 - 1,
2581 .flags = ADDR_TYPE_RT
2582 },
2583 {
2584 .pa_start = 0x48304200,
2585 .pa_end = 0x48304200 + SZ_256 - 1,
2586 .flags = ADDR_TYPE_RT
2587 },
2588 { }
2589};
2590
2591static struct omap_hwmod_ocp_if am33xx_l4_ls__ehrpwm2 = {
2592 .master = &am33xx_l4_ls_hwmod,
2593 .slave = &am33xx_ehrpwm2_hwmod,
2594 .clk = "l4ls_gclk",
2595 .addr = am33xx_ehrpwm2_addr_space,
2596 .user = OCP_USER_MPU,
2597};
2598
2599/*
2600 * Splitting the resources to handle access of PWMSS config space
2601 * and module specific part independently
2602 */
2603static struct omap_hwmod_addr_space am33xx_ecap0_addr_space[] = {
2604 {
2605 .pa_start = 0x48300000,
2606 .pa_end = 0x48300000 + SZ_16 - 1,
2607 .flags = ADDR_TYPE_RT
2608 },
2609 {
2610 .pa_start = 0x48300100,
2611 .pa_end = 0x48300100 + SZ_256 - 1,
2612 .flags = ADDR_TYPE_RT
2613 },
2614 { }
2615};
2616
2617static struct omap_hwmod_ocp_if am33xx_l4_ls__ecap0 = {
2618 .master = &am33xx_l4_ls_hwmod,
2619 .slave = &am33xx_ecap0_hwmod,
2620 .clk = "l4ls_gclk",
2621 .addr = am33xx_ecap0_addr_space,
2622 .user = OCP_USER_MPU,
2623};
2624
2625/*
2626 * Splitting the resources to handle access of PWMSS config space
2627 * and module specific part independently
2628 */
2629static struct omap_hwmod_addr_space am33xx_ecap1_addr_space[] = {
2630 {
2631 .pa_start = 0x48302000,
2632 .pa_end = 0x48302000 + SZ_16 - 1,
2633 .flags = ADDR_TYPE_RT
2634 },
2635 {
2636 .pa_start = 0x48302100,
2637 .pa_end = 0x48302100 + SZ_256 - 1,
2638 .flags = ADDR_TYPE_RT
2639 },
2640 { }
2641};
2642
2643static struct omap_hwmod_ocp_if am33xx_l4_ls__ecap1 = {
2644 .master = &am33xx_l4_ls_hwmod,
2645 .slave = &am33xx_ecap1_hwmod,
2646 .clk = "l4ls_gclk",
2647 .addr = am33xx_ecap1_addr_space,
2648 .user = OCP_USER_MPU,
2649};
2650
2651/*
2652 * Splitting the resources to handle access of PWMSS config space
2653 * and module specific part independently
2654 */
2655static struct omap_hwmod_addr_space am33xx_ecap2_addr_space[] = {
2656 {
2657 .pa_start = 0x48304000,
2658 .pa_end = 0x48304000 + SZ_16 - 1,
2659 .flags = ADDR_TYPE_RT
2660 },
2661 {
2662 .pa_start = 0x48304100,
2663 .pa_end = 0x48304100 + SZ_256 - 1,
2664 .flags = ADDR_TYPE_RT
2665 },
2666 { }
2667};
2668
2669static struct omap_hwmod_ocp_if am33xx_l4_ls__ecap2 = {
2670 .master = &am33xx_l4_ls_hwmod,
2671 .slave = &am33xx_ecap2_hwmod,
2672 .clk = "l4ls_gclk",
2673 .addr = am33xx_ecap2_addr_space,
2674 .user = OCP_USER_MPU,
2675};
2676
2677/* l3s cfg -> gpmc */
2678static struct omap_hwmod_addr_space am33xx_gpmc_addr_space[] = {
2679 {
2680 .pa_start = 0x50000000,
2681 .pa_end = 0x50000000 + SZ_8K - 1,
2682 .flags = ADDR_TYPE_RT,
2683 },
2684 { }
2685};
2686
2687static struct omap_hwmod_ocp_if am33xx_l3_s__gpmc = {
2688 .master = &am33xx_l3_s_hwmod,
2689 .slave = &am33xx_gpmc_hwmod,
2690 .clk = "l3s_gclk",
2691 .addr = am33xx_gpmc_addr_space,
2692 .user = OCP_USER_MPU,
2693};
2694
2695/* i2c2 */
2696static struct omap_hwmod_addr_space am33xx_i2c2_addr_space[] = {
2697 {
2698 .pa_start = 0x4802A000,
2699 .pa_end = 0x4802A000 + SZ_4K - 1,
2700 .flags = ADDR_TYPE_RT,
2701 },
2702 { }
2703};
2704
2705static struct omap_hwmod_ocp_if am33xx_l4_per__i2c2 = {
2706 .master = &am33xx_l4_ls_hwmod,
2707 .slave = &am33xx_i2c2_hwmod,
2708 .clk = "l4ls_gclk",
2709 .addr = am33xx_i2c2_addr_space,
2710 .user = OCP_USER_MPU,
2711};
2712
2713static struct omap_hwmod_addr_space am33xx_i2c3_addr_space[] = {
2714 {
2715 .pa_start = 0x4819C000,
2716 .pa_end = 0x4819C000 + SZ_4K - 1,
2717 .flags = ADDR_TYPE_RT
2718 },
2719 { }
2720};
2721
2722static struct omap_hwmod_ocp_if am33xx_l4_per__i2c3 = {
2723 .master = &am33xx_l4_ls_hwmod,
2724 .slave = &am33xx_i2c3_hwmod,
2725 .clk = "l4ls_gclk",
2726 .addr = am33xx_i2c3_addr_space,
2727 .user = OCP_USER_MPU,
2728};
2729
2730static struct omap_hwmod_addr_space am33xx_lcdc_addr_space[] = {
2731 {
2732 .pa_start = 0x4830E000,
2733 .pa_end = 0x4830E000 + SZ_8K - 1,
2734 .flags = ADDR_TYPE_RT,
2735 },
2736 { }
2737};
2738
2739static struct omap_hwmod_ocp_if am33xx_l3_main__lcdc = {
2740 .master = &am33xx_l3_main_hwmod,
2741 .slave = &am33xx_lcdc_hwmod,
2742 .clk = "dpll_core_m4_ck",
2743 .addr = am33xx_lcdc_addr_space,
2744 .user = OCP_USER_MPU,
2745};
2746
2747static struct omap_hwmod_addr_space am33xx_mailbox_addrs[] = {
2748 {
2749 .pa_start = 0x480C8000,
2750 .pa_end = 0x480C8000 + (SZ_4K - 1),
2751 .flags = ADDR_TYPE_RT
2752 },
2753 { }
2754};
2755
2756/* l4 ls -> mailbox */
2757static struct omap_hwmod_ocp_if am33xx_l4_per__mailbox = {
2758 .master = &am33xx_l4_ls_hwmod,
2759 .slave = &am33xx_mailbox_hwmod,
2760 .clk = "l4ls_gclk",
2761 .addr = am33xx_mailbox_addrs,
2762 .user = OCP_USER_MPU,
2763};
2764
2765/* l4 ls -> spinlock */
2766static struct omap_hwmod_addr_space am33xx_spinlock_addrs[] = {
2767 {
2768 .pa_start = 0x480Ca000,
2769 .pa_end = 0x480Ca000 + SZ_4K - 1,
2770 .flags = ADDR_TYPE_RT
2771 },
2772 { }
2773};
2774
2775static struct omap_hwmod_ocp_if am33xx_l4_ls__spinlock = {
2776 .master = &am33xx_l4_ls_hwmod,
2777 .slave = &am33xx_spinlock_hwmod,
2778 .clk = "l4ls_gclk",
2779 .addr = am33xx_spinlock_addrs,
2780 .user = OCP_USER_MPU,
2781};
2782
2783/* l4 ls -> mcasp0 */
2784static struct omap_hwmod_addr_space am33xx_mcasp0_addr_space[] = {
2785 {
2786 .pa_start = 0x48038000,
2787 .pa_end = 0x48038000 + SZ_8K - 1,
2788 .flags = ADDR_TYPE_RT
2789 },
2790 { }
2791};
2792
2793static struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp0 = {
2794 .master = &am33xx_l4_ls_hwmod,
2795 .slave = &am33xx_mcasp0_hwmod,
2796 .clk = "l4ls_gclk",
2797 .addr = am33xx_mcasp0_addr_space,
2798 .user = OCP_USER_MPU,
2799};
2800
2801/* l3 s -> mcasp0 data */
2802static struct omap_hwmod_addr_space am33xx_mcasp0_data_addr_space[] = {
2803 {
2804 .pa_start = 0x46000000,
2805 .pa_end = 0x46000000 + SZ_4M - 1,
2806 .flags = ADDR_TYPE_RT
2807 },
2808 { }
2809};
2810
2811static struct omap_hwmod_ocp_if am33xx_l3_s__mcasp0_data = {
2812 .master = &am33xx_l3_s_hwmod,
2813 .slave = &am33xx_mcasp0_hwmod,
2814 .clk = "l3s_gclk",
2815 .addr = am33xx_mcasp0_data_addr_space,
2816 .user = OCP_USER_SDMA,
2817};
2818
2819/* l4 ls -> mcasp1 */
2820static struct omap_hwmod_addr_space am33xx_mcasp1_addr_space[] = {
2821 {
2822 .pa_start = 0x4803C000,
2823 .pa_end = 0x4803C000 + SZ_8K - 1,
2824 .flags = ADDR_TYPE_RT
2825 },
2826 { }
2827};
2828
2829static struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp1 = {
2830 .master = &am33xx_l4_ls_hwmod,
2831 .slave = &am33xx_mcasp1_hwmod,
2832 .clk = "l4ls_gclk",
2833 .addr = am33xx_mcasp1_addr_space,
2834 .user = OCP_USER_MPU,
2835};
2836
2837/* l3 s -> mcasp1 data */
2838static struct omap_hwmod_addr_space am33xx_mcasp1_data_addr_space[] = {
2839 {
2840 .pa_start = 0x46400000,
2841 .pa_end = 0x46400000 + SZ_4M - 1,
2842 .flags = ADDR_TYPE_RT
2843 },
2844 { }
2845};
2846
2847static struct omap_hwmod_ocp_if am33xx_l3_s__mcasp1_data = {
2848 .master = &am33xx_l3_s_hwmod,
2849 .slave = &am33xx_mcasp1_hwmod,
2850 .clk = "l3s_gclk",
2851 .addr = am33xx_mcasp1_data_addr_space,
2852 .user = OCP_USER_SDMA,
2853};
2854
2855/* l4 ls -> mmc0 */
2856static struct omap_hwmod_addr_space am33xx_mmc0_addr_space[] = {
2857 {
2858 .pa_start = 0x48060100,
2859 .pa_end = 0x48060100 + SZ_4K - 1,
2860 .flags = ADDR_TYPE_RT,
2861 },
2862 { }
2863};
2864
2865static struct omap_hwmod_ocp_if am33xx_l4_ls__mmc0 = {
2866 .master = &am33xx_l4_ls_hwmod,
2867 .slave = &am33xx_mmc0_hwmod,
2868 .clk = "l4ls_gclk",
2869 .addr = am33xx_mmc0_addr_space,
2870 .user = OCP_USER_MPU,
2871};
2872
2873/* l4 ls -> mmc1 */
2874static struct omap_hwmod_addr_space am33xx_mmc1_addr_space[] = {
2875 {
2876 .pa_start = 0x481d8100,
2877 .pa_end = 0x481d8100 + SZ_4K - 1,
2878 .flags = ADDR_TYPE_RT,
2879 },
2880 { }
2881};
2882
2883static struct omap_hwmod_ocp_if am33xx_l4_ls__mmc1 = {
2884 .master = &am33xx_l4_ls_hwmod,
2885 .slave = &am33xx_mmc1_hwmod,
2886 .clk = "l4ls_gclk",
2887 .addr = am33xx_mmc1_addr_space,
2888 .user = OCP_USER_MPU,
2889};
2890
2891/* l3 s -> mmc2 */
2892static struct omap_hwmod_addr_space am33xx_mmc2_addr_space[] = {
2893 {
2894 .pa_start = 0x47810100,
2895 .pa_end = 0x47810100 + SZ_64K - 1,
2896 .flags = ADDR_TYPE_RT,
2897 },
2898 { }
2899};
2900
2901static struct omap_hwmod_ocp_if am33xx_l3_s__mmc2 = {
2902 .master = &am33xx_l3_s_hwmod,
2903 .slave = &am33xx_mmc2_hwmod,
2904 .clk = "l3s_gclk",
2905 .addr = am33xx_mmc2_addr_space,
2906 .user = OCP_USER_MPU,
2907};
2908
2909/* l4 ls -> mcspi0 */
2910static struct omap_hwmod_addr_space am33xx_mcspi0_addr_space[] = {
2911 {
2912 .pa_start = 0x48030000,
2913 .pa_end = 0x48030000 + SZ_1K - 1,
2914 .flags = ADDR_TYPE_RT,
2915 },
2916 { }
2917};
2918
2919static struct omap_hwmod_ocp_if am33xx_l4_ls__mcspi0 = {
2920 .master = &am33xx_l4_ls_hwmod,
2921 .slave = &am33xx_spi0_hwmod,
2922 .clk = "l4ls_gclk",
2923 .addr = am33xx_mcspi0_addr_space,
2924 .user = OCP_USER_MPU,
2925};
2926
2927/* l4 ls -> mcspi1 */
2928static struct omap_hwmod_addr_space am33xx_mcspi1_addr_space[] = {
2929 {
2930 .pa_start = 0x481A0000,
2931 .pa_end = 0x481A0000 + SZ_1K - 1,
2932 .flags = ADDR_TYPE_RT,
2933 },
2934 { }
2935};
2936
2937static struct omap_hwmod_ocp_if am33xx_l4_ls__mcspi1 = {
2938 .master = &am33xx_l4_ls_hwmod,
2939 .slave = &am33xx_spi1_hwmod,
2940 .clk = "l4ls_gclk",
2941 .addr = am33xx_mcspi1_addr_space,
2942 .user = OCP_USER_MPU,
2943};
2944
2945/* l4 wkup -> timer1 */
2946static struct omap_hwmod_addr_space am33xx_timer1_addr_space[] = {
2947 {
2948 .pa_start = 0x44E31000,
2949 .pa_end = 0x44E31000 + SZ_1K - 1,
2950 .flags = ADDR_TYPE_RT
2951 },
2952 { }
2953};
2954
2955static struct omap_hwmod_ocp_if am33xx_l4_wkup__timer1 = {
2956 .master = &am33xx_l4_wkup_hwmod,
2957 .slave = &am33xx_timer1_hwmod,
2958 .clk = "dpll_core_m4_div2_ck",
2959 .addr = am33xx_timer1_addr_space,
2960 .user = OCP_USER_MPU,
2961};
2962
2963/* l4 per -> timer2 */
2964static struct omap_hwmod_addr_space am33xx_timer2_addr_space[] = {
2965 {
2966 .pa_start = 0x48040000,
2967 .pa_end = 0x48040000 + SZ_1K - 1,
2968 .flags = ADDR_TYPE_RT
2969 },
2970 { }
2971};
2972
2973static struct omap_hwmod_ocp_if am33xx_l4_ls__timer2 = {
2974 .master = &am33xx_l4_ls_hwmod,
2975 .slave = &am33xx_timer2_hwmod,
2976 .clk = "l4ls_gclk",
2977 .addr = am33xx_timer2_addr_space,
2978 .user = OCP_USER_MPU,
2979};
2980
2981/* l4 per -> timer3 */
2982static struct omap_hwmod_addr_space am33xx_timer3_addr_space[] = {
2983 {
2984 .pa_start = 0x48042000,
2985 .pa_end = 0x48042000 + SZ_1K - 1,
2986 .flags = ADDR_TYPE_RT
2987 },
2988 { }
2989};
2990
2991static struct omap_hwmod_ocp_if am33xx_l4_ls__timer3 = {
2992 .master = &am33xx_l4_ls_hwmod,
2993 .slave = &am33xx_timer3_hwmod,
2994 .clk = "l4ls_gclk",
2995 .addr = am33xx_timer3_addr_space,
2996 .user = OCP_USER_MPU,
2997};
2998
2999/* l4 per -> timer4 */
3000static struct omap_hwmod_addr_space am33xx_timer4_addr_space[] = {
3001 {
3002 .pa_start = 0x48044000,
3003 .pa_end = 0x48044000 + SZ_1K - 1,
3004 .flags = ADDR_TYPE_RT
3005 },
3006 { }
3007};
3008
3009static struct omap_hwmod_ocp_if am33xx_l4_ls__timer4 = {
3010 .master = &am33xx_l4_ls_hwmod,
3011 .slave = &am33xx_timer4_hwmod,
3012 .clk = "l4ls_gclk",
3013 .addr = am33xx_timer4_addr_space,
3014 .user = OCP_USER_MPU,
3015};
3016
3017/* l4 per -> timer5 */
3018static struct omap_hwmod_addr_space am33xx_timer5_addr_space[] = {
3019 {
3020 .pa_start = 0x48046000,
3021 .pa_end = 0x48046000 + SZ_1K - 1,
3022 .flags = ADDR_TYPE_RT
3023 },
3024 { }
3025};
3026
3027static struct omap_hwmod_ocp_if am33xx_l4_ls__timer5 = {
3028 .master = &am33xx_l4_ls_hwmod,
3029 .slave = &am33xx_timer5_hwmod,
3030 .clk = "l4ls_gclk",
3031 .addr = am33xx_timer5_addr_space,
3032 .user = OCP_USER_MPU,
3033};
3034
3035/* l4 per -> timer6 */
3036static struct omap_hwmod_addr_space am33xx_timer6_addr_space[] = {
3037 {
3038 .pa_start = 0x48048000,
3039 .pa_end = 0x48048000 + SZ_1K - 1,
3040 .flags = ADDR_TYPE_RT
3041 },
3042 { }
3043};
3044
3045static struct omap_hwmod_ocp_if am33xx_l4_ls__timer6 = {
3046 .master = &am33xx_l4_ls_hwmod,
3047 .slave = &am33xx_timer6_hwmod,
3048 .clk = "l4ls_gclk",
3049 .addr = am33xx_timer6_addr_space,
3050 .user = OCP_USER_MPU,
3051};
3052
3053/* l4 per -> timer7 */
3054static struct omap_hwmod_addr_space am33xx_timer7_addr_space[] = {
3055 {
3056 .pa_start = 0x4804A000,
3057 .pa_end = 0x4804A000 + SZ_1K - 1,
3058 .flags = ADDR_TYPE_RT
3059 },
3060 { }
3061};
3062
3063static struct omap_hwmod_ocp_if am33xx_l4_ls__timer7 = {
3064 .master = &am33xx_l4_ls_hwmod,
3065 .slave = &am33xx_timer7_hwmod,
3066 .clk = "l4ls_gclk",
3067 .addr = am33xx_timer7_addr_space,
3068 .user = OCP_USER_MPU,
3069};
3070
3071/* l3 main -> tpcc */
3072static struct omap_hwmod_addr_space am33xx_tpcc_addr_space[] = {
3073 {
3074 .pa_start = 0x49000000,
3075 .pa_end = 0x49000000 + SZ_32K - 1,
3076 .flags = ADDR_TYPE_RT
3077 },
3078 { }
3079};
3080
3081static struct omap_hwmod_ocp_if am33xx_l3_main__tpcc = {
3082 .master = &am33xx_l3_main_hwmod,
3083 .slave = &am33xx_tpcc_hwmod,
3084 .clk = "l3_gclk",
3085 .addr = am33xx_tpcc_addr_space,
3086 .user = OCP_USER_MPU,
3087};
3088
3089/* l3 main -> tpcc0 */
3090static struct omap_hwmod_addr_space am33xx_tptc0_addr_space[] = {
3091 {
3092 .pa_start = 0x49800000,
3093 .pa_end = 0x49800000 + SZ_8K - 1,
3094 .flags = ADDR_TYPE_RT,
3095 },
3096 { }
3097};
3098
3099static struct omap_hwmod_ocp_if am33xx_l3_main__tptc0 = {
3100 .master = &am33xx_l3_main_hwmod,
3101 .slave = &am33xx_tptc0_hwmod,
3102 .clk = "l3_gclk",
3103 .addr = am33xx_tptc0_addr_space,
3104 .user = OCP_USER_MPU,
3105};
3106
3107/* l3 main -> tpcc1 */
3108static struct omap_hwmod_addr_space am33xx_tptc1_addr_space[] = {
3109 {
3110 .pa_start = 0x49900000,
3111 .pa_end = 0x49900000 + SZ_8K - 1,
3112 .flags = ADDR_TYPE_RT,
3113 },
3114 { }
3115};
3116
3117static struct omap_hwmod_ocp_if am33xx_l3_main__tptc1 = {
3118 .master = &am33xx_l3_main_hwmod,
3119 .slave = &am33xx_tptc1_hwmod,
3120 .clk = "l3_gclk",
3121 .addr = am33xx_tptc1_addr_space,
3122 .user = OCP_USER_MPU,
3123};
3124
3125/* l3 main -> tpcc2 */
3126static struct omap_hwmod_addr_space am33xx_tptc2_addr_space[] = {
3127 {
3128 .pa_start = 0x49a00000,
3129 .pa_end = 0x49a00000 + SZ_8K - 1,
3130 .flags = ADDR_TYPE_RT,
3131 },
3132 { }
3133};
3134
3135static struct omap_hwmod_ocp_if am33xx_l3_main__tptc2 = {
3136 .master = &am33xx_l3_main_hwmod,
3137 .slave = &am33xx_tptc2_hwmod,
3138 .clk = "l3_gclk",
3139 .addr = am33xx_tptc2_addr_space,
3140 .user = OCP_USER_MPU,
3141};
3142
3143/* l4 wkup -> uart1 */
3144static struct omap_hwmod_addr_space am33xx_uart1_addr_space[] = {
3145 {
3146 .pa_start = 0x44E09000,
3147 .pa_end = 0x44E09000 + SZ_8K - 1,
3148 .flags = ADDR_TYPE_RT,
3149 },
3150 { }
3151};
3152
3153static struct omap_hwmod_ocp_if am33xx_l4_wkup__uart1 = {
3154 .master = &am33xx_l4_wkup_hwmod,
3155 .slave = &am33xx_uart1_hwmod,
3156 .clk = "dpll_core_m4_div2_ck",
3157 .addr = am33xx_uart1_addr_space,
3158 .user = OCP_USER_MPU,
3159};
3160
3161/* l4 ls -> uart2 */
3162static struct omap_hwmod_addr_space am33xx_uart2_addr_space[] = {
3163 {
3164 .pa_start = 0x48022000,
3165 .pa_end = 0x48022000 + SZ_8K - 1,
3166 .flags = ADDR_TYPE_RT,
3167 },
3168 { }
3169};
3170
3171static struct omap_hwmod_ocp_if am33xx_l4_ls__uart2 = {
3172 .master = &am33xx_l4_ls_hwmod,
3173 .slave = &am33xx_uart2_hwmod,
3174 .clk = "l4ls_gclk",
3175 .addr = am33xx_uart2_addr_space,
3176 .user = OCP_USER_MPU,
3177};
3178
3179/* l4 ls -> uart3 */
3180static struct omap_hwmod_addr_space am33xx_uart3_addr_space[] = {
3181 {
3182 .pa_start = 0x48024000,
3183 .pa_end = 0x48024000 + SZ_8K - 1,
3184 .flags = ADDR_TYPE_RT,
3185 },
3186 { }
3187};
3188
3189static struct omap_hwmod_ocp_if am33xx_l4_ls__uart3 = {
3190 .master = &am33xx_l4_ls_hwmod,
3191 .slave = &am33xx_uart3_hwmod,
3192 .clk = "l4ls_gclk",
3193 .addr = am33xx_uart3_addr_space,
3194 .user = OCP_USER_MPU,
3195};
3196
3197/* l4 ls -> uart4 */
3198static struct omap_hwmod_addr_space am33xx_uart4_addr_space[] = {
3199 {
3200 .pa_start = 0x481A6000,
3201 .pa_end = 0x481A6000 + SZ_8K - 1,
3202 .flags = ADDR_TYPE_RT,
3203 },
3204 { }
3205};
3206
3207static struct omap_hwmod_ocp_if am33xx_l4_ls__uart4 = {
3208 .master = &am33xx_l4_ls_hwmod,
3209 .slave = &am33xx_uart4_hwmod,
3210 .clk = "l4ls_gclk",
3211 .addr = am33xx_uart4_addr_space,
3212 .user = OCP_USER_MPU,
3213};
3214
3215/* l4 ls -> uart5 */
3216static struct omap_hwmod_addr_space am33xx_uart5_addr_space[] = {
3217 {
3218 .pa_start = 0x481A8000,
3219 .pa_end = 0x481A8000 + SZ_8K - 1,
3220 .flags = ADDR_TYPE_RT,
3221 },
3222 { }
3223};
3224
3225static struct omap_hwmod_ocp_if am33xx_l4_ls__uart5 = {
3226 .master = &am33xx_l4_ls_hwmod,
3227 .slave = &am33xx_uart5_hwmod,
3228 .clk = "l4ls_gclk",
3229 .addr = am33xx_uart5_addr_space,
3230 .user = OCP_USER_MPU,
3231};
3232
3233/* l4 ls -> uart6 */
3234static struct omap_hwmod_addr_space am33xx_uart6_addr_space[] = {
3235 {
3236 .pa_start = 0x481aa000,
3237 .pa_end = 0x481aa000 + SZ_8K - 1,
3238 .flags = ADDR_TYPE_RT,
3239 },
3240 { }
3241};
3242
3243static struct omap_hwmod_ocp_if am33xx_l4_ls__uart6 = {
3244 .master = &am33xx_l4_ls_hwmod,
3245 .slave = &am33xx_uart6_hwmod,
3246 .clk = "l4ls_gclk",
3247 .addr = am33xx_uart6_addr_space,
3248 .user = OCP_USER_MPU,
3249};
3250
3251/* l4 wkup -> wd_timer1 */
3252static struct omap_hwmod_addr_space am33xx_wd_timer1_addrs[] = {
3253 {
3254 .pa_start = 0x44e35000,
3255 .pa_end = 0x44e35000 + SZ_4K - 1,
3256 .flags = ADDR_TYPE_RT
3257 },
3258 { }
3259};
3260
3261static struct omap_hwmod_ocp_if am33xx_l4_wkup__wd_timer1 = {
3262 .master = &am33xx_l4_wkup_hwmod,
3263 .slave = &am33xx_wd_timer1_hwmod,
3264 .clk = "dpll_core_m4_div2_ck",
3265 .addr = am33xx_wd_timer1_addrs,
3266 .user = OCP_USER_MPU,
3267};
3268
3269/* usbss */
3270/* l3 s -> USBSS interface */
3271static struct omap_hwmod_addr_space am33xx_usbss_addr_space[] = {
3272 {
3273 .name = "usbss",
3274 .pa_start = 0x47400000,
3275 .pa_end = 0x47400000 + SZ_4K - 1,
3276 .flags = ADDR_TYPE_RT
3277 },
3278 {
3279 .name = "musb0",
3280 .pa_start = 0x47401000,
3281 .pa_end = 0x47401000 + SZ_2K - 1,
3282 .flags = ADDR_TYPE_RT
3283 },
3284 {
3285 .name = "musb1",
3286 .pa_start = 0x47401800,
3287 .pa_end = 0x47401800 + SZ_2K - 1,
3288 .flags = ADDR_TYPE_RT
3289 },
3290 { }
3291};
3292
3293static struct omap_hwmod_ocp_if am33xx_l3_s__usbss = {
3294 .master = &am33xx_l3_s_hwmod,
3295 .slave = &am33xx_usbss_hwmod,
3296 .clk = "l3s_gclk",
3297 .addr = am33xx_usbss_addr_space,
3298 .user = OCP_USER_MPU,
3299 .flags = OCPIF_SWSUP_IDLE,
3300};
3301
3302static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
3303 &am33xx_l4_fw__emif_fw,
3304 &am33xx_l3_main__emif,
3305 &am33xx_mpu__l3_main,
3306 &am33xx_mpu__prcm,
3307 &am33xx_l3_s__l4_ls,
3308 &am33xx_l3_s__l4_wkup,
3309 &am33xx_l3_s__l4_fw,
3310 &am33xx_l3_main__l4_hs,
3311 &am33xx_l3_main__l3_s,
3312 &am33xx_l3_main__l3_instr,
3313 &am33xx_l3_main__gfx,
3314 &am33xx_l3_s__l3_main,
3315 &am33xx_pruss__l3_main,
3316 &am33xx_wkup_m3__l4_wkup,
3317 &am33xx_gfx__l3_main,
3318 &am33xx_l4_wkup__wkup_m3,
3319 &am33xx_l4_wkup__control,
3320 &am33xx_l4_wkup__smartreflex0,
3321 &am33xx_l4_wkup__smartreflex1,
3322 &am33xx_l4_wkup__uart1,
3323 &am33xx_l4_wkup__timer1,
3324 &am33xx_l4_wkup__rtc,
3325 &am33xx_l4_wkup__i2c1,
3326 &am33xx_l4_wkup__gpio0,
3327 &am33xx_l4_wkup__adc_tsc,
3328 &am33xx_l4_wkup__wd_timer1,
3329 &am33xx_l4_hs__pruss,
3330 &am33xx_l4_per__dcan0,
3331 &am33xx_l4_per__dcan1,
3332 &am33xx_l4_per__gpio1,
3333 &am33xx_l4_per__gpio2,
3334 &am33xx_l4_per__gpio3,
3335 &am33xx_l4_per__i2c2,
3336 &am33xx_l4_per__i2c3,
3337 &am33xx_l4_per__mailbox,
3338 &am33xx_l4_ls__mcasp0,
3339 &am33xx_l3_s__mcasp0_data,
3340 &am33xx_l4_ls__mcasp1,
3341 &am33xx_l3_s__mcasp1_data,
3342 &am33xx_l4_ls__mmc0,
3343 &am33xx_l4_ls__mmc1,
3344 &am33xx_l3_s__mmc2,
3345 &am33xx_l4_ls__timer2,
3346 &am33xx_l4_ls__timer3,
3347 &am33xx_l4_ls__timer4,
3348 &am33xx_l4_ls__timer5,
3349 &am33xx_l4_ls__timer6,
3350 &am33xx_l4_ls__timer7,
3351 &am33xx_l3_main__tpcc,
3352 &am33xx_l4_ls__uart2,
3353 &am33xx_l4_ls__uart3,
3354 &am33xx_l4_ls__uart4,
3355 &am33xx_l4_ls__uart5,
3356 &am33xx_l4_ls__uart6,
3357 &am33xx_l4_ls__spinlock,
3358 &am33xx_l4_ls__elm,
3359 &am33xx_l4_ls__ehrpwm0,
3360 &am33xx_l4_ls__ehrpwm1,
3361 &am33xx_l4_ls__ehrpwm2,
3362 &am33xx_l4_ls__ecap0,
3363 &am33xx_l4_ls__ecap1,
3364 &am33xx_l4_ls__ecap2,
3365 &am33xx_l3_s__gpmc,
3366 &am33xx_l3_main__lcdc,
3367 &am33xx_l4_ls__mcspi0,
3368 &am33xx_l4_ls__mcspi1,
3369 &am33xx_l3_main__tptc0,
3370 &am33xx_l3_main__tptc1,
3371 &am33xx_l3_main__tptc2,
3372 &am33xx_l3_s__usbss,
3373 &am33xx_l4_hs__cpgmac0,
3374 NULL,
3375};
3376
3377int __init am33xx_hwmod_init(void)
3378{
3379 omap_hwmod_init();
3380 return omap_hwmod_register_links(am33xx_hwmod_ocp_ifs);
3381}
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index c9e38200216..f67b7ee07dd 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -15,26 +15,27 @@
15 * XXX these should be marked initdata for multi-OMAP kernels 15 * XXX these should be marked initdata for multi-OMAP kernels
16 */ 16 */
17#include <linux/power/smartreflex.h> 17#include <linux/power/smartreflex.h>
18#include <linux/platform_data/gpio-omap.h>
18 19
19#include <plat/omap_hwmod.h> 20#include <plat/omap_hwmod.h>
20#include <mach/irqs.h>
21#include <plat/cpu.h>
22#include <plat/dma.h> 21#include <plat/dma.h>
23#include <plat/serial.h> 22#include <plat/serial.h>
24#include <plat/l3_3xxx.h> 23#include "l3_3xxx.h"
25#include <plat/l4_3xxx.h> 24#include "l4_3xxx.h"
26#include <plat/i2c.h> 25#include <plat/i2c.h>
27#include <plat/gpio.h>
28#include <plat/mmc.h> 26#include <plat/mmc.h>
29#include <plat/mcbsp.h> 27#include <linux/platform_data/asoc-ti-mcbsp.h>
30#include <plat/mcspi.h> 28#include <linux/platform_data/spi-omap2-mcspi.h>
31#include <plat/dmtimer.h> 29#include <plat/dmtimer.h>
30#include <plat/iommu.h>
32 31
32#include "am35xx.h"
33
34#include "soc.h"
33#include "omap_hwmod_common_data.h" 35#include "omap_hwmod_common_data.h"
34#include "prm-regbits-34xx.h" 36#include "prm-regbits-34xx.h"
35#include "cm-regbits-34xx.h" 37#include "cm-regbits-34xx.h"
36#include "wd_timer.h" 38#include "wd_timer.h"
37#include <mach/am35xx.h>
38 39
39/* 40/*
40 * OMAP3xxx hardware module integration data 41 * OMAP3xxx hardware module integration data
@@ -51,9 +52,9 @@
51 52
52/* L3 */ 53/* L3 */
53static struct omap_hwmod_irq_info omap3xxx_l3_main_irqs[] = { 54static struct omap_hwmod_irq_info omap3xxx_l3_main_irqs[] = {
54 { .irq = INT_34XX_L3_DBG_IRQ }, 55 { .irq = 9 + OMAP_INTC_START, },
55 { .irq = INT_34XX_L3_APP_IRQ }, 56 { .irq = 10 + OMAP_INTC_START, },
56 { .irq = -1 } 57 { .irq = -1 },
57}; 58};
58 59
59static struct omap_hwmod omap3xxx_l3_main_hwmod = { 60static struct omap_hwmod omap3xxx_l3_main_hwmod = {
@@ -92,17 +93,23 @@ static struct omap_hwmod omap3xxx_l4_sec_hwmod = {
92}; 93};
93 94
94/* MPU */ 95/* MPU */
96static struct omap_hwmod_irq_info omap3xxx_mpu_irqs[] = {
97 { .name = "pmu", .irq = 3 + OMAP_INTC_START },
98 { .irq = -1 }
99};
100
95static struct omap_hwmod omap3xxx_mpu_hwmod = { 101static struct omap_hwmod omap3xxx_mpu_hwmod = {
96 .name = "mpu", 102 .name = "mpu",
103 .mpu_irqs = omap3xxx_mpu_irqs,
97 .class = &mpu_hwmod_class, 104 .class = &mpu_hwmod_class,
98 .main_clk = "arm_fck", 105 .main_clk = "arm_fck",
99}; 106};
100 107
101/* IVA2 (IVA2) */ 108/* IVA2 (IVA2) */
102static struct omap_hwmod_rst_info omap3xxx_iva_resets[] = { 109static struct omap_hwmod_rst_info omap3xxx_iva_resets[] = {
103 { .name = "logic", .rst_shift = 0 }, 110 { .name = "logic", .rst_shift = 0, .st_shift = 8 },
104 { .name = "seq0", .rst_shift = 1 }, 111 { .name = "seq0", .rst_shift = 1, .st_shift = 9 },
105 { .name = "seq1", .rst_shift = 2 }, 112 { .name = "seq1", .rst_shift = 2, .st_shift = 10 },
106}; 113};
107 114
108static struct omap_hwmod omap3xxx_iva_hwmod = { 115static struct omap_hwmod omap3xxx_iva_hwmod = {
@@ -112,6 +119,33 @@ static struct omap_hwmod omap3xxx_iva_hwmod = {
112 .rst_lines = omap3xxx_iva_resets, 119 .rst_lines = omap3xxx_iva_resets,
113 .rst_lines_cnt = ARRAY_SIZE(omap3xxx_iva_resets), 120 .rst_lines_cnt = ARRAY_SIZE(omap3xxx_iva_resets),
114 .main_clk = "iva2_ck", 121 .main_clk = "iva2_ck",
122 .prcm = {
123 .omap2 = {
124 .module_offs = OMAP3430_IVA2_MOD,
125 .prcm_reg_id = 1,
126 .module_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT,
127 .idlest_reg_id = 1,
128 .idlest_idle_bit = OMAP3430_ST_IVA2_SHIFT,
129 }
130 },
131};
132
133/*
134 * 'debugss' class
135 * debug and emulation sub system
136 */
137
138static struct omap_hwmod_class omap3xxx_debugss_hwmod_class = {
139 .name = "debugss",
140};
141
142/* debugss */
143static struct omap_hwmod omap3xxx_debugss_hwmod = {
144 .name = "debugss",
145 .class = &omap3xxx_debugss_hwmod_class,
146 .clkdm_name = "emu_clkdm",
147 .main_clk = "emu_src_ck",
148 .flags = HWMOD_NO_IDLEST,
115}; 149};
116 150
117/* timer class */ 151/* timer class */
@@ -161,6 +195,16 @@ static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
161 .timer_capability = OMAP_TIMER_HAS_PWM, 195 .timer_capability = OMAP_TIMER_HAS_PWM,
162}; 196};
163 197
198/* timers with DSP interrupt dev attribute */
199static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = {
200 .timer_capability = OMAP_TIMER_HAS_DSP_IRQ,
201};
202
203/* pwm timers with DSP interrupt dev attribute */
204static struct omap_timer_capability_dev_attr capability_dsp_pwm_dev_attr = {
205 .timer_capability = OMAP_TIMER_HAS_DSP_IRQ | OMAP_TIMER_HAS_PWM,
206};
207
164/* timer1 */ 208/* timer1 */
165static struct omap_hwmod omap3xxx_timer1_hwmod = { 209static struct omap_hwmod omap3xxx_timer1_hwmod = {
166 .name = "timer1", 210 .name = "timer1",
@@ -244,6 +288,7 @@ static struct omap_hwmod omap3xxx_timer5_hwmod = {
244 .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT, 288 .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT,
245 }, 289 },
246 }, 290 },
291 .dev_attr = &capability_dsp_dev_attr,
247 .class = &omap3xxx_timer_hwmod_class, 292 .class = &omap3xxx_timer_hwmod_class,
248}; 293};
249 294
@@ -261,6 +306,7 @@ static struct omap_hwmod omap3xxx_timer6_hwmod = {
261 .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT, 306 .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT,
262 }, 307 },
263 }, 308 },
309 .dev_attr = &capability_dsp_dev_attr,
264 .class = &omap3xxx_timer_hwmod_class, 310 .class = &omap3xxx_timer_hwmod_class,
265}; 311};
266 312
@@ -278,6 +324,7 @@ static struct omap_hwmod omap3xxx_timer7_hwmod = {
278 .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT, 324 .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT,
279 }, 325 },
280 }, 326 },
327 .dev_attr = &capability_dsp_dev_attr,
281 .class = &omap3xxx_timer_hwmod_class, 328 .class = &omap3xxx_timer_hwmod_class,
282}; 329};
283 330
@@ -295,7 +342,7 @@ static struct omap_hwmod omap3xxx_timer8_hwmod = {
295 .idlest_idle_bit = OMAP3430_ST_GPT8_SHIFT, 342 .idlest_idle_bit = OMAP3430_ST_GPT8_SHIFT,
296 }, 343 },
297 }, 344 },
298 .dev_attr = &capability_pwm_dev_attr, 345 .dev_attr = &capability_dsp_pwm_dev_attr,
299 .class = &omap3xxx_timer_hwmod_class, 346 .class = &omap3xxx_timer_hwmod_class,
300}; 347};
301 348
@@ -355,8 +402,8 @@ static struct omap_hwmod omap3xxx_timer11_hwmod = {
355 402
356/* timer12 */ 403/* timer12 */
357static struct omap_hwmod_irq_info omap3xxx_timer12_mpu_irqs[] = { 404static struct omap_hwmod_irq_info omap3xxx_timer12_mpu_irqs[] = {
358 { .irq = 95, }, 405 { .irq = 95 + OMAP_INTC_START, },
359 { .irq = -1 } 406 { .irq = -1 },
360}; 407};
361 408
362static struct omap_hwmod omap3xxx_timer12_hwmod = { 409static struct omap_hwmod omap3xxx_timer12_hwmod = {
@@ -490,8 +537,8 @@ static struct omap_hwmod omap3xxx_uart3_hwmod = {
490 537
491/* UART4 */ 538/* UART4 */
492static struct omap_hwmod_irq_info uart4_mpu_irqs[] = { 539static struct omap_hwmod_irq_info uart4_mpu_irqs[] = {
493 { .irq = INT_36XX_UART4_IRQ, }, 540 { .irq = 80 + OMAP_INTC_START, },
494 { .irq = -1 } 541 { .irq = -1 },
495}; 542};
496 543
497static struct omap_hwmod_dma_info uart4_sdma_reqs[] = { 544static struct omap_hwmod_dma_info uart4_sdma_reqs[] = {
@@ -518,8 +565,8 @@ static struct omap_hwmod omap36xx_uart4_hwmod = {
518}; 565};
519 566
520static struct omap_hwmod_irq_info am35xx_uart4_mpu_irqs[] = { 567static struct omap_hwmod_irq_info am35xx_uart4_mpu_irqs[] = {
521 { .irq = INT_35XX_UART4_IRQ, }, 568 { .irq = 84 + OMAP_INTC_START, },
522 { .irq = -1 } 569 { .irq = -1 },
523}; 570};
524 571
525static struct omap_hwmod_dma_info am35xx_uart4_sdma_reqs[] = { 572static struct omap_hwmod_dma_info am35xx_uart4_sdma_reqs[] = {
@@ -674,8 +721,8 @@ static struct omap_hwmod_class omap3xxx_dsi_hwmod_class = {
674}; 721};
675 722
676static struct omap_hwmod_irq_info omap3xxx_dsi1_irqs[] = { 723static struct omap_hwmod_irq_info omap3xxx_dsi1_irqs[] = {
677 { .irq = 25 }, 724 { .irq = 25 + OMAP_INTC_START, },
678 { .irq = -1 } 725 { .irq = -1 },
679}; 726};
680 727
681/* dss_dsi1 */ 728/* dss_dsi1 */
@@ -804,8 +851,8 @@ static struct omap_i2c_dev_attr i2c3_dev_attr = {
804}; 851};
805 852
806static struct omap_hwmod_irq_info i2c3_mpu_irqs[] = { 853static struct omap_hwmod_irq_info i2c3_mpu_irqs[] = {
807 { .irq = INT_34XX_I2C3_IRQ, }, 854 { .irq = 61 + OMAP_INTC_START, },
808 { .irq = -1 } 855 { .irq = -1 },
809}; 856};
810 857
811static struct omap_hwmod_dma_info i2c3_sdma_reqs[] = { 858static struct omap_hwmod_dma_info i2c3_sdma_reqs[] = {
@@ -963,8 +1010,8 @@ static struct omap_hwmod omap3xxx_gpio4_hwmod = {
963 1010
964/* gpio5 */ 1011/* gpio5 */
965static struct omap_hwmod_irq_info omap3xxx_gpio5_irqs[] = { 1012static struct omap_hwmod_irq_info omap3xxx_gpio5_irqs[] = {
966 { .irq = 33 }, /* INT_34XX_GPIO_BANK5 */ 1013 { .irq = 33 + OMAP_INTC_START, }, /* INT_34XX_GPIO_BANK5 */
967 { .irq = -1 } 1014 { .irq = -1 },
968}; 1015};
969 1016
970static struct omap_hwmod_opt_clk gpio5_opt_clks[] = { 1017static struct omap_hwmod_opt_clk gpio5_opt_clks[] = {
@@ -993,8 +1040,8 @@ static struct omap_hwmod omap3xxx_gpio5_hwmod = {
993 1040
994/* gpio6 */ 1041/* gpio6 */
995static struct omap_hwmod_irq_info omap3xxx_gpio6_irqs[] = { 1042static struct omap_hwmod_irq_info omap3xxx_gpio6_irqs[] = {
996 { .irq = 34 }, /* INT_34XX_GPIO_BANK6 */ 1043 { .irq = 34 + OMAP_INTC_START, }, /* INT_34XX_GPIO_BANK6 */
997 { .irq = -1 } 1044 { .irq = -1 },
998}; 1045};
999 1046
1000static struct omap_hwmod_opt_clk gpio6_opt_clks[] = { 1047static struct omap_hwmod_opt_clk gpio6_opt_clks[] = {
@@ -1098,10 +1145,10 @@ static struct omap_hwmod_opt_clk mcbsp234_opt_clks[] = {
1098 1145
1099/* mcbsp1 */ 1146/* mcbsp1 */
1100static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = { 1147static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = {
1101 { .name = "common", .irq = 16 }, 1148 { .name = "common", .irq = 16 + OMAP_INTC_START, },
1102 { .name = "tx", .irq = 59 }, 1149 { .name = "tx", .irq = 59 + OMAP_INTC_START, },
1103 { .name = "rx", .irq = 60 }, 1150 { .name = "rx", .irq = 60 + OMAP_INTC_START, },
1104 { .irq = -1 } 1151 { .irq = -1 },
1105}; 1152};
1106 1153
1107static struct omap_hwmod omap3xxx_mcbsp1_hwmod = { 1154static struct omap_hwmod omap3xxx_mcbsp1_hwmod = {
@@ -1125,10 +1172,10 @@ static struct omap_hwmod omap3xxx_mcbsp1_hwmod = {
1125 1172
1126/* mcbsp2 */ 1173/* mcbsp2 */
1127static struct omap_hwmod_irq_info omap3xxx_mcbsp2_irqs[] = { 1174static struct omap_hwmod_irq_info omap3xxx_mcbsp2_irqs[] = {
1128 { .name = "common", .irq = 17 }, 1175 { .name = "common", .irq = 17 + OMAP_INTC_START, },
1129 { .name = "tx", .irq = 62 }, 1176 { .name = "tx", .irq = 62 + OMAP_INTC_START, },
1130 { .name = "rx", .irq = 63 }, 1177 { .name = "rx", .irq = 63 + OMAP_INTC_START, },
1131 { .irq = -1 } 1178 { .irq = -1 },
1132}; 1179};
1133 1180
1134static struct omap_mcbsp_dev_attr omap34xx_mcbsp2_dev_attr = { 1181static struct omap_mcbsp_dev_attr omap34xx_mcbsp2_dev_attr = {
@@ -1157,10 +1204,10 @@ static struct omap_hwmod omap3xxx_mcbsp2_hwmod = {
1157 1204
1158/* mcbsp3 */ 1205/* mcbsp3 */
1159static struct omap_hwmod_irq_info omap3xxx_mcbsp3_irqs[] = { 1206static struct omap_hwmod_irq_info omap3xxx_mcbsp3_irqs[] = {
1160 { .name = "common", .irq = 22 }, 1207 { .name = "common", .irq = 22 + OMAP_INTC_START, },
1161 { .name = "tx", .irq = 89 }, 1208 { .name = "tx", .irq = 89 + OMAP_INTC_START, },
1162 { .name = "rx", .irq = 90 }, 1209 { .name = "rx", .irq = 90 + OMAP_INTC_START, },
1163 { .irq = -1 } 1210 { .irq = -1 },
1164}; 1211};
1165 1212
1166static struct omap_mcbsp_dev_attr omap34xx_mcbsp3_dev_attr = { 1213static struct omap_mcbsp_dev_attr omap34xx_mcbsp3_dev_attr = {
@@ -1189,10 +1236,10 @@ static struct omap_hwmod omap3xxx_mcbsp3_hwmod = {
1189 1236
1190/* mcbsp4 */ 1237/* mcbsp4 */
1191static struct omap_hwmod_irq_info omap3xxx_mcbsp4_irqs[] = { 1238static struct omap_hwmod_irq_info omap3xxx_mcbsp4_irqs[] = {
1192 { .name = "common", .irq = 23 }, 1239 { .name = "common", .irq = 23 + OMAP_INTC_START, },
1193 { .name = "tx", .irq = 54 }, 1240 { .name = "tx", .irq = 54 + OMAP_INTC_START, },
1194 { .name = "rx", .irq = 55 }, 1241 { .name = "rx", .irq = 55 + OMAP_INTC_START, },
1195 { .irq = -1 } 1242 { .irq = -1 },
1196}; 1243};
1197 1244
1198static struct omap_hwmod_dma_info omap3xxx_mcbsp4_sdma_chs[] = { 1245static struct omap_hwmod_dma_info omap3xxx_mcbsp4_sdma_chs[] = {
@@ -1222,10 +1269,10 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod = {
1222 1269
1223/* mcbsp5 */ 1270/* mcbsp5 */
1224static struct omap_hwmod_irq_info omap3xxx_mcbsp5_irqs[] = { 1271static struct omap_hwmod_irq_info omap3xxx_mcbsp5_irqs[] = {
1225 { .name = "common", .irq = 27 }, 1272 { .name = "common", .irq = 27 + OMAP_INTC_START, },
1226 { .name = "tx", .irq = 81 }, 1273 { .name = "tx", .irq = 81 + OMAP_INTC_START, },
1227 { .name = "rx", .irq = 82 }, 1274 { .name = "rx", .irq = 82 + OMAP_INTC_START, },
1228 { .irq = -1 } 1275 { .irq = -1 },
1229}; 1276};
1230 1277
1231static struct omap_hwmod_dma_info omap3xxx_mcbsp5_sdma_chs[] = { 1278static struct omap_hwmod_dma_info omap3xxx_mcbsp5_sdma_chs[] = {
@@ -1267,8 +1314,8 @@ static struct omap_hwmod_class omap3xxx_mcbsp_sidetone_hwmod_class = {
1267 1314
1268/* mcbsp2_sidetone */ 1315/* mcbsp2_sidetone */
1269static struct omap_hwmod_irq_info omap3xxx_mcbsp2_sidetone_irqs[] = { 1316static struct omap_hwmod_irq_info omap3xxx_mcbsp2_sidetone_irqs[] = {
1270 { .name = "irq", .irq = 4 }, 1317 { .name = "irq", .irq = 4 + OMAP_INTC_START, },
1271 { .irq = -1 } 1318 { .irq = -1 },
1272}; 1319};
1273 1320
1274static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = { 1321static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = {
@@ -1289,8 +1336,8 @@ static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = {
1289 1336
1290/* mcbsp3_sidetone */ 1337/* mcbsp3_sidetone */
1291static struct omap_hwmod_irq_info omap3xxx_mcbsp3_sidetone_irqs[] = { 1338static struct omap_hwmod_irq_info omap3xxx_mcbsp3_sidetone_irqs[] = {
1292 { .name = "irq", .irq = 5 }, 1339 { .name = "irq", .irq = 5 + OMAP_INTC_START, },
1293 { .irq = -1 } 1340 { .irq = -1 },
1294}; 1341};
1295 1342
1296static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = { 1343static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = {
@@ -1352,8 +1399,8 @@ static struct omap_smartreflex_dev_attr sr1_dev_attr = {
1352}; 1399};
1353 1400
1354static struct omap_hwmod_irq_info omap3_smartreflex_mpu_irqs[] = { 1401static struct omap_hwmod_irq_info omap3_smartreflex_mpu_irqs[] = {
1355 { .irq = 18 }, 1402 { .irq = 18 + OMAP_INTC_START, },
1356 { .irq = -1 } 1403 { .irq = -1 },
1357}; 1404};
1358 1405
1359static struct omap_hwmod omap34xx_sr1_hwmod = { 1406static struct omap_hwmod omap34xx_sr1_hwmod = {
@@ -1397,8 +1444,8 @@ static struct omap_smartreflex_dev_attr sr2_dev_attr = {
1397}; 1444};
1398 1445
1399static struct omap_hwmod_irq_info omap3_smartreflex_core_irqs[] = { 1446static struct omap_hwmod_irq_info omap3_smartreflex_core_irqs[] = {
1400 { .irq = 19 }, 1447 { .irq = 19 + OMAP_INTC_START, },
1401 { .irq = -1 } 1448 { .irq = -1 },
1402}; 1449};
1403 1450
1404static struct omap_hwmod omap34xx_sr2_hwmod = { 1451static struct omap_hwmod omap34xx_sr2_hwmod = {
@@ -1458,8 +1505,8 @@ static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = {
1458}; 1505};
1459 1506
1460static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = { 1507static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = {
1461 { .irq = 26 }, 1508 { .irq = 26 + OMAP_INTC_START, },
1462 { .irq = -1 } 1509 { .irq = -1 },
1463}; 1510};
1464 1511
1465static struct omap_hwmod omap3xxx_mailbox_hwmod = { 1512static struct omap_hwmod omap3xxx_mailbox_hwmod = {
@@ -1549,8 +1596,8 @@ static struct omap_hwmod omap34xx_mcspi2 = {
1549 1596
1550/* mcspi3 */ 1597/* mcspi3 */
1551static struct omap_hwmod_irq_info omap34xx_mcspi3_mpu_irqs[] = { 1598static struct omap_hwmod_irq_info omap34xx_mcspi3_mpu_irqs[] = {
1552 { .name = "irq", .irq = 91 }, /* 91 */ 1599 { .name = "irq", .irq = 91 + OMAP_INTC_START, }, /* 91 */
1553 { .irq = -1 } 1600 { .irq = -1 },
1554}; 1601};
1555 1602
1556static struct omap_hwmod_dma_info omap34xx_mcspi3_sdma_reqs[] = { 1603static struct omap_hwmod_dma_info omap34xx_mcspi3_sdma_reqs[] = {
@@ -1585,8 +1632,8 @@ static struct omap_hwmod omap34xx_mcspi3 = {
1585 1632
1586/* mcspi4 */ 1633/* mcspi4 */
1587static struct omap_hwmod_irq_info omap34xx_mcspi4_mpu_irqs[] = { 1634static struct omap_hwmod_irq_info omap34xx_mcspi4_mpu_irqs[] = {
1588 { .name = "irq", .irq = INT_34XX_SPI4_IRQ }, /* 48 */ 1635 { .name = "irq", .irq = 48 + OMAP_INTC_START, },
1589 { .irq = -1 } 1636 { .irq = -1 },
1590}; 1637};
1591 1638
1592static struct omap_hwmod_dma_info omap34xx_mcspi4_sdma_reqs[] = { 1639static struct omap_hwmod_dma_info omap34xx_mcspi4_sdma_reqs[] = {
@@ -1638,9 +1685,9 @@ static struct omap_hwmod_class usbotg_class = {
1638/* usb_otg_hs */ 1685/* usb_otg_hs */
1639static struct omap_hwmod_irq_info omap3xxx_usbhsotg_mpu_irqs[] = { 1686static struct omap_hwmod_irq_info omap3xxx_usbhsotg_mpu_irqs[] = {
1640 1687
1641 { .name = "mc", .irq = 92 }, 1688 { .name = "mc", .irq = 92 + OMAP_INTC_START, },
1642 { .name = "dma", .irq = 93 }, 1689 { .name = "dma", .irq = 93 + OMAP_INTC_START, },
1643 { .irq = -1 } 1690 { .irq = -1 },
1644}; 1691};
1645 1692
1646static struct omap_hwmod omap3xxx_usbhsotg_hwmod = { 1693static struct omap_hwmod omap3xxx_usbhsotg_hwmod = {
@@ -1670,8 +1717,8 @@ static struct omap_hwmod omap3xxx_usbhsotg_hwmod = {
1670 1717
1671/* usb_otg_hs */ 1718/* usb_otg_hs */
1672static struct omap_hwmod_irq_info am35xx_usbhsotg_mpu_irqs[] = { 1719static struct omap_hwmod_irq_info am35xx_usbhsotg_mpu_irqs[] = {
1673 { .name = "mc", .irq = 71 }, 1720 { .name = "mc", .irq = 71 + OMAP_INTC_START, },
1674 { .irq = -1 } 1721 { .irq = -1 },
1675}; 1722};
1676 1723
1677static struct omap_hwmod_class am35xx_usbotg_class = { 1724static struct omap_hwmod_class am35xx_usbotg_class = {
@@ -1706,8 +1753,8 @@ static struct omap_hwmod_class omap34xx_mmc_class = {
1706/* MMC/SD/SDIO1 */ 1753/* MMC/SD/SDIO1 */
1707 1754
1708static struct omap_hwmod_irq_info omap34xx_mmc1_mpu_irqs[] = { 1755static struct omap_hwmod_irq_info omap34xx_mmc1_mpu_irqs[] = {
1709 { .irq = 83, }, 1756 { .irq = 83 + OMAP_INTC_START, },
1710 { .irq = -1 } 1757 { .irq = -1 },
1711}; 1758};
1712 1759
1713static struct omap_hwmod_dma_info omap34xx_mmc1_sdma_reqs[] = { 1760static struct omap_hwmod_dma_info omap34xx_mmc1_sdma_reqs[] = {
@@ -1773,8 +1820,8 @@ static struct omap_hwmod omap3xxx_es3plus_mmc1_hwmod = {
1773/* MMC/SD/SDIO2 */ 1820/* MMC/SD/SDIO2 */
1774 1821
1775static struct omap_hwmod_irq_info omap34xx_mmc2_mpu_irqs[] = { 1822static struct omap_hwmod_irq_info omap34xx_mmc2_mpu_irqs[] = {
1776 { .irq = INT_24XX_MMC2_IRQ, }, 1823 { .irq = 86 + OMAP_INTC_START, },
1777 { .irq = -1 } 1824 { .irq = -1 },
1778}; 1825};
1779 1826
1780static struct omap_hwmod_dma_info omap34xx_mmc2_sdma_reqs[] = { 1827static struct omap_hwmod_dma_info omap34xx_mmc2_sdma_reqs[] = {
@@ -1834,8 +1881,8 @@ static struct omap_hwmod omap3xxx_es3plus_mmc2_hwmod = {
1834/* MMC/SD/SDIO3 */ 1881/* MMC/SD/SDIO3 */
1835 1882
1836static struct omap_hwmod_irq_info omap34xx_mmc3_mpu_irqs[] = { 1883static struct omap_hwmod_irq_info omap34xx_mmc3_mpu_irqs[] = {
1837 { .irq = 94, }, 1884 { .irq = 94 + OMAP_INTC_START, },
1838 { .irq = -1 } 1885 { .irq = -1 },
1839}; 1886};
1840 1887
1841static struct omap_hwmod_dma_info omap34xx_mmc3_sdma_reqs[] = { 1888static struct omap_hwmod_dma_info omap34xx_mmc3_sdma_reqs[] = {
@@ -1893,9 +1940,9 @@ static struct omap_hwmod_opt_clk omap3xxx_usb_host_hs_opt_clks[] = {
1893}; 1940};
1894 1941
1895static struct omap_hwmod_irq_info omap3xxx_usb_host_hs_irqs[] = { 1942static struct omap_hwmod_irq_info omap3xxx_usb_host_hs_irqs[] = {
1896 { .name = "ohci-irq", .irq = 76 }, 1943 { .name = "ohci-irq", .irq = 76 + OMAP_INTC_START, },
1897 { .name = "ehci-irq", .irq = 77 }, 1944 { .name = "ehci-irq", .irq = 77 + OMAP_INTC_START, },
1898 { .irq = -1 } 1945 { .irq = -1 },
1899}; 1946};
1900 1947
1901static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = { 1948static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = {
@@ -1987,8 +2034,8 @@ static struct omap_hwmod_class omap3xxx_usb_tll_hs_hwmod_class = {
1987}; 2034};
1988 2035
1989static struct omap_hwmod_irq_info omap3xxx_usb_tll_hs_irqs[] = { 2036static struct omap_hwmod_irq_info omap3xxx_usb_tll_hs_irqs[] = {
1990 { .name = "tll-irq", .irq = 78 }, 2037 { .name = "tll-irq", .irq = 78 + OMAP_INTC_START, },
1991 { .irq = -1 } 2038 { .irq = -1 },
1992}; 2039};
1993 2040
1994static struct omap_hwmod omap3xxx_usb_tll_hs_hwmod = { 2041static struct omap_hwmod omap3xxx_usb_tll_hs_hwmod = {
@@ -2024,6 +2071,33 @@ static struct omap_hwmod omap3xxx_hdq1w_hwmod = {
2024 .class = &omap2_hdq1w_class, 2071 .class = &omap2_hdq1w_class,
2025}; 2072};
2026 2073
2074/* SAD2D */
2075static struct omap_hwmod_rst_info omap3xxx_sad2d_resets[] = {
2076 { .name = "rst_modem_pwron_sw", .rst_shift = 0 },
2077 { .name = "rst_modem_sw", .rst_shift = 1 },
2078};
2079
2080static struct omap_hwmod_class omap3xxx_sad2d_class = {
2081 .name = "sad2d",
2082};
2083
2084static struct omap_hwmod omap3xxx_sad2d_hwmod = {
2085 .name = "sad2d",
2086 .rst_lines = omap3xxx_sad2d_resets,
2087 .rst_lines_cnt = ARRAY_SIZE(omap3xxx_sad2d_resets),
2088 .main_clk = "sad2d_ick",
2089 .prcm = {
2090 .omap2 = {
2091 .module_offs = CORE_MOD,
2092 .prcm_reg_id = 1,
2093 .module_bit = OMAP3430_EN_SAD2D_SHIFT,
2094 .idlest_reg_id = 1,
2095 .idlest_idle_bit = OMAP3430_ST_SAD2D_SHIFT,
2096 },
2097 },
2098 .class = &omap3xxx_sad2d_class,
2099};
2100
2027/* 2101/*
2028 * '32K sync counter' class 2102 * '32K sync counter' class
2029 * 32-bit ordinary counter, clocked by the falling edge of the 32 khz clock 2103 * 32-bit ordinary counter, clocked by the falling edge of the 32 khz clock
@@ -2059,6 +2133,49 @@ static struct omap_hwmod omap3xxx_counter_32k_hwmod = {
2059}; 2133};
2060 2134
2061/* 2135/*
2136 * 'gpmc' class
2137 * general purpose memory controller
2138 */
2139
2140static struct omap_hwmod_class_sysconfig omap3xxx_gpmc_sysc = {
2141 .rev_offs = 0x0000,
2142 .sysc_offs = 0x0010,
2143 .syss_offs = 0x0014,
2144 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
2145 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
2146 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2147 .sysc_fields = &omap_hwmod_sysc_type1,
2148};
2149
2150static struct omap_hwmod_class omap3xxx_gpmc_hwmod_class = {
2151 .name = "gpmc",
2152 .sysc = &omap3xxx_gpmc_sysc,
2153};
2154
2155static struct omap_hwmod_irq_info omap3xxx_gpmc_irqs[] = {
2156 { .irq = 20 },
2157 { .irq = -1 }
2158};
2159
2160static struct omap_hwmod omap3xxx_gpmc_hwmod = {
2161 .name = "gpmc",
2162 .class = &omap3xxx_gpmc_hwmod_class,
2163 .clkdm_name = "core_l3_clkdm",
2164 .mpu_irqs = omap3xxx_gpmc_irqs,
2165 .main_clk = "gpmc_fck",
2166 /*
2167 * XXX HWMOD_INIT_NO_RESET should not be needed for this IP
2168 * block. It is not being added due to any known bugs with
2169 * resetting the GPMC IP block, but rather because any timings
2170 * set by the bootloader are not being correctly programmed by
2171 * the kernel from the board file or DT data.
2172 * HWMOD_INIT_NO_RESET should be removed ASAP.
2173 */
2174 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET |
2175 HWMOD_NO_IDLEST),
2176};
2177
2178/*
2062 * interfaces 2179 * interfaces
2063 */ 2180 */
2064 2181
@@ -2093,6 +2210,23 @@ static struct omap_hwmod_ocp_if omap3xxx_mpu__l3_main = {
2093 .user = OCP_USER_MPU, 2210 .user = OCP_USER_MPU,
2094}; 2211};
2095 2212
2213static struct omap_hwmod_addr_space omap3xxx_l4_emu_addrs[] = {
2214 {
2215 .pa_start = 0x54000000,
2216 .pa_end = 0x547fffff,
2217 .flags = ADDR_TYPE_RT,
2218 },
2219 { }
2220};
2221
2222/* l3 -> debugss */
2223static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_debugss = {
2224 .master = &omap3xxx_l3_main_hwmod,
2225 .slave = &omap3xxx_debugss_hwmod,
2226 .addr = omap3xxx_l4_emu_addrs,
2227 .user = OCP_USER_MPU,
2228};
2229
2096/* DSS -> l3 */ 2230/* DSS -> l3 */
2097static struct omap_hwmod_ocp_if omap3430es1_dss__l3 = { 2231static struct omap_hwmod_ocp_if omap3430es1_dss__l3 = {
2098 .master = &omap3430es1_dss_core_hwmod, 2232 .master = &omap3430es1_dss_core_hwmod,
@@ -2128,6 +2262,14 @@ static struct omap_hwmod_ocp_if am35xx_usbhsotg__l3 = {
2128 .user = OCP_USER_MPU, 2262 .user = OCP_USER_MPU,
2129}; 2263};
2130 2264
2265/* l3_core -> sad2d interface */
2266static struct omap_hwmod_ocp_if omap3xxx_sad2d__l3 = {
2267 .master = &omap3xxx_sad2d_hwmod,
2268 .slave = &omap3xxx_l3_main_hwmod,
2269 .clk = "core_l3_ick",
2270 .user = OCP_USER_MPU,
2271};
2272
2131/* L4_CORE -> L4_WKUP interface */ 2273/* L4_CORE -> L4_WKUP interface */
2132static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { 2274static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = {
2133 .master = &omap3xxx_l4_core_hwmod, 2275 .master = &omap3xxx_l4_core_hwmod,
@@ -2814,6 +2956,122 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio3 = {
2814 .user = OCP_USER_MPU | OCP_USER_SDMA, 2956 .user = OCP_USER_MPU | OCP_USER_SDMA,
2815}; 2957};
2816 2958
2959/*
2960 * 'mmu' class
2961 * The memory management unit performs virtual to physical address translation
2962 * for its requestors.
2963 */
2964
2965static struct omap_hwmod_class_sysconfig mmu_sysc = {
2966 .rev_offs = 0x000,
2967 .sysc_offs = 0x010,
2968 .syss_offs = 0x014,
2969 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
2970 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
2971 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2972 .sysc_fields = &omap_hwmod_sysc_type1,
2973};
2974
2975static struct omap_hwmod_class omap3xxx_mmu_hwmod_class = {
2976 .name = "mmu",
2977 .sysc = &mmu_sysc,
2978};
2979
2980/* mmu isp */
2981
2982static struct omap_mmu_dev_attr mmu_isp_dev_attr = {
2983 .da_start = 0x0,
2984 .da_end = 0xfffff000,
2985 .nr_tlb_entries = 8,
2986};
2987
2988static struct omap_hwmod omap3xxx_mmu_isp_hwmod;
2989static struct omap_hwmod_irq_info omap3xxx_mmu_isp_irqs[] = {
2990 { .irq = 24 },
2991 { .irq = -1 }
2992};
2993
2994static struct omap_hwmod_addr_space omap3xxx_mmu_isp_addrs[] = {
2995 {
2996 .pa_start = 0x480bd400,
2997 .pa_end = 0x480bd47f,
2998 .flags = ADDR_TYPE_RT,
2999 },
3000 { }
3001};
3002
3003/* l4_core -> mmu isp */
3004static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmu_isp = {
3005 .master = &omap3xxx_l4_core_hwmod,
3006 .slave = &omap3xxx_mmu_isp_hwmod,
3007 .addr = omap3xxx_mmu_isp_addrs,
3008 .user = OCP_USER_MPU | OCP_USER_SDMA,
3009};
3010
3011static struct omap_hwmod omap3xxx_mmu_isp_hwmod = {
3012 .name = "mmu_isp",
3013 .class = &omap3xxx_mmu_hwmod_class,
3014 .mpu_irqs = omap3xxx_mmu_isp_irqs,
3015 .main_clk = "cam_ick",
3016 .dev_attr = &mmu_isp_dev_attr,
3017 .flags = HWMOD_NO_IDLEST,
3018};
3019
3020#ifdef CONFIG_OMAP_IOMMU_IVA2
3021
3022/* mmu iva */
3023
3024static struct omap_mmu_dev_attr mmu_iva_dev_attr = {
3025 .da_start = 0x11000000,
3026 .da_end = 0xfffff000,
3027 .nr_tlb_entries = 32,
3028};
3029
3030static struct omap_hwmod omap3xxx_mmu_iva_hwmod;
3031static struct omap_hwmod_irq_info omap3xxx_mmu_iva_irqs[] = {
3032 { .irq = 28 },
3033 { .irq = -1 }
3034};
3035
3036static struct omap_hwmod_rst_info omap3xxx_mmu_iva_resets[] = {
3037 { .name = "mmu", .rst_shift = 1, .st_shift = 9 },
3038};
3039
3040static struct omap_hwmod_addr_space omap3xxx_mmu_iva_addrs[] = {
3041 {
3042 .pa_start = 0x5d000000,
3043 .pa_end = 0x5d00007f,
3044 .flags = ADDR_TYPE_RT,
3045 },
3046 { }
3047};
3048
3049/* l3_main -> iva mmu */
3050static struct omap_hwmod_ocp_if omap3xxx_l3_main__mmu_iva = {
3051 .master = &omap3xxx_l3_main_hwmod,
3052 .slave = &omap3xxx_mmu_iva_hwmod,
3053 .addr = omap3xxx_mmu_iva_addrs,
3054 .user = OCP_USER_MPU | OCP_USER_SDMA,
3055};
3056
3057static struct omap_hwmod omap3xxx_mmu_iva_hwmod = {
3058 .name = "mmu_iva",
3059 .class = &omap3xxx_mmu_hwmod_class,
3060 .mpu_irqs = omap3xxx_mmu_iva_irqs,
3061 .rst_lines = omap3xxx_mmu_iva_resets,
3062 .rst_lines_cnt = ARRAY_SIZE(omap3xxx_mmu_iva_resets),
3063 .main_clk = "iva2_ck",
3064 .prcm = {
3065 .omap2 = {
3066 .module_offs = OMAP3430_IVA2_MOD,
3067 },
3068 },
3069 .dev_attr = &mmu_iva_dev_attr,
3070 .flags = HWMOD_NO_IDLEST,
3071};
3072
3073#endif
3074
2817/* l4_per -> gpio4 */ 3075/* l4_per -> gpio4 */
2818static struct omap_hwmod_addr_space omap3xxx_gpio4_addrs[] = { 3076static struct omap_hwmod_addr_space omap3xxx_gpio4_addrs[] = {
2819 { 3077 {
@@ -3159,6 +3417,15 @@ static struct omap_hwmod_addr_space omap3xxx_counter_32k_addrs[] = {
3159 { } 3417 { }
3160}; 3418};
3161 3419
3420static struct omap_hwmod_addr_space omap3xxx_gpmc_addrs[] = {
3421 {
3422 .pa_start = 0x6e000000,
3423 .pa_end = 0x6e000fff,
3424 .flags = ADDR_TYPE_RT
3425 },
3426 { }
3427};
3428
3162static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__counter_32k = { 3429static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__counter_32k = {
3163 .master = &omap3xxx_l4_wkup_hwmod, 3430 .master = &omap3xxx_l4_wkup_hwmod,
3164 .slave = &omap3xxx_counter_32k_hwmod, 3431 .slave = &omap3xxx_counter_32k_hwmod,
@@ -3214,11 +3481,11 @@ static struct omap_hwmod_ocp_if am35xx_l4_core__mdio = {
3214}; 3481};
3215 3482
3216static struct omap_hwmod_irq_info am35xx_emac_mpu_irqs[] = { 3483static struct omap_hwmod_irq_info am35xx_emac_mpu_irqs[] = {
3217 { .name = "rxthresh", .irq = INT_35XX_EMAC_C0_RXTHRESH_IRQ }, 3484 { .name = "rxthresh", .irq = 67 + OMAP_INTC_START, },
3218 { .name = "rx_pulse", .irq = INT_35XX_EMAC_C0_RX_PULSE_IRQ }, 3485 { .name = "rx_pulse", .irq = 68 + OMAP_INTC_START, },
3219 { .name = "tx_pulse", .irq = INT_35XX_EMAC_C0_TX_PULSE_IRQ }, 3486 { .name = "tx_pulse", .irq = 69 + OMAP_INTC_START },
3220 { .name = "misc_pulse", .irq = INT_35XX_EMAC_C0_MISC_PULSE_IRQ }, 3487 { .name = "misc_pulse", .irq = 70 + OMAP_INTC_START },
3221 { .irq = -1 } 3488 { .irq = -1 },
3222}; 3489};
3223 3490
3224static struct omap_hwmod_class am35xx_emac_class = { 3491static struct omap_hwmod_class am35xx_emac_class = {
@@ -3268,10 +3535,19 @@ static struct omap_hwmod_ocp_if am35xx_l4_core__emac = {
3268 .user = OCP_USER_MPU, 3535 .user = OCP_USER_MPU,
3269}; 3536};
3270 3537
3538static struct omap_hwmod_ocp_if omap3xxx_l3_main__gpmc = {
3539 .master = &omap3xxx_l3_main_hwmod,
3540 .slave = &omap3xxx_gpmc_hwmod,
3541 .clk = "core_l3_ick",
3542 .addr = omap3xxx_gpmc_addrs,
3543 .user = OCP_USER_MPU | OCP_USER_SDMA,
3544};
3545
3271static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = { 3546static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = {
3272 &omap3xxx_l3_main__l4_core, 3547 &omap3xxx_l3_main__l4_core,
3273 &omap3xxx_l3_main__l4_per, 3548 &omap3xxx_l3_main__l4_per,
3274 &omap3xxx_mpu__l3_main, 3549 &omap3xxx_mpu__l3_main,
3550 &omap3xxx_l3_main__l4_debugss,
3275 &omap3xxx_l4_core__l4_wkup, 3551 &omap3xxx_l4_core__l4_wkup,
3276 &omap3xxx_l4_core__mmc3, 3552 &omap3xxx_l4_core__mmc3,
3277 &omap3_l4_core__uart1, 3553 &omap3_l4_core__uart1,
@@ -3313,6 +3589,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = {
3313 &omap34xx_l4_core__mcspi3, 3589 &omap34xx_l4_core__mcspi3,
3314 &omap34xx_l4_core__mcspi4, 3590 &omap34xx_l4_core__mcspi4,
3315 &omap3xxx_l4_wkup__counter_32k, 3591 &omap3xxx_l4_wkup__counter_32k,
3592 &omap3xxx_l3_main__gpmc,
3316 NULL, 3593 NULL,
3317}; 3594};
3318 3595
@@ -3362,6 +3639,11 @@ static struct omap_hwmod_ocp_if *omap34xx_hwmod_ocp_ifs[] __initdata = {
3362 &omap34xx_l4_core__sr2, 3639 &omap34xx_l4_core__sr2,
3363 &omap3xxx_l4_core__mailbox, 3640 &omap3xxx_l4_core__mailbox,
3364 &omap3xxx_l4_core__hdq1w, 3641 &omap3xxx_l4_core__hdq1w,
3642 &omap3xxx_sad2d__l3,
3643 &omap3xxx_l4_core__mmu_isp,
3644#ifdef CONFIG_OMAP_IOMMU_IVA2
3645 &omap3xxx_l3_main__mmu_iva,
3646#endif
3365 NULL 3647 NULL
3366}; 3648};
3367 3649
@@ -3382,6 +3664,11 @@ static struct omap_hwmod_ocp_if *omap36xx_hwmod_ocp_ifs[] __initdata = {
3382 &omap3xxx_l4_core__es3plus_mmc1, 3664 &omap3xxx_l4_core__es3plus_mmc1,
3383 &omap3xxx_l4_core__es3plus_mmc2, 3665 &omap3xxx_l4_core__es3plus_mmc2,
3384 &omap3xxx_l4_core__hdq1w, 3666 &omap3xxx_l4_core__hdq1w,
3667 &omap3xxx_sad2d__l3,
3668 &omap3xxx_l4_core__mmu_isp,
3669#ifdef CONFIG_OMAP_IOMMU_IVA2
3670 &omap3xxx_l3_main__mmu_iva,
3671#endif
3385 NULL 3672 NULL
3386}; 3673};
3387 3674
@@ -3396,6 +3683,7 @@ static struct omap_hwmod_ocp_if *am35xx_hwmod_ocp_ifs[] __initdata = {
3396 &omap3xxx_l4_core__usb_tll_hs, 3683 &omap3xxx_l4_core__usb_tll_hs,
3397 &omap3xxx_l4_core__es3plus_mmc1, 3684 &omap3xxx_l4_core__es3plus_mmc1,
3398 &omap3xxx_l4_core__es3plus_mmc2, 3685 &omap3xxx_l4_core__es3plus_mmc2,
3686 &omap3xxx_l4_core__hdq1w,
3399 &am35xx_mdio__l3, 3687 &am35xx_mdio__l3,
3400 &am35xx_l4_core__mdio, 3688 &am35xx_l4_core__mdio,
3401 &am35xx_emac__l3, 3689 &am35xx_emac__l3,
@@ -3450,7 +3738,7 @@ int __init omap3xxx_hwmod_init(void)
3450 } else { 3738 } else {
3451 WARN(1, "OMAP3 hwmod family init: unknown chip type\n"); 3739 WARN(1, "OMAP3 hwmod family init: unknown chip type\n");
3452 return -EINVAL; 3740 return -EINVAL;
3453 }; 3741 }
3454 3742
3455 r = omap_hwmod_register_links(h); 3743 r = omap_hwmod_register_links(h);
3456 if (r < 0) 3744 if (r < 0)
@@ -3467,7 +3755,7 @@ int __init omap3xxx_hwmod_init(void)
3467 rev == OMAP3430_REV_ES3_0 || rev == OMAP3430_REV_ES3_1 || 3755 rev == OMAP3430_REV_ES3_0 || rev == OMAP3430_REV_ES3_1 ||
3468 rev == OMAP3430_REV_ES3_1_2) { 3756 rev == OMAP3430_REV_ES3_1_2) {
3469 h = omap3430es2plus_hwmod_ocp_ifs; 3757 h = omap3430es2plus_hwmod_ocp_ifs;
3470 }; 3758 }
3471 3759
3472 if (h) { 3760 if (h) {
3473 r = omap_hwmod_register_links(h); 3761 r = omap_hwmod_register_links(h);
@@ -3482,7 +3770,7 @@ int __init omap3xxx_hwmod_init(void)
3482 } else if (rev == OMAP3430_REV_ES3_0 || rev == OMAP3430_REV_ES3_1 || 3770 } else if (rev == OMAP3430_REV_ES3_0 || rev == OMAP3430_REV_ES3_1 ||
3483 rev == OMAP3430_REV_ES3_1_2) { 3771 rev == OMAP3430_REV_ES3_1_2) {
3484 h = omap3430_es3plus_hwmod_ocp_ifs; 3772 h = omap3430_es3plus_hwmod_ocp_ifs;
3485 }; 3773 }
3486 3774
3487 if (h) 3775 if (h)
3488 r = omap_hwmod_register_links(h); 3776 r = omap_hwmod_register_links(h);
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 242aee498ce..652d0285bd6 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -19,18 +19,18 @@
19 */ 19 */
20 20
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/platform_data/gpio-omap.h>
22#include <linux/power/smartreflex.h> 23#include <linux/power/smartreflex.h>
23 24
24#include <plat/omap_hwmod.h> 25#include <plat/omap_hwmod.h>
25#include <plat/cpu.h>
26#include <plat/i2c.h> 26#include <plat/i2c.h>
27#include <plat/gpio.h>
28#include <plat/dma.h> 27#include <plat/dma.h>
29#include <plat/mcspi.h> 28#include <linux/platform_data/spi-omap2-mcspi.h>
30#include <plat/mcbsp.h> 29#include <linux/platform_data/asoc-ti-mcbsp.h>
31#include <plat/mmc.h> 30#include <plat/mmc.h>
32#include <plat/dmtimer.h> 31#include <plat/dmtimer.h>
33#include <plat/common.h> 32#include <plat/common.h>
33#include <plat/iommu.h>
34 34
35#include "omap_hwmod_common_data.h" 35#include "omap_hwmod_common_data.h"
36#include "cm1_44xx.h" 36#include "cm1_44xx.h"
@@ -203,6 +203,9 @@ static struct omap_hwmod omap44xx_l4_abe_hwmod = {
203 .prcm = { 203 .prcm = {
204 .omap4 = { 204 .omap4 = {
205 .clkctrl_offs = OMAP4_CM1_ABE_L4ABE_CLKCTRL_OFFSET, 205 .clkctrl_offs = OMAP4_CM1_ABE_L4ABE_CLKCTRL_OFFSET,
206 .context_offs = OMAP4_RM_ABE_AESS_CONTEXT_OFFSET,
207 .lostcontext_mask = OMAP4430_LOSTMEM_AESSMEM_MASK,
208 .flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT,
206 }, 209 },
207 }, 210 },
208}; 211};
@@ -259,6 +262,11 @@ static struct omap_hwmod omap44xx_mpu_private_hwmod = {
259 .name = "mpu_private", 262 .name = "mpu_private",
260 .class = &omap44xx_mpu_bus_hwmod_class, 263 .class = &omap44xx_mpu_bus_hwmod_class,
261 .clkdm_name = "mpuss_clkdm", 264 .clkdm_name = "mpuss_clkdm",
265 .prcm = {
266 .omap4 = {
267 .flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT,
268 },
269 },
262}; 270};
263 271
264/* 272/*
@@ -343,6 +351,7 @@ static struct omap_hwmod omap44xx_aess_hwmod = {
343 .omap4 = { 351 .omap4 = {
344 .clkctrl_offs = OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET, 352 .clkctrl_offs = OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET,
345 .context_offs = OMAP4_RM_ABE_AESS_CONTEXT_OFFSET, 353 .context_offs = OMAP4_RM_ABE_AESS_CONTEXT_OFFSET,
354 .lostcontext_mask = OMAP4430_LOSTCONTEXT_DFF_MASK,
346 .modulemode = MODULEMODE_SWCTRL, 355 .modulemode = MODULEMODE_SWCTRL,
347 }, 356 },
348 }, 357 },
@@ -447,6 +456,11 @@ static struct omap_hwmod omap44xx_ctrl_module_core_hwmod = {
447 .class = &omap44xx_ctrl_module_hwmod_class, 456 .class = &omap44xx_ctrl_module_hwmod_class,
448 .clkdm_name = "l4_cfg_clkdm", 457 .clkdm_name = "l4_cfg_clkdm",
449 .mpu_irqs = omap44xx_ctrl_module_core_irqs, 458 .mpu_irqs = omap44xx_ctrl_module_core_irqs,
459 .prcm = {
460 .omap4 = {
461 .flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT,
462 },
463 },
450}; 464};
451 465
452/* ctrl_module_pad_core */ 466/* ctrl_module_pad_core */
@@ -454,6 +468,11 @@ static struct omap_hwmod omap44xx_ctrl_module_pad_core_hwmod = {
454 .name = "ctrl_module_pad_core", 468 .name = "ctrl_module_pad_core",
455 .class = &omap44xx_ctrl_module_hwmod_class, 469 .class = &omap44xx_ctrl_module_hwmod_class,
456 .clkdm_name = "l4_cfg_clkdm", 470 .clkdm_name = "l4_cfg_clkdm",
471 .prcm = {
472 .omap4 = {
473 .flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT,
474 },
475 },
457}; 476};
458 477
459/* ctrl_module_wkup */ 478/* ctrl_module_wkup */
@@ -461,6 +480,11 @@ static struct omap_hwmod omap44xx_ctrl_module_wkup_hwmod = {
461 .name = "ctrl_module_wkup", 480 .name = "ctrl_module_wkup",
462 .class = &omap44xx_ctrl_module_hwmod_class, 481 .class = &omap44xx_ctrl_module_hwmod_class,
463 .clkdm_name = "l4_wkup_clkdm", 482 .clkdm_name = "l4_wkup_clkdm",
483 .prcm = {
484 .omap4 = {
485 .flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT,
486 },
487 },
464}; 488};
465 489
466/* ctrl_module_pad_wkup */ 490/* ctrl_module_pad_wkup */
@@ -468,6 +492,11 @@ static struct omap_hwmod omap44xx_ctrl_module_pad_wkup_hwmod = {
468 .name = "ctrl_module_pad_wkup", 492 .name = "ctrl_module_pad_wkup",
469 .class = &omap44xx_ctrl_module_hwmod_class, 493 .class = &omap44xx_ctrl_module_hwmod_class,
470 .clkdm_name = "l4_wkup_clkdm", 494 .clkdm_name = "l4_wkup_clkdm",
495 .prcm = {
496 .omap4 = {
497 .flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT,
498 },
499 },
471}; 500};
472 501
473/* 502/*
@@ -612,7 +641,6 @@ static struct omap_hwmod_irq_info omap44xx_dsp_irqs[] = {
612 641
613static struct omap_hwmod_rst_info omap44xx_dsp_resets[] = { 642static struct omap_hwmod_rst_info omap44xx_dsp_resets[] = {
614 { .name = "dsp", .rst_shift = 0 }, 643 { .name = "dsp", .rst_shift = 0 },
615 { .name = "mmu_cache", .rst_shift = 1 },
616}; 644};
617 645
618static struct omap_hwmod omap44xx_dsp_hwmod = { 646static struct omap_hwmod omap44xx_dsp_hwmod = {
@@ -1324,6 +1352,14 @@ static struct omap_hwmod omap44xx_gpmc_hwmod = {
1324 .name = "gpmc", 1352 .name = "gpmc",
1325 .class = &omap44xx_gpmc_hwmod_class, 1353 .class = &omap44xx_gpmc_hwmod_class,
1326 .clkdm_name = "l3_2_clkdm", 1354 .clkdm_name = "l3_2_clkdm",
1355 /*
1356 * XXX HWMOD_INIT_NO_RESET should not be needed for this IP
1357 * block. It is not being added due to any known bugs with
1358 * resetting the GPMC IP block, but rather because any timings
1359 * set by the bootloader are not being correctly programmed by
1360 * the kernel from the board file or DT data.
1361 * HWMOD_INIT_NO_RESET should be removed ASAP.
1362 */
1327 .flags = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET, 1363 .flags = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET,
1328 .mpu_irqs = omap44xx_gpmc_irqs, 1364 .mpu_irqs = omap44xx_gpmc_irqs,
1329 .sdma_reqs = omap44xx_gpmc_sdma_reqs, 1365 .sdma_reqs = omap44xx_gpmc_sdma_reqs,
@@ -1632,7 +1668,6 @@ static struct omap_hwmod_irq_info omap44xx_ipu_irqs[] = {
1632static struct omap_hwmod_rst_info omap44xx_ipu_resets[] = { 1668static struct omap_hwmod_rst_info omap44xx_ipu_resets[] = {
1633 { .name = "cpu0", .rst_shift = 0 }, 1669 { .name = "cpu0", .rst_shift = 0 },
1634 { .name = "cpu1", .rst_shift = 1 }, 1670 { .name = "cpu1", .rst_shift = 1 },
1635 { .name = "mmu_cache", .rst_shift = 2 },
1636}; 1671};
1637 1672
1638static struct omap_hwmod omap44xx_ipu_hwmod = { 1673static struct omap_hwmod omap44xx_ipu_hwmod = {
@@ -2439,6 +2474,137 @@ static struct omap_hwmod omap44xx_mmc5_hwmod = {
2439}; 2474};
2440 2475
2441/* 2476/*
2477 * 'mmu' class
2478 * The memory management unit performs virtual to physical address translation
2479 * for its requestors.
2480 */
2481
2482static struct omap_hwmod_class_sysconfig mmu_sysc = {
2483 .rev_offs = 0x000,
2484 .sysc_offs = 0x010,
2485 .syss_offs = 0x014,
2486 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
2487 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
2488 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2489 .sysc_fields = &omap_hwmod_sysc_type1,
2490};
2491
2492static struct omap_hwmod_class omap44xx_mmu_hwmod_class = {
2493 .name = "mmu",
2494 .sysc = &mmu_sysc,
2495};
2496
2497/* mmu ipu */
2498
2499static struct omap_mmu_dev_attr mmu_ipu_dev_attr = {
2500 .da_start = 0x0,
2501 .da_end = 0xfffff000,
2502 .nr_tlb_entries = 32,
2503};
2504
2505static struct omap_hwmod omap44xx_mmu_ipu_hwmod;
2506static struct omap_hwmod_irq_info omap44xx_mmu_ipu_irqs[] = {
2507 { .irq = 100 + OMAP44XX_IRQ_GIC_START, },
2508 { .irq = -1 }
2509};
2510
2511static struct omap_hwmod_rst_info omap44xx_mmu_ipu_resets[] = {
2512 { .name = "mmu_cache", .rst_shift = 2 },
2513};
2514
2515static struct omap_hwmod_addr_space omap44xx_mmu_ipu_addrs[] = {
2516 {
2517 .pa_start = 0x55082000,
2518 .pa_end = 0x550820ff,
2519 .flags = ADDR_TYPE_RT,
2520 },
2521 { }
2522};
2523
2524/* l3_main_2 -> mmu_ipu */
2525static struct omap_hwmod_ocp_if omap44xx_l3_main_2__mmu_ipu = {
2526 .master = &omap44xx_l3_main_2_hwmod,
2527 .slave = &omap44xx_mmu_ipu_hwmod,
2528 .clk = "l3_div_ck",
2529 .addr = omap44xx_mmu_ipu_addrs,
2530 .user = OCP_USER_MPU | OCP_USER_SDMA,
2531};
2532
2533static struct omap_hwmod omap44xx_mmu_ipu_hwmod = {
2534 .name = "mmu_ipu",
2535 .class = &omap44xx_mmu_hwmod_class,
2536 .clkdm_name = "ducati_clkdm",
2537 .mpu_irqs = omap44xx_mmu_ipu_irqs,
2538 .rst_lines = omap44xx_mmu_ipu_resets,
2539 .rst_lines_cnt = ARRAY_SIZE(omap44xx_mmu_ipu_resets),
2540 .main_clk = "ducati_clk_mux_ck",
2541 .prcm = {
2542 .omap4 = {
2543 .clkctrl_offs = OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET,
2544 .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET,
2545 .context_offs = OMAP4_RM_DUCATI_DUCATI_CONTEXT_OFFSET,
2546 .modulemode = MODULEMODE_HWCTRL,
2547 },
2548 },
2549 .dev_attr = &mmu_ipu_dev_attr,
2550};
2551
2552/* mmu dsp */
2553
2554static struct omap_mmu_dev_attr mmu_dsp_dev_attr = {
2555 .da_start = 0x0,
2556 .da_end = 0xfffff000,
2557 .nr_tlb_entries = 32,
2558};
2559
2560static struct omap_hwmod omap44xx_mmu_dsp_hwmod;
2561static struct omap_hwmod_irq_info omap44xx_mmu_dsp_irqs[] = {
2562 { .irq = 28 + OMAP44XX_IRQ_GIC_START },
2563 { .irq = -1 }
2564};
2565
2566static struct omap_hwmod_rst_info omap44xx_mmu_dsp_resets[] = {
2567 { .name = "mmu_cache", .rst_shift = 1 },
2568};
2569
2570static struct omap_hwmod_addr_space omap44xx_mmu_dsp_addrs[] = {
2571 {
2572 .pa_start = 0x4a066000,
2573 .pa_end = 0x4a0660ff,
2574 .flags = ADDR_TYPE_RT,
2575 },
2576 { }
2577};
2578
2579/* l4_cfg -> dsp */
2580static struct omap_hwmod_ocp_if omap44xx_l4_cfg__mmu_dsp = {
2581 .master = &omap44xx_l4_cfg_hwmod,
2582 .slave = &omap44xx_mmu_dsp_hwmod,
2583 .clk = "l4_div_ck",
2584 .addr = omap44xx_mmu_dsp_addrs,
2585 .user = OCP_USER_MPU | OCP_USER_SDMA,
2586};
2587
2588static struct omap_hwmod omap44xx_mmu_dsp_hwmod = {
2589 .name = "mmu_dsp",
2590 .class = &omap44xx_mmu_hwmod_class,
2591 .clkdm_name = "tesla_clkdm",
2592 .mpu_irqs = omap44xx_mmu_dsp_irqs,
2593 .rst_lines = omap44xx_mmu_dsp_resets,
2594 .rst_lines_cnt = ARRAY_SIZE(omap44xx_mmu_dsp_resets),
2595 .main_clk = "dpll_iva_m4x2_ck",
2596 .prcm = {
2597 .omap4 = {
2598 .clkctrl_offs = OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET,
2599 .rstctrl_offs = OMAP4_RM_TESLA_RSTCTRL_OFFSET,
2600 .context_offs = OMAP4_RM_TESLA_TESLA_CONTEXT_OFFSET,
2601 .modulemode = MODULEMODE_HWCTRL,
2602 },
2603 },
2604 .dev_attr = &mmu_dsp_dev_attr,
2605};
2606
2607/*
2442 * 'mpu' class 2608 * 'mpu' class
2443 * mpu sub-system 2609 * mpu sub-system
2444 */ 2610 */
@@ -2449,6 +2615,8 @@ static struct omap_hwmod_class omap44xx_mpu_hwmod_class = {
2449 2615
2450/* mpu */ 2616/* mpu */
2451static struct omap_hwmod_irq_info omap44xx_mpu_irqs[] = { 2617static struct omap_hwmod_irq_info omap44xx_mpu_irqs[] = {
2618 { .name = "pmu0", .irq = 54 + OMAP44XX_IRQ_GIC_START },
2619 { .name = "pmu1", .irq = 55 + OMAP44XX_IRQ_GIC_START },
2452 { .name = "pl310", .irq = 0 + OMAP44XX_IRQ_GIC_START }, 2620 { .name = "pl310", .irq = 0 + OMAP44XX_IRQ_GIC_START },
2453 { .name = "cti0", .irq = 1 + OMAP44XX_IRQ_GIC_START }, 2621 { .name = "cti0", .irq = 1 + OMAP44XX_IRQ_GIC_START },
2454 { .name = "cti1", .irq = 2 + OMAP44XX_IRQ_GIC_START }, 2622 { .name = "cti1", .irq = 2 + OMAP44XX_IRQ_GIC_START },
@@ -2498,19 +2666,27 @@ static struct omap_hwmod omap44xx_ocmc_ram_hwmod = {
2498 * protocol 2666 * protocol
2499 */ 2667 */
2500 2668
2669static struct omap_hwmod_class_sysconfig omap44xx_ocp2scp_sysc = {
2670 .rev_offs = 0x0000,
2671 .sysc_offs = 0x0010,
2672 .syss_offs = 0x0014,
2673 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
2674 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
2675 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2676 .sysc_fields = &omap_hwmod_sysc_type1,
2677};
2678
2501static struct omap_hwmod_class omap44xx_ocp2scp_hwmod_class = { 2679static struct omap_hwmod_class omap44xx_ocp2scp_hwmod_class = {
2502 .name = "ocp2scp", 2680 .name = "ocp2scp",
2681 .sysc = &omap44xx_ocp2scp_sysc,
2503}; 2682};
2504 2683
2505/* ocp2scp_usb_phy */ 2684/* ocp2scp_usb_phy */
2506static struct omap_hwmod_opt_clk ocp2scp_usb_phy_opt_clks[] = {
2507 { .role = "phy_48m", .clk = "ocp2scp_usb_phy_phy_48m" },
2508};
2509
2510static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = { 2685static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = {
2511 .name = "ocp2scp_usb_phy", 2686 .name = "ocp2scp_usb_phy",
2512 .class = &omap44xx_ocp2scp_hwmod_class, 2687 .class = &omap44xx_ocp2scp_hwmod_class,
2513 .clkdm_name = "l3_init_clkdm", 2688 .clkdm_name = "l3_init_clkdm",
2689 .main_clk = "ocp2scp_usb_phy_phy_48m",
2514 .prcm = { 2690 .prcm = {
2515 .omap4 = { 2691 .omap4 = {
2516 .clkctrl_offs = OMAP4_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL_OFFSET, 2692 .clkctrl_offs = OMAP4_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL_OFFSET,
@@ -2518,8 +2694,6 @@ static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = {
2518 .modulemode = MODULEMODE_HWCTRL, 2694 .modulemode = MODULEMODE_HWCTRL,
2519 }, 2695 },
2520 }, 2696 },
2521 .opt_clks = ocp2scp_usb_phy_opt_clks,
2522 .opt_clks_cnt = ARRAY_SIZE(ocp2scp_usb_phy_opt_clks),
2523}; 2697};
2524 2698
2525/* 2699/*
@@ -2537,18 +2711,36 @@ static struct omap_hwmod omap44xx_prcm_mpu_hwmod = {
2537 .name = "prcm_mpu", 2711 .name = "prcm_mpu",
2538 .class = &omap44xx_prcm_hwmod_class, 2712 .class = &omap44xx_prcm_hwmod_class,
2539 .clkdm_name = "l4_wkup_clkdm", 2713 .clkdm_name = "l4_wkup_clkdm",
2714 .flags = HWMOD_NO_IDLEST,
2715 .prcm = {
2716 .omap4 = {
2717 .flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT,
2718 },
2719 },
2540}; 2720};
2541 2721
2542/* cm_core_aon */ 2722/* cm_core_aon */
2543static struct omap_hwmod omap44xx_cm_core_aon_hwmod = { 2723static struct omap_hwmod omap44xx_cm_core_aon_hwmod = {
2544 .name = "cm_core_aon", 2724 .name = "cm_core_aon",
2545 .class = &omap44xx_prcm_hwmod_class, 2725 .class = &omap44xx_prcm_hwmod_class,
2726 .flags = HWMOD_NO_IDLEST,
2727 .prcm = {
2728 .omap4 = {
2729 .flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT,
2730 },
2731 },
2546}; 2732};
2547 2733
2548/* cm_core */ 2734/* cm_core */
2549static struct omap_hwmod omap44xx_cm_core_hwmod = { 2735static struct omap_hwmod omap44xx_cm_core_hwmod = {
2550 .name = "cm_core", 2736 .name = "cm_core",
2551 .class = &omap44xx_prcm_hwmod_class, 2737 .class = &omap44xx_prcm_hwmod_class,
2738 .flags = HWMOD_NO_IDLEST,
2739 .prcm = {
2740 .omap4 = {
2741 .flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT,
2742 },
2743 },
2552}; 2744};
2553 2745
2554/* prm */ 2746/* prm */
@@ -2584,6 +2776,11 @@ static struct omap_hwmod omap44xx_scrm_hwmod = {
2584 .name = "scrm", 2776 .name = "scrm",
2585 .class = &omap44xx_scrm_hwmod_class, 2777 .class = &omap44xx_scrm_hwmod_class,
2586 .clkdm_name = "l4_wkup_clkdm", 2778 .clkdm_name = "l4_wkup_clkdm",
2779 .prcm = {
2780 .omap4 = {
2781 .flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT,
2782 },
2783 },
2587}; 2784};
2588 2785
2589/* 2786/*
@@ -2902,6 +3099,16 @@ static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
2902 .timer_capability = OMAP_TIMER_HAS_PWM, 3099 .timer_capability = OMAP_TIMER_HAS_PWM,
2903}; 3100};
2904 3101
3102/* timers with DSP interrupt dev attribute */
3103static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = {
3104 .timer_capability = OMAP_TIMER_HAS_DSP_IRQ,
3105};
3106
3107/* pwm timers with DSP interrupt dev attribute */
3108static struct omap_timer_capability_dev_attr capability_dsp_pwm_dev_attr = {
3109 .timer_capability = OMAP_TIMER_HAS_DSP_IRQ | OMAP_TIMER_HAS_PWM,
3110};
3111
2905/* timer1 */ 3112/* timer1 */
2906static struct omap_hwmod_irq_info omap44xx_timer1_irqs[] = { 3113static struct omap_hwmod_irq_info omap44xx_timer1_irqs[] = {
2907 { .irq = 37 + OMAP44XX_IRQ_GIC_START }, 3114 { .irq = 37 + OMAP44XX_IRQ_GIC_START },
@@ -3006,6 +3213,7 @@ static struct omap_hwmod omap44xx_timer5_hwmod = {
3006 .modulemode = MODULEMODE_SWCTRL, 3213 .modulemode = MODULEMODE_SWCTRL,
3007 }, 3214 },
3008 }, 3215 },
3216 .dev_attr = &capability_dsp_dev_attr,
3009}; 3217};
3010 3218
3011/* timer6 */ 3219/* timer6 */
@@ -3028,6 +3236,7 @@ static struct omap_hwmod omap44xx_timer6_hwmod = {
3028 .modulemode = MODULEMODE_SWCTRL, 3236 .modulemode = MODULEMODE_SWCTRL,
3029 }, 3237 },
3030 }, 3238 },
3239 .dev_attr = &capability_dsp_dev_attr,
3031}; 3240};
3032 3241
3033/* timer7 */ 3242/* timer7 */
@@ -3049,6 +3258,7 @@ static struct omap_hwmod omap44xx_timer7_hwmod = {
3049 .modulemode = MODULEMODE_SWCTRL, 3258 .modulemode = MODULEMODE_SWCTRL,
3050 }, 3259 },
3051 }, 3260 },
3261 .dev_attr = &capability_dsp_dev_attr,
3052}; 3262};
3053 3263
3054/* timer8 */ 3264/* timer8 */
@@ -3070,7 +3280,7 @@ static struct omap_hwmod omap44xx_timer8_hwmod = {
3070 .modulemode = MODULEMODE_SWCTRL, 3280 .modulemode = MODULEMODE_SWCTRL,
3071 }, 3281 },
3072 }, 3282 },
3073 .dev_attr = &capability_pwm_dev_attr, 3283 .dev_attr = &capability_dsp_pwm_dev_attr,
3074}; 3284};
3075 3285
3076/* timer9 */ 3286/* timer9 */
@@ -4210,7 +4420,7 @@ static struct omap_hwmod_ocp_if omap44xx_dsp__iva = {
4210}; 4420};
4211 4421
4212/* dsp -> sl2if */ 4422/* dsp -> sl2if */
4213static struct omap_hwmod_ocp_if omap44xx_dsp__sl2if = { 4423static struct omap_hwmod_ocp_if __maybe_unused omap44xx_dsp__sl2if = {
4214 .master = &omap44xx_dsp_hwmod, 4424 .master = &omap44xx_dsp_hwmod,
4215 .slave = &omap44xx_sl2if_hwmod, 4425 .slave = &omap44xx_sl2if_hwmod,
4216 .clk = "dpll_iva_m5x2_ck", 4426 .clk = "dpll_iva_m5x2_ck",
@@ -4828,7 +5038,7 @@ static struct omap_hwmod_ocp_if omap44xx_l3_main_2__iss = {
4828}; 5038};
4829 5039
4830/* iva -> sl2if */ 5040/* iva -> sl2if */
4831static struct omap_hwmod_ocp_if omap44xx_iva__sl2if = { 5041static struct omap_hwmod_ocp_if __maybe_unused omap44xx_iva__sl2if = {
4832 .master = &omap44xx_iva_hwmod, 5042 .master = &omap44xx_iva_hwmod,
4833 .slave = &omap44xx_sl2if_hwmod, 5043 .slave = &omap44xx_sl2if_hwmod,
4834 .clk = "dpll_iva_m5x2_ck", 5044 .clk = "dpll_iva_m5x2_ck",
@@ -5059,6 +5269,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_per__mcbsp4 = {
5059 5269
5060static struct omap_hwmod_addr_space omap44xx_mcpdm_addrs[] = { 5270static struct omap_hwmod_addr_space omap44xx_mcpdm_addrs[] = {
5061 { 5271 {
5272 .name = "mpu",
5062 .pa_start = 0x40132000, 5273 .pa_start = 0x40132000,
5063 .pa_end = 0x4013207f, 5274 .pa_end = 0x4013207f,
5064 .flags = ADDR_TYPE_RT 5275 .flags = ADDR_TYPE_RT
@@ -5077,6 +5288,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcpdm = {
5077 5288
5078static struct omap_hwmod_addr_space omap44xx_mcpdm_dma_addrs[] = { 5289static struct omap_hwmod_addr_space omap44xx_mcpdm_dma_addrs[] = {
5079 { 5290 {
5291 .name = "dma",
5080 .pa_start = 0x49032000, 5292 .pa_start = 0x49032000,
5081 .pa_end = 0x4903207f, 5293 .pa_end = 0x4903207f,
5082 .flags = ADDR_TYPE_RT 5294 .flags = ADDR_TYPE_RT
@@ -5263,11 +5475,21 @@ static struct omap_hwmod_ocp_if omap44xx_l3_main_2__ocmc_ram = {
5263 .user = OCP_USER_MPU | OCP_USER_SDMA, 5475 .user = OCP_USER_MPU | OCP_USER_SDMA,
5264}; 5476};
5265 5477
5478static struct omap_hwmod_addr_space omap44xx_ocp2scp_usb_phy_addrs[] = {
5479 {
5480 .pa_start = 0x4a0ad000,
5481 .pa_end = 0x4a0ad01f,
5482 .flags = ADDR_TYPE_RT
5483 },
5484 { }
5485};
5486
5266/* l4_cfg -> ocp2scp_usb_phy */ 5487/* l4_cfg -> ocp2scp_usb_phy */
5267static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ocp2scp_usb_phy = { 5488static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ocp2scp_usb_phy = {
5268 .master = &omap44xx_l4_cfg_hwmod, 5489 .master = &omap44xx_l4_cfg_hwmod,
5269 .slave = &omap44xx_ocp2scp_usb_phy_hwmod, 5490 .slave = &omap44xx_ocp2scp_usb_phy_hwmod,
5270 .clk = "l4_div_ck", 5491 .clk = "l4_div_ck",
5492 .addr = omap44xx_ocp2scp_usb_phy_addrs,
5271 .user = OCP_USER_MPU | OCP_USER_SDMA, 5493 .user = OCP_USER_MPU | OCP_USER_SDMA,
5272}; 5494};
5273 5495
@@ -5362,7 +5584,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_wkup__scrm = {
5362}; 5584};
5363 5585
5364/* l3_main_2 -> sl2if */ 5586/* l3_main_2 -> sl2if */
5365static struct omap_hwmod_ocp_if omap44xx_l3_main_2__sl2if = { 5587static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l3_main_2__sl2if = {
5366 .master = &omap44xx_l3_main_2_hwmod, 5588 .master = &omap44xx_l3_main_2_hwmod,
5367 .slave = &omap44xx_sl2if_hwmod, 5589 .slave = &omap44xx_sl2if_hwmod,
5368 .clk = "l3_div_ck", 5590 .clk = "l3_div_ck",
@@ -5887,7 +6109,13 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_host_hs = {
5887static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { 6109static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
5888 { 6110 {
5889 .pa_start = 0x4a0ab000, 6111 .pa_start = 0x4a0ab000,
5890 .pa_end = 0x4a0ab003, 6112 .pa_end = 0x4a0ab7ff,
6113 .flags = ADDR_TYPE_RT
6114 },
6115 {
6116 /* XXX: Remove this once control module driver is in place */
6117 .pa_start = 0x4a00233c,
6118 .pa_end = 0x4a00233f,
5891 .flags = ADDR_TYPE_RT 6119 .flags = ADDR_TYPE_RT
5892 }, 6120 },
5893 { } 6121 { }
@@ -6032,7 +6260,7 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
6032 &omap44xx_l4_abe__dmic, 6260 &omap44xx_l4_abe__dmic,
6033 &omap44xx_l4_abe__dmic_dma, 6261 &omap44xx_l4_abe__dmic_dma,
6034 &omap44xx_dsp__iva, 6262 &omap44xx_dsp__iva,
6035 &omap44xx_dsp__sl2if, 6263 /* &omap44xx_dsp__sl2if, */
6036 &omap44xx_l4_cfg__dsp, 6264 &omap44xx_l4_cfg__dsp,
6037 &omap44xx_l3_main_2__dss, 6265 &omap44xx_l3_main_2__dss,
6038 &omap44xx_l4_per__dss, 6266 &omap44xx_l4_per__dss,
@@ -6068,7 +6296,7 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
6068 &omap44xx_l4_per__i2c4, 6296 &omap44xx_l4_per__i2c4,
6069 &omap44xx_l3_main_2__ipu, 6297 &omap44xx_l3_main_2__ipu,
6070 &omap44xx_l3_main_2__iss, 6298 &omap44xx_l3_main_2__iss,
6071 &omap44xx_iva__sl2if, 6299 /* &omap44xx_iva__sl2if, */
6072 &omap44xx_l3_main_2__iva, 6300 &omap44xx_l3_main_2__iva,
6073 &omap44xx_l4_wkup__kbd, 6301 &omap44xx_l4_wkup__kbd,
6074 &omap44xx_l4_cfg__mailbox, 6302 &omap44xx_l4_cfg__mailbox,
@@ -6092,6 +6320,8 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
6092 &omap44xx_l4_per__mmc3, 6320 &omap44xx_l4_per__mmc3,
6093 &omap44xx_l4_per__mmc4, 6321 &omap44xx_l4_per__mmc4,
6094 &omap44xx_l4_per__mmc5, 6322 &omap44xx_l4_per__mmc5,
6323 &omap44xx_l3_main_2__mmu_ipu,
6324 &omap44xx_l4_cfg__mmu_dsp,
6095 &omap44xx_l3_main_2__ocmc_ram, 6325 &omap44xx_l3_main_2__ocmc_ram,
6096 &omap44xx_l4_cfg__ocp2scp_usb_phy, 6326 &omap44xx_l4_cfg__ocp2scp_usb_phy,
6097 &omap44xx_mpu_private__prcm_mpu, 6327 &omap44xx_mpu_private__prcm_mpu,
@@ -6099,7 +6329,7 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
6099 &omap44xx_l4_cfg__cm_core, 6329 &omap44xx_l4_cfg__cm_core,
6100 &omap44xx_l4_wkup__prm, 6330 &omap44xx_l4_wkup__prm,
6101 &omap44xx_l4_wkup__scrm, 6331 &omap44xx_l4_wkup__scrm,
6102 &omap44xx_l3_main_2__sl2if, 6332 /* &omap44xx_l3_main_2__sl2if, */
6103 &omap44xx_l4_abe__slimbus1, 6333 &omap44xx_l4_abe__slimbus1,
6104 &omap44xx_l4_abe__slimbus1_dma, 6334 &omap44xx_l4_abe__slimbus1_dma,
6105 &omap44xx_l4_per__slimbus2, 6335 &omap44xx_l4_per__slimbus2,
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.h b/arch/arm/mach-omap2/omap_hwmod_common_data.h
index e7e8eeae95e..2bc8f1705d4 100644
--- a/arch/arm/mach-omap2/omap_hwmod_common_data.h
+++ b/arch/arm/mach-omap2/omap_hwmod_common_data.h
@@ -2,9 +2,8 @@
2 * omap_hwmod_common_data.h - OMAP hwmod common macros and declarations 2 * omap_hwmod_common_data.h - OMAP hwmod common macros and declarations
3 * 3 *
4 * Copyright (C) 2010-2011 Nokia Corporation 4 * Copyright (C) 2010-2011 Nokia Corporation
5 * Copyright (C) 2010-2012 Texas Instruments, Inc.
5 * Paul Walmsley 6 * Paul Walmsley
6 *
7 * Copyright (C) 2010-2011 Texas Instruments, Inc.
8 * Benoît Cousson 7 * Benoît Cousson
9 * 8 *
10 * 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
@@ -16,6 +15,7 @@
16 15
17#include <plat/omap_hwmod.h> 16#include <plat/omap_hwmod.h>
18 17
18#include "common.h"
19#include "display.h" 19#include "display.h"
20 20
21/* Common address space across OMAP2xxx */ 21/* Common address space across OMAP2xxx */
@@ -76,6 +76,8 @@ extern struct omap_hwmod omap2xxx_gpio4_hwmod;
76extern struct omap_hwmod omap2xxx_mcspi1_hwmod; 76extern struct omap_hwmod omap2xxx_mcspi1_hwmod;
77extern struct omap_hwmod omap2xxx_mcspi2_hwmod; 77extern struct omap_hwmod omap2xxx_mcspi2_hwmod;
78extern struct omap_hwmod omap2xxx_counter_32k_hwmod; 78extern struct omap_hwmod omap2xxx_counter_32k_hwmod;
79extern struct omap_hwmod omap2xxx_gpmc_hwmod;
80extern struct omap_hwmod omap2xxx_rng_hwmod;
79 81
80/* Common interface data across OMAP2xxx */ 82/* Common interface data across OMAP2xxx */
81extern struct omap_hwmod_ocp_if omap2xxx_l3_main__l4_core; 83extern struct omap_hwmod_ocp_if omap2xxx_l3_main__l4_core;
@@ -102,6 +104,7 @@ extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss;
102extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_dispc; 104extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_dispc;
103extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_rfbi; 105extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_rfbi;
104extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_venc; 106extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_venc;
107extern struct omap_hwmod_ocp_if omap2xxx_l4_core__rng;
105 108
106/* Common IP block data */ 109/* Common IP block data */
107extern struct omap_hwmod_dma_info omap2_uart1_sdma_reqs[]; 110extern struct omap_hwmod_dma_info omap2_uart1_sdma_reqs[];
diff --git a/arch/arm/mach-omap2/omap_l3_noc.c b/arch/arm/mach-omap2/omap_l3_noc.c
deleted file mode 100644
index d15225ff5c4..00000000000
--- a/arch/arm/mach-omap2/omap_l3_noc.c
+++ /dev/null
@@ -1,266 +0,0 @@
1/*
2 * OMAP4XXX L3 Interconnect error handling driver
3 *
4 * Copyright (C) 2011 Texas Corporation
5 * Santosh Shilimkar <santosh.shilimkar@ti.com>
6 * Sricharan <r.sricharan@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
22 */
23#include <linux/module.h>
24#include <linux/init.h>
25#include <linux/io.h>
26#include <linux/platform_device.h>
27#include <linux/interrupt.h>
28#include <linux/kernel.h>
29#include <linux/slab.h>
30
31#include "omap_l3_noc.h"
32
33/*
34 * Interrupt Handler for L3 error detection.
35 * 1) Identify the L3 clockdomain partition to which the error belongs to.
36 * 2) Identify the slave where the error information is logged
37 * 3) Print the logged information.
38 * 4) Add dump stack to provide kernel trace.
39 *
40 * Two Types of errors :
41 * 1) Custom errors in L3 :
42 * Target like DMM/FW/EMIF generates SRESP=ERR error
43 * 2) Standard L3 error:
44 * - Unsupported CMD.
45 * L3 tries to access target while it is idle
46 * - OCP disconnect.
47 * - Address hole error:
48 * If DSS/ISS/FDIF/USBHOSTFS access a target where they
49 * do not have connectivity, the error is logged in
50 * their default target which is DMM2.
51 *
52 * On High Secure devices, firewall errors are possible and those
53 * can be trapped as well. But the trapping is implemented as part
54 * secure software and hence need not be implemented here.
55 */
56static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
57{
58
59 struct omap4_l3 *l3 = _l3;
60 int inttype, i, k;
61 int err_src = 0;
62 u32 std_err_main, err_reg, clear, masterid;
63 void __iomem *base, *l3_targ_base;
64 char *target_name, *master_name = "UN IDENTIFIED";
65
66 /* Get the Type of interrupt */
67 inttype = irq == l3->app_irq ? L3_APPLICATION_ERROR : L3_DEBUG_ERROR;
68
69 for (i = 0; i < L3_MODULES; i++) {
70 /*
71 * Read the regerr register of the clock domain
72 * to determine the source
73 */
74 base = l3->l3_base[i];
75 err_reg = __raw_readl(base + l3_flagmux[i] +
76 + L3_FLAGMUX_REGERR0 + (inttype << 3));
77
78 /* Get the corresponding error and analyse */
79 if (err_reg) {
80 /* Identify the source from control status register */
81 err_src = __ffs(err_reg);
82
83 /* Read the stderrlog_main_source from clk domain */
84 l3_targ_base = base + *(l3_targ[i] + err_src);
85 std_err_main = __raw_readl(l3_targ_base +
86 L3_TARG_STDERRLOG_MAIN);
87 masterid = __raw_readl(l3_targ_base +
88 L3_TARG_STDERRLOG_MSTADDR);
89
90 switch (std_err_main & CUSTOM_ERROR) {
91 case STANDARD_ERROR:
92 target_name =
93 l3_targ_inst_name[i][err_src];
94 WARN(true, "L3 standard error: TARGET:%s at address 0x%x\n",
95 target_name,
96 __raw_readl(l3_targ_base +
97 L3_TARG_STDERRLOG_SLVOFSLSB));
98 /* clear the std error log*/
99 clear = std_err_main | CLEAR_STDERR_LOG;
100 writel(clear, l3_targ_base +
101 L3_TARG_STDERRLOG_MAIN);
102 break;
103
104 case CUSTOM_ERROR:
105 target_name =
106 l3_targ_inst_name[i][err_src];
107 for (k = 0; k < NUM_OF_L3_MASTERS; k++) {
108 if (masterid == l3_masters[k].id)
109 master_name =
110 l3_masters[k].name;
111 }
112 WARN(true, "L3 custom error: MASTER:%s TARGET:%s\n",
113 master_name, target_name);
114 /* clear the std error log*/
115 clear = std_err_main | CLEAR_STDERR_LOG;
116 writel(clear, l3_targ_base +
117 L3_TARG_STDERRLOG_MAIN);
118 break;
119
120 default:
121 /* Nothing to be handled here as of now */
122 break;
123 }
124 /* Error found so break the for loop */
125 break;
126 }
127 }
128 return IRQ_HANDLED;
129}
130
131static int __devinit omap4_l3_probe(struct platform_device *pdev)
132{
133 static struct omap4_l3 *l3;
134 struct resource *res;
135 int ret;
136
137 l3 = kzalloc(sizeof(*l3), GFP_KERNEL);
138 if (!l3)
139 return -ENOMEM;
140
141 platform_set_drvdata(pdev, l3);
142 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
143 if (!res) {
144 dev_err(&pdev->dev, "couldn't find resource 0\n");
145 ret = -ENODEV;
146 goto err0;
147 }
148
149 l3->l3_base[0] = ioremap(res->start, resource_size(res));
150 if (!l3->l3_base[0]) {
151 dev_err(&pdev->dev, "ioremap failed\n");
152 ret = -ENOMEM;
153 goto err0;
154 }
155
156 res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
157 if (!res) {
158 dev_err(&pdev->dev, "couldn't find resource 1\n");
159 ret = -ENODEV;
160 goto err1;
161 }
162
163 l3->l3_base[1] = ioremap(res->start, resource_size(res));
164 if (!l3->l3_base[1]) {
165 dev_err(&pdev->dev, "ioremap failed\n");
166 ret = -ENOMEM;
167 goto err1;
168 }
169
170 res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
171 if (!res) {
172 dev_err(&pdev->dev, "couldn't find resource 2\n");
173 ret = -ENODEV;
174 goto err2;
175 }
176
177 l3->l3_base[2] = ioremap(res->start, resource_size(res));
178 if (!l3->l3_base[2]) {
179 dev_err(&pdev->dev, "ioremap failed\n");
180 ret = -ENOMEM;
181 goto err2;
182 }
183
184 /*
185 * Setup interrupt Handlers
186 */
187 l3->debug_irq = platform_get_irq(pdev, 0);
188 ret = request_irq(l3->debug_irq,
189 l3_interrupt_handler,
190 IRQF_DISABLED, "l3-dbg-irq", l3);
191 if (ret) {
192 pr_crit("L3: request_irq failed to register for 0x%x\n",
193 OMAP44XX_IRQ_L3_DBG);
194 goto err3;
195 }
196
197 l3->app_irq = platform_get_irq(pdev, 1);
198 ret = request_irq(l3->app_irq,
199 l3_interrupt_handler,
200 IRQF_DISABLED, "l3-app-irq", l3);
201 if (ret) {
202 pr_crit("L3: request_irq failed to register for 0x%x\n",
203 OMAP44XX_IRQ_L3_APP);
204 goto err4;
205 }
206
207 return 0;
208
209err4:
210 free_irq(l3->debug_irq, l3);
211err3:
212 iounmap(l3->l3_base[2]);
213err2:
214 iounmap(l3->l3_base[1]);
215err1:
216 iounmap(l3->l3_base[0]);
217err0:
218 kfree(l3);
219 return ret;
220}
221
222static int __devexit omap4_l3_remove(struct platform_device *pdev)
223{
224 struct omap4_l3 *l3 = platform_get_drvdata(pdev);
225
226 free_irq(l3->app_irq, l3);
227 free_irq(l3->debug_irq, l3);
228 iounmap(l3->l3_base[0]);
229 iounmap(l3->l3_base[1]);
230 iounmap(l3->l3_base[2]);
231 kfree(l3);
232
233 return 0;
234}
235
236#if defined(CONFIG_OF)
237static const struct of_device_id l3_noc_match[] = {
238 {.compatible = "ti,omap4-l3-noc", },
239 {},
240};
241MODULE_DEVICE_TABLE(of, l3_noc_match);
242#else
243#define l3_noc_match NULL
244#endif
245
246static struct platform_driver omap4_l3_driver = {
247 .probe = omap4_l3_probe,
248 .remove = __devexit_p(omap4_l3_remove),
249 .driver = {
250 .name = "omap_l3_noc",
251 .owner = THIS_MODULE,
252 .of_match_table = l3_noc_match,
253 },
254};
255
256static int __init omap4_l3_init(void)
257{
258 return platform_driver_register(&omap4_l3_driver);
259}
260postcore_initcall_sync(omap4_l3_init);
261
262static void __exit omap4_l3_exit(void)
263{
264 platform_driver_unregister(&omap4_l3_driver);
265}
266module_exit(omap4_l3_exit);
diff --git a/arch/arm/mach-omap2/omap_l3_noc.h b/arch/arm/mach-omap2/omap_l3_noc.h
deleted file mode 100644
index a6ce34dc481..00000000000
--- a/arch/arm/mach-omap2/omap_l3_noc.h
+++ /dev/null
@@ -1,176 +0,0 @@
1/*
2 * OMAP4XXX L3 Interconnect error handling driver header
3 *
4 * Copyright (C) 2011 Texas Corporation
5 * Santosh Shilimkar <santosh.shilimkar@ti.com>
6 * sricharan <r.sricharan@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
22 */
23#ifndef __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
24#define __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
25
26#define L3_MODULES 3
27#define CLEAR_STDERR_LOG (1 << 31)
28#define CUSTOM_ERROR 0x2
29#define STANDARD_ERROR 0x0
30#define INBAND_ERROR 0x0
31#define L3_APPLICATION_ERROR 0x0
32#define L3_DEBUG_ERROR 0x1
33
34/* L3 TARG register offsets */
35#define L3_TARG_STDERRLOG_MAIN 0x48
36#define L3_TARG_STDERRLOG_SLVOFSLSB 0x5c
37#define L3_TARG_STDERRLOG_MSTADDR 0x68
38#define L3_FLAGMUX_REGERR0 0xc
39
40#define NUM_OF_L3_MASTERS (sizeof(l3_masters)/sizeof(l3_masters[0]))
41
42static u32 l3_flagmux[L3_MODULES] = {
43 0x500,
44 0x1000,
45 0X0200
46};
47
48/* L3 Target standard Error register offsets */
49static u32 l3_targ_inst_clk1[] = {
50 0x100, /* DMM1 */
51 0x200, /* DMM2 */
52 0x300, /* ABE */
53 0x400, /* L4CFG */
54 0x600, /* CLK2 PWR DISC */
55 0x0, /* Host CLK1 */
56 0x900 /* L4 Wakeup */
57};
58
59static u32 l3_targ_inst_clk2[] = {
60 0x500, /* CORTEX M3 */
61 0x300, /* DSS */
62 0x100, /* GPMC */
63 0x400, /* ISS */
64 0x700, /* IVAHD */
65 0xD00, /* missing in TRM corresponds to AES1*/
66 0x900, /* L4 PER0*/
67 0x200, /* OCMRAM */
68 0x100, /* missing in TRM corresponds to GPMC sERROR*/
69 0x600, /* SGX */
70 0x800, /* SL2 */
71 0x1600, /* C2C */
72 0x1100, /* missing in TRM corresponds PWR DISC CLK1*/
73 0xF00, /* missing in TRM corrsponds to SHA1*/
74 0xE00, /* missing in TRM corresponds to AES2*/
75 0xC00, /* L4 PER3 */
76 0xA00, /* L4 PER1*/
77 0xB00, /* L4 PER2*/
78 0x0, /* HOST CLK2 */
79 0x1800, /* CAL */
80 0x1700 /* LLI */
81};
82
83static u32 l3_targ_inst_clk3[] = {
84 0x0100 /* EMUSS */,
85 0x0300, /* DEBUGSS_CT_TBR */
86 0x0 /* HOST CLK3 */
87};
88
89static struct l3_masters_data {
90 u32 id;
91 char name[10];
92} l3_masters[] = {
93 { 0x0 , "MPU"},
94 { 0x10, "CS_ADP"},
95 { 0x14, "xxx"},
96 { 0x20, "DSP"},
97 { 0x30, "IVAHD"},
98 { 0x40, "ISS"},
99 { 0x44, "DucatiM3"},
100 { 0x48, "FaceDetect"},
101 { 0x50, "SDMA_Rd"},
102 { 0x54, "SDMA_Wr"},
103 { 0x58, "xxx"},
104 { 0x5C, "xxx"},
105 { 0x60, "SGX"},
106 { 0x70, "DSS"},
107 { 0x80, "C2C"},
108 { 0x88, "xxx"},
109 { 0x8C, "xxx"},
110 { 0x90, "HSI"},
111 { 0xA0, "MMC1"},
112 { 0xA4, "MMC2"},
113 { 0xA8, "MMC6"},
114 { 0xB0, "UNIPRO1"},
115 { 0xC0, "USBHOSTHS"},
116 { 0xC4, "USBOTGHS"},
117 { 0xC8, "USBHOSTFS"}
118};
119
120static char *l3_targ_inst_name[L3_MODULES][21] = {
121 {
122 "DMM1",
123 "DMM2",
124 "ABE",
125 "L4CFG",
126 "CLK2 PWR DISC",
127 "HOST CLK1",
128 "L4 WAKEUP"
129 },
130 {
131 "CORTEX M3" ,
132 "DSS ",
133 "GPMC ",
134 "ISS ",
135 "IVAHD ",
136 "AES1",
137 "L4 PER0",
138 "OCMRAM ",
139 "GPMC sERROR",
140 "SGX ",
141 "SL2 ",
142 "C2C ",
143 "PWR DISC CLK1",
144 "SHA1",
145 "AES2",
146 "L4 PER3",
147 "L4 PER1",
148 "L4 PER2",
149 "HOST CLK2",
150 "CAL",
151 "LLI"
152 },
153 {
154 "EMUSS",
155 "DEBUG SOURCE",
156 "HOST CLK3"
157 },
158};
159
160static u32 *l3_targ[L3_MODULES] = {
161 l3_targ_inst_clk1,
162 l3_targ_inst_clk2,
163 l3_targ_inst_clk3,
164};
165
166struct omap4_l3 {
167 struct device *dev;
168 struct clk *ick;
169
170 /* memory base */
171 void __iomem *l3_base[L3_MODULES];
172
173 int debug_irq;
174 int app_irq;
175};
176#endif
diff --git a/arch/arm/mach-omap2/omap_l3_smx.c b/arch/arm/mach-omap2/omap_l3_smx.c
deleted file mode 100644
index acc216491b8..00000000000
--- a/arch/arm/mach-omap2/omap_l3_smx.c
+++ /dev/null
@@ -1,297 +0,0 @@
1/*
2 * OMAP3XXX L3 Interconnect Driver
3 *
4 * Copyright (C) 2011 Texas Corporation
5 * Felipe Balbi <balbi@ti.com>
6 * Santosh Shilimkar <santosh.shilimkar@ti.com>
7 * Sricharan <r.sricharan@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 */
24
25#include <linux/kernel.h>
26#include <linux/slab.h>
27#include <linux/platform_device.h>
28#include <linux/interrupt.h>
29#include <linux/io.h>
30#include "omap_l3_smx.h"
31
32static inline u64 omap3_l3_readll(void __iomem *base, u16 reg)
33{
34 return __raw_readll(base + reg);
35}
36
37static inline void omap3_l3_writell(void __iomem *base, u16 reg, u64 value)
38{
39 __raw_writell(value, base + reg);
40}
41
42static inline enum omap3_l3_code omap3_l3_decode_error_code(u64 error)
43{
44 return (error & 0x0f000000) >> L3_ERROR_LOG_CODE;
45}
46
47static inline u32 omap3_l3_decode_addr(u64 error_addr)
48{
49 return error_addr & 0xffffffff;
50}
51
52static inline unsigned omap3_l3_decode_cmd(u64 error)
53{
54 return (error & 0x07) >> L3_ERROR_LOG_CMD;
55}
56
57static inline enum omap3_l3_initiator_id omap3_l3_decode_initid(u64 error)
58{
59 return (error & 0xff00) >> L3_ERROR_LOG_INITID;
60}
61
62static inline unsigned omap3_l3_decode_req_info(u64 error)
63{
64 return (error >> 32) & 0xffff;
65}
66
67static char *omap3_l3_code_string(u8 code)
68{
69 switch (code) {
70 case OMAP_L3_CODE_NOERROR:
71 return "No Error";
72 case OMAP_L3_CODE_UNSUP_CMD:
73 return "Unsupported Command";
74 case OMAP_L3_CODE_ADDR_HOLE:
75 return "Address Hole";
76 case OMAP_L3_CODE_PROTECT_VIOLATION:
77 return "Protection Violation";
78 case OMAP_L3_CODE_IN_BAND_ERR:
79 return "In-band Error";
80 case OMAP_L3_CODE_REQ_TOUT_NOT_ACCEPT:
81 return "Request Timeout Not Accepted";
82 case OMAP_L3_CODE_REQ_TOUT_NO_RESP:
83 return "Request Timeout, no response";
84 default:
85 return "UNKNOWN error";
86 }
87}
88
89static char *omap3_l3_initiator_string(u8 initid)
90{
91 switch (initid) {
92 case OMAP_L3_LCD:
93 return "LCD";
94 case OMAP_L3_SAD2D:
95 return "SAD2D";
96 case OMAP_L3_IA_MPU_SS_1:
97 case OMAP_L3_IA_MPU_SS_2:
98 case OMAP_L3_IA_MPU_SS_3:
99 case OMAP_L3_IA_MPU_SS_4:
100 case OMAP_L3_IA_MPU_SS_5:
101 return "MPU";
102 case OMAP_L3_IA_IVA_SS_1:
103 case OMAP_L3_IA_IVA_SS_2:
104 case OMAP_L3_IA_IVA_SS_3:
105 return "IVA_SS";
106 case OMAP_L3_IA_IVA_SS_DMA_1:
107 case OMAP_L3_IA_IVA_SS_DMA_2:
108 case OMAP_L3_IA_IVA_SS_DMA_3:
109 case OMAP_L3_IA_IVA_SS_DMA_4:
110 case OMAP_L3_IA_IVA_SS_DMA_5:
111 case OMAP_L3_IA_IVA_SS_DMA_6:
112 return "IVA_SS_DMA";
113 case OMAP_L3_IA_SGX:
114 return "SGX";
115 case OMAP_L3_IA_CAM_1:
116 case OMAP_L3_IA_CAM_2:
117 case OMAP_L3_IA_CAM_3:
118 return "CAM";
119 case OMAP_L3_IA_DAP:
120 return "DAP";
121 case OMAP_L3_SDMA_WR_1:
122 case OMAP_L3_SDMA_WR_2:
123 return "SDMA_WR";
124 case OMAP_L3_SDMA_RD_1:
125 case OMAP_L3_SDMA_RD_2:
126 case OMAP_L3_SDMA_RD_3:
127 case OMAP_L3_SDMA_RD_4:
128 return "SDMA_RD";
129 case OMAP_L3_USBOTG:
130 return "USB_OTG";
131 case OMAP_L3_USBHOST:
132 return "USB_HOST";
133 default:
134 return "UNKNOWN Initiator";
135 }
136}
137
138/*
139 * omap3_l3_block_irq - handles a register block's irq
140 * @l3: struct omap3_l3 *
141 * @base: register block base address
142 * @error: L3_ERROR_LOG register of our block
143 *
144 * Called in hard-irq context. Caller should take care of locking
145 *
146 * OMAP36xx TRM gives, on page 2001, Figure 9-10, the Typical Error
147 * Analysis Sequence, we are following that sequence here, please
148 * refer to that Figure for more information on the subject.
149 */
150static irqreturn_t omap3_l3_block_irq(struct omap3_l3 *l3,
151 u64 error, int error_addr)
152{
153 u8 code = omap3_l3_decode_error_code(error);
154 u8 initid = omap3_l3_decode_initid(error);
155 u8 multi = error & L3_ERROR_LOG_MULTI;
156 u32 address = omap3_l3_decode_addr(error_addr);
157
158 pr_err("%s seen by %s %s at address %x\n",
159 omap3_l3_code_string(code),
160 omap3_l3_initiator_string(initid),
161 multi ? "Multiple Errors" : "", address);
162 WARN_ON(1);
163
164 return IRQ_HANDLED;
165}
166
167static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
168{
169 struct omap3_l3 *l3 = _l3;
170 u64 status, clear;
171 u64 error;
172 u64 error_addr;
173 u64 err_source = 0;
174 void __iomem *base;
175 int int_type;
176 irqreturn_t ret = IRQ_NONE;
177
178 int_type = irq == l3->app_irq ? L3_APPLICATION_ERROR : L3_DEBUG_ERROR;
179 if (!int_type) {
180 status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_0);
181 /*
182 * if we have a timeout error, there's nothing we can
183 * do besides rebooting the board. So let's BUG on any
184 * of such errors and handle the others. timeout error
185 * is severe and not expected to occur.
186 */
187 BUG_ON(status & L3_STATUS_0_TIMEOUT_MASK);
188 } else {
189 status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_1);
190 /* No timeout error for debug sources */
191 }
192
193 /* identify the error source */
194 err_source = __ffs(status);
195
196 base = l3->rt + omap3_l3_bases[int_type][err_source];
197 error = omap3_l3_readll(base, L3_ERROR_LOG);
198 if (error) {
199 error_addr = omap3_l3_readll(base, L3_ERROR_LOG_ADDR);
200 ret |= omap3_l3_block_irq(l3, error, error_addr);
201 }
202
203 /* Clear the status register */
204 clear = (L3_AGENT_STATUS_CLEAR_IA << int_type) |
205 L3_AGENT_STATUS_CLEAR_TA;
206 omap3_l3_writell(base, L3_AGENT_STATUS, clear);
207
208 /* clear the error log register */
209 omap3_l3_writell(base, L3_ERROR_LOG, error);
210
211 return ret;
212}
213
214static int __init omap3_l3_probe(struct platform_device *pdev)
215{
216 struct omap3_l3 *l3;
217 struct resource *res;
218 int ret;
219
220 l3 = kzalloc(sizeof(*l3), GFP_KERNEL);
221 if (!l3)
222 return -ENOMEM;
223
224 platform_set_drvdata(pdev, l3);
225
226 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
227 if (!res) {
228 dev_err(&pdev->dev, "couldn't find resource\n");
229 ret = -ENODEV;
230 goto err0;
231 }
232 l3->rt = ioremap(res->start, resource_size(res));
233 if (!l3->rt) {
234 dev_err(&pdev->dev, "ioremap failed\n");
235 ret = -ENOMEM;
236 goto err0;
237 }
238
239 l3->debug_irq = platform_get_irq(pdev, 0);
240 ret = request_irq(l3->debug_irq, omap3_l3_app_irq,
241 IRQF_DISABLED | IRQF_TRIGGER_RISING,
242 "l3-debug-irq", l3);
243 if (ret) {
244 dev_err(&pdev->dev, "couldn't request debug irq\n");
245 goto err1;
246 }
247
248 l3->app_irq = platform_get_irq(pdev, 1);
249 ret = request_irq(l3->app_irq, omap3_l3_app_irq,
250 IRQF_DISABLED | IRQF_TRIGGER_RISING,
251 "l3-app-irq", l3);
252 if (ret) {
253 dev_err(&pdev->dev, "couldn't request app irq\n");
254 goto err2;
255 }
256
257 return 0;
258
259err2:
260 free_irq(l3->debug_irq, l3);
261err1:
262 iounmap(l3->rt);
263err0:
264 kfree(l3);
265 return ret;
266}
267
268static int __exit omap3_l3_remove(struct platform_device *pdev)
269{
270 struct omap3_l3 *l3 = platform_get_drvdata(pdev);
271
272 free_irq(l3->app_irq, l3);
273 free_irq(l3->debug_irq, l3);
274 iounmap(l3->rt);
275 kfree(l3);
276
277 return 0;
278}
279
280static struct platform_driver omap3_l3_driver = {
281 .remove = __exit_p(omap3_l3_remove),
282 .driver = {
283 .name = "omap_l3_smx",
284 },
285};
286
287static int __init omap3_l3_init(void)
288{
289 return platform_driver_probe(&omap3_l3_driver, omap3_l3_probe);
290}
291postcore_initcall_sync(omap3_l3_init);
292
293static void __exit omap3_l3_exit(void)
294{
295 platform_driver_unregister(&omap3_l3_driver);
296}
297module_exit(omap3_l3_exit);
diff --git a/arch/arm/mach-omap2/omap_l3_smx.h b/arch/arm/mach-omap2/omap_l3_smx.h
deleted file mode 100644
index 4f3cebca417..00000000000
--- a/arch/arm/mach-omap2/omap_l3_smx.h
+++ /dev/null
@@ -1,338 +0,0 @@
1/*
2 * OMAP3XXX L3 Interconnect Driver header
3 *
4 * Copyright (C) 2011 Texas Corporation
5 * Felipe Balbi <balbi@ti.com>
6 * Santosh Shilimkar <santosh.shilimkar@ti.com>
7 * sricharan <r.sricharan@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 */
24#ifndef __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
25#define __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
26
27/* Register definitions. All 64-bit wide */
28#define L3_COMPONENT 0x000
29#define L3_CORE 0x018
30#define L3_AGENT_CONTROL 0x020
31#define L3_AGENT_STATUS 0x028
32#define L3_ERROR_LOG 0x058
33
34#define L3_ERROR_LOG_MULTI (1 << 31)
35#define L3_ERROR_LOG_SECONDARY (1 << 30)
36
37#define L3_ERROR_LOG_ADDR 0x060
38
39/* Register definitions for Sideband Interconnect */
40#define L3_SI_CONTROL 0x020
41#define L3_SI_FLAG_STATUS_0 0x510
42
43static const u64 shift = 1;
44
45#define L3_STATUS_0_MPUIA_BRST (shift << 0)
46#define L3_STATUS_0_MPUIA_RSP (shift << 1)
47#define L3_STATUS_0_MPUIA_INBAND (shift << 2)
48#define L3_STATUS_0_IVAIA_BRST (shift << 6)
49#define L3_STATUS_0_IVAIA_RSP (shift << 7)
50#define L3_STATUS_0_IVAIA_INBAND (shift << 8)
51#define L3_STATUS_0_SGXIA_BRST (shift << 9)
52#define L3_STATUS_0_SGXIA_RSP (shift << 10)
53#define L3_STATUS_0_SGXIA_MERROR (shift << 11)
54#define L3_STATUS_0_CAMIA_BRST (shift << 12)
55#define L3_STATUS_0_CAMIA_RSP (shift << 13)
56#define L3_STATUS_0_CAMIA_INBAND (shift << 14)
57#define L3_STATUS_0_DISPIA_BRST (shift << 15)
58#define L3_STATUS_0_DISPIA_RSP (shift << 16)
59#define L3_STATUS_0_DMARDIA_BRST (shift << 18)
60#define L3_STATUS_0_DMARDIA_RSP (shift << 19)
61#define L3_STATUS_0_DMAWRIA_BRST (shift << 21)
62#define L3_STATUS_0_DMAWRIA_RSP (shift << 22)
63#define L3_STATUS_0_USBOTGIA_BRST (shift << 24)
64#define L3_STATUS_0_USBOTGIA_RSP (shift << 25)
65#define L3_STATUS_0_USBOTGIA_INBAND (shift << 26)
66#define L3_STATUS_0_USBHOSTIA_BRST (shift << 27)
67#define L3_STATUS_0_USBHOSTIA_INBAND (shift << 28)
68#define L3_STATUS_0_SMSTA_REQ (shift << 48)
69#define L3_STATUS_0_GPMCTA_REQ (shift << 49)
70#define L3_STATUS_0_OCMRAMTA_REQ (shift << 50)
71#define L3_STATUS_0_OCMROMTA_REQ (shift << 51)
72#define L3_STATUS_0_IVATA_REQ (shift << 54)
73#define L3_STATUS_0_SGXTA_REQ (shift << 55)
74#define L3_STATUS_0_SGXTA_SERROR (shift << 56)
75#define L3_STATUS_0_GPMCTA_SERROR (shift << 57)
76#define L3_STATUS_0_L4CORETA_REQ (shift << 58)
77#define L3_STATUS_0_L4PERTA_REQ (shift << 59)
78#define L3_STATUS_0_L4EMUTA_REQ (shift << 60)
79#define L3_STATUS_0_MAD2DTA_REQ (shift << 61)
80
81#define L3_STATUS_0_TIMEOUT_MASK (L3_STATUS_0_MPUIA_BRST \
82 | L3_STATUS_0_MPUIA_RSP \
83 | L3_STATUS_0_IVAIA_BRST \
84 | L3_STATUS_0_IVAIA_RSP \
85 | L3_STATUS_0_SGXIA_BRST \
86 | L3_STATUS_0_SGXIA_RSP \
87 | L3_STATUS_0_CAMIA_BRST \
88 | L3_STATUS_0_CAMIA_RSP \
89 | L3_STATUS_0_DISPIA_BRST \
90 | L3_STATUS_0_DISPIA_RSP \
91 | L3_STATUS_0_DMARDIA_BRST \
92 | L3_STATUS_0_DMARDIA_RSP \
93 | L3_STATUS_0_DMAWRIA_BRST \
94 | L3_STATUS_0_DMAWRIA_RSP \
95 | L3_STATUS_0_USBOTGIA_BRST \
96 | L3_STATUS_0_USBOTGIA_RSP \
97 | L3_STATUS_0_USBHOSTIA_BRST \
98 | L3_STATUS_0_SMSTA_REQ \
99 | L3_STATUS_0_GPMCTA_REQ \
100 | L3_STATUS_0_OCMRAMTA_REQ \
101 | L3_STATUS_0_OCMROMTA_REQ \
102 | L3_STATUS_0_IVATA_REQ \
103 | L3_STATUS_0_SGXTA_REQ \
104 | L3_STATUS_0_L4CORETA_REQ \
105 | L3_STATUS_0_L4PERTA_REQ \
106 | L3_STATUS_0_L4EMUTA_REQ \
107 | L3_STATUS_0_MAD2DTA_REQ)
108
109#define L3_SI_FLAG_STATUS_1 0x530
110
111#define L3_STATUS_1_MPU_DATAIA (1 << 0)
112#define L3_STATUS_1_DAPIA0 (1 << 3)
113#define L3_STATUS_1_DAPIA1 (1 << 4)
114#define L3_STATUS_1_IVAIA (1 << 6)
115
116#define L3_PM_ERROR_LOG 0x020
117#define L3_PM_CONTROL 0x028
118#define L3_PM_ERROR_CLEAR_SINGLE 0x030
119#define L3_PM_ERROR_CLEAR_MULTI 0x038
120#define L3_PM_REQ_INFO_PERMISSION(n) (0x048 + (0x020 * n))
121#define L3_PM_READ_PERMISSION(n) (0x050 + (0x020 * n))
122#define L3_PM_WRITE_PERMISSION(n) (0x058 + (0x020 * n))
123#define L3_PM_ADDR_MATCH(n) (0x060 + (0x020 * n))
124
125/* L3 error log bit fields. Common for IA and TA */
126#define L3_ERROR_LOG_CODE 24
127#define L3_ERROR_LOG_INITID 8
128#define L3_ERROR_LOG_CMD 0
129
130/* L3 agent status bit fields. */
131#define L3_AGENT_STATUS_CLEAR_IA 0x10000000
132#define L3_AGENT_STATUS_CLEAR_TA 0x01000000
133
134#define OMAP34xx_IRQ_L3_APP 10
135#define L3_APPLICATION_ERROR 0x0
136#define L3_DEBUG_ERROR 0x1
137
138enum omap3_l3_initiator_id {
139 /* LCD has 1 ID */
140 OMAP_L3_LCD = 29,
141 /* SAD2D has 1 ID */
142 OMAP_L3_SAD2D = 28,
143 /* MPU has 5 IDs */
144 OMAP_L3_IA_MPU_SS_1 = 27,
145 OMAP_L3_IA_MPU_SS_2 = 26,
146 OMAP_L3_IA_MPU_SS_3 = 25,
147 OMAP_L3_IA_MPU_SS_4 = 24,
148 OMAP_L3_IA_MPU_SS_5 = 23,
149 /* IVA2.2 SS has 3 IDs*/
150 OMAP_L3_IA_IVA_SS_1 = 22,
151 OMAP_L3_IA_IVA_SS_2 = 21,
152 OMAP_L3_IA_IVA_SS_3 = 20,
153 /* IVA 2.2 SS DMA has 6 IDS */
154 OMAP_L3_IA_IVA_SS_DMA_1 = 19,
155 OMAP_L3_IA_IVA_SS_DMA_2 = 18,
156 OMAP_L3_IA_IVA_SS_DMA_3 = 17,
157 OMAP_L3_IA_IVA_SS_DMA_4 = 16,
158 OMAP_L3_IA_IVA_SS_DMA_5 = 15,
159 OMAP_L3_IA_IVA_SS_DMA_6 = 14,
160 /* SGX has 1 ID */
161 OMAP_L3_IA_SGX = 13,
162 /* CAM has 3 ID */
163 OMAP_L3_IA_CAM_1 = 12,
164 OMAP_L3_IA_CAM_2 = 11,
165 OMAP_L3_IA_CAM_3 = 10,
166 /* DAP has 1 ID */
167 OMAP_L3_IA_DAP = 9,
168 /* SDMA WR has 2 IDs */
169 OMAP_L3_SDMA_WR_1 = 8,
170 OMAP_L3_SDMA_WR_2 = 7,
171 /* SDMA RD has 4 IDs */
172 OMAP_L3_SDMA_RD_1 = 6,
173 OMAP_L3_SDMA_RD_2 = 5,
174 OMAP_L3_SDMA_RD_3 = 4,
175 OMAP_L3_SDMA_RD_4 = 3,
176 /* HSUSB OTG has 1 ID */
177 OMAP_L3_USBOTG = 2,
178 /* HSUSB HOST has 1 ID */
179 OMAP_L3_USBHOST = 1,
180};
181
182enum omap3_l3_code {
183 OMAP_L3_CODE_NOERROR = 0,
184 OMAP_L3_CODE_UNSUP_CMD = 1,
185 OMAP_L3_CODE_ADDR_HOLE = 2,
186 OMAP_L3_CODE_PROTECT_VIOLATION = 3,
187 OMAP_L3_CODE_IN_BAND_ERR = 4,
188 /* codes 5 and 6 are reserved */
189 OMAP_L3_CODE_REQ_TOUT_NOT_ACCEPT = 7,
190 OMAP_L3_CODE_REQ_TOUT_NO_RESP = 8,
191 /* codes 9 - 15 are also reserved */
192};
193
194struct omap3_l3 {
195 struct device *dev;
196 struct clk *ick;
197
198 /* memory base*/
199 void __iomem *rt;
200
201 int debug_irq;
202 int app_irq;
203
204 /* true when and inband functional error occurs */
205 unsigned inband:1;
206};
207
208/* offsets for l3 agents in order with the Flag status register */
209static unsigned int omap3_l3_app_bases[] = {
210 /* MPU IA */
211 0x1400,
212 0x1400,
213 0x1400,
214 /* RESERVED */
215 0,
216 0,
217 0,
218 /* IVA 2.2 IA */
219 0x1800,
220 0x1800,
221 0x1800,
222 /* SGX IA */
223 0x1c00,
224 0x1c00,
225 /* RESERVED */
226 0,
227 /* CAMERA IA */
228 0x5800,
229 0x5800,
230 0x5800,
231 /* DISPLAY IA */
232 0x5400,
233 0x5400,
234 /* RESERVED */
235 0,
236 /*SDMA RD IA */
237 0x4c00,
238 0x4c00,
239 /* RESERVED */
240 0,
241 /* SDMA WR IA */
242 0x5000,
243 0x5000,
244 /* RESERVED */
245 0,
246 /* USB OTG IA */
247 0x4400,
248 0x4400,
249 0x4400,
250 /* USB HOST IA */
251 0x4000,
252 0x4000,
253 /* RESERVED */
254 0,
255 0,
256 0,
257 0,
258 /* SAD2D IA */
259 0x3000,
260 0x3000,
261 0x3000,
262 /* RESERVED */
263 0,
264 0,
265 0,
266 0,
267 0,
268 0,
269 0,
270 0,
271 0,
272 0,
273 0,
274 0,
275 /* SMA TA */
276 0x2000,
277 /* GPMC TA */
278 0x2400,
279 /* OCM RAM TA */
280 0x2800,
281 /* OCM ROM TA */
282 0x2C00,
283 /* L4 CORE TA */
284 0x6800,
285 /* L4 PER TA */
286 0x6c00,
287 /* IVA 2.2 TA */
288 0x6000,
289 /* SGX TA */
290 0x6400,
291 /* L4 EMU TA */
292 0x7000,
293 /* GPMC TA */
294 0x2400,
295 /* L4 CORE TA */
296 0x6800,
297 /* L4 PER TA */
298 0x6c00,
299 /* L4 EMU TA */
300 0x7000,
301 /* MAD2D TA */
302 0x3400,
303 /* RESERVED */
304 0,
305 0,
306};
307
308static unsigned int omap3_l3_debug_bases[] = {
309 /* MPU DATA IA */
310 0x1400,
311 /* RESERVED */
312 0,
313 0,
314 /* DAP IA */
315 0x5c00,
316 0x5c00,
317 /* RESERVED */
318 0,
319 /* IVA 2.2 IA */
320 0x1800,
321 /* REST RESERVED */
322};
323
324static u32 *omap3_l3_bases[] = {
325 omap3_l3_app_bases,
326 omap3_l3_debug_bases,
327};
328
329/*
330 * REVISIT define __raw_readll/__raw_writell here, but move them to
331 * <asm/io.h> at some point
332 */
333#define __raw_writell(v, a) (__chk_io_ptr(a), \
334 *(volatile u64 __force *)(a) = (v))
335#define __raw_readll(a) (__chk_io_ptr(a), \
336 *(volatile u64 __force *)(a))
337
338#endif
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index d52651a05da..d992db8ff0b 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -29,145 +29,9 @@
29#include <linux/usb.h> 29#include <linux/usb.h>
30 30
31#include <plat/usb.h> 31#include <plat/usb.h>
32#include "control.h"
33
34/* OMAP control module register for UTMI PHY */
35#define CONTROL_DEV_CONF 0x300
36#define PHY_PD 0x1
37
38#define USBOTGHS_CONTROL 0x33c
39#define AVALID BIT(0)
40#define BVALID BIT(1)
41#define VBUSVALID BIT(2)
42#define SESSEND BIT(3)
43#define IDDIG BIT(4)
44
45static struct clk *phyclk, *clk48m, *clk32k;
46static void __iomem *ctrl_base;
47static int usbotghs_control;
48
49int omap4430_phy_init(struct device *dev)
50{
51 ctrl_base = ioremap(OMAP443X_SCM_BASE, SZ_1K);
52 if (!ctrl_base) {
53 pr_err("control module ioremap failed\n");
54 return -ENOMEM;
55 }
56 /* Power down the phy */
57 __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF);
58
59 if (!dev) {
60 iounmap(ctrl_base);
61 return 0;
62 }
63
64 phyclk = clk_get(dev, "ocp2scp_usb_phy_ick");
65 if (IS_ERR(phyclk)) {
66 dev_err(dev, "cannot clk_get ocp2scp_usb_phy_ick\n");
67 iounmap(ctrl_base);
68 return PTR_ERR(phyclk);
69 }
70
71 clk48m = clk_get(dev, "ocp2scp_usb_phy_phy_48m");
72 if (IS_ERR(clk48m)) {
73 dev_err(dev, "cannot clk_get ocp2scp_usb_phy_phy_48m\n");
74 clk_put(phyclk);
75 iounmap(ctrl_base);
76 return PTR_ERR(clk48m);
77 }
78
79 clk32k = clk_get(dev, "usb_phy_cm_clk32k");
80 if (IS_ERR(clk32k)) {
81 dev_err(dev, "cannot clk_get usb_phy_cm_clk32k\n");
82 clk_put(phyclk);
83 clk_put(clk48m);
84 iounmap(ctrl_base);
85 return PTR_ERR(clk32k);
86 }
87 return 0;
88}
89
90int omap4430_phy_set_clk(struct device *dev, int on)
91{
92 static int state;
93
94 if (on && !state) {
95 /* Enable the phy clocks */
96 clk_enable(phyclk);
97 clk_enable(clk48m);
98 clk_enable(clk32k);
99 state = 1;
100 } else if (state) {
101 /* Disable the phy clocks */
102 clk_disable(phyclk);
103 clk_disable(clk48m);
104 clk_disable(clk32k);
105 state = 0;
106 }
107 return 0;
108}
109
110int omap4430_phy_power(struct device *dev, int ID, int on)
111{
112 if (on) {
113 if (ID)
114 /* enable VBUS valid, IDDIG groung */
115 __raw_writel(AVALID | VBUSVALID, ctrl_base +
116 USBOTGHS_CONTROL);
117 else
118 /*
119 * Enable VBUS Valid, AValid and IDDIG
120 * high impedance
121 */
122 __raw_writel(IDDIG | AVALID | VBUSVALID,
123 ctrl_base + USBOTGHS_CONTROL);
124 } else {
125 /* Enable session END and IDIG to high impedance. */
126 __raw_writel(SESSEND | IDDIG, ctrl_base +
127 USBOTGHS_CONTROL);
128 }
129 return 0;
130}
131
132int omap4430_phy_suspend(struct device *dev, int suspend)
133{
134 if (suspend) {
135 /* Disable the clocks */
136 omap4430_phy_set_clk(dev, 0);
137 /* Power down the phy */
138 __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF);
139
140 /* save the context */
141 usbotghs_control = __raw_readl(ctrl_base + USBOTGHS_CONTROL);
142 } else {
143 /* Enable the internel phy clcoks */
144 omap4430_phy_set_clk(dev, 1);
145 /* power on the phy */
146 if (__raw_readl(ctrl_base + CONTROL_DEV_CONF) & PHY_PD) {
147 __raw_writel(~PHY_PD, ctrl_base + CONTROL_DEV_CONF);
148 mdelay(200);
149 }
150
151 /* restore the context */
152 __raw_writel(usbotghs_control, ctrl_base + USBOTGHS_CONTROL);
153 }
154
155 return 0;
156}
157
158int omap4430_phy_exit(struct device *dev)
159{
160 if (ctrl_base)
161 iounmap(ctrl_base);
162 if (phyclk)
163 clk_put(phyclk);
164 if (clk48m)
165 clk_put(clk48m);
166 if (clk32k)
167 clk_put(clk32k);
168 32
169 return 0; 33#include "soc.h"
170} 34#include "control.h"
171 35
172void am35x_musb_reset(void) 36void am35x_musb_reset(void)
173{ 37{
diff --git a/arch/arm/mach-omap2/opp.c b/arch/arm/mach-omap2/opp.c
index d8f6dbf45d1..58e16aef40b 100644
--- a/arch/arm/mach-omap2/opp.c
+++ b/arch/arm/mach-omap2/opp.c
@@ -18,6 +18,7 @@
18 */ 18 */
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/opp.h> 20#include <linux/opp.h>
21#include <linux/cpu.h>
21 22
22#include <plat/omap_device.h> 23#include <plat/omap_device.h>
23 24
@@ -62,27 +63,34 @@ int __init omap_init_opp_table(struct omap_opp_def *opp_def,
62 __func__, i); 63 __func__, i);
63 return -EINVAL; 64 return -EINVAL;
64 } 65 }
65 oh = omap_hwmod_lookup(opp_def->hwmod_name); 66
66 if (!oh || !oh->od) { 67 if (!strncmp(opp_def->hwmod_name, "mpu", 3)) {
67 pr_debug("%s: no hwmod or odev for %s, [%d] " 68 /*
68 "cannot add OPPs.\n", __func__, 69 * All current OMAPs share voltage rail and
69 opp_def->hwmod_name, i); 70 * clock source, so CPU0 is used to represent
70 continue; 71 * the MPU-SS.
72 */
73 dev = get_cpu_device(0);
74 } else {
75 oh = omap_hwmod_lookup(opp_def->hwmod_name);
76 if (!oh || !oh->od) {
77 pr_debug("%s: no hwmod or odev for %s, [%d] cannot add OPPs.\n",
78 __func__, opp_def->hwmod_name, i);
79 continue;
80 }
81 dev = &oh->od->pdev->dev;
71 } 82 }
72 dev = &oh->od->pdev->dev;
73 83
74 r = opp_add(dev, opp_def->freq, opp_def->u_volt); 84 r = opp_add(dev, opp_def->freq, opp_def->u_volt);
75 if (r) { 85 if (r) {
76 dev_err(dev, "%s: add OPP %ld failed for %s [%d] " 86 dev_err(dev, "%s: add OPP %ld failed for %s [%d] result=%d\n",
77 "result=%d\n", 87 __func__, opp_def->freq,
78 __func__, opp_def->freq, 88 opp_def->hwmod_name, i, r);
79 opp_def->hwmod_name, i, r);
80 } else { 89 } else {
81 if (!opp_def->default_available) 90 if (!opp_def->default_available)
82 r = opp_disable(dev, opp_def->freq); 91 r = opp_disable(dev, opp_def->freq);
83 if (r) 92 if (r)
84 dev_err(dev, "%s: disable %ld failed for %s " 93 dev_err(dev, "%s: disable %ld failed for %s [%d] result=%d\n",
85 "[%d] result=%d\n",
86 __func__, opp_def->freq, 94 __func__, opp_def->freq,
87 opp_def->hwmod_name, i, r); 95 opp_def->hwmod_name, i, r);
88 } 96 }
diff --git a/arch/arm/mach-omap2/opp2420_data.c b/arch/arm/mach-omap2/opp2420_data.c
index 5037e76e4e2..a9e8cf21705 100644
--- a/arch/arm/mach-omap2/opp2420_data.c
+++ b/arch/arm/mach-omap2/opp2420_data.c
@@ -28,7 +28,7 @@
28 * http://repository.maemo.org/pool/diablo/free/k/kernel-source-diablo/ 28 * http://repository.maemo.org/pool/diablo/free/k/kernel-source-diablo/
29 */ 29 */
30 30
31#include <plat/hardware.h> 31#include <linux/kernel.h>
32 32
33#include "opp2xxx.h" 33#include "opp2xxx.h"
34#include "sdrc.h" 34#include "sdrc.h"
diff --git a/arch/arm/mach-omap2/opp2430_data.c b/arch/arm/mach-omap2/opp2430_data.c
index 750805c528d..0e75ec3e114 100644
--- a/arch/arm/mach-omap2/opp2430_data.c
+++ b/arch/arm/mach-omap2/opp2430_data.c
@@ -26,7 +26,7 @@
26 * This is technically part of the OMAP2xxx clock code. 26 * This is technically part of the OMAP2xxx clock code.
27 */ 27 */
28 28
29#include <plat/hardware.h> 29#include <linux/kernel.h>
30 30
31#include "opp2xxx.h" 31#include "opp2xxx.h"
32#include "sdrc.h" 32#include "sdrc.h"
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
index d95f3f945d4..75cef5f67a8 100644
--- a/arch/arm/mach-omap2/opp3xxx_data.c
+++ b/arch/arm/mach-omap2/opp3xxx_data.c
@@ -19,8 +19,6 @@
19 */ 19 */
20#include <linux/module.h> 20#include <linux/module.h>
21 21
22#include <plat/cpu.h>
23
24#include "control.h" 22#include "control.h"
25#include "omap_opp_data.h" 23#include "omap_opp_data.h"
26#include "pm.h" 24#include "pm.h"
diff --git a/arch/arm/mach-omap2/opp4xxx_data.c b/arch/arm/mach-omap2/opp4xxx_data.c
index c95415da23c..a9fd6d5fe79 100644
--- a/arch/arm/mach-omap2/opp4xxx_data.c
+++ b/arch/arm/mach-omap2/opp4xxx_data.c
@@ -20,8 +20,7 @@
20 */ 20 */
21#include <linux/module.h> 21#include <linux/module.h>
22 22
23#include <plat/cpu.h> 23#include "soc.h"
24
25#include "control.h" 24#include "control.h"
26#include "omap_opp_data.h" 25#include "omap_opp_data.h"
27#include "pm.h" 26#include "pm.h"
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 814bcd90159..46092cd806f 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -28,7 +28,6 @@
28#include <linux/slab.h> 28#include <linux/slab.h>
29 29
30#include <plat/clock.h> 30#include <plat/clock.h>
31#include <plat/board.h>
32#include "powerdomain.h" 31#include "powerdomain.h"
33#include "clockdomain.h" 32#include "clockdomain.h"
34#include <plat/dmtimer.h> 33#include <plat/dmtimer.h>
@@ -169,7 +168,7 @@ static int pm_dbg_open(struct inode *inode, struct file *file)
169 default: 168 default:
170 return single_open(file, pm_dbg_show_timers, 169 return single_open(file, pm_dbg_show_timers,
171 &inode->i_private); 170 &inode->i_private);
172 }; 171 }
173} 172}
174 173
175static const struct file_operations debug_fops = { 174static const struct file_operations debug_fops = {
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 9cb5cede0f5..ea61c32957b 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -16,6 +16,7 @@
16#include <linux/opp.h> 16#include <linux/opp.h>
17#include <linux/export.h> 17#include <linux/export.h>
18#include <linux/suspend.h> 18#include <linux/suspend.h>
19#include <linux/cpu.h>
19 20
20#include <asm/system_misc.h> 21#include <asm/system_misc.h>
21 22
@@ -80,7 +81,8 @@ static void __init omap2_init_processor_devices(void)
80 81
81int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused) 82int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
82{ 83{
83 if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) 84 if ((clkdm->flags & CLKDM_CAN_ENABLE_AUTO) &&
85 !(clkdm->flags & CLKDM_MISSING_IDLE_REPORTING))
84 clkdm_allow_idle(clkdm); 86 clkdm_allow_idle(clkdm);
85 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && 87 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP &&
86 atomic_read(&clkdm->usecount) == 0) 88 atomic_read(&clkdm->usecount) == 0)
@@ -168,7 +170,15 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
168 goto exit; 170 goto exit;
169 } 171 }
170 172
171 dev = omap_device_get_by_hwmod_name(oh_name); 173 if (!strncmp(oh_name, "mpu", 3))
174 /*
175 * All current OMAPs share voltage rail and clock
176 * source, so CPU0 is used to represent the MPU-SS.
177 */
178 dev = get_cpu_device(0);
179 else
180 dev = omap_device_get_by_hwmod_name(oh_name);
181
172 if (IS_ERR(dev)) { 182 if (IS_ERR(dev)) {
173 pr_err("%s: Unable to get dev pointer for hwmod %s\n", 183 pr_err("%s: Unable to get dev pointer for hwmod %s\n",
174 __func__, oh_name); 184 __func__, oh_name);
@@ -176,7 +186,7 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
176 } 186 }
177 187
178 voltdm = voltdm_lookup(vdd_name); 188 voltdm = voltdm_lookup(vdd_name);
179 if (IS_ERR(voltdm)) { 189 if (!voltdm) {
180 pr_err("%s: unable to get vdd pointer for vdd_%s\n", 190 pr_err("%s: unable to get vdd pointer for vdd_%s\n",
181 __func__, vdd_name); 191 __func__, vdd_name);
182 goto exit; 192 goto exit;
@@ -188,7 +198,7 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
188 goto exit; 198 goto exit;
189 } 199 }
190 200
191 freq = clk->rate; 201 freq = clk_get_rate(clk);
192 clk_put(clk); 202 clk_put(clk);
193 203
194 rcu_read_lock(); 204 rcu_read_lock();
@@ -203,8 +213,8 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
203 bootup_volt = opp_get_voltage(opp); 213 bootup_volt = opp_get_voltage(opp);
204 rcu_read_unlock(); 214 rcu_read_unlock();
205 if (!bootup_volt) { 215 if (!bootup_volt) {
206 pr_err("%s: unable to find voltage corresponding " 216 pr_err("%s: unable to find voltage corresponding to the bootup OPP for vdd_%s\n",
207 "to the bootup OPP for vdd_%s\n", __func__, vdd_name); 217 __func__, vdd_name);
208 goto exit; 218 goto exit;
209 } 219 }
210 220
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index 2edeffc923a..8af6cd6ac33 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -29,6 +29,7 @@
29#include <linux/irq.h> 29#include <linux/irq.h>
30#include <linux/time.h> 30#include <linux/time.h>
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/platform_data/gpio-omap.h>
32 33
33#include <asm/mach/time.h> 34#include <asm/mach/time.h>
34#include <asm/mach/irq.h> 35#include <asm/mach/irq.h>
@@ -38,9 +39,6 @@
38#include <plat/clock.h> 39#include <plat/clock.h>
39#include <plat/sram.h> 40#include <plat/sram.h>
40#include <plat/dma.h> 41#include <plat/dma.h>
41#include <plat/board.h>
42
43#include <mach/irqs.h>
44 42
45#include "common.h" 43#include "common.h"
46#include "prm2xxx_3xxx.h" 44#include "prm2xxx_3xxx.h"
@@ -352,16 +350,6 @@ int __init omap2_pm_init(void)
352 350
353 prcm_setup_regs(); 351 prcm_setup_regs();
354 352
355 /* Hack to prevent MPU retention when STI console is enabled. */
356 {
357 const struct omap_sti_console_config *sti;
358
359 sti = omap_get_config(OMAP_TAG_STI_CONSOLE,
360 struct omap_sti_console_config);
361 if (sti != NULL && sti->enable)
362 sti_console_enabled = 1;
363 }
364
365 /* 353 /*
366 * We copy the assembler sleep/wakeup routines to SRAM. 354 * We copy the assembler sleep/wakeup routines to SRAM.
367 * These routines need to be in SRAM as that's the only 355 * These routines need to be in SRAM as that's the only
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 05bd8f02723..ba670db1fd3 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -28,6 +28,8 @@
28#include <linux/clk.h> 28#include <linux/clk.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/platform_data/gpio-omap.h>
32
31#include <trace/events/power.h> 33#include <trace/events/power.h>
32 34
33#include <asm/suspend.h> 35#include <asm/suspend.h>
@@ -389,9 +391,8 @@ restore:
389 list_for_each_entry(pwrst, &pwrst_list, node) { 391 list_for_each_entry(pwrst, &pwrst_list, node) {
390 state = pwrdm_read_prev_pwrst(pwrst->pwrdm); 392 state = pwrdm_read_prev_pwrst(pwrst->pwrdm);
391 if (state > pwrst->next_state) { 393 if (state > pwrst->next_state) {
392 pr_info("Powerdomain (%s) didn't enter " 394 pr_info("Powerdomain (%s) didn't enter target state %d\n",
393 "target state %d\n", 395 pwrst->pwrdm->name, pwrst->next_state);
394 pwrst->pwrdm->name, pwrst->next_state);
395 ret = -1; 396 ret = -1;
396 } 397 }
397 omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); 398 omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state);
@@ -731,8 +732,7 @@ int __init omap3_pm_init(void)
731 omap3_secure_ram_storage = 732 omap3_secure_ram_storage =
732 kmalloc(0x803F, GFP_KERNEL); 733 kmalloc(0x803F, GFP_KERNEL);
733 if (!omap3_secure_ram_storage) 734 if (!omap3_secure_ram_storage)
734 pr_err("Memory allocation failed when " 735 pr_err("Memory allocation failed when allocating for secure sram context\n");
735 "allocating for secure sram context\n");
736 736
737 local_irq_disable(); 737 local_irq_disable();
738 local_fiq_disable(); 738 local_fiq_disable();
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index ea24174f570..04922d14906 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -69,9 +69,8 @@ static int omap4_pm_suspend(void)
69 list_for_each_entry(pwrst, &pwrst_list, node) { 69 list_for_each_entry(pwrst, &pwrst_list, node) {
70 state = pwrdm_read_prev_pwrst(pwrst->pwrdm); 70 state = pwrdm_read_prev_pwrst(pwrst->pwrdm);
71 if (state > pwrst->next_state) { 71 if (state > pwrst->next_state) {
72 pr_info("Powerdomain (%s) didn't enter " 72 pr_info("Powerdomain (%s) didn't enter target state %d\n",
73 "target state %d\n", 73 pwrst->pwrdm->name, pwrst->next_state);
74 pwrst->pwrdm->name, pwrst->next_state);
75 ret = -1; 74 ret = -1;
76 } 75 }
77 omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); 76 omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state);
@@ -189,8 +188,7 @@ int __init omap4_pm_init(void)
189 ret |= clkdm_add_wkdep(ducati_clkdm, l3_1_clkdm); 188 ret |= clkdm_add_wkdep(ducati_clkdm, l3_1_clkdm);
190 ret |= clkdm_add_wkdep(ducati_clkdm, l3_2_clkdm); 189 ret |= clkdm_add_wkdep(ducati_clkdm, l3_2_clkdm);
191 if (ret) { 190 if (ret) {
192 pr_err("Failed to add MPUSS -> L3/EMIF/L4PER, DUCATI -> L3 " 191 pr_err("Failed to add MPUSS -> L3/EMIF/L4PER, DUCATI -> L3 wakeup dependency\n");
193 "wakeup dependency\n");
194 goto err2; 192 goto err2;
195 } 193 }
196 194
diff --git a/arch/arm/mach-omap2/pmu.c b/arch/arm/mach-omap2/pmu.c
new file mode 100644
index 00000000000..2a791766283
--- /dev/null
+++ b/arch/arm/mach-omap2/pmu.c
@@ -0,0 +1,95 @@
1/*
2 * OMAP2 ARM Performance Monitoring Unit (PMU) Support
3 *
4 * Copyright (C) 2012 Texas Instruments, Inc.
5 *
6 * Contacts:
7 * Jon Hunter <jon-hunter@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */
14#include <linux/pm_runtime.h>
15
16#include <asm/pmu.h>
17
18#include <plat/omap_hwmod.h>
19#include <plat/omap_device.h>
20
21static char *omap2_pmu_oh_names[] = {"mpu"};
22static char *omap3_pmu_oh_names[] = {"mpu", "debugss"};
23static char *omap4430_pmu_oh_names[] = {"l3_main_3", "l3_instr", "debugss"};
24static struct platform_device *omap_pmu_dev;
25
26/**
27 * omap2_init_pmu - creates and registers PMU platform device
28 * @oh_num: Number of OMAP HWMODs required to create PMU device
29 * @oh_names: Array of OMAP HWMODS names required to create PMU device
30 *
31 * Uses OMAP HWMOD framework to create and register an ARM PMU device
32 * from a list of HWMOD names passed. Currently supports OMAP2, OMAP3
33 * and OMAP4 devices.
34 */
35static int __init omap2_init_pmu(unsigned oh_num, char *oh_names[])
36{
37 int i;
38 struct omap_hwmod *oh[3];
39 char *dev_name = "arm-pmu";
40
41 if ((!oh_num) || (oh_num > 3))
42 return -EINVAL;
43
44 for (i = 0; i < oh_num; i++) {
45 oh[i] = omap_hwmod_lookup(oh_names[i]);
46 if (!oh[i]) {
47 pr_err("Could not look up %s hwmod\n", oh_names[i]);
48 return -ENODEV;
49 }
50 }
51
52 omap_pmu_dev = omap_device_build_ss(dev_name, -1, oh, oh_num, NULL, 0,
53 NULL, 0, 0);
54 WARN(IS_ERR(omap_pmu_dev), "Can't build omap_device for %s.\n",
55 dev_name);
56
57 if (IS_ERR(omap_pmu_dev))
58 return PTR_ERR(omap_pmu_dev);
59
60 pm_runtime_enable(&omap_pmu_dev->dev);
61
62 return 0;
63}
64
65static int __init omap_init_pmu(void)
66{
67 unsigned oh_num;
68 char **oh_names;
69
70 /*
71 * To create an ARM-PMU device the following HWMODs
72 * are required for the various OMAP2+ devices.
73 *
74 * OMAP24xx: mpu
75 * OMAP3xxx: mpu, debugss
76 * OMAP4430: l3_main_3, l3_instr, debugss
77 * OMAP4460/70: mpu, debugss
78 */
79 if (cpu_is_omap443x()) {
80 oh_num = ARRAY_SIZE(omap4430_pmu_oh_names);
81 oh_names = omap4430_pmu_oh_names;
82 /* XXX Remove the next two lines when CTI driver available */
83 pr_info("ARM PMU: not yet supported on OMAP4430 due to missing CTI driver\n");
84 return 0;
85 } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
86 oh_num = ARRAY_SIZE(omap3_pmu_oh_names);
87 oh_names = omap3_pmu_oh_names;
88 } else {
89 oh_num = ARRAY_SIZE(omap2_pmu_oh_names);
90 oh_names = omap2_pmu_oh_names;
91 }
92
93 return omap2_init_pmu(oh_num, oh_names);
94}
95subsys_initcall(omap_init_pmu);
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 69b36e185e9..1678a328423 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -28,11 +28,13 @@
28#include "prm44xx.h" 28#include "prm44xx.h"
29 29
30#include <asm/cpu.h> 30#include <asm/cpu.h>
31#include <plat/cpu.h> 31
32#include <plat/prcm.h>
33
32#include "powerdomain.h" 34#include "powerdomain.h"
33#include "clockdomain.h" 35#include "clockdomain.h"
34#include <plat/prcm.h>
35 36
37#include "soc.h"
36#include "pm.h" 38#include "pm.h"
37 39
38#define PWRDM_TRACE_STATES_FLAG (1<<31) 40#define PWRDM_TRACE_STATES_FLAG (1<<31)
@@ -339,8 +341,8 @@ int pwrdm_add_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm)
339 if (!pwrdm || !clkdm) 341 if (!pwrdm || !clkdm)
340 return -EINVAL; 342 return -EINVAL;
341 343
342 pr_debug("powerdomain: associating clockdomain %s with powerdomain " 344 pr_debug("powerdomain: %s: associating clockdomain %s\n",
343 "%s\n", clkdm->name, pwrdm->name); 345 pwrdm->name, clkdm->name);
344 346
345 for (i = 0; i < PWRDM_MAX_CLKDMS; i++) { 347 for (i = 0; i < PWRDM_MAX_CLKDMS; i++) {
346 if (!pwrdm->pwrdm_clkdms[i]) 348 if (!pwrdm->pwrdm_clkdms[i])
@@ -354,8 +356,8 @@ int pwrdm_add_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm)
354 } 356 }
355 357
356 if (i == PWRDM_MAX_CLKDMS) { 358 if (i == PWRDM_MAX_CLKDMS) {
357 pr_debug("powerdomain: increase PWRDM_MAX_CLKDMS for " 359 pr_debug("powerdomain: %s: increase PWRDM_MAX_CLKDMS for clkdm %s\n",
358 "pwrdm %s clkdm %s\n", pwrdm->name, clkdm->name); 360 pwrdm->name, clkdm->name);
359 WARN_ON(1); 361 WARN_ON(1);
360 ret = -ENOMEM; 362 ret = -ENOMEM;
361 goto pac_exit; 363 goto pac_exit;
@@ -387,16 +389,16 @@ int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm)
387 if (!pwrdm || !clkdm) 389 if (!pwrdm || !clkdm)
388 return -EINVAL; 390 return -EINVAL;
389 391
390 pr_debug("powerdomain: dissociating clockdomain %s from powerdomain " 392 pr_debug("powerdomain: %s: dissociating clockdomain %s\n",
391 "%s\n", clkdm->name, pwrdm->name); 393 pwrdm->name, clkdm->name);
392 394
393 for (i = 0; i < PWRDM_MAX_CLKDMS; i++) 395 for (i = 0; i < PWRDM_MAX_CLKDMS; i++)
394 if (pwrdm->pwrdm_clkdms[i] == clkdm) 396 if (pwrdm->pwrdm_clkdms[i] == clkdm)
395 break; 397 break;
396 398
397 if (i == PWRDM_MAX_CLKDMS) { 399 if (i == PWRDM_MAX_CLKDMS) {
398 pr_debug("powerdomain: clkdm %s not associated with pwrdm " 400 pr_debug("powerdomain: %s: clkdm %s not associated?!\n",
399 "%s ?!\n", clkdm->name, pwrdm->name); 401 pwrdm->name, clkdm->name);
400 ret = -ENOENT; 402 ret = -ENOENT;
401 goto pdc_exit; 403 goto pdc_exit;
402 } 404 }
@@ -485,7 +487,7 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
485 if (!(pwrdm->pwrsts & (1 << pwrst))) 487 if (!(pwrdm->pwrsts & (1 << pwrst)))
486 return -EINVAL; 488 return -EINVAL;
487 489
488 pr_debug("powerdomain: setting next powerstate for %s to %0x\n", 490 pr_debug("powerdomain: %s: setting next powerstate to %0x\n",
489 pwrdm->name, pwrst); 491 pwrdm->name, pwrst);
490 492
491 if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) { 493 if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
@@ -587,7 +589,7 @@ int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
587 if (!(pwrdm->pwrsts_logic_ret & (1 << pwrst))) 589 if (!(pwrdm->pwrsts_logic_ret & (1 << pwrst)))
588 return -EINVAL; 590 return -EINVAL;
589 591
590 pr_debug("powerdomain: setting next logic powerstate for %s to %0x\n", 592 pr_debug("powerdomain: %s: setting next logic powerstate to %0x\n",
591 pwrdm->name, pwrst); 593 pwrdm->name, pwrst);
592 594
593 if (arch_pwrdm && arch_pwrdm->pwrdm_set_logic_retst) 595 if (arch_pwrdm && arch_pwrdm->pwrdm_set_logic_retst)
@@ -624,8 +626,8 @@ int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
624 if (!(pwrdm->pwrsts_mem_on[bank] & (1 << pwrst))) 626 if (!(pwrdm->pwrsts_mem_on[bank] & (1 << pwrst)))
625 return -EINVAL; 627 return -EINVAL;
626 628
627 pr_debug("powerdomain: setting next memory powerstate for domain %s " 629 pr_debug("powerdomain: %s: setting next memory powerstate for bank %0x while pwrdm-ON to %0x\n",
628 "bank %0x while pwrdm-ON to %0x\n", pwrdm->name, bank, pwrst); 630 pwrdm->name, bank, pwrst);
629 631
630 if (arch_pwrdm && arch_pwrdm->pwrdm_set_mem_onst) 632 if (arch_pwrdm && arch_pwrdm->pwrdm_set_mem_onst)
631 ret = arch_pwrdm->pwrdm_set_mem_onst(pwrdm, bank, pwrst); 633 ret = arch_pwrdm->pwrdm_set_mem_onst(pwrdm, bank, pwrst);
@@ -662,8 +664,8 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
662 if (!(pwrdm->pwrsts_mem_ret[bank] & (1 << pwrst))) 664 if (!(pwrdm->pwrsts_mem_ret[bank] & (1 << pwrst)))
663 return -EINVAL; 665 return -EINVAL;
664 666
665 pr_debug("powerdomain: setting next memory powerstate for domain %s " 667 pr_debug("powerdomain: %s: setting next memory powerstate for bank %0x while pwrdm-RET to %0x\n",
666 "bank %0x while pwrdm-RET to %0x\n", pwrdm->name, bank, pwrst); 668 pwrdm->name, bank, pwrst);
667 669
668 if (arch_pwrdm && arch_pwrdm->pwrdm_set_mem_retst) 670 if (arch_pwrdm && arch_pwrdm->pwrdm_set_mem_retst)
669 ret = arch_pwrdm->pwrdm_set_mem_retst(pwrdm, bank, pwrst); 671 ret = arch_pwrdm->pwrdm_set_mem_retst(pwrdm, bank, pwrst);
@@ -841,7 +843,7 @@ int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
841 * warn & fail if it is not ON. 843 * warn & fail if it is not ON.
842 */ 844 */
843 845
844 pr_debug("powerdomain: clearing previous power state reg for %s\n", 846 pr_debug("powerdomain: %s: clearing previous power state reg\n",
845 pwrdm->name); 847 pwrdm->name);
846 848
847 if (arch_pwrdm && arch_pwrdm->pwrdm_clear_all_prev_pwrst) 849 if (arch_pwrdm && arch_pwrdm->pwrdm_clear_all_prev_pwrst)
@@ -871,8 +873,7 @@ int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm)
871 if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR)) 873 if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR))
872 return ret; 874 return ret;
873 875
874 pr_debug("powerdomain: %s: setting SAVEANDRESTORE bit\n", 876 pr_debug("powerdomain: %s: setting SAVEANDRESTORE bit\n", pwrdm->name);
875 pwrdm->name);
876 877
877 if (arch_pwrdm && arch_pwrdm->pwrdm_enable_hdwr_sar) 878 if (arch_pwrdm && arch_pwrdm->pwrdm_enable_hdwr_sar)
878 ret = arch_pwrdm->pwrdm_enable_hdwr_sar(pwrdm); 879 ret = arch_pwrdm->pwrdm_enable_hdwr_sar(pwrdm);
@@ -901,8 +902,7 @@ int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
901 if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR)) 902 if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR))
902 return ret; 903 return ret;
903 904
904 pr_debug("powerdomain: %s: clearing SAVEANDRESTORE bit\n", 905 pr_debug("powerdomain: %s: clearing SAVEANDRESTORE bit\n", pwrdm->name);
905 pwrdm->name);
906 906
907 if (arch_pwrdm && arch_pwrdm->pwrdm_disable_hdwr_sar) 907 if (arch_pwrdm && arch_pwrdm->pwrdm_disable_hdwr_sar)
908 ret = arch_pwrdm->pwrdm_disable_hdwr_sar(pwrdm); 908 ret = arch_pwrdm->pwrdm_disable_hdwr_sar(pwrdm);
diff --git a/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
index 0f0a9f1592f..3950ccfe5f4 100644
--- a/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
@@ -122,8 +122,8 @@ static int omap2_pwrdm_wait_transition(struct powerdomain *pwrdm)
122 udelay(1); 122 udelay(1);
123 123
124 if (c > PWRDM_TRANSITION_BAILOUT) { 124 if (c > PWRDM_TRANSITION_BAILOUT) {
125 printk(KERN_ERR "powerdomain: waited too long for " 125 pr_err("powerdomain: %s: waited too long to complete transition\n",
126 "powerdomain %s to complete transition\n", pwrdm->name); 126 pwrdm->name);
127 return -EAGAIN; 127 return -EAGAIN;
128 } 128 }
129 129
diff --git a/arch/arm/mach-omap2/powerdomain44xx.c b/arch/arm/mach-omap2/powerdomain44xx.c
index 601325b852a..aceb4f464c9 100644
--- a/arch/arm/mach-omap2/powerdomain44xx.c
+++ b/arch/arm/mach-omap2/powerdomain44xx.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP4 powerdomain control 2 * OMAP4 powerdomain control
3 * 3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc. 4 * Copyright (C) 2009-2010, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation 5 * Copyright (C) 2007-2009 Nokia Corporation
6 * 6 *
7 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley 7 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley
@@ -151,6 +151,34 @@ static int omap4_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
151 return v; 151 return v;
152} 152}
153 153
154/**
155 * omap4_pwrdm_read_prev_logic_pwrst - read the previous logic powerstate
156 * @pwrdm: struct powerdomain * to read the state for
157 *
158 * Reads the previous logic powerstate for a powerdomain. This
159 * function must determine the previous logic powerstate by first
160 * checking the previous powerstate for the domain. If that was OFF,
161 * then logic has been lost. If previous state was RETENTION, the
162 * function reads the setting for the next retention logic state to
163 * see the actual value. In every other case, the logic is
164 * retained. Returns either PWRDM_POWER_OFF or PWRDM_POWER_RET
165 * depending whether the logic was retained or not.
166 */
167static int omap4_pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
168{
169 int state;
170
171 state = omap4_pwrdm_read_prev_pwrst(pwrdm);
172
173 if (state == PWRDM_POWER_OFF)
174 return PWRDM_POWER_OFF;
175
176 if (state != PWRDM_POWER_RET)
177 return PWRDM_POWER_RET;
178
179 return omap4_pwrdm_read_logic_retst(pwrdm);
180}
181
154static int omap4_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank) 182static int omap4_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
155{ 183{
156 u32 m, v; 184 u32 m, v;
@@ -179,6 +207,35 @@ static int omap4_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
179 return v; 207 return v;
180} 208}
181 209
210/**
211 * omap4_pwrdm_read_prev_mem_pwrst - reads the previous memory powerstate
212 * @pwrdm: struct powerdomain * to read mem powerstate for
213 * @bank: memory bank index
214 *
215 * Reads the previous memory powerstate for a powerdomain. This
216 * function must determine the previous memory powerstate by first
217 * checking the previous powerstate for the domain. If that was OFF,
218 * then logic has been lost. If previous state was RETENTION, the
219 * function reads the setting for the next memory retention state to
220 * see the actual value. In every other case, the logic is
221 * retained. Returns either PWRDM_POWER_OFF or PWRDM_POWER_RET
222 * depending whether logic was retained or not.
223 */
224static int omap4_pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
225{
226 int state;
227
228 state = omap4_pwrdm_read_prev_pwrst(pwrdm);
229
230 if (state == PWRDM_POWER_OFF)
231 return PWRDM_POWER_OFF;
232
233 if (state != PWRDM_POWER_RET)
234 return PWRDM_POWER_RET;
235
236 return omap4_pwrdm_read_mem_retst(pwrdm, bank);
237}
238
182static int omap4_pwrdm_wait_transition(struct powerdomain *pwrdm) 239static int omap4_pwrdm_wait_transition(struct powerdomain *pwrdm)
183{ 240{
184 u32 c = 0; 241 u32 c = 0;
@@ -198,8 +255,8 @@ static int omap4_pwrdm_wait_transition(struct powerdomain *pwrdm)
198 udelay(1); 255 udelay(1);
199 256
200 if (c > PWRDM_TRANSITION_BAILOUT) { 257 if (c > PWRDM_TRANSITION_BAILOUT) {
201 printk(KERN_ERR "powerdomain: waited too long for " 258 pr_err("powerdomain: %s: waited too long to complete transition\n",
202 "powerdomain %s to complete transition\n", pwrdm->name); 259 pwrdm->name);
203 return -EAGAIN; 260 return -EAGAIN;
204 } 261 }
205 262
@@ -217,9 +274,11 @@ struct pwrdm_ops omap4_pwrdm_operations = {
217 .pwrdm_clear_all_prev_pwrst = omap4_pwrdm_clear_all_prev_pwrst, 274 .pwrdm_clear_all_prev_pwrst = omap4_pwrdm_clear_all_prev_pwrst,
218 .pwrdm_set_logic_retst = omap4_pwrdm_set_logic_retst, 275 .pwrdm_set_logic_retst = omap4_pwrdm_set_logic_retst,
219 .pwrdm_read_logic_pwrst = omap4_pwrdm_read_logic_pwrst, 276 .pwrdm_read_logic_pwrst = omap4_pwrdm_read_logic_pwrst,
277 .pwrdm_read_prev_logic_pwrst = omap4_pwrdm_read_prev_logic_pwrst,
220 .pwrdm_read_logic_retst = omap4_pwrdm_read_logic_retst, 278 .pwrdm_read_logic_retst = omap4_pwrdm_read_logic_retst,
221 .pwrdm_read_mem_pwrst = omap4_pwrdm_read_mem_pwrst, 279 .pwrdm_read_mem_pwrst = omap4_pwrdm_read_mem_pwrst,
222 .pwrdm_read_mem_retst = omap4_pwrdm_read_mem_retst, 280 .pwrdm_read_mem_retst = omap4_pwrdm_read_mem_retst,
281 .pwrdm_read_prev_mem_pwrst = omap4_pwrdm_read_prev_mem_pwrst,
223 .pwrdm_set_mem_onst = omap4_pwrdm_set_mem_onst, 282 .pwrdm_set_mem_onst = omap4_pwrdm_set_mem_onst,
224 .pwrdm_set_mem_retst = omap4_pwrdm_set_mem_retst, 283 .pwrdm_set_mem_retst = omap4_pwrdm_set_mem_retst,
225 .pwrdm_wait_transition = omap4_pwrdm_wait_transition, 284 .pwrdm_wait_transition = omap4_pwrdm_wait_transition,
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c
index bb883e46307..8b23d234fb5 100644
--- a/arch/arm/mach-omap2/powerdomains3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c
@@ -15,11 +15,9 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/bug.h> 16#include <linux/bug.h>
17 17
18#include <plat/cpu.h> 18#include "soc.h"
19
20#include "powerdomain.h" 19#include "powerdomain.h"
21#include "powerdomains2xxx_3xxx_data.h" 20#include "powerdomains2xxx_3xxx_data.h"
22
23#include "prcm-common.h" 21#include "prcm-common.h"
24#include "prm2xxx_3xxx.h" 22#include "prm2xxx_3xxx.h"
25#include "prm-regbits-34xx.h" 23#include "prm-regbits-34xx.h"
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index e5f0503a68b..72df97482cc 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -109,6 +109,8 @@
109#define OMAP2430_EN_MDM_INTC_MASK (1 << 11) 109#define OMAP2430_EN_MDM_INTC_MASK (1 << 11)
110#define OMAP2430_EN_USBHS_SHIFT 6 110#define OMAP2430_EN_USBHS_SHIFT 6
111#define OMAP2430_EN_USBHS_MASK (1 << 6) 111#define OMAP2430_EN_USBHS_MASK (1 << 6)
112#define OMAP24XX_EN_GPMC_SHIFT 1
113#define OMAP24XX_EN_GPMC_MASK (1 << 1)
112 114
113/* CM_IDLEST1_CORE, PM_WKST1_CORE shared bits */ 115/* CM_IDLEST1_CORE, PM_WKST1_CORE shared bits */
114#define OMAP2420_ST_MMC_SHIFT 26 116#define OMAP2420_ST_MMC_SHIFT 26
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index 053e24ed3c4..0f51e034e0a 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -27,7 +27,6 @@
27 27
28#include "common.h" 28#include "common.h"
29#include <plat/prcm.h> 29#include <plat/prcm.h>
30#include <plat/irqs.h>
31 30
32#include "clock.h" 31#include "clock.h"
33#include "clock2xxx.h" 32#include "clock2xxx.h"
@@ -140,11 +139,11 @@ int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
140 MAX_MODULE_ENABLE_WAIT, i); 139 MAX_MODULE_ENABLE_WAIT, i);
141 140
142 if (i < MAX_MODULE_ENABLE_WAIT) 141 if (i < MAX_MODULE_ENABLE_WAIT)
143 pr_debug("cm: Module associated with clock %s ready after %d " 142 pr_debug("cm: Module associated with clock %s ready after %d loops\n",
144 "loops\n", name, i); 143 name, i);
145 else 144 else
146 pr_err("cm: Module associated with clock %s didn't enable in " 145 pr_err("cm: Module associated with clock %s didn't enable in %d tries\n",
147 "%d tries\n", name, MAX_MODULE_ENABLE_WAIT); 146 name, MAX_MODULE_ENABLE_WAIT);
148 147
149 return (i < MAX_MODULE_ENABLE_WAIT) ? 1 : 0; 148 return (i < MAX_MODULE_ENABLE_WAIT) ? 1 : 0;
150}; 149};
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index a0309dea679..9529984d8d2 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -17,11 +17,10 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/irq.h> 18#include <linux/irq.h>
19 19
20#include "common.h"
21#include <plat/cpu.h>
22#include <plat/prcm.h> 20#include <plat/prcm.h>
23#include <plat/irqs.h>
24 21
22#include "soc.h"
23#include "common.h"
25#include "vp.h" 24#include "vp.h"
26 25
27#include "prm2xxx_3xxx.h" 26#include "prm2xxx_3xxx.h"
@@ -40,7 +39,7 @@ static struct omap_prcm_irq_setup omap3_prcm_irq_setup = {
40 .nr_regs = 1, 39 .nr_regs = 1,
41 .irqs = omap3_prcm_irqs, 40 .irqs = omap3_prcm_irqs,
42 .nr_irqs = ARRAY_SIZE(omap3_prcm_irqs), 41 .nr_irqs = ARRAY_SIZE(omap3_prcm_irqs),
43 .irq = INT_34XX_PRCM_MPU_IRQ, 42 .irq = 11 + OMAP_INTC_START,
44 .read_pending_irqs = &omap3xxx_prm_read_pending_irqs, 43 .read_pending_irqs = &omap3xxx_prm_read_pending_irqs,
45 .ocp_barrier = &omap3xxx_prm_ocp_barrier, 44 .ocp_barrier = &omap3xxx_prm_ocp_barrier,
46 .save_and_clear_irqen = &omap3xxx_prm_save_and_clear_irqen, 45 .save_and_clear_irqen = &omap3xxx_prm_save_and_clear_irqen,
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index bb727c2d933..f0c4d5f4a17 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -17,10 +17,9 @@
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <plat/cpu.h>
21#include <plat/irqs.h>
22#include <plat/prcm.h> 20#include <plat/prcm.h>
23 21
22#include "soc.h"
24#include "iomap.h" 23#include "iomap.h"
25#include "common.h" 24#include "common.h"
26#include "vp.h" 25#include "vp.h"
@@ -40,7 +39,7 @@ static struct omap_prcm_irq_setup omap4_prcm_irq_setup = {
40 .nr_regs = 2, 39 .nr_regs = 2,
41 .irqs = omap4_prcm_irqs, 40 .irqs = omap4_prcm_irqs,
42 .nr_irqs = ARRAY_SIZE(omap4_prcm_irqs), 41 .nr_irqs = ARRAY_SIZE(omap4_prcm_irqs),
43 .irq = OMAP44XX_IRQ_PRCM, 42 .irq = 11 + OMAP44XX_IRQ_GIC_START,
44 .read_pending_irqs = &omap44xx_prm_read_pending_irqs, 43 .read_pending_irqs = &omap44xx_prm_read_pending_irqs,
45 .ocp_barrier = &omap44xx_prm_ocp_barrier, 44 .ocp_barrier = &omap44xx_prm_ocp_barrier,
46 .save_and_clear_irqen = &omap44xx_prm_save_and_clear_irqen, 45 .save_and_clear_irqen = &omap44xx_prm_save_and_clear_irqen,
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 03b126d9ad9..6b4d332be2f 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -26,7 +26,6 @@
26 26
27#include <plat/common.h> 27#include <plat/common.h>
28#include <plat/prcm.h> 28#include <plat/prcm.h>
29#include <plat/irqs.h>
30 29
31#include "prm2xxx_3xxx.h" 30#include "prm2xxx_3xxx.h"
32#include "prm44xx.h" 31#include "prm44xx.h"
diff --git a/arch/arm/mach-omap2/sdrc2xxx.c b/arch/arm/mach-omap2/sdrc2xxx.c
index 1133bb2f632..73e55e48532 100644
--- a/arch/arm/mach-omap2/sdrc2xxx.c
+++ b/arch/arm/mach-omap2/sdrc2xxx.c
@@ -24,11 +24,11 @@
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include <plat/hardware.h>
28#include <plat/clock.h> 27#include <plat/clock.h>
29#include <plat/sram.h> 28#include <plat/sram.h>
30#include <plat/sdrc.h> 29#include <plat/sdrc.h>
31 30
31#include "soc.h"
32#include "iomap.h" 32#include "iomap.h"
33#include "common.h" 33#include "common.h"
34#include "prm2xxx_3xxx.h" 34#include "prm2xxx_3xxx.h"
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index c1b93c752d7..0405c819080 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -29,11 +29,11 @@
29 29
30#include <plat/omap-serial.h> 30#include <plat/omap-serial.h>
31#include "common.h" 31#include "common.h"
32#include <plat/board.h>
33#include <plat/dma.h> 32#include <plat/dma.h>
34#include <plat/omap_hwmod.h> 33#include <plat/omap_hwmod.h>
35#include <plat/omap_device.h> 34#include <plat/omap_device.h>
36#include <plat/omap-pm.h> 35#include <plat/omap-pm.h>
36#include <plat/serial.h>
37 37
38#include "prm2xxx_3xxx.h" 38#include "prm2xxx_3xxx.h"
39#include "pm.h" 39#include "pm.h"
@@ -81,8 +81,9 @@ static struct omap_uart_port_info omap_serial_default_info[] __initdata = {
81}; 81};
82 82
83#ifdef CONFIG_PM 83#ifdef CONFIG_PM
84static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable) 84static void omap_uart_enable_wakeup(struct device *dev, bool enable)
85{ 85{
86 struct platform_device *pdev = to_platform_device(dev);
86 struct omap_device *od = to_omap_device(pdev); 87 struct omap_device *od = to_omap_device(pdev);
87 88
88 if (!od) 89 if (!od)
@@ -99,15 +100,17 @@ static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable)
99 * in Smartidle Mode When Configured for DMA Operations. 100 * in Smartidle Mode When Configured for DMA Operations.
100 * WA: configure uart in force idle mode. 101 * WA: configure uart in force idle mode.
101 */ 102 */
102static void omap_uart_set_noidle(struct platform_device *pdev) 103static void omap_uart_set_noidle(struct device *dev)
103{ 104{
105 struct platform_device *pdev = to_platform_device(dev);
104 struct omap_device *od = to_omap_device(pdev); 106 struct omap_device *od = to_omap_device(pdev);
105 107
106 omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_NO); 108 omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_NO);
107} 109}
108 110
109static void omap_uart_set_smartidle(struct platform_device *pdev) 111static void omap_uart_set_smartidle(struct device *dev)
110{ 112{
113 struct platform_device *pdev = to_platform_device(dev);
111 struct omap_device *od = to_omap_device(pdev); 114 struct omap_device *od = to_omap_device(pdev);
112 u8 idlemode; 115 u8 idlemode;
113 116
@@ -120,10 +123,10 @@ static void omap_uart_set_smartidle(struct platform_device *pdev)
120} 123}
121 124
122#else 125#else
123static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable) 126static void omap_uart_enable_wakeup(struct device *dev, bool enable)
124{} 127{}
125static void omap_uart_set_noidle(struct platform_device *pdev) {} 128static void omap_uart_set_noidle(struct device *dev) {}
126static void omap_uart_set_smartidle(struct platform_device *pdev) {} 129static void omap_uart_set_smartidle(struct device *dev) {}
127#endif /* CONFIG_PM */ 130#endif /* CONFIG_PM */
128 131
129#ifdef CONFIG_OMAP_MUX 132#ifdef CONFIG_OMAP_MUX
@@ -229,9 +232,8 @@ static int __init omap_serial_early_init(void)
229 232
230 if (console_loglevel >= 10) { 233 if (console_loglevel >= 10) {
231 uart_debug = true; 234 uart_debug = true;
232 pr_info("%s used as console in debug mode" 235 pr_info("%s used as console in debug mode: uart%d clocks will not be gated",
233 " uart%d clocks will not be" 236 uart_name, uart->num);
234 " gated", uart_name, uart->num);
235 } 237 }
236 238
237 if (cmdline_find_option("no_console_suspend")) 239 if (cmdline_find_option("no_console_suspend"))
@@ -304,6 +306,9 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
304 omap_up.dma_rx_timeout = info->dma_rx_timeout; 306 omap_up.dma_rx_timeout = info->dma_rx_timeout;
305 omap_up.dma_rx_poll_rate = info->dma_rx_poll_rate; 307 omap_up.dma_rx_poll_rate = info->dma_rx_poll_rate;
306 omap_up.autosuspend_timeout = info->autosuspend_timeout; 308 omap_up.autosuspend_timeout = info->autosuspend_timeout;
309 omap_up.DTR_gpio = info->DTR_gpio;
310 omap_up.DTR_inverted = info->DTR_inverted;
311 omap_up.DTR_present = info->DTR_present;
307 312
308 pdata = &omap_up; 313 pdata = &omap_up;
309 pdata_size = sizeof(struct omap_uart_port_info); 314 pdata_size = sizeof(struct omap_uart_port_info);
@@ -313,8 +318,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
313 318
314 pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size, 319 pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size,
315 NULL, 0, false); 320 NULL, 0, false);
316 WARN(IS_ERR(pdev), "Could not build omap_device for %s: %s.\n", 321 if (IS_ERR(pdev)) {
317 name, oh->name); 322 WARN(1, "Could not build omap_device for %s: %s.\n", name,
323 oh->name);
324 return;
325 }
318 326
319 if ((console_uart_id == bdata->id) && no_console_suspend) 327 if ((console_uart_id == bdata->id) && no_console_suspend)
320 omap_device_disable_idle_on_suspend(pdev); 328 omap_device_disable_idle_on_suspend(pdev);
diff --git a/arch/arm/mach-omap2/sleep24xx.S b/arch/arm/mach-omap2/sleep24xx.S
index d4bf904d84a..ce0ccd26efb 100644
--- a/arch/arm/mach-omap2/sleep24xx.S
+++ b/arch/arm/mach-omap2/sleep24xx.S
@@ -28,8 +28,7 @@
28#include <linux/linkage.h> 28#include <linux/linkage.h>
29#include <asm/assembler.h> 29#include <asm/assembler.h>
30 30
31#include <plat/omap24xx.h> 31#include "omap24xx.h"
32
33#include "sdrc.h" 32#include "sdrc.h"
34 33
35/* First address of reserved address space? apparently valid for OMAP2 & 3 */ 34/* First address of reserved address space? apparently valid for OMAP2 & 3 */
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 1f62f23673f..506987979c1 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -26,9 +26,9 @@
26 26
27#include <asm/assembler.h> 27#include <asm/assembler.h>
28 28
29#include <plat/hardware.h>
30#include <plat/sram.h> 29#include <plat/sram.h>
31 30
31#include "omap34xx.h"
32#include "iomap.h" 32#include "iomap.h"
33#include "cm2xxx_3xxx.h" 33#include "cm2xxx_3xxx.h"
34#include "prm2xxx_3xxx.h" 34#include "prm2xxx_3xxx.h"
diff --git a/arch/arm/mach-omap2/sleep44xx.S b/arch/arm/mach-omap2/sleep44xx.S
index 91e71d8f46f..88ff83a0942 100644
--- a/arch/arm/mach-omap2/sleep44xx.S
+++ b/arch/arm/mach-omap2/sleep44xx.S
@@ -14,10 +14,10 @@
14#include <asm/memory.h> 14#include <asm/memory.h>
15#include <asm/hardware/cache-l2x0.h> 15#include <asm/hardware/cache-l2x0.h>
16 16
17#include <plat/omap44xx.h> 17#include "omap-secure.h"
18#include <mach/omap-secure.h>
19 18
20#include "common.h" 19#include "common.h"
20#include "omap44xx.h"
21#include "omap4-sar-layout.h" 21#include "omap4-sar-layout.h"
22 22
23#if defined(CONFIG_SMP) && defined(CONFIG_PM) 23#if defined(CONFIG_SMP) && defined(CONFIG_PM)
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
new file mode 100644
index 00000000000..fc9b96daf85
--- /dev/null
+++ b/arch/arm/mach-omap2/soc.h
@@ -0,0 +1,7 @@
1#include <plat/cpu.h>
2#include "omap24xx.h"
3#include "omap34xx.h"
4#include "omap44xx.h"
5#include "ti81xx.h"
6#include "am33xx.h"
7#include "omap54xx.h"
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index d033a65f4e4..f8217a5a4a2 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -104,16 +104,15 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
104 104
105 sr_data = kzalloc(sizeof(struct omap_sr_data), GFP_KERNEL); 105 sr_data = kzalloc(sizeof(struct omap_sr_data), GFP_KERNEL);
106 if (!sr_data) { 106 if (!sr_data) {
107 pr_err("%s: Unable to allocate memory for %s sr_data.Error!\n", 107 pr_err("%s: Unable to allocate memory for %s sr_data\n",
108 __func__, oh->name); 108 __func__, oh->name);
109 return -ENOMEM; 109 return -ENOMEM;
110 } 110 }
111 111
112 sr_dev_attr = (struct omap_smartreflex_dev_attr *)oh->dev_attr; 112 sr_dev_attr = (struct omap_smartreflex_dev_attr *)oh->dev_attr;
113 if (!sr_dev_attr || !sr_dev_attr->sensor_voltdm_name) { 113 if (!sr_dev_attr || !sr_dev_attr->sensor_voltdm_name) {
114 pr_err("%s: No voltage domain specified for %s." 114 pr_err("%s: No voltage domain specified for %s. Cannot initialize\n",
115 "Cannot initialize\n", __func__, 115 __func__, oh->name);
116 oh->name);
117 goto exit; 116 goto exit;
118 } 117 }
119 118
@@ -123,7 +122,7 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
123 sr_data->senp_mod = 0x1; 122 sr_data->senp_mod = 0x1;
124 123
125 sr_data->voltdm = voltdm_lookup(sr_dev_attr->sensor_voltdm_name); 124 sr_data->voltdm = voltdm_lookup(sr_dev_attr->sensor_voltdm_name);
126 if (IS_ERR(sr_data->voltdm)) { 125 if (!sr_data->voltdm) {
127 pr_err("%s: Unable to get voltage domain pointer for VDD %s\n", 126 pr_err("%s: Unable to get voltage domain pointer for VDD %s\n",
128 __func__, sr_dev_attr->sensor_voltdm_name); 127 __func__, sr_dev_attr->sensor_voltdm_name);
129 goto exit; 128 goto exit;
@@ -131,8 +130,8 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
131 130
132 omap_voltage_get_volttable(sr_data->voltdm, &volt_data); 131 omap_voltage_get_volttable(sr_data->voltdm, &volt_data);
133 if (!volt_data) { 132 if (!volt_data) {
134 pr_warning("%s: No Voltage table registered fo VDD%d." 133 pr_err("%s: No Voltage table registered for VDD%d\n",
135 "Something really wrong\n\n", __func__, i + 1); 134 __func__, i + 1);
136 goto exit; 135 goto exit;
137 } 136 }
138 137
diff --git a/arch/arm/mach-omap2/sram242x.S b/arch/arm/mach-omap2/sram242x.S
index ee0bfcc1410..8f7326cd435 100644
--- a/arch/arm/mach-omap2/sram242x.S
+++ b/arch/arm/mach-omap2/sram242x.S
@@ -32,8 +32,7 @@
32 32
33#include <asm/assembler.h> 33#include <asm/assembler.h>
34 34
35#include <mach/hardware.h> 35#include "soc.h"
36
37#include "iomap.h" 36#include "iomap.h"
38#include "prm2xxx_3xxx.h" 37#include "prm2xxx_3xxx.h"
39#include "cm2xxx_3xxx.h" 38#include "cm2xxx_3xxx.h"
diff --git a/arch/arm/mach-omap2/sram243x.S b/arch/arm/mach-omap2/sram243x.S
index d4d39ef0476..b140d657852 100644
--- a/arch/arm/mach-omap2/sram243x.S
+++ b/arch/arm/mach-omap2/sram243x.S
@@ -32,8 +32,7 @@
32 32
33#include <asm/assembler.h> 33#include <asm/assembler.h>
34 34
35#include <mach/hardware.h> 35#include "soc.h"
36
37#include "iomap.h" 36#include "iomap.h"
38#include "prm2xxx_3xxx.h" 37#include "prm2xxx_3xxx.h"
39#include "cm2xxx_3xxx.h" 38#include "cm2xxx_3xxx.h"
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S
index df5a21322b0..2d0ceaa23fb 100644
--- a/arch/arm/mach-omap2/sram34xx.S
+++ b/arch/arm/mach-omap2/sram34xx.S
@@ -29,8 +29,7 @@
29 29
30#include <asm/assembler.h> 30#include <asm/assembler.h>
31 31
32#include <mach/hardware.h> 32#include "soc.h"
33
34#include "iomap.h" 33#include "iomap.h"
35#include "sdrc.h" 34#include "sdrc.h"
36#include "cm2xxx_3xxx.h" 35#include "cm2xxx_3xxx.h"
diff --git a/arch/arm/plat-omap/include/plat/ti81xx.h b/arch/arm/mach-omap2/ti81xx.h
index 8f9843f7842..8f9843f7842 100644
--- a/arch/arm/plat-omap/include/plat/ti81xx.h
+++ b/arch/arm/mach-omap2/ti81xx.h
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 2ff6d41ec6c..44f9aa7ec0c 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -36,16 +36,20 @@
36#include <linux/clocksource.h> 36#include <linux/clocksource.h>
37#include <linux/clockchips.h> 37#include <linux/clockchips.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/of.h>
39 40
40#include <asm/mach/time.h> 41#include <asm/mach/time.h>
41#include <plat/dmtimer.h>
42#include <asm/smp_twd.h> 42#include <asm/smp_twd.h>
43#include <asm/sched_clock.h> 43#include <asm/sched_clock.h>
44#include "common.h" 44
45#include <asm/arch_timer.h>
45#include <plat/omap_hwmod.h> 46#include <plat/omap_hwmod.h>
46#include <plat/omap_device.h> 47#include <plat/omap_device.h>
48#include <plat/dmtimer.h>
47#include <plat/omap-pm.h> 49#include <plat/omap-pm.h>
48 50
51#include "soc.h"
52#include "common.h"
49#include "powerdomain.h" 53#include "powerdomain.h"
50 54
51/* Parent clocks, eventually these will come from the clock framework */ 55/* Parent clocks, eventually these will come from the clock framework */
@@ -69,6 +73,11 @@
69#define OMAP3_SECURE_TIMER 1 73#define OMAP3_SECURE_TIMER 1
70#endif 74#endif
71 75
76#define REALTIME_COUNTER_BASE 0x48243200
77#define INCREMENTER_NUMERATOR_OFFSET 0x10
78#define INCREMENTER_DENUMERATOR_RELOAD_OFFSET 0x14
79#define NUMERATOR_DENUMERATOR_MASK 0xfffff000
80
72/* Clockevent code */ 81/* Clockevent code */
73 82
74static struct omap_dm_timer clkev; 83static struct omap_dm_timer clkev;
@@ -211,7 +220,7 @@ static void __init omap2_gp_clockevent_init(int gptimer_id,
211 res = omap_dm_timer_init_one(&clkev, gptimer_id, fck_source); 220 res = omap_dm_timer_init_one(&clkev, gptimer_id, fck_source);
212 BUG_ON(res); 221 BUG_ON(res);
213 222
214 omap2_gp_timer_irq.dev_id = (void *)&clkev; 223 omap2_gp_timer_irq.dev_id = &clkev;
215 setup_irq(clkev.irq, &omap2_gp_timer_irq); 224 setup_irq(clkev.irq, &omap2_gp_timer_irq);
216 225
217 __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW); 226 __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW);
@@ -260,6 +269,7 @@ static u32 notrace dmtimer_read_sched_clock(void)
260 return 0; 269 return 0;
261} 270}
262 271
272#ifdef CONFIG_OMAP_32K_TIMER
263/* Setup free-running counter for clocksource */ 273/* Setup free-running counter for clocksource */
264static int __init omap2_sync32k_clocksource_init(void) 274static int __init omap2_sync32k_clocksource_init(void)
265{ 275{
@@ -299,6 +309,12 @@ static int __init omap2_sync32k_clocksource_init(void)
299 309
300 return ret; 310 return ret;
301} 311}
312#else
313static inline int omap2_sync32k_clocksource_init(void)
314{
315 return -ENODEV;
316}
317#endif
302 318
303static void __init omap2_gptimer_clocksource_init(int gptimer_id, 319static void __init omap2_gptimer_clocksource_init(int gptimer_id,
304 const char *fck_source) 320 const char *fck_source)
@@ -339,6 +355,84 @@ static void __init omap2_clocksource_init(int gptimer_id,
339 omap2_gptimer_clocksource_init(gptimer_id, fck_source); 355 omap2_gptimer_clocksource_init(gptimer_id, fck_source);
340} 356}
341 357
358#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
359/*
360 * The realtime counter also called master counter, is a free-running
361 * counter, which is related to real time. It produces the count used
362 * by the CPU local timer peripherals in the MPU cluster. The timer counts
363 * at a rate of 6.144 MHz. Because the device operates on different clocks
364 * in different power modes, the master counter shifts operation between
365 * clocks, adjusting the increment per clock in hardware accordingly to
366 * maintain a constant count rate.
367 */
368static void __init realtime_counter_init(void)
369{
370 void __iomem *base;
371 static struct clk *sys_clk;
372 unsigned long rate;
373 unsigned int reg, num, den;
374
375 base = ioremap(REALTIME_COUNTER_BASE, SZ_32);
376 if (!base) {
377 pr_err("%s: ioremap failed\n", __func__);
378 return;
379 }
380 sys_clk = clk_get(NULL, "sys_clkin_ck");
381 if (IS_ERR(sys_clk)) {
382 pr_err("%s: failed to get system clock handle\n", __func__);
383 iounmap(base);
384 return;
385 }
386
387 rate = clk_get_rate(sys_clk);
388 /* Numerator/denumerator values refer TRM Realtime Counter section */
389 switch (rate) {
390 case 1200000:
391 num = 64;
392 den = 125;
393 break;
394 case 1300000:
395 num = 768;
396 den = 1625;
397 break;
398 case 19200000:
399 num = 8;
400 den = 25;
401 break;
402 case 2600000:
403 num = 384;
404 den = 1625;
405 break;
406 case 2700000:
407 num = 256;
408 den = 1125;
409 break;
410 case 38400000:
411 default:
412 /* Program it for 38.4 MHz */
413 num = 4;
414 den = 25;
415 break;
416 }
417
418 /* Program numerator and denumerator registers */
419 reg = __raw_readl(base + INCREMENTER_NUMERATOR_OFFSET) &
420 NUMERATOR_DENUMERATOR_MASK;
421 reg |= num;
422 __raw_writel(reg, base + INCREMENTER_NUMERATOR_OFFSET);
423
424 reg = __raw_readl(base + INCREMENTER_NUMERATOR_OFFSET) &
425 NUMERATOR_DENUMERATOR_MASK;
426 reg |= den;
427 __raw_writel(reg, base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET);
428
429 iounmap(base);
430}
431#else
432static inline void __init realtime_counter_init(void)
433{}
434#endif
435
342#define OMAP_SYS_TIMER_INIT(name, clkev_nr, clkev_src, \ 436#define OMAP_SYS_TIMER_INIT(name, clkev_nr, clkev_src, \
343 clksrc_nr, clksrc_src) \ 437 clksrc_nr, clksrc_src) \
344static void __init omap##name##_timer_init(void) \ 438static void __init omap##name##_timer_init(void) \
@@ -373,8 +467,7 @@ OMAP_SYS_TIMER(3_am33xx)
373#ifdef CONFIG_ARCH_OMAP4 467#ifdef CONFIG_ARCH_OMAP4
374#ifdef CONFIG_LOCAL_TIMERS 468#ifdef CONFIG_LOCAL_TIMERS
375static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 469static DEFINE_TWD_LOCAL_TIMER(twd_local_timer,
376 OMAP44XX_LOCAL_TWD_BASE, 470 OMAP44XX_LOCAL_TWD_BASE, 29 + OMAP_INTC_START);
377 OMAP44XX_IRQ_LOCALTIMER);
378#endif 471#endif
379 472
380static void __init omap4_timer_init(void) 473static void __init omap4_timer_init(void)
@@ -386,6 +479,11 @@ static void __init omap4_timer_init(void)
386 if (omap_rev() != OMAP4430_REV_ES1_0) { 479 if (omap_rev() != OMAP4430_REV_ES1_0) {
387 int err; 480 int err;
388 481
482 if (of_have_populated_dt()) {
483 twd_local_timer_of_register();
484 return;
485 }
486
389 err = twd_local_timer_register(&twd_local_timer); 487 err = twd_local_timer_register(&twd_local_timer);
390 if (err) 488 if (err)
391 pr_err("twd_local_timer_register failed %d\n", err); 489 pr_err("twd_local_timer_register failed %d\n", err);
@@ -396,7 +494,18 @@ OMAP_SYS_TIMER(4)
396#endif 494#endif
397 495
398#ifdef CONFIG_SOC_OMAP5 496#ifdef CONFIG_SOC_OMAP5
399OMAP_SYS_TIMER_INIT(5, 1, OMAP4_CLKEV_SOURCE, 2, OMAP4_MPU_SOURCE) 497static void __init omap5_timer_init(void)
498{
499 int err;
500
501 omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE);
502 omap2_clocksource_init(2, OMAP4_MPU_SOURCE);
503 realtime_counter_init();
504
505 err = arch_timer_of_register();
506 if (err)
507 pr_err("%s: arch_timer_register failed %d\n", __func__, err);
508}
400OMAP_SYS_TIMER(5) 509OMAP_SYS_TIMER(5)
401#endif 510#endif
402 511
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index db5ff664237..635e109f5ad 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -29,6 +29,7 @@
29#include <plat/i2c.h> 29#include <plat/i2c.h>
30#include <plat/usb.h> 30#include <plat/usb.h>
31 31
32#include "soc.h"
32#include "twl-common.h" 33#include "twl-common.h"
33#include "pm.h" 34#include "pm.h"
34#include "voltage.h" 35#include "voltage.h"
@@ -39,16 +40,6 @@ static struct i2c_board_info __initdata pmic_i2c_board_info = {
39 .flags = I2C_CLIENT_WAKE, 40 .flags = I2C_CLIENT_WAKE,
40}; 41};
41 42
42static struct i2c_board_info __initdata omap4_i2c1_board_info[] = {
43 {
44 .addr = 0x48,
45 .flags = I2C_CLIENT_WAKE,
46 },
47 {
48 I2C_BOARD_INFO("twl6040", 0x4b),
49 },
50};
51
52#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) 43#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
53static int twl_set_voltage(void *data, int target_uV) 44static int twl_set_voltage(void *data, int target_uV)
54{ 45{
@@ -78,30 +69,25 @@ void __init omap_pmic_init(int bus, u32 clkrate,
78 69
79void __init omap4_pmic_init(const char *pmic_type, 70void __init omap4_pmic_init(const char *pmic_type,
80 struct twl4030_platform_data *pmic_data, 71 struct twl4030_platform_data *pmic_data,
81 struct twl6040_platform_data *twl6040_data, int twl6040_irq) 72 struct i2c_board_info *devices, int nr_devices)
82{ 73{
83 /* PMIC part*/ 74 /* PMIC part*/
84 omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); 75 omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
85 strncpy(omap4_i2c1_board_info[0].type, pmic_type, 76 omap_pmic_init(1, 400, pmic_type, 7 + OMAP44XX_IRQ_GIC_START, pmic_data);
86 sizeof(omap4_i2c1_board_info[0].type));
87 omap4_i2c1_board_info[0].irq = OMAP44XX_IRQ_SYS_1N;
88 omap4_i2c1_board_info[0].platform_data = pmic_data;
89
90 /* TWL6040 audio IC part */
91 omap4_i2c1_board_info[1].irq = twl6040_irq;
92 omap4_i2c1_board_info[1].platform_data = twl6040_data;
93
94 omap_register_i2c_bus(1, 400, omap4_i2c1_board_info, 2);
95 77
78 /* Register additional devices on i2c1 bus if needed */
79 if (devices)
80 i2c_register_board_info(1, devices, nr_devices);
96} 81}
97 82
98void __init omap_pmic_late_init(void) 83void __init omap_pmic_late_init(void)
99{ 84{
100 /* Init the OMAP TWL parameters (if PMIC has been registered) */ 85 /* Init the OMAP TWL parameters (if PMIC has been registerd) */
101 if (pmic_i2c_board_info.irq) 86 if (!pmic_i2c_board_info.irq)
102 omap3_twl_init(); 87 return;
103 if (omap4_i2c1_board_info[0].irq) 88
104 omap4_twl_init(); 89 omap3_twl_init();
90 omap4_twl_init();
105} 91}
106 92
107#if defined(CONFIG_ARCH_OMAP3) 93#if defined(CONFIG_ARCH_OMAP3)
@@ -172,7 +158,7 @@ static struct regulator_init_data omap3_vpll2_idata = {
172}; 158};
173 159
174static struct regulator_consumer_supply omap3_vdd1_supply[] = { 160static struct regulator_consumer_supply omap3_vdd1_supply[] = {
175 REGULATOR_SUPPLY("vcc", "mpu.0"), 161 REGULATOR_SUPPLY("vcc", "cpu0"),
176}; 162};
177 163
178static struct regulator_consumer_supply omap3_vdd2_supply[] = { 164static struct regulator_consumer_supply omap3_vdd2_supply[] = {
@@ -251,11 +237,10 @@ void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
251 237
252#if defined(CONFIG_ARCH_OMAP4) 238#if defined(CONFIG_ARCH_OMAP4)
253static struct twl4030_usb_data omap4_usb_pdata = { 239static struct twl4030_usb_data omap4_usb_pdata = {
254 .phy_init = omap4430_phy_init, 240};
255 .phy_exit = omap4430_phy_exit, 241
256 .phy_power = omap4430_phy_power, 242static struct regulator_consumer_supply omap4_vdda_hdmi_dac_supplies[] = {
257 .phy_set_clock = omap4430_phy_set_clk, 243 REGULATOR_SUPPLY("vdda_hdmi_dac", "omapdss_hdmi"),
258 .phy_suspend = omap4430_phy_suspend,
259}; 244};
260 245
261static struct regulator_init_data omap4_vdac_idata = { 246static struct regulator_init_data omap4_vdac_idata = {
@@ -267,6 +252,8 @@ static struct regulator_init_data omap4_vdac_idata = {
267 .valid_ops_mask = REGULATOR_CHANGE_MODE 252 .valid_ops_mask = REGULATOR_CHANGE_MODE
268 | REGULATOR_CHANGE_STATUS, 253 | REGULATOR_CHANGE_STATUS,
269 }, 254 },
255 .num_consumer_supplies = ARRAY_SIZE(omap4_vdda_hdmi_dac_supplies),
256 .consumer_supplies = omap4_vdda_hdmi_dac_supplies,
270 .supply_regulator = "V2V1", 257 .supply_regulator = "V2V1",
271}; 258};
272 259
@@ -538,3 +525,30 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
538 pmic_data->v2v1 = &omap4_v2v1_idata; 525 pmic_data->v2v1 = &omap4_v2v1_idata;
539} 526}
540#endif /* CONFIG_ARCH_OMAP4 */ 527#endif /* CONFIG_ARCH_OMAP4 */
528
529#if defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) || \
530 defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030_MODULE)
531#include <linux/platform_data/omap-twl4030.h>
532
533static struct omap_tw4030_pdata omap_twl4030_audio_data;
534
535static struct platform_device audio_device = {
536 .name = "omap-twl4030",
537 .id = -1,
538 .dev = {
539 .platform_data = &omap_twl4030_audio_data,
540 },
541};
542
543void __init omap_twl4030_audio_init(char *card_name)
544{
545 omap_twl4030_audio_data.card_name = card_name;
546 platform_device_register(&audio_device);
547}
548
549#else /* SOC_OMAP_TWL4030 */
550void __init omap_twl4030_audio_init(char *card_name)
551{
552 return;
553}
554#endif /* SOC_OMAP_TWL4030 */
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h
index 8fe71cfd002..dcfbad5ac47 100644
--- a/arch/arm/mach-omap2/twl-common.h
+++ b/arch/arm/mach-omap2/twl-common.h
@@ -1,7 +1,7 @@
1#ifndef __OMAP_PMIC_COMMON__ 1#ifndef __OMAP_PMIC_COMMON__
2#define __OMAP_PMIC_COMMON__ 2#define __OMAP_PMIC_COMMON__
3 3
4#include <plat/irqs.h> 4#include "common.h"
5 5
6#define TWL_COMMON_PDATA_USB (1 << 0) 6#define TWL_COMMON_PDATA_USB (1 << 0)
7#define TWL_COMMON_PDATA_BCI (1 << 1) 7#define TWL_COMMON_PDATA_BCI (1 << 1)
@@ -32,6 +32,7 @@
32 32
33struct twl4030_platform_data; 33struct twl4030_platform_data;
34struct twl6040_platform_data; 34struct twl6040_platform_data;
35struct i2c_board_info;
35 36
36void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, 37void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq,
37 struct twl4030_platform_data *pmic_data); 38 struct twl4030_platform_data *pmic_data);
@@ -40,18 +41,18 @@ void omap_pmic_late_init(void);
40static inline void omap2_pmic_init(const char *pmic_type, 41static inline void omap2_pmic_init(const char *pmic_type,
41 struct twl4030_platform_data *pmic_data) 42 struct twl4030_platform_data *pmic_data)
42{ 43{
43 omap_pmic_init(2, 2600, pmic_type, INT_24XX_SYS_NIRQ, pmic_data); 44 omap_pmic_init(2, 2600, pmic_type, 7 + OMAP_INTC_START, pmic_data);
44} 45}
45 46
46static inline void omap3_pmic_init(const char *pmic_type, 47static inline void omap3_pmic_init(const char *pmic_type,
47 struct twl4030_platform_data *pmic_data) 48 struct twl4030_platform_data *pmic_data)
48{ 49{
49 omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data); 50 omap_pmic_init(1, 2600, pmic_type, 7 + OMAP_INTC_START, pmic_data);
50} 51}
51 52
52void omap4_pmic_init(const char *pmic_type, 53void omap4_pmic_init(const char *pmic_type,
53 struct twl4030_platform_data *pmic_data, 54 struct twl4030_platform_data *pmic_data,
54 struct twl6040_platform_data *audio_data, int twl6040_irq); 55 struct i2c_board_info *devices, int nr_devices);
55 56
56void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, 57void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
57 u32 pdata_flags, u32 regulators_flags); 58 u32 pdata_flags, u32 regulators_flags);
@@ -59,4 +60,6 @@ void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
59void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, 60void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
60 u32 pdata_flags, u32 regulators_flags); 61 u32 pdata_flags, u32 regulators_flags);
61 62
63void omap_twl4030_audio_init(char *card_name);
64
62#endif /* __OMAP_PMIC_COMMON__ */ 65#endif /* __OMAP_PMIC_COMMON__ */
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index dde8a11f47d..3c434498e12 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -25,8 +25,6 @@
25 25
26#include <asm/io.h> 26#include <asm/io.h>
27 27
28#include <mach/hardware.h>
29#include <mach/irqs.h>
30#include <plat/usb.h> 28#include <plat/usb.h>
31#include <plat/omap_device.h> 29#include <plat/omap_device.h>
32 30
@@ -35,10 +33,12 @@
35#ifdef CONFIG_MFD_OMAP_USB_HOST 33#ifdef CONFIG_MFD_OMAP_USB_HOST
36 34
37#define OMAP_USBHS_DEVICE "usbhs_omap" 35#define OMAP_USBHS_DEVICE "usbhs_omap"
36#define OMAP_USBTLL_DEVICE "usbhs_tll"
38#define USBHS_UHH_HWMODNAME "usb_host_hs" 37#define USBHS_UHH_HWMODNAME "usb_host_hs"
39#define USBHS_TLL_HWMODNAME "usb_tll_hs" 38#define USBHS_TLL_HWMODNAME "usb_tll_hs"
40 39
41static struct usbhs_omap_platform_data usbhs_data; 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; 42static struct ehci_hcd_omap_platform_data ehci_data;
43static struct ohci_hcd_omap_platform_data ohci_data; 43static struct ohci_hcd_omap_platform_data ohci_data;
44 44
@@ -487,13 +487,14 @@ void __init setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
487 487
488void __init usbhs_init(const struct usbhs_omap_board_data *pdata) 488void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
489{ 489{
490 struct omap_hwmod *oh[2]; 490 struct omap_hwmod *uhh_hwm, *tll_hwm;
491 struct platform_device *pdev; 491 struct platform_device *pdev;
492 int bus_id = -1; 492 int bus_id = -1;
493 int i; 493 int i;
494 494
495 for (i = 0; i < OMAP3_HS_USB_PORTS; i++) { 495 for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
496 usbhs_data.port_mode[i] = pdata->port_mode[i]; 496 usbhs_data.port_mode[i] = pdata->port_mode[i];
497 usbtll_data.port_mode[i] = pdata->port_mode[i];
497 ohci_data.port_mode[i] = pdata->port_mode[i]; 498 ohci_data.port_mode[i] = pdata->port_mode[i];
498 ehci_data.port_mode[i] = pdata->port_mode[i]; 499 ehci_data.port_mode[i] = pdata->port_mode[i];
499 ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i]; 500 ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i];
@@ -512,25 +513,35 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
512 setup_4430ohci_io_mux(pdata->port_mode); 513 setup_4430ohci_io_mux(pdata->port_mode);
513 } 514 }
514 515
515 oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME); 516 uhh_hwm = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
516 if (!oh[0]) { 517 if (!uhh_hwm) {
517 pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME); 518 pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
518 return; 519 return;
519 } 520 }
520 521
521 oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME); 522 tll_hwm = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
522 if (!oh[1]) { 523 if (!tll_hwm) {
523 pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME); 524 pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME);
524 return; 525 return;
525 } 526 }
526 527
527 pdev = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, 528 pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm,
528 (void *)&usbhs_data, sizeof(usbhs_data), 529 &usbtll_data, sizeof(usbtll_data),
529 omap_uhhtll_latency, 530 omap_uhhtll_latency,
530 ARRAY_SIZE(omap_uhhtll_latency), false); 531 ARRAY_SIZE(omap_uhhtll_latency), false);
531 if (IS_ERR(pdev)) { 532 if (IS_ERR(pdev)) {
532 pr_err("Could not build hwmod devices %s,%s\n", 533 pr_err("Could not build hwmod device %s\n",
533 USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME); 534 USBHS_TLL_HWMODNAME);
535 return;
536 }
537
538 pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm,
539 &usbhs_data, sizeof(usbhs_data),
540 omap_uhhtll_latency,
541 ARRAY_SIZE(omap_uhhtll_latency), false);
542 if (IS_ERR(pdev)) {
543 pr_err("Could not build hwmod devices %s\n",
544 USBHS_UHH_HWMODNAME);
534 return; 545 return;
535 } 546 }
536} 547}
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index c4a57685666..51da21cb78f 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -23,14 +23,13 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/dma-mapping.h> 24#include <linux/dma-mapping.h>
25#include <linux/io.h> 25#include <linux/io.h>
26
27#include <linux/usb/musb.h> 26#include <linux/usb/musb.h>
28 27
29#include <mach/hardware.h>
30#include <mach/irqs.h>
31#include <mach/am35xx.h>
32#include <plat/usb.h> 28#include <plat/usb.h>
33#include <plat/omap_device.h> 29#include <plat/omap_device.h>
30
31#include "am35xx.h"
32
34#include "mux.h" 33#include "mux.h"
35 34
36static struct musb_hdrc_config musb_config = { 35static struct musb_hdrc_config musb_config = {
@@ -117,7 +116,4 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
117 dev->dma_mask = &musb_dmamask; 116 dev->dma_mask = &musb_dmamask;
118 dev->coherent_dma_mask = musb_dmamask; 117 dev->coherent_dma_mask = musb_dmamask;
119 put_device(dev); 118 put_device(dev);
120
121 if (cpu_is_omap44xx())
122 omap4430_phy_init(dev);
123} 119}
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index 84da34f9a7c..880249b1701 100644
--- a/arch/arm/mach-omap2/vc.c
+++ b/arch/arm/mach-omap2/vc.c
@@ -12,8 +12,7 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/bug.h> 13#include <linux/bug.h>
14 14
15#include <plat/cpu.h> 15#include "soc.h"
16
17#include "voltage.h" 16#include "voltage.h"
18#include "vc.h" 17#include "vc.h"
19#include "prm-regbits-34xx.h" 18#include "prm-regbits-34xx.h"
@@ -116,9 +115,8 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm,
116 } 115 }
117 116
118 if (!voltdm->pmic->uv_to_vsel) { 117 if (!voltdm->pmic->uv_to_vsel) {
119 pr_err("%s: PMIC function to convert voltage in uV to" 118 pr_err("%s: PMIC function to convert voltage in uV to vsel not registered. Hence unable to scale voltage for vdd_%s\n",
120 "vsel not registered. Hence unable to scale voltage" 119 __func__, voltdm->name);
121 "for vdd_%s\n", __func__, voltdm->name);
122 return -ENODATA; 120 return -ENODATA;
123 } 121 }
124 122
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
index 4dc60e83e00..3ac8fe1d821 100644
--- a/arch/arm/mach-omap2/voltage.c
+++ b/arch/arm/mach-omap2/voltage.c
@@ -195,8 +195,8 @@ struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm,
195 return &voltdm->volt_data[i]; 195 return &voltdm->volt_data[i];
196 } 196 }
197 197
198 pr_notice("%s: Unable to match the current voltage with the voltage" 198 pr_notice("%s: Unable to match the current voltage with the voltage table for vdd_%s\n",
199 "table for vdd_%s\n", __func__, voltdm->name); 199 __func__, voltdm->name);
200 200
201 return ERR_PTR(-ENODATA); 201 return ERR_PTR(-ENODATA);
202} 202}
@@ -249,8 +249,8 @@ void omap_change_voltscale_method(struct voltagedomain *voltdm,
249 voltdm->scale = omap_vc_bypass_scale; 249 voltdm->scale = omap_vc_bypass_scale;
250 return; 250 return;
251 default: 251 default:
252 pr_warning("%s: Trying to change the method of voltage scaling" 252 pr_warn("%s: Trying to change the method of voltage scaling to an unsupported one!\n",
253 "to an unsupported one!\n", __func__); 253 __func__);
254 } 254 }
255} 255}
256 256
@@ -331,8 +331,8 @@ int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm)
331 if (!voltdm || !pwrdm) 331 if (!voltdm || !pwrdm)
332 return -EINVAL; 332 return -EINVAL;
333 333
334 pr_debug("voltagedomain: associating powerdomain %s with voltagedomain " 334 pr_debug("voltagedomain: %s: associating powerdomain %s\n",
335 "%s\n", pwrdm->name, voltdm->name); 335 voltdm->name, pwrdm->name);
336 336
337 list_add(&pwrdm->voltdm_node, &voltdm->pwrdm_list); 337 list_add(&pwrdm->voltdm_node, &voltdm->pwrdm_list);
338 338
diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
index 0ac2caf1594..7283b7ed7de 100644
--- a/arch/arm/mach-omap2/voltage.h
+++ b/arch/arm/mach-omap2/voltage.h
@@ -16,7 +16,7 @@
16 16
17#include <linux/err.h> 17#include <linux/err.h>
18 18
19#include <plat/voltage.h> 19#include <linux/platform_data/voltage-omap.h>
20 20
21#include "vc.h" 21#include "vc.h"
22#include "vp.h" 22#include "vp.h"
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
index d0103c80d04..63afbfed3cb 100644
--- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
@@ -18,9 +18,8 @@
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/init.h> 19#include <linux/init.h>
20 20
21#include "soc.h"
21#include "common.h" 22#include "common.h"
22#include <plat/cpu.h>
23
24#include "prm-regbits-34xx.h" 23#include "prm-regbits-34xx.h"
25#include "omap_opp_data.h" 24#include "omap_opp_data.h"
26#include "voltage.h" 25#include "voltage.h"
diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
index f95c1bad9dc..85241b828c0 100644
--- a/arch/arm/mach-omap2/vp.c
+++ b/arch/arm/mach-omap2/vp.c
@@ -138,8 +138,8 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
138 udelay(1); 138 udelay(1);
139 } 139 }
140 if (timeout >= VP_TRANXDONE_TIMEOUT) { 140 if (timeout >= VP_TRANXDONE_TIMEOUT) {
141 pr_warning("%s: vdd_%s TRANXDONE timeout exceeded." 141 pr_warn("%s: vdd_%s TRANXDONE timeout exceeded. Voltage change aborted",
142 "Voltage change aborted", __func__, voltdm->name); 142 __func__, voltdm->name);
143 return -ETIMEDOUT; 143 return -ETIMEDOUT;
144 } 144 }
145 145
@@ -157,9 +157,8 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
157 omap_test_timeout(vp->common->ops->check_txdone(vp->id), 157 omap_test_timeout(vp->common->ops->check_txdone(vp->id),
158 VP_TRANXDONE_TIMEOUT, timeout); 158 VP_TRANXDONE_TIMEOUT, timeout);
159 if (timeout >= VP_TRANXDONE_TIMEOUT) 159 if (timeout >= VP_TRANXDONE_TIMEOUT)
160 pr_err("%s: vdd_%s TRANXDONE timeout exceeded." 160 pr_err("%s: vdd_%s TRANXDONE timeout exceeded. TRANXDONE never got set after the voltage update\n",
161 "TRANXDONE never got set after the voltage update\n", 161 __func__, voltdm->name);
162 __func__, voltdm->name);
163 162
164 omap_vc_post_scale(voltdm, target_volt, target_vsel, current_vsel); 163 omap_vc_post_scale(voltdm, target_volt, target_vsel, current_vsel);
165 164
@@ -176,8 +175,7 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
176 } 175 }
177 176
178 if (timeout >= VP_TRANXDONE_TIMEOUT) 177 if (timeout >= VP_TRANXDONE_TIMEOUT)
179 pr_warning("%s: vdd_%s TRANXDONE timeout exceeded while trying" 178 pr_warn("%s: vdd_%s TRANXDONE timeout exceeded while trying to clear the TRANXDONE status\n",
180 "to clear the TRANXDONE status\n",
181 __func__, voltdm->name); 179 __func__, voltdm->name);
182 180
183 /* Clear force bit */ 181 /* Clear force bit */
@@ -257,8 +255,8 @@ void omap_vp_disable(struct voltagedomain *voltdm)
257 255
258 /* If VP is already disabled, do nothing. Return */ 256 /* If VP is already disabled, do nothing. Return */
259 if (!vp->enabled) { 257 if (!vp->enabled) {
260 pr_warning("%s: Trying to disable VP for vdd_%s when" 258 pr_warn("%s: Trying to disable VP for vdd_%s when it is already disabled\n",
261 "it is already disabled\n", __func__, voltdm->name); 259 __func__, voltdm->name);
262 return; 260 return;
263 } 261 }
264 262
diff --git a/arch/arm/mach-orion5x/addr-map.c b/arch/arm/mach-orion5x/addr-map.c
index eaac83d1df6..b5efc0fd31c 100644
--- a/arch/arm/mach-orion5x/addr-map.c
+++ b/arch/arm/mach-orion5x/addr-map.c
@@ -113,7 +113,8 @@ void __init orion5x_setup_cpu_mbus_bridge(void)
113 /* 113 /*
114 * Setup MBUS dram target info. 114 * Setup MBUS dram target info.
115 */ 115 */
116 orion_setup_cpu_mbus_target(&addr_map_cfg, ORION5X_DDR_WINDOW_CPU_BASE); 116 orion_setup_cpu_mbus_target(&addr_map_cfg,
117 (void __iomem *) ORION5X_DDR_WINDOW_CPU_BASE);
117} 118}
118 119
119void __init orion5x_setup_dev_boot_win(u32 base, u32 size) 120void __init orion5x_setup_dev_boot_win(u32 base, u32 size)
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 410291c6766..b3eb3da0116 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -30,8 +30,8 @@
30#include <mach/bridge-regs.h> 30#include <mach/bridge-regs.h>
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <mach/orion5x.h> 32#include <mach/orion5x.h>
33#include <plat/orion_nand.h> 33#include <linux/platform_data/mtd-orion_nand.h>
34#include <plat/ehci-orion.h> 34#include <linux/platform_data/usb-ehci-orion.h>
35#include <plat/time.h> 35#include <plat/time.h>
36#include <plat/common.h> 36#include <plat/common.h>
37#include <plat/addr-map.h> 37#include <plat/addr-map.h>
@@ -42,22 +42,12 @@
42 ****************************************************************************/ 42 ****************************************************************************/
43static struct map_desc orion5x_io_desc[] __initdata = { 43static struct map_desc orion5x_io_desc[] __initdata = {
44 { 44 {
45 .virtual = ORION5X_REGS_VIRT_BASE, 45 .virtual = (unsigned long) ORION5X_REGS_VIRT_BASE,
46 .pfn = __phys_to_pfn(ORION5X_REGS_PHYS_BASE), 46 .pfn = __phys_to_pfn(ORION5X_REGS_PHYS_BASE),
47 .length = ORION5X_REGS_SIZE, 47 .length = ORION5X_REGS_SIZE,
48 .type = MT_DEVICE, 48 .type = MT_DEVICE,
49 }, { 49 }, {
50 .virtual = ORION5X_PCIE_IO_VIRT_BASE, 50 .virtual = (unsigned long) ORION5X_PCIE_WA_VIRT_BASE,
51 .pfn = __phys_to_pfn(ORION5X_PCIE_IO_PHYS_BASE),
52 .length = ORION5X_PCIE_IO_SIZE,
53 .type = MT_DEVICE,
54 }, {
55 .virtual = ORION5X_PCI_IO_VIRT_BASE,
56 .pfn = __phys_to_pfn(ORION5X_PCI_IO_PHYS_BASE),
57 .length = ORION5X_PCI_IO_SIZE,
58 .type = MT_DEVICE,
59 }, {
60 .virtual = ORION5X_PCIE_WA_VIRT_BASE,
61 .pfn = __phys_to_pfn(ORION5X_PCIE_WA_PHYS_BASE), 51 .pfn = __phys_to_pfn(ORION5X_PCIE_WA_PHYS_BASE),
62 .length = ORION5X_PCIE_WA_SIZE, 52 .length = ORION5X_PCIE_WA_SIZE,
63 .type = MT_DEVICE, 53 .type = MT_DEVICE,
@@ -204,6 +194,13 @@ void __init orion5x_wdt_init(void)
204void __init orion5x_init_early(void) 194void __init orion5x_init_early(void)
205{ 195{
206 orion_time_set_base(TIMER_VIRT_BASE); 196 orion_time_set_base(TIMER_VIRT_BASE);
197
198 /*
199 * Some Orion5x devices allocate their coherent buffers from atomic
200 * context. Increase size of atomic coherent pool to make sure such
201 * the allocations won't fail.
202 */
203 init_dma_coherent_pool_size(SZ_1M);
207} 204}
208 205
209int orion5x_tclk; 206int orion5x_tclk;
diff --git a/arch/arm/mach-orion5x/d2net-setup.c b/arch/arm/mach-orion5x/d2net-setup.c
index d75dcfa0f01..e3629c063df 100644
--- a/arch/arm/mach-orion5x/d2net-setup.c
+++ b/arch/arm/mach-orion5x/d2net-setup.c
@@ -27,6 +27,7 @@
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/mach/pci.h> 28#include <asm/mach/pci.h>
29#include <mach/orion5x.h> 29#include <mach/orion5x.h>
30#include <plat/orion-gpio.h>
30#include "common.h" 31#include "common.h"
31#include "mpp.h" 32#include "mpp.h"
32 33
diff --git a/arch/arm/mach-orion5x/db88f5281-setup.c b/arch/arm/mach-orion5x/db88f5281-setup.c
index 49a3fd63031..41fe2b1ff47 100644
--- a/arch/arm/mach-orion5x/db88f5281-setup.c
+++ b/arch/arm/mach-orion5x/db88f5281-setup.c
@@ -24,7 +24,7 @@
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <asm/mach/pci.h> 25#include <asm/mach/pci.h>
26#include <mach/orion5x.h> 26#include <mach/orion5x.h>
27#include <plat/orion_nand.h> 27#include <linux/platform_data/mtd-orion_nand.h>
28#include "common.h" 28#include "common.h"
29#include "mpp.h" 29#include "mpp.h"
30 30
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index d470864b4e4..e533588880f 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -34,6 +34,7 @@
34#include <asm/mach/pci.h> 34#include <asm/mach/pci.h>
35#include <asm/system_info.h> 35#include <asm/system_info.h>
36#include <mach/orion5x.h> 36#include <mach/orion5x.h>
37#include <plat/orion-gpio.h>
37#include "common.h" 38#include "common.h"
38#include "mpp.h" 39#include "mpp.h"
39 40
@@ -700,7 +701,7 @@ static void __init dns323_init(void)
700 * Note: AFAIK, rev B1 needs the same treatement but I'll let 701 * Note: AFAIK, rev B1 needs the same treatement but I'll let
701 * somebody else test it. 702 * somebody else test it.
702 */ 703 */
703 writel(0x5, ORION5X_SATA_VIRT_BASE | 0x2c); 704 writel(0x5, ORION5X_SATA_VIRT_BASE + 0x2c);
704 break; 705 break;
705 } 706 }
706} 707}
diff --git a/arch/arm/mach-orion5x/include/mach/bridge-regs.h b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
index 11a3c1e9801..461fd69a10a 100644
--- a/arch/arm/mach-orion5x/include/mach/bridge-regs.h
+++ b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
@@ -13,27 +13,27 @@
13 13
14#include <mach/orion5x.h> 14#include <mach/orion5x.h>
15 15
16#define CPU_CONF (ORION5X_BRIDGE_VIRT_BASE | 0x100) 16#define CPU_CONF (ORION5X_BRIDGE_VIRT_BASE + 0x100)
17 17
18#define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE | 0x104) 18#define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE + 0x104)
19 19
20#define RSTOUTn_MASK (ORION5X_BRIDGE_VIRT_BASE | 0x108) 20#define RSTOUTn_MASK (ORION5X_BRIDGE_VIRT_BASE + 0x108)
21#define WDT_RESET_OUT_EN 0x0002 21#define WDT_RESET_OUT_EN 0x0002
22 22
23#define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE | 0x10c) 23#define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE + 0x10c)
24 24
25#define BRIDGE_CAUSE (ORION5X_BRIDGE_VIRT_BASE | 0x110) 25#define BRIDGE_CAUSE (ORION5X_BRIDGE_VIRT_BASE + 0x110)
26 26
27#define POWER_MNG_CTRL_REG (ORION5X_BRIDGE_VIRT_BASE | 0x11C) 27#define POWER_MNG_CTRL_REG (ORION5X_BRIDGE_VIRT_BASE + 0x11C)
28 28
29#define WDT_INT_REQ 0x0008 29#define WDT_INT_REQ 0x0008
30 30
31#define BRIDGE_INT_TIMER1_CLR (~0x0004) 31#define BRIDGE_INT_TIMER1_CLR (~0x0004)
32 32
33#define MAIN_IRQ_CAUSE (ORION5X_BRIDGE_VIRT_BASE | 0x200) 33#define MAIN_IRQ_CAUSE (ORION5X_BRIDGE_VIRT_BASE + 0x200)
34 34
35#define MAIN_IRQ_MASK (ORION5X_BRIDGE_VIRT_BASE | 0x204) 35#define MAIN_IRQ_MASK (ORION5X_BRIDGE_VIRT_BASE + 0x204)
36 36
37#define TIMER_VIRT_BASE (ORION5X_BRIDGE_VIRT_BASE | 0x300) 37#define TIMER_VIRT_BASE (ORION5X_BRIDGE_VIRT_BASE + 0x300)
38#define TIMER_PHYS_BASE (ORION5X_BRIDGE_PHYS_BASE | 0x300) 38#define TIMER_PHYS_BASE (ORION5X_BRIDGE_PHYS_BASE + 0x300)
39#endif 39#endif
diff --git a/arch/arm/mach-orion5x/include/mach/gpio.h b/arch/arm/mach-orion5x/include/mach/gpio.h
deleted file mode 100644
index a1d0b78decb..00000000000
--- a/arch/arm/mach-orion5x/include/mach/gpio.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/*
2 * arch/arm/mach-orion5x/include/mach/gpio.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#include <plat/gpio.h>
diff --git a/arch/arm/mach-orion5x/include/mach/io.h b/arch/arm/mach-orion5x/include/mach/io.h
deleted file mode 100644
index 1aa5d0a50a0..00000000000
--- a/arch/arm/mach-orion5x/include/mach/io.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * arch/arm/mach-orion5x/include/mach/io.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_IO_H
10#define __ASM_ARCH_IO_H
11
12#include <mach/orion5x.h>
13#include <asm/sizes.h>
14
15#define IO_SPACE_LIMIT SZ_2M
16static inline void __iomem *__io(unsigned long addr)
17{
18 return (void __iomem *)(addr + ORION5X_PCIE_IO_VIRT_BASE);
19}
20
21#define __io(a) __io(a)
22#endif
diff --git a/arch/arm/mach-orion5x/include/mach/orion5x.h b/arch/arm/mach-orion5x/include/mach/orion5x.h
index 683e085ce16..d265f5484a8 100644
--- a/arch/arm/mach-orion5x/include/mach/orion5x.h
+++ b/arch/arm/mach-orion5x/include/mach/orion5x.h
@@ -31,31 +31,29 @@
31 * fc000000 device bus mappings (cs0/cs1) 31 * fc000000 device bus mappings (cs0/cs1)
32 * 32 *
33 * virt phys size 33 * virt phys size
34 * fdd00000 f1000000 1M on-chip peripheral registers 34 * fe000000 f1000000 1M on-chip peripheral registers
35 * fde00000 f2000000 1M PCIe I/O space 35 * fee00000 f2000000 64K PCIe I/O space
36 * fdf00000 f2100000 1M PCI I/O space 36 * fee10000 f2100000 64K PCI I/O space
37 * fe000000 f0000000 16M PCIe WA space (Orion-1/Orion-NAS only) 37 * fd000000 f0000000 16M PCIe WA space (Orion-1/Orion-NAS only)
38 ****************************************************************************/ 38 ****************************************************************************/
39#define ORION5X_REGS_PHYS_BASE 0xf1000000 39#define ORION5X_REGS_PHYS_BASE 0xf1000000
40#define ORION5X_REGS_VIRT_BASE 0xfdd00000 40#define ORION5X_REGS_VIRT_BASE IOMEM(0xfe000000)
41#define ORION5X_REGS_SIZE SZ_1M 41#define ORION5X_REGS_SIZE SZ_1M
42 42
43#define ORION5X_PCIE_IO_PHYS_BASE 0xf2000000 43#define ORION5X_PCIE_IO_PHYS_BASE 0xf2000000
44#define ORION5X_PCIE_IO_VIRT_BASE 0xfde00000
45#define ORION5X_PCIE_IO_BUS_BASE 0x00000000 44#define ORION5X_PCIE_IO_BUS_BASE 0x00000000
46#define ORION5X_PCIE_IO_SIZE SZ_1M 45#define ORION5X_PCIE_IO_SIZE SZ_64K
47 46
48#define ORION5X_PCI_IO_PHYS_BASE 0xf2100000 47#define ORION5X_PCI_IO_PHYS_BASE 0xf2100000
49#define ORION5X_PCI_IO_VIRT_BASE 0xfdf00000 48#define ORION5X_PCI_IO_BUS_BASE 0x00010000
50#define ORION5X_PCI_IO_BUS_BASE 0x00100000 49#define ORION5X_PCI_IO_SIZE SZ_64K
51#define ORION5X_PCI_IO_SIZE SZ_1M
52 50
53#define ORION5X_SRAM_PHYS_BASE (0xf2200000) 51#define ORION5X_SRAM_PHYS_BASE (0xf2200000)
54#define ORION5X_SRAM_SIZE SZ_8K 52#define ORION5X_SRAM_SIZE SZ_8K
55 53
56/* Relevant only for Orion-1/Orion-NAS */ 54/* Relevant only for Orion-1/Orion-NAS */
57#define ORION5X_PCIE_WA_PHYS_BASE 0xf0000000 55#define ORION5X_PCIE_WA_PHYS_BASE 0xf0000000
58#define ORION5X_PCIE_WA_VIRT_BASE 0xfe000000 56#define ORION5X_PCIE_WA_VIRT_BASE IOMEM(0xfd000000)
59#define ORION5X_PCIE_WA_SIZE SZ_16M 57#define ORION5X_PCIE_WA_SIZE SZ_16M
60 58
61#define ORION5X_PCIE_MEM_PHYS_BASE 0xe0000000 59#define ORION5X_PCIE_MEM_PHYS_BASE 0xe0000000
@@ -68,42 +66,42 @@
68 * Orion Registers Map 66 * Orion Registers Map
69 ******************************************************************************/ 67 ******************************************************************************/
70 68
71#define ORION5X_DDR_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x00000) 69#define ORION5X_DDR_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x00000)
72#define ORION5X_DDR_WINDOW_CPU_BASE (ORION5X_DDR_VIRT_BASE | 0x1500) 70#define ORION5X_DDR_WINDOW_CPU_BASE (ORION5X_DDR_VIRT_BASE + 0x1500)
73#define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x10000) 71#define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0x10000)
74#define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x10000) 72#define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x10000)
75#define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE | (x)) 73#define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE + (x))
76#define GPIO_VIRT_BASE ORION5X_DEV_BUS_REG(0x0100) 74#define GPIO_VIRT_BASE ORION5X_DEV_BUS_REG(0x0100)
77#define SPI_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x0600) 75#define SPI_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE + 0x0600)
78#define I2C_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x1000) 76#define I2C_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE + 0x1000)
79#define UART0_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x2000) 77#define UART0_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE + 0x2000)
80#define UART0_VIRT_BASE (ORION5X_DEV_BUS_VIRT_BASE | 0x2000) 78#define UART0_VIRT_BASE (ORION5X_DEV_BUS_VIRT_BASE + 0x2000)
81#define UART1_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x2100) 79#define UART1_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE + 0x2100)
82#define UART1_VIRT_BASE (ORION5X_DEV_BUS_VIRT_BASE | 0x2100) 80#define UART1_VIRT_BASE (ORION5X_DEV_BUS_VIRT_BASE + 0x2100)
83 81
84#define ORION5X_BRIDGE_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x20000) 82#define ORION5X_BRIDGE_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x20000)
85#define ORION5X_BRIDGE_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x20000) 83#define ORION5X_BRIDGE_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0x20000)
86 84
87#define ORION5X_PCI_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x30000) 85#define ORION5X_PCI_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x30000)
88 86
89#define ORION5X_PCIE_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x40000) 87#define ORION5X_PCIE_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x40000)
90 88
91#define ORION5X_USB0_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x50000) 89#define ORION5X_USB0_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0x50000)
92#define ORION5X_USB0_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x50000) 90#define ORION5X_USB0_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x50000)
93 91
94#define ORION5X_XOR_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x60900) 92#define ORION5X_XOR_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0x60900)
95#define ORION5X_XOR_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x60900) 93#define ORION5X_XOR_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x60900)
96 94
97#define ORION5X_ETH_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x70000) 95#define ORION5X_ETH_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0x70000)
98#define ORION5X_ETH_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x70000) 96#define ORION5X_ETH_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x70000)
99 97
100#define ORION5X_SATA_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x80000) 98#define ORION5X_SATA_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0x80000)
101#define ORION5X_SATA_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x80000) 99#define ORION5X_SATA_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x80000)
102 100
103#define ORION5X_CRYPTO_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x90000) 101#define ORION5X_CRYPTO_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0x90000)
104 102
105#define ORION5X_USB1_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0xa0000) 103#define ORION5X_USB1_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0xa0000)
106#define ORION5X_USB1_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0xa0000) 104#define ORION5X_USB1_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0xa0000)
107 105
108/******************************************************************************* 106/*******************************************************************************
109 * Device Bus Registers 107 * Device Bus Registers
diff --git a/arch/arm/mach-orion5x/irq.c b/arch/arm/mach-orion5x/irq.c
index 17da7091d31..30a192b9c51 100644
--- a/arch/arm/mach-orion5x/irq.c
+++ b/arch/arm/mach-orion5x/irq.c
@@ -12,7 +12,9 @@
12#include <linux/gpio.h> 12#include <linux/gpio.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/io.h>
15#include <mach/bridge-regs.h> 16#include <mach/bridge-regs.h>
17#include <plat/orion-gpio.h>
16#include <plat/irq.h> 18#include <plat/irq.h>
17 19
18static int __initdata gpio0_irqs[4] = { 20static int __initdata gpio0_irqs[4] = {
@@ -24,11 +26,11 @@ static int __initdata gpio0_irqs[4] = {
24 26
25void __init orion5x_init_irq(void) 27void __init orion5x_init_irq(void)
26{ 28{
27 orion_irq_init(0, (void __iomem *)MAIN_IRQ_MASK); 29 orion_irq_init(0, MAIN_IRQ_MASK);
28 30
29 /* 31 /*
30 * Initialize gpiolib for GPIOs 0-31. 32 * Initialize gpiolib for GPIOs 0-31.
31 */ 33 */
32 orion_gpio_init(NULL, 0, 32, (void __iomem *)GPIO_VIRT_BASE, 0, 34 orion_gpio_init(NULL, 0, 32, GPIO_VIRT_BASE, 0,
33 IRQ_ORION5X_GPIO_START, gpio0_irqs); 35 IRQ_ORION5X_GPIO_START, gpio0_irqs);
34} 36}
diff --git a/arch/arm/mach-orion5x/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c
index 1e458efafb9..f1ae10ae5bd 100644
--- a/arch/arm/mach-orion5x/kurobox_pro-setup.c
+++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c
@@ -24,7 +24,7 @@
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <asm/mach/pci.h> 25#include <asm/mach/pci.h>
26#include <mach/orion5x.h> 26#include <mach/orion5x.h>
27#include <plat/orion_nand.h> 27#include <linux/platform_data/mtd-orion_nand.h>
28#include "common.h" 28#include "common.h"
29#include "mpp.h" 29#include "mpp.h"
30 30
diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c
index 0180c393c71..3506f16c0bf 100644
--- a/arch/arm/mach-orion5x/net2big-setup.c
+++ b/arch/arm/mach-orion5x/net2big-setup.c
@@ -25,6 +25,7 @@
25#include <asm/mach-types.h> 25#include <asm/mach-types.h>
26#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
27#include <mach/orion5x.h> 27#include <mach/orion5x.h>
28#include <plat/orion-gpio.h>
28#include "common.h" 29#include "common.h"
29#include "mpp.h" 30#include "mpp.h"
30 31
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c
index cb19e1661bb..cd50e328db2 100644
--- a/arch/arm/mach-orion5x/pci.c
+++ b/arch/arm/mach-orion5x/pci.c
@@ -38,7 +38,7 @@
38/***************************************************************************** 38/*****************************************************************************
39 * PCIe controller 39 * PCIe controller
40 ****************************************************************************/ 40 ****************************************************************************/
41#define PCIE_BASE ((void __iomem *)ORION5X_PCIE_VIRT_BASE) 41#define PCIE_BASE (ORION5X_PCIE_VIRT_BASE)
42 42
43void __init orion5x_pcie_id(u32 *dev, u32 *rev) 43void __init orion5x_pcie_id(u32 *dev, u32 *rev)
44{ 44{
@@ -111,7 +111,7 @@ static int pcie_rd_conf_wa(struct pci_bus *bus, u32 devfn,
111 return PCIBIOS_DEVICE_NOT_FOUND; 111 return PCIBIOS_DEVICE_NOT_FOUND;
112 } 112 }
113 113
114 ret = orion_pcie_rd_conf_wa((void __iomem *)ORION5X_PCIE_WA_VIRT_BASE, 114 ret = orion_pcie_rd_conf_wa(ORION5X_PCIE_WA_VIRT_BASE,
115 bus, devfn, where, size, val); 115 bus, devfn, where, size, val);
116 116
117 return ret; 117 return ret;
@@ -162,35 +162,25 @@ static int __init pcie_setup(struct pci_sys_data *sys)
162 pcie_ops.read = pcie_rd_conf_wa; 162 pcie_ops.read = pcie_rd_conf_wa;
163 } 163 }
164 164
165 pci_ioremap_io(sys->busnr * SZ_64K, ORION5X_PCIE_IO_PHYS_BASE);
166
165 /* 167 /*
166 * Request resources. 168 * Request resources.
167 */ 169 */
168 res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL); 170 res = kzalloc(sizeof(struct resource), GFP_KERNEL);
169 if (!res) 171 if (!res)
170 panic("pcie_setup unable to alloc resources"); 172 panic("pcie_setup unable to alloc resources");
171 173
172 /* 174 /*
173 * IORESOURCE_IO
174 */
175 sys->io_offset = 0;
176 res[0].name = "PCIe I/O Space";
177 res[0].flags = IORESOURCE_IO;
178 res[0].start = ORION5X_PCIE_IO_BUS_BASE;
179 res[0].end = res[0].start + ORION5X_PCIE_IO_SIZE - 1;
180 if (request_resource(&ioport_resource, &res[0]))
181 panic("Request PCIe IO resource failed\n");
182 pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset);
183
184 /*
185 * IORESOURCE_MEM 175 * IORESOURCE_MEM
186 */ 176 */
187 res[1].name = "PCIe Memory Space"; 177 res->name = "PCIe Memory Space";
188 res[1].flags = IORESOURCE_MEM; 178 res->flags = IORESOURCE_MEM;
189 res[1].start = ORION5X_PCIE_MEM_PHYS_BASE; 179 res->start = ORION5X_PCIE_MEM_PHYS_BASE;
190 res[1].end = res[1].start + ORION5X_PCIE_MEM_SIZE - 1; 180 res->end = res->start + ORION5X_PCIE_MEM_SIZE - 1;
191 if (request_resource(&iomem_resource, &res[1])) 181 if (request_resource(&iomem_resource, res))
192 panic("Request PCIe Memory resource failed\n"); 182 panic("Request PCIe Memory resource failed\n");
193 pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); 183 pci_add_resource_offset(&sys->resources, res, sys->mem_offset);
194 184
195 return 1; 185 return 1;
196} 186}
@@ -198,7 +188,7 @@ static int __init pcie_setup(struct pci_sys_data *sys)
198/***************************************************************************** 188/*****************************************************************************
199 * PCI controller 189 * PCI controller
200 ****************************************************************************/ 190 ****************************************************************************/
201#define ORION5X_PCI_REG(x) (ORION5X_PCI_VIRT_BASE | (x)) 191#define ORION5X_PCI_REG(x) (ORION5X_PCI_VIRT_BASE + (x))
202#define PCI_MODE ORION5X_PCI_REG(0xd00) 192#define PCI_MODE ORION5X_PCI_REG(0xd00)
203#define PCI_CMD ORION5X_PCI_REG(0xc00) 193#define PCI_CMD ORION5X_PCI_REG(0xc00)
204#define PCI_P2P_CONF ORION5X_PCI_REG(0x1d14) 194#define PCI_P2P_CONF ORION5X_PCI_REG(0x1d14)
@@ -489,35 +479,25 @@ static int __init pci_setup(struct pci_sys_data *sys)
489 */ 479 */
490 orion5x_setbits(PCI_CMD, PCI_CMD_HOST_REORDER); 480 orion5x_setbits(PCI_CMD, PCI_CMD_HOST_REORDER);
491 481
482 pci_ioremap_io(sys->busnr * SZ_64K, ORION5X_PCI_IO_PHYS_BASE);
483
492 /* 484 /*
493 * Request resources 485 * Request resources
494 */ 486 */
495 res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL); 487 res = kzalloc(sizeof(struct resource), GFP_KERNEL);
496 if (!res) 488 if (!res)
497 panic("pci_setup unable to alloc resources"); 489 panic("pci_setup unable to alloc resources");
498 490
499 /* 491 /*
500 * IORESOURCE_IO
501 */
502 sys->io_offset = 0;
503 res[0].name = "PCI I/O Space";
504 res[0].flags = IORESOURCE_IO;
505 res[0].start = ORION5X_PCI_IO_BUS_BASE;
506 res[0].end = res[0].start + ORION5X_PCI_IO_SIZE - 1;
507 if (request_resource(&ioport_resource, &res[0]))
508 panic("Request PCI IO resource failed\n");
509 pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset);
510
511 /*
512 * IORESOURCE_MEM 492 * IORESOURCE_MEM
513 */ 493 */
514 res[1].name = "PCI Memory Space"; 494 res->name = "PCI Memory Space";
515 res[1].flags = IORESOURCE_MEM; 495 res->flags = IORESOURCE_MEM;
516 res[1].start = ORION5X_PCI_MEM_PHYS_BASE; 496 res->start = ORION5X_PCI_MEM_PHYS_BASE;
517 res[1].end = res[1].start + ORION5X_PCI_MEM_SIZE - 1; 497 res->end = res->start + ORION5X_PCI_MEM_SIZE - 1;
518 if (request_resource(&iomem_resource, &res[1])) 498 if (request_resource(&iomem_resource, res))
519 panic("Request PCI Memory resource failed\n"); 499 panic("Request PCI Memory resource failed\n");
520 pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); 500 pci_add_resource_offset(&sys->resources, res, sys->mem_offset);
521 501
522 return 1; 502 return 1;
523} 503}
diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
index 78a6a11d821..9b1c9531029 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
@@ -18,7 +18,6 @@
18#include <linux/ethtool.h> 18#include <linux/ethtool.h>
19#include <net/dsa.h> 19#include <net/dsa.h>
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include <asm/leds.h>
22#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
23#include <asm/mach/pci.h> 22#include <asm/mach/pci.h>
24#include <mach/orion5x.h> 23#include <mach/orion5x.h>
diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
index 2f5dc54cd4c..51ba2b81a10 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
@@ -19,7 +19,6 @@
19#include <linux/i2c.h> 19#include <linux/i2c.h>
20#include <net/dsa.h> 20#include <net/dsa.h>
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22#include <asm/leds.h>
23#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
24#include <asm/mach/pci.h> 23#include <asm/mach/pci.h>
25#include <mach/orion5x.h> 24#include <mach/orion5x.h>
diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c
index 399130fac0b..0a56b9444f1 100644
--- a/arch/arm/mach-orion5x/rd88f5182-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5182-setup.c
@@ -19,8 +19,8 @@
19#include <linux/mv643xx_eth.h> 19#include <linux/mv643xx_eth.h>
20#include <linux/ata_platform.h> 20#include <linux/ata_platform.h>
21#include <linux/i2c.h> 21#include <linux/i2c.h>
22#include <linux/leds.h>
22#include <asm/mach-types.h> 23#include <asm/mach-types.h>
23#include <asm/leds.h>
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <asm/mach/pci.h> 25#include <asm/mach/pci.h>
26#include <mach/orion5x.h> 26#include <mach/orion5x.h>
@@ -53,12 +53,6 @@
53#define RD88F5182_PCI_SLOT0_IRQ_A_PIN 7 53#define RD88F5182_PCI_SLOT0_IRQ_A_PIN 7
54#define RD88F5182_PCI_SLOT0_IRQ_B_PIN 6 54#define RD88F5182_PCI_SLOT0_IRQ_B_PIN 6
55 55
56/*
57 * GPIO Debug LED
58 */
59
60#define RD88F5182_GPIO_DBG_LED 0
61
62/***************************************************************************** 56/*****************************************************************************
63 * 16M NOR Flash on Device bus CS1 57 * 16M NOR Flash on Device bus CS1
64 ****************************************************************************/ 58 ****************************************************************************/
@@ -83,55 +77,32 @@ static struct platform_device rd88f5182_nor_flash = {
83 .resource = &rd88f5182_nor_flash_resource, 77 .resource = &rd88f5182_nor_flash_resource,
84}; 78};
85 79
86#ifdef CONFIG_LEDS
87
88/***************************************************************************** 80/*****************************************************************************
89 * Use GPIO debug led as CPU active indication 81 * Use GPIO LED as CPU active indication
90 ****************************************************************************/ 82 ****************************************************************************/
91 83
92static void rd88f5182_dbgled_event(led_event_t evt) 84#define RD88F5182_GPIO_LED 0
93{
94 int val;
95
96 if (evt == led_idle_end)
97 val = 1;
98 else if (evt == led_idle_start)
99 val = 0;
100 else
101 return;
102
103 gpio_set_value(RD88F5182_GPIO_DBG_LED, val);
104}
105
106static int __init rd88f5182_dbgled_init(void)
107{
108 int pin;
109
110 if (machine_is_rd88f5182()) {
111 pin = RD88F5182_GPIO_DBG_LED;
112 85
113 if (gpio_request(pin, "DBGLED") == 0) { 86static struct gpio_led rd88f5182_gpio_led_pins[] = {
114 if (gpio_direction_output(pin, 0) != 0) { 87 {
115 printk(KERN_ERR "rd88f5182_dbgled_init failed " 88 .name = "rd88f5182:cpu",
116 "to set output pin %d\n", pin); 89 .default_trigger = "cpu0",
117 gpio_free(pin); 90 .gpio = RD88F5182_GPIO_LED,
118 return 0; 91 },
119 } 92};
120 } else {
121 printk(KERN_ERR "rd88f5182_dbgled_init failed "
122 "to request gpio %d\n", pin);
123 return 0;
124 }
125
126 leds_event = rd88f5182_dbgled_event;
127 }
128
129 return 0;
130}
131 93
132__initcall(rd88f5182_dbgled_init); 94static struct gpio_led_platform_data rd88f5182_gpio_led_data = {
95 .leds = rd88f5182_gpio_led_pins,
96 .num_leds = ARRAY_SIZE(rd88f5182_gpio_led_pins),
97};
133 98
134#endif 99static struct platform_device rd88f5182_gpio_leds = {
100 .name = "leds-gpio",
101 .id = -1,
102 .dev = {
103 .platform_data = &rd88f5182_gpio_led_data,
104 },
105};
135 106
136/***************************************************************************** 107/*****************************************************************************
137 * PCI 108 * PCI
@@ -298,6 +269,7 @@ static void __init rd88f5182_init(void)
298 269
299 orion5x_setup_dev1_win(RD88F5182_NOR_BASE, RD88F5182_NOR_SIZE); 270 orion5x_setup_dev1_win(RD88F5182_NOR_BASE, RD88F5182_NOR_SIZE);
300 platform_device_register(&rd88f5182_nor_flash); 271 platform_device_register(&rd88f5182_nor_flash);
272 platform_device_register(&rd88f5182_gpio_leds);
301 273
302 i2c_register_board_info(0, &rd88f5182_i2c_rtc, 1); 274 i2c_register_board_info(0, &rd88f5182_i2c_rtc, 1);
303} 275}
diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
index 92df49c1b62..ed50910b08a 100644
--- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
@@ -20,7 +20,6 @@
20#include <linux/ethtool.h> 20#include <linux/ethtool.h>
21#include <net/dsa.h> 21#include <net/dsa.h>
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/leds.h>
24#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
25#include <asm/mach/pci.h> 24#include <asm/mach/pci.h>
26#include <mach/orion5x.h> 25#include <mach/orion5x.h>
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index b4203277f3c..b0727dcd1ef 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -36,7 +36,7 @@
36 * FPGA - lives where the PCI bus would be at ORION5X_PCI_MEM_PHYS_BASE 36 * FPGA - lives where the PCI bus would be at ORION5X_PCI_MEM_PHYS_BASE
37 */ 37 */
38#define TS78XX_FPGA_REGS_PHYS_BASE 0xe8000000 38#define TS78XX_FPGA_REGS_PHYS_BASE 0xe8000000
39#define TS78XX_FPGA_REGS_VIRT_BASE 0xff900000 39#define TS78XX_FPGA_REGS_VIRT_BASE IOMEM(0xff900000)
40#define TS78XX_FPGA_REGS_SIZE SZ_1M 40#define TS78XX_FPGA_REGS_SIZE SZ_1M
41 41
42static struct ts78xx_fpga_data ts78xx_fpga = { 42static struct ts78xx_fpga_data ts78xx_fpga = {
@@ -50,7 +50,7 @@ static struct ts78xx_fpga_data ts78xx_fpga = {
50 ****************************************************************************/ 50 ****************************************************************************/
51static struct map_desc ts78xx_io_desc[] __initdata = { 51static struct map_desc ts78xx_io_desc[] __initdata = {
52 { 52 {
53 .virtual = TS78XX_FPGA_REGS_VIRT_BASE, 53 .virtual = (unsigned long)TS78XX_FPGA_REGS_VIRT_BASE,
54 .pfn = __phys_to_pfn(TS78XX_FPGA_REGS_PHYS_BASE), 54 .pfn = __phys_to_pfn(TS78XX_FPGA_REGS_PHYS_BASE),
55 .length = TS78XX_FPGA_REGS_SIZE, 55 .length = TS78XX_FPGA_REGS_SIZE,
56 .type = MT_DEVICE, 56 .type = MT_DEVICE,
@@ -80,8 +80,8 @@ static struct mv_sata_platform_data ts78xx_sata_data = {
80/***************************************************************************** 80/*****************************************************************************
81 * RTC M48T86 - nicked^Wborrowed from arch/arm/mach-ep93xx/ts72xx.c 81 * RTC M48T86 - nicked^Wborrowed from arch/arm/mach-ep93xx/ts72xx.c
82 ****************************************************************************/ 82 ****************************************************************************/
83#define TS_RTC_CTRL (TS78XX_FPGA_REGS_VIRT_BASE | 0x808) 83#define TS_RTC_CTRL (TS78XX_FPGA_REGS_VIRT_BASE + 0x808)
84#define TS_RTC_DATA (TS78XX_FPGA_REGS_VIRT_BASE | 0x80c) 84#define TS_RTC_DATA (TS78XX_FPGA_REGS_VIRT_BASE + 0x80c)
85 85
86static unsigned char ts78xx_ts_rtc_readbyte(unsigned long addr) 86static unsigned char ts78xx_ts_rtc_readbyte(unsigned long addr)
87{ 87{
@@ -162,8 +162,8 @@ static void ts78xx_ts_rtc_unload(void)
162/***************************************************************************** 162/*****************************************************************************
163 * NAND Flash 163 * NAND Flash
164 ****************************************************************************/ 164 ****************************************************************************/
165#define TS_NAND_CTRL (TS78XX_FPGA_REGS_VIRT_BASE | 0x800) /* VIRT */ 165#define TS_NAND_CTRL (TS78XX_FPGA_REGS_VIRT_BASE + 0x800) /* VIRT */
166#define TS_NAND_DATA (TS78XX_FPGA_REGS_PHYS_BASE | 0x804) /* PHYS */ 166#define TS_NAND_DATA (TS78XX_FPGA_REGS_PHYS_BASE + 0x804) /* PHYS */
167 167
168/* 168/*
169 * hardware specific access to control-lines 169 * hardware specific access to control-lines
diff --git a/arch/arm/mach-picoxcell/Kconfig b/arch/arm/mach-picoxcell/Kconfig
new file mode 100644
index 00000000000..868796f8085
--- /dev/null
+++ b/arch/arm/mach-picoxcell/Kconfig
@@ -0,0 +1,14 @@
1config ARCH_PICOXCELL
2 bool "Picochip PicoXcell" if ARCH_MULTI_V6
3 select ARCH_REQUIRE_GPIOLIB
4 select ARM_PATCH_PHYS_VIRT
5 select ARM_VIC
6 select CPU_V6K
7 select DW_APB_TIMER
8 select DW_APB_TIMER_OF
9 select GENERIC_CLOCKEVENTS
10 select GENERIC_GPIO
11 select HAVE_TCM
12 select NO_IOPORT
13 select SPARSE_IRQ
14 select USE_OF
diff --git a/arch/arm/mach-picoxcell/Makefile.boot b/arch/arm/mach-picoxcell/Makefile.boot
deleted file mode 100644
index b3271754e9f..00000000000
--- a/arch/arm/mach-picoxcell/Makefile.boot
+++ /dev/null
@@ -1 +0,0 @@
1zreladdr-y := 0x00008000
diff --git a/arch/arm/mach-picoxcell/common.c b/arch/arm/mach-picoxcell/common.c
index 8f9a0b47a7f..f6c0849af5e 100644
--- a/arch/arm/mach-picoxcell/common.c
+++ b/arch/arm/mach-picoxcell/common.c
@@ -20,14 +20,15 @@
20#include <asm/hardware/vic.h> 20#include <asm/hardware/vic.h>
21#include <asm/mach/map.h> 21#include <asm/mach/map.h>
22 22
23#include <mach/map.h>
24#include <mach/picoxcell_soc.h>
25
26#include "common.h" 23#include "common.h"
27 24
28#define WDT_CTRL_REG_EN_MASK (1 << 0) 25#define PHYS_TO_IO(x) (((x) & 0x00ffffff) | 0xfe000000)
29#define WDT_CTRL_REG_OFFS (0x00) 26#define PICOXCELL_PERIPH_BASE 0x80000000
30#define WDT_TIMEOUT_REG_OFFS (0x04) 27#define PICOXCELL_PERIPH_LENGTH SZ_4M
28
29#define WDT_CTRL_REG_EN_MASK (1 << 0)
30#define WDT_CTRL_REG_OFFS (0x00)
31#define WDT_TIMEOUT_REG_OFFS (0x04)
31static void __iomem *wdt_regs; 32static void __iomem *wdt_regs;
32 33
33/* 34/*
diff --git a/arch/arm/mach-picoxcell/include/mach/gpio.h b/arch/arm/mach-picoxcell/include/mach/gpio.h
deleted file mode 100644
index 40a8c178f10..00000000000
--- a/arch/arm/mach-picoxcell/include/mach/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/mach-picoxcell/include/mach/map.h b/arch/arm/mach-picoxcell/include/mach/map.h
deleted file mode 100644
index c06afad218b..00000000000
--- a/arch/arm/mach-picoxcell/include/mach/map.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles
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#ifndef __PICOXCELL_MAP_H__
15#define __PICOXCELL_MAP_H__
16
17#define PHYS_TO_IO(x) (((x) & 0x00ffffff) | 0xfe000000)
18
19#ifdef __ASSEMBLY__
20#define IO_ADDRESS(x) PHYS_TO_IO((x))
21#else
22#define IO_ADDRESS(x) (void __iomem __force *)(PHYS_TO_IO((x)))
23#endif
24
25#endif /* __PICOXCELL_MAP_H__ */
diff --git a/arch/arm/mach-picoxcell/include/mach/picoxcell_soc.h b/arch/arm/mach-picoxcell/include/mach/picoxcell_soc.h
deleted file mode 100644
index 5566fc88ddb..00000000000
--- a/arch/arm/mach-picoxcell/include/mach/picoxcell_soc.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles
3 *
4 * This file contains the hardware definitions of the picoXcell SoC devices.
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#ifndef __PICOXCELL_SOC_H__
17#define __PICOXCELL_SOC_H__
18
19#define PICOXCELL_UART1_BASE 0x80230000
20#define PICOXCELL_PERIPH_BASE 0x80000000
21#define PICOXCELL_PERIPH_LENGTH SZ_4M
22#define PICOXCELL_VIC0_BASE 0x80060000
23#define PICOXCELL_VIC1_BASE 0x80064000
24
25#endif /* __PICOXCELL_SOC_H__ */
diff --git a/arch/arm/mach-picoxcell/include/mach/timex.h b/arch/arm/mach-picoxcell/include/mach/timex.h
deleted file mode 100644
index 6c540a69f40..00000000000
--- a/arch/arm/mach-picoxcell/include/mach/timex.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles
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 __TIMEX_H__
19#define __TIMEX_H__
20
21/* Bogus value to allow the kernel to compile. */
22#define CLOCK_TICK_RATE 1000000
23
24#endif /* __TIMEX_H__ */
25
diff --git a/arch/arm/mach-picoxcell/include/mach/uncompress.h b/arch/arm/mach-picoxcell/include/mach/uncompress.h
deleted file mode 100644
index b60b19d1d73..00000000000
--- a/arch/arm/mach-picoxcell/include/mach/uncompress.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles
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#define putc(c)
19#define flush()
20#define arch_decomp_setup()
21#define arch_decomp_wdog()
diff --git a/arch/arm/mach-pnx4008/Makefile b/arch/arm/mach-pnx4008/Makefile
deleted file mode 100644
index 777564c90a1..00000000000
--- a/arch/arm/mach-pnx4008/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5obj-y := core.o irq.o time.o clock.o gpio.o serial.o dma.o i2c.o
6obj-m :=
7obj-n :=
8obj- :=
9
10# Power Management
11obj-$(CONFIG_PM) += pm.o sleep.o
12
diff --git a/arch/arm/mach-pnx4008/Makefile.boot b/arch/arm/mach-pnx4008/Makefile.boot
deleted file mode 100644
index 9fa19baa7f2..00000000000
--- a/arch/arm/mach-pnx4008/Makefile.boot
+++ /dev/null
@@ -1,4 +0,0 @@
1 zreladdr-y += 0x80008000
2params_phys-y := 0x80000100
3initrd_phys-y := 0x80800000
4
diff --git a/arch/arm/mach-pnx4008/clock.c b/arch/arm/mach-pnx4008/clock.c
deleted file mode 100644
index a4a3819c96c..00000000000
--- a/arch/arm/mach-pnx4008/clock.c
+++ /dev/null
@@ -1,1001 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/clock.c
3 *
4 * Clock control driver for PNX4008
5 *
6 * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com>
7 * Generic clock management functions are partially based on:
8 * linux/arch/arm/mach-omap/clock.c
9 *
10 * 2005-2006 (c) MontaVista Software, Inc. This file is licensed under
11 * the terms of the GNU General Public License version 2. This program
12 * is licensed "as is" without any warranty of any kind, whether express
13 * or implied.
14 */
15
16#include <linux/module.h>
17#include <linux/kernel.h>
18#include <linux/list.h>
19#include <linux/errno.h>
20#include <linux/device.h>
21#include <linux/err.h>
22#include <linux/delay.h>
23#include <linux/io.h>
24#include <linux/clkdev.h>
25
26#include <mach/hardware.h>
27#include <mach/clock.h>
28#include "clock.h"
29
30/*forward declaration*/
31static struct clk per_ck;
32static struct clk hclk_ck;
33static struct clk ck_1MHz;
34static struct clk ck_13MHz;
35static struct clk ck_pll1;
36static int local_set_rate(struct clk *clk, u32 rate);
37
38static inline void clock_lock(void)
39{
40 local_irq_disable();
41}
42
43static inline void clock_unlock(void)
44{
45 local_irq_enable();
46}
47
48static void propagate_rate(struct clk *clk)
49{
50 struct clk *tmp_clk;
51
52 tmp_clk = clk;
53 while (tmp_clk->propagate_next) {
54 tmp_clk = tmp_clk->propagate_next;
55 local_set_rate(tmp_clk, tmp_clk->user_rate);
56 }
57}
58
59static void clk_reg_disable(struct clk *clk)
60{
61 if (clk->enable_reg)
62 __raw_writel(__raw_readl(clk->enable_reg) &
63 ~(1 << clk->enable_shift), clk->enable_reg);
64}
65
66static int clk_reg_enable(struct clk *clk)
67{
68 if (clk->enable_reg)
69 __raw_writel(__raw_readl(clk->enable_reg) |
70 (1 << clk->enable_shift), clk->enable_reg);
71 return 0;
72}
73
74static inline void clk_reg_disable1(struct clk *clk)
75{
76 if (clk->enable_reg1)
77 __raw_writel(__raw_readl(clk->enable_reg1) &
78 ~(1 << clk->enable_shift1), clk->enable_reg1);
79}
80
81static inline void clk_reg_enable1(struct clk *clk)
82{
83 if (clk->enable_reg1)
84 __raw_writel(__raw_readl(clk->enable_reg1) |
85 (1 << clk->enable_shift1), clk->enable_reg1);
86}
87
88static int clk_wait_for_pll_lock(struct clk *clk)
89{
90 int i;
91 i = 0;
92 while (i++ < 0xFFF && !(__raw_readl(clk->scale_reg) & 1)) ; /*wait for PLL to lock */
93
94 if (!(__raw_readl(clk->scale_reg) & 1)) {
95 printk(KERN_ERR
96 "%s ERROR: failed to lock, scale reg data: %x\n",
97 clk->name, __raw_readl(clk->scale_reg));
98 return -1;
99 }
100 return 0;
101}
102
103static int switch_to_dirty_13mhz(struct clk *clk)
104{
105 int i;
106 int ret;
107 u32 tmp_reg;
108
109 ret = 0;
110
111 if (!clk->rate)
112 clk_reg_enable1(clk);
113
114 tmp_reg = __raw_readl(clk->parent_switch_reg);
115 /*if 13Mhz clock selected, select 13'MHz (dirty) source from OSC */
116 if (!(tmp_reg & 1)) {
117 tmp_reg |= (1 << 1); /* Trigger switch to 13'MHz (dirty) clock */
118 __raw_writel(tmp_reg, clk->parent_switch_reg);
119 i = 0;
120 while (i++ < 0xFFF && !(__raw_readl(clk->parent_switch_reg) & 1)) ; /*wait for 13'MHz selection status */
121
122 if (!(__raw_readl(clk->parent_switch_reg) & 1)) {
123 printk(KERN_ERR
124 "%s ERROR: failed to select 13'MHz, parent sw reg data: %x\n",
125 clk->name, __raw_readl(clk->parent_switch_reg));
126 ret = -1;
127 }
128 }
129
130 if (!clk->rate)
131 clk_reg_disable1(clk);
132
133 return ret;
134}
135
136static int switch_to_clean_13mhz(struct clk *clk)
137{
138 int i;
139 int ret;
140 u32 tmp_reg;
141
142 ret = 0;
143
144 if (!clk->rate)
145 clk_reg_enable1(clk);
146
147 tmp_reg = __raw_readl(clk->parent_switch_reg);
148 /*if 13'Mhz clock selected, select 13MHz (clean) source from OSC */
149 if (tmp_reg & 1) {
150 tmp_reg &= ~(1 << 1); /* Trigger switch to 13MHz (clean) clock */
151 __raw_writel(tmp_reg, clk->parent_switch_reg);
152 i = 0;
153 while (i++ < 0xFFF && (__raw_readl(clk->parent_switch_reg) & 1)) ; /*wait for 13MHz selection status */
154
155 if (__raw_readl(clk->parent_switch_reg) & 1) {
156 printk(KERN_ERR
157 "%s ERROR: failed to select 13MHz, parent sw reg data: %x\n",
158 clk->name, __raw_readl(clk->parent_switch_reg));
159 ret = -1;
160 }
161 }
162
163 if (!clk->rate)
164 clk_reg_disable1(clk);
165
166 return ret;
167}
168
169static int set_13MHz_parent(struct clk *clk, struct clk *parent)
170{
171 int ret = -EINVAL;
172
173 if (parent == &ck_13MHz)
174 ret = switch_to_clean_13mhz(clk);
175 else if (parent == &ck_pll1)
176 ret = switch_to_dirty_13mhz(clk);
177
178 return ret;
179}
180
181#define PLL160_MIN_FCCO 156000
182#define PLL160_MAX_FCCO 320000
183
184/*
185 * Calculate pll160 settings.
186 * Possible input: up to 320MHz with step of clk->parent->rate.
187 * In PNX4008 parent rate for pll160s may be either 1 or 13MHz.
188 * Ignored paths: "feedback" (bit 13 set), "div-by-N".
189 * Setting ARM PLL4 rate to 0 will put CPU into direct run mode.
190 * Setting PLL5 and PLL3 rate to 0 will disable USB and DSP clock input.
191 * Please refer to PNX4008 IC manual for details.
192 */
193
194static int pll160_set_rate(struct clk *clk, u32 rate)
195{
196 u32 tmp_reg, tmp_m, tmp_2p, i;
197 u32 parent_rate;
198 int ret = -EINVAL;
199
200 parent_rate = clk->parent->rate;
201
202 if (!parent_rate)
203 goto out;
204
205 /* set direct run for ARM or disable output for others */
206 clk_reg_disable(clk);
207
208 /* disable source input as well (ignored for ARM) */
209 clk_reg_disable1(clk);
210
211 tmp_reg = __raw_readl(clk->scale_reg);
212 tmp_reg &= ~0x1ffff; /*clear all settings, power down */
213 __raw_writel(tmp_reg, clk->scale_reg);
214
215 rate -= rate % parent_rate; /*round down the input */
216
217 if (rate > PLL160_MAX_FCCO)
218 rate = PLL160_MAX_FCCO;
219
220 if (!rate) {
221 clk->rate = 0;
222 ret = 0;
223 goto out;
224 }
225
226 clk_reg_enable1(clk);
227 tmp_reg = __raw_readl(clk->scale_reg);
228
229 if (rate == parent_rate) {
230 /*enter direct bypass mode */
231 tmp_reg |= ((1 << 14) | (1 << 15));
232 __raw_writel(tmp_reg, clk->scale_reg);
233 clk->rate = parent_rate;
234 clk_reg_enable(clk);
235 ret = 0;
236 goto out;
237 }
238
239 i = 0;
240 for (tmp_2p = 1; tmp_2p < 16; tmp_2p <<= 1) {
241 if (rate * tmp_2p >= PLL160_MIN_FCCO)
242 break;
243 i++;
244 }
245
246 if (tmp_2p > 1)
247 tmp_reg |= ((i - 1) << 11);
248 else
249 tmp_reg |= (1 << 14); /*direct mode, no divide */
250
251 tmp_m = rate * tmp_2p;
252 tmp_m /= parent_rate;
253
254 tmp_reg |= (tmp_m - 1) << 1; /*calculate M */
255 tmp_reg |= (1 << 16); /*power up PLL */
256 __raw_writel(tmp_reg, clk->scale_reg);
257
258 if (clk_wait_for_pll_lock(clk) < 0) {
259 clk_reg_disable(clk);
260 clk_reg_disable1(clk);
261
262 tmp_reg = __raw_readl(clk->scale_reg);
263 tmp_reg &= ~0x1ffff; /*clear all settings, power down */
264 __raw_writel(tmp_reg, clk->scale_reg);
265 clk->rate = 0;
266 ret = -EFAULT;
267 goto out;
268 }
269
270 clk->rate = (tmp_m * parent_rate) / tmp_2p;
271
272 if (clk->flags & RATE_PROPAGATES)
273 propagate_rate(clk);
274
275 clk_reg_enable(clk);
276 ret = 0;
277
278out:
279 return ret;
280}
281
282/*configure PER_CLK*/
283static int per_clk_set_rate(struct clk *clk, u32 rate)
284{
285 u32 tmp;
286
287 tmp = __raw_readl(clk->scale_reg);
288 tmp &= ~(0x1f << 2);
289 tmp |= ((clk->parent->rate / clk->rate) - 1) << 2;
290 __raw_writel(tmp, clk->scale_reg);
291 clk->rate = rate;
292 return 0;
293}
294
295/*configure HCLK*/
296static int hclk_set_rate(struct clk *clk, u32 rate)
297{
298 u32 tmp;
299 tmp = __raw_readl(clk->scale_reg);
300 tmp = tmp & ~0x3;
301 switch (rate) {
302 case 1:
303 break;
304 case 2:
305 tmp |= 1;
306 break;
307 case 4:
308 tmp |= 2;
309 break;
310 }
311
312 __raw_writel(tmp, clk->scale_reg);
313 clk->rate = rate;
314 return 0;
315}
316
317static u32 hclk_round_rate(struct clk *clk, u32 rate)
318{
319 switch (rate) {
320 case 1:
321 case 4:
322 return rate;
323 }
324 return 2;
325}
326
327static u32 per_clk_round_rate(struct clk *clk, u32 rate)
328{
329 return CLK_RATE_13MHZ;
330}
331
332static int on_off_set_rate(struct clk *clk, u32 rate)
333{
334 if (rate) {
335 clk_reg_enable(clk);
336 clk->rate = 1;
337 } else {
338 clk_reg_disable(clk);
339 clk->rate = 0;
340 }
341 return 0;
342}
343
344static int on_off_inv_set_rate(struct clk *clk, u32 rate)
345{
346 if (rate) {
347 clk_reg_disable(clk); /*enable bit is inverted */
348 clk->rate = 1;
349 } else {
350 clk_reg_enable(clk);
351 clk->rate = 0;
352 }
353 return 0;
354}
355
356static u32 on_off_round_rate(struct clk *clk, u32 rate)
357{
358 return (rate ? 1 : 0);
359}
360
361static u32 pll4_round_rate(struct clk *clk, u32 rate)
362{
363 if (rate > CLK_RATE_208MHZ)
364 rate = CLK_RATE_208MHZ;
365 if (rate == CLK_RATE_208MHZ && hclk_ck.user_rate == 1)
366 rate = CLK_RATE_208MHZ - CLK_RATE_13MHZ;
367 return (rate - (rate % (hclk_ck.user_rate * CLK_RATE_13MHZ)));
368}
369
370static u32 pll3_round_rate(struct clk *clk, u32 rate)
371{
372 if (rate > CLK_RATE_208MHZ)
373 rate = CLK_RATE_208MHZ;
374 return (rate - rate % CLK_RATE_13MHZ);
375}
376
377static u32 pll5_round_rate(struct clk *clk, u32 rate)
378{
379 return (rate ? CLK_RATE_48MHZ : 0);
380}
381
382static u32 ck_13MHz_round_rate(struct clk *clk, u32 rate)
383{
384 return (rate ? CLK_RATE_13MHZ : 0);
385}
386
387static int ck_13MHz_set_rate(struct clk *clk, u32 rate)
388{
389 if (rate) {
390 clk_reg_disable(clk); /*enable bit is inverted */
391 udelay(500);
392 clk->rate = CLK_RATE_13MHZ;
393 ck_1MHz.rate = CLK_RATE_1MHZ;
394 } else {
395 clk_reg_enable(clk);
396 clk->rate = 0;
397 ck_1MHz.rate = 0;
398 }
399 return 0;
400}
401
402static int pll1_set_rate(struct clk *clk, u32 rate)
403{
404#if 0 /* doesn't work on some boards, probably a HW BUG */
405 if (rate) {
406 clk_reg_disable(clk); /*enable bit is inverted */
407 if (!clk_wait_for_pll_lock(clk)) {
408 clk->rate = CLK_RATE_13MHZ;
409 } else {
410 clk_reg_enable(clk);
411 clk->rate = 0;
412 }
413
414 } else {
415 clk_reg_enable(clk);
416 clk->rate = 0;
417 }
418#endif
419 return 0;
420}
421
422/* Clock sources */
423
424static struct clk osc_13MHz = {
425 .name = "osc_13MHz",
426 .flags = FIXED_RATE,
427 .rate = CLK_RATE_13MHZ,
428};
429
430static struct clk ck_13MHz = {
431 .name = "ck_13MHz",
432 .parent = &osc_13MHz,
433 .flags = NEEDS_INITIALIZATION,
434 .round_rate = &ck_13MHz_round_rate,
435 .set_rate = &ck_13MHz_set_rate,
436 .enable_reg = OSC13CTRL_REG,
437 .enable_shift = 0,
438 .rate = CLK_RATE_13MHZ,
439};
440
441static struct clk osc_32KHz = {
442 .name = "osc_32KHz",
443 .flags = FIXED_RATE,
444 .rate = CLK_RATE_32KHZ,
445};
446
447/*attached to PLL5*/
448static struct clk ck_1MHz = {
449 .name = "ck_1MHz",
450 .flags = FIXED_RATE | PARENT_SET_RATE,
451 .parent = &ck_13MHz,
452};
453
454/* PLL1 (397) - provides 13' MHz clock */
455static struct clk ck_pll1 = {
456 .name = "ck_pll1",
457 .parent = &osc_32KHz,
458 .flags = NEEDS_INITIALIZATION,
459 .round_rate = &ck_13MHz_round_rate,
460 .set_rate = &pll1_set_rate,
461 .enable_reg = PLLCTRL_REG,
462 .enable_shift = 1,
463 .scale_reg = PLLCTRL_REG,
464 .rate = CLK_RATE_13MHZ,
465};
466
467/* CPU/Bus PLL */
468static struct clk ck_pll4 = {
469 .name = "ck_pll4",
470 .parent = &ck_pll1,
471 .flags = RATE_PROPAGATES | NEEDS_INITIALIZATION,
472 .propagate_next = &per_ck,
473 .round_rate = &pll4_round_rate,
474 .set_rate = &pll160_set_rate,
475 .rate = CLK_RATE_208MHZ,
476 .scale_reg = HCLKPLLCTRL_REG,
477 .enable_reg = PWRCTRL_REG,
478 .enable_shift = 2,
479 .parent_switch_reg = SYSCLKCTRL_REG,
480 .set_parent = &set_13MHz_parent,
481};
482
483/* USB PLL */
484static struct clk ck_pll5 = {
485 .name = "ck_pll5",
486 .parent = &ck_1MHz,
487 .flags = NEEDS_INITIALIZATION,
488 .round_rate = &pll5_round_rate,
489 .set_rate = &pll160_set_rate,
490 .scale_reg = USBCTRL_REG,
491 .enable_reg = USBCTRL_REG,
492 .enable_shift = 18,
493 .enable_reg1 = USBCTRL_REG,
494 .enable_shift1 = 17,
495};
496
497/* XPERTTeak DSP PLL */
498static struct clk ck_pll3 = {
499 .name = "ck_pll3",
500 .parent = &ck_pll1,
501 .flags = NEEDS_INITIALIZATION,
502 .round_rate = &pll3_round_rate,
503 .set_rate = &pll160_set_rate,
504 .scale_reg = DSPPLLCTRL_REG,
505 .enable_reg = DSPCLKCTRL_REG,
506 .enable_shift = 3,
507 .enable_reg1 = DSPCLKCTRL_REG,
508 .enable_shift1 = 2,
509 .parent_switch_reg = DSPCLKCTRL_REG,
510 .set_parent = &set_13MHz_parent,
511};
512
513static struct clk hclk_ck = {
514 .name = "hclk_ck",
515 .parent = &ck_pll4,
516 .flags = PARENT_SET_RATE,
517 .set_rate = &hclk_set_rate,
518 .round_rate = &hclk_round_rate,
519 .scale_reg = HCLKDIVCTRL_REG,
520 .rate = 2,
521 .user_rate = 2,
522};
523
524static struct clk per_ck = {
525 .name = "per_ck",
526 .parent = &ck_pll4,
527 .flags = FIXED_RATE,
528 .propagate_next = &hclk_ck,
529 .set_rate = &per_clk_set_rate,
530 .round_rate = &per_clk_round_rate,
531 .scale_reg = HCLKDIVCTRL_REG,
532 .rate = CLK_RATE_13MHZ,
533 .user_rate = CLK_RATE_13MHZ,
534};
535
536static struct clk m2hclk_ck = {
537 .name = "m2hclk_ck",
538 .parent = &hclk_ck,
539 .flags = NEEDS_INITIALIZATION,
540 .round_rate = &on_off_round_rate,
541 .set_rate = &on_off_inv_set_rate,
542 .rate = 1,
543 .enable_shift = 6,
544 .enable_reg = PWRCTRL_REG,
545};
546
547static struct clk vfp9_ck = {
548 .name = "vfp9_ck",
549 .parent = &ck_pll4,
550 .flags = NEEDS_INITIALIZATION,
551 .round_rate = &on_off_round_rate,
552 .set_rate = &on_off_set_rate,
553 .rate = 1,
554 .enable_shift = 4,
555 .enable_reg = VFP9CLKCTRL_REG,
556};
557
558static struct clk keyscan_ck = {
559 .name = "keyscan_ck",
560 .parent = &osc_32KHz,
561 .flags = NEEDS_INITIALIZATION,
562 .round_rate = &on_off_round_rate,
563 .set_rate = &on_off_set_rate,
564 .enable_shift = 0,
565 .enable_reg = KEYCLKCTRL_REG,
566};
567
568static struct clk touch_ck = {
569 .name = "touch_ck",
570 .parent = &osc_32KHz,
571 .flags = NEEDS_INITIALIZATION,
572 .round_rate = &on_off_round_rate,
573 .set_rate = &on_off_set_rate,
574 .enable_shift = 0,
575 .enable_reg = TSCLKCTRL_REG,
576};
577
578static struct clk pwm1_ck = {
579 .name = "pwm1_ck",
580 .parent = &osc_32KHz,
581 .flags = NEEDS_INITIALIZATION,
582 .round_rate = &on_off_round_rate,
583 .set_rate = &on_off_set_rate,
584 .enable_shift = 0,
585 .enable_reg = PWMCLKCTRL_REG,
586};
587
588static struct clk pwm2_ck = {
589 .name = "pwm2_ck",
590 .parent = &osc_32KHz,
591 .flags = NEEDS_INITIALIZATION,
592 .round_rate = &on_off_round_rate,
593 .set_rate = &on_off_set_rate,
594 .enable_shift = 2,
595 .enable_reg = PWMCLKCTRL_REG,
596};
597
598static struct clk jpeg_ck = {
599 .name = "jpeg_ck",
600 .parent = &hclk_ck,
601 .flags = NEEDS_INITIALIZATION,
602 .round_rate = &on_off_round_rate,
603 .set_rate = &on_off_set_rate,
604 .enable_shift = 0,
605 .enable_reg = JPEGCLKCTRL_REG,
606};
607
608static struct clk ms_ck = {
609 .name = "ms_ck",
610 .parent = &ck_pll4,
611 .flags = NEEDS_INITIALIZATION,
612 .round_rate = &on_off_round_rate,
613 .set_rate = &on_off_set_rate,
614 .enable_shift = 5,
615 .enable_reg = MSCTRL_REG,
616};
617
618static struct clk dum_ck = {
619 .name = "dum_ck",
620 .parent = &hclk_ck,
621 .flags = NEEDS_INITIALIZATION,
622 .round_rate = &on_off_round_rate,
623 .set_rate = &on_off_set_rate,
624 .enable_shift = 0,
625 .enable_reg = DUMCLKCTRL_REG,
626};
627
628static struct clk flash_ck = {
629 .name = "flash_ck",
630 .parent = &hclk_ck,
631 .round_rate = &on_off_round_rate,
632 .set_rate = &on_off_set_rate,
633 .enable_shift = 1, /* Only MLC clock supported */
634 .enable_reg = FLASHCLKCTRL_REG,
635};
636
637static struct clk i2c0_ck = {
638 .name = "i2c0_ck",
639 .parent = &per_ck,
640 .flags = NEEDS_INITIALIZATION | FIXED_RATE,
641 .enable_shift = 0,
642 .enable_reg = I2CCLKCTRL_REG,
643 .rate = 13000000,
644 .enable = clk_reg_enable,
645 .disable = clk_reg_disable,
646};
647
648static struct clk i2c1_ck = {
649 .name = "i2c1_ck",
650 .parent = &per_ck,
651 .flags = NEEDS_INITIALIZATION | FIXED_RATE,
652 .enable_shift = 1,
653 .enable_reg = I2CCLKCTRL_REG,
654 .rate = 13000000,
655 .enable = clk_reg_enable,
656 .disable = clk_reg_disable,
657};
658
659static struct clk i2c2_ck = {
660 .name = "i2c2_ck",
661 .parent = &per_ck,
662 .flags = NEEDS_INITIALIZATION | FIXED_RATE,
663 .enable_shift = 2,
664 .enable_reg = USB_OTG_CLKCTRL_REG,
665 .rate = 13000000,
666 .enable = clk_reg_enable,
667 .disable = clk_reg_disable,
668};
669
670static struct clk spi0_ck = {
671 .name = "spi0_ck",
672 .parent = &hclk_ck,
673 .flags = NEEDS_INITIALIZATION,
674 .round_rate = &on_off_round_rate,
675 .set_rate = &on_off_set_rate,
676 .enable_shift = 0,
677 .enable_reg = SPICTRL_REG,
678};
679
680static struct clk spi1_ck = {
681 .name = "spi1_ck",
682 .parent = &hclk_ck,
683 .flags = NEEDS_INITIALIZATION,
684 .round_rate = &on_off_round_rate,
685 .set_rate = &on_off_set_rate,
686 .enable_shift = 4,
687 .enable_reg = SPICTRL_REG,
688};
689
690static struct clk dma_ck = {
691 .name = "dma_ck",
692 .parent = &hclk_ck,
693 .round_rate = &on_off_round_rate,
694 .set_rate = &on_off_set_rate,
695 .enable_shift = 0,
696 .enable_reg = DMACLKCTRL_REG,
697};
698
699static struct clk uart3_ck = {
700 .name = "uart3_ck",
701 .parent = &per_ck,
702 .flags = NEEDS_INITIALIZATION,
703 .round_rate = &on_off_round_rate,
704 .set_rate = &on_off_set_rate,
705 .rate = 1,
706 .enable_shift = 0,
707 .enable_reg = UARTCLKCTRL_REG,
708};
709
710static struct clk uart4_ck = {
711 .name = "uart4_ck",
712 .parent = &per_ck,
713 .flags = NEEDS_INITIALIZATION,
714 .round_rate = &on_off_round_rate,
715 .set_rate = &on_off_set_rate,
716 .enable_shift = 1,
717 .enable_reg = UARTCLKCTRL_REG,
718};
719
720static struct clk uart5_ck = {
721 .name = "uart5_ck",
722 .parent = &per_ck,
723 .flags = NEEDS_INITIALIZATION,
724 .round_rate = &on_off_round_rate,
725 .set_rate = &on_off_set_rate,
726 .rate = 1,
727 .enable_shift = 2,
728 .enable_reg = UARTCLKCTRL_REG,
729};
730
731static struct clk uart6_ck = {
732 .name = "uart6_ck",
733 .parent = &per_ck,
734 .flags = NEEDS_INITIALIZATION,
735 .round_rate = &on_off_round_rate,
736 .set_rate = &on_off_set_rate,
737 .enable_shift = 3,
738 .enable_reg = UARTCLKCTRL_REG,
739};
740
741static struct clk wdt_ck = {
742 .name = "wdt_ck",
743 .parent = &per_ck,
744 .flags = NEEDS_INITIALIZATION,
745 .enable_shift = 0,
746 .enable_reg = TIMCLKCTRL_REG,
747 .enable = clk_reg_enable,
748 .disable = clk_reg_disable,
749};
750
751/* These clocks are visible outside this module
752 * and can be initialized
753 */
754static struct clk *onchip_clks[] __initdata = {
755 &ck_13MHz,
756 &ck_pll1,
757 &ck_pll4,
758 &ck_pll5,
759 &ck_pll3,
760 &vfp9_ck,
761 &m2hclk_ck,
762 &hclk_ck,
763 &dma_ck,
764 &flash_ck,
765 &dum_ck,
766 &keyscan_ck,
767 &pwm1_ck,
768 &pwm2_ck,
769 &jpeg_ck,
770 &ms_ck,
771 &touch_ck,
772 &i2c0_ck,
773 &i2c1_ck,
774 &i2c2_ck,
775 &spi0_ck,
776 &spi1_ck,
777 &uart3_ck,
778 &uart4_ck,
779 &uart5_ck,
780 &uart6_ck,
781 &wdt_ck,
782};
783
784static struct clk_lookup onchip_clkreg[] = {
785 { .clk = &ck_13MHz, .con_id = "ck_13MHz" },
786 { .clk = &ck_pll1, .con_id = "ck_pll1" },
787 { .clk = &ck_pll4, .con_id = "ck_pll4" },
788 { .clk = &ck_pll5, .con_id = "ck_pll5" },
789 { .clk = &ck_pll3, .con_id = "ck_pll3" },
790 { .clk = &vfp9_ck, .con_id = "vfp9_ck" },
791 { .clk = &m2hclk_ck, .con_id = "m2hclk_ck" },
792 { .clk = &hclk_ck, .con_id = "hclk_ck" },
793 { .clk = &dma_ck, .con_id = "dma_ck" },
794 { .clk = &flash_ck, .con_id = "flash_ck" },
795 { .clk = &dum_ck, .con_id = "dum_ck" },
796 { .clk = &keyscan_ck, .con_id = "keyscan_ck" },
797 { .clk = &pwm1_ck, .con_id = "pwm1_ck" },
798 { .clk = &pwm2_ck, .con_id = "pwm2_ck" },
799 { .clk = &jpeg_ck, .con_id = "jpeg_ck" },
800 { .clk = &ms_ck, .con_id = "ms_ck" },
801 { .clk = &touch_ck, .con_id = "touch_ck" },
802 { .clk = &i2c0_ck, .dev_id = "pnx-i2c.0" },
803 { .clk = &i2c1_ck, .dev_id = "pnx-i2c.1" },
804 { .clk = &i2c2_ck, .dev_id = "pnx-i2c.2" },
805 { .clk = &spi0_ck, .con_id = "spi0_ck" },
806 { .clk = &spi1_ck, .con_id = "spi1_ck" },
807 { .clk = &uart3_ck, .con_id = "uart3_ck" },
808 { .clk = &uart4_ck, .con_id = "uart4_ck" },
809 { .clk = &uart5_ck, .con_id = "uart5_ck" },
810 { .clk = &uart6_ck, .con_id = "uart6_ck" },
811 { .clk = &wdt_ck, .dev_id = "pnx4008-watchdog" },
812};
813
814static void local_clk_disable(struct clk *clk)
815{
816 if (WARN_ON(clk->usecount == 0))
817 return;
818
819 if (!(--clk->usecount)) {
820 if (clk->disable)
821 clk->disable(clk);
822 else if (!(clk->flags & FIXED_RATE) && clk->rate && clk->set_rate)
823 clk->set_rate(clk, 0);
824 if (clk->parent)
825 local_clk_disable(clk->parent);
826 }
827}
828
829static int local_clk_enable(struct clk *clk)
830{
831 int ret = 0;
832
833 if (clk->usecount == 0) {
834 if (clk->parent) {
835 ret = local_clk_enable(clk->parent);
836 if (ret != 0)
837 goto out;
838 }
839
840 if (clk->enable)
841 ret = clk->enable(clk);
842 else if (!(clk->flags & FIXED_RATE) && !clk->rate && clk->set_rate
843 && clk->user_rate)
844 ret = clk->set_rate(clk, clk->user_rate);
845
846 if (ret != 0 && clk->parent) {
847 local_clk_disable(clk->parent);
848 goto out;
849 }
850
851 clk->usecount++;
852 }
853out:
854 return ret;
855}
856
857static int local_set_rate(struct clk *clk, u32 rate)
858{
859 int ret = -EINVAL;
860 if (clk->set_rate) {
861
862 if (clk->user_rate == clk->rate && clk->parent->rate) {
863 /* if clock enabled or rate not set */
864 clk->user_rate = clk->round_rate(clk, rate);
865 ret = clk->set_rate(clk, clk->user_rate);
866 } else
867 clk->user_rate = clk->round_rate(clk, rate);
868 ret = 0;
869 }
870 return ret;
871}
872
873int clk_set_rate(struct clk *clk, unsigned long rate)
874{
875 int ret = -EINVAL;
876
877 if (clk->flags & FIXED_RATE)
878 goto out;
879
880 clock_lock();
881 if ((clk->flags & PARENT_SET_RATE) && clk->parent) {
882
883 clk->user_rate = clk->round_rate(clk, rate);
884 /* parent clock needs to be refreshed
885 for the setting to take effect */
886 } else {
887 ret = local_set_rate(clk, rate);
888 }
889 ret = 0;
890 clock_unlock();
891
892out:
893 return ret;
894}
895
896EXPORT_SYMBOL(clk_set_rate);
897
898unsigned long clk_get_rate(struct clk *clk)
899{
900 unsigned long ret;
901 clock_lock();
902 ret = clk->rate;
903 clock_unlock();
904 return ret;
905}
906EXPORT_SYMBOL(clk_get_rate);
907
908int clk_enable(struct clk *clk)
909{
910 int ret;
911
912 clock_lock();
913 ret = local_clk_enable(clk);
914 clock_unlock();
915 return ret;
916}
917
918EXPORT_SYMBOL(clk_enable);
919
920void clk_disable(struct clk *clk)
921{
922 clock_lock();
923 local_clk_disable(clk);
924 clock_unlock();
925}
926
927EXPORT_SYMBOL(clk_disable);
928
929long clk_round_rate(struct clk *clk, unsigned long rate)
930{
931 long ret;
932 clock_lock();
933 if (clk->round_rate)
934 ret = clk->round_rate(clk, rate);
935 else
936 ret = clk->rate;
937 clock_unlock();
938 return ret;
939}
940
941EXPORT_SYMBOL(clk_round_rate);
942
943int clk_set_parent(struct clk *clk, struct clk *parent)
944{
945 int ret = -ENODEV;
946 if (!clk->set_parent)
947 goto out;
948
949 clock_lock();
950 ret = clk->set_parent(clk, parent);
951 if (!ret)
952 clk->parent = parent;
953 clock_unlock();
954
955out:
956 return ret;
957}
958
959EXPORT_SYMBOL(clk_set_parent);
960
961static int __init clk_init(void)
962{
963 struct clk **clkp;
964
965 /* Disable autoclocking, as it doesn't seem to work */
966 __raw_writel(0xff, AUTOCLK_CTRL);
967
968 for (clkp = onchip_clks; clkp < onchip_clks + ARRAY_SIZE(onchip_clks);
969 clkp++) {
970 struct clk *clk = *clkp;
971 if (clk->flags & NEEDS_INITIALIZATION) {
972 if (clk->set_rate) {
973 clk->user_rate = clk->rate;
974 local_set_rate(clk, clk->user_rate);
975 if (clk->set_parent)
976 clk->set_parent(clk, clk->parent);
977 }
978 if (clk->enable && clk->usecount)
979 clk->enable(clk);
980 if (clk->disable && !clk->usecount)
981 clk->disable(clk);
982 }
983 pr_debug("%s: clock %s, rate %ld\n",
984 __func__, clk->name, clk->rate);
985 }
986
987 local_clk_enable(&ck_pll4);
988
989 /* if ck_13MHz is not used, disable it. */
990 if (ck_13MHz.usecount == 0)
991 local_clk_disable(&ck_13MHz);
992
993 /* Disable autoclocking */
994 __raw_writeb(0xff, AUTOCLK_CTRL);
995
996 clkdev_add_table(onchip_clkreg, ARRAY_SIZE(onchip_clkreg));
997
998 return 0;
999}
1000
1001arch_initcall(clk_init);
diff --git a/arch/arm/mach-pnx4008/clock.h b/arch/arm/mach-pnx4008/clock.h
deleted file mode 100644
index 39720d6c0d0..00000000000
--- a/arch/arm/mach-pnx4008/clock.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/clock.h
3 *
4 * Clock control driver for PNX4008 - internal header file
5 *
6 * Author: Vitaly Wool <source@mvista.com>
7 *
8 * 2006 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#ifndef __ARCH_ARM_PNX4008_CLOCK_H__
14#define __ARCH_ARM_PNX4008_CLOCK_H__
15
16struct clk {
17 const char *name;
18 struct clk *parent;
19 struct clk *propagate_next;
20 u32 rate;
21 u32 user_rate;
22 s8 usecount;
23 u32 flags;
24 u32 scale_reg;
25 u8 enable_shift;
26 u32 enable_reg;
27 u8 enable_shift1;
28 u32 enable_reg1;
29 u32 parent_switch_reg;
30 u32(*round_rate) (struct clk *, u32);
31 int (*set_rate) (struct clk *, u32);
32 int (*set_parent) (struct clk * clk, struct clk * parent);
33 int (*enable)(struct clk *);
34 void (*disable)(struct clk *);
35};
36
37/* Flags */
38#define RATE_PROPAGATES (1<<0)
39#define NEEDS_INITIALIZATION (1<<1)
40#define PARENT_SET_RATE (1<<2)
41#define FIXED_RATE (1<<3)
42
43#endif
diff --git a/arch/arm/mach-pnx4008/core.c b/arch/arm/mach-pnx4008/core.c
deleted file mode 100644
index a00d2f1254e..00000000000
--- a/arch/arm/mach-pnx4008/core.c
+++ /dev/null
@@ -1,290 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/core.c
3 *
4 * PNX4008 core startup code
5 *
6 * Authors: Vitaly Wool, Dmitry Chigirev,
7 * Grigory Tolstolytkin, Dmitry Pervushin <source@mvista.com>
8 *
9 * Based on reference code received from Philips:
10 * Copyright (C) 2003 Philips Semiconductors
11 *
12 * 2005 (c) MontaVista Software, Inc. This file is licensed under
13 * the terms of the GNU General Public License version 2. This program
14 * is licensed "as is" without any warranty of any kind, whether express
15 * or implied.
16 */
17
18#include <linux/kernel.h>
19#include <linux/types.h>
20#include <linux/mm.h>
21#include <linux/interrupt.h>
22#include <linux/list.h>
23#include <linux/init.h>
24#include <linux/ioport.h>
25#include <linux/serial_8250.h>
26#include <linux/device.h>
27#include <linux/spi/spi.h>
28#include <linux/io.h>
29
30#include <mach/hardware.h>
31#include <asm/setup.h>
32#include <asm/mach-types.h>
33#include <asm/pgtable.h>
34#include <asm/page.h>
35#include <asm/system_misc.h>
36
37#include <asm/mach/arch.h>
38#include <asm/mach/map.h>
39#include <asm/mach/time.h>
40
41#include <mach/irq.h>
42#include <mach/clock.h>
43#include <mach/dma.h>
44
45struct resource spipnx_0_resources[] = {
46 {
47 .start = PNX4008_SPI1_BASE,
48 .end = PNX4008_SPI1_BASE + SZ_4K,
49 .flags = IORESOURCE_MEM,
50 }, {
51 .start = PER_SPI1_REC_XMIT,
52 .flags = IORESOURCE_DMA,
53 }, {
54 .start = SPI1_INT,
55 .flags = IORESOURCE_IRQ,
56 }, {
57 .flags = 0,
58 },
59};
60
61struct resource spipnx_1_resources[] = {
62 {
63 .start = PNX4008_SPI2_BASE,
64 .end = PNX4008_SPI2_BASE + SZ_4K,
65 .flags = IORESOURCE_MEM,
66 }, {
67 .start = PER_SPI2_REC_XMIT,
68 .flags = IORESOURCE_DMA,
69 }, {
70 .start = SPI2_INT,
71 .flags = IORESOURCE_IRQ,
72 }, {
73 .flags = 0,
74 }
75};
76
77static struct spi_board_info spi_board_info[] __initdata = {
78 {
79 .modalias = "m25p80",
80 .max_speed_hz = 1000000,
81 .bus_num = 1,
82 .chip_select = 0,
83 },
84};
85
86static struct platform_device spipnx_1 = {
87 .name = "spipnx",
88 .id = 1,
89 .num_resources = ARRAY_SIZE(spipnx_0_resources),
90 .resource = spipnx_0_resources,
91 .dev = {
92 .coherent_dma_mask = 0xFFFFFFFF,
93 },
94};
95
96static struct platform_device spipnx_2 = {
97 .name = "spipnx",
98 .id = 2,
99 .num_resources = ARRAY_SIZE(spipnx_1_resources),
100 .resource = spipnx_1_resources,
101 .dev = {
102 .coherent_dma_mask = 0xFFFFFFFF,
103 },
104};
105
106static struct plat_serial8250_port platform_serial_ports[] = {
107 {
108 .membase = (void *)__iomem(IO_ADDRESS(PNX4008_UART5_BASE)),
109 .mapbase = (unsigned long)PNX4008_UART5_BASE,
110 .irq = IIR5_INT,
111 .uartclk = PNX4008_UART_CLK,
112 .regshift = 2,
113 .iotype = UPIO_MEM,
114 .flags = UPF_BOOT_AUTOCONF | UPF_BUGGY_UART | UPF_SKIP_TEST,
115 },
116 {
117 .membase = (void *)__iomem(IO_ADDRESS(PNX4008_UART3_BASE)),
118 .mapbase = (unsigned long)PNX4008_UART3_BASE,
119 .irq = IIR3_INT,
120 .uartclk = PNX4008_UART_CLK,
121 .regshift = 2,
122 .iotype = UPIO_MEM,
123 .flags = UPF_BOOT_AUTOCONF | UPF_BUGGY_UART | UPF_SKIP_TEST,
124 },
125 {}
126};
127
128static struct platform_device serial_device = {
129 .name = "serial8250",
130 .id = PLAT8250_DEV_PLATFORM,
131 .dev = {
132 .platform_data = &platform_serial_ports,
133 },
134};
135
136static struct platform_device nand_flash_device = {
137 .name = "pnx4008-flash",
138 .id = -1,
139 .dev = {
140 .coherent_dma_mask = 0xFFFFFFFF,
141 },
142};
143
144/* The dmamask must be set for OHCI to work */
145static u64 ohci_dmamask = ~(u32) 0;
146
147static struct resource ohci_resources[] = {
148 {
149 .start = IO_ADDRESS(PNX4008_USB_CONFIG_BASE),
150 .end = IO_ADDRESS(PNX4008_USB_CONFIG_BASE + 0x100),
151 .flags = IORESOURCE_MEM,
152 }, {
153 .start = USB_HOST_INT,
154 .flags = IORESOURCE_IRQ,
155 },
156};
157
158static struct platform_device ohci_device = {
159 .name = "pnx4008-usb-ohci",
160 .id = -1,
161 .dev = {
162 .dma_mask = &ohci_dmamask,
163 .coherent_dma_mask = 0xffffffff,
164 },
165 .num_resources = ARRAY_SIZE(ohci_resources),
166 .resource = ohci_resources,
167};
168
169static struct platform_device sdum_device = {
170 .name = "pnx4008-sdum",
171 .id = 0,
172 .dev = {
173 .coherent_dma_mask = 0xffffffff,
174 },
175};
176
177static struct platform_device rgbfb_device = {
178 .name = "pnx4008-rgbfb",
179 .id = 0,
180 .dev = {
181 .coherent_dma_mask = 0xffffffff,
182 }
183};
184
185struct resource watchdog_resources[] = {
186 {
187 .start = PNX4008_WDOG_BASE,
188 .end = PNX4008_WDOG_BASE + SZ_4K - 1,
189 .flags = IORESOURCE_MEM,
190 },
191};
192
193static struct platform_device watchdog_device = {
194 .name = "pnx4008-watchdog",
195 .id = -1,
196 .num_resources = ARRAY_SIZE(watchdog_resources),
197 .resource = watchdog_resources,
198};
199
200static struct platform_device *devices[] __initdata = {
201 &spipnx_1,
202 &spipnx_2,
203 &serial_device,
204 &ohci_device,
205 &nand_flash_device,
206 &sdum_device,
207 &rgbfb_device,
208 &watchdog_device,
209};
210
211
212extern void pnx4008_uart_init(void);
213
214static void __init pnx4008_init(void)
215{
216 /*disable all START interrupt sources,
217 and clear all START interrupt flags */
218 __raw_writel(0, START_INT_ER_REG(SE_PIN_BASE_INT));
219 __raw_writel(0, START_INT_ER_REG(SE_INT_BASE_INT));
220 __raw_writel(0xffffffff, START_INT_RSR_REG(SE_PIN_BASE_INT));
221 __raw_writel(0xffffffff, START_INT_RSR_REG(SE_INT_BASE_INT));
222
223 platform_add_devices(devices, ARRAY_SIZE(devices));
224 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
225 /* Switch on the UART clocks */
226 pnx4008_uart_init();
227}
228
229static struct map_desc pnx4008_io_desc[] __initdata = {
230 {
231 .virtual = IO_ADDRESS(PNX4008_IRAM_BASE),
232 .pfn = __phys_to_pfn(PNX4008_IRAM_BASE),
233 .length = SZ_64K,
234 .type = MT_DEVICE,
235 }, {
236 .virtual = IO_ADDRESS(PNX4008_NDF_FLASH_BASE),
237 .pfn = __phys_to_pfn(PNX4008_NDF_FLASH_BASE),
238 .length = SZ_1M - SZ_128K,
239 .type = MT_DEVICE,
240 }, {
241 .virtual = IO_ADDRESS(PNX4008_JPEG_CONFIG_BASE),
242 .pfn = __phys_to_pfn(PNX4008_JPEG_CONFIG_BASE),
243 .length = SZ_128K * 3,
244 .type = MT_DEVICE,
245 }, {
246 .virtual = IO_ADDRESS(PNX4008_DMA_CONFIG_BASE),
247 .pfn = __phys_to_pfn(PNX4008_DMA_CONFIG_BASE),
248 .length = SZ_1M,
249 .type = MT_DEVICE,
250 }, {
251 .virtual = IO_ADDRESS(PNX4008_AHB2FAB_BASE),
252 .pfn = __phys_to_pfn(PNX4008_AHB2FAB_BASE),
253 .length = SZ_1M,
254 .type = MT_DEVICE,
255 },
256};
257
258void __init pnx4008_map_io(void)
259{
260 iotable_init(pnx4008_io_desc, ARRAY_SIZE(pnx4008_io_desc));
261}
262
263static void pnx4008_restart(char mode, const char *cmd)
264{
265 soft_restart(0);
266}
267
268#ifdef CONFIG_PM
269extern int pnx4008_pm_init(void);
270#else
271static inline int pnx4008_pm_init(void) { return 0; }
272#endif
273
274void __init pnx4008_init_late(void)
275{
276 pnx4008_pm_init();
277}
278
279extern struct sys_timer pnx4008_timer;
280
281MACHINE_START(PNX4008, "Philips PNX4008")
282 /* Maintainer: MontaVista Software Inc. */
283 .atag_offset = 0x100,
284 .map_io = pnx4008_map_io,
285 .init_irq = pnx4008_init_irq,
286 .init_machine = pnx4008_init,
287 .init_late = pnx4008_init_late,
288 .timer = &pnx4008_timer,
289 .restart = pnx4008_restart,
290MACHINE_END
diff --git a/arch/arm/mach-pnx4008/dma.c b/arch/arm/mach-pnx4008/dma.c
deleted file mode 100644
index a4739e9fb2f..00000000000
--- a/arch/arm/mach-pnx4008/dma.c
+++ /dev/null
@@ -1,1105 +0,0 @@
1/*
2 * linux/arch/arm/mach-pnx4008/dma.c
3 *
4 * PNX4008 DMA registration and IRQ dispatching
5 *
6 * Author: Vitaly Wool
7 * Copyright: MontaVista Software Inc. (c) 2005
8 *
9 * Based on the code from Nicolas Pitre
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#include <linux/module.h>
17#include <linux/init.h>
18#include <linux/kernel.h>
19#include <linux/interrupt.h>
20#include <linux/errno.h>
21#include <linux/err.h>
22#include <linux/dma-mapping.h>
23#include <linux/clk.h>
24#include <linux/io.h>
25#include <linux/gfp.h>
26
27#include <mach/hardware.h>
28#include <mach/dma.h>
29#include <asm/dma-mapping.h>
30#include <mach/clock.h>
31
32static struct dma_channel {
33 char *name;
34 void (*irq_handler) (int, int, void *);
35 void *data;
36 struct pnx4008_dma_ll *ll;
37 u32 ll_dma;
38 void *target_addr;
39 int target_id;
40} dma_channels[MAX_DMA_CHANNELS];
41
42static struct ll_pool {
43 void *vaddr;
44 void *cur;
45 dma_addr_t dma_addr;
46 int count;
47} ll_pool;
48
49static DEFINE_SPINLOCK(ll_lock);
50
51struct pnx4008_dma_ll *pnx4008_alloc_ll_entry(dma_addr_t * ll_dma)
52{
53 struct pnx4008_dma_ll *ll = NULL;
54 unsigned long flags;
55
56 spin_lock_irqsave(&ll_lock, flags);
57 if (ll_pool.count > 4) { /* can give one more */
58 ll = *(struct pnx4008_dma_ll **) ll_pool.cur;
59 *ll_dma = ll_pool.dma_addr + ((void *)ll - ll_pool.vaddr);
60 *(void **)ll_pool.cur = **(void ***)ll_pool.cur;
61 memset(ll, 0, sizeof(*ll));
62 ll_pool.count--;
63 }
64 spin_unlock_irqrestore(&ll_lock, flags);
65
66 return ll;
67}
68
69EXPORT_SYMBOL_GPL(pnx4008_alloc_ll_entry);
70
71void pnx4008_free_ll_entry(struct pnx4008_dma_ll * ll, dma_addr_t ll_dma)
72{
73 unsigned long flags;
74
75 if (ll) {
76 if ((unsigned long)((long)ll - (long)ll_pool.vaddr) > 0x4000) {
77 printk(KERN_ERR "Trying to free entry not allocated by DMA\n");
78 BUG();
79 }
80
81 if (ll->flags & DMA_BUFFER_ALLOCATED)
82 ll->free(ll->alloc_data);
83
84 spin_lock_irqsave(&ll_lock, flags);
85 *(long *)ll = *(long *)ll_pool.cur;
86 *(long *)ll_pool.cur = (long)ll;
87 ll_pool.count++;
88 spin_unlock_irqrestore(&ll_lock, flags);
89 }
90}
91
92EXPORT_SYMBOL_GPL(pnx4008_free_ll_entry);
93
94void pnx4008_free_ll(u32 ll_dma, struct pnx4008_dma_ll * ll)
95{
96 struct pnx4008_dma_ll *ptr;
97 u32 dma;
98
99 while (ll) {
100 dma = ll->next_dma;
101 ptr = ll->next;
102 pnx4008_free_ll_entry(ll, ll_dma);
103
104 ll_dma = dma;
105 ll = ptr;
106 }
107}
108
109EXPORT_SYMBOL_GPL(pnx4008_free_ll);
110
111static int dma_channels_requested = 0;
112
113static inline void dma_increment_usage(void)
114{
115 if (!dma_channels_requested++) {
116 struct clk *clk = clk_get(0, "dma_ck");
117 if (!IS_ERR(clk)) {
118 clk_set_rate(clk, 1);
119 clk_put(clk);
120 }
121 pnx4008_config_dma(-1, -1, 1);
122 }
123}
124static inline void dma_decrement_usage(void)
125{
126 if (!--dma_channels_requested) {
127 struct clk *clk = clk_get(0, "dma_ck");
128 if (!IS_ERR(clk)) {
129 clk_set_rate(clk, 0);
130 clk_put(clk);
131 }
132 pnx4008_config_dma(-1, -1, 0);
133
134 }
135}
136
137static DEFINE_SPINLOCK(dma_lock);
138
139static inline void pnx4008_dma_lock(void)
140{
141 spin_lock_irq(&dma_lock);
142}
143
144static inline void pnx4008_dma_unlock(void)
145{
146 spin_unlock_irq(&dma_lock);
147}
148
149#define VALID_CHANNEL(c) (((c) >= 0) && ((c) < MAX_DMA_CHANNELS))
150
151int pnx4008_request_channel(char *name, int ch,
152 void (*irq_handler) (int, int, void *), void *data)
153{
154 int i, found = 0;
155
156 /* basic sanity checks */
157 if (!name || (ch != -1 && !VALID_CHANNEL(ch)))
158 return -EINVAL;
159
160 pnx4008_dma_lock();
161
162 /* try grabbing a DMA channel with the requested priority */
163 for (i = MAX_DMA_CHANNELS - 1; i >= 0; i--) {
164 if (!dma_channels[i].name && (ch == -1 || ch == i)) {
165 found = 1;
166 break;
167 }
168 }
169
170 if (found) {
171 dma_increment_usage();
172 dma_channels[i].name = name;
173 dma_channels[i].irq_handler = irq_handler;
174 dma_channels[i].data = data;
175 dma_channels[i].ll = NULL;
176 dma_channels[i].ll_dma = 0;
177 } else {
178 printk(KERN_WARNING "No more available DMA channels for %s\n",
179 name);
180 i = -ENODEV;
181 }
182
183 pnx4008_dma_unlock();
184 return i;
185}
186
187EXPORT_SYMBOL_GPL(pnx4008_request_channel);
188
189void pnx4008_free_channel(int ch)
190{
191 if (!dma_channels[ch].name) {
192 printk(KERN_CRIT
193 "%s: trying to free channel %d which is already freed\n",
194 __func__, ch);
195 return;
196 }
197
198 pnx4008_dma_lock();
199 pnx4008_free_ll(dma_channels[ch].ll_dma, dma_channels[ch].ll);
200 dma_channels[ch].ll = NULL;
201 dma_decrement_usage();
202
203 dma_channels[ch].name = NULL;
204 pnx4008_dma_unlock();
205}
206
207EXPORT_SYMBOL_GPL(pnx4008_free_channel);
208
209int pnx4008_config_dma(int ahb_m1_be, int ahb_m2_be, int enable)
210{
211 unsigned long dma_cfg = __raw_readl(DMAC_CONFIG);
212
213 switch (ahb_m1_be) {
214 case 0:
215 dma_cfg &= ~(1 << 1);
216 break;
217 case 1:
218 dma_cfg |= (1 << 1);
219 break;
220 default:
221 break;
222 }
223
224 switch (ahb_m2_be) {
225 case 0:
226 dma_cfg &= ~(1 << 2);
227 break;
228 case 1:
229 dma_cfg |= (1 << 2);
230 break;
231 default:
232 break;
233 }
234
235 switch (enable) {
236 case 0:
237 dma_cfg &= ~(1 << 0);
238 break;
239 case 1:
240 dma_cfg |= (1 << 0);
241 break;
242 default:
243 break;
244 }
245
246 pnx4008_dma_lock();
247 __raw_writel(dma_cfg, DMAC_CONFIG);
248 pnx4008_dma_unlock();
249
250 return 0;
251}
252
253EXPORT_SYMBOL_GPL(pnx4008_config_dma);
254
255int pnx4008_dma_pack_control(const struct pnx4008_dma_ch_ctrl * ch_ctrl,
256 unsigned long *ctrl)
257{
258 int i = 0, dbsize, sbsize, err = 0;
259
260 if (!ctrl || !ch_ctrl) {
261 err = -EINVAL;
262 goto out;
263 }
264
265 *ctrl = 0;
266
267 switch (ch_ctrl->tc_mask) {
268 case 0:
269 break;
270 case 1:
271 *ctrl |= (1 << 31);
272 break;
273
274 default:
275 err = -EINVAL;
276 goto out;
277 }
278
279 switch (ch_ctrl->cacheable) {
280 case 0:
281 break;
282 case 1:
283 *ctrl |= (1 << 30);
284 break;
285
286 default:
287 err = -EINVAL;
288 goto out;
289 }
290 switch (ch_ctrl->bufferable) {
291 case 0:
292 break;
293 case 1:
294 *ctrl |= (1 << 29);
295 break;
296
297 default:
298 err = -EINVAL;
299 goto out;
300 }
301 switch (ch_ctrl->priv_mode) {
302 case 0:
303 break;
304 case 1:
305 *ctrl |= (1 << 28);
306 break;
307
308 default:
309 err = -EINVAL;
310 goto out;
311 }
312 switch (ch_ctrl->di) {
313 case 0:
314 break;
315 case 1:
316 *ctrl |= (1 << 27);
317 break;
318
319 default:
320 err = -EINVAL;
321 goto out;
322 }
323 switch (ch_ctrl->si) {
324 case 0:
325 break;
326 case 1:
327 *ctrl |= (1 << 26);
328 break;
329
330 default:
331 err = -EINVAL;
332 goto out;
333 }
334 switch (ch_ctrl->dest_ahb1) {
335 case 0:
336 break;
337 case 1:
338 *ctrl |= (1 << 25);
339 break;
340
341 default:
342 err = -EINVAL;
343 goto out;
344 }
345 switch (ch_ctrl->src_ahb1) {
346 case 0:
347 break;
348 case 1:
349 *ctrl |= (1 << 24);
350 break;
351
352 default:
353 err = -EINVAL;
354 goto out;
355 }
356 switch (ch_ctrl->dwidth) {
357 case WIDTH_BYTE:
358 *ctrl &= ~(7 << 21);
359 break;
360 case WIDTH_HWORD:
361 *ctrl &= ~(7 << 21);
362 *ctrl |= (1 << 21);
363 break;
364 case WIDTH_WORD:
365 *ctrl &= ~(7 << 21);
366 *ctrl |= (2 << 21);
367 break;
368
369 default:
370 err = -EINVAL;
371 goto out;
372 }
373 switch (ch_ctrl->swidth) {
374 case WIDTH_BYTE:
375 *ctrl &= ~(7 << 18);
376 break;
377 case WIDTH_HWORD:
378 *ctrl &= ~(7 << 18);
379 *ctrl |= (1 << 18);
380 break;
381 case WIDTH_WORD:
382 *ctrl &= ~(7 << 18);
383 *ctrl |= (2 << 18);
384 break;
385
386 default:
387 err = -EINVAL;
388 goto out;
389 }
390 dbsize = ch_ctrl->dbsize;
391 while (!(dbsize & 1)) {
392 i++;
393 dbsize >>= 1;
394 }
395 if (ch_ctrl->dbsize != 1 || i > 8 || i == 1) {
396 err = -EINVAL;
397 goto out;
398 } else if (i > 1)
399 i--;
400 *ctrl &= ~(7 << 15);
401 *ctrl |= (i << 15);
402
403 sbsize = ch_ctrl->sbsize;
404 while (!(sbsize & 1)) {
405 i++;
406 sbsize >>= 1;
407 }
408 if (ch_ctrl->sbsize != 1 || i > 8 || i == 1) {
409 err = -EINVAL;
410 goto out;
411 } else if (i > 1)
412 i--;
413 *ctrl &= ~(7 << 12);
414 *ctrl |= (i << 12);
415
416 if (ch_ctrl->tr_size > 0x7ff) {
417 err = -E2BIG;
418 goto out;
419 }
420 *ctrl &= ~0x7ff;
421 *ctrl |= ch_ctrl->tr_size & 0x7ff;
422
423out:
424 return err;
425}
426
427EXPORT_SYMBOL_GPL(pnx4008_dma_pack_control);
428
429int pnx4008_dma_parse_control(unsigned long ctrl,
430 struct pnx4008_dma_ch_ctrl * ch_ctrl)
431{
432 int err = 0;
433
434 if (!ch_ctrl) {
435 err = -EINVAL;
436 goto out;
437 }
438
439 ch_ctrl->tr_size = ctrl & 0x7ff;
440 ctrl >>= 12;
441
442 ch_ctrl->sbsize = 1 << (ctrl & 7);
443 if (ch_ctrl->sbsize > 1)
444 ch_ctrl->sbsize <<= 1;
445 ctrl >>= 3;
446
447 ch_ctrl->dbsize = 1 << (ctrl & 7);
448 if (ch_ctrl->dbsize > 1)
449 ch_ctrl->dbsize <<= 1;
450 ctrl >>= 3;
451
452 switch (ctrl & 7) {
453 case 0:
454 ch_ctrl->swidth = WIDTH_BYTE;
455 break;
456 case 1:
457 ch_ctrl->swidth = WIDTH_HWORD;
458 break;
459 case 2:
460 ch_ctrl->swidth = WIDTH_WORD;
461 break;
462 default:
463 err = -EINVAL;
464 goto out;
465 }
466 ctrl >>= 3;
467
468 switch (ctrl & 7) {
469 case 0:
470 ch_ctrl->dwidth = WIDTH_BYTE;
471 break;
472 case 1:
473 ch_ctrl->dwidth = WIDTH_HWORD;
474 break;
475 case 2:
476 ch_ctrl->dwidth = WIDTH_WORD;
477 break;
478 default:
479 err = -EINVAL;
480 goto out;
481 }
482 ctrl >>= 3;
483
484 ch_ctrl->src_ahb1 = ctrl & 1;
485 ctrl >>= 1;
486
487 ch_ctrl->dest_ahb1 = ctrl & 1;
488 ctrl >>= 1;
489
490 ch_ctrl->si = ctrl & 1;
491 ctrl >>= 1;
492
493 ch_ctrl->di = ctrl & 1;
494 ctrl >>= 1;
495
496 ch_ctrl->priv_mode = ctrl & 1;
497 ctrl >>= 1;
498
499 ch_ctrl->bufferable = ctrl & 1;
500 ctrl >>= 1;
501
502 ch_ctrl->cacheable = ctrl & 1;
503 ctrl >>= 1;
504
505 ch_ctrl->tc_mask = ctrl & 1;
506
507out:
508 return err;
509}
510
511EXPORT_SYMBOL_GPL(pnx4008_dma_parse_control);
512
513int pnx4008_dma_pack_config(const struct pnx4008_dma_ch_config * ch_cfg,
514 unsigned long *cfg)
515{
516 int err = 0;
517
518 if (!cfg || !ch_cfg) {
519 err = -EINVAL;
520 goto out;
521 }
522
523 *cfg = 0;
524
525 switch (ch_cfg->halt) {
526 case 0:
527 break;
528 case 1:
529 *cfg |= (1 << 18);
530 break;
531
532 default:
533 err = -EINVAL;
534 goto out;
535 }
536 switch (ch_cfg->active) {
537 case 0:
538 break;
539 case 1:
540 *cfg |= (1 << 17);
541 break;
542
543 default:
544 err = -EINVAL;
545 goto out;
546 }
547 switch (ch_cfg->lock) {
548 case 0:
549 break;
550 case 1:
551 *cfg |= (1 << 16);
552 break;
553
554 default:
555 err = -EINVAL;
556 goto out;
557 }
558 switch (ch_cfg->itc) {
559 case 0:
560 break;
561 case 1:
562 *cfg |= (1 << 15);
563 break;
564
565 default:
566 err = -EINVAL;
567 goto out;
568 }
569 switch (ch_cfg->ie) {
570 case 0:
571 break;
572 case 1:
573 *cfg |= (1 << 14);
574 break;
575
576 default:
577 err = -EINVAL;
578 goto out;
579 }
580 switch (ch_cfg->flow_cntrl) {
581 case FC_MEM2MEM_DMA:
582 *cfg &= ~(7 << 11);
583 break;
584 case FC_MEM2PER_DMA:
585 *cfg &= ~(7 << 11);
586 *cfg |= (1 << 11);
587 break;
588 case FC_PER2MEM_DMA:
589 *cfg &= ~(7 << 11);
590 *cfg |= (2 << 11);
591 break;
592 case FC_PER2PER_DMA:
593 *cfg &= ~(7 << 11);
594 *cfg |= (3 << 11);
595 break;
596 case FC_PER2PER_DPER:
597 *cfg &= ~(7 << 11);
598 *cfg |= (4 << 11);
599 break;
600 case FC_MEM2PER_PER:
601 *cfg &= ~(7 << 11);
602 *cfg |= (5 << 11);
603 break;
604 case FC_PER2MEM_PER:
605 *cfg &= ~(7 << 11);
606 *cfg |= (6 << 11);
607 break;
608 case FC_PER2PER_SPER:
609 *cfg |= (7 << 11);
610 break;
611
612 default:
613 err = -EINVAL;
614 goto out;
615 }
616 *cfg &= ~(0x1f << 6);
617 *cfg |= ((ch_cfg->dest_per & 0x1f) << 6);
618
619 *cfg &= ~(0x1f << 1);
620 *cfg |= ((ch_cfg->src_per & 0x1f) << 1);
621
622out:
623 return err;
624}
625
626EXPORT_SYMBOL_GPL(pnx4008_dma_pack_config);
627
628int pnx4008_dma_parse_config(unsigned long cfg,
629 struct pnx4008_dma_ch_config * ch_cfg)
630{
631 int err = 0;
632
633 if (!ch_cfg) {
634 err = -EINVAL;
635 goto out;
636 }
637
638 cfg >>= 1;
639
640 ch_cfg->src_per = cfg & 0x1f;
641 cfg >>= 5;
642
643 ch_cfg->dest_per = cfg & 0x1f;
644 cfg >>= 5;
645
646 switch (cfg & 7) {
647 case 0:
648 ch_cfg->flow_cntrl = FC_MEM2MEM_DMA;
649 break;
650 case 1:
651 ch_cfg->flow_cntrl = FC_MEM2PER_DMA;
652 break;
653 case 2:
654 ch_cfg->flow_cntrl = FC_PER2MEM_DMA;
655 break;
656 case 3:
657 ch_cfg->flow_cntrl = FC_PER2PER_DMA;
658 break;
659 case 4:
660 ch_cfg->flow_cntrl = FC_PER2PER_DPER;
661 break;
662 case 5:
663 ch_cfg->flow_cntrl = FC_MEM2PER_PER;
664 break;
665 case 6:
666 ch_cfg->flow_cntrl = FC_PER2MEM_PER;
667 break;
668 case 7:
669 ch_cfg->flow_cntrl = FC_PER2PER_SPER;
670 }
671 cfg >>= 3;
672
673 ch_cfg->ie = cfg & 1;
674 cfg >>= 1;
675
676 ch_cfg->itc = cfg & 1;
677 cfg >>= 1;
678
679 ch_cfg->lock = cfg & 1;
680 cfg >>= 1;
681
682 ch_cfg->active = cfg & 1;
683 cfg >>= 1;
684
685 ch_cfg->halt = cfg & 1;
686
687out:
688 return err;
689}
690
691EXPORT_SYMBOL_GPL(pnx4008_dma_parse_config);
692
693void pnx4008_dma_split_head_entry(struct pnx4008_dma_config * config,
694 struct pnx4008_dma_ch_ctrl * ctrl)
695{
696 int new_len = ctrl->tr_size, num_entries = 0;
697 int old_len = new_len;
698 int src_width, dest_width, count = 1;
699
700 switch (ctrl->swidth) {
701 case WIDTH_BYTE:
702 src_width = 1;
703 break;
704 case WIDTH_HWORD:
705 src_width = 2;
706 break;
707 case WIDTH_WORD:
708 src_width = 4;
709 break;
710 default:
711 return;
712 }
713
714 switch (ctrl->dwidth) {
715 case WIDTH_BYTE:
716 dest_width = 1;
717 break;
718 case WIDTH_HWORD:
719 dest_width = 2;
720 break;
721 case WIDTH_WORD:
722 dest_width = 4;
723 break;
724 default:
725 return;
726 }
727
728 while (new_len > 0x7FF) {
729 num_entries++;
730 new_len = (ctrl->tr_size + num_entries) / (num_entries + 1);
731 }
732 if (num_entries != 0) {
733 struct pnx4008_dma_ll *ll = NULL;
734 config->ch_ctrl &= ~0x7ff;
735 config->ch_ctrl |= new_len;
736 if (!config->is_ll) {
737 config->is_ll = 1;
738 while (num_entries) {
739 if (!ll) {
740 config->ll =
741 pnx4008_alloc_ll_entry(&config->
742 ll_dma);
743 ll = config->ll;
744 } else {
745 ll->next =
746 pnx4008_alloc_ll_entry(&ll->
747 next_dma);
748 ll = ll->next;
749 }
750
751 if (ctrl->si)
752 ll->src_addr =
753 config->src_addr +
754 src_width * new_len * count;
755 else
756 ll->src_addr = config->src_addr;
757 if (ctrl->di)
758 ll->dest_addr =
759 config->dest_addr +
760 dest_width * new_len * count;
761 else
762 ll->dest_addr = config->dest_addr;
763 ll->ch_ctrl = config->ch_ctrl & 0x7fffffff;
764 ll->next_dma = 0;
765 ll->next = NULL;
766 num_entries--;
767 count++;
768 }
769 } else {
770 struct pnx4008_dma_ll *ll_old = config->ll;
771 unsigned long ll_dma_old = config->ll_dma;
772 while (num_entries) {
773 if (!ll) {
774 config->ll =
775 pnx4008_alloc_ll_entry(&config->
776 ll_dma);
777 ll = config->ll;
778 } else {
779 ll->next =
780 pnx4008_alloc_ll_entry(&ll->
781 next_dma);
782 ll = ll->next;
783 }
784
785 if (ctrl->si)
786 ll->src_addr =
787 config->src_addr +
788 src_width * new_len * count;
789 else
790 ll->src_addr = config->src_addr;
791 if (ctrl->di)
792 ll->dest_addr =
793 config->dest_addr +
794 dest_width * new_len * count;
795 else
796 ll->dest_addr = config->dest_addr;
797 ll->ch_ctrl = config->ch_ctrl & 0x7fffffff;
798 ll->next_dma = 0;
799 ll->next = NULL;
800 num_entries--;
801 count++;
802 }
803 ll->next_dma = ll_dma_old;
804 ll->next = ll_old;
805 }
806 /* adjust last length/tc */
807 ll->ch_ctrl = config->ch_ctrl & (~0x7ff);
808 ll->ch_ctrl |= old_len - new_len * (count - 1);
809 config->ch_ctrl &= 0x7fffffff;
810 }
811}
812
813EXPORT_SYMBOL_GPL(pnx4008_dma_split_head_entry);
814
815void pnx4008_dma_split_ll_entry(struct pnx4008_dma_ll * cur_ll,
816 struct pnx4008_dma_ch_ctrl * ctrl)
817{
818 int new_len = ctrl->tr_size, num_entries = 0;
819 int old_len = new_len;
820 int src_width, dest_width, count = 1;
821
822 switch (ctrl->swidth) {
823 case WIDTH_BYTE:
824 src_width = 1;
825 break;
826 case WIDTH_HWORD:
827 src_width = 2;
828 break;
829 case WIDTH_WORD:
830 src_width = 4;
831 break;
832 default:
833 return;
834 }
835
836 switch (ctrl->dwidth) {
837 case WIDTH_BYTE:
838 dest_width = 1;
839 break;
840 case WIDTH_HWORD:
841 dest_width = 2;
842 break;
843 case WIDTH_WORD:
844 dest_width = 4;
845 break;
846 default:
847 return;
848 }
849
850 while (new_len > 0x7FF) {
851 num_entries++;
852 new_len = (ctrl->tr_size + num_entries) / (num_entries + 1);
853 }
854 if (num_entries != 0) {
855 struct pnx4008_dma_ll *ll = NULL;
856 cur_ll->ch_ctrl &= ~0x7ff;
857 cur_ll->ch_ctrl |= new_len;
858 if (!cur_ll->next) {
859 while (num_entries) {
860 if (!ll) {
861 cur_ll->next =
862 pnx4008_alloc_ll_entry(&cur_ll->
863 next_dma);
864 ll = cur_ll->next;
865 } else {
866 ll->next =
867 pnx4008_alloc_ll_entry(&ll->
868 next_dma);
869 ll = ll->next;
870 }
871
872 if (ctrl->si)
873 ll->src_addr =
874 cur_ll->src_addr +
875 src_width * new_len * count;
876 else
877 ll->src_addr = cur_ll->src_addr;
878 if (ctrl->di)
879 ll->dest_addr =
880 cur_ll->dest_addr +
881 dest_width * new_len * count;
882 else
883 ll->dest_addr = cur_ll->dest_addr;
884 ll->ch_ctrl = cur_ll->ch_ctrl & 0x7fffffff;
885 ll->next_dma = 0;
886 ll->next = NULL;
887 num_entries--;
888 count++;
889 }
890 } else {
891 struct pnx4008_dma_ll *ll_old = cur_ll->next;
892 unsigned long ll_dma_old = cur_ll->next_dma;
893 while (num_entries) {
894 if (!ll) {
895 cur_ll->next =
896 pnx4008_alloc_ll_entry(&cur_ll->
897 next_dma);
898 ll = cur_ll->next;
899 } else {
900 ll->next =
901 pnx4008_alloc_ll_entry(&ll->
902 next_dma);
903 ll = ll->next;
904 }
905
906 if (ctrl->si)
907 ll->src_addr =
908 cur_ll->src_addr +
909 src_width * new_len * count;
910 else
911 ll->src_addr = cur_ll->src_addr;
912 if (ctrl->di)
913 ll->dest_addr =
914 cur_ll->dest_addr +
915 dest_width * new_len * count;
916 else
917 ll->dest_addr = cur_ll->dest_addr;
918 ll->ch_ctrl = cur_ll->ch_ctrl & 0x7fffffff;
919 ll->next_dma = 0;
920 ll->next = NULL;
921 num_entries--;
922 count++;
923 }
924
925 ll->next_dma = ll_dma_old;
926 ll->next = ll_old;
927 }
928 /* adjust last length/tc */
929 ll->ch_ctrl = cur_ll->ch_ctrl & (~0x7ff);
930 ll->ch_ctrl |= old_len - new_len * (count - 1);
931 cur_ll->ch_ctrl &= 0x7fffffff;
932 }
933}
934
935EXPORT_SYMBOL_GPL(pnx4008_dma_split_ll_entry);
936
937int pnx4008_config_channel(int ch, struct pnx4008_dma_config * config)
938{
939 if (!VALID_CHANNEL(ch) || !dma_channels[ch].name)
940 return -EINVAL;
941
942 pnx4008_dma_lock();
943 __raw_writel(config->src_addr, DMAC_Cx_SRC_ADDR(ch));
944 __raw_writel(config->dest_addr, DMAC_Cx_DEST_ADDR(ch));
945
946 if (config->is_ll)
947 __raw_writel(config->ll_dma, DMAC_Cx_LLI(ch));
948 else
949 __raw_writel(0, DMAC_Cx_LLI(ch));
950
951 __raw_writel(config->ch_ctrl, DMAC_Cx_CONTROL(ch));
952 __raw_writel(config->ch_cfg, DMAC_Cx_CONFIG(ch));
953 pnx4008_dma_unlock();
954
955 return 0;
956
957}
958
959EXPORT_SYMBOL_GPL(pnx4008_config_channel);
960
961int pnx4008_channel_get_config(int ch, struct pnx4008_dma_config * config)
962{
963 if (!VALID_CHANNEL(ch) || !dma_channels[ch].name || !config)
964 return -EINVAL;
965
966 pnx4008_dma_lock();
967 config->ch_cfg = __raw_readl(DMAC_Cx_CONFIG(ch));
968 config->ch_ctrl = __raw_readl(DMAC_Cx_CONTROL(ch));
969
970 config->ll_dma = __raw_readl(DMAC_Cx_LLI(ch));
971 config->is_ll = config->ll_dma ? 1 : 0;
972
973 config->src_addr = __raw_readl(DMAC_Cx_SRC_ADDR(ch));
974 config->dest_addr = __raw_readl(DMAC_Cx_DEST_ADDR(ch));
975 pnx4008_dma_unlock();
976
977 return 0;
978}
979
980EXPORT_SYMBOL_GPL(pnx4008_channel_get_config);
981
982int pnx4008_dma_ch_enable(int ch)
983{
984 unsigned long ch_cfg;
985
986 if (!VALID_CHANNEL(ch) || !dma_channels[ch].name)
987 return -EINVAL;
988
989 pnx4008_dma_lock();
990 ch_cfg = __raw_readl(DMAC_Cx_CONFIG(ch));
991 ch_cfg |= 1;
992 __raw_writel(ch_cfg, DMAC_Cx_CONFIG(ch));
993 pnx4008_dma_unlock();
994
995 return 0;
996}
997
998EXPORT_SYMBOL_GPL(pnx4008_dma_ch_enable);
999
1000int pnx4008_dma_ch_disable(int ch)
1001{
1002 unsigned long ch_cfg;
1003
1004 if (!VALID_CHANNEL(ch) || !dma_channels[ch].name)
1005 return -EINVAL;
1006
1007 pnx4008_dma_lock();
1008 ch_cfg = __raw_readl(DMAC_Cx_CONFIG(ch));
1009 ch_cfg &= ~1;
1010 __raw_writel(ch_cfg, DMAC_Cx_CONFIG(ch));
1011 pnx4008_dma_unlock();
1012
1013 return 0;
1014}
1015
1016EXPORT_SYMBOL_GPL(pnx4008_dma_ch_disable);
1017
1018int pnx4008_dma_ch_enabled(int ch)
1019{
1020 unsigned long ch_cfg;
1021
1022 if (!VALID_CHANNEL(ch) || !dma_channels[ch].name)
1023 return -EINVAL;
1024
1025 pnx4008_dma_lock();
1026 ch_cfg = __raw_readl(DMAC_Cx_CONFIG(ch));
1027 pnx4008_dma_unlock();
1028
1029 return ch_cfg & 1;
1030}
1031
1032EXPORT_SYMBOL_GPL(pnx4008_dma_ch_enabled);
1033
1034static irqreturn_t dma_irq_handler(int irq, void *dev_id)
1035{
1036 int i;
1037 unsigned long dint = __raw_readl(DMAC_INT_STAT);
1038 unsigned long tcint = __raw_readl(DMAC_INT_TC_STAT);
1039 unsigned long eint = __raw_readl(DMAC_INT_ERR_STAT);
1040 unsigned long i_bit;
1041
1042 for (i = MAX_DMA_CHANNELS - 1; i >= 0; i--) {
1043 i_bit = 1 << i;
1044 if (dint & i_bit) {
1045 struct dma_channel *channel = &dma_channels[i];
1046
1047 if (channel->name && channel->irq_handler) {
1048 int cause = 0;
1049
1050 if (eint & i_bit)
1051 cause |= DMA_ERR_INT;
1052 if (tcint & i_bit)
1053 cause |= DMA_TC_INT;
1054 channel->irq_handler(i, cause, channel->data);
1055 } else {
1056 /*
1057 * IRQ for an unregistered DMA channel
1058 */
1059 printk(KERN_WARNING
1060 "spurious IRQ for DMA channel %d\n", i);
1061 }
1062 if (tcint & i_bit)
1063 __raw_writel(i_bit, DMAC_INT_TC_CLEAR);
1064 if (eint & i_bit)
1065 __raw_writel(i_bit, DMAC_INT_ERR_CLEAR);
1066 }
1067 }
1068 return IRQ_HANDLED;
1069}
1070
1071static int __init pnx4008_dma_init(void)
1072{
1073 int ret, i;
1074
1075 ret = request_irq(DMA_INT, dma_irq_handler, 0, "DMA", NULL);
1076 if (ret) {
1077 printk(KERN_CRIT "Wow! Can't register IRQ for DMA\n");
1078 goto out;
1079 }
1080
1081 ll_pool.count = 0x4000 / sizeof(struct pnx4008_dma_ll);
1082 ll_pool.cur = ll_pool.vaddr =
1083 dma_alloc_coherent(NULL, ll_pool.count * sizeof(struct pnx4008_dma_ll),
1084 &ll_pool.dma_addr, GFP_KERNEL);
1085
1086 if (!ll_pool.vaddr) {
1087 ret = -ENOMEM;
1088 free_irq(DMA_INT, NULL);
1089 goto out;
1090 }
1091
1092 for (i = 0; i < ll_pool.count - 1; i++) {
1093 void **addr = ll_pool.vaddr + i * sizeof(struct pnx4008_dma_ll);
1094 *addr = (void *)addr + sizeof(struct pnx4008_dma_ll);
1095 }
1096 *(long *)(ll_pool.vaddr +
1097 (ll_pool.count - 1) * sizeof(struct pnx4008_dma_ll)) =
1098 (long)ll_pool.vaddr;
1099
1100 __raw_writel(1, DMAC_CONFIG);
1101
1102out:
1103 return ret;
1104}
1105arch_initcall(pnx4008_dma_init);
diff --git a/arch/arm/mach-pnx4008/gpio.c b/arch/arm/mach-pnx4008/gpio.c
deleted file mode 100644
index d3e71d3847b..00000000000
--- a/arch/arm/mach-pnx4008/gpio.c
+++ /dev/null
@@ -1,328 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/gpio.c
3 *
4 * PNX4008 GPIO driver
5 *
6 * Author: Dmitry Chigirev <source@mvista.com>
7 *
8 * Based on reference code by Iwo Mergler and Z.Tabaaloute from Philips:
9 * Copyright (c) 2005 Koninklijke Philips Electronics N.V.
10 *
11 * 2005 (c) MontaVista Software, Inc. This file is licensed under
12 * the terms of the GNU General Public License version 2. This program
13 * is licensed "as is" without any warranty of any kind, whether express
14 * or implied.
15 */
16#include <linux/types.h>
17#include <linux/kernel.h>
18#include <linux/module.h>
19#include <linux/io.h>
20#include <mach/hardware.h>
21#include <mach/platform.h>
22#include <mach/gpio-pnx4008.h>
23
24/* register definitions */
25#define PIO_VA_BASE IO_ADDRESS(PNX4008_PIO_BASE)
26
27#define PIO_INP_STATE (0x00U)
28#define PIO_OUTP_SET (0x04U)
29#define PIO_OUTP_CLR (0x08U)
30#define PIO_OUTP_STATE (0x0CU)
31#define PIO_DRV_SET (0x10U)
32#define PIO_DRV_CLR (0x14U)
33#define PIO_DRV_STATE (0x18U)
34#define PIO_SDINP_STATE (0x1CU)
35#define PIO_SDOUTP_SET (0x20U)
36#define PIO_SDOUTP_CLR (0x24U)
37#define PIO_MUX_SET (0x28U)
38#define PIO_MUX_CLR (0x2CU)
39#define PIO_MUX_STATE (0x30U)
40
41static inline void gpio_lock(void)
42{
43 local_irq_disable();
44}
45
46static inline void gpio_unlock(void)
47{
48 local_irq_enable();
49}
50
51/* Inline functions */
52static inline int gpio_read_bit(u32 reg, int gpio)
53{
54 u32 bit, val;
55 int ret = -EFAULT;
56
57 if (gpio < 0)
58 goto out;
59
60 bit = GPIO_BIT(gpio);
61 if (bit) {
62 val = __raw_readl(PIO_VA_BASE + reg);
63 ret = (val & bit) ? 1 : 0;
64 }
65out:
66 return ret;
67}
68
69static inline int gpio_set_bit(u32 reg, int gpio)
70{
71 u32 bit, val;
72 int ret = -EFAULT;
73
74 if (gpio < 0)
75 goto out;
76
77 bit = GPIO_BIT(gpio);
78 if (bit) {
79 val = __raw_readl(PIO_VA_BASE + reg);
80 val |= bit;
81 __raw_writel(val, PIO_VA_BASE + reg);
82 ret = 0;
83 }
84out:
85 return ret;
86}
87
88/* Very simple access control, bitmap for allocated/free */
89static unsigned long access_map[4];
90#define INP_INDEX 0
91#define OUTP_INDEX 1
92#define GPIO_INDEX 2
93#define MUX_INDEX 3
94
95/*GPIO to Input Mapping */
96static short gpio_to_inp_map[32] = {
97 -1, -1, -1, -1, -1, -1, -1, -1,
98 -1, -1, -1, -1, -1, -1, -1, -1,
99 -1, -1, -1, -1, -1, -1, -1, -1,
100 -1, 10, 11, 12, 13, 14, 24, -1
101};
102
103/*GPIO to Mux Mapping */
104static short gpio_to_mux_map[32] = {
105 -1, -1, -1, -1, -1, -1, -1, -1,
106 -1, -1, -1, -1, -1, -1, -1, -1,
107 -1, -1, -1, -1, -1, -1, -1, -1,
108 -1, -1, -1, 0, 1, 4, 5, -1
109};
110
111/*Output to Mux Mapping */
112static short outp_to_mux_map[32] = {
113 -1, -1, -1, 6, -1, -1, -1, -1,
114 -1, -1, -1, -1, -1, -1, -1, -1,
115 -1, -1, -1, -1, -1, 2, -1, -1,
116 -1, -1, -1, -1, -1, -1, -1, -1
117};
118
119int pnx4008_gpio_register_pin(unsigned short pin)
120{
121 unsigned long bit = GPIO_BIT(pin);
122 int ret = -EBUSY; /* Already in use */
123
124 gpio_lock();
125
126 if (GPIO_ISBID(pin)) {
127 if (access_map[GPIO_INDEX] & bit)
128 goto out;
129 access_map[GPIO_INDEX] |= bit;
130
131 } else if (GPIO_ISRAM(pin)) {
132 if (access_map[GPIO_INDEX] & bit)
133 goto out;
134 access_map[GPIO_INDEX] |= bit;
135
136 } else if (GPIO_ISMUX(pin)) {
137 if (access_map[MUX_INDEX] & bit)
138 goto out;
139 access_map[MUX_INDEX] |= bit;
140
141 } else if (GPIO_ISOUT(pin)) {
142 if (access_map[OUTP_INDEX] & bit)
143 goto out;
144 access_map[OUTP_INDEX] |= bit;
145
146 } else if (GPIO_ISIN(pin)) {
147 if (access_map[INP_INDEX] & bit)
148 goto out;
149 access_map[INP_INDEX] |= bit;
150 } else
151 goto out;
152 ret = 0;
153
154out:
155 gpio_unlock();
156 return ret;
157}
158
159EXPORT_SYMBOL(pnx4008_gpio_register_pin);
160
161int pnx4008_gpio_unregister_pin(unsigned short pin)
162{
163 unsigned long bit = GPIO_BIT(pin);
164 int ret = -EFAULT; /* Not registered */
165
166 gpio_lock();
167
168 if (GPIO_ISBID(pin)) {
169 if (~access_map[GPIO_INDEX] & bit)
170 goto out;
171 access_map[GPIO_INDEX] &= ~bit;
172 } else if (GPIO_ISRAM(pin)) {
173 if (~access_map[GPIO_INDEX] & bit)
174 goto out;
175 access_map[GPIO_INDEX] &= ~bit;
176 } else if (GPIO_ISMUX(pin)) {
177 if (~access_map[MUX_INDEX] & bit)
178 goto out;
179 access_map[MUX_INDEX] &= ~bit;
180 } else if (GPIO_ISOUT(pin)) {
181 if (~access_map[OUTP_INDEX] & bit)
182 goto out;
183 access_map[OUTP_INDEX] &= ~bit;
184 } else if (GPIO_ISIN(pin)) {
185 if (~access_map[INP_INDEX] & bit)
186 goto out;
187 access_map[INP_INDEX] &= ~bit;
188 } else
189 goto out;
190 ret = 0;
191
192out:
193 gpio_unlock();
194 return ret;
195}
196
197EXPORT_SYMBOL(pnx4008_gpio_unregister_pin);
198
199unsigned long pnx4008_gpio_read_pin(unsigned short pin)
200{
201 unsigned long ret = -EFAULT;
202 int gpio = GPIO_BIT_MASK(pin);
203 gpio_lock();
204 if (GPIO_ISOUT(pin)) {
205 ret = gpio_read_bit(PIO_OUTP_STATE, gpio);
206 } else if (GPIO_ISRAM(pin)) {
207 if (gpio_read_bit(PIO_DRV_STATE, gpio) == 0) {
208 ret = gpio_read_bit(PIO_SDINP_STATE, gpio);
209 }
210 } else if (GPIO_ISBID(pin)) {
211 ret = gpio_read_bit(PIO_DRV_STATE, gpio);
212 if (ret > 0)
213 ret = gpio_read_bit(PIO_OUTP_STATE, gpio);
214 else if (ret == 0)
215 ret =
216 gpio_read_bit(PIO_INP_STATE, gpio_to_inp_map[gpio]);
217 } else if (GPIO_ISIN(pin)) {
218 ret = gpio_read_bit(PIO_INP_STATE, gpio);
219 }
220 gpio_unlock();
221 return ret;
222}
223
224EXPORT_SYMBOL(pnx4008_gpio_read_pin);
225
226/* Write Value to output */
227int pnx4008_gpio_write_pin(unsigned short pin, int output)
228{
229 int gpio = GPIO_BIT_MASK(pin);
230 int ret = -EFAULT;
231
232 gpio_lock();
233 if (GPIO_ISOUT(pin)) {
234 printk( "writing '%x' to '%x'\n",
235 gpio, output ? PIO_OUTP_SET : PIO_OUTP_CLR );
236 ret = gpio_set_bit(output ? PIO_OUTP_SET : PIO_OUTP_CLR, gpio);
237 } else if (GPIO_ISRAM(pin)) {
238 if (gpio_read_bit(PIO_DRV_STATE, gpio) > 0)
239 ret = gpio_set_bit(output ? PIO_SDOUTP_SET :
240 PIO_SDOUTP_CLR, gpio);
241 } else if (GPIO_ISBID(pin)) {
242 if (gpio_read_bit(PIO_DRV_STATE, gpio) > 0)
243 ret = gpio_set_bit(output ? PIO_OUTP_SET :
244 PIO_OUTP_CLR, gpio);
245 }
246 gpio_unlock();
247 return ret;
248}
249
250EXPORT_SYMBOL(pnx4008_gpio_write_pin);
251
252/* Value = 1 : Set GPIO pin as output */
253/* Value = 0 : Set GPIO pin as input */
254int pnx4008_gpio_set_pin_direction(unsigned short pin, int output)
255{
256 int gpio = GPIO_BIT_MASK(pin);
257 int ret = -EFAULT;
258
259 gpio_lock();
260 if (GPIO_ISBID(pin) || GPIO_ISRAM(pin)) {
261 ret = gpio_set_bit(output ? PIO_DRV_SET : PIO_DRV_CLR, gpio);
262 }
263 gpio_unlock();
264 return ret;
265}
266
267EXPORT_SYMBOL(pnx4008_gpio_set_pin_direction);
268
269/* Read GPIO pin direction: 0= pin used as input, 1= pin used as output*/
270int pnx4008_gpio_read_pin_direction(unsigned short pin)
271{
272 int gpio = GPIO_BIT_MASK(pin);
273 int ret = -EFAULT;
274
275 gpio_lock();
276 if (GPIO_ISBID(pin) || GPIO_ISRAM(pin)) {
277 ret = gpio_read_bit(PIO_DRV_STATE, gpio);
278 }
279 gpio_unlock();
280 return ret;
281}
282
283EXPORT_SYMBOL(pnx4008_gpio_read_pin_direction);
284
285/* Value = 1 : Set pin to muxed function */
286/* Value = 0 : Set pin as GPIO */
287int pnx4008_gpio_set_pin_mux(unsigned short pin, int output)
288{
289 int gpio = GPIO_BIT_MASK(pin);
290 int ret = -EFAULT;
291
292 gpio_lock();
293 if (GPIO_ISBID(pin)) {
294 ret =
295 gpio_set_bit(output ? PIO_MUX_SET : PIO_MUX_CLR,
296 gpio_to_mux_map[gpio]);
297 } else if (GPIO_ISOUT(pin)) {
298 ret =
299 gpio_set_bit(output ? PIO_MUX_SET : PIO_MUX_CLR,
300 outp_to_mux_map[gpio]);
301 } else if (GPIO_ISMUX(pin)) {
302 ret = gpio_set_bit(output ? PIO_MUX_SET : PIO_MUX_CLR, gpio);
303 }
304 gpio_unlock();
305 return ret;
306}
307
308EXPORT_SYMBOL(pnx4008_gpio_set_pin_mux);
309
310/* Read pin mux function: 0= pin used as GPIO, 1= pin used for muxed function*/
311int pnx4008_gpio_read_pin_mux(unsigned short pin)
312{
313 int gpio = GPIO_BIT_MASK(pin);
314 int ret = -EFAULT;
315
316 gpio_lock();
317 if (GPIO_ISBID(pin)) {
318 ret = gpio_read_bit(PIO_MUX_STATE, gpio_to_mux_map[gpio]);
319 } else if (GPIO_ISOUT(pin)) {
320 ret = gpio_read_bit(PIO_MUX_STATE, outp_to_mux_map[gpio]);
321 } else if (GPIO_ISMUX(pin)) {
322 ret = gpio_read_bit(PIO_MUX_STATE, gpio);
323 }
324 gpio_unlock();
325 return ret;
326}
327
328EXPORT_SYMBOL(pnx4008_gpio_read_pin_mux);
diff --git a/arch/arm/mach-pnx4008/i2c.c b/arch/arm/mach-pnx4008/i2c.c
deleted file mode 100644
index 550cfc2a1f2..00000000000
--- a/arch/arm/mach-pnx4008/i2c.c
+++ /dev/null
@@ -1,86 +0,0 @@
1/*
2 * I2C initialization for PNX4008.
3 *
4 * Author: Vitaly Wool <vitalywool@gmail.com>
5 *
6 * 2005-2006 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/clk.h>
13#include <linux/i2c.h>
14#include <linux/i2c-pnx.h>
15#include <linux/platform_device.h>
16#include <linux/err.h>
17#include <mach/platform.h>
18#include <mach/irqs.h>
19
20static struct resource i2c0_resources[] = {
21 {
22 .start = PNX4008_I2C1_BASE,
23 .end = PNX4008_I2C1_BASE + SZ_4K - 1,
24 .flags = IORESOURCE_MEM,
25 }, {
26 .start = I2C_1_INT,
27 .end = I2C_1_INT,
28 .flags = IORESOURCE_IRQ,
29 },
30};
31
32static struct resource i2c1_resources[] = {
33 {
34 .start = PNX4008_I2C2_BASE,
35 .end = PNX4008_I2C2_BASE + SZ_4K - 1,
36 .flags = IORESOURCE_MEM,
37 }, {
38 .start = I2C_2_INT,
39 .end = I2C_2_INT,
40 .flags = IORESOURCE_IRQ,
41 },
42};
43
44static struct resource i2c2_resources[] = {
45 {
46 .start = PNX4008_USB_CONFIG_BASE + 0x300,
47 .end = PNX4008_USB_CONFIG_BASE + 0x300 + SZ_4K - 1,
48 .flags = IORESOURCE_MEM,
49 }, {
50 .start = USB_I2C_INT,
51 .end = USB_I2C_INT,
52 .flags = IORESOURCE_IRQ,
53 },
54};
55
56static struct platform_device i2c0_device = {
57 .name = "pnx-i2c.0",
58 .id = 0,
59 .resource = i2c0_resources,
60 .num_resources = ARRAY_SIZE(i2c0_resources),
61};
62
63static struct platform_device i2c1_device = {
64 .name = "pnx-i2c.1",
65 .id = 1,
66 .resource = i2c1_resources,
67 .num_resources = ARRAY_SIZE(i2c1_resources),
68};
69
70static struct platform_device i2c2_device = {
71 .name = "pnx-i2c.2",
72 .id = 2,
73 .resource = i2c2_resources,
74 .num_resources = ARRAY_SIZE(i2c2_resources),
75};
76
77static struct platform_device *devices[] __initdata = {
78 &i2c0_device,
79 &i2c1_device,
80 &i2c2_device,
81};
82
83void __init pnx4008_register_i2c_devices(void)
84{
85 platform_add_devices(devices, ARRAY_SIZE(devices));
86}
diff --git a/arch/arm/mach-pnx4008/include/mach/clock.h b/arch/arm/mach-pnx4008/include/mach/clock.h
deleted file mode 100644
index 8d2a5ef52c9..00000000000
--- a/arch/arm/mach-pnx4008/include/mach/clock.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/clock.h
3 *
4 * Clock control driver for PNX4008 - header file
5 *
6 * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#ifndef __PNX4008_CLOCK_H__
14#define __PNX4008_CLOCK_H__
15
16struct module;
17struct clk;
18
19#define PWRMAN_VA_BASE IO_ADDRESS(PNX4008_PWRMAN_BASE)
20#define HCLKDIVCTRL_REG (PWRMAN_VA_BASE + 0x40)
21#define PWRCTRL_REG (PWRMAN_VA_BASE + 0x44)
22#define PLLCTRL_REG (PWRMAN_VA_BASE + 0x48)
23#define OSC13CTRL_REG (PWRMAN_VA_BASE + 0x4c)
24#define SYSCLKCTRL_REG (PWRMAN_VA_BASE + 0x50)
25#define HCLKPLLCTRL_REG (PWRMAN_VA_BASE + 0x58)
26#define USBCTRL_REG (PWRMAN_VA_BASE + 0x64)
27#define SDRAMCLKCTRL_REG (PWRMAN_VA_BASE + 0x68)
28#define MSCTRL_REG (PWRMAN_VA_BASE + 0x80)
29#define BTCLKCTRL (PWRMAN_VA_BASE + 0x84)
30#define DUMCLKCTRL_REG (PWRMAN_VA_BASE + 0x90)
31#define I2CCLKCTRL_REG (PWRMAN_VA_BASE + 0xac)
32#define KEYCLKCTRL_REG (PWRMAN_VA_BASE + 0xb0)
33#define TSCLKCTRL_REG (PWRMAN_VA_BASE + 0xb4)
34#define PWMCLKCTRL_REG (PWRMAN_VA_BASE + 0xb8)
35#define TIMCLKCTRL_REG (PWRMAN_VA_BASE + 0xbc)
36#define SPICTRL_REG (PWRMAN_VA_BASE + 0xc4)
37#define FLASHCLKCTRL_REG (PWRMAN_VA_BASE + 0xc8)
38#define UART3CLK_REG (PWRMAN_VA_BASE + 0xd0)
39#define UARTCLKCTRL_REG (PWRMAN_VA_BASE + 0xe4)
40#define DMACLKCTRL_REG (PWRMAN_VA_BASE + 0xe8)
41#define AUTOCLK_CTRL (PWRMAN_VA_BASE + 0xec)
42#define JPEGCLKCTRL_REG (PWRMAN_VA_BASE + 0xfc)
43
44#define AUDIOCONFIG_VA_BASE IO_ADDRESS(PNX4008_AUDIOCONFIG_BASE)
45#define DSPPLLCTRL_REG (AUDIOCONFIG_VA_BASE + 0x60)
46#define DSPCLKCTRL_REG (AUDIOCONFIG_VA_BASE + 0x64)
47#define AUDIOCLKCTRL_REG (AUDIOCONFIG_VA_BASE + 0x68)
48#define AUDIOPLLCTRL_REG (AUDIOCONFIG_VA_BASE + 0x6C)
49
50#define USB_OTG_CLKCTRL_REG IO_ADDRESS(PNX4008_USB_CONFIG_BASE + 0xff4)
51
52#define VFP9CLKCTRL_REG IO_ADDRESS(PNX4008_DEBUG_BASE)
53
54#define CLK_RATE_13MHZ 13000
55#define CLK_RATE_1MHZ 1000
56#define CLK_RATE_208MHZ 208000
57#define CLK_RATE_48MHZ 48000
58#define CLK_RATE_32KHZ 32
59
60#define PNX4008_UART_CLK CLK_RATE_13MHZ * 1000 /* in MHz */
61
62#endif
diff --git a/arch/arm/mach-pnx4008/include/mach/debug-macro.S b/arch/arm/mach-pnx4008/include/mach/debug-macro.S
deleted file mode 100644
index 469d60d97f5..00000000000
--- a/arch/arm/mach-pnx4008/include/mach/debug-macro.S
+++ /dev/null
@@ -1,21 +0,0 @@
1/* arch/arm/mach-pnx4008/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14 .macro addruart, rp, rv, tmp
15 mov \rp, #0x00090000
16 add \rv, \rp, #0xf4000000 @ virtual
17 add \rp, \rp, #0x40000000 @ physical
18 .endm
19
20#define UART_SHIFT 2
21#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-pnx4008/include/mach/dma.h b/arch/arm/mach-pnx4008/include/mach/dma.h
deleted file mode 100644
index f094bf8bfb1..00000000000
--- a/arch/arm/mach-pnx4008/include/mach/dma.h
+++ /dev/null
@@ -1,160 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/dma.h
3 *
4 * PNX4008 DMA header file
5 *
6 * Author: Vitaly Wool
7 * Copyright: MontaVista Software Inc. (c) 2005
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_DMA_H
15#define __ASM_ARCH_DMA_H
16
17#include "platform.h"
18
19#define MAX_DMA_CHANNELS 8
20
21#define DMAC_BASE IO_ADDRESS(PNX4008_DMA_CONFIG_BASE)
22#define DMAC_INT_STAT (DMAC_BASE + 0x0000)
23#define DMAC_INT_TC_STAT (DMAC_BASE + 0x0004)
24#define DMAC_INT_TC_CLEAR (DMAC_BASE + 0x0008)
25#define DMAC_INT_ERR_STAT (DMAC_BASE + 0x000c)
26#define DMAC_INT_ERR_CLEAR (DMAC_BASE + 0x0010)
27#define DMAC_SOFT_SREQ (DMAC_BASE + 0x0024)
28#define DMAC_CONFIG (DMAC_BASE + 0x0030)
29#define DMAC_Cx_SRC_ADDR(c) (DMAC_BASE + 0x0100 + (c) * 0x20)
30#define DMAC_Cx_DEST_ADDR(c) (DMAC_BASE + 0x0104 + (c) * 0x20)
31#define DMAC_Cx_LLI(c) (DMAC_BASE + 0x0108 + (c) * 0x20)
32#define DMAC_Cx_CONTROL(c) (DMAC_BASE + 0x010c + (c) * 0x20)
33#define DMAC_Cx_CONFIG(c) (DMAC_BASE + 0x0110 + (c) * 0x20)
34
35enum {
36 WIDTH_BYTE = 0,
37 WIDTH_HWORD,
38 WIDTH_WORD
39};
40
41enum {
42 FC_MEM2MEM_DMA,
43 FC_MEM2PER_DMA,
44 FC_PER2MEM_DMA,
45 FC_PER2PER_DMA,
46 FC_PER2PER_DPER,
47 FC_MEM2PER_PER,
48 FC_PER2MEM_PER,
49 FC_PER2PER_SPER
50};
51
52enum {
53 DMA_INT_UNKNOWN = 0,
54 DMA_ERR_INT = 1,
55 DMA_TC_INT = 2,
56};
57
58enum {
59 DMA_BUFFER_ALLOCATED = 1,
60 DMA_HAS_LL = 2,
61};
62
63enum {
64 PER_CAM_DMA_1 = 0,
65 PER_NDF_FLASH = 1,
66 PER_MBX_SLAVE_FIFO = 2,
67 PER_SPI2_REC_XMIT = 3,
68 PER_MS_SD_RX_XMIT = 4,
69 PER_HS_UART_1_XMIT = 5,
70 PER_HS_UART_1_RX = 6,
71 PER_HS_UART_2_XMIT = 7,
72 PER_HS_UART_2_RX = 8,
73 PER_HS_UART_7_XMIT = 9,
74 PER_HS_UART_7_RX = 10,
75 PER_SPI1_REC_XMIT = 11,
76 PER_MLC_NDF_SREC = 12,
77 PER_CAM_DMA_2 = 13,
78 PER_PRNG_INFIFO = 14,
79 PER_PRNG_OUTFIFO = 15,
80};
81
82struct pnx4008_dma_ch_ctrl {
83 int tc_mask;
84 int cacheable;
85 int bufferable;
86 int priv_mode;
87 int di;
88 int si;
89 int dest_ahb1;
90 int src_ahb1;
91 int dwidth;
92 int swidth;
93 int dbsize;
94 int sbsize;
95 int tr_size;
96};
97
98struct pnx4008_dma_ch_config {
99 int halt;
100 int active;
101 int lock;
102 int itc;
103 int ie;
104 int flow_cntrl;
105 int dest_per;
106 int src_per;
107};
108
109struct pnx4008_dma_ll {
110 unsigned long src_addr;
111 unsigned long dest_addr;
112 u32 next_dma;
113 unsigned long ch_ctrl;
114 struct pnx4008_dma_ll *next;
115 int flags;
116 void *alloc_data;
117 int (*free) (void *);
118};
119
120struct pnx4008_dma_config {
121 int is_ll;
122 unsigned long src_addr;
123 unsigned long dest_addr;
124 unsigned long ch_ctrl;
125 unsigned long ch_cfg;
126 struct pnx4008_dma_ll *ll;
127 u32 ll_dma;
128 int flags;
129 void *alloc_data;
130 int (*free) (void *);
131};
132
133extern struct pnx4008_dma_ll *pnx4008_alloc_ll_entry(dma_addr_t *);
134extern void pnx4008_free_ll_entry(struct pnx4008_dma_ll *, dma_addr_t);
135extern void pnx4008_free_ll(u32 ll_dma, struct pnx4008_dma_ll *);
136
137extern int pnx4008_request_channel(char *, int,
138 void (*)(int, int, void *),
139 void *);
140extern void pnx4008_free_channel(int);
141extern int pnx4008_config_dma(int, int, int);
142extern int pnx4008_dma_pack_control(const struct pnx4008_dma_ch_ctrl *,
143 unsigned long *);
144extern int pnx4008_dma_parse_control(unsigned long,
145 struct pnx4008_dma_ch_ctrl *);
146extern int pnx4008_dma_pack_config(const struct pnx4008_dma_ch_config *,
147 unsigned long *);
148extern int pnx4008_dma_parse_config(unsigned long,
149 struct pnx4008_dma_ch_config *);
150extern int pnx4008_config_channel(int, struct pnx4008_dma_config *);
151extern int pnx4008_channel_get_config(int, struct pnx4008_dma_config *);
152extern int pnx4008_dma_ch_enable(int);
153extern int pnx4008_dma_ch_disable(int);
154extern int pnx4008_dma_ch_enabled(int);
155extern void pnx4008_dma_split_head_entry(struct pnx4008_dma_config *,
156 struct pnx4008_dma_ch_ctrl *);
157extern void pnx4008_dma_split_ll_entry(struct pnx4008_dma_ll *,
158 struct pnx4008_dma_ch_ctrl *);
159
160#endif /* _ASM_ARCH_DMA_H */
diff --git a/arch/arm/mach-pnx4008/include/mach/entry-macro.S b/arch/arm/mach-pnx4008/include/mach/entry-macro.S
deleted file mode 100644
index 77a55584671..00000000000
--- a/arch/arm/mach-pnx4008/include/mach/entry-macro.S
+++ /dev/null
@@ -1,116 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for PNX4008-based platforms
5 *
6 * 2005-2006 (c) MontaVista Software, Inc.
7 * Author: Vitaly Wool <vwool@ru.mvista.com>
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include "platform.h"
14
15#define IO_BASE 0xF0000000
16#define IO_ADDRESS(x) (((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) | IO_BASE)
17
18#define INTRC_MASK 0x00
19#define INTRC_RAW_STAT 0x04
20#define INTRC_STAT 0x08
21#define INTRC_POLAR 0x0C
22#define INTRC_ACT_TYPE 0x10
23#define INTRC_TYPE 0x14
24
25#define SIC1_BASE_INT 32
26#define SIC2_BASE_INT 64
27
28 .macro get_irqnr_preamble, base, tmp
29 .endm
30
31 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
32/* decode the MIC interrupt numbers */
33 ldr \base, =IO_ADDRESS(PNX4008_INTCTRLMIC_BASE)
34 ldr \irqstat, [\base, #INTRC_STAT]
35
36 cmp \irqstat,#1<<16
37 movhs \irqnr,#16
38 movlo \irqnr,#0
39 movhs \irqstat,\irqstat,lsr#16
40 cmp \irqstat,#1<<8
41 addhs \irqnr,\irqnr,#8
42 movhs \irqstat,\irqstat,lsr#8
43 cmp \irqstat,#1<<4
44 addhs \irqnr,\irqnr,#4
45 movhs \irqstat,\irqstat,lsr#4
46 cmp \irqstat,#1<<2
47 addhs \irqnr,\irqnr,#2
48 movhs \irqstat,\irqstat,lsr#2
49 cmp \irqstat,#1<<1
50 addhs \irqnr,\irqnr,#1
51
52/* was there an interrupt ? if not then drop out with EQ status */
53 teq \irqstat,#0
54 beq 1003f
55
56/* and now check for extended IRQ reasons */
57 cmp \irqnr,#1
58 bls 1003f
59 cmp \irqnr,#30
60 blo 1002f
61
62/* IRQ 31,30 : High priority cascade IRQ handle */
63/* read the correct SIC */
64/* decoding status after compare : eq is 30 (SIC1) , ne is 31 (SIC2) */
65/* set the base IRQ number */
66 ldreq \base, =IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE)
67 moveq \irqnr,#SIC1_BASE_INT
68 ldrne \base, =IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE)
69 movne \irqnr,#SIC2_BASE_INT
70 ldr \irqstat, [\base, #INTRC_STAT]
71 ldr \tmp, [\base, #INTRC_TYPE]
72/* and with inverted mask : low priority interrupts */
73 and \irqstat,\irqstat,\tmp
74 b 1004f
75
761003:
77/* IRQ 1,0 : Low priority cascade IRQ handle */
78/* read the correct SIC */
79/* decoding status after compare : eq is 1 (SIC2) , ne is 0 (SIC1)*/
80/* read the correct SIC */
81/* set the base IRQ number */
82 ldrne \base, =IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE)
83 movne \irqnr,#SIC1_BASE_INT
84 ldreq \base, =IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE)
85 moveq \irqnr,#SIC2_BASE_INT
86 ldr \irqstat, [\base, #INTRC_STAT]
87 ldr \tmp, [\base, #INTRC_TYPE]
88/* and with inverted mask : low priority interrupts */
89 bic \irqstat,\irqstat,\tmp
90
911004:
92
93 cmp \irqstat,#1<<16
94 addhs \irqnr,\irqnr,#16
95 movhs \irqstat,\irqstat,lsr#16
96 cmp \irqstat,#1<<8
97 addhs \irqnr,\irqnr,#8
98 movhs \irqstat,\irqstat,lsr#8
99 cmp \irqstat,#1<<4
100 addhs \irqnr,\irqnr,#4
101 movhs \irqstat,\irqstat,lsr#4
102 cmp \irqstat,#1<<2
103 addhs \irqnr,\irqnr,#2
104 movhs \irqstat,\irqstat,lsr#2
105 cmp \irqstat,#1<<1
106 addhs \irqnr,\irqnr,#1
107
108
109/* is irqstat not zero */
110
1111002:
112/* we assert that irqstat is not equal to zero and return ne status if true*/
113 teq \irqstat,#0
1141003:
115 .endm
116
diff --git a/arch/arm/mach-pnx4008/include/mach/gpio-pnx4008.h b/arch/arm/mach-pnx4008/include/mach/gpio-pnx4008.h
deleted file mode 100644
index 41027dd7cf7..00000000000
--- a/arch/arm/mach-pnx4008/include/mach/gpio-pnx4008.h
+++ /dev/null
@@ -1,241 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/gpio-pnx4008.h
3 *
4 * PNX4008 GPIO driver - header file
5 *
6 * Author: Dmitry Chigirev <source@mvista.com>
7 *
8 * Based on reference code by Iwo Mergler and Z.Tabaaloute from Philips:
9 * Copyright (c) 2005 Koninklijke Philips Electronics N.V.
10 *
11 * 2005 (c) MontaVista Software, Inc. This file is licensed under
12 * the terms of the GNU General Public License version 2. This program
13 * is licensed "as is" without any warranty of any kind, whether express
14 * or implied.
15 */
16
17#ifndef _PNX4008_GPIO_H_
18#define _PNX4008_GPIO_H_
19
20
21/* Block numbers */
22#define GPIO_IN (0)
23#define GPIO_OUT (0x100)
24#define GPIO_BID (0x200)
25#define GPIO_RAM (0x300)
26#define GPIO_MUX (0x400)
27
28#define GPIO_TYPE_MASK(K) ((K) & 0x700)
29
30/* INPUT GPIOs */
31/* GPI */
32#define GPI_00 (GPIO_IN | 0)
33#define GPI_01 (GPIO_IN | 1)
34#define GPI_02 (GPIO_IN | 2)
35#define GPI_03 (GPIO_IN | 3)
36#define GPI_04 (GPIO_IN | 4)
37#define GPI_05 (GPIO_IN | 5)
38#define GPI_06 (GPIO_IN | 6)
39#define GPI_07 (GPIO_IN | 7)
40#define GPI_08 (GPIO_IN | 8)
41#define GPI_09 (GPIO_IN | 9)
42#define U1_RX (GPIO_IN | 15)
43#define U2_HTCS (GPIO_IN | 16)
44#define U2_RX (GPIO_IN | 17)
45#define U3_RX (GPIO_IN | 18)
46#define U4_RX (GPIO_IN | 19)
47#define U5_RX (GPIO_IN | 20)
48#define U6_IRRX (GPIO_IN | 21)
49#define U7_HCTS (GPIO_IN | 22)
50#define U7_RX (GPIO_IN | 23)
51/* MISC IN */
52#define SPI1_DATIN (GPIO_IN | 25)
53#define DISP_SYNC (GPIO_IN | 26)
54#define SPI2_DATIN (GPIO_IN | 27)
55#define GPI_11 (GPIO_IN | 28)
56
57#define GPIO_IN_MASK 0x1eff83ff
58
59/* OUTPUT GPIOs */
60/* GPO */
61#define GPO_00 (GPIO_OUT | 0)
62#define GPO_01 (GPIO_OUT | 1)
63#define GPO_02 (GPIO_OUT | 2)
64#define GPO_03 (GPIO_OUT | 3)
65#define GPO_04 (GPIO_OUT | 4)
66#define GPO_05 (GPIO_OUT | 5)
67#define GPO_06 (GPIO_OUT | 6)
68#define GPO_07 (GPIO_OUT | 7)
69#define GPO_08 (GPIO_OUT | 8)
70#define GPO_09 (GPIO_OUT | 9)
71#define GPO_10 (GPIO_OUT | 10)
72#define GPO_11 (GPIO_OUT | 11)
73#define GPO_12 (GPIO_OUT | 12)
74#define GPO_13 (GPIO_OUT | 13)
75#define GPO_14 (GPIO_OUT | 14)
76#define GPO_15 (GPIO_OUT | 15)
77#define GPO_16 (GPIO_OUT | 16)
78#define GPO_17 (GPIO_OUT | 17)
79#define GPO_18 (GPIO_OUT | 18)
80#define GPO_19 (GPIO_OUT | 19)
81#define GPO_20 (GPIO_OUT | 20)
82#define GPO_21 (GPIO_OUT | 21)
83#define GPO_22 (GPIO_OUT | 22)
84#define GPO_23 (GPIO_OUT | 23)
85
86#define GPIO_OUT_MASK 0xffffff
87
88/* BIDIRECTIONAL GPIOs */
89/* RAM pins */
90#define RAM_D19 (GPIO_RAM | 0)
91#define RAM_D20 (GPIO_RAM | 1)
92#define RAM_D21 (GPIO_RAM | 2)
93#define RAM_D22 (GPIO_RAM | 3)
94#define RAM_D23 (GPIO_RAM | 4)
95#define RAM_D24 (GPIO_RAM | 5)
96#define RAM_D25 (GPIO_RAM | 6)
97#define RAM_D26 (GPIO_RAM | 7)
98#define RAM_D27 (GPIO_RAM | 8)
99#define RAM_D28 (GPIO_RAM | 9)
100#define RAM_D29 (GPIO_RAM | 10)
101#define RAM_D30 (GPIO_RAM | 11)
102#define RAM_D31 (GPIO_RAM | 12)
103
104#define GPIO_RAM_MASK 0x1fff
105
106/* I/O pins */
107#define GPIO_00 (GPIO_BID | 25)
108#define GPIO_01 (GPIO_BID | 26)
109#define GPIO_02 (GPIO_BID | 27)
110#define GPIO_03 (GPIO_BID | 28)
111#define GPIO_04 (GPIO_BID | 29)
112#define GPIO_05 (GPIO_BID | 30)
113
114#define GPIO_BID_MASK 0x7e000000
115
116/* Non-GPIO multiplexed PIOs. For multiplexing with GPIO, please use GPIO macros */
117#define GPIO_SDRAM_SEL (GPIO_MUX | 3)
118
119#define GPIO_MUX_MASK 0x8
120
121/* Extraction/assembly macros */
122#define GPIO_BIT_MASK(K) ((K) & 0x1F)
123#define GPIO_BIT(K) (1 << GPIO_BIT_MASK(K))
124#define GPIO_ISMUX(K) ((GPIO_TYPE_MASK(K) == GPIO_MUX) && (GPIO_BIT(K) & GPIO_MUX_MASK))
125#define GPIO_ISRAM(K) ((GPIO_TYPE_MASK(K) == GPIO_RAM) && (GPIO_BIT(K) & GPIO_RAM_MASK))
126#define GPIO_ISBID(K) ((GPIO_TYPE_MASK(K) == GPIO_BID) && (GPIO_BIT(K) & GPIO_BID_MASK))
127#define GPIO_ISOUT(K) ((GPIO_TYPE_MASK(K) == GPIO_OUT) && (GPIO_BIT(K) & GPIO_OUT_MASK))
128#define GPIO_ISIN(K) ((GPIO_TYPE_MASK(K) == GPIO_IN) && (GPIO_BIT(K) & GPIO_IN_MASK))
129
130/* Start Enable Pin Interrupts - table 58 page 66 */
131
132#define SE_PIN_BASE_INT 32
133
134#define SE_U7_RX_INT 63
135#define SE_U7_HCTS_INT 62
136#define SE_BT_CLKREQ_INT 61
137#define SE_U6_IRRX_INT 60
138/*59 unused*/
139#define SE_U5_RX_INT 58
140#define SE_GPI_11_INT 57
141#define SE_U3_RX_INT 56
142#define SE_U2_HCTS_INT 55
143#define SE_U2_RX_INT 54
144#define SE_U1_RX_INT 53
145#define SE_DISP_SYNC_INT 52
146/*51 unused*/
147#define SE_SDIO_INT_N 50
148#define SE_MSDIO_START_INT 49
149#define SE_GPI_06_INT 48
150#define SE_GPI_05_INT 47
151#define SE_GPI_04_INT 46
152#define SE_GPI_03_INT 45
153#define SE_GPI_02_INT 44
154#define SE_GPI_01_INT 43
155#define SE_GPI_00_INT 42
156#define SE_SYSCLKEN_PIN_INT 41
157#define SE_SPI1_DATAIN_INT 40
158#define SE_GPI_07_INT 39
159#define SE_SPI2_DATAIN_INT 38
160#define SE_GPI_10_INT 37
161#define SE_GPI_09_INT 36
162#define SE_GPI_08_INT 35
163/*34-32 unused*/
164
165/* Start Enable Internal Interrupts - table 57 page 65 */
166
167#define SE_INT_BASE_INT 0
168
169#define SE_TS_IRQ 31
170#define SE_TS_P_INT 30
171#define SE_TS_AUX_INT 29
172/*27-28 unused*/
173#define SE_USB_AHB_NEED_CLK_INT 26
174#define SE_MSTIMER_INT 25
175#define SE_RTC_INT 24
176#define SE_USB_NEED_CLK_INT 23
177#define SE_USB_INT 22
178#define SE_USB_I2C_INT 21
179#define SE_USB_OTG_TIMER_INT 20
180#define SE_USB_OTG_ATX_INT_N 19
181/*18 unused*/
182#define SE_DSP_GPIO4_INT 17
183#define SE_KEY_IRQ 16
184#define SE_DSP_SLAVEPORT_INT 15
185#define SE_DSP_GPIO1_INT 14
186#define SE_DSP_GPIO0_INT 13
187#define SE_DSP_AHB_INT 12
188/*11-6 unused*/
189#define SE_GPIO_05_INT 5
190#define SE_GPIO_04_INT 4
191#define SE_GPIO_03_INT 3
192#define SE_GPIO_02_INT 2
193#define SE_GPIO_01_INT 1
194#define SE_GPIO_00_INT 0
195
196#define START_INT_REG_BIT(irq) (1<<((irq)&0x1F))
197
198#define START_INT_ER_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x20 + (((irq)&(0x1<<5))>>1)))
199#define START_INT_RSR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x24 + (((irq)&(0x1<<5))>>1)))
200#define START_INT_SR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x28 + (((irq)&(0x1<<5))>>1)))
201#define START_INT_APR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x2C + (((irq)&(0x1<<5))>>1)))
202
203extern int pnx4008_gpio_register_pin(unsigned short pin);
204extern int pnx4008_gpio_unregister_pin(unsigned short pin);
205extern unsigned long pnx4008_gpio_read_pin(unsigned short pin);
206extern int pnx4008_gpio_write_pin(unsigned short pin, int output);
207extern int pnx4008_gpio_set_pin_direction(unsigned short pin, int output);
208extern int pnx4008_gpio_read_pin_direction(unsigned short pin);
209extern int pnx4008_gpio_set_pin_mux(unsigned short pin, int output);
210extern int pnx4008_gpio_read_pin_mux(unsigned short pin);
211
212static inline void start_int_umask(u8 irq)
213{
214 __raw_writel(__raw_readl(START_INT_ER_REG(irq)) |
215 START_INT_REG_BIT(irq), START_INT_ER_REG(irq));
216}
217
218static inline void start_int_mask(u8 irq)
219{
220 __raw_writel(__raw_readl(START_INT_ER_REG(irq)) &
221 ~START_INT_REG_BIT(irq), START_INT_ER_REG(irq));
222}
223
224static inline void start_int_ack(u8 irq)
225{
226 __raw_writel(START_INT_REG_BIT(irq), START_INT_RSR_REG(irq));
227}
228
229static inline void start_int_set_falling_edge(u8 irq)
230{
231 __raw_writel(__raw_readl(START_INT_APR_REG(irq)) &
232 ~START_INT_REG_BIT(irq), START_INT_APR_REG(irq));
233}
234
235static inline void start_int_set_rising_edge(u8 irq)
236{
237 __raw_writel(__raw_readl(START_INT_APR_REG(irq)) |
238 START_INT_REG_BIT(irq), START_INT_APR_REG(irq));
239}
240
241#endif /* _PNX4008_GPIO_H_ */
diff --git a/arch/arm/mach-pnx4008/include/mach/hardware.h b/arch/arm/mach-pnx4008/include/mach/hardware.h
deleted file mode 100644
index 7b98b828d36..00000000000
--- a/arch/arm/mach-pnx4008/include/mach/hardware.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/hardware.h
3 *
4 * Copyright (c) 2005 MontaVista Software, Inc. <source@mvista.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARCH_HARDWARE_H
21#define __ASM_ARCH_HARDWARE_H
22
23#include <asm/sizes.h>
24#include <mach/platform.h>
25
26/* Start of virtual addresses for IO devices */
27#define IO_BASE 0xF0000000
28
29/* This macro relies on fact that for all HW i/o addresses bits 20-23 are 0 */
30#define IO_ADDRESS(x) (((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) | IO_BASE)
31
32#endif
diff --git a/arch/arm/mach-pnx4008/include/mach/irq.h b/arch/arm/mach-pnx4008/include/mach/irq.h
deleted file mode 100644
index 2a690ca3387..00000000000
--- a/arch/arm/mach-pnx4008/include/mach/irq.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/irq.h
3 *
4 * PNX4008 IRQ controller driver - header file
5 * this one is used in entry-arnv.S as well so it cannot contain C code
6 *
7 * Copyright (c) 2005 Philips Semiconductors
8 * Copyright (c) 2005 MontaVista Software, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15#ifndef __PNX4008_IRQ_H__
16#define __PNX4008_IRQ_H__
17
18#define MIC_VA_BASE IO_ADDRESS(PNX4008_INTCTRLMIC_BASE)
19#define SIC1_VA_BASE IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE)
20#define SIC2_VA_BASE IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE)
21
22/* Manual: Chapter 20, page 195 */
23
24#define INTC_BIT(irq) (1<< ((irq) & 0x1F))
25
26#define INTC_ER(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x0 + (((irq)&(0x3<<5))<<9)))
27#define INTC_RSR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x4 + (((irq)&(0x3<<5))<<9)))
28#define INTC_SR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x8 + (((irq)&(0x3<<5))<<9)))
29#define INTC_APR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0xC + (((irq)&(0x3<<5))<<9)))
30#define INTC_ATR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x10 + (((irq)&(0x3<<5))<<9)))
31#define INTC_ITR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x14 + (((irq)&(0x3<<5))<<9)))
32
33#define START_INT_REG_BIT(irq) (1<<((irq)&0x1F))
34
35#define START_INT_ER_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x20 + (((irq)&(0x1<<5))>>1)))
36#define START_INT_RSR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x24 + (((irq)&(0x1<<5))>>1)))
37#define START_INT_SR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x28 + (((irq)&(0x1<<5))>>1)))
38#define START_INT_APR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x2C + (((irq)&(0x1<<5))>>1)))
39
40extern void __init pnx4008_init_irq(void);
41
42#endif /* __PNX4008_IRQ_H__ */
diff --git a/arch/arm/mach-pnx4008/include/mach/irqs.h b/arch/arm/mach-pnx4008/include/mach/irqs.h
deleted file mode 100644
index f6b33cf23ae..00000000000
--- a/arch/arm/mach-pnx4008/include/mach/irqs.h
+++ /dev/null
@@ -1,215 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/irqs.h
3 *
4 * PNX4008 IRQ controller driver - header file
5 *
6 * Author: Dmitry Chigirev <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#ifndef __PNX4008_IRQS_h__
14#define __PNX4008_IRQS_h__
15
16#define NR_IRQS 96
17
18/*Manual: table 259, page 199*/
19
20/*SUB2 Interrupt Routing (SIC2)*/
21
22#define SIC2_BASE_INT 64
23
24#define CLK_SWITCH_ARM_INT 95 /*manual: Clkswitch ARM */
25#define CLK_SWITCH_DSP_INT 94 /*manual: ClkSwitch DSP */
26#define CLK_SWITCH_AUD_INT 93 /*manual: Clkswitch AUD */
27#define GPI_06_INT 92
28#define GPI_05_INT 91
29#define GPI_04_INT 90
30#define GPI_03_INT 89
31#define GPI_02_INT 88
32#define GPI_01_INT 87
33#define GPI_00_INT 86
34#define BT_CLKREQ_INT 85
35#define SPI1_DATIN_INT 84
36#define U5_RX_INT 83
37#define SDIO_INT_N 82
38#define CAM_HS_INT 81
39#define CAM_VS_INT 80
40#define GPI_07_INT 79
41#define DISP_SYNC_INT 78
42#define DSP_INT8 77
43#define U7_HCTS_INT 76
44#define GPI_10_INT 75
45#define GPI_09_INT 74
46#define GPI_08_INT 73
47#define DSP_INT7 72
48#define U2_HCTS_INT 71
49#define SPI2_DATIN_INT 70
50#define GPIO_05_INT 69
51#define GPIO_04_INT 68
52#define GPIO_03_INT 67
53#define GPIO_02_INT 66
54#define GPIO_01_INT 65
55#define GPIO_00_INT 64
56
57/*Manual: table 258, page 198*/
58
59/*SUB1 Interrupt Routing (SIC1)*/
60
61#define SIC1_BASE_INT 32
62
63#define USB_I2C_INT 63
64#define USB_DEV_HP_INT 62
65#define USB_DEV_LP_INT 61
66#define USB_DEV_DMA_INT 60
67#define USB_HOST_INT 59
68#define USB_OTG_ATX_INT_N 58
69#define USB_OTG_TIMER_INT 57
70#define SW_INT 56
71#define SPI1_INT 55
72#define KEY_IRQ 54
73#define DSP_M_INT 53
74#define RTC_INT 52
75#define I2C_1_INT 51
76#define I2C_2_INT 50
77#define PLL1_LOCK_INT 49
78#define PLL2_LOCK_INT 48
79#define PLL3_LOCK_INT 47
80#define PLL4_LOCK_INT 46
81#define PLL5_LOCK_INT 45
82#define SPI2_INT 44
83#define DSP_INT1 43
84#define DSP_INT2 42
85#define DSP_TDM_INT2 41
86#define TS_AUX_INT 40
87#define TS_IRQ 39
88#define TS_P_INT 38
89#define UOUT1_TO_PAD_INT 37
90#define GPI_11_INT 36
91#define DSP_INT4 35
92#define JTAG_COMM_RX_INT 34
93#define JTAG_COMM_TX_INT 33
94#define DSP_INT3 32
95
96/*Manual: table 257, page 197*/
97
98/*MAIN Interrupt Routing*/
99
100#define MAIN_BASE_INT 0
101
102#define SUB2_FIQ_N 31 /*active low */
103#define SUB1_FIQ_N 30 /*active low */
104#define JPEG_INT 29
105#define DMA_INT 28
106#define MSTIMER_INT 27
107#define IIR1_INT 26
108#define IIR2_INT 25
109#define IIR7_INT 24
110#define DSP_TDM_INT0 23
111#define DSP_TDM_INT1 22
112#define DSP_P_INT 21
113#define DSP_INT0 20
114#define DUM_INT 19
115#define UOUT0_TO_PAD_INT 18
116#define MP4_ENC_INT 17
117#define MP4_DEC_INT 16
118#define SD0_INT 15
119#define MBX_INT 14
120#define SD1_INT 13
121#define MS_INT_N 12
122#define FLASH_INT 11 /*NAND*/
123#define IIR6_INT 10
124#define IIR5_INT 9
125#define IIR4_INT 8
126#define IIR3_INT 7
127#define WATCH_INT 6
128#define HSTIMER_INT 5
129#define ARCH_TIMER_IRQ HSTIMER_INT
130#define CAM_INT 4
131#define PRNG_INT 3
132#define CRYPTO_INT 2
133#define SUB2_IRQ_N 1 /*active low */
134#define SUB1_IRQ_N 0 /*active low */
135
136#define PNX4008_IRQ_TYPES \
137{ /*IRQ #'s: */ \
138IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, /* 0, 1, 2, 3 */ \
139IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 4, 5, 6, 7 */ \
140IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 8, 9,10,11 */ \
141IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 12,13,14,15 */ \
142IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 16,17,18,19 */ \
143IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 20,21,22,23 */ \
144IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 24,25,26,27 */ \
145IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, /* 28,29,30,31 */ \
146IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 32,33,34,35 */ \
147IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_FALLING, IRQ_TYPE_LEVEL_HIGH, /* 36,37,38,39 */ \
148IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 40,41,42,43 */ \
149IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 44,45,46,47 */ \
150IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, /* 48,49,50,51 */ \
151IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 52,53,54,55 */ \
152IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, /* 56,57,58,59 */ \
153IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 60,61,62,63 */ \
154IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 64,65,66,67 */ \
155IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 68,69,70,71 */ \
156IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 72,73,74,75 */ \
157IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 76,77,78,79 */ \
158IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 80,81,82,83 */ \
159IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 84,85,86,87 */ \
160IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 88,89,90,91 */ \
161IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 92,93,94,95 */ \
162}
163
164/* Start Enable Pin Interrupts - table 58 page 66 */
165
166#define SE_PIN_BASE_INT 32
167
168#define SE_U7_RX_INT 63
169#define SE_U7_HCTS_INT 62
170#define SE_BT_CLKREQ_INT 61
171#define SE_U6_IRRX_INT 60
172/*59 unused*/
173#define SE_U5_RX_INT 58
174#define SE_GPI_11_INT 57
175#define SE_U3_RX_INT 56
176#define SE_U2_HCTS_INT 55
177#define SE_U2_RX_INT 54
178#define SE_U1_RX_INT 53
179#define SE_DISP_SYNC_INT 52
180/*51 unused*/
181#define SE_SDIO_INT_N 50
182#define SE_MSDIO_START_INT 49
183#define SE_GPI_06_INT 48
184#define SE_GPI_05_INT 47
185#define SE_GPI_04_INT 46
186#define SE_GPI_03_INT 45
187#define SE_GPI_02_INT 44
188#define SE_GPI_01_INT 43
189#define SE_GPI_00_INT 42
190#define SE_SYSCLKEN_PIN_INT 41
191#define SE_SPI1_DATAIN_INT 40
192#define SE_GPI_07_INT 39
193#define SE_SPI2_DATAIN_INT 38
194#define SE_GPI_10_INT 37
195#define SE_GPI_09_INT 36
196#define SE_GPI_08_INT 35
197/*34-32 unused*/
198
199/* Start Enable Internal Interrupts - table 57 page 65 */
200
201#define SE_INT_BASE_INT 0
202
203#define SE_TS_IRQ 31
204#define SE_TS_P_INT 30
205#define SE_TS_AUX_INT 29
206/*27-28 unused*/
207#define SE_USB_AHB_NEED_CLK_INT 26
208#define SE_MSTIMER_INT 25
209#define SE_RTC_INT 24
210#define SE_USB_NEED_CLK_INT 23
211#define SE_USB_INT 22
212#define SE_USB_I2C_INT 21
213#define SE_USB_OTG_TIMER_INT 20
214
215#endif /* __PNX4008_IRQS_h__ */
diff --git a/arch/arm/mach-pnx4008/include/mach/platform.h b/arch/arm/mach-pnx4008/include/mach/platform.h
deleted file mode 100644
index 368c2c10a30..00000000000
--- a/arch/arm/mach-pnx4008/include/mach/platform.h
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/platform.h
3 *
4 * PNX4008 Base addresses - header file
5 *
6 * Author: Dmitry Chigirev <source@mvista.com>
7 *
8 * Based on reference code received from Philips:
9 * Copyright (C) 2003 Philips Semiconductors
10 *
11 * 2005 (c) MontaVista Software, Inc. This file is licensed under
12 * the terms of the GNU General Public License version 2. This program
13 * is licensed "as is" without any warranty of any kind, whether express
14 * or implied.
15 */
16
17
18#ifndef __ASM_ARCH_PLATFORM_H__
19#define __ASM_ARCH_PLATFORM_H__
20
21#define PNX4008_IRAM_BASE 0x08000000
22#define PNX4008_IRAM_SIZE 0x00010000
23#define PNX4008_YUV_SLAVE_BASE 0x10000000
24#define PNX4008_DUM_SLAVE_BASE 0x18000000
25#define PNX4008_NDF_FLASH_BASE 0x20020000
26#define PNX4008_SPI1_BASE 0x20088000
27#define PNX4008_SPI2_BASE 0x20090000
28#define PNX4008_SD_CONFIG_BASE 0x20098000
29#define PNX4008_FLASH_DATA 0x200B0000
30#define PNX4008_MLC_FLASH_BASE 0x200B8000
31#define PNX4008_JPEG_CONFIG_BASE 0x300A0000
32#define PNX4008_DMA_CONFIG_BASE 0x31000000
33#define PNX4008_USB_CONFIG_BASE 0x31020000
34#define PNX4008_SDRAM_CFG_BASE 0x31080000
35#define PNX4008_AHB2FAB_BASE 0x40000000
36#define PNX4008_PWRMAN_BASE 0x40004000
37#define PNX4008_INTCTRLMIC_BASE 0x40008000
38#define PNX4008_INTCTRLSIC1_BASE 0x4000C000
39#define PNX4008_INTCTRLSIC2_BASE 0x40010000
40#define PNX4008_HSUART1_BASE 0x40014000
41#define PNX4008_HSUART2_BASE 0x40018000
42#define PNX4008_HSUART7_BASE 0x4001C000
43#define PNX4008_RTC_BASE 0x40024000
44#define PNX4008_PIO_BASE 0x40028000
45#define PNX4008_MSTIMER_BASE 0x40034000
46#define PNX4008_HSTIMER_BASE 0x40038000
47#define PNX4008_WDOG_BASE 0x4003C000
48#define PNX4008_DEBUG_BASE 0x40040000
49#define PNX4008_TOUCH1_BASE 0x40048000
50#define PNX4008_KEYSCAN_BASE 0x40050000
51#define PNX4008_UARTCTRL_BASE 0x40054000
52#define PNX4008_PWM_BASE 0x4005C000
53#define PNX4008_UART3_BASE 0x40080000
54#define PNX4008_UART4_BASE 0x40088000
55#define PNX4008_UART5_BASE 0x40090000
56#define PNX4008_UART6_BASE 0x40098000
57#define PNX4008_I2C1_BASE 0x400A0000
58#define PNX4008_I2C2_BASE 0x400A8000
59#define PNX4008_MAGICGATE_BASE 0x400B0000
60#define PNX4008_DUMCONF_BASE 0x400B8000
61#define PNX4008_DUM_MAINCFG_BASE 0x400BC000
62#define PNX4008_DSP_BASE 0x400C0000
63#define PNX4008_PROFCOUNTER_BASE 0x400C8000
64#define PNX4008_CRYPTO_BASE 0x400D0000
65#define PNX4008_CAMIFCONF_BASE 0x400D8000
66#define PNX4008_YUV2RGB_BASE 0x400E0000
67#define PNX4008_AUDIOCONFIG_BASE 0x400E8000
68
69#endif
diff --git a/arch/arm/mach-pnx4008/include/mach/pm.h b/arch/arm/mach-pnx4008/include/mach/pm.h
deleted file mode 100644
index 2fa685bff85..00000000000
--- a/arch/arm/mach-pnx4008/include/mach/pm.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/pm.h
3 *
4 * PNX4008 Power Management Routiness - header file
5 *
6 * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#ifndef __ASM_ARCH_PNX4008_PM_H
15#define __ASM_ARCH_PNX4008_PM_H
16
17#ifndef __ASSEMBLER__
18#include "irq.h"
19#include "irqs.h"
20#include "clock.h"
21
22extern void pnx4008_pm_idle(void);
23extern void pnx4008_pm_suspend(void);
24extern unsigned int pnx4008_cpu_suspend_sz;
25extern void pnx4008_cpu_suspend(void);
26extern unsigned int pnx4008_cpu_standby_sz;
27extern void pnx4008_cpu_standby(void);
28
29extern int pnx4008_startup_pll(struct clk *);
30extern int pnx4008_shutdown_pll(struct clk *);
31
32#endif /* ASSEMBLER */
33#endif /* __ASM_ARCH_PNX4008_PM_H */
diff --git a/arch/arm/mach-pnx4008/include/mach/timex.h b/arch/arm/mach-pnx4008/include/mach/timex.h
deleted file mode 100644
index b383c7de7ab..00000000000
--- a/arch/arm/mach-pnx4008/include/mach/timex.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/timex.h
3 *
4 * PNX4008 timers header file
5 *
6 * Author: Dmitry Chigirev <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#ifndef __PNX4008_TIMEX_H
15#define __PNX4008_TIMEX_H
16
17#define CLOCK_TICK_RATE 1000000
18
19#endif
diff --git a/arch/arm/mach-pnx4008/include/mach/uncompress.h b/arch/arm/mach-pnx4008/include/mach/uncompress.h
deleted file mode 100644
index bb4751ee253..00000000000
--- a/arch/arm/mach-pnx4008/include/mach/uncompress.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/uncompress.h
3 *
4 * Copyright (C) 1999 ARM Limited
5 * Copyright (C) 2006 MontaVista Software, Inc.
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#define UART5_BASE 0x40090000
23
24#define UART5_DR (*(volatile unsigned char *) (UART5_BASE))
25#define UART5_FR (*(volatile unsigned char *) (UART5_BASE + 18))
26
27static __inline__ void putc(char c)
28{
29 while (UART5_FR & (1 << 5))
30 barrier();
31
32 UART5_DR = c;
33}
34
35/*
36 * This does not append a newline
37 */
38static inline void flush(void)
39{
40}
41
42/*
43 * nothing to do
44 */
45#define arch_decomp_setup()
46#define arch_decomp_wdog()
diff --git a/arch/arm/mach-pnx4008/irq.c b/arch/arm/mach-pnx4008/irq.c
deleted file mode 100644
index 41e4201972d..00000000000
--- a/arch/arm/mach-pnx4008/irq.c
+++ /dev/null
@@ -1,121 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/irq.c
3 *
4 * PNX4008 IRQ controller driver
5 *
6 * Author: Dmitry Chigirev <source@mvista.com>
7 *
8 * Based on reference code received from Philips:
9 * Copyright (C) 2003 Philips Semiconductors
10 *
11 * 2005 (c) MontaVista Software, Inc. This file is licensed under
12 * the terms of the GNU General Public License version 2. This program
13 * is licensed "as is" without any warranty of any kind, whether express
14 * or implied.
15 */
16
17#include <linux/kernel.h>
18#include <linux/types.h>
19#include <linux/mm.h>
20#include <linux/interrupt.h>
21#include <linux/list.h>
22#include <linux/init.h>
23#include <linux/ioport.h>
24#include <linux/device.h>
25#include <linux/irq.h>
26#include <linux/io.h>
27#include <mach/hardware.h>
28#include <asm/setup.h>
29#include <asm/pgtable.h>
30#include <asm/page.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/irq.h>
33#include <asm/mach/map.h>
34#include <mach/irq.h>
35
36static u8 pnx4008_irq_type[NR_IRQS] = PNX4008_IRQ_TYPES;
37
38static void pnx4008_mask_irq(struct irq_data *d)
39{
40 __raw_writel(__raw_readl(INTC_ER(d->irq)) & ~INTC_BIT(d->irq), INTC_ER(d->irq)); /* mask interrupt */
41}
42
43static void pnx4008_unmask_irq(struct irq_data *d)
44{
45 __raw_writel(__raw_readl(INTC_ER(d->irq)) | INTC_BIT(d->irq), INTC_ER(d->irq)); /* unmask interrupt */
46}
47
48static void pnx4008_mask_ack_irq(struct irq_data *d)
49{
50 __raw_writel(__raw_readl(INTC_ER(d->irq)) & ~INTC_BIT(d->irq), INTC_ER(d->irq)); /* mask interrupt */
51 __raw_writel(INTC_BIT(d->irq), INTC_SR(d->irq)); /* clear interrupt status */
52}
53
54static int pnx4008_set_irq_type(struct irq_data *d, unsigned int type)
55{
56 switch (type) {
57 case IRQ_TYPE_EDGE_RISING:
58 __raw_writel(__raw_readl(INTC_ATR(d->irq)) | INTC_BIT(d->irq), INTC_ATR(d->irq)); /*edge sensitive */
59 __raw_writel(__raw_readl(INTC_APR(d->irq)) | INTC_BIT(d->irq), INTC_APR(d->irq)); /*rising edge */
60 irq_set_handler(d->irq, handle_edge_irq);
61 break;
62 case IRQ_TYPE_EDGE_FALLING:
63 __raw_writel(__raw_readl(INTC_ATR(d->irq)) | INTC_BIT(d->irq), INTC_ATR(d->irq)); /*edge sensitive */
64 __raw_writel(__raw_readl(INTC_APR(d->irq)) & ~INTC_BIT(d->irq), INTC_APR(d->irq)); /*falling edge */
65 irq_set_handler(d->irq, handle_edge_irq);
66 break;
67 case IRQ_TYPE_LEVEL_LOW:
68 __raw_writel(__raw_readl(INTC_ATR(d->irq)) & ~INTC_BIT(d->irq), INTC_ATR(d->irq)); /*level sensitive */
69 __raw_writel(__raw_readl(INTC_APR(d->irq)) & ~INTC_BIT(d->irq), INTC_APR(d->irq)); /*low level */
70 irq_set_handler(d->irq, handle_level_irq);
71 break;
72 case IRQ_TYPE_LEVEL_HIGH:
73 __raw_writel(__raw_readl(INTC_ATR(d->irq)) & ~INTC_BIT(d->irq), INTC_ATR(d->irq)); /*level sensitive */
74 __raw_writel(__raw_readl(INTC_APR(d->irq)) | INTC_BIT(d->irq), INTC_APR(d->irq)); /* high level */
75 irq_set_handler(d->irq, handle_level_irq);
76 break;
77
78 /* IRQ_TYPE_EDGE_BOTH is not supported */
79 default:
80 printk(KERN_ERR "PNX4008 IRQ: Unsupported irq type %d\n", type);
81 return -1;
82 }
83 return 0;
84}
85
86static struct irq_chip pnx4008_irq_chip = {
87 .irq_ack = pnx4008_mask_ack_irq,
88 .irq_mask = pnx4008_mask_irq,
89 .irq_unmask = pnx4008_unmask_irq,
90 .irq_set_type = pnx4008_set_irq_type,
91};
92
93void __init pnx4008_init_irq(void)
94{
95 unsigned int i;
96
97 /* configure IRQ's */
98 for (i = 0; i < NR_IRQS; i++) {
99 set_irq_flags(i, IRQF_VALID);
100 irq_set_chip(i, &pnx4008_irq_chip);
101 pnx4008_set_irq_type(irq_get_irq_data(i), pnx4008_irq_type[i]);
102 }
103
104 /* configure and enable IRQ 0,1,30,31 (cascade interrupts) */
105 pnx4008_set_irq_type(irq_get_irq_data(SUB1_IRQ_N),
106 pnx4008_irq_type[SUB1_IRQ_N]);
107 pnx4008_set_irq_type(irq_get_irq_data(SUB2_IRQ_N),
108 pnx4008_irq_type[SUB2_IRQ_N]);
109 pnx4008_set_irq_type(irq_get_irq_data(SUB1_FIQ_N),
110 pnx4008_irq_type[SUB1_FIQ_N]);
111 pnx4008_set_irq_type(irq_get_irq_data(SUB2_FIQ_N),
112 pnx4008_irq_type[SUB2_FIQ_N]);
113
114 /* mask all others */
115 __raw_writel((1 << SUB2_FIQ_N) | (1 << SUB1_FIQ_N) |
116 (1 << SUB2_IRQ_N) | (1 << SUB1_IRQ_N),
117 INTC_ER(MAIN_BASE_INT));
118 __raw_writel(0, INTC_ER(SIC1_BASE_INT));
119 __raw_writel(0, INTC_ER(SIC2_BASE_INT));
120}
121
diff --git a/arch/arm/mach-pnx4008/pm.c b/arch/arm/mach-pnx4008/pm.c
deleted file mode 100644
index 26f8d06b142..00000000000
--- a/arch/arm/mach-pnx4008/pm.c
+++ /dev/null
@@ -1,153 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/pm.c
3 *
4 * Power Management driver for PNX4008
5 *
6 * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#include <linux/pm.h>
15#include <linux/rtc.h>
16#include <linux/sched.h>
17#include <linux/proc_fs.h>
18#include <linux/suspend.h>
19#include <linux/delay.h>
20#include <linux/clk.h>
21#include <linux/io.h>
22#include <linux/slab.h>
23
24#include <asm/cacheflush.h>
25
26#include <mach/hardware.h>
27#include <mach/pm.h>
28#include <mach/clock.h>
29
30#define SRAM_VA IO_ADDRESS(PNX4008_IRAM_BASE)
31
32static void *saved_sram;
33
34static struct clk *pll4_clk;
35
36static inline void pnx4008_standby(void)
37{
38 void (*pnx4008_cpu_standby_ptr) (void);
39
40 local_irq_disable();
41 local_fiq_disable();
42
43 clk_disable(pll4_clk);
44
45 /*saving portion of SRAM to be used by suspend function. */
46 memcpy(saved_sram, (void *)SRAM_VA, pnx4008_cpu_standby_sz);
47
48 /*make sure SRAM copy gets physically written into SDRAM.
49 SDRAM will be placed into self-refresh during power down */
50 flush_cache_all();
51
52 /*copy suspend function into SRAM */
53 memcpy((void *)SRAM_VA, pnx4008_cpu_standby, pnx4008_cpu_standby_sz);
54
55 /*do suspend */
56 pnx4008_cpu_standby_ptr = (void *)SRAM_VA;
57 pnx4008_cpu_standby_ptr();
58
59 /*restoring portion of SRAM that was used by suspend function */
60 memcpy((void *)SRAM_VA, saved_sram, pnx4008_cpu_standby_sz);
61
62 clk_enable(pll4_clk);
63
64 local_fiq_enable();
65 local_irq_enable();
66}
67
68static inline void pnx4008_suspend(void)
69{
70 void (*pnx4008_cpu_suspend_ptr) (void);
71
72 local_irq_disable();
73 local_fiq_disable();
74
75 clk_disable(pll4_clk);
76
77 __raw_writel(0xffffffff, START_INT_RSR_REG(SE_PIN_BASE_INT));
78 __raw_writel(0xffffffff, START_INT_RSR_REG(SE_INT_BASE_INT));
79
80 /*saving portion of SRAM to be used by suspend function. */
81 memcpy(saved_sram, (void *)SRAM_VA, pnx4008_cpu_suspend_sz);
82
83 /*make sure SRAM copy gets physically written into SDRAM.
84 SDRAM will be placed into self-refresh during power down */
85 flush_cache_all();
86
87 /*copy suspend function into SRAM */
88 memcpy((void *)SRAM_VA, pnx4008_cpu_suspend, pnx4008_cpu_suspend_sz);
89
90 /*do suspend */
91 pnx4008_cpu_suspend_ptr = (void *)SRAM_VA;
92 pnx4008_cpu_suspend_ptr();
93
94 /*restoring portion of SRAM that was used by suspend function */
95 memcpy((void *)SRAM_VA, saved_sram, pnx4008_cpu_suspend_sz);
96
97 clk_enable(pll4_clk);
98
99 local_fiq_enable();
100 local_irq_enable();
101}
102
103static int pnx4008_pm_enter(suspend_state_t state)
104{
105 switch (state) {
106 case PM_SUSPEND_STANDBY:
107 pnx4008_standby();
108 break;
109 case PM_SUSPEND_MEM:
110 pnx4008_suspend();
111 break;
112 }
113 return 0;
114}
115
116static int pnx4008_pm_valid(suspend_state_t state)
117{
118 return (state == PM_SUSPEND_STANDBY) ||
119 (state == PM_SUSPEND_MEM);
120}
121
122static const struct platform_suspend_ops pnx4008_pm_ops = {
123 .enter = pnx4008_pm_enter,
124 .valid = pnx4008_pm_valid,
125};
126
127int __init pnx4008_pm_init(void)
128{
129 u32 sram_size_to_allocate;
130
131 pll4_clk = clk_get(0, "ck_pll4");
132 if (IS_ERR(pll4_clk)) {
133 printk(KERN_ERR
134 "PM Suspend cannot acquire ARM(PLL4) clock control\n");
135 return PTR_ERR(pll4_clk);
136 }
137
138 if (pnx4008_cpu_standby_sz > pnx4008_cpu_suspend_sz)
139 sram_size_to_allocate = pnx4008_cpu_standby_sz;
140 else
141 sram_size_to_allocate = pnx4008_cpu_suspend_sz;
142
143 saved_sram = kmalloc(sram_size_to_allocate, GFP_ATOMIC);
144 if (!saved_sram) {
145 printk(KERN_ERR
146 "PM Suspend: cannot allocate memory to save portion of SRAM\n");
147 clk_put(pll4_clk);
148 return -ENOMEM;
149 }
150
151 suspend_set_ops(&pnx4008_pm_ops);
152 return 0;
153}
diff --git a/arch/arm/mach-pnx4008/serial.c b/arch/arm/mach-pnx4008/serial.c
deleted file mode 100644
index 374c138ac1a..00000000000
--- a/arch/arm/mach-pnx4008/serial.c
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * linux/arch/arm/mach-pnx4008/serial.c
3 *
4 * PNX4008 UART initialization
5 *
6 * Copyright: MontaVista Software Inc. (c) 2005
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/io.h>
15
16#include <mach/platform.h>
17#include <mach/hardware.h>
18
19#include <linux/serial_core.h>
20#include <linux/serial_reg.h>
21
22#include <mach/gpio-pnx4008.h>
23#include <mach/clock.h>
24
25#define UART_3 0
26#define UART_4 1
27#define UART_5 2
28#define UART_6 3
29#define UART_UNKNOWN (-1)
30
31#define UART3_BASE_VA IO_ADDRESS(PNX4008_UART3_BASE)
32#define UART4_BASE_VA IO_ADDRESS(PNX4008_UART4_BASE)
33#define UART5_BASE_VA IO_ADDRESS(PNX4008_UART5_BASE)
34#define UART6_BASE_VA IO_ADDRESS(PNX4008_UART6_BASE)
35
36#define UART_FCR_OFFSET 8
37#define UART_FIFO_SIZE 64
38
39void pnx4008_uart_init(void)
40{
41 u32 tmp;
42 int i = UART_FIFO_SIZE;
43
44 __raw_writel(0xC1, UART5_BASE_VA + UART_FCR_OFFSET);
45 __raw_writel(0xC1, UART3_BASE_VA + UART_FCR_OFFSET);
46
47 /* Send a NULL to fix the UART HW bug */
48 __raw_writel(0x00, UART5_BASE_VA);
49 __raw_writel(0x00, UART3_BASE_VA);
50
51 while (i--) {
52 tmp = __raw_readl(UART5_BASE_VA);
53 tmp = __raw_readl(UART3_BASE_VA);
54 }
55 __raw_writel(0, UART5_BASE_VA + UART_FCR_OFFSET);
56 __raw_writel(0, UART3_BASE_VA + UART_FCR_OFFSET);
57
58 /* setup wakeup interrupt */
59 start_int_set_rising_edge(SE_U3_RX_INT);
60 start_int_ack(SE_U3_RX_INT);
61 start_int_umask(SE_U3_RX_INT);
62
63 start_int_set_rising_edge(SE_U5_RX_INT);
64 start_int_ack(SE_U5_RX_INT);
65 start_int_umask(SE_U5_RX_INT);
66}
67
diff --git a/arch/arm/mach-pnx4008/sleep.S b/arch/arm/mach-pnx4008/sleep.S
deleted file mode 100644
index f4eed495d29..00000000000
--- a/arch/arm/mach-pnx4008/sleep.S
+++ /dev/null
@@ -1,195 +0,0 @@
1/*
2 * linux/arch/arm/mach-pnx4008/sleep.S
3 *
4 * PNX4008 support for STOP mode and SDRAM self-refresh
5 *
6 * Authors: Dmitry Chigirev, Vitaly Wool <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#include <linux/linkage.h>
15#include <asm/assembler.h>
16#include <mach/hardware.h>
17
18#define PWRMAN_VA_BASE IO_ADDRESS(PNX4008_PWRMAN_BASE)
19#define PWR_CTRL_REG_OFFS 0x44
20
21#define SDRAM_CFG_VA_BASE IO_ADDRESS(PNX4008_SDRAM_CFG_BASE)
22#define MPMC_STATUS_REG_OFFS 0x4
23
24 .text
25
26ENTRY(pnx4008_cpu_suspend)
27 @this function should be entered in Direct run mode.
28
29 @ save registers on stack
30 stmfd sp!, {r0 - r6, lr}
31
32 @ setup Power Manager base address in r4
33 @ and put it's value in r5
34 mov r4, #(PWRMAN_VA_BASE & 0xff000000)
35 orr r4, r4, #(PWRMAN_VA_BASE & 0x00ff0000)
36 orr r4, r4, #(PWRMAN_VA_BASE & 0x0000ff00)
37 orr r4, r4, #(PWRMAN_VA_BASE & 0x000000ff)
38 ldr r5, [r4, #PWR_CTRL_REG_OFFS]
39
40 @ setup SDRAM controller base address in r2
41 @ and put it's value in r3
42 mov r2, #(SDRAM_CFG_VA_BASE & 0xff000000)
43 orr r2, r2, #(SDRAM_CFG_VA_BASE & 0x00ff0000)
44 orr r2, r2, #(SDRAM_CFG_VA_BASE & 0x0000ff00)
45 orr r2, r2, #(SDRAM_CFG_VA_BASE & 0x000000ff)
46 ldr r3, [r2, #MPMC_STATUS_REG_OFFS] @extra read - HW bug workaround
47
48 @ clear SDRAM self-refresh bit latch
49 and r5, r5, #(~(1 << 8))
50 @ clear SDRAM self-refresh bit
51 and r5, r5, #(~(1 << 9))
52 str r5, [r4, #PWR_CTRL_REG_OFFS]
53
54 @ do save current bit settings in r1
55 mov r1, r5
56
57 @ set SDRAM self-refresh bit
58 orr r5, r5, #(1 << 9)
59 str r5, [r4, #PWR_CTRL_REG_OFFS]
60
61 @ set SDRAM self-refresh bit latch
62 orr r5, r5, #(1 << 8)
63 str r5, [r4, #PWR_CTRL_REG_OFFS]
64
65 @ clear SDRAM self-refresh bit latch
66 and r5, r5, #(~(1 << 8))
67 str r5, [r4, #PWR_CTRL_REG_OFFS]
68
69 @ clear SDRAM self-refresh bit
70 and r5, r5, #(~(1 << 9))
71 str r5, [r4, #PWR_CTRL_REG_OFFS]
72
73 @ wait for SDRAM to get into self-refresh mode
742: ldr r3, [r2, #MPMC_STATUS_REG_OFFS]
75 tst r3, #(1 << 2)
76 beq 2b
77
78 @ to prepare SDRAM to get out of self-refresh mode after wakeup
79 orr r5, r5, #(1 << 7)
80 str r5, [r4, #PWR_CTRL_REG_OFFS]
81
82 @ do enter stop mode
83 orr r5, r5, #(1 << 0)
84 str r5, [r4, #PWR_CTRL_REG_OFFS]
85 nop
86 nop
87 nop
88 nop
89 nop
90 nop
91 nop
92 nop
93 nop
94
95 @ sleeping now...
96
97 @ coming out of STOP mode into Direct Run mode
98 @ clear STOP mode and SDRAM self-refresh bits
99 str r1, [r4, #PWR_CTRL_REG_OFFS]
100
101 @ wait for SDRAM to get out self-refresh mode
1023: ldr r3, [r2, #MPMC_STATUS_REG_OFFS]
103 tst r3, #5
104 bne 3b
105
106 @ restore regs and return
107 ldmfd sp!, {r0 - r6, pc}
108
109ENTRY(pnx4008_cpu_suspend_sz)
110 .word . - pnx4008_cpu_suspend
111
112ENTRY(pnx4008_cpu_standby)
113 @ save registers on stack
114 stmfd sp!, {r0 - r6, lr}
115
116 @ setup Power Manager base address in r4
117 @ and put it's value in r5
118 mov r4, #(PWRMAN_VA_BASE & 0xff000000)
119 orr r4, r4, #(PWRMAN_VA_BASE & 0x00ff0000)
120 orr r4, r4, #(PWRMAN_VA_BASE & 0x0000ff00)
121 orr r4, r4, #(PWRMAN_VA_BASE & 0x000000ff)
122 ldr r5, [r4, #PWR_CTRL_REG_OFFS]
123
124 @ setup SDRAM controller base address in r2
125 @ and put it's value in r3
126 mov r2, #(SDRAM_CFG_VA_BASE & 0xff000000)
127 orr r2, r2, #(SDRAM_CFG_VA_BASE & 0x00ff0000)
128 orr r2, r2, #(SDRAM_CFG_VA_BASE & 0x0000ff00)
129 orr r2, r2, #(SDRAM_CFG_VA_BASE & 0x000000ff)
130 ldr r3, [r2, #MPMC_STATUS_REG_OFFS] @extra read - HW bug workaround
131
132 @ clear SDRAM self-refresh bit latch
133 and r5, r5, #(~(1 << 8))
134 @ clear SDRAM self-refresh bit
135 and r5, r5, #(~(1 << 9))
136 str r5, [r4, #PWR_CTRL_REG_OFFS]
137
138 @ do save current bit settings in r1
139 mov r1, r5
140
141 @ set SDRAM self-refresh bit
142 orr r5, r5, #(1 << 9)
143 str r5, [r4, #PWR_CTRL_REG_OFFS]
144
145 @ set SDRAM self-refresh bit latch
146 orr r5, r5, #(1 << 8)
147 str r5, [r4, #PWR_CTRL_REG_OFFS]
148
149 @ clear SDRAM self-refresh bit latch
150 and r5, r5, #(~(1 << 8))
151 str r5, [r4, #PWR_CTRL_REG_OFFS]
152
153 @ clear SDRAM self-refresh bit
154 and r5, r5, #(~(1 << 9))
155 str r5, [r4, #PWR_CTRL_REG_OFFS]
156
157 @ wait for SDRAM to get into self-refresh mode
1582: ldr r3, [r2, #MPMC_STATUS_REG_OFFS]
159 tst r3, #(1 << 2)
160 beq 2b
161
162 @ set 'get out of self-refresh mode after wakeup' bit
163 orr r5, r5, #(1 << 7)
164 str r5, [r4, #PWR_CTRL_REG_OFFS]
165
166 mcr p15, 0, r0, c7, c0, 4 @ kinda sleeping now...
167
168 @ set SDRAM self-refresh bit latch
169 orr r5, r5, #(1 << 8)
170 str r5, [r4, #PWR_CTRL_REG_OFFS]
171
172 @ clear SDRAM self-refresh bit latch
173 and r5, r5, #(~(1 << 8))
174 str r5, [r4, #PWR_CTRL_REG_OFFS]
175
176 @ wait for SDRAM to get out self-refresh mode
1773: ldr r3, [r2, #MPMC_STATUS_REG_OFFS]
178 tst r3, #5
179 bne 3b
180
181 @ restore regs and return
182 ldmfd sp!, {r0 - r6, pc}
183
184ENTRY(pnx4008_cpu_standby_sz)
185 .word . - pnx4008_cpu_standby
186
187ENTRY(pnx4008_cache_clean_invalidate)
188 stmfd sp!, {r0 - r6, lr}
189#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
190 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
191#else
1921: mrc p15, 0, r15, c7, c14, 3 @ test,clean,invalidate
193 bne 1b
194#endif
195 ldmfd sp!, {r0 - r6, pc}
diff --git a/arch/arm/mach-pnx4008/time.c b/arch/arm/mach-pnx4008/time.c
deleted file mode 100644
index 0cfe8af3d3b..00000000000
--- a/arch/arm/mach-pnx4008/time.c
+++ /dev/null
@@ -1,134 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/time.c
3 *
4 * PNX4008 Timers
5 *
6 * Authors: Vitaly Wool, Dmitry Chigirev, Grigory Tolstolytkin <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/delay.h>
17#include <linux/interrupt.h>
18#include <linux/sched.h>
19#include <linux/spinlock.h>
20#include <linux/module.h>
21#include <linux/kallsyms.h>
22#include <linux/time.h>
23#include <linux/timex.h>
24#include <linux/irq.h>
25#include <linux/io.h>
26
27#include <mach/hardware.h>
28#include <asm/leds.h>
29#include <asm/mach/time.h>
30#include <asm/errno.h>
31
32#include "time.h"
33
34/*! Note: all timers are UPCOUNTING */
35
36/*!
37 * Returns number of us since last clock interrupt. Note that interrupts
38 * will have been disabled by do_gettimeoffset()
39 */
40static unsigned long pnx4008_gettimeoffset(void)
41{
42 u32 ticks_to_match =
43 __raw_readl(HSTIM_MATCH0) - __raw_readl(HSTIM_COUNTER);
44 u32 elapsed = LATCH - ticks_to_match;
45 return (elapsed * (tick_nsec / 1000)) / LATCH;
46}
47
48/*!
49 * IRQ handler for the timer
50 */
51static irqreturn_t pnx4008_timer_interrupt(int irq, void *dev_id)
52{
53 if (__raw_readl(HSTIM_INT) & MATCH0_INT) {
54
55 do {
56 timer_tick();
57
58 /*
59 * this algorithm takes care of possible delay
60 * for this interrupt handling longer than a normal
61 * timer period
62 */
63 __raw_writel(__raw_readl(HSTIM_MATCH0) + LATCH,
64 HSTIM_MATCH0);
65 __raw_writel(MATCH0_INT, HSTIM_INT); /* clear interrupt */
66
67 /*
68 * The goal is to keep incrementing HSTIM_MATCH0
69 * register until HSTIM_MATCH0 indicates time after
70 * what HSTIM_COUNTER indicates.
71 */
72 } while ((signed)
73 (__raw_readl(HSTIM_MATCH0) -
74 __raw_readl(HSTIM_COUNTER)) < 0);
75 }
76
77 return IRQ_HANDLED;
78}
79
80static struct irqaction pnx4008_timer_irq = {
81 .name = "PNX4008 Tick Timer",
82 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
83 .handler = pnx4008_timer_interrupt
84};
85
86/*!
87 * Set up timer and timer interrupt.
88 */
89static __init void pnx4008_setup_timer(void)
90{
91 __raw_writel(RESET_COUNT, MSTIM_CTRL);
92 while (__raw_readl(MSTIM_COUNTER)) ; /* wait for reset to complete. 100% guarantee event */
93 __raw_writel(0, MSTIM_CTRL); /* stop the timer */
94 __raw_writel(0, MSTIM_MCTRL);
95
96 __raw_writel(RESET_COUNT, HSTIM_CTRL);
97 while (__raw_readl(HSTIM_COUNTER)) ; /* wait for reset to complete. 100% guarantee event */
98 __raw_writel(0, HSTIM_CTRL);
99 __raw_writel(0, HSTIM_MCTRL);
100 __raw_writel(0, HSTIM_CCR);
101 __raw_writel(12, HSTIM_PMATCH); /* scale down to 1 MHZ */
102 __raw_writel(LATCH, HSTIM_MATCH0);
103 __raw_writel(MR0_INT, HSTIM_MCTRL);
104
105 setup_irq(HSTIMER_INT, &pnx4008_timer_irq);
106
107 __raw_writel(COUNT_ENAB | DEBUG_EN, HSTIM_CTRL); /*start timer, stop when JTAG active */
108}
109
110/* Timer Clock Control in PM register */
111#define TIMCLK_CTRL_REG IO_ADDRESS((PNX4008_PWRMAN_BASE + 0xBC))
112#define WATCHDOG_CLK_EN 1
113#define TIMER_CLK_EN 2 /* HS and MS timers? */
114
115static u32 timclk_ctrl_reg_save;
116
117void pnx4008_timer_suspend(void)
118{
119 timclk_ctrl_reg_save = __raw_readl(TIMCLK_CTRL_REG);
120 __raw_writel(0, TIMCLK_CTRL_REG); /* disable timers */
121}
122
123void pnx4008_timer_resume(void)
124{
125 __raw_writel(timclk_ctrl_reg_save, TIMCLK_CTRL_REG); /* enable timers */
126}
127
128struct sys_timer pnx4008_timer = {
129 .init = pnx4008_setup_timer,
130 .offset = pnx4008_gettimeoffset,
131 .suspend = pnx4008_timer_suspend,
132 .resume = pnx4008_timer_resume,
133};
134
diff --git a/arch/arm/mach-pnx4008/time.h b/arch/arm/mach-pnx4008/time.h
deleted file mode 100644
index 75e88c570aa..00000000000
--- a/arch/arm/mach-pnx4008/time.h
+++ /dev/null
@@ -1,70 +0,0 @@
1/*
2 * arch/arm/mach-pnx4008/include/mach/timex.h
3 *
4 * PNX4008 timers header file
5 *
6 * Author: Dmitry Chigirev <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#ifndef PNX_TIME_H
14#define PNX_TIME_H
15
16#include <linux/io.h>
17#include <mach/hardware.h>
18
19#define TICKS2USECS(x) (x)
20
21/* MilliSecond Timer - Chapter 21 Page 202 */
22
23#define MSTIM_INT IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x0))
24#define MSTIM_CTRL IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x4))
25#define MSTIM_COUNTER IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x8))
26#define MSTIM_MCTRL IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x14))
27#define MSTIM_MATCH0 IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x18))
28#define MSTIM_MATCH1 IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x1c))
29
30/* High Speed Timer - Chpater 22, Page 205 */
31
32#define HSTIM_INT IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x0))
33#define HSTIM_CTRL IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x4))
34#define HSTIM_COUNTER IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x8))
35#define HSTIM_PMATCH IO_ADDRESS((PNX4008_HSTIMER_BASE + 0xC))
36#define HSTIM_PCOUNT IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x10))
37#define HSTIM_MCTRL IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x14))
38#define HSTIM_MATCH0 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x18))
39#define HSTIM_MATCH1 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x1c))
40#define HSTIM_MATCH2 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x20))
41#define HSTIM_CCR IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x28))
42#define HSTIM_CR0 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x2C))
43#define HSTIM_CR1 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x30))
44
45/* IMPORTANT: both timers are UPCOUNTING */
46
47/* xSTIM_MCTRL bit definitions */
48#define MR0_INT 1
49#define RESET_COUNT0 (1<<1)
50#define STOP_COUNT0 (1<<2)
51#define MR1_INT (1<<3)
52#define RESET_COUNT1 (1<<4)
53#define STOP_COUNT1 (1<<5)
54#define MR2_INT (1<<6)
55#define RESET_COUNT2 (1<<7)
56#define STOP_COUNT2 (1<<8)
57
58/* xSTIM_CTRL bit definitions */
59#define COUNT_ENAB 1
60#define RESET_COUNT (1<<1)
61#define DEBUG_EN (1<<2)
62
63/* xSTIM_INT bit definitions */
64#define MATCH0_INT 1
65#define MATCH1_INT (1<<1)
66#define MATCH2_INT (1<<2)
67#define RTC_TICK0 (1<<4)
68#define RTC_TICK1 (1<<5)
69
70#endif
diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
new file mode 100644
index 00000000000..558ccfb8d45
--- /dev/null
+++ b/arch/arm/mach-prima2/Kconfig
@@ -0,0 +1,19 @@
1if ARCH_SIRF
2
3menu "CSR SiRF primaII/Marco/Polo Specific Features"
4
5config ARCH_PRIMA2
6 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
7 default y
8 select CPU_V7
9 select SIRF_IRQ
10 select ZONE_DMA
11 help
12 Support for CSR SiRFSoC ARM Cortex A9 Platform
13
14endmenu
15
16config SIRF_IRQ
17 bool
18
19endif
diff --git a/arch/arm/mach-prima2/Makefile b/arch/arm/mach-prima2/Makefile
index 13dd1604d95..fc9ce22e2b5 100644
--- a/arch/arm/mach-prima2/Makefile
+++ b/arch/arm/mach-prima2/Makefile
@@ -1,9 +1,8 @@
1obj-y := timer.o 1obj-y := timer.o
2obj-y += irq.o
3obj-y += clock.o
4obj-y += rstc.o 2obj-y += rstc.o
5obj-y += prima2.o 3obj-y += common.o
6obj-y += rtciobrg.o 4obj-y += rtciobrg.o
7obj-$(CONFIG_DEBUG_LL) += lluart.o 5obj-$(CONFIG_DEBUG_LL) += lluart.o
8obj-$(CONFIG_CACHE_L2X0) += l2x0.o 6obj-$(CONFIG_CACHE_L2X0) += l2x0.o
9obj-$(CONFIG_SUSPEND) += pm.o sleep.o 7obj-$(CONFIG_SUSPEND) += pm.o sleep.o
8obj-$(CONFIG_SIRF_IRQ) += irq.o
diff --git a/arch/arm/mach-prima2/clock.c b/arch/arm/mach-prima2/clock.c
deleted file mode 100644
index aebad7e565c..00000000000
--- a/arch/arm/mach-prima2/clock.c
+++ /dev/null
@@ -1,510 +0,0 @@
1/*
2 * Clock tree 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/module.h>
10#include <linux/bitops.h>
11#include <linux/err.h>
12#include <linux/errno.h>
13#include <linux/io.h>
14#include <linux/clkdev.h>
15#include <linux/clk.h>
16#include <linux/spinlock.h>
17#include <linux/of.h>
18#include <linux/of_address.h>
19#include <asm/mach/map.h>
20#include <mach/map.h>
21
22#define SIRFSOC_CLKC_CLK_EN0 0x0000
23#define SIRFSOC_CLKC_CLK_EN1 0x0004
24#define SIRFSOC_CLKC_REF_CFG 0x0014
25#define SIRFSOC_CLKC_CPU_CFG 0x0018
26#define SIRFSOC_CLKC_MEM_CFG 0x001c
27#define SIRFSOC_CLKC_SYS_CFG 0x0020
28#define SIRFSOC_CLKC_IO_CFG 0x0024
29#define SIRFSOC_CLKC_DSP_CFG 0x0028
30#define SIRFSOC_CLKC_GFX_CFG 0x002c
31#define SIRFSOC_CLKC_MM_CFG 0x0030
32#define SIRFSOC_LKC_LCD_CFG 0x0034
33#define SIRFSOC_CLKC_MMC_CFG 0x0038
34#define SIRFSOC_CLKC_PLL1_CFG0 0x0040
35#define SIRFSOC_CLKC_PLL2_CFG0 0x0044
36#define SIRFSOC_CLKC_PLL3_CFG0 0x0048
37#define SIRFSOC_CLKC_PLL1_CFG1 0x004c
38#define SIRFSOC_CLKC_PLL2_CFG1 0x0050
39#define SIRFSOC_CLKC_PLL3_CFG1 0x0054
40#define SIRFSOC_CLKC_PLL1_CFG2 0x0058
41#define SIRFSOC_CLKC_PLL2_CFG2 0x005c
42#define SIRFSOC_CLKC_PLL3_CFG2 0x0060
43
44#define SIRFSOC_CLOCK_VA_BASE SIRFSOC_VA(0x005000)
45
46#define KHZ 1000
47#define MHZ (KHZ * KHZ)
48
49struct clk_ops {
50 unsigned long (*get_rate)(struct clk *clk);
51 long (*round_rate)(struct clk *clk, unsigned long rate);
52 int (*set_rate)(struct clk *clk, unsigned long rate);
53 int (*enable)(struct clk *clk);
54 int (*disable)(struct clk *clk);
55 struct clk *(*get_parent)(struct clk *clk);
56 int (*set_parent)(struct clk *clk, struct clk *parent);
57};
58
59struct clk {
60 struct clk *parent; /* parent clk */
61 unsigned long rate; /* clock rate in Hz */
62 signed char usage; /* clock enable count */
63 signed char enable_bit; /* enable bit: 0 ~ 63 */
64 unsigned short regofs; /* register offset */
65 struct clk_ops *ops; /* clock operation */
66};
67
68static DEFINE_SPINLOCK(clocks_lock);
69
70static inline unsigned long clkc_readl(unsigned reg)
71{
72 return readl(SIRFSOC_CLOCK_VA_BASE + reg);
73}
74
75static inline void clkc_writel(u32 val, unsigned reg)
76{
77 writel(val, SIRFSOC_CLOCK_VA_BASE + reg);
78}
79
80/*
81 * osc_rtc - real time oscillator - 32.768KHz
82 * osc_sys - high speed oscillator - 26MHz
83 */
84
85static struct clk clk_rtc = {
86 .rate = 32768,
87};
88
89static struct clk clk_osc = {
90 .rate = 26 * MHZ,
91};
92
93/*
94 * std pll
95 */
96static unsigned long std_pll_get_rate(struct clk *clk)
97{
98 unsigned long fin = clk_get_rate(clk->parent);
99 u32 regcfg2 = clk->regofs + SIRFSOC_CLKC_PLL1_CFG2 -
100 SIRFSOC_CLKC_PLL1_CFG0;
101
102 if (clkc_readl(regcfg2) & BIT(2)) {
103 /* pll bypass mode */
104 clk->rate = fin;
105 } else {
106 /* fout = fin * nf / nr / od */
107 u32 cfg0 = clkc_readl(clk->regofs);
108 u32 nf = (cfg0 & (BIT(13) - 1)) + 1;
109 u32 nr = ((cfg0 >> 13) & (BIT(6) - 1)) + 1;
110 u32 od = ((cfg0 >> 19) & (BIT(4) - 1)) + 1;
111 WARN_ON(fin % MHZ);
112 clk->rate = fin / MHZ * nf / nr / od * MHZ;
113 }
114
115 return clk->rate;
116}
117
118static int std_pll_set_rate(struct clk *clk, unsigned long rate)
119{
120 unsigned long fin, nf, nr, od, reg;
121
122 /*
123 * fout = fin * nf / (nr * od);
124 * set od = 1, nr = fin/MHz, so fout = nf * MHz
125 */
126
127 nf = rate / MHZ;
128 if (unlikely((rate % MHZ) || nf > BIT(13) || nf < 1))
129 return -EINVAL;
130
131 fin = clk_get_rate(clk->parent);
132 BUG_ON(fin < MHZ);
133
134 nr = fin / MHZ;
135 BUG_ON((fin % MHZ) || nr > BIT(6));
136
137 od = 1;
138
139 reg = (nf - 1) | ((nr - 1) << 13) | ((od - 1) << 19);
140 clkc_writel(reg, clk->regofs);
141
142 reg = clk->regofs + SIRFSOC_CLKC_PLL1_CFG1 - SIRFSOC_CLKC_PLL1_CFG0;
143 clkc_writel((nf >> 1) - 1, reg);
144
145 reg = clk->regofs + SIRFSOC_CLKC_PLL1_CFG2 - SIRFSOC_CLKC_PLL1_CFG0;
146 while (!(clkc_readl(reg) & BIT(6)))
147 cpu_relax();
148
149 clk->rate = 0; /* set to zero will force recalculation */
150 return 0;
151}
152
153static struct clk_ops std_pll_ops = {
154 .get_rate = std_pll_get_rate,
155 .set_rate = std_pll_set_rate,
156};
157
158static struct clk clk_pll1 = {
159 .parent = &clk_osc,
160 .regofs = SIRFSOC_CLKC_PLL1_CFG0,
161 .ops = &std_pll_ops,
162};
163
164static struct clk clk_pll2 = {
165 .parent = &clk_osc,
166 .regofs = SIRFSOC_CLKC_PLL2_CFG0,
167 .ops = &std_pll_ops,
168};
169
170static struct clk clk_pll3 = {
171 .parent = &clk_osc,
172 .regofs = SIRFSOC_CLKC_PLL3_CFG0,
173 .ops = &std_pll_ops,
174};
175
176/*
177 * clock domains - cpu, mem, sys/io
178 */
179
180static struct clk clk_mem;
181
182static struct clk *dmn_get_parent(struct clk *clk)
183{
184 struct clk *clks[] = {
185 &clk_osc, &clk_rtc, &clk_pll1, &clk_pll2, &clk_pll3
186 };
187 u32 cfg = clkc_readl(clk->regofs);
188 WARN_ON((cfg & (BIT(3) - 1)) > 4);
189 return clks[cfg & (BIT(3) - 1)];
190}
191
192static int dmn_set_parent(struct clk *clk, struct clk *parent)
193{
194 const struct clk *clks[] = {
195 &clk_osc, &clk_rtc, &clk_pll1, &clk_pll2, &clk_pll3
196 };
197 u32 cfg = clkc_readl(clk->regofs);
198 int i;
199 for (i = 0; i < ARRAY_SIZE(clks); i++) {
200 if (clks[i] == parent) {
201 cfg &= ~(BIT(3) - 1);
202 clkc_writel(cfg | i, clk->regofs);
203 /* BIT(3) - switching status: 1 - busy, 0 - done */
204 while (clkc_readl(clk->regofs) & BIT(3))
205 cpu_relax();
206 return 0;
207 }
208 }
209 return -EINVAL;
210}
211
212static unsigned long dmn_get_rate(struct clk *clk)
213{
214 unsigned long fin = clk_get_rate(clk->parent);
215 u32 cfg = clkc_readl(clk->regofs);
216 if (cfg & BIT(24)) {
217 /* fcd bypass mode */
218 clk->rate = fin;
219 } else {
220 /*
221 * wait count: bit[19:16], hold count: bit[23:20]
222 */
223 u32 wait = (cfg >> 16) & (BIT(4) - 1);
224 u32 hold = (cfg >> 20) & (BIT(4) - 1);
225
226 clk->rate = fin / (wait + hold + 2);
227 }
228
229 return clk->rate;
230}
231
232static int dmn_set_rate(struct clk *clk, unsigned long rate)
233{
234 unsigned long fin;
235 unsigned ratio, wait, hold, reg;
236 unsigned bits = (clk == &clk_mem) ? 3 : 4;
237
238 fin = clk_get_rate(clk->parent);
239 ratio = fin / rate;
240
241 if (unlikely(ratio < 2 || ratio > BIT(bits + 1)))
242 return -EINVAL;
243
244 WARN_ON(fin % rate);
245
246 wait = (ratio >> 1) - 1;
247 hold = ratio - wait - 2;
248
249 reg = clkc_readl(clk->regofs);
250 reg &= ~(((BIT(bits) - 1) << 16) | ((BIT(bits) - 1) << 20));
251 reg |= (wait << 16) | (hold << 20) | BIT(25);
252 clkc_writel(reg, clk->regofs);
253
254 /* waiting FCD been effective */
255 while (clkc_readl(clk->regofs) & BIT(25))
256 cpu_relax();
257
258 clk->rate = 0; /* set to zero will force recalculation */
259
260 return 0;
261}
262
263/*
264 * cpu clock has no FCD register in Prima2, can only change pll
265 */
266static int cpu_set_rate(struct clk *clk, unsigned long rate)
267{
268 int ret1, ret2;
269 struct clk *cur_parent, *tmp_parent;
270
271 cur_parent = dmn_get_parent(clk);
272 BUG_ON(cur_parent == NULL || cur_parent->usage > 1);
273
274 /* switch to tmp pll before setting parent clock's rate */
275 tmp_parent = cur_parent == &clk_pll1 ? &clk_pll2 : &clk_pll1;
276 ret1 = dmn_set_parent(clk, tmp_parent);
277 BUG_ON(ret1);
278
279 ret2 = clk_set_rate(cur_parent, rate);
280
281 ret1 = dmn_set_parent(clk, cur_parent);
282
283 clk->rate = 0; /* set to zero will force recalculation */
284
285 return ret2 ? ret2 : ret1;
286}
287
288static struct clk_ops cpu_ops = {
289 .get_parent = dmn_get_parent,
290 .set_parent = dmn_set_parent,
291 .set_rate = cpu_set_rate,
292};
293
294static struct clk clk_cpu = {
295 .parent = &clk_pll1,
296 .regofs = SIRFSOC_CLKC_CPU_CFG,
297 .ops = &cpu_ops,
298};
299
300
301static struct clk_ops msi_ops = {
302 .set_rate = dmn_set_rate,
303 .get_rate = dmn_get_rate,
304 .set_parent = dmn_set_parent,
305 .get_parent = dmn_get_parent,
306};
307
308static struct clk clk_mem = {
309 .parent = &clk_pll2,
310 .regofs = SIRFSOC_CLKC_MEM_CFG,
311 .ops = &msi_ops,
312};
313
314static struct clk clk_sys = {
315 .parent = &clk_pll3,
316 .regofs = SIRFSOC_CLKC_SYS_CFG,
317 .ops = &msi_ops,
318};
319
320static struct clk clk_io = {
321 .parent = &clk_pll3,
322 .regofs = SIRFSOC_CLKC_IO_CFG,
323 .ops = &msi_ops,
324};
325
326/*
327 * on-chip clock sets
328 */
329static struct clk_lookup onchip_clks[] = {
330 {
331 .dev_id = "rtc",
332 .clk = &clk_rtc,
333 }, {
334 .dev_id = "osc",
335 .clk = &clk_osc,
336 }, {
337 .dev_id = "pll1",
338 .clk = &clk_pll1,
339 }, {
340 .dev_id = "pll2",
341 .clk = &clk_pll2,
342 }, {
343 .dev_id = "pll3",
344 .clk = &clk_pll3,
345 }, {
346 .dev_id = "cpu",
347 .clk = &clk_cpu,
348 }, {
349 .dev_id = "mem",
350 .clk = &clk_mem,
351 }, {
352 .dev_id = "sys",
353 .clk = &clk_sys,
354 }, {
355 .dev_id = "io",
356 .clk = &clk_io,
357 },
358};
359
360int clk_enable(struct clk *clk)
361{
362 unsigned long flags;
363
364 if (unlikely(IS_ERR_OR_NULL(clk)))
365 return -EINVAL;
366
367 if (clk->parent)
368 clk_enable(clk->parent);
369
370 spin_lock_irqsave(&clocks_lock, flags);
371 if (!clk->usage++ && clk->ops && clk->ops->enable)
372 clk->ops->enable(clk);
373 spin_unlock_irqrestore(&clocks_lock, flags);
374 return 0;
375}
376EXPORT_SYMBOL(clk_enable);
377
378void clk_disable(struct clk *clk)
379{
380 unsigned long flags;
381
382 if (unlikely(IS_ERR_OR_NULL(clk)))
383 return;
384
385 WARN_ON(!clk->usage);
386
387 spin_lock_irqsave(&clocks_lock, flags);
388 if (--clk->usage == 0 && clk->ops && clk->ops->disable)
389 clk->ops->disable(clk);
390 spin_unlock_irqrestore(&clocks_lock, flags);
391
392 if (clk->parent)
393 clk_disable(clk->parent);
394}
395EXPORT_SYMBOL(clk_disable);
396
397unsigned long clk_get_rate(struct clk *clk)
398{
399 if (unlikely(IS_ERR_OR_NULL(clk)))
400 return 0;
401
402 if (clk->rate)
403 return clk->rate;
404
405 if (clk->ops && clk->ops->get_rate)
406 return clk->ops->get_rate(clk);
407
408 return clk_get_rate(clk->parent);
409}
410EXPORT_SYMBOL(clk_get_rate);
411
412long clk_round_rate(struct clk *clk, unsigned long rate)
413{
414 if (unlikely(IS_ERR_OR_NULL(clk)))
415 return 0;
416
417 if (clk->ops && clk->ops->round_rate)
418 return clk->ops->round_rate(clk, rate);
419
420 return 0;
421}
422EXPORT_SYMBOL(clk_round_rate);
423
424int clk_set_rate(struct clk *clk, unsigned long rate)
425{
426 if (unlikely(IS_ERR_OR_NULL(clk)))
427 return -EINVAL;
428
429 if (!clk->ops || !clk->ops->set_rate)
430 return -EINVAL;
431
432 return clk->ops->set_rate(clk, rate);
433}
434EXPORT_SYMBOL(clk_set_rate);
435
436int clk_set_parent(struct clk *clk, struct clk *parent)
437{
438 int ret;
439 unsigned long flags;
440
441 if (unlikely(IS_ERR_OR_NULL(clk)))
442 return -EINVAL;
443
444 if (!clk->ops || !clk->ops->set_parent)
445 return -EINVAL;
446
447 spin_lock_irqsave(&clocks_lock, flags);
448 ret = clk->ops->set_parent(clk, parent);
449 if (!ret) {
450 parent->usage += clk->usage;
451 clk->parent->usage -= clk->usage;
452 BUG_ON(clk->parent->usage < 0);
453 clk->parent = parent;
454 }
455 spin_unlock_irqrestore(&clocks_lock, flags);
456 return ret;
457}
458EXPORT_SYMBOL(clk_set_parent);
459
460struct clk *clk_get_parent(struct clk *clk)
461{
462 unsigned long flags;
463
464 if (unlikely(IS_ERR_OR_NULL(clk)))
465 return NULL;
466
467 if (!clk->ops || !clk->ops->get_parent)
468 return clk->parent;
469
470 spin_lock_irqsave(&clocks_lock, flags);
471 clk->parent = clk->ops->get_parent(clk);
472 spin_unlock_irqrestore(&clocks_lock, flags);
473 return clk->parent;
474}
475EXPORT_SYMBOL(clk_get_parent);
476
477static void __init sirfsoc_clk_init(void)
478{
479 clkdev_add_table(onchip_clks, ARRAY_SIZE(onchip_clks));
480}
481
482static struct of_device_id clkc_ids[] = {
483 { .compatible = "sirf,prima2-clkc" },
484 {},
485};
486
487void __init sirfsoc_of_clk_init(void)
488{
489 struct device_node *np;
490 struct resource res;
491 struct map_desc sirfsoc_clkc_iodesc = {
492 .virtual = SIRFSOC_CLOCK_VA_BASE,
493 .type = MT_DEVICE,
494 };
495
496 np = of_find_matching_node(NULL, clkc_ids);
497 if (!np)
498 panic("unable to find compatible clkc node in dtb\n");
499
500 if (of_address_to_resource(np, 0, &res))
501 panic("unable to find clkc range in dtb");
502 of_node_put(np);
503
504 sirfsoc_clkc_iodesc.pfn = __phys_to_pfn(res.start);
505 sirfsoc_clkc_iodesc.length = 1 + res.end - res.start;
506
507 iotable_init(&sirfsoc_clkc_iodesc, 1);
508
509 sirfsoc_clk_init();
510}
diff --git a/arch/arm/mach-prima2/prima2.c b/arch/arm/mach-prima2/common.c
index 8f0429d4b79..f25a5419463 100644
--- a/arch/arm/mach-prima2/prima2.c
+++ b/arch/arm/mach-prima2/common.c
@@ -30,21 +30,21 @@ void __init sirfsoc_init_late(void)
30 sirfsoc_pm_init(); 30 sirfsoc_pm_init();
31} 31}
32 32
33static const char *prima2cb_dt_match[] __initdata = { 33#ifdef CONFIG_ARCH_PRIMA2
34 "sirf,prima2-cb", 34static const char *prima2_dt_match[] __initdata = {
35 "sirf,prima2",
35 NULL 36 NULL
36}; 37};
37 38
38MACHINE_START(PRIMA2_EVB, "prima2cb") 39DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)")
39 /* Maintainer: Barry Song <baohua.song@csr.com> */ 40 /* Maintainer: Barry Song <baohua.song@csr.com> */
40 .atag_offset = 0x100,
41 .init_early = sirfsoc_of_clk_init,
42 .map_io = sirfsoc_map_lluart, 41 .map_io = sirfsoc_map_lluart,
43 .init_irq = sirfsoc_of_irq_init, 42 .init_irq = sirfsoc_of_irq_init,
44 .timer = &sirfsoc_timer, 43 .timer = &sirfsoc_timer,
45 .dma_zone_size = SZ_256M, 44 .dma_zone_size = SZ_256M,
46 .init_machine = sirfsoc_mach_init, 45 .init_machine = sirfsoc_mach_init,
47 .init_late = sirfsoc_init_late, 46 .init_late = sirfsoc_init_late,
48 .dt_compat = prima2cb_dt_match, 47 .dt_compat = prima2_dt_match,
49 .restart = sirfsoc_restart, 48 .restart = sirfsoc_restart,
50MACHINE_END 49MACHINE_END
50#endif
diff --git a/arch/arm/mach-prima2/include/mach/uncompress.h b/arch/arm/mach-prima2/include/mach/uncompress.h
index 83125c6a30b..0c898fcf909 100644
--- a/arch/arm/mach-prima2/include/mach/uncompress.h
+++ b/arch/arm/mach-prima2/include/mach/uncompress.h
@@ -25,11 +25,11 @@ static __inline__ void putc(char c)
25 * during kernel decompression, all mappings are flat: 25 * during kernel decompression, all mappings are flat:
26 * virt_addr == phys_addr 26 * virt_addr == phys_addr
27 */ 27 */
28 while (__raw_readl(SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_STATUS) 28 while (__raw_readl((void __iomem *)SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_STATUS)
29 & SIRFSOC_UART1_TXFIFO_FULL) 29 & SIRFSOC_UART1_TXFIFO_FULL)
30 barrier(); 30 barrier();
31 31
32 __raw_writel(c, SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_DATA); 32 __raw_writel(c, (void __iomem *)SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_DATA);
33} 33}
34 34
35static inline void flush(void) 35static inline void flush(void)
diff --git a/arch/arm/mach-prima2/irq.c b/arch/arm/mach-prima2/irq.c
index a7b9415d30f..7dee9176e77 100644
--- a/arch/arm/mach-prima2/irq.c
+++ b/arch/arm/mach-prima2/irq.c
@@ -63,7 +63,7 @@ void __init sirfsoc_of_irq_init(void)
63 63
64 np = of_find_matching_node(NULL, intc_ids); 64 np = of_find_matching_node(NULL, intc_ids);
65 if (!np) 65 if (!np)
66 panic("unable to find compatible intc node in dtb\n"); 66 return;
67 67
68 sirfsoc_intc_base = of_iomap(np, 0); 68 sirfsoc_intc_base = of_iomap(np, 0);
69 if (!sirfsoc_intc_base) 69 if (!sirfsoc_intc_base)
diff --git a/arch/arm/mach-prima2/timer.c b/arch/arm/mach-prima2/timer.c
index f224107de7b..d95bf252f69 100644
--- a/arch/arm/mach-prima2/timer.c
+++ b/arch/arm/mach-prima2/timer.c
@@ -21,6 +21,8 @@
21#include <asm/sched_clock.h> 21#include <asm/sched_clock.h>
22#include <asm/mach/time.h> 22#include <asm/mach/time.h>
23 23
24#include "common.h"
25
24#define SIRFSOC_TIMER_COUNTER_LO 0x0000 26#define SIRFSOC_TIMER_COUNTER_LO 0x0000
25#define SIRFSOC_TIMER_COUNTER_HI 0x0004 27#define SIRFSOC_TIMER_COUNTER_HI 0x0004
26#define SIRFSOC_TIMER_MATCH_0 0x0008 28#define SIRFSOC_TIMER_MATCH_0 0x0008
@@ -188,9 +190,13 @@ static void __init sirfsoc_clockevent_init(void)
188static void __init sirfsoc_timer_init(void) 190static void __init sirfsoc_timer_init(void)
189{ 191{
190 unsigned long rate; 192 unsigned long rate;
193 struct clk *clk;
194
195 /* initialize clocking early, we want to set the OS timer */
196 sirfsoc_of_clk_init();
191 197
192 /* timer's input clock is io clock */ 198 /* timer's input clock is io clock */
193 struct clk *clk = clk_get_sys("io", NULL); 199 clk = clk_get_sys("io", NULL);
194 200
195 BUG_ON(IS_ERR(clk)); 201 BUG_ON(IS_ERR(clk));
196 202
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index fe2d1f80ef5..11aa7399dc0 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -25,6 +25,18 @@ config PXA_V7_MACH_AUTO
25if !ARCH_PXA_V7 25if !ARCH_PXA_V7
26comment "Intel/Marvell Dev Platforms (sorted by hardware release time)" 26comment "Intel/Marvell Dev Platforms (sorted by hardware release time)"
27 27
28config MACH_PXA3XX_DT
29 bool "Support PXA3xx platforms from device tree"
30 select CPU_PXA300
31 select HAVE_PWM
32 select POWER_SUPPLY
33 select PXA3xx
34 select USE_OF
35 help
36 Include support for Marvell PXA3xx based platforms using
37 the device tree. Needn't select any other machine while
38 MACH_PXA3XX_DT is enabled.
39
28config ARCH_LUBBOCK 40config ARCH_LUBBOCK
29 bool "Intel DBPXA250 Development Platform (aka Lubbock)" 41 bool "Intel DBPXA250 Development Platform (aka Lubbock)"
30 select PXA25x 42 select PXA25x
@@ -32,13 +44,13 @@ config ARCH_LUBBOCK
32 44
33config MACH_MAINSTONE 45config MACH_MAINSTONE
34 bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)" 46 bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)"
35 select PXA27x
36 select HAVE_PWM 47 select HAVE_PWM
48 select PXA27x
37 49
38config MACH_ZYLONITE 50config MACH_ZYLONITE
39 bool 51 bool
40 select PXA3xx
41 select HAVE_PWM 52 select HAVE_PWM
53 select PXA3xx
42 54
43config MACH_ZYLONITE300 55config MACH_ZYLONITE300
44 bool "PXA3xx Development Platform (aka Zylonite) PXA300/310" 56 bool "PXA3xx Development Platform (aka Zylonite) PXA300/310"
@@ -53,19 +65,19 @@ config MACH_ZYLONITE320
53 65
54config MACH_LITTLETON 66config MACH_LITTLETON
55 bool "PXA3xx Form Factor Platform (aka Littleton)" 67 bool "PXA3xx Form Factor Platform (aka Littleton)"
56 select PXA3xx
57 select CPU_PXA300 68 select CPU_PXA300
58 select CPU_PXA310 69 select CPU_PXA310
70 select PXA3xx
59 71
60config MACH_TAVOREVB 72config MACH_TAVOREVB
61 bool "PXA930 Evaluation Board (aka TavorEVB)" 73 bool "PXA930 Evaluation Board (aka TavorEVB)"
62 select PXA3xx
63 select CPU_PXA930 74 select CPU_PXA930
75 select PXA3xx
64 76
65config MACH_SAAR 77config MACH_SAAR
66 bool "PXA930 Handheld Platform (aka SAAR)" 78 bool "PXA930 Handheld Platform (aka SAAR)"
67 select PXA3xx
68 select CPU_PXA930 79 select CPU_PXA930
80 select PXA3xx
69 81
70comment "Third Party Dev Platforms (sorted by vendor name)" 82comment "Third Party Dev Platforms (sorted by vendor name)"
71 83
@@ -75,29 +87,29 @@ config ARCH_PXA_IDP
75 87
76config ARCH_VIPER 88config ARCH_VIPER
77 bool "Arcom/Eurotech VIPER SBC" 89 bool "Arcom/Eurotech VIPER SBC"
78 select PXA25x 90 select ARCOM_PCMCIA
79 select ISA
80 select I2C_GPIO
81 select HAVE_PWM 91 select HAVE_PWM
92 select I2C_GPIO
93 select ISA
94 select PXA25x
82 select PXA_HAVE_ISA_IRQS 95 select PXA_HAVE_ISA_IRQS
83 select ARCOM_PCMCIA
84 96
85config MACH_ARCOM_ZEUS 97config MACH_ARCOM_ZEUS
86 bool "Arcom/Eurotech ZEUS SBC" 98 bool "Arcom/Eurotech ZEUS SBC"
87 select PXA27x 99 select ARCOM_PCMCIA
88 select ISA 100 select ISA
101 select PXA27x
89 select PXA_HAVE_ISA_IRQS 102 select PXA_HAVE_ISA_IRQS
90 select ARCOM_PCMCIA
91 103
92config MACH_BALLOON3 104config MACH_BALLOON3
93 bool "Balloon 3 board" 105 bool "Balloon 3 board"
94 select PXA27x
95 select IWMMXT 106 select IWMMXT
107 select PXA27x
96 108
97config MACH_CSB726 109config MACH_CSB726
98 bool "Enable Cogent CSB726 System On a Module" 110 bool "Enable Cogent CSB726 System On a Module"
99 select PXA27x
100 select IWMMXT 111 select IWMMXT
112 select PXA27x
101 help 113 help
102 Say Y here if you intend to run this kernel on a Cogent 114 Say Y here if you intend to run this kernel on a Cogent
103 CSB726 System On Module. 115 CSB726 System On Module.
@@ -109,11 +121,11 @@ config CSB726_CSB701
109config MACH_ARMCORE 121config MACH_ARMCORE
110 bool "CompuLab CM-X255/CM-X270 modules" 122 bool "CompuLab CM-X255/CM-X270 modules"
111 select ARCH_HAS_DMA_SET_COHERENT_MASK if PCI 123 select ARCH_HAS_DMA_SET_COHERENT_MASK if PCI
112 select PXA27x
113 select IWMMXT 124 select IWMMXT
114 select PXA25x
115 select MIGHT_HAVE_PCI 125 select MIGHT_HAVE_PCI
116 select NEED_MACH_IO_H if PCI 126 select NEED_MACH_IO_H if PCI
127 select PXA25x
128 select PXA27x
117 129
118config MACH_EM_X270 130config MACH_EM_X270
119 bool "CompuLab EM-x270 platform" 131 bool "CompuLab EM-x270 platform"
@@ -125,10 +137,10 @@ config MACH_EXEDA
125 137
126config MACH_CM_X300 138config MACH_CM_X300
127 bool "CompuLab CM-X300 modules" 139 bool "CompuLab CM-X300 modules"
128 select PXA3xx
129 select CPU_PXA300 140 select CPU_PXA300
130 select CPU_PXA310 141 select CPU_PXA310
131 select HAVE_PWM 142 select HAVE_PWM
143 select PXA3xx
132 144
133config MACH_CAPC7117 145config MACH_CAPC7117
134 bool "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM" 146 bool "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM"
@@ -156,22 +168,22 @@ endchoice
156 168
157config MACH_INTELMOTE2 169config MACH_INTELMOTE2
158 bool "Intel Mote 2 Platform" 170 bool "Intel Mote 2 Platform"
159 select PXA27x
160 select IWMMXT 171 select IWMMXT
172 select PXA27x
161 173
162config MACH_STARGATE2 174config MACH_STARGATE2
163 bool "Intel Stargate 2 Platform" 175 bool "Intel Stargate 2 Platform"
164 select PXA27x
165 select IWMMXT 176 select IWMMXT
177 select PXA27x
166 178
167config MACH_XCEP 179config MACH_XCEP
168 bool "Iskratel Electronics XCEP" 180 bool "Iskratel Electronics XCEP"
169 select PXA25x
170 select MTD 181 select MTD
171 select MTD_PHYSMAP
172 select MTD_CFI_INTELEXT
173 select MTD_CFI 182 select MTD_CFI
183 select MTD_CFI_INTELEXT
174 select MTD_CHAR 184 select MTD_CHAR
185 select MTD_PHYSMAP
186 select PXA25x
175 select SMC91X 187 select SMC91X
176 help 188 help
177 PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash. 189 PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash.
@@ -183,14 +195,14 @@ config TRIZEPS_PXA
183config MACH_TRIZEPS4 195config MACH_TRIZEPS4
184 bool "Keith und Koep Trizeps4 DIMM-Module" 196 bool "Keith und Koep Trizeps4 DIMM-Module"
185 depends on TRIZEPS_PXA 197 depends on TRIZEPS_PXA
186 select TRIZEPS_PCMCIA
187 select PXA27x 198 select PXA27x
199 select TRIZEPS_PCMCIA
188 200
189config MACH_TRIZEPS4WL 201config MACH_TRIZEPS4WL
190 bool "Keith und Koep Trizeps4-WL DIMM-Module" 202 bool "Keith und Koep Trizeps4-WL DIMM-Module"
191 depends on TRIZEPS_PXA 203 depends on TRIZEPS_PXA
192 select TRIZEPS_PCMCIA
193 select PXA27x 204 select PXA27x
205 select TRIZEPS_PCMCIA
194 206
195choice 207choice
196 prompt "Select base board for Trizeps module" 208 prompt "Select base board for Trizeps module"
@@ -219,18 +231,18 @@ config TRIZEPS_PCMCIA
219 231
220config MACH_LOGICPD_PXA270 232config MACH_LOGICPD_PXA270
221 bool "LogicPD PXA270 Card Engine Development Platform" 233 bool "LogicPD PXA270 Card Engine Development Platform"
222 select PXA27x
223 select HAVE_PWM 234 select HAVE_PWM
235 select PXA27x
224 236
225config MACH_PCM027 237config MACH_PCM027
226 bool "Phytec phyCORE-PXA270 CPU module (PCM-027)" 238 bool "Phytec phyCORE-PXA270 CPU module (PCM-027)"
227 select PXA27x
228 select IWMMXT 239 select IWMMXT
240 select PXA27x
229 241
230config MACH_PCM990_BASEBOARD 242config MACH_PCM990_BASEBOARD
231 bool "PHYTEC PCM-990 development board" 243 bool "PHYTEC PCM-990 development board"
232 select HAVE_PWM
233 depends on MACH_PCM027 244 depends on MACH_PCM027
245 select HAVE_PWM
234 246
235choice 247choice
236 prompt "display on pcm990" 248 prompt "display on pcm990"
@@ -254,19 +266,19 @@ config MACH_COLIBRI
254config MACH_COLIBRI_PXA270_INCOME 266config MACH_COLIBRI_PXA270_INCOME
255 bool "Income s.r.o. PXA270 SBC" 267 bool "Income s.r.o. PXA270 SBC"
256 depends on MACH_COLIBRI 268 depends on MACH_COLIBRI
257 select PXA27x
258 select HAVE_PWM 269 select HAVE_PWM
270 select PXA27x
259 271
260config MACH_COLIBRI300 272config MACH_COLIBRI300
261 bool "Toradex Colibri PXA300/310" 273 bool "Toradex Colibri PXA300/310"
262 select PXA3xx
263 select CPU_PXA300 274 select CPU_PXA300
264 select CPU_PXA310 275 select CPU_PXA310
276 select PXA3xx
265 277
266config MACH_COLIBRI320 278config MACH_COLIBRI320
267 bool "Toradex Colibri PXA320" 279 bool "Toradex Colibri PXA320"
268 select PXA3xx
269 select CPU_PXA320 280 select CPU_PXA320
281 select PXA3xx
270 282
271config MACH_COLIBRI_EVALBOARD 283config MACH_COLIBRI_EVALBOARD
272 bool "Toradex Colibri Evaluation Carrier Board support" 284 bool "Toradex Colibri Evaluation Carrier Board support"
@@ -274,8 +286,8 @@ config MACH_COLIBRI_EVALBOARD
274 286
275config MACH_VPAC270 287config MACH_VPAC270
276 bool "Voipac PXA270" 288 bool "Voipac PXA270"
277 select PXA27x
278 select HAVE_PATA_PLATFORM 289 select HAVE_PATA_PLATFORM
290 select PXA27x
279 help 291 help
280 PXA270 based Single Board Computer. 292 PXA270 based Single Board Computer.
281 293
@@ -283,9 +295,9 @@ comment "End-user Products (sorted by vendor name)"
283 295
284config MACH_H4700 296config MACH_H4700
285 bool "HP iPAQ hx4700" 297 bool "HP iPAQ hx4700"
286 select PXA27x
287 select IWMMXT
288 select HAVE_PWM 298 select HAVE_PWM
299 select IWMMXT
300 select PXA27x
289 301
290config MACH_H5000 302config MACH_H5000
291 bool "HP iPAQ h5000" 303 bool "HP iPAQ h5000"
@@ -297,16 +309,16 @@ config MACH_HIMALAYA
297 309
298config MACH_MAGICIAN 310config MACH_MAGICIAN
299 bool "Enable HTC Magician Support" 311 bool "Enable HTC Magician Support"
300 select PXA27x
301 select IWMMXT
302 select HAVE_PWM 312 select HAVE_PWM
313 select IWMMXT
314 select PXA27x
303 315
304config MACH_MIOA701 316config MACH_MIOA701
305 bool "Mitac Mio A701 Support" 317 bool "Mitac Mio A701 Support"
306 select PXA27x
307 select IWMMXT
308 select HAVE_PWM
309 select GPIO_SYSFS 318 select GPIO_SYSFS
319 select HAVE_PWM
320 select IWMMXT
321 select PXA27x
310 help 322 help
311 Say Y here if you intend to run this kernel on a 323 Say Y here if you intend to run this kernel on a
312 MIO A701. Currently there is only basic support 324 MIO A701. Currently there is only basic support
@@ -314,9 +326,9 @@ config MACH_MIOA701
314 326
315config PXA_EZX 327config PXA_EZX
316 bool "Motorola EZX Platform" 328 bool "Motorola EZX Platform"
317 select PXA27x
318 select IWMMXT
319 select HAVE_PWM 329 select HAVE_PWM
330 select IWMMXT
331 select PXA27x
320 332
321config MACH_EZX_A780 333config MACH_EZX_A780
322 bool "Motorola EZX A780" 334 bool "Motorola EZX A780"
@@ -381,9 +393,9 @@ config MACH_PALMT5
381 bool "Palm Tungsten|T5" 393 bool "Palm Tungsten|T5"
382 default y 394 default y
383 depends on ARCH_PXA_PALM 395 depends on ARCH_PXA_PALM
384 select PXA27x
385 select IWMMXT 396 select IWMMXT
386 select MACH_PALM27X 397 select MACH_PALM27X
398 select PXA27x
387 help 399 help
388 Say Y here if you intend to run this kernel on a Palm Tungsten|T5 400 Say Y here if you intend to run this kernel on a Palm Tungsten|T5
389 handheld computer. 401 handheld computer.
@@ -392,9 +404,9 @@ config MACH_PALMTX
392 bool "Palm T|X" 404 bool "Palm T|X"
393 default y 405 default y
394 depends on ARCH_PXA_PALM 406 depends on ARCH_PXA_PALM
395 select PXA27x
396 select IWMMXT 407 select IWMMXT
397 select MACH_PALM27X 408 select MACH_PALM27X
409 select PXA27x
398 help 410 help
399 Say Y here if you intend to run this kernel on a Palm T|X 411 Say Y here if you intend to run this kernel on a Palm T|X
400 handheld computer. 412 handheld computer.
@@ -403,9 +415,9 @@ config MACH_PALMZ72
403 bool "Palm Zire 72" 415 bool "Palm Zire 72"
404 default y 416 default y
405 depends on ARCH_PXA_PALM 417 depends on ARCH_PXA_PALM
406 select PXA27x
407 select IWMMXT 418 select IWMMXT
408 select MACH_PALM27X 419 select MACH_PALM27X
420 select PXA27x
409 help 421 help
410 Say Y here if you intend to run this kernel on Palm Zire 72 422 Say Y here if you intend to run this kernel on Palm Zire 72
411 handheld computer. 423 handheld computer.
@@ -414,9 +426,9 @@ config MACH_PALMLD
414 bool "Palm LifeDrive" 426 bool "Palm LifeDrive"
415 default y 427 default y
416 depends on ARCH_PXA_PALM 428 depends on ARCH_PXA_PALM
417 select PXA27x
418 select IWMMXT 429 select IWMMXT
419 select MACH_PALM27X 430 select MACH_PALM27X
431 select PXA27x
420 help 432 help
421 Say Y here if you intend to run this kernel on a Palm LifeDrive 433 Say Y here if you intend to run this kernel on a Palm LifeDrive
422 handheld computer. 434 handheld computer.
@@ -429,10 +441,10 @@ config MACH_CENTRO
429 bool "Palm Centro 685 (GSM)" 441 bool "Palm Centro 685 (GSM)"
430 default y 442 default y
431 depends on ARCH_PXA_PALM 443 depends on ARCH_PXA_PALM
432 select MACH_PALM27X
433 select PXA27x
434 select IWMMXT 444 select IWMMXT
445 select MACH_PALM27X
435 select PALM_TREO 446 select PALM_TREO
447 select PXA27x
436 help 448 help
437 Say Y here if you intend to run this kernel on Palm Centro 685 (GSM) 449 Say Y here if you intend to run this kernel on Palm Centro 685 (GSM)
438 smartphone. 450 smartphone.
@@ -441,37 +453,37 @@ config MACH_TREO680
441 bool "Palm Treo 680" 453 bool "Palm Treo 680"
442 default y 454 default y
443 depends on ARCH_PXA_PALM 455 depends on ARCH_PXA_PALM
444 select MACH_PALM27X
445 select PXA27x
446 select IWMMXT 456 select IWMMXT
457 select MACH_PALM27X
447 select PALM_TREO 458 select PALM_TREO
459 select PXA27x
448 help 460 help
449 Say Y here if you intend to run this kernel on Palm Treo 680 461 Say Y here if you intend to run this kernel on Palm Treo 680
450 smartphone. 462 smartphone.
451 463
452config MACH_RAUMFELD_RC 464config MACH_RAUMFELD_RC
453 bool "Raumfeld Controller" 465 bool "Raumfeld Controller"
454 select PXA3xx
455 select CPU_PXA300 466 select CPU_PXA300
456 select POWER_SUPPLY
457 select HAVE_PWM 467 select HAVE_PWM
468 select POWER_SUPPLY
469 select PXA3xx
458 470
459config MACH_RAUMFELD_CONNECTOR 471config MACH_RAUMFELD_CONNECTOR
460 bool "Raumfeld Connector" 472 bool "Raumfeld Connector"
473 select CPU_PXA300
461 select POWER_SUPPLY 474 select POWER_SUPPLY
462 select PXA3xx 475 select PXA3xx
463 select CPU_PXA300
464 476
465config MACH_RAUMFELD_SPEAKER 477config MACH_RAUMFELD_SPEAKER
466 bool "Raumfeld Speaker" 478 bool "Raumfeld Speaker"
479 select CPU_PXA300
467 select POWER_SUPPLY 480 select POWER_SUPPLY
468 select PXA3xx 481 select PXA3xx
469 select CPU_PXA300
470 482
471config PXA_SHARPSL 483config PXA_SHARPSL
472 bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models" 484 bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models"
473 select SHARP_SCOOP
474 select SHARP_PARAM 485 select SHARP_PARAM
486 select SHARP_SCOOP
475 help 487 help
476 Say Y here if you intend to run this kernel on a 488 Say Y here if you intend to run this kernel on a
477 Sharp Zaurus SL-5600 (Poodle), SL-C700 (Corgi), 489 Sharp Zaurus SL-5600 (Poodle), SL-C700 (Corgi),
@@ -514,11 +526,11 @@ config MACH_HUSKY
514config MACH_AKITA 526config MACH_AKITA
515 bool "Enable Sharp SL-1000 (Akita) Support" 527 bool "Enable Sharp SL-1000 (Akita) Support"
516 depends on PXA_SHARPSL 528 depends on PXA_SHARPSL
517 select PXA27x
518 select PXA_SHARP_Cxx00
519 select MACH_SPITZ
520 select I2C 529 select I2C
521 select I2C_PXA 530 select I2C_PXA
531 select MACH_SPITZ
532 select PXA27x
533 select PXA_SHARP_Cxx00
522 534
523config MACH_SPITZ 535config MACH_SPITZ
524 bool "Enable Sharp Zaurus SL-3000 (Spitz) Support" 536 bool "Enable Sharp Zaurus SL-3000 (Spitz) Support"
@@ -563,8 +575,8 @@ config MACH_ICONTROL
563 575
564config ARCH_PXA_ESERIES 576config ARCH_PXA_ESERIES
565 bool "PXA based Toshiba e-series PDAs" 577 bool "PXA based Toshiba e-series PDAs"
566 select PXA25x
567 select FB_W100 578 select FB_W100
579 select PXA25x
568 580
569config MACH_E330 581config MACH_E330
570 bool "Toshiba e330" 582 bool "Toshiba e330"
@@ -616,8 +628,8 @@ config MACH_E800
616 628
617config MACH_ZIPIT2 629config MACH_ZIPIT2
618 bool "Zipit Z2 Handheld" 630 bool "Zipit Z2 Handheld"
619 select PXA27x
620 select HAVE_PWM 631 select HAVE_PWM
632 select PXA27x
621endif 633endif
622endmenu 634endmenu
623 635
@@ -708,9 +720,9 @@ config SHARPSL_PM
708config SHARPSL_PM_MAX1111 720config SHARPSL_PM_MAX1111
709 bool 721 bool
710 select HWMON 722 select HWMON
723 select SENSORS_MAX1111
711 select SPI 724 select SPI
712 select SPI_MASTER 725 select SPI_MASTER
713 select SENSORS_MAX1111
714 726
715config PXA_HAVE_ISA_IRQS 727config PXA_HAVE_ISA_IRQS
716 bool 728 bool
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index be0f7df8685..ee88d6eae64 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -26,6 +26,9 @@ obj-$(CONFIG_CPU_PXA930) += pxa930.o
26 26
27# NOTE: keep the order of boards in accordance to their order in Kconfig 27# NOTE: keep the order of boards in accordance to their order in Kconfig
28 28
29# Device Tree support
30obj-$(CONFIG_MACH_PXA3XX_DT) += pxa-dt.o
31
29# Intel/Marvell Dev Platforms 32# Intel/Marvell Dev Platforms
30obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o 33obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
31obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o 34obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
@@ -95,12 +98,4 @@ obj-$(CONFIG_MACH_RAUMFELD_CONNECTOR) += raumfeld.o
95obj-$(CONFIG_MACH_RAUMFELD_SPEAKER) += raumfeld.o 98obj-$(CONFIG_MACH_RAUMFELD_SPEAKER) += raumfeld.o
96obj-$(CONFIG_MACH_ZIPIT2) += z2.o 99obj-$(CONFIG_MACH_ZIPIT2) += z2.o
97 100
98# Support for blinky lights
99led-y := leds.o
100led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o
101led-$(CONFIG_MACH_MAINSTONE) += leds-mainstone.o
102led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o
103
104obj-$(CONFIG_LEDS) += $(led-y)
105
106obj-$(CONFIG_TOSA_BT) += tosa-bt.o 101obj-$(CONFIG_TOSA_BT) += tosa-bt.o
diff --git a/arch/arm/mach-pxa/am200epd.c b/arch/arm/mach-pxa/am200epd.c
index ccdac4b6a46..ffa6d811aad 100644
--- a/arch/arm/mach-pxa/am200epd.c
+++ b/arch/arm/mach-pxa/am200epd.c
@@ -32,7 +32,7 @@
32 32
33#include <mach/pxa25x.h> 33#include <mach/pxa25x.h>
34#include <mach/gumstix.h> 34#include <mach/gumstix.h>
35#include <mach/pxafb.h> 35#include <linux/platform_data/video-pxafb.h>
36 36
37#include "generic.h" 37#include "generic.h"
38 38
diff --git a/arch/arm/mach-pxa/am300epd.c b/arch/arm/mach-pxa/am300epd.c
index 76c4b949403..3dfec1ec462 100644
--- a/arch/arm/mach-pxa/am300epd.c
+++ b/arch/arm/mach-pxa/am300epd.c
@@ -30,7 +30,7 @@
30 30
31#include <mach/gumstix.h> 31#include <mach/gumstix.h>
32#include <mach/mfp-pxa25x.h> 32#include <mach/mfp-pxa25x.h>
33#include <mach/pxafb.h> 33#include <linux/platform_data/video-pxafb.h>
34 34
35#include "generic.h" 35#include "generic.h"
36 36
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index 9244493dbcb..20822934251 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -45,12 +45,12 @@
45#include <mach/pxa27x.h> 45#include <mach/pxa27x.h>
46#include <mach/balloon3.h> 46#include <mach/balloon3.h>
47#include <mach/audio.h> 47#include <mach/audio.h>
48#include <mach/pxafb.h> 48#include <linux/platform_data/video-pxafb.h>
49#include <mach/mmc.h> 49#include <linux/platform_data/mmc-pxamci.h>
50#include <mach/udc.h> 50#include <mach/udc.h>
51#include <mach/pxa27x-udc.h> 51#include <mach/pxa27x-udc.h>
52#include <mach/irda.h> 52#include <linux/platform_data/irda-pxaficp.h>
53#include <mach/ohci.h> 53#include <linux/platform_data/usb-ohci-pxa27x.h>
54 54
55#include "generic.h" 55#include "generic.h"
56#include "devices.h" 56#include "devices.h"
diff --git a/arch/arm/mach-pxa/clock-pxa3xx.c b/arch/arm/mach-pxa/clock-pxa3xx.c
index 2a37a9a8f62..d4e9499832d 100644
--- a/arch/arm/mach-pxa/clock-pxa3xx.c
+++ b/arch/arm/mach-pxa/clock-pxa3xx.c
@@ -127,8 +127,10 @@ void clk_pxa3xx_cken_enable(struct clk *clk)
127 127
128 if (clk->cken < 32) 128 if (clk->cken < 32)
129 CKENA |= mask; 129 CKENA |= mask;
130 else 130 else if (clk->cken < 64)
131 CKENB |= mask; 131 CKENB |= mask;
132 else
133 CKENC |= mask;
132} 134}
133 135
134void clk_pxa3xx_cken_disable(struct clk *clk) 136void clk_pxa3xx_cken_disable(struct clk *clk)
@@ -137,8 +139,10 @@ void clk_pxa3xx_cken_disable(struct clk *clk)
137 139
138 if (clk->cken < 32) 140 if (clk->cken < 32)
139 CKENA &= ~mask; 141 CKENA &= ~mask;
140 else 142 else if (clk->cken < 64)
141 CKENB &= ~mask; 143 CKENB &= ~mask;
144 else
145 CKENC &= ~mask;
142} 146}
143 147
144const struct clkops clk_pxa3xx_cken_ops = { 148const struct clkops clk_pxa3xx_cken_ops = {
diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
index 431ef56700c..2503db9e325 100644
--- a/arch/arm/mach-pxa/cm-x270.c
+++ b/arch/arm/mach-pxa/cm-x270.c
@@ -22,8 +22,8 @@
22#include <linux/spi/libertas_spi.h> 22#include <linux/spi/libertas_spi.h>
23 23
24#include <mach/pxa27x.h> 24#include <mach/pxa27x.h>
25#include <mach/ohci.h> 25#include <linux/platform_data/usb-ohci-pxa27x.h>
26#include <mach/mmc.h> 26#include <linux/platform_data/mmc-pxamci.h>
27 27
28#include "generic.h" 28#include "generic.h"
29 29
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index 8fa4ad27edf..a103c8ffea9 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -22,9 +22,10 @@
22#include <asm/mach/map.h> 22#include <asm/mach/map.h>
23 23
24#include <mach/pxa25x.h> 24#include <mach/pxa25x.h>
25#undef GPIO24_SSP1_SFRM
25#include <mach/pxa27x.h> 26#include <mach/pxa27x.h>
26#include <mach/audio.h> 27#include <mach/audio.h>
27#include <mach/pxafb.h> 28#include <linux/platform_data/video-pxafb.h>
28#include <mach/smemc.h> 29#include <mach/smemc.h>
29 30
30#include <asm/hardware/it8152.h> 31#include <asm/hardware/it8152.h>
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 3e4e9fe2d46..cc2b23afcaa 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -48,12 +48,12 @@
48 48
49#include <mach/pxa300.h> 49#include <mach/pxa300.h>
50#include <mach/pxa27x-udc.h> 50#include <mach/pxa27x-udc.h>
51#include <mach/pxafb.h> 51#include <linux/platform_data/video-pxafb.h>
52#include <mach/mmc.h> 52#include <linux/platform_data/mmc-pxamci.h>
53#include <mach/ohci.h> 53#include <linux/platform_data/usb-ohci-pxa27x.h>
54#include <plat/pxa3xx_nand.h> 54#include <linux/platform_data/mtd-nand-pxa3xx.h>
55#include <mach/audio.h> 55#include <mach/audio.h>
56#include <mach/pxa3xx-u2d.h> 56#include <linux/platform_data/usb-pxa3xx-ulpi.h>
57 57
58#include <asm/mach/map.h> 58#include <asm/mach/map.h>
59 59
diff --git a/arch/arm/mach-pxa/colibri-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c
index d28e802e244..8404b24240e 100644
--- a/arch/arm/mach-pxa/colibri-evalboard.c
+++ b/arch/arm/mach-pxa/colibri-evalboard.c
@@ -23,8 +23,8 @@
23 23
24#include <mach/pxa27x.h> 24#include <mach/pxa27x.h>
25#include <mach/colibri.h> 25#include <mach/colibri.h>
26#include <mach/mmc.h> 26#include <linux/platform_data/mmc-pxamci.h>
27#include <mach/ohci.h> 27#include <linux/platform_data/usb-ohci-pxa27x.h>
28#include <mach/pxa27x-udc.h> 28#include <mach/pxa27x-udc.h>
29 29
30#include "generic.h" 30#include "generic.h"
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
index 248804bb2c9..2d4a7b4d5d7 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-income.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -27,11 +27,11 @@
27#include <asm/mach-types.h> 27#include <asm/mach-types.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/mmc.h> 30#include <linux/platform_data/mmc-pxamci.h>
31#include <mach/ohci.h> 31#include <linux/platform_data/usb-ohci-pxa27x.h>
32#include <mach/pxa27x.h> 32#include <mach/pxa27x.h>
33#include <mach/pxa27x-udc.h> 33#include <mach/pxa27x-udc.h>
34#include <mach/pxafb.h> 34#include <linux/platform_data/video-pxafb.h>
35 35
36#include "devices.h" 36#include "devices.h"
37#include "generic.h" 37#include "generic.h"
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index bb6def8ec97..a9c9c163dd9 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -24,8 +24,8 @@
24 24
25#include <mach/pxa300.h> 25#include <mach/pxa300.h>
26#include <mach/colibri.h> 26#include <mach/colibri.h>
27#include <mach/ohci.h> 27#include <linux/platform_data/usb-ohci-pxa27x.h>
28#include <mach/pxafb.h> 28#include <linux/platform_data/video-pxafb.h>
29#include <mach/audio.h> 29#include <mach/audio.h>
30 30
31#include "generic.h" 31#include "generic.h"
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index d88e7b37f1d..25515cd7e68 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -25,8 +25,8 @@
25 25
26#include <mach/pxa320.h> 26#include <mach/pxa320.h>
27#include <mach/colibri.h> 27#include <mach/colibri.h>
28#include <mach/pxafb.h> 28#include <linux/platform_data/video-pxafb.h>
29#include <mach/ohci.h> 29#include <linux/platform_data/usb-ohci-pxa27x.h>
30#include <mach/audio.h> 30#include <mach/audio.h>
31#include <mach/pxa27x-udc.h> 31#include <mach/pxa27x-udc.h>
32#include <mach/udc.h> 32#include <mach/udc.h>
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c
index 68cc75fac21..8240291ab8c 100644
--- a/arch/arm/mach-pxa/colibri-pxa3xx.c
+++ b/arch/arm/mach-pxa/colibri-pxa3xx.c
@@ -24,9 +24,9 @@
24#include <mach/pxa3xx-regs.h> 24#include <mach/pxa3xx-regs.h>
25#include <mach/mfp-pxa300.h> 25#include <mach/mfp-pxa300.h>
26#include <mach/colibri.h> 26#include <mach/colibri.h>
27#include <mach/mmc.h> 27#include <linux/platform_data/mmc-pxamci.h>
28#include <mach/pxafb.h> 28#include <linux/platform_data/video-pxafb.h>
29#include <plat/pxa3xx_nand.h> 29#include <linux/platform_data/mtd-nand-pxa3xx.h>
30 30
31#include "generic.h" 31#include "generic.h"
32#include "devices.h" 32#include "devices.h"
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index c1fe32db475..7c83f52c549 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -46,8 +46,8 @@
46#include <asm/mach/irq.h> 46#include <asm/mach/irq.h>
47 47
48#include <mach/pxa25x.h> 48#include <mach/pxa25x.h>
49#include <mach/irda.h> 49#include <linux/platform_data/irda-pxaficp.h>
50#include <mach/mmc.h> 50#include <linux/platform_data/mmc-pxamci.h>
51#include <mach/udc.h> 51#include <mach/udc.h>
52#include <mach/corgi.h> 52#include <mach/corgi.h>
53#include <mach/sharpsl_pm.h> 53#include <mach/sharpsl_pm.h>
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c
index 67f0de37f46..7039f44b364 100644
--- a/arch/arm/mach-pxa/csb726.c
+++ b/arch/arm/mach-pxa/csb726.c
@@ -23,8 +23,8 @@
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <mach/csb726.h> 24#include <mach/csb726.h>
25#include <mach/pxa27x.h> 25#include <mach/pxa27x.h>
26#include <mach/mmc.h> 26#include <linux/platform_data/mmc-pxamci.h>
27#include <mach/ohci.h> 27#include <linux/platform_data/usb-ohci-pxa27x.h>
28#include <mach/audio.h> 28#include <mach/audio.h>
29#include <mach/smemc.h> 29#include <mach/smemc.h>
30 30
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index 166eee5b8a7..ddaa04de8e2 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -6,19 +6,18 @@
6#include <linux/spi/pxa2xx_spi.h> 6#include <linux/spi/pxa2xx_spi.h>
7#include <linux/i2c/pxa-i2c.h> 7#include <linux/i2c/pxa-i2c.h>
8 8
9#include <asm/pmu.h>
10#include <mach/udc.h> 9#include <mach/udc.h>
11#include <mach/pxa3xx-u2d.h> 10#include <linux/platform_data/usb-pxa3xx-ulpi.h>
12#include <mach/pxafb.h> 11#include <linux/platform_data/video-pxafb.h>
13#include <mach/mmc.h> 12#include <linux/platform_data/mmc-pxamci.h>
14#include <mach/irda.h> 13#include <linux/platform_data/irda-pxaficp.h>
15#include <mach/irqs.h> 14#include <mach/irqs.h>
16#include <mach/ohci.h> 15#include <linux/platform_data/usb-ohci-pxa27x.h>
17#include <plat/pxa27x_keypad.h> 16#include <linux/platform_data/keypad-pxa27x.h>
18#include <mach/camera.h> 17#include <linux/platform_data/camera-pxa.h>
19#include <mach/audio.h> 18#include <mach/audio.h>
20#include <mach/hardware.h> 19#include <mach/hardware.h>
21#include <plat/pxa3xx_nand.h> 20#include <linux/platform_data/mtd-nand-pxa3xx.h>
22 21
23#include "devices.h" 22#include "devices.h"
24#include "generic.h" 23#include "generic.h"
@@ -42,7 +41,7 @@ static struct resource pxa_resource_pmu = {
42 41
43struct platform_device pxa_device_pmu = { 42struct platform_device pxa_device_pmu = {
44 .name = "arm-pmu", 43 .name = "arm-pmu",
45 .id = ARM_PMU_DEVICE_CPU, 44 .id = -1,
46 .resource = &pxa_resource_pmu, 45 .resource = &pxa_resource_pmu,
47 .num_resources = 1, 46 .num_resources = 1,
48}; 47};
@@ -384,9 +383,24 @@ struct platform_device pxa_device_asoc_platform = {
384 383
385static u64 pxaficp_dmamask = ~(u32)0; 384static u64 pxaficp_dmamask = ~(u32)0;
386 385
386static struct resource pxa_ir_resources[] = {
387 [0] = {
388 .start = IRQ_STUART,
389 .end = IRQ_STUART,
390 .flags = IORESOURCE_IRQ,
391 },
392 [1] = {
393 .start = IRQ_ICP,
394 .end = IRQ_ICP,
395 .flags = IORESOURCE_IRQ,
396 },
397};
398
387struct platform_device pxa_device_ficp = { 399struct platform_device pxa_device_ficp = {
388 .name = "pxa2xx-ir", 400 .name = "pxa2xx-ir",
389 .id = -1, 401 .id = -1,
402 .num_resources = ARRAY_SIZE(pxa_ir_resources),
403 .resource = pxa_ir_resources,
390 .dev = { 404 .dev = {
391 .dma_mask = &pxaficp_dmamask, 405 .dma_mask = &pxaficp_dmamask,
392 .coherent_dma_mask = 0xffffffff, 406 .coherent_dma_mask = 0xffffffff,
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index 97f82ad341b..1b6411439ec 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -42,11 +42,11 @@
42#include <mach/pxa27x.h> 42#include <mach/pxa27x.h>
43#include <mach/pxa27x-udc.h> 43#include <mach/pxa27x-udc.h>
44#include <mach/audio.h> 44#include <mach/audio.h>
45#include <mach/pxafb.h> 45#include <linux/platform_data/video-pxafb.h>
46#include <mach/ohci.h> 46#include <linux/platform_data/usb-ohci-pxa27x.h>
47#include <mach/mmc.h> 47#include <linux/platform_data/mmc-pxamci.h>
48#include <plat/pxa27x_keypad.h> 48#include <linux/platform_data/keypad-pxa27x.h>
49#include <mach/camera.h> 49#include <linux/platform_data/camera-pxa.h>
50 50
51#include "generic.h" 51#include "generic.h"
52#include "devices.h" 52#include "devices.h"
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index 4cb2391a782..be2ee9bf5c6 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -32,9 +32,9 @@
32#include <mach/eseries-gpio.h> 32#include <mach/eseries-gpio.h>
33#include <mach/eseries-irq.h> 33#include <mach/eseries-irq.h>
34#include <mach/audio.h> 34#include <mach/audio.h>
35#include <mach/pxafb.h> 35#include <linux/platform_data/video-pxafb.h>
36#include <mach/udc.h> 36#include <mach/udc.h>
37#include <mach/irda.h> 37#include <linux/platform_data/irda-pxaficp.h>
38 38
39#include "devices.h" 39#include "devices.h"
40#include "generic.h" 40#include "generic.h"
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 15ab2533667..dc58fa0edb6 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -29,11 +29,11 @@
29#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30 30
31#include <mach/pxa27x.h> 31#include <mach/pxa27x.h>
32#include <mach/pxafb.h> 32#include <linux/platform_data/video-pxafb.h>
33#include <mach/ohci.h> 33#include <linux/platform_data/usb-ohci-pxa27x.h>
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35#include <plat/pxa27x_keypad.h> 35#include <linux/platform_data/keypad-pxa27x.h>
36#include <mach/camera.h> 36#include <linux/platform_data/camera-pxa.h>
37 37
38#include "devices.h" 38#include "devices.h"
39#include "generic.h" 39#include "generic.h"
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
index e529a35a44c..60755a6bb1c 100644
--- a/arch/arm/mach-pxa/gumstix.c
+++ b/arch/arm/mach-pxa/gumstix.c
@@ -41,7 +41,7 @@
41#include <asm/mach/flash.h> 41#include <asm/mach/flash.h>
42 42
43#include <mach/pxa25x.h> 43#include <mach/pxa25x.h>
44#include <mach/mmc.h> 44#include <linux/platform_data/mmc-pxamci.h>
45#include <mach/udc.h> 45#include <mach/udc.h>
46#include <mach/gumstix.h> 46#include <mach/gumstix.h>
47 47
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index e6311988add..5ecbd17b564 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -45,7 +45,7 @@
45 45
46#include <mach/pxa27x.h> 46#include <mach/pxa27x.h>
47#include <mach/hx4700.h> 47#include <mach/hx4700.h>
48#include <mach/irda.h> 48#include <linux/platform_data/irda-pxaficp.h>
49 49
50#include <sound/ak4641.h> 50#include <sound/ak4641.h>
51#include <video/platform_lcd.h> 51#include <video/platform_lcd.h>
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index 6ff466bd43e..64507cdd2e8 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -33,9 +33,9 @@
33 33
34#include <mach/pxa25x.h> 34#include <mach/pxa25x.h>
35#include <mach/idp.h> 35#include <mach/idp.h>
36#include <mach/pxafb.h> 36#include <linux/platform_data/video-pxafb.h>
37#include <mach/bitfield.h> 37#include <mach/bitfield.h>
38#include <mach/mmc.h> 38#include <linux/platform_data/mmc-pxamci.h>
39 39
40#include "generic.h" 40#include "generic.h"
41#include "devices.h" 41#include "devices.h"
@@ -191,6 +191,87 @@ static void __init idp_map_io(void)
191 iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc)); 191 iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc));
192} 192}
193 193
194/* LEDs */
195#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
196struct idp_led {
197 struct led_classdev cdev;
198 u8 mask;
199};
200
201/*
202 * The triggers lines up below will only be used if the
203 * LED triggers are compiled in.
204 */
205static const struct {
206 const char *name;
207 const char *trigger;
208} idp_leds[] = {
209 { "idp:green", "heartbeat", },
210 { "idp:red", "cpu0", },
211};
212
213static void idp_led_set(struct led_classdev *cdev,
214 enum led_brightness b)
215{
216 struct idp_led *led = container_of(cdev,
217 struct idp_led, cdev);
218 u32 reg = IDP_CPLD_LED_CONTROL;
219
220 if (b != LED_OFF)
221 reg &= ~led->mask;
222 else
223 reg |= led->mask;
224
225 IDP_CPLD_LED_CONTROL = reg;
226}
227
228static enum led_brightness idp_led_get(struct led_classdev *cdev)
229{
230 struct idp_led *led = container_of(cdev,
231 struct idp_led, cdev);
232
233 return (IDP_CPLD_LED_CONTROL & led->mask) ? LED_OFF : LED_FULL;
234}
235
236static int __init idp_leds_init(void)
237{
238 int i;
239
240 if (!machine_is_pxa_idp())
241 return -ENODEV;
242
243 for (i = 0; i < ARRAY_SIZE(idp_leds); i++) {
244 struct idp_led *led;
245
246 led = kzalloc(sizeof(*led), GFP_KERNEL);
247 if (!led)
248 break;
249
250 led->cdev.name = idp_leds[i].name;
251 led->cdev.brightness_set = idp_led_set;
252 led->cdev.brightness_get = idp_led_get;
253 led->cdev.default_trigger = idp_leds[i].trigger;
254
255 if (i == 0)
256 led->mask = IDP_HB_LED;
257 else
258 led->mask = IDP_BUSY_LED;
259
260 if (led_classdev_register(NULL, &led->cdev) < 0) {
261 kfree(led);
262 break;
263 }
264 }
265
266 return 0;
267}
268
269/*
270 * Since we may have triggers on any subsystem, defer registration
271 * until after subsystem_init.
272 */
273fs_initcall(idp_leds_init);
274#endif
194 275
195MACHINE_START(PXA_IDP, "Vibren PXA255 IDP") 276MACHINE_START(PXA_IDP, "Vibren PXA255 IDP")
196 /* Maintainer: Vibren Technologies */ 277 /* Maintainer: Vibren Technologies */
diff --git a/arch/arm/mach-pxa/include/mach/arcom-pcmcia.h b/arch/arm/mach-pxa/include/mach/arcom-pcmcia.h
deleted file mode 100644
index d428be4db44..00000000000
--- a/arch/arm/mach-pxa/include/mach/arcom-pcmcia.h
+++ /dev/null
@@ -1,11 +0,0 @@
1#ifndef __ARCOM_PCMCIA_H
2#define __ARCOM_PCMCIA_H
3
4struct arcom_pcmcia_pdata {
5 int cd_gpio;
6 int rdy_gpio;
7 int pwr_gpio;
8 void (*reset)(int state);
9};
10
11#endif
diff --git a/arch/arm/mach-pxa/include/mach/camera.h b/arch/arm/mach-pxa/include/mach/camera.h
deleted file mode 100644
index 6709b1cd7c7..00000000000
--- a/arch/arm/mach-pxa/include/mach/camera.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 camera.h - PXA camera driver header file
3
4 Copyright (C) 2003, Intel Corporation
5 Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
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., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#ifndef __ASM_ARCH_CAMERA_H_
23#define __ASM_ARCH_CAMERA_H_
24
25#define PXA_CAMERA_MASTER 1
26#define PXA_CAMERA_DATAWIDTH_4 2
27#define PXA_CAMERA_DATAWIDTH_5 4
28#define PXA_CAMERA_DATAWIDTH_8 8
29#define PXA_CAMERA_DATAWIDTH_9 0x10
30#define PXA_CAMERA_DATAWIDTH_10 0x20
31#define PXA_CAMERA_PCLK_EN 0x40
32#define PXA_CAMERA_MCLK_EN 0x80
33#define PXA_CAMERA_PCP 0x100
34#define PXA_CAMERA_HSP 0x200
35#define PXA_CAMERA_VSP 0x400
36
37struct pxacamera_platform_data {
38 unsigned long flags;
39 unsigned long mclk_10khz;
40};
41
42extern void pxa_set_camera_info(struct pxacamera_platform_data *);
43
44#endif /* __ASM_ARCH_CAMERA_H_ */
diff --git a/arch/arm/mach-pxa/include/mach/irda.h b/arch/arm/mach-pxa/include/mach/irda.h
deleted file mode 100644
index 3cd41f77dda..00000000000
--- a/arch/arm/mach-pxa/include/mach/irda.h
+++ /dev/null
@@ -1,25 +0,0 @@
1#ifndef ASMARM_ARCH_IRDA_H
2#define ASMARM_ARCH_IRDA_H
3
4/* board specific transceiver capabilities */
5
6#define IR_OFF 1
7#define IR_SIRMODE 2
8#define IR_FIRMODE 4
9
10struct pxaficp_platform_data {
11 int transceiver_cap;
12 void (*transceiver_mode)(struct device *dev, int mode);
13 int (*startup)(struct device *dev);
14 void (*shutdown)(struct device *dev);
15 int gpio_pwdown; /* powerdown GPIO for the IrDA chip */
16 bool gpio_pwdown_inverted; /* gpio_pwdown is inverted */
17};
18
19extern void pxa_set_ficp_info(struct pxaficp_platform_data *info);
20
21#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
22void pxa2xx_transceiver_mode(struct device *dev, int mode);
23#endif
24
25#endif
diff --git a/arch/arm/mach-pxa/include/mach/mmc.h b/arch/arm/mach-pxa/include/mach/mmc.h
deleted file mode 100644
index 9eb515bb799..00000000000
--- a/arch/arm/mach-pxa/include/mach/mmc.h
+++ /dev/null
@@ -1,28 +0,0 @@
1#ifndef ASMARM_ARCH_MMC_H
2#define ASMARM_ARCH_MMC_H
3
4#include <linux/mmc/host.h>
5#include <linux/interrupt.h>
6
7struct device;
8struct mmc_host;
9
10struct pxamci_platform_data {
11 unsigned int ocr_mask; /* available voltages */
12 unsigned long detect_delay_ms; /* delay in millisecond before detecting cards after interrupt */
13 int (*init)(struct device *, irq_handler_t , void *);
14 int (*get_ro)(struct device *);
15 void (*setpower)(struct device *, unsigned int);
16 void (*exit)(struct device *, void *);
17 int gpio_card_detect; /* gpio detecting card insertion */
18 int gpio_card_ro; /* gpio detecting read only toggle */
19 bool gpio_card_ro_invert; /* gpio ro is inverted */
20 int gpio_power; /* gpio powering up MMC bus */
21 bool gpio_power_invert; /* gpio power is inverted */
22};
23
24extern void pxa_set_mci_info(struct pxamci_platform_data *info);
25extern void pxa3xx_set_mci2_info(struct pxamci_platform_data *info);
26extern void pxa3xx_set_mci3_info(struct pxamci_platform_data *info);
27
28#endif
diff --git a/arch/arm/mach-pxa/include/mach/ohci.h b/arch/arm/mach-pxa/include/mach/ohci.h
deleted file mode 100644
index 95b6e2a6e51..00000000000
--- a/arch/arm/mach-pxa/include/mach/ohci.h
+++ /dev/null
@@ -1,36 +0,0 @@
1#ifndef ASMARM_ARCH_OHCI_H
2#define ASMARM_ARCH_OHCI_H
3
4struct device;
5
6struct pxaohci_platform_data {
7 int (*init)(struct device *);
8 void (*exit)(struct device *);
9
10 unsigned long flags;
11#define ENABLE_PORT1 (1 << 0)
12#define ENABLE_PORT2 (1 << 1)
13#define ENABLE_PORT3 (1 << 2)
14#define ENABLE_PORT_ALL (ENABLE_PORT1 | ENABLE_PORT2 | ENABLE_PORT3)
15
16#define POWER_SENSE_LOW (1 << 3)
17#define POWER_CONTROL_LOW (1 << 4)
18#define NO_OC_PROTECTION (1 << 5)
19#define OC_MODE_GLOBAL (0 << 6)
20#define OC_MODE_PERPORT (1 << 6)
21
22 int power_on_delay; /* Power On to Power Good time - in ms
23 * HCD must wait for this duration before
24 * accessing a powered on port
25 */
26 int port_mode;
27#define PMM_NPS_MODE 1
28#define PMM_GLOBAL_MODE 2
29#define PMM_PERPORT_MODE 3
30
31 int power_budget;
32};
33
34extern void pxa_set_ohci_info(struct pxaohci_platform_data *info);
35
36#endif
diff --git a/arch/arm/mach-pxa/include/mach/palmasoc.h b/arch/arm/mach-pxa/include/mach/palmasoc.h
deleted file mode 100644
index 58afb30d529..00000000000
--- a/arch/arm/mach-pxa/include/mach/palmasoc.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _INCLUDE_PALMASOC_H_
2#define _INCLUDE_PALMASOC_H_
3
4struct palm27x_asoc_info {
5 int jack_gpio;
6};
7
8#endif
diff --git a/arch/arm/mach-pxa/include/mach/pata_pxa.h b/arch/arm/mach-pxa/include/mach/pata_pxa.h
deleted file mode 100644
index 6cf7df1d583..00000000000
--- a/arch/arm/mach-pxa/include/mach/pata_pxa.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * Generic PXA PATA driver
3 *
4 * Copyright (C) 2010 Marek Vasut <marek.vasut@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, or (at your option)
9 * 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; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef __MACH_PATA_PXA_H__
22#define __MACH_PATA_PXA_H__
23
24struct pata_pxa_pdata {
25 /* PXA DMA DREQ<0:2> pin */
26 uint32_t dma_dreq;
27 /* Register shift */
28 uint32_t reg_shift;
29 /* IRQ flags */
30 uint32_t irq_flags;
31};
32
33#endif /* __MACH_PATA_PXA_H__ */
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
index 207ecb49a61..f4d48d20754 100644
--- a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
+++ b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
@@ -131,6 +131,7 @@
131#define AICSR __REG(0x41340008) /* Application Subsystem Interrupt Control/Status Register */ 131#define AICSR __REG(0x41340008) /* Application Subsystem Interrupt Control/Status Register */
132#define CKENA __REG(0x4134000C) /* A Clock Enable Register */ 132#define CKENA __REG(0x4134000C) /* A Clock Enable Register */
133#define CKENB __REG(0x41340010) /* B Clock Enable Register */ 133#define CKENB __REG(0x41340010) /* B Clock Enable Register */
134#define CKENC __REG(0x41340024) /* C Clock Enable Register */
134#define AC97_DIV __REG(0x41340014) /* AC97 clock divisor value register */ 135#define AC97_DIV __REG(0x41340014) /* AC97 clock divisor value register */
135 136
136#define ACCR_XPDIS (1 << 31) /* Core PLL Output Disable */ 137#define ACCR_XPDIS (1 << 31) /* Core PLL Output Disable */
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h b/arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h
deleted file mode 100644
index 9d82cb65ea5..00000000000
--- a/arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * PXA3xx U2D header
3 *
4 * Copyright (C) 2010 CompuLab Ltd.
5 *
6 * Igor Grinberg <grinberg@compulab.co.il>
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#ifndef __PXA310_U2D__
13#define __PXA310_U2D__
14
15#include <linux/usb/ulpi.h>
16
17struct pxa3xx_u2d_platform_data {
18
19#define ULPI_SER_6PIN (1 << 0)
20#define ULPI_SER_3PIN (1 << 1)
21 unsigned int ulpi_mode;
22
23 int (*init)(struct device *);
24 void (*exit)(struct device *);
25};
26
27
28/* Start PXA3xx U2D host */
29int pxa3xx_u2d_start_hc(struct usb_bus *host);
30/* Stop PXA3xx U2D host */
31void pxa3xx_u2d_stop_hc(struct usb_bus *host);
32
33extern void pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info);
34
35#endif /* __PXA310_U2D__ */
diff --git a/arch/arm/mach-pxa/include/mach/pxa930_rotary.h b/arch/arm/mach-pxa/include/mach/pxa930_rotary.h
deleted file mode 100644
index 053587caffd..00000000000
--- a/arch/arm/mach-pxa/include/mach/pxa930_rotary.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef __ASM_ARCH_PXA930_ROTARY_H
2#define __ASM_ARCH_PXA930_ROTARY_H
3
4/* NOTE:
5 *
6 * rotary can be either interpreted as a ralative input event (e.g.
7 * REL_WHEEL or REL_HWHEEL) or a specific key event (e.g. UP/DOWN
8 * or LEFT/RIGHT), depending on if up_key & down_key are assigned
9 * or rel_code is assigned a non-zero value. When all are non-zero,
10 * up_key and down_key will be preferred.
11 */
12struct pxa930_rotary_platform_data {
13 int up_key;
14 int down_key;
15 int rel_code;
16};
17
18void __init pxa930_set_rotarykey_info(struct pxa930_rotary_platform_data *info);
19
20#endif /* __ASM_ARCH_PXA930_ROTARY_H */
diff --git a/arch/arm/mach-pxa/include/mach/pxa930_trkball.h b/arch/arm/mach-pxa/include/mach/pxa930_trkball.h
deleted file mode 100644
index 5e0789bc472..00000000000
--- a/arch/arm/mach-pxa/include/mach/pxa930_trkball.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef __ASM_ARCH_PXA930_TRKBALL_H
2#define __ASM_ARCH_PXA930_TRKBALL_H
3
4struct pxa930_trkball_platform_data {
5 int x_filter;
6 int y_filter;
7};
8
9#endif /* __ASM_ARCH_PXA930_TRKBALL_H */
10
diff --git a/arch/arm/mach-pxa/include/mach/pxafb.h b/arch/arm/mach-pxa/include/mach/pxafb.h
deleted file mode 100644
index 486b4c519ae..00000000000
--- a/arch/arm/mach-pxa/include/mach/pxafb.h
+++ /dev/null
@@ -1,175 +0,0 @@
1/*
2 * arch/arm/mach-pxa/include/mach/pxafb.h
3 *
4 * Support for the xscale frame buffer.
5 *
6 * Author: Jean-Frederic Clere
7 * Created: Sep 22, 2003
8 * Copyright: jfclere@sinix.net
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/fb.h>
16#include <mach/regs-lcd.h>
17
18/*
19 * Supported LCD connections
20 *
21 * bits 0 - 3: for LCD panel type:
22 *
23 * STN - for passive matrix
24 * DSTN - for dual scan passive matrix
25 * TFT - for active matrix
26 *
27 * bits 4 - 9 : for bus width
28 * bits 10-17 : for AC Bias Pin Frequency
29 * bit 18 : for output enable polarity
30 * bit 19 : for pixel clock edge
31 * bit 20 : for output pixel format when base is RGBT16
32 */
33#define LCD_CONN_TYPE(_x) ((_x) & 0x0f)
34#define LCD_CONN_WIDTH(_x) (((_x) >> 4) & 0x1f)
35
36#define LCD_TYPE_MASK 0xf
37#define LCD_TYPE_UNKNOWN 0
38#define LCD_TYPE_MONO_STN 1
39#define LCD_TYPE_MONO_DSTN 2
40#define LCD_TYPE_COLOR_STN 3
41#define LCD_TYPE_COLOR_DSTN 4
42#define LCD_TYPE_COLOR_TFT 5
43#define LCD_TYPE_SMART_PANEL 6
44#define LCD_TYPE_MAX 7
45
46#define LCD_MONO_STN_4BPP ((4 << 4) | LCD_TYPE_MONO_STN)
47#define LCD_MONO_STN_8BPP ((8 << 4) | LCD_TYPE_MONO_STN)
48#define LCD_MONO_DSTN_8BPP ((8 << 4) | LCD_TYPE_MONO_DSTN)
49#define LCD_COLOR_STN_8BPP ((8 << 4) | LCD_TYPE_COLOR_STN)
50#define LCD_COLOR_DSTN_16BPP ((16 << 4) | LCD_TYPE_COLOR_DSTN)
51#define LCD_COLOR_TFT_8BPP ((8 << 4) | LCD_TYPE_COLOR_TFT)
52#define LCD_COLOR_TFT_16BPP ((16 << 4) | LCD_TYPE_COLOR_TFT)
53#define LCD_COLOR_TFT_18BPP ((18 << 4) | LCD_TYPE_COLOR_TFT)
54#define LCD_SMART_PANEL_8BPP ((8 << 4) | LCD_TYPE_SMART_PANEL)
55#define LCD_SMART_PANEL_16BPP ((16 << 4) | LCD_TYPE_SMART_PANEL)
56#define LCD_SMART_PANEL_18BPP ((18 << 4) | LCD_TYPE_SMART_PANEL)
57
58#define LCD_AC_BIAS_FREQ(x) (((x) & 0xff) << 10)
59#define LCD_BIAS_ACTIVE_HIGH (0 << 18)
60#define LCD_BIAS_ACTIVE_LOW (1 << 18)
61#define LCD_PCLK_EDGE_RISE (0 << 19)
62#define LCD_PCLK_EDGE_FALL (1 << 19)
63#define LCD_ALTERNATE_MAPPING (1 << 20)
64
65/*
66 * This structure describes the machine which we are running on.
67 * It is set in linux/arch/arm/mach-pxa/machine_name.c and used in the probe routine
68 * of linux/drivers/video/pxafb.c
69 */
70struct pxafb_mode_info {
71 u_long pixclock;
72
73 u_short xres;
74 u_short yres;
75
76 u_char bpp;
77 u_int cmap_greyscale:1,
78 depth:8,
79 transparency:1,
80 unused:22;
81
82 /* Parallel Mode Timing */
83 u_char hsync_len;
84 u_char left_margin;
85 u_char right_margin;
86
87 u_char vsync_len;
88 u_char upper_margin;
89 u_char lower_margin;
90 u_char sync;
91
92 /* Smart Panel Mode Timing - see PXA27x DM 7.4.15.0.3 for details
93 * Note:
94 * 1. all parameters in nanosecond (ns)
95 * 2. a0cs{rd,wr}_set_hld are controlled by the same register bits
96 * in pxa27x and pxa3xx, initialize them to the same value or
97 * the larger one will be used
98 * 3. same to {rd,wr}_pulse_width
99 *
100 * 4. LCD_PCLK_EDGE_{RISE,FALL} controls the L_PCLK_WR polarity
101 * 5. sync & FB_SYNC_HOR_HIGH_ACT controls the L_LCLK_A0
102 * 6. sync & FB_SYNC_VERT_HIGH_ACT controls the L_LCLK_RD
103 */
104 unsigned a0csrd_set_hld; /* A0 and CS Setup/Hold Time before/after L_FCLK_RD */
105 unsigned a0cswr_set_hld; /* A0 and CS Setup/Hold Time before/after L_PCLK_WR */
106 unsigned wr_pulse_width; /* L_PCLK_WR pulse width */
107 unsigned rd_pulse_width; /* L_FCLK_RD pulse width */
108 unsigned cmd_inh_time; /* Command Inhibit time between two writes */
109 unsigned op_hold_time; /* Output Hold time from L_FCLK_RD negation */
110};
111
112struct pxafb_mach_info {
113 struct pxafb_mode_info *modes;
114 unsigned int num_modes;
115
116 unsigned int lcd_conn;
117 unsigned long video_mem_size;
118
119 u_int fixed_modes:1,
120 cmap_inverse:1,
121 cmap_static:1,
122 acceleration_enabled:1,
123 unused:28;
124
125 /* The following should be defined in LCCR0
126 * LCCR0_Act or LCCR0_Pas Active or Passive
127 * LCCR0_Sngl or LCCR0_Dual Single/Dual panel
128 * LCCR0_Mono or LCCR0_Color Mono/Color
129 * LCCR0_4PixMono or LCCR0_8PixMono (in mono single mode)
130 * LCCR0_DMADel(Tcpu) (optional) DMA request delay
131 *
132 * The following should not be defined in LCCR0:
133 * LCCR0_OUM, LCCR0_BM, LCCR0_QDM, LCCR0_DIS, LCCR0_EFM
134 * LCCR0_IUM, LCCR0_SFM, LCCR0_LDM, LCCR0_ENB
135 */
136 u_int lccr0;
137 /* The following should be defined in LCCR3
138 * LCCR3_OutEnH or LCCR3_OutEnL Output enable polarity
139 * LCCR3_PixRsEdg or LCCR3_PixFlEdg Pixel clock edge type
140 * LCCR3_Acb(X) AB Bias pin frequency
141 * LCCR3_DPC (optional) Double Pixel Clock mode (untested)
142 *
143 * The following should not be defined in LCCR3
144 * LCCR3_HSP, LCCR3_VSP, LCCR0_Pcd(x), LCCR3_Bpp
145 */
146 u_int lccr3;
147 /* The following should be defined in LCCR4
148 * LCCR4_PAL_FOR_0 or LCCR4_PAL_FOR_1 or LCCR4_PAL_FOR_2
149 *
150 * All other bits in LCCR4 should be left alone.
151 */
152 u_int lccr4;
153 void (*pxafb_backlight_power)(int);
154 void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *);
155 void (*smart_update)(struct fb_info *);
156};
157
158void pxa_set_fb_info(struct device *, struct pxafb_mach_info *);
159unsigned long pxafb_get_hsync_time(struct device *dev);
160
161#ifdef CONFIG_FB_PXA_SMARTPANEL
162extern int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int);
163extern int pxafb_smart_flush(struct fb_info *info);
164#else
165static inline int pxafb_smart_queue(struct fb_info *info,
166 uint16_t *cmds, int n)
167{
168 return 0;
169}
170
171static inline int pxafb_smart_flush(struct fb_info *info)
172{
173 return 0;
174}
175#endif
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 5dae15ea671..b6cc1816463 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -17,6 +17,8 @@
17#include <linux/syscore_ops.h> 17#include <linux/syscore_ops.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/irq.h> 19#include <linux/irq.h>
20#include <linux/of_address.h>
21#include <linux/of_irq.h>
20 22
21#include <asm/exception.h> 23#include <asm/exception.h>
22 24
@@ -25,8 +27,6 @@
25 27
26#include "generic.h" 28#include "generic.h"
27 29
28#define IRQ_BASE io_p2v(0x40d00000)
29
30#define ICIP (0x000) 30#define ICIP (0x000)
31#define ICMR (0x004) 31#define ICMR (0x004)
32#define ICLR (0x008) 32#define ICLR (0x008)
@@ -48,22 +48,19 @@
48 * This is for peripheral IRQs internal to the PXA chip. 48 * This is for peripheral IRQs internal to the PXA chip.
49 */ 49 */
50 50
51static void __iomem *pxa_irq_base;
51static int pxa_internal_irq_nr; 52static int pxa_internal_irq_nr;
52 53static bool cpu_has_ipr;
53static inline int cpu_has_ipr(void)
54{
55 return !cpu_is_pxa25x();
56}
57 54
58static inline void __iomem *irq_base(int i) 55static inline void __iomem *irq_base(int i)
59{ 56{
60 static unsigned long phys_base[] = { 57 static unsigned long phys_base_offset[] = {
61 0x40d00000, 58 0x0,
62 0x40d0009c, 59 0x9c,
63 0x40d00130, 60 0x130,
64 }; 61 };
65 62
66 return io_p2v(phys_base[i]); 63 return pxa_irq_base + phys_base_offset[i];
67} 64}
68 65
69void pxa_mask_irq(struct irq_data *d) 66void pxa_mask_irq(struct irq_data *d)
@@ -96,8 +93,8 @@ asmlinkage void __exception_irq_entry icip_handle_irq(struct pt_regs *regs)
96 uint32_t icip, icmr, mask; 93 uint32_t icip, icmr, mask;
97 94
98 do { 95 do {
99 icip = __raw_readl(IRQ_BASE + ICIP); 96 icip = __raw_readl(pxa_irq_base + ICIP);
100 icmr = __raw_readl(IRQ_BASE + ICMR); 97 icmr = __raw_readl(pxa_irq_base + ICMR);
101 mask = icip & icmr; 98 mask = icip & icmr;
102 99
103 if (mask == 0) 100 if (mask == 0)
@@ -128,6 +125,8 @@ void __init pxa_init_irq(int irq_nr, int (*fn)(struct irq_data *, unsigned int))
128 BUG_ON(irq_nr > MAX_INTERNAL_IRQS); 125 BUG_ON(irq_nr > MAX_INTERNAL_IRQS);
129 126
130 pxa_internal_irq_nr = irq_nr; 127 pxa_internal_irq_nr = irq_nr;
128 cpu_has_ipr = !cpu_is_pxa25x();
129 pxa_irq_base = io_p2v(0x40d00000);
131 130
132 for (n = 0; n < irq_nr; n += 32) { 131 for (n = 0; n < irq_nr; n += 32) {
133 void __iomem *base = irq_base(n >> 5); 132 void __iomem *base = irq_base(n >> 5);
@@ -136,8 +135,8 @@ void __init pxa_init_irq(int irq_nr, int (*fn)(struct irq_data *, unsigned int))
136 __raw_writel(0, base + ICLR); /* all IRQs are IRQ, not FIQ */ 135 __raw_writel(0, base + ICLR); /* all IRQs are IRQ, not FIQ */
137 for (i = n; (i < (n + 32)) && (i < irq_nr); i++) { 136 for (i = n; (i < (n + 32)) && (i < irq_nr); i++) {
138 /* initialize interrupt priority */ 137 /* initialize interrupt priority */
139 if (cpu_has_ipr()) 138 if (cpu_has_ipr)
140 __raw_writel(i | IPR_VALID, IRQ_BASE + IPR(i)); 139 __raw_writel(i | IPR_VALID, pxa_irq_base + IPR(i));
141 140
142 irq = PXA_IRQ(i); 141 irq = PXA_IRQ(i);
143 irq_set_chip_and_handler(irq, &pxa_internal_irq_chip, 142 irq_set_chip_and_handler(irq, &pxa_internal_irq_chip,
@@ -168,9 +167,9 @@ static int pxa_irq_suspend(void)
168 __raw_writel(0, base + ICMR); 167 __raw_writel(0, base + ICMR);
169 } 168 }
170 169
171 if (cpu_has_ipr()) { 170 if (cpu_has_ipr) {
172 for (i = 0; i < pxa_internal_irq_nr; i++) 171 for (i = 0; i < pxa_internal_irq_nr; i++)
173 saved_ipr[i] = __raw_readl(IRQ_BASE + IPR(i)); 172 saved_ipr[i] = __raw_readl(pxa_irq_base + IPR(i));
174 } 173 }
175 174
176 return 0; 175 return 0;
@@ -187,11 +186,11 @@ static void pxa_irq_resume(void)
187 __raw_writel(0, base + ICLR); 186 __raw_writel(0, base + ICLR);
188 } 187 }
189 188
190 if (cpu_has_ipr()) 189 if (cpu_has_ipr)
191 for (i = 0; i < pxa_internal_irq_nr; i++) 190 for (i = 0; i < pxa_internal_irq_nr; i++)
192 __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i)); 191 __raw_writel(saved_ipr[i], pxa_irq_base + IPR(i));
193 192
194 __raw_writel(1, IRQ_BASE + ICCR); 193 __raw_writel(1, pxa_irq_base + ICCR);
195} 194}
196#else 195#else
197#define pxa_irq_suspend NULL 196#define pxa_irq_suspend NULL
@@ -202,3 +201,93 @@ struct syscore_ops pxa_irq_syscore_ops = {
202 .suspend = pxa_irq_suspend, 201 .suspend = pxa_irq_suspend,
203 .resume = pxa_irq_resume, 202 .resume = pxa_irq_resume,
204}; 203};
204
205#ifdef CONFIG_OF
206static struct irq_domain *pxa_irq_domain;
207
208static int pxa_irq_map(struct irq_domain *h, unsigned int virq,
209 irq_hw_number_t hw)
210{
211 void __iomem *base = irq_base(hw / 32);
212
213 /* initialize interrupt priority */
214 if (cpu_has_ipr)
215 __raw_writel(hw | IPR_VALID, pxa_irq_base + IPR(hw));
216
217 irq_set_chip_and_handler(hw, &pxa_internal_irq_chip,
218 handle_level_irq);
219 irq_set_chip_data(hw, base);
220 set_irq_flags(hw, IRQF_VALID);
221
222 return 0;
223}
224
225static struct irq_domain_ops pxa_irq_ops = {
226 .map = pxa_irq_map,
227 .xlate = irq_domain_xlate_onecell,
228};
229
230static const struct of_device_id intc_ids[] __initconst = {
231 { .compatible = "marvell,pxa-intc", },
232 {}
233};
234
235void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int))
236{
237 struct device_node *node;
238 const struct of_device_id *of_id;
239 struct pxa_intc_conf *conf;
240 struct resource res;
241 int n, ret;
242
243 node = of_find_matching_node(NULL, intc_ids);
244 if (!node) {
245 pr_err("Failed to find interrupt controller in arch-pxa\n");
246 return;
247 }
248 of_id = of_match_node(intc_ids, node);
249 conf = of_id->data;
250
251 ret = of_property_read_u32(node, "marvell,intc-nr-irqs",
252 &pxa_internal_irq_nr);
253 if (ret) {
254 pr_err("Not found marvell,intc-nr-irqs property\n");
255 return;
256 }
257
258 ret = of_address_to_resource(node, 0, &res);
259 if (ret < 0) {
260 pr_err("No registers defined for node\n");
261 return;
262 }
263 pxa_irq_base = io_p2v(res.start);
264
265 if (of_find_property(node, "marvell,intc-priority", NULL))
266 cpu_has_ipr = 1;
267
268 ret = irq_alloc_descs(-1, 0, pxa_internal_irq_nr, 0);
269 if (ret < 0) {
270 pr_err("Failed to allocate IRQ numbers\n");
271 return;
272 }
273
274 pxa_irq_domain = irq_domain_add_legacy(node, pxa_internal_irq_nr, 0, 0,
275 &pxa_irq_ops, NULL);
276 if (!pxa_irq_domain)
277 panic("Unable to add PXA IRQ domain\n");
278
279 irq_set_default_host(pxa_irq_domain);
280
281 for (n = 0; n < pxa_internal_irq_nr; n += 32) {
282 void __iomem *base = irq_base(n >> 5);
283
284 __raw_writel(0, base + ICMR); /* disable all IRQs */
285 __raw_writel(0, base + ICLR); /* all IRQs are IRQ, not FIQ */
286 }
287
288 /* only unmasked interrupts kick us out of idle */
289 __raw_writel(1, irq_base(0) + ICCR);
290
291 pxa_internal_irq_chip.irq_set_wake = fn;
292}
293#endif /* CONFIG_OF */
diff --git a/arch/arm/mach-pxa/leds-idp.c b/arch/arm/mach-pxa/leds-idp.c
deleted file mode 100644
index 06b060025d1..00000000000
--- a/arch/arm/mach-pxa/leds-idp.c
+++ /dev/null
@@ -1,115 +0,0 @@
1/*
2 * linux/arch/arm/mach-pxa/leds-idp.c
3 *
4 * Copyright (C) 2000 John Dorsey <john+@cs.cmu.edu>
5 *
6 * Copyright (c) 2001 Jeff Sutherland <jeffs@accelent.com>
7 *
8 * Original (leds-footbridge.c) by Russell King
9 *
10 * Macros for actual LED manipulation should be in machine specific
11 * files in this 'mach' directory.
12 */
13
14
15#include <linux/init.h>
16
17#include <mach/hardware.h>
18#include <asm/leds.h>
19
20#include <mach/pxa25x.h>
21#include <mach/idp.h>
22
23#include "leds.h"
24
25#define LED_STATE_ENABLED 1
26#define LED_STATE_CLAIMED 2
27
28static unsigned int led_state;
29static unsigned int hw_led_state;
30
31void idp_leds_event(led_event_t evt)
32{
33 unsigned long flags;
34
35 local_irq_save(flags);
36
37 switch (evt) {
38 case led_start:
39 hw_led_state = IDP_HB_LED | IDP_BUSY_LED;
40 led_state = LED_STATE_ENABLED;
41 break;
42
43 case led_stop:
44 led_state &= ~LED_STATE_ENABLED;
45 break;
46
47 case led_claim:
48 led_state |= LED_STATE_CLAIMED;
49 hw_led_state = IDP_HB_LED | IDP_BUSY_LED;
50 break;
51
52 case led_release:
53 led_state &= ~LED_STATE_CLAIMED;
54 hw_led_state = IDP_HB_LED | IDP_BUSY_LED;
55 break;
56
57#ifdef CONFIG_LEDS_TIMER
58 case led_timer:
59 if (!(led_state & LED_STATE_CLAIMED))
60 hw_led_state ^= IDP_HB_LED;
61 break;
62#endif
63
64#ifdef CONFIG_LEDS_CPU
65 case led_idle_start:
66 if (!(led_state & LED_STATE_CLAIMED))
67 hw_led_state &= ~IDP_BUSY_LED;
68 break;
69
70 case led_idle_end:
71 if (!(led_state & LED_STATE_CLAIMED))
72 hw_led_state |= IDP_BUSY_LED;
73 break;
74#endif
75
76 case led_halted:
77 break;
78
79 case led_green_on:
80 if (led_state & LED_STATE_CLAIMED)
81 hw_led_state |= IDP_HB_LED;
82 break;
83
84 case led_green_off:
85 if (led_state & LED_STATE_CLAIMED)
86 hw_led_state &= ~IDP_HB_LED;
87 break;
88
89 case led_amber_on:
90 break;
91
92 case led_amber_off:
93 break;
94
95 case led_red_on:
96 if (led_state & LED_STATE_CLAIMED)
97 hw_led_state |= IDP_BUSY_LED;
98 break;
99
100 case led_red_off:
101 if (led_state & LED_STATE_CLAIMED)
102 hw_led_state &= ~IDP_BUSY_LED;
103 break;
104
105 default:
106 break;
107 }
108
109 if (led_state & LED_STATE_ENABLED)
110 IDP_CPLD_LED_CONTROL = ( (IDP_CPLD_LED_CONTROL | IDP_LEDS_MASK) & ~hw_led_state);
111 else
112 IDP_CPLD_LED_CONTROL |= IDP_LEDS_MASK;
113
114 local_irq_restore(flags);
115}
diff --git a/arch/arm/mach-pxa/leds-lubbock.c b/arch/arm/mach-pxa/leds-lubbock.c
deleted file mode 100644
index 0bd85c884a7..00000000000
--- a/arch/arm/mach-pxa/leds-lubbock.c
+++ /dev/null
@@ -1,124 +0,0 @@
1/*
2 * linux/arch/arm/mach-pxa/leds-lubbock.c
3 *
4 * Copyright (C) 2000 John Dorsey <john+@cs.cmu.edu>
5 *
6 * Copyright (c) 2001 Jeff Sutherland <jeffs@accelent.com>
7 *
8 * Original (leds-footbridge.c) by Russell King
9 *
10 * Major surgery on April 2004 by Nicolas Pitre for less global
11 * namespace collision. Mostly adapted the Mainstone version.
12 */
13
14#include <linux/init.h>
15
16#include <mach/hardware.h>
17#include <asm/leds.h>
18#include <mach/pxa25x.h>
19#include <mach/lubbock.h>
20
21#include "leds.h"
22
23/*
24 * 8 discrete leds available for general use:
25 *
26 * Note: bits [15-8] are used to enable/blank the 8 7 segment hex displays
27 * so be sure to not monkey with them here.
28 */
29
30#define D28 (1 << 0)
31#define D27 (1 << 1)
32#define D26 (1 << 2)
33#define D25 (1 << 3)
34#define D24 (1 << 4)
35#define D23 (1 << 5)
36#define D22 (1 << 6)
37#define D21 (1 << 7)
38
39#define LED_STATE_ENABLED 1
40#define LED_STATE_CLAIMED 2
41
42static unsigned int led_state;
43static unsigned int hw_led_state;
44
45void lubbock_leds_event(led_event_t evt)
46{
47 unsigned long flags;
48
49 local_irq_save(flags);
50
51 switch (evt) {
52 case led_start:
53 hw_led_state = 0;
54 led_state = LED_STATE_ENABLED;
55 break;
56
57 case led_stop:
58 led_state &= ~LED_STATE_ENABLED;
59 break;
60
61 case led_claim:
62 led_state |= LED_STATE_CLAIMED;
63 hw_led_state = 0;
64 break;
65
66 case led_release:
67 led_state &= ~LED_STATE_CLAIMED;
68 hw_led_state = 0;
69 break;
70
71#ifdef CONFIG_LEDS_TIMER
72 case led_timer:
73 hw_led_state ^= D26;
74 break;
75#endif
76
77#ifdef CONFIG_LEDS_CPU
78 case led_idle_start:
79 hw_led_state &= ~D27;
80 break;
81
82 case led_idle_end:
83 hw_led_state |= D27;
84 break;
85#endif
86
87 case led_halted:
88 break;
89
90 case led_green_on:
91 hw_led_state |= D21;
92 break;
93
94 case led_green_off:
95 hw_led_state &= ~D21;
96 break;
97
98 case led_amber_on:
99 hw_led_state |= D22;
100 break;
101
102 case led_amber_off:
103 hw_led_state &= ~D22;
104 break;
105
106 case led_red_on:
107 hw_led_state |= D23;
108 break;
109
110 case led_red_off:
111 hw_led_state &= ~D23;
112 break;
113
114 default:
115 break;
116 }
117
118 if (led_state & LED_STATE_ENABLED)
119 LUB_DISC_BLNK_LED = (LUB_DISC_BLNK_LED | 0xff) & ~hw_led_state;
120 else
121 LUB_DISC_BLNK_LED |= 0xff;
122
123 local_irq_restore(flags);
124}
diff --git a/arch/arm/mach-pxa/leds-mainstone.c b/arch/arm/mach-pxa/leds-mainstone.c
deleted file mode 100644
index 4058ab340fe..00000000000
--- a/arch/arm/mach-pxa/leds-mainstone.c
+++ /dev/null
@@ -1,119 +0,0 @@
1/*
2 * linux/arch/arm/mach-pxa/leds-mainstone.c
3 *
4 * Author: Nicolas Pitre
5 * Created: Nov 05, 2002
6 * Copyright: MontaVista Software Inc.
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/init.h>
14
15#include <mach/hardware.h>
16#include <asm/leds.h>
17
18#include <mach/pxa27x.h>
19#include <mach/mainstone.h>
20
21#include "leds.h"
22
23
24/* 8 discrete leds available for general use: */
25#define D28 (1 << 0)
26#define D27 (1 << 1)
27#define D26 (1 << 2)
28#define D25 (1 << 3)
29#define D24 (1 << 4)
30#define D23 (1 << 5)
31#define D22 (1 << 6)
32#define D21 (1 << 7)
33
34#define LED_STATE_ENABLED 1
35#define LED_STATE_CLAIMED 2
36
37static unsigned int led_state;
38static unsigned int hw_led_state;
39
40void mainstone_leds_event(led_event_t evt)
41{
42 unsigned long flags;
43
44 local_irq_save(flags);
45
46 switch (evt) {
47 case led_start:
48 hw_led_state = 0;
49 led_state = LED_STATE_ENABLED;
50 break;
51
52 case led_stop:
53 led_state &= ~LED_STATE_ENABLED;
54 break;
55
56 case led_claim:
57 led_state |= LED_STATE_CLAIMED;
58 hw_led_state = 0;
59 break;
60
61 case led_release:
62 led_state &= ~LED_STATE_CLAIMED;
63 hw_led_state = 0;
64 break;
65
66#ifdef CONFIG_LEDS_TIMER
67 case led_timer:
68 hw_led_state ^= D26;
69 break;
70#endif
71
72#ifdef CONFIG_LEDS_CPU
73 case led_idle_start:
74 hw_led_state &= ~D27;
75 break;
76
77 case led_idle_end:
78 hw_led_state |= D27;
79 break;
80#endif
81
82 case led_halted:
83 break;
84
85 case led_green_on:
86 hw_led_state |= D21;
87 break;
88
89 case led_green_off:
90 hw_led_state &= ~D21;
91 break;
92
93 case led_amber_on:
94 hw_led_state |= D22;
95 break;
96
97 case led_amber_off:
98 hw_led_state &= ~D22;
99 break;
100
101 case led_red_on:
102 hw_led_state |= D23;
103 break;
104
105 case led_red_off:
106 hw_led_state &= ~D23;
107 break;
108
109 default:
110 break;
111 }
112
113 if (led_state & LED_STATE_ENABLED)
114 MST_LEDCTRL = (MST_LEDCTRL | 0xff) & ~hw_led_state;
115 else
116 MST_LEDCTRL |= 0xff;
117
118 local_irq_restore(flags);
119}
diff --git a/arch/arm/mach-pxa/leds.c b/arch/arm/mach-pxa/leds.c
deleted file mode 100644
index bbe4d5f6afa..00000000000
--- a/arch/arm/mach-pxa/leds.c
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * linux/arch/arm/mach-pxa/leds.c
3 *
4 * xscale LEDs dispatcher
5 *
6 * Copyright (C) 2001 Nicolas Pitre
7 *
8 * Copyright (c) 2001 Jeff Sutherland, Accelent Systems Inc.
9 */
10#include <linux/compiler.h>
11#include <linux/init.h>
12
13#include <asm/leds.h>
14#include <asm/mach-types.h>
15
16#include "leds.h"
17
18static int __init
19pxa_leds_init(void)
20{
21 if (machine_is_lubbock())
22 leds_event = lubbock_leds_event;
23 if (machine_is_mainstone())
24 leds_event = mainstone_leds_event;
25 if (machine_is_pxa_idp())
26 leds_event = idp_leds_event;
27
28 leds_event(led_start);
29 return 0;
30}
31
32core_initcall(pxa_leds_init);
diff --git a/arch/arm/mach-pxa/leds.h b/arch/arm/mach-pxa/leds.h
deleted file mode 100644
index 7f0dfe01345..00000000000
--- a/arch/arm/mach-pxa/leds.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * arch/arm/mach-pxa/leds.h
3 *
4 * Copyright (c) 2001 Jeff Sutherland, Accelent Systems Inc.
5 *
6 * blinky lights for various PXA-based systems:
7 *
8 */
9
10extern void idp_leds_event(led_event_t evt);
11extern void lubbock_leds_event(led_event_t evt);
12extern void mainstone_leds_event(led_event_t evt);
13extern void trizeps4_leds_event(led_event_t evt);
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index 1fb86edb857..402874f9021 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -42,11 +42,11 @@
42#include <asm/mach/irq.h> 42#include <asm/mach/irq.h>
43 43
44#include <mach/pxa300.h> 44#include <mach/pxa300.h>
45#include <mach/pxafb.h> 45#include <linux/platform_data/video-pxafb.h>
46#include <mach/mmc.h> 46#include <linux/platform_data/mmc-pxamci.h>
47#include <plat/pxa27x_keypad.h> 47#include <linux/platform_data/keypad-pxa27x.h>
48#include <mach/littleton.h> 48#include <mach/littleton.h>
49#include <plat/pxa3xx_nand.h> 49#include <linux/platform_data/mtd-nand-pxa3xx.h>
50 50
51#include "generic.h" 51#include "generic.h"
52 52
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index cee9ce2fc0b..1a63eaa8986 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -41,10 +41,10 @@
41#include <mach/pxa27x.h> 41#include <mach/pxa27x.h>
42#include <mach/lpd270.h> 42#include <mach/lpd270.h>
43#include <mach/audio.h> 43#include <mach/audio.h>
44#include <mach/pxafb.h> 44#include <linux/platform_data/video-pxafb.h>
45#include <mach/mmc.h> 45#include <linux/platform_data/mmc-pxamci.h>
46#include <mach/irda.h> 46#include <linux/platform_data/irda-pxaficp.h>
47#include <mach/ohci.h> 47#include <linux/platform_data/usb-ohci-pxa27x.h>
48#include <mach/smemc.h> 48#include <mach/smemc.h>
49 49
50#include "generic.h" 50#include "generic.h"
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 0ca0db78790..553056d9a3c 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -15,6 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/io.h>
18#include <linux/platform_device.h> 19#include <linux/platform_device.h>
19#include <linux/syscore_ops.h> 20#include <linux/syscore_ops.h>
20#include <linux/major.h> 21#include <linux/major.h>
@@ -23,6 +24,8 @@
23#include <linux/mtd/mtd.h> 24#include <linux/mtd/mtd.h>
24#include <linux/mtd/partitions.h> 25#include <linux/mtd/partitions.h>
25#include <linux/smc91x.h> 26#include <linux/smc91x.h>
27#include <linux/slab.h>
28#include <linux/leds.h>
26 29
27#include <linux/spi/spi.h> 30#include <linux/spi/spi.h>
28#include <linux/spi/ads7846.h> 31#include <linux/spi/ads7846.h>
@@ -46,9 +49,9 @@
46#include <mach/audio.h> 49#include <mach/audio.h>
47#include <mach/lubbock.h> 50#include <mach/lubbock.h>
48#include <mach/udc.h> 51#include <mach/udc.h>
49#include <mach/irda.h> 52#include <linux/platform_data/irda-pxaficp.h>
50#include <mach/pxafb.h> 53#include <linux/platform_data/video-pxafb.h>
51#include <mach/mmc.h> 54#include <linux/platform_data/mmc-pxamci.h>
52#include <mach/pm.h> 55#include <mach/pm.h>
53#include <mach/smemc.h> 56#include <mach/smemc.h>
54 57
@@ -549,6 +552,98 @@ static void __init lubbock_map_io(void)
549 PCFR |= PCFR_OPDE; 552 PCFR |= PCFR_OPDE;
550} 553}
551 554
555/*
556 * Driver for the 8 discrete LEDs available for general use:
557 * Note: bits [15-8] are used to enable/blank the 8 7 segment hex displays
558 * so be sure to not monkey with them here.
559 */
560
561#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
562struct lubbock_led {
563 struct led_classdev cdev;
564 u8 mask;
565};
566
567/*
568 * The triggers lines up below will only be used if the
569 * LED triggers are compiled in.
570 */
571static const struct {
572 const char *name;
573 const char *trigger;
574} lubbock_leds[] = {
575 { "lubbock:D28", "default-on", },
576 { "lubbock:D27", "cpu0", },
577 { "lubbock:D26", "heartbeat" },
578 { "lubbock:D25", },
579 { "lubbock:D24", },
580 { "lubbock:D23", },
581 { "lubbock:D22", },
582 { "lubbock:D21", },
583};
584
585static void lubbock_led_set(struct led_classdev *cdev,
586 enum led_brightness b)
587{
588 struct lubbock_led *led = container_of(cdev,
589 struct lubbock_led, cdev);
590 u32 reg = LUB_DISC_BLNK_LED;
591
592 if (b != LED_OFF)
593 reg |= led->mask;
594 else
595 reg &= ~led->mask;
596
597 LUB_DISC_BLNK_LED = reg;
598}
599
600static enum led_brightness lubbock_led_get(struct led_classdev *cdev)
601{
602 struct lubbock_led *led = container_of(cdev,
603 struct lubbock_led, cdev);
604 u32 reg = LUB_DISC_BLNK_LED;
605
606 return (reg & led->mask) ? LED_FULL : LED_OFF;
607}
608
609static int __init lubbock_leds_init(void)
610{
611 int i;
612
613 if (!machine_is_lubbock())
614 return -ENODEV;
615
616 /* All ON */
617 LUB_DISC_BLNK_LED |= 0xff;
618 for (i = 0; i < ARRAY_SIZE(lubbock_leds); i++) {
619 struct lubbock_led *led;
620
621 led = kzalloc(sizeof(*led), GFP_KERNEL);
622 if (!led)
623 break;
624
625 led->cdev.name = lubbock_leds[i].name;
626 led->cdev.brightness_set = lubbock_led_set;
627 led->cdev.brightness_get = lubbock_led_get;
628 led->cdev.default_trigger = lubbock_leds[i].trigger;
629 led->mask = BIT(i);
630
631 if (led_classdev_register(NULL, &led->cdev) < 0) {
632 kfree(led);
633 break;
634 }
635 }
636
637 return 0;
638}
639
640/*
641 * Since we may have triggers on any subsystem, defer registration
642 * until after subsystem_init.
643 */
644fs_initcall(lubbock_leds_init);
645#endif
646
552MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)") 647MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
553 /* Maintainer: MontaVista Software Inc. */ 648 /* Maintainer: MontaVista Software Inc. */
554 .map_io = lubbock_map_io, 649 .map_io = lubbock_map_io,
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 39561dcf65f..f7922404d94 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -38,10 +38,10 @@
38 38
39#include <mach/pxa27x.h> 39#include <mach/pxa27x.h>
40#include <mach/magician.h> 40#include <mach/magician.h>
41#include <mach/pxafb.h> 41#include <linux/platform_data/video-pxafb.h>
42#include <mach/mmc.h> 42#include <linux/platform_data/mmc-pxamci.h>
43#include <mach/irda.h> 43#include <linux/platform_data/irda-pxaficp.h>
44#include <mach/ohci.h> 44#include <linux/platform_data/usb-ohci-pxa27x.h>
45 45
46#include "devices.h" 46#include "devices.h"
47#include "generic.h" 47#include "generic.h"
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 1aebaf71946..f27a61ee7ac 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -28,6 +28,8 @@
28#include <linux/pwm_backlight.h> 28#include <linux/pwm_backlight.h>
29#include <linux/smc91x.h> 29#include <linux/smc91x.h>
30#include <linux/i2c/pxa-i2c.h> 30#include <linux/i2c/pxa-i2c.h>
31#include <linux/slab.h>
32#include <linux/leds.h>
31 33
32#include <asm/types.h> 34#include <asm/types.h>
33#include <asm/setup.h> 35#include <asm/setup.h>
@@ -45,11 +47,11 @@
45#include <mach/pxa27x.h> 47#include <mach/pxa27x.h>
46#include <mach/mainstone.h> 48#include <mach/mainstone.h>
47#include <mach/audio.h> 49#include <mach/audio.h>
48#include <mach/pxafb.h> 50#include <linux/platform_data/video-pxafb.h>
49#include <mach/mmc.h> 51#include <linux/platform_data/mmc-pxamci.h>
50#include <mach/irda.h> 52#include <linux/platform_data/irda-pxaficp.h>
51#include <mach/ohci.h> 53#include <linux/platform_data/usb-ohci-pxa27x.h>
52#include <plat/pxa27x_keypad.h> 54#include <linux/platform_data/keypad-pxa27x.h>
53#include <mach/smemc.h> 55#include <mach/smemc.h>
54 56
55#include "generic.h" 57#include "generic.h"
@@ -613,6 +615,98 @@ static void __init mainstone_map_io(void)
613 PCFR = 0x66; 615 PCFR = 0x66;
614} 616}
615 617
618/*
619 * Driver for the 8 discrete LEDs available for general use:
620 * Note: bits [15-8] are used to enable/blank the 8 7 segment hex displays
621 * so be sure to not monkey with them here.
622 */
623
624#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
625struct mainstone_led {
626 struct led_classdev cdev;
627 u8 mask;
628};
629
630/*
631 * The triggers lines up below will only be used if the
632 * LED triggers are compiled in.
633 */
634static const struct {
635 const char *name;
636 const char *trigger;
637} mainstone_leds[] = {
638 { "mainstone:D28", "default-on", },
639 { "mainstone:D27", "cpu0", },
640 { "mainstone:D26", "heartbeat" },
641 { "mainstone:D25", },
642 { "mainstone:D24", },
643 { "mainstone:D23", },
644 { "mainstone:D22", },
645 { "mainstone:D21", },
646};
647
648static void mainstone_led_set(struct led_classdev *cdev,
649 enum led_brightness b)
650{
651 struct mainstone_led *led = container_of(cdev,
652 struct mainstone_led, cdev);
653 u32 reg = MST_LEDCTRL;
654
655 if (b != LED_OFF)
656 reg |= led->mask;
657 else
658 reg &= ~led->mask;
659
660 MST_LEDCTRL = reg;
661}
662
663static enum led_brightness mainstone_led_get(struct led_classdev *cdev)
664{
665 struct mainstone_led *led = container_of(cdev,
666 struct mainstone_led, cdev);
667 u32 reg = MST_LEDCTRL;
668
669 return (reg & led->mask) ? LED_FULL : LED_OFF;
670}
671
672static int __init mainstone_leds_init(void)
673{
674 int i;
675
676 if (!machine_is_mainstone())
677 return -ENODEV;
678
679 /* All ON */
680 MST_LEDCTRL |= 0xff;
681 for (i = 0; i < ARRAY_SIZE(mainstone_leds); i++) {
682 struct mainstone_led *led;
683
684 led = kzalloc(sizeof(*led), GFP_KERNEL);
685 if (!led)
686 break;
687
688 led->cdev.name = mainstone_leds[i].name;
689 led->cdev.brightness_set = mainstone_led_set;
690 led->cdev.brightness_get = mainstone_led_get;
691 led->cdev.default_trigger = mainstone_leds[i].trigger;
692 led->mask = BIT(i);
693
694 if (led_classdev_register(NULL, &led->cdev) < 0) {
695 kfree(led);
696 break;
697 }
698 }
699
700 return 0;
701}
702
703/*
704 * Since we may have triggers on any subsystem, defer registration
705 * until after subsystem_init.
706 */
707fs_initcall(mainstone_leds_init);
708#endif
709
616MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") 710MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
617 /* Maintainer: MontaVista Software Inc. */ 711 /* Maintainer: MontaVista Software Inc. */
618 .atag_offset = 0x100, /* BLOB boot parameter setting */ 712 .atag_offset = 0x100, /* BLOB boot parameter setting */
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index bf99022b021..2831308dba6 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -46,12 +46,12 @@
46 46
47#include <mach/pxa27x.h> 47#include <mach/pxa27x.h>
48#include <mach/regs-rtc.h> 48#include <mach/regs-rtc.h>
49#include <plat/pxa27x_keypad.h> 49#include <linux/platform_data/keypad-pxa27x.h>
50#include <mach/pxafb.h> 50#include <linux/platform_data/video-pxafb.h>
51#include <mach/mmc.h> 51#include <linux/platform_data/mmc-pxamci.h>
52#include <mach/udc.h> 52#include <mach/udc.h>
53#include <mach/pxa27x-udc.h> 53#include <mach/pxa27x-udc.h>
54#include <mach/camera.h> 54#include <linux/platform_data/camera-pxa.h>
55#include <mach/audio.h> 55#include <mach/audio.h>
56#include <mach/smemc.h> 56#include <mach/smemc.h>
57#include <media/soc_camera.h> 57#include <media/soc_camera.h>
diff --git a/arch/arm/mach-pxa/mxm8x10.c b/arch/arm/mach-pxa/mxm8x10.c
index 83570a79e7d..d04ed4961e6 100644
--- a/arch/arm/mach-pxa/mxm8x10.c
+++ b/arch/arm/mach-pxa/mxm8x10.c
@@ -24,11 +24,11 @@
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/i2c/pxa-i2c.h> 25#include <linux/i2c/pxa-i2c.h>
26 26
27#include <plat/pxa3xx_nand.h> 27#include <linux/platform_data/mtd-nand-pxa3xx.h>
28 28
29#include <mach/pxafb.h> 29#include <linux/platform_data/video-pxafb.h>
30#include <mach/mmc.h> 30#include <linux/platform_data/mmc-pxamci.h>
31#include <mach/ohci.h> 31#include <linux/platform_data/usb-ohci-pxa27x.h>
32#include <mach/pxa320.h> 32#include <mach/pxa320.h>
33 33
34#include <mach/mxm8x10.h> 34#include <mach/mxm8x10.h>
diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c
index dad71cfa34c..17d4c53017c 100644
--- a/arch/arm/mach-pxa/palm27x.c
+++ b/arch/arm/mach-pxa/palm27x.c
@@ -29,11 +29,11 @@
29 29
30#include <mach/pxa27x.h> 30#include <mach/pxa27x.h>
31#include <mach/audio.h> 31#include <mach/audio.h>
32#include <mach/mmc.h> 32#include <linux/platform_data/mmc-pxamci.h>
33#include <mach/pxafb.h> 33#include <linux/platform_data/video-pxafb.h>
34#include <mach/irda.h> 34#include <linux/platform_data/irda-pxaficp.h>
35#include <mach/udc.h> 35#include <mach/udc.h>
36#include <mach/palmasoc.h> 36#include <linux/platform_data/asoc-palm27x.h>
37#include <mach/palm27x.h> 37#include <mach/palm27x.h>
38 38
39#include "generic.h" 39#include "generic.h"
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index 31e0433d83b..8bcc96e3b0d 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -35,11 +35,11 @@
35#include <mach/pxa27x.h> 35#include <mach/pxa27x.h>
36#include <mach/audio.h> 36#include <mach/audio.h>
37#include <mach/palmld.h> 37#include <mach/palmld.h>
38#include <mach/mmc.h> 38#include <linux/platform_data/mmc-pxamci.h>
39#include <mach/pxafb.h> 39#include <linux/platform_data/video-pxafb.h>
40#include <mach/irda.h> 40#include <linux/platform_data/irda-pxaficp.h>
41#include <plat/pxa27x_keypad.h> 41#include <linux/platform_data/keypad-pxa27x.h>
42#include <mach/palmasoc.h> 42#include <linux/platform_data/asoc-palm27x.h>
43#include <mach/palm27x.h> 43#include <mach/palm27x.h>
44 44
45#include "generic.h" 45#include "generic.h"
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 0f6bd4fcfa3..5ca7b904a30 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -36,12 +36,12 @@
36#include <mach/pxa27x.h> 36#include <mach/pxa27x.h>
37#include <mach/audio.h> 37#include <mach/audio.h>
38#include <mach/palmt5.h> 38#include <mach/palmt5.h>
39#include <mach/mmc.h> 39#include <linux/platform_data/mmc-pxamci.h>
40#include <mach/pxafb.h> 40#include <linux/platform_data/video-pxafb.h>
41#include <mach/irda.h> 41#include <linux/platform_data/irda-pxaficp.h>
42#include <plat/pxa27x_keypad.h> 42#include <linux/platform_data/keypad-pxa27x.h>
43#include <mach/udc.h> 43#include <mach/udc.h>
44#include <mach/palmasoc.h> 44#include <linux/platform_data/asoc-palm27x.h>
45#include <mach/palm27x.h> 45#include <mach/palm27x.h>
46 46
47#include "generic.h" 47#include "generic.h"
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index e2d97eed07a..ca924cfedfc 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -34,9 +34,9 @@
34#include <mach/pxa25x.h> 34#include <mach/pxa25x.h>
35#include <mach/audio.h> 35#include <mach/audio.h>
36#include <mach/palmtc.h> 36#include <mach/palmtc.h>
37#include <mach/mmc.h> 37#include <linux/platform_data/mmc-pxamci.h>
38#include <mach/pxafb.h> 38#include <linux/platform_data/video-pxafb.h>
39#include <mach/irda.h> 39#include <linux/platform_data/irda-pxaficp.h>
40#include <mach/udc.h> 40#include <mach/udc.h>
41 41
42#include "generic.h" 42#include "generic.h"
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c
index c054827c567..32e0d799835 100644
--- a/arch/arm/mach-pxa/palmte2.c
+++ b/arch/arm/mach-pxa/palmte2.c
@@ -34,11 +34,11 @@
34#include <mach/pxa25x.h> 34#include <mach/pxa25x.h>
35#include <mach/audio.h> 35#include <mach/audio.h>
36#include <mach/palmte2.h> 36#include <mach/palmte2.h>
37#include <mach/mmc.h> 37#include <linux/platform_data/mmc-pxamci.h>
38#include <mach/pxafb.h> 38#include <linux/platform_data/video-pxafb.h>
39#include <mach/irda.h> 39#include <linux/platform_data/irda-pxaficp.h>
40#include <mach/udc.h> 40#include <mach/udc.h>
41#include <mach/palmasoc.h> 41#include <linux/platform_data/asoc-palm27x.h>
42 42
43#include "generic.h" 43#include "generic.h"
44#include "devices.h" 44#include "devices.h"
@@ -105,6 +105,7 @@ static struct pxamci_platform_data palmte2_mci_platform_data = {
105 .gpio_power = GPIO_NR_PALMTE2_SD_POWER, 105 .gpio_power = GPIO_NR_PALMTE2_SD_POWER,
106}; 106};
107 107
108#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
108/****************************************************************************** 109/******************************************************************************
109 * GPIO keys 110 * GPIO keys
110 ******************************************************************************/ 111 ******************************************************************************/
@@ -132,6 +133,7 @@ static struct platform_device palmte2_pxa_keys = {
132 .platform_data = &palmte2_pxa_keys_data, 133 .platform_data = &palmte2_pxa_keys_data,
133 }, 134 },
134}; 135};
136#endif
135 137
136/****************************************************************************** 138/******************************************************************************
137 * Backlight 139 * Backlight
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c
index fbdebee39a5..3f3c48f2f7c 100644
--- a/arch/arm/mach-pxa/palmtreo.c
+++ b/arch/arm/mach-pxa/palmtreo.c
@@ -35,15 +35,15 @@
35#include <mach/pxa27x-udc.h> 35#include <mach/pxa27x-udc.h>
36#include <mach/audio.h> 36#include <mach/audio.h>
37#include <mach/palmtreo.h> 37#include <mach/palmtreo.h>
38#include <mach/mmc.h> 38#include <linux/platform_data/mmc-pxamci.h>
39#include <mach/pxafb.h> 39#include <linux/platform_data/video-pxafb.h>
40#include <mach/irda.h> 40#include <linux/platform_data/irda-pxaficp.h>
41#include <plat/pxa27x_keypad.h> 41#include <linux/platform_data/keypad-pxa27x.h>
42#include <mach/udc.h> 42#include <mach/udc.h>
43#include <mach/ohci.h> 43#include <linux/platform_data/usb-ohci-pxa27x.h>
44#include <mach/pxa2xx-regs.h> 44#include <mach/pxa2xx-regs.h>
45#include <mach/palmasoc.h> 45#include <linux/platform_data/asoc-palm27x.h>
46#include <mach/camera.h> 46#include <linux/platform_data/camera-pxa.h>
47#include <mach/palm27x.h> 47#include <mach/palm27x.h>
48 48
49#include <sound/pxa2xx-lib.h> 49#include <sound/pxa2xx-lib.h>
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index 0da35dccfd8..8b4366628a1 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -40,12 +40,12 @@
40#include <mach/pxa27x.h> 40#include <mach/pxa27x.h>
41#include <mach/audio.h> 41#include <mach/audio.h>
42#include <mach/palmtx.h> 42#include <mach/palmtx.h>
43#include <mach/mmc.h> 43#include <linux/platform_data/mmc-pxamci.h>
44#include <mach/pxafb.h> 44#include <linux/platform_data/video-pxafb.h>
45#include <mach/irda.h> 45#include <linux/platform_data/irda-pxaficp.h>
46#include <plat/pxa27x_keypad.h> 46#include <linux/platform_data/keypad-pxa27x.h>
47#include <mach/udc.h> 47#include <mach/udc.h>
48#include <mach/palmasoc.h> 48#include <linux/platform_data/asoc-palm27x.h>
49#include <mach/palm27x.h> 49#include <mach/palm27x.h>
50 50
51#include "generic.h" 51#include "generic.h"
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index a97b59965bb..8cdd4f58e25 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -40,16 +40,16 @@
40#include <mach/pxa27x.h> 40#include <mach/pxa27x.h>
41#include <mach/audio.h> 41#include <mach/audio.h>
42#include <mach/palmz72.h> 42#include <mach/palmz72.h>
43#include <mach/mmc.h> 43#include <linux/platform_data/mmc-pxamci.h>
44#include <mach/pxafb.h> 44#include <linux/platform_data/video-pxafb.h>
45#include <mach/irda.h> 45#include <linux/platform_data/irda-pxaficp.h>
46#include <plat/pxa27x_keypad.h> 46#include <linux/platform_data/keypad-pxa27x.h>
47#include <mach/udc.h> 47#include <mach/udc.h>
48#include <mach/palmasoc.h> 48#include <linux/platform_data/asoc-palm27x.h>
49#include <mach/palm27x.h> 49#include <mach/palm27x.h>
50 50
51#include <mach/pm.h> 51#include <mach/pm.h>
52#include <mach/camera.h> 52#include <linux/platform_data/camera-pxa.h>
53 53
54#include <media/soc_camera.h> 54#include <media/soc_camera.h>
55 55
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index cb723e84bc2..113c57a0356 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -28,14 +28,14 @@
28 28
29#include <media/soc_camera.h> 29#include <media/soc_camera.h>
30 30
31#include <mach/camera.h> 31#include <linux/platform_data/camera-pxa.h>
32#include <asm/mach/map.h> 32#include <asm/mach/map.h>
33#include <mach/pxa27x.h> 33#include <mach/pxa27x.h>
34#include <mach/audio.h> 34#include <mach/audio.h>
35#include <mach/mmc.h> 35#include <linux/platform_data/mmc-pxamci.h>
36#include <mach/ohci.h> 36#include <linux/platform_data/usb-ohci-pxa27x.h>
37#include <mach/pcm990_baseboard.h> 37#include <mach/pcm990_baseboard.h>
38#include <mach/pxafb.h> 38#include <linux/platform_data/video-pxafb.h>
39 39
40#include "devices.h" 40#include "devices.h"
41#include "generic.h" 41#include "generic.h"
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 89d98c83218..2910bb935c7 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -40,11 +40,11 @@
40#include <asm/mach/irq.h> 40#include <asm/mach/irq.h>
41 41
42#include <mach/pxa25x.h> 42#include <mach/pxa25x.h>
43#include <mach/mmc.h> 43#include <linux/platform_data/mmc-pxamci.h>
44#include <mach/udc.h> 44#include <mach/udc.h>
45#include <mach/irda.h> 45#include <linux/platform_data/irda-pxaficp.h>
46#include <mach/poodle.h> 46#include <mach/poodle.h>
47#include <mach/pxafb.h> 47#include <linux/platform_data/video-pxafb.h>
48 48
49#include <asm/hardware/scoop.h> 49#include <asm/hardware/scoop.h>
50#include <asm/hardware/locomo.h> 50#include <asm/hardware/locomo.h>
diff --git a/arch/arm/mach-pxa/pxa-dt.c b/arch/arm/mach-pxa/pxa-dt.c
new file mode 100644
index 00000000000..c9192cea003
--- /dev/null
+++ b/arch/arm/mach-pxa/pxa-dt.c
@@ -0,0 +1,63 @@
1/*
2 * linux/arch/arm/mach-pxa/pxa-dt.c
3 *
4 * Copyright (C) 2012 Daniel Mack
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 * publishhed by the Free Software Foundation.
9 */
10
11#include <linux/irq.h>
12#include <linux/irqdomain.h>
13#include <linux/of_irq.h>
14#include <linux/of_platform.h>
15#include <asm/mach/arch.h>
16#include <asm/mach/time.h>
17#include <mach/irqs.h>
18#include <mach/pxa3xx.h>
19
20#include "generic.h"
21
22#ifdef CONFIG_PXA3xx
23extern void __init pxa3xx_dt_init_irq(void);
24
25static const struct of_dev_auxdata pxa3xx_auxdata_lookup[] __initconst = {
26 OF_DEV_AUXDATA("mrvl,pxa-uart", 0x40100000, "pxa2xx-uart.0", NULL),
27 OF_DEV_AUXDATA("mrvl,pxa-uart", 0x40200000, "pxa2xx-uart.1", NULL),
28 OF_DEV_AUXDATA("mrvl,pxa-uart", 0x40700000, "pxa2xx-uart.2", NULL),
29 OF_DEV_AUXDATA("mrvl,pxa-uart", 0x41600000, "pxa2xx-uart.3", NULL),
30 OF_DEV_AUXDATA("marvell,pxa-mmc", 0x41100000, "pxa2xx-mci.0", NULL),
31 OF_DEV_AUXDATA("mrvl,pxa-gpio", 0x40e00000, "pxa-gpio", NULL),
32 OF_DEV_AUXDATA("marvell,pxa-ohci", 0x4c000000, "pxa27x-ohci", NULL),
33 OF_DEV_AUXDATA("mrvl,pxa-i2c", 0x40301680, "pxa2xx-i2c.0", NULL),
34 OF_DEV_AUXDATA("mrvl,pwri2c", 0x40f500c0, "pxa3xx-i2c.1", NULL),
35 OF_DEV_AUXDATA("marvell,pxa3xx-nand", 0x43100000, "pxa3xx-nand", NULL),
36 {}
37};
38
39static void __init pxa3xx_dt_init(void)
40{
41 of_platform_populate(NULL, of_default_bus_match_table,
42 pxa3xx_auxdata_lookup, NULL);
43}
44
45static const char *pxa3xx_dt_board_compat[] __initdata = {
46 "marvell,pxa300",
47 "marvell,pxa310",
48 "marvell,pxa320",
49 NULL,
50};
51#endif
52
53#ifdef CONFIG_PXA3xx
54DT_MACHINE_START(PXA_DT, "Marvell PXA3xx (Device Tree Support)")
55 .map_io = pxa3xx_map_io,
56 .init_irq = pxa3xx_dt_init_irq,
57 .handle_irq = pxa3xx_handle_irq,
58 .timer = &pxa_timer,
59 .restart = pxa_restart,
60 .init_machine = pxa3xx_dt_init,
61 .dt_compat = pxa3xx_dt_board_compat,
62MACHINE_END
63#endif
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 4726c246dcd..8047ee0effc 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -30,7 +30,7 @@
30#include <mach/irqs.h> 30#include <mach/irqs.h>
31#include <mach/pxa27x.h> 31#include <mach/pxa27x.h>
32#include <mach/reset.h> 32#include <mach/reset.h>
33#include <mach/ohci.h> 33#include <linux/platform_data/usb-ohci-pxa27x.h>
34#include <mach/pm.h> 34#include <mach/pm.h>
35#include <mach/dma.h> 35#include <mach/dma.h>
36#include <mach/smemc.h> 36#include <mach/smemc.h>
diff --git a/arch/arm/mach-pxa/pxa2xx.c b/arch/arm/mach-pxa/pxa2xx.c
index f8ec85450c4..447dcbb22f6 100644
--- a/arch/arm/mach-pxa/pxa2xx.c
+++ b/arch/arm/mach-pxa/pxa2xx.c
@@ -19,7 +19,7 @@
19#include <mach/pxa2xx-regs.h> 19#include <mach/pxa2xx-regs.h>
20#include <mach/mfp-pxa25x.h> 20#include <mach/mfp-pxa25x.h>
21#include <mach/reset.h> 21#include <mach/reset.h>
22#include <mach/irda.h> 22#include <linux/platform_data/irda-pxaficp.h>
23 23
24void pxa2xx_clear_reset_status(unsigned int mask) 24void pxa2xx_clear_reset_status(unsigned int mask)
25{ 25{
diff --git a/arch/arm/mach-pxa/pxa3xx-ulpi.c b/arch/arm/mach-pxa/pxa3xx-ulpi.c
index 5ead6d480c6..7dbe3ccf199 100644
--- a/arch/arm/mach-pxa/pxa3xx-ulpi.c
+++ b/arch/arm/mach-pxa/pxa3xx-ulpi.c
@@ -27,7 +27,7 @@
27 27
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/regs-u2d.h> 29#include <mach/regs-u2d.h>
30#include <mach/pxa3xx-u2d.h> 30#include <linux/platform_data/usb-pxa3xx-ulpi.h>
31 31
32struct pxa3xx_u2d_ulpi { 32struct pxa3xx_u2d_ulpi {
33 struct clk *clk; 33 struct clk *clk;
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index dffb7e813d9..656a1bb16d1 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -19,6 +19,7 @@
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/of.h>
22#include <linux/syscore_ops.h> 23#include <linux/syscore_ops.h>
23#include <linux/i2c/pxa-i2c.h> 24#include <linux/i2c/pxa-i2c.h>
24 25
@@ -27,7 +28,7 @@
27#include <mach/hardware.h> 28#include <mach/hardware.h>
28#include <mach/pxa3xx-regs.h> 29#include <mach/pxa3xx-regs.h>
29#include <mach/reset.h> 30#include <mach/reset.h>
30#include <mach/ohci.h> 31#include <linux/platform_data/usb-ohci-pxa27x.h>
31#include <mach/pm.h> 32#include <mach/pm.h>
32#include <mach/dma.h> 33#include <mach/dma.h>
33#include <mach/smemc.h> 34#include <mach/smemc.h>
@@ -40,6 +41,8 @@
40#define PECR_IE(n) ((1 << ((n) * 2)) << 28) 41#define PECR_IE(n) ((1 << ((n) * 2)) << 28)
41#define PECR_IS(n) ((1 << ((n) * 2)) << 29) 42#define PECR_IS(n) ((1 << ((n) * 2)) << 29)
42 43
44extern void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int));
45
43static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1); 46static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1);
44static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1); 47static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1);
45static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1); 48static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1);
@@ -382,7 +385,7 @@ static void __init pxa_init_ext_wakeup_irq(int (*fn)(struct irq_data *,
382 pxa_ext_wakeup_chip.irq_set_wake = fn; 385 pxa_ext_wakeup_chip.irq_set_wake = fn;
383} 386}
384 387
385void __init pxa3xx_init_irq(void) 388static void __init __pxa3xx_init_irq(void)
386{ 389{
387 /* enable CP6 access */ 390 /* enable CP6 access */
388 u32 value; 391 u32 value;
@@ -390,10 +393,23 @@ void __init pxa3xx_init_irq(void)
390 value |= (1 << 6); 393 value |= (1 << 6);
391 __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value)); 394 __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value));
392 395
393 pxa_init_irq(56, pxa3xx_set_wake);
394 pxa_init_ext_wakeup_irq(pxa3xx_set_wake); 396 pxa_init_ext_wakeup_irq(pxa3xx_set_wake);
395} 397}
396 398
399void __init pxa3xx_init_irq(void)
400{
401 __pxa3xx_init_irq();
402 pxa_init_irq(56, pxa3xx_set_wake);
403}
404
405#ifdef CONFIG_OF
406void __init pxa3xx_dt_init_irq(void)
407{
408 __pxa3xx_init_irq();
409 pxa_dt_irq_init(pxa3xx_set_wake);
410}
411#endif /* CONFIG_OF */
412
397static struct map_desc pxa3xx_io_desc[] __initdata = { 413static struct map_desc pxa3xx_io_desc[] __initdata = {
398 { /* Mem Ctl */ 414 { /* Mem Ctl */
399 .virtual = (unsigned long)SMEMC_VIRT, 415 .virtual = (unsigned long)SMEMC_VIRT,
@@ -466,7 +482,8 @@ static int __init pxa3xx_init(void)
466 register_syscore_ops(&pxa3xx_mfp_syscore_ops); 482 register_syscore_ops(&pxa3xx_mfp_syscore_ops);
467 register_syscore_ops(&pxa3xx_clock_syscore_ops); 483 register_syscore_ops(&pxa3xx_clock_syscore_ops);
468 484
469 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 485 if (!of_have_populated_dt())
486 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
470 } 487 }
471 488
472 return ret; 489 return ret;
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index d89d87ae144..25b08bfa997 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -49,10 +49,10 @@
49#include <asm/mach/arch.h> 49#include <asm/mach/arch.h>
50 50
51#include <mach/pxa300.h> 51#include <mach/pxa300.h>
52#include <mach/ohci.h> 52#include <linux/platform_data/usb-ohci-pxa27x.h>
53#include <mach/pxafb.h> 53#include <linux/platform_data/video-pxafb.h>
54#include <mach/mmc.h> 54#include <linux/platform_data/mmc-pxamci.h>
55#include <plat/pxa3xx_nand.h> 55#include <linux/platform_data/mtd-nand-pxa3xx.h>
56 56
57#include "generic.h" 57#include "generic.h"
58#include "devices.h" 58#include "devices.h"
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c
index 86c95a5d853..08d87a5d263 100644
--- a/arch/arm/mach-pxa/saar.c
+++ b/arch/arm/mach-pxa/saar.c
@@ -32,7 +32,7 @@
32#include <asm/mach/flash.h> 32#include <asm/mach/flash.h>
33 33
34#include <mach/pxa930.h> 34#include <mach/pxa930.h>
35#include <mach/pxafb.h> 35#include <linux/platform_data/video-pxafb.h>
36 36
37#include "devices.h" 37#include "devices.h"
38#include "generic.h" 38#include "generic.h"
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index bdf4cb88ca0..ec55c575ed1 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -55,7 +55,6 @@
55#ifdef CONFIG_PM 55#ifdef CONFIG_PM
56static int sharpsl_off_charge_battery(void); 56static int sharpsl_off_charge_battery(void);
57static int sharpsl_check_battery_voltage(void); 57static int sharpsl_check_battery_voltage(void);
58static int sharpsl_fatal_check(void);
59#endif 58#endif
60static int sharpsl_check_battery_temp(void); 59static int sharpsl_check_battery_temp(void);
61static int sharpsl_ac_check(void); 60static int sharpsl_ac_check(void);
@@ -579,8 +578,8 @@ static int sharpsl_ac_check(void)
579static int sharpsl_pm_suspend(struct platform_device *pdev, pm_message_t state) 578static int sharpsl_pm_suspend(struct platform_device *pdev, pm_message_t state)
580{ 579{
581 sharpsl_pm.flags |= SHARPSL_SUSPENDED; 580 sharpsl_pm.flags |= SHARPSL_SUSPENDED;
582 flush_delayed_work_sync(&toggle_charger); 581 flush_delayed_work(&toggle_charger);
583 flush_delayed_work_sync(&sharpsl_bat); 582 flush_delayed_work(&sharpsl_bat);
584 583
585 if (sharpsl_pm.charge_mode == CHRG_ON) 584 if (sharpsl_pm.charge_mode == CHRG_ON)
586 sharpsl_pm.flags |= SHARPSL_DO_OFFLINE_CHRG; 585 sharpsl_pm.flags |= SHARPSL_DO_OFFLINE_CHRG;
@@ -686,53 +685,6 @@ static int corgi_pxa_pm_enter(suspend_state_t state)
686 return 0; 685 return 0;
687} 686}
688 687
689/*
690 * Check for fatal battery errors
691 * Fatal returns -1
692 */
693static int sharpsl_fatal_check(void)
694{
695 int buff[5], temp, i, acin;
696
697 dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check entered\n");
698
699 /* Check AC-Adapter */
700 acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN);
701
702 if (acin && (sharpsl_pm.charge_mode == CHRG_ON)) {
703 sharpsl_pm.machinfo->charge(0);
704 udelay(100);
705 sharpsl_pm.machinfo->discharge(1); /* enable discharge */
706 mdelay(SHARPSL_WAIT_DISCHARGE_ON);
707 }
708
709 if (sharpsl_pm.machinfo->discharge1)
710 sharpsl_pm.machinfo->discharge1(1);
711
712 /* Check battery : check inserting battery ? */
713 for (i = 0; i < 5; i++) {
714 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
715 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT);
716 }
717
718 if (sharpsl_pm.machinfo->discharge1)
719 sharpsl_pm.machinfo->discharge1(0);
720
721 if (acin && (sharpsl_pm.charge_mode == CHRG_ON)) {
722 udelay(100);
723 sharpsl_pm.machinfo->charge(1);
724 sharpsl_pm.machinfo->discharge(0);
725 }
726
727 temp = get_select_val(buff);
728 dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check: acin: %d, discharge voltage: %d, no discharge: %ld\n", acin, temp, sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT));
729
730 if ((acin && (temp < sharpsl_pm.machinfo->fatal_acin_volt)) ||
731 (!acin && (temp < sharpsl_pm.machinfo->fatal_noacin_volt)))
732 return -1;
733 return 0;
734}
735
736static int sharpsl_off_charge_error(void) 688static int sharpsl_off_charge_error(void)
737{ 689{
738 dev_err(sharpsl_pm.dev, "Offline Charger: Error occurred.\n"); 690 dev_err(sharpsl_pm.dev, "Offline Charger: Error occurred.\n");
@@ -879,7 +831,7 @@ static const struct platform_suspend_ops sharpsl_pm_ops = {
879 831
880static int __devinit sharpsl_pm_probe(struct platform_device *pdev) 832static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
881{ 833{
882 int ret; 834 int ret, irq;
883 835
884 if (!pdev->dev.platform_data) 836 if (!pdev->dev.platform_data)
885 return -EINVAL; 837 return -EINVAL;
@@ -907,24 +859,28 @@ static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
907 gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock); 859 gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock);
908 860
909 /* Register interrupt handlers */ 861 /* Register interrupt handlers */
910 if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) { 862 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_acin);
911 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin)); 863 if (request_irq(irq, sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) {
864 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
912 } 865 }
913 866
914 if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) { 867 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock);
915 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock)); 868 if (request_irq(irq, sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) {
869 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
916 } 870 }
917 871
918 if (sharpsl_pm.machinfo->gpio_fatal) { 872 if (sharpsl_pm.machinfo->gpio_fatal) {
919 if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) { 873 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal);
920 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal)); 874 if (request_irq(irq, sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) {
875 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
921 } 876 }
922 } 877 }
923 878
924 if (sharpsl_pm.machinfo->batfull_irq) { 879 if (sharpsl_pm.machinfo->batfull_irq) {
925 /* Register interrupt handler. */ 880 /* Register interrupt handler. */
926 if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) { 881 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull);
927 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull)); 882 if (request_irq(irq, sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) {
883 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
928 } 884 }
929 } 885 }
930 886
@@ -953,14 +909,14 @@ static int sharpsl_pm_remove(struct platform_device *pdev)
953 909
954 led_trigger_unregister_simple(sharpsl_charge_led_trigger); 910 led_trigger_unregister_simple(sharpsl_charge_led_trigger);
955 911
956 free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr); 912 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr);
957 free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr); 913 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);
958 914
959 if (sharpsl_pm.machinfo->gpio_fatal) 915 if (sharpsl_pm.machinfo->gpio_fatal)
960 free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr); 916 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);
961 917
962 if (sharpsl_pm.machinfo->batfull_irq) 918 if (sharpsl_pm.machinfo->batfull_irq)
963 free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr); 919 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
964 920
965 gpio_free(sharpsl_pm.machinfo->gpio_batlock); 921 gpio_free(sharpsl_pm.machinfo->gpio_batlock);
966 gpio_free(sharpsl_pm.machinfo->gpio_batfull); 922 gpio_free(sharpsl_pm.machinfo->gpio_batfull);
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 363d91b44ec..2073f0e6db0 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -41,10 +41,10 @@
41#include <mach/pxa27x.h> 41#include <mach/pxa27x.h>
42#include <mach/pxa27x-udc.h> 42#include <mach/pxa27x-udc.h>
43#include <mach/reset.h> 43#include <mach/reset.h>
44#include <mach/irda.h> 44#include <linux/platform_data/irda-pxaficp.h>
45#include <mach/mmc.h> 45#include <linux/platform_data/mmc-pxamci.h>
46#include <mach/ohci.h> 46#include <linux/platform_data/usb-ohci-pxa27x.h>
47#include <mach/pxafb.h> 47#include <linux/platform_data/video-pxafb.h>
48#include <mach/spitz.h> 48#include <mach/spitz.h>
49#include <mach/sharpsl_pm.h> 49#include <mach/sharpsl_pm.h>
50#include <mach/smemc.h> 50#include <mach/smemc.h>
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index 30b1b0b3c7f..456560b5aad 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -44,7 +44,7 @@
44#include <asm/mach/flash.h> 44#include <asm/mach/flash.h>
45 45
46#include <mach/pxa27x.h> 46#include <mach/pxa27x.h>
47#include <mach/mmc.h> 47#include <linux/platform_data/mmc-pxamci.h>
48#include <mach/udc.h> 48#include <mach/udc.h>
49#include <mach/pxa27x-udc.h> 49#include <mach/pxa27x-udc.h>
50#include <mach/smemc.h> 50#include <mach/smemc.h>
@@ -52,7 +52,7 @@
52#include <linux/spi/spi.h> 52#include <linux/spi/spi.h>
53#include <linux/spi/pxa2xx_spi.h> 53#include <linux/spi/pxa2xx_spi.h>
54#include <linux/mfd/da903x.h> 54#include <linux/mfd/da903x.h>
55#include <linux/sht15.h> 55#include <linux/platform_data/sht15.h>
56 56
57#include "devices.h" 57#include "devices.h"
58#include "generic.h" 58#include "generic.h"
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c
index 736bfdc50ee..1a25f8a7b0c 100644
--- a/arch/arm/mach-pxa/tavorevb.c
+++ b/arch/arm/mach-pxa/tavorevb.c
@@ -24,8 +24,8 @@
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25 25
26#include <mach/pxa930.h> 26#include <mach/pxa930.h>
27#include <mach/pxafb.h> 27#include <linux/platform_data/video-pxafb.h>
28#include <plat/pxa27x_keypad.h> 28#include <linux/platform_data/keypad-pxa27x.h>
29 29
30#include "devices.h" 30#include "devices.h"
31#include "generic.h" 31#include "generic.h"
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 4d4eb60bad1..233629edf7e 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -42,8 +42,8 @@
42 42
43#include <mach/pxa25x.h> 43#include <mach/pxa25x.h>
44#include <mach/reset.h> 44#include <mach/reset.h>
45#include <mach/irda.h> 45#include <linux/platform_data/irda-pxaficp.h>
46#include <mach/mmc.h> 46#include <linux/platform_data/mmc-pxamci.h>
47#include <mach/udc.h> 47#include <mach/udc.h>
48#include <mach/tosa_bt.h> 48#include <mach/tosa_bt.h>
49#include <mach/audio.h> 49#include <mach/audio.h>
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index 166dd32cc1d..fbbcbed4d1d 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -43,10 +43,10 @@
43#include <mach/pxa27x.h> 43#include <mach/pxa27x.h>
44#include <mach/trizeps4.h> 44#include <mach/trizeps4.h>
45#include <mach/audio.h> 45#include <mach/audio.h>
46#include <mach/pxafb.h> 46#include <linux/platform_data/video-pxafb.h>
47#include <mach/mmc.h> 47#include <linux/platform_data/mmc-pxamci.h>
48#include <mach/irda.h> 48#include <linux/platform_data/irda-pxaficp.h>
49#include <mach/ohci.h> 49#include <linux/platform_data/usb-ohci-pxa27x.h>
50#include <mach/smemc.h> 50#include <mach/smemc.h>
51 51
52#include "generic.h" 52#include "generic.h"
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 130379fb9d0..c773e4dded6 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -48,9 +48,9 @@
48 48
49#include <mach/pxa25x.h> 49#include <mach/pxa25x.h>
50#include <mach/audio.h> 50#include <mach/audio.h>
51#include <mach/pxafb.h> 51#include <linux/platform_data/video-pxafb.h>
52#include <mach/regs-uart.h> 52#include <mach/regs-uart.h>
53#include <mach/arcom-pcmcia.h> 53#include <linux/platform_data/pcmcia-pxa2xx_viper.h>
54#include <mach/viper.h> 54#include <mach/viper.h>
55 55
56#include <asm/setup.h> 56#include <asm/setup.h>
@@ -768,8 +768,7 @@ static unsigned long viper_tpm;
768 768
769static int __init viper_tpm_setup(char *str) 769static int __init viper_tpm_setup(char *str)
770{ 770{
771 strict_strtoul(str, 10, &viper_tpm); 771 return strict_strtoul(str, 10, &viper_tpm) >= 0;
772 return 1;
773} 772}
774 773
775__setup("tpm=", viper_tpm_setup); 774__setup("tpm=", viper_tpm_setup);
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index e1740acd15f..491b6c9a2a9 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -33,12 +33,12 @@
33#include <mach/pxa27x.h> 33#include <mach/pxa27x.h>
34#include <mach/audio.h> 34#include <mach/audio.h>
35#include <mach/vpac270.h> 35#include <mach/vpac270.h>
36#include <mach/mmc.h> 36#include <linux/platform_data/mmc-pxamci.h>
37#include <mach/pxafb.h> 37#include <linux/platform_data/video-pxafb.h>
38#include <mach/ohci.h> 38#include <linux/platform_data/usb-ohci-pxa27x.h>
39#include <mach/pxa27x-udc.h> 39#include <mach/pxa27x-udc.h>
40#include <mach/udc.h> 40#include <mach/udc.h>
41#include <mach/pata_pxa.h> 41#include <linux/platform_data/ata-pxa.h>
42 42
43#include "generic.h" 43#include "generic.h"
44#include "devices.h" 44#include "devices.h"
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index b9320cb8a11..97529face7a 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -37,9 +37,9 @@
37#include <mach/pxa27x.h> 37#include <mach/pxa27x.h>
38#include <mach/mfp-pxa27x.h> 38#include <mach/mfp-pxa27x.h>
39#include <mach/z2.h> 39#include <mach/z2.h>
40#include <mach/pxafb.h> 40#include <linux/platform_data/video-pxafb.h>
41#include <mach/mmc.h> 41#include <linux/platform_data/mmc-pxamci.h>
42#include <plat/pxa27x_keypad.h> 42#include <linux/platform_data/keypad-pxa27x.h>
43#include <mach/pm.h> 43#include <mach/pm.h>
44 44
45#include "generic.h" 45#include "generic.h"
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index af3d4f7646d..abd3aa14508 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -38,14 +38,14 @@
38 38
39#include <mach/pxa27x.h> 39#include <mach/pxa27x.h>
40#include <mach/regs-uart.h> 40#include <mach/regs-uart.h>
41#include <mach/ohci.h> 41#include <linux/platform_data/usb-ohci-pxa27x.h>
42#include <mach/mmc.h> 42#include <linux/platform_data/mmc-pxamci.h>
43#include <mach/pxa27x-udc.h> 43#include <mach/pxa27x-udc.h>
44#include <mach/udc.h> 44#include <mach/udc.h>
45#include <mach/pxafb.h> 45#include <linux/platform_data/video-pxafb.h>
46#include <mach/pm.h> 46#include <mach/pm.h>
47#include <mach/audio.h> 47#include <mach/audio.h>
48#include <mach/arcom-pcmcia.h> 48#include <linux/platform_data/pcmcia-pxa2xx_viper.h>
49#include <mach/zeus.h> 49#include <mach/zeus.h>
50#include <mach/smemc.h> 50#include <mach/smemc.h>
51 51
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c
index 98eec80623e..226279fac9d 100644
--- a/arch/arm/mach-pxa/zylonite.c
+++ b/arch/arm/mach-pxa/zylonite.c
@@ -26,12 +26,12 @@
26#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
27#include <mach/pxa3xx.h> 27#include <mach/pxa3xx.h>
28#include <mach/audio.h> 28#include <mach/audio.h>
29#include <mach/pxafb.h> 29#include <linux/platform_data/video-pxafb.h>
30#include <mach/zylonite.h> 30#include <mach/zylonite.h>
31#include <mach/mmc.h> 31#include <linux/platform_data/mmc-pxamci.h>
32#include <mach/ohci.h> 32#include <linux/platform_data/usb-ohci-pxa27x.h>
33#include <plat/pxa27x_keypad.h> 33#include <linux/platform_data/keypad-pxa27x.h>
34#include <plat/pxa3xx_nand.h> 34#include <linux/platform_data/mtd-nand-pxa3xx.h>
35 35
36#include "devices.h" 36#include "devices.h"
37#include "generic.h" 37#include "generic.h"
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index c593be428b8..14c1d47e1ab 100644
--- a/arch/arm/mach-realview/Kconfig
+++ b/arch/arm/mach-realview/Kconfig
@@ -21,8 +21,8 @@ config REALVIEW_EB_A9MP
21config REALVIEW_EB_ARM11MP 21config REALVIEW_EB_ARM11MP
22 bool "Support ARM11MPCore Tile" 22 bool "Support ARM11MPCore Tile"
23 depends on MACH_REALVIEW_EB 23 depends on MACH_REALVIEW_EB
24 select CPU_V6K
25 select ARCH_HAS_BARRIERS if SMP 24 select ARCH_HAS_BARRIERS if SMP
25 select CPU_V6K
26 select HAVE_SMP 26 select HAVE_SMP
27 select MIGHT_HAVE_CACHE_L2X0 27 select MIGHT_HAVE_CACHE_L2X0
28 help 28 help
@@ -40,12 +40,12 @@ config REALVIEW_EB_ARM11MP_REVB
40 40
41config MACH_REALVIEW_PB11MP 41config MACH_REALVIEW_PB11MP
42 bool "Support RealView(R) Platform Baseboard for ARM11MPCore" 42 bool "Support RealView(R) Platform Baseboard for ARM11MPCore"
43 select CPU_V6K 43 select ARCH_HAS_BARRIERS if SMP
44 select ARM_GIC 44 select ARM_GIC
45 select CPU_V6K
45 select HAVE_PATA_PLATFORM 46 select HAVE_PATA_PLATFORM
46 select HAVE_SMP 47 select HAVE_SMP
47 select MIGHT_HAVE_CACHE_L2X0 48 select MIGHT_HAVE_CACHE_L2X0
48 select ARCH_HAS_BARRIERS if SMP
49 help 49 help
50 Include support for the ARM(R) RealView(R) Platform Baseboard for 50 Include support for the ARM(R) RealView(R) Platform Baseboard for
51 the ARM11MPCore. This platform has an on-board ARM11MPCore and has 51 the ARM11MPCore. This platform has an on-board ARM11MPCore and has
@@ -54,8 +54,8 @@ config MACH_REALVIEW_PB11MP
54# ARMv6 CPU without K extensions, but does have the new exclusive ops 54# ARMv6 CPU without K extensions, but does have the new exclusive ops
55config MACH_REALVIEW_PB1176 55config MACH_REALVIEW_PB1176
56 bool "Support RealView(R) Platform Baseboard for ARM1176JZF-S" 56 bool "Support RealView(R) Platform Baseboard for ARM1176JZF-S"
57 select CPU_V6
58 select ARM_GIC 57 select ARM_GIC
58 select CPU_V6
59 select HAVE_TCM 59 select HAVE_TCM
60 select MIGHT_HAVE_CACHE_L2X0 60 select MIGHT_HAVE_CACHE_L2X0
61 help 61 help
@@ -73,8 +73,8 @@ config REALVIEW_PB1176_SECURE_FLASH
73 73
74config MACH_REALVIEW_PBA8 74config MACH_REALVIEW_PBA8
75 bool "Support RealView(R) Platform Baseboard for Cortex(tm)-A8 platform" 75 bool "Support RealView(R) Platform Baseboard for Cortex(tm)-A8 platform"
76 select CPU_V7
77 select ARM_GIC 76 select ARM_GIC
77 select CPU_V7
78 select HAVE_PATA_PLATFORM 78 select HAVE_PATA_PLATFORM
79 help 79 help
80 Include support for the ARM(R) RealView Platform Baseboard for 80 Include support for the ARM(R) RealView Platform Baseboard for
@@ -83,11 +83,11 @@ config MACH_REALVIEW_PBA8
83 83
84config MACH_REALVIEW_PBX 84config MACH_REALVIEW_PBX
85 bool "Support RealView(R) Platform Baseboard Explore" 85 bool "Support RealView(R) Platform Baseboard Explore"
86 select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET
86 select ARM_GIC 87 select ARM_GIC
87 select HAVE_PATA_PLATFORM 88 select HAVE_PATA_PLATFORM
88 select HAVE_SMP 89 select HAVE_SMP
89 select MIGHT_HAVE_CACHE_L2X0 90 select MIGHT_HAVE_CACHE_L2X0
90 select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET
91 select ZONE_DMA if SPARSEMEM 91 select ZONE_DMA if SPARSEMEM
92 help 92 help
93 Include support for the ARM(R) RealView(R) Platform Baseboard 93 Include support for the ARM(R) RealView(R) Platform Baseboard
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 45868bb43cb..68246748058 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -30,12 +30,10 @@
30#include <linux/ata_platform.h> 30#include <linux/ata_platform.h>
31#include <linux/amba/mmci.h> 31#include <linux/amba/mmci.h>
32#include <linux/gfp.h> 32#include <linux/gfp.h>
33#include <linux/clkdev.h>
34#include <linux/mtd/physmap.h> 33#include <linux/mtd/physmap.h>
35 34
36#include <mach/hardware.h> 35#include <mach/hardware.h>
37#include <asm/irq.h> 36#include <asm/irq.h>
38#include <asm/leds.h>
39#include <asm/mach-types.h> 37#include <asm/mach-types.h>
40#include <asm/hardware/arm_timer.h> 38#include <asm/hardware/arm_timer.h>
41#include <asm/hardware/icst.h> 39#include <asm/hardware/icst.h>
@@ -226,115 +224,10 @@ struct mmci_platform_data realview_mmc1_plat_data = {
226 .cd_invert = true, 224 .cd_invert = true,
227}; 225};
228 226
229/*
230 * Clock handling
231 */
232static const struct icst_params realview_oscvco_params = {
233 .ref = 24000000,
234 .vco_max = ICST307_VCO_MAX,
235 .vco_min = ICST307_VCO_MIN,
236 .vd_min = 4 + 8,
237 .vd_max = 511 + 8,
238 .rd_min = 1 + 2,
239 .rd_max = 127 + 2,
240 .s2div = icst307_s2div,
241 .idx2s = icst307_idx2s,
242};
243
244static void realview_oscvco_set(struct clk *clk, struct icst_vco vco)
245{
246 void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET;
247 u32 val;
248
249 val = readl(clk->vcoreg) & ~0x7ffff;
250 val |= vco.v | (vco.r << 9) | (vco.s << 16);
251
252 writel(0xa05f, sys_lock);
253 writel(val, clk->vcoreg);
254 writel(0, sys_lock);
255}
256
257static const struct clk_ops oscvco_clk_ops = {
258 .round = icst_clk_round,
259 .set = icst_clk_set,
260 .setvco = realview_oscvco_set,
261};
262
263static struct clk oscvco_clk = {
264 .ops = &oscvco_clk_ops,
265 .params = &realview_oscvco_params,
266};
267
268/*
269 * These are fixed clocks.
270 */
271static struct clk ref24_clk = {
272 .rate = 24000000,
273};
274
275static struct clk sp804_clk = {
276 .rate = 1000000,
277};
278
279static struct clk dummy_apb_pclk;
280
281static struct clk_lookup lookups[] = {
282 { /* Bus clock */
283 .con_id = "apb_pclk",
284 .clk = &dummy_apb_pclk,
285 }, { /* UART0 */
286 .dev_id = "dev:uart0",
287 .clk = &ref24_clk,
288 }, { /* UART1 */
289 .dev_id = "dev:uart1",
290 .clk = &ref24_clk,
291 }, { /* UART2 */
292 .dev_id = "dev:uart2",
293 .clk = &ref24_clk,
294 }, { /* UART3 */
295 .dev_id = "fpga:uart3",
296 .clk = &ref24_clk,
297 }, { /* UART3 is on the dev chip in PB1176 */
298 .dev_id = "dev:uart3",
299 .clk = &ref24_clk,
300 }, { /* UART4 only exists in PB1176 */
301 .dev_id = "fpga:uart4",
302 .clk = &ref24_clk,
303 }, { /* KMI0 */
304 .dev_id = "fpga:kmi0",
305 .clk = &ref24_clk,
306 }, { /* KMI1 */
307 .dev_id = "fpga:kmi1",
308 .clk = &ref24_clk,
309 }, { /* MMC0 */
310 .dev_id = "fpga:mmc0",
311 .clk = &ref24_clk,
312 }, { /* CLCD is in the PB1176 and EB DevChip */
313 .dev_id = "dev:clcd",
314 .clk = &oscvco_clk,
315 }, { /* PB:CLCD */
316 .dev_id = "issp:clcd",
317 .clk = &oscvco_clk,
318 }, { /* SSP */
319 .dev_id = "dev:ssp0",
320 .clk = &ref24_clk,
321 }, { /* SP804 timers */
322 .dev_id = "sp804",
323 .clk = &sp804_clk,
324 },
325};
326
327void __init realview_init_early(void) 227void __init realview_init_early(void)
328{ 228{
329 void __iomem *sys = __io_address(REALVIEW_SYS_BASE); 229 void __iomem *sys = __io_address(REALVIEW_SYS_BASE);
330 230
331 if (machine_is_realview_pb1176())
332 oscvco_clk.vcoreg = sys + REALVIEW_SYS_OSC0_OFFSET;
333 else
334 oscvco_clk.vcoreg = sys + REALVIEW_SYS_OSC4_OFFSET;
335
336 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
337
338 versatile_sched_clock_init(sys + REALVIEW_SYS_24MHz_OFFSET, 24000000); 231 versatile_sched_clock_init(sys + REALVIEW_SYS_24MHz_OFFSET, 24000000);
339} 232}
340 233
@@ -436,44 +329,6 @@ struct clcd_board clcd_plat_data = {
436 .remove = versatile_clcd_remove_dma, 329 .remove = versatile_clcd_remove_dma,
437}; 330};
438 331
439#ifdef CONFIG_LEDS
440#define VA_LEDS_BASE (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LED_OFFSET)
441
442void realview_leds_event(led_event_t ledevt)
443{
444 unsigned long flags;
445 u32 val;
446 u32 led = 1 << smp_processor_id();
447
448 local_irq_save(flags);
449 val = readl(VA_LEDS_BASE);
450
451 switch (ledevt) {
452 case led_idle_start:
453 val = val & ~led;
454 break;
455
456 case led_idle_end:
457 val = val | led;
458 break;
459
460 case led_timer:
461 val = val ^ REALVIEW_SYS_LED7;
462 break;
463
464 case led_halted:
465 val = 0;
466 break;
467
468 default:
469 break;
470 }
471
472 writel(val, VA_LEDS_BASE);
473 local_irq_restore(flags);
474}
475#endif /* CONFIG_LEDS */
476
477/* 332/*
478 * Where is the timer (VA)? 333 * Where is the timer (VA)?
479 */ 334 */
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index f8f2c0ac4c0..602ca5ec52c 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -26,7 +26,6 @@
26#include <linux/io.h> 26#include <linux/io.h>
27 27
28#include <asm/setup.h> 28#include <asm/setup.h>
29#include <asm/leds.h>
30 29
31#define APB_DEVICE(name, busid, base, plat) \ 30#define APB_DEVICE(name, busid, base, plat) \
32static AMBA_APB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat) 31static AMBA_APB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat)
@@ -47,7 +46,6 @@ extern void __iomem *timer1_va_base;
47extern void __iomem *timer2_va_base; 46extern void __iomem *timer2_va_base;
48extern void __iomem *timer3_va_base; 47extern void __iomem *timer3_va_base;
49 48
50extern void realview_leds_event(led_event_t ledevt);
51extern void realview_timer_init(unsigned int timer_irq); 49extern void realview_timer_init(unsigned int timer_irq);
52extern int realview_flash_register(struct resource *res, u32 num); 50extern int realview_flash_register(struct resource *res, u32 num);
53extern int realview_eth_register(const char *name, struct resource *res); 51extern int realview_eth_register(const char *name, struct resource *res);
@@ -56,4 +54,7 @@ extern void realview_init_early(void);
56extern void realview_fixup(struct tag *tags, char **from, 54extern void realview_fixup(struct tag *tags, char **from,
57 struct meminfo *meminfo); 55 struct meminfo *meminfo);
58 56
57extern struct smp_operations realview_smp_ops;
58extern void realview_cpu_die(unsigned int cpu);
59
59#endif 60#endif
diff --git a/arch/arm/mach-realview/hotplug.c b/arch/arm/mach-realview/hotplug.c
index 57d9efba295..53818e5cd3a 100644
--- a/arch/arm/mach-realview/hotplug.c
+++ b/arch/arm/mach-realview/hotplug.c
@@ -16,8 +16,6 @@
16#include <asm/cp15.h> 16#include <asm/cp15.h>
17#include <asm/smp_plat.h> 17#include <asm/smp_plat.h>
18 18
19extern volatile int pen_release;
20
21static inline void cpu_enter_lowpower(void) 19static inline void cpu_enter_lowpower(void)
22{ 20{
23 unsigned int v; 21 unsigned int v;
@@ -89,17 +87,12 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
89 } 87 }
90} 88}
91 89
92int platform_cpu_kill(unsigned int cpu)
93{
94 return 1;
95}
96
97/* 90/*
98 * platform-specific code to shutdown a CPU 91 * platform-specific code to shutdown a CPU
99 * 92 *
100 * Called with IRQs disabled 93 * Called with IRQs disabled
101 */ 94 */
102void platform_cpu_die(unsigned int cpu) 95void __ref realview_cpu_die(unsigned int cpu)
103{ 96{
104 int spurious = 0; 97 int spurious = 0;
105 98
@@ -118,12 +111,3 @@ void platform_cpu_die(unsigned int cpu)
118 if (spurious) 111 if (spurious)
119 pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); 112 pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
120} 113}
121
122int platform_cpu_disable(unsigned int cpu)
123{
124 /*
125 * we don't allow CPU 0 to be shutdown (it is still too special
126 * e.g. clock tick interrupts)
127 */
128 return cpu == 0 ? -EPERM : 0;
129}
diff --git a/arch/arm/mach-realview/include/mach/clkdev.h b/arch/arm/mach-realview/include/mach/clkdev.h
deleted file mode 100644
index e58d0771b64..00000000000
--- a/arch/arm/mach-realview/include/mach/clkdev.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H
3
4#include <plat/clock.h>
5
6struct clk {
7 unsigned long rate;
8 const struct clk_ops *ops;
9 const struct icst_params *params;
10 void __iomem *vcoreg;
11};
12
13#define __clk_get(clk) ({ 1; })
14#define __clk_put(clk) do { } while (0)
15
16#endif
diff --git a/arch/arm/mach-realview/include/mach/gpio.h b/arch/arm/mach-realview/include/mach/gpio.h
deleted file mode 100644
index 40a8c178f10..00000000000
--- a/arch/arm/mach-realview/include/mach/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index 17c878ddbc7..300f7064465 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -22,9 +22,9 @@
22#include <mach/board-pb11mp.h> 22#include <mach/board-pb11mp.h>
23#include <mach/board-pbx.h> 23#include <mach/board-pbx.h>
24 24
25#include "core.h" 25#include <plat/platsmp.h>
26 26
27extern void versatile_secondary_startup(void); 27#include "core.h"
28 28
29static void __iomem *scu_base_addr(void) 29static void __iomem *scu_base_addr(void)
30{ 30{
@@ -43,7 +43,7 @@ static void __iomem *scu_base_addr(void)
43 * Initialise the CPU possible map early - this describes the CPUs 43 * Initialise the CPU possible map early - this describes the CPUs
44 * which may be present or become present in the system. 44 * which may be present or become present in the system.
45 */ 45 */
46void __init smp_init_cpus(void) 46static void __init realview_smp_init_cpus(void)
47{ 47{
48 void __iomem *scu_base = scu_base_addr(); 48 void __iomem *scu_base = scu_base_addr();
49 unsigned int i, ncores; 49 unsigned int i, ncores;
@@ -63,7 +63,7 @@ void __init smp_init_cpus(void)
63 set_smp_cross_call(gic_raise_softirq); 63 set_smp_cross_call(gic_raise_softirq);
64} 64}
65 65
66void __init platform_smp_prepare_cpus(unsigned int max_cpus) 66static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
67{ 67{
68 68
69 scu_enable(scu_base_addr()); 69 scu_enable(scu_base_addr());
@@ -77,3 +77,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
77 __raw_writel(virt_to_phys(versatile_secondary_startup), 77 __raw_writel(virt_to_phys(versatile_secondary_startup),
78 __io_address(REALVIEW_SYS_FLAGSSET)); 78 __io_address(REALVIEW_SYS_FLAGSSET));
79} 79}
80
81struct smp_operations realview_smp_ops __initdata = {
82 .smp_init_cpus = realview_smp_init_cpus,
83 .smp_prepare_cpus = realview_smp_prepare_cpus,
84 .smp_secondary_init = versatile_secondary_init,
85 .smp_boot_secondary = versatile_boot_secondary,
86#ifdef CONFIG_HOTPLUG_CPU
87 .cpu_die = realview_cpu_die,
88#endif
89};
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index baf382c5e77..d3b3cd216d6 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -27,12 +27,11 @@
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/platform_data/clk-realview.h>
30 31
31#include <mach/hardware.h> 32#include <mach/hardware.h>
32#include <asm/irq.h> 33#include <asm/irq.h>
33#include <asm/leds.h>
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35#include <asm/pmu.h>
36#include <asm/pgtable.h> 35#include <asm/pgtable.h>
37#include <asm/hardware/gic.h> 36#include <asm/hardware/gic.h>
38#include <asm/hardware/cache-l2x0.h> 37#include <asm/hardware/cache-l2x0.h>
@@ -297,7 +296,7 @@ static struct resource pmu_resources[] = {
297 296
298static struct platform_device pmu_device = { 297static struct platform_device pmu_device = {
299 .name = "arm-pmu", 298 .name = "arm-pmu",
300 .id = ARM_PMU_DEVICE_CPU, 299 .id = -1,
301 .num_resources = ARRAY_SIZE(pmu_resources), 300 .num_resources = ARRAY_SIZE(pmu_resources),
302 .resource = pmu_resources, 301 .resource = pmu_resources,
303}; 302};
@@ -414,6 +413,7 @@ static void __init realview_eb_timer_init(void)
414 else 413 else
415 timer_irq = IRQ_EB_TIMER0_1; 414 timer_irq = IRQ_EB_TIMER0_1;
416 415
416 realview_clk_init(__io_address(REALVIEW_SYS_BASE), false);
417 realview_timer_init(timer_irq); 417 realview_timer_init(timer_irq);
418 realview_eb_twd_init(); 418 realview_eb_twd_init();
419} 419}
@@ -462,10 +462,6 @@ static void __init realview_eb_init(void)
462 struct amba_device *d = amba_devs[i]; 462 struct amba_device *d = amba_devs[i];
463 amba_device_register(d, &iomem_resource); 463 amba_device_register(d, &iomem_resource);
464 } 464 }
465
466#ifdef CONFIG_LEDS
467 leds_event = realview_leds_event;
468#endif
469} 465}
470 466
471MACHINE_START(REALVIEW_EB, "ARM-RealView EB") 467MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index b1d7cafa1a6..07d6672ddae 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -29,12 +29,11 @@
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/platform_data/clk-realview.h>
32 33
33#include <mach/hardware.h> 34#include <mach/hardware.h>
34#include <asm/irq.h> 35#include <asm/irq.h>
35#include <asm/leds.h>
36#include <asm/mach-types.h> 36#include <asm/mach-types.h>
37#include <asm/pmu.h>
38#include <asm/pgtable.h> 37#include <asm/pgtable.h>
39#include <asm/hardware/gic.h> 38#include <asm/hardware/gic.h>
40#include <asm/hardware/cache-l2x0.h> 39#include <asm/hardware/cache-l2x0.h>
@@ -280,7 +279,7 @@ static struct resource pmu_resource = {
280 279
281static struct platform_device pmu_device = { 280static struct platform_device pmu_device = {
282 .name = "arm-pmu", 281 .name = "arm-pmu",
283 .id = ARM_PMU_DEVICE_CPU, 282 .id = -1,
284 .num_resources = 1, 283 .num_resources = 1,
285 .resource = &pmu_resource, 284 .resource = &pmu_resource,
286}; 285};
@@ -326,6 +325,7 @@ static void __init realview_pb1176_timer_init(void)
326 timer2_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE); 325 timer2_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE);
327 timer3_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE) + 0x20; 326 timer3_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE) + 0x20;
328 327
328 realview_clk_init(__io_address(REALVIEW_SYS_BASE), true);
329 realview_timer_init(IRQ_DC1176_TIMER0); 329 realview_timer_init(IRQ_DC1176_TIMER0);
330} 330}
331 331
@@ -375,10 +375,6 @@ static void __init realview_pb1176_init(void)
375 struct amba_device *d = amba_devs[i]; 375 struct amba_device *d = amba_devs[i];
376 amba_device_register(d, &iomem_resource); 376 amba_device_register(d, &iomem_resource);
377 } 377 }
378
379#ifdef CONFIG_LEDS
380 leds_event = realview_leds_event;
381#endif
382} 378}
383 379
384MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176") 380MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index a98c536e332..7ed53d75350 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -27,12 +27,11 @@
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/platform_data/clk-realview.h>
30 31
31#include <mach/hardware.h> 32#include <mach/hardware.h>
32#include <asm/irq.h> 33#include <asm/irq.h>
33#include <asm/leds.h>
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35#include <asm/pmu.h>
36#include <asm/pgtable.h> 35#include <asm/pgtable.h>
37#include <asm/hardware/gic.h> 36#include <asm/hardware/gic.h>
38#include <asm/hardware/cache-l2x0.h> 37#include <asm/hardware/cache-l2x0.h>
@@ -263,7 +262,7 @@ static struct resource pmu_resources[] = {
263 262
264static struct platform_device pmu_device = { 263static struct platform_device pmu_device = {
265 .name = "arm-pmu", 264 .name = "arm-pmu",
266 .id = ARM_PMU_DEVICE_CPU, 265 .id = -1,
267 .num_resources = ARRAY_SIZE(pmu_resources), 266 .num_resources = ARRAY_SIZE(pmu_resources),
268 .resource = pmu_resources, 267 .resource = pmu_resources,
269}; 268};
@@ -312,6 +311,7 @@ static void __init realview_pb11mp_timer_init(void)
312 timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE); 311 timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE);
313 timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20; 312 timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20;
314 313
314 realview_clk_init(__io_address(REALVIEW_SYS_BASE), false);
315 realview_timer_init(IRQ_TC11MP_TIMER0_1); 315 realview_timer_init(IRQ_TC11MP_TIMER0_1);
316 realview_pb11mp_twd_init(); 316 realview_pb11mp_twd_init();
317} 317}
@@ -357,15 +357,12 @@ static void __init realview_pb11mp_init(void)
357 struct amba_device *d = amba_devs[i]; 357 struct amba_device *d = amba_devs[i];
358 amba_device_register(d, &iomem_resource); 358 amba_device_register(d, &iomem_resource);
359 } 359 }
360
361#ifdef CONFIG_LEDS
362 leds_event = realview_leds_event;
363#endif
364} 360}
365 361
366MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore") 362MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
367 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 363 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
368 .atag_offset = 0x100, 364 .atag_offset = 0x100,
365 .smp = smp_ops(realview_smp_ops),
369 .fixup = realview_fixup, 366 .fixup = realview_fixup,
370 .map_io = realview_pb11mp_map_io, 367 .map_io = realview_pb11mp_map_io,
371 .init_early = realview_init_early, 368 .init_early = realview_init_early,
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index 59650174e6e..9992431b8a1 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -27,11 +27,10 @@
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/platform_data/clk-realview.h>
30 31
31#include <asm/irq.h> 32#include <asm/irq.h>
32#include <asm/leds.h>
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/pmu.h>
35#include <asm/pgtable.h> 34#include <asm/pgtable.h>
36#include <asm/hardware/gic.h> 35#include <asm/hardware/gic.h>
37 36
@@ -241,7 +240,7 @@ static struct resource pmu_resource = {
241 240
242static struct platform_device pmu_device = { 241static struct platform_device pmu_device = {
243 .name = "arm-pmu", 242 .name = "arm-pmu",
244 .id = ARM_PMU_DEVICE_CPU, 243 .id = -1,
245 .num_resources = 1, 244 .num_resources = 1,
246 .resource = &pmu_resource, 245 .resource = &pmu_resource,
247}; 246};
@@ -261,6 +260,7 @@ static void __init realview_pba8_timer_init(void)
261 timer2_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE); 260 timer2_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE);
262 timer3_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE) + 0x20; 261 timer3_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE) + 0x20;
263 262
263 realview_clk_init(__io_address(REALVIEW_SYS_BASE), false);
264 realview_timer_init(IRQ_PBA8_TIMER0_1); 264 realview_timer_init(IRQ_PBA8_TIMER0_1);
265} 265}
266 266
@@ -299,10 +299,6 @@ static void __init realview_pba8_init(void)
299 struct amba_device *d = amba_devs[i]; 299 struct amba_device *d = amba_devs[i];
300 amba_device_register(d, &iomem_resource); 300 amba_device_register(d, &iomem_resource);
301 } 301 }
302
303#ifdef CONFIG_LEDS
304 leds_event = realview_leds_event;
305#endif
306} 302}
307 303
308MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8") 304MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 3f2f605624e..4f486f05108 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -26,11 +26,10 @@
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/platform_data/clk-realview.h>
29 30
30#include <asm/irq.h> 31#include <asm/irq.h>
31#include <asm/leds.h>
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33#include <asm/pmu.h>
34#include <asm/smp_twd.h> 33#include <asm/smp_twd.h>
35#include <asm/pgtable.h> 34#include <asm/pgtable.h>
36#include <asm/hardware/gic.h> 35#include <asm/hardware/gic.h>
@@ -280,7 +279,7 @@ static struct resource pmu_resources[] = {
280 279
281static struct platform_device pmu_device = { 280static struct platform_device pmu_device = {
282 .name = "arm-pmu", 281 .name = "arm-pmu",
283 .id = ARM_PMU_DEVICE_CPU, 282 .id = -1,
284 .num_resources = ARRAY_SIZE(pmu_resources), 283 .num_resources = ARRAY_SIZE(pmu_resources),
285 .resource = pmu_resources, 284 .resource = pmu_resources,
286}; 285};
@@ -320,6 +319,7 @@ static void __init realview_pbx_timer_init(void)
320 timer2_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE); 319 timer2_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE);
321 timer3_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE) + 0x20; 320 timer3_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE) + 0x20;
322 321
322 realview_clk_init(__io_address(REALVIEW_SYS_BASE), false);
323 realview_timer_init(IRQ_PBX_TIMER0_1); 323 realview_timer_init(IRQ_PBX_TIMER0_1);
324 realview_pbx_twd_init(); 324 realview_pbx_twd_init();
325} 325}
@@ -394,15 +394,12 @@ static void __init realview_pbx_init(void)
394 struct amba_device *d = amba_devs[i]; 394 struct amba_device *d = amba_devs[i];
395 amba_device_register(d, &iomem_resource); 395 amba_device_register(d, &iomem_resource);
396 } 396 }
397
398#ifdef CONFIG_LEDS
399 leds_event = realview_leds_event;
400#endif
401} 397}
402 398
403MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX") 399MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
404 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 400 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
405 .atag_offset = 0x100, 401 .atag_offset = 0x100,
402 .smp = smp_ops(realview_smp_ops),
406 .fixup = realview_pbx_fixup, 403 .fixup = realview_pbx_fixup,
407 .map_io = realview_pbx_map_io, 404 .map_io = realview_pbx_map_io,
408 .init_early = realview_init_early, 405 .init_early = realview_init_early,
diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c
index b91bc87b3dc..fcb1d59f7ae 100644
--- a/arch/arm/mach-rpc/ecard.c
+++ b/arch/arm/mach-rpc/ecard.c
@@ -960,7 +960,9 @@ static int __init ecard_probe(int slot, unsigned irq, card_type_t type)
960 *ecp = ec; 960 *ecp = ec;
961 slot_to_expcard[slot] = ec; 961 slot_to_expcard[slot] = ec;
962 962
963 device_register(&ec->dev); 963 rc = device_register(&ec->dev);
964 if (rc)
965 goto nodev;
964 966
965 return 0; 967 return 0;
966 968
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
index c5256f4e90b..495f6928cba 100644
--- a/arch/arm/mach-s3c2412/Kconfig
+++ b/arch/arm/mach-s3c2412/Kconfig
@@ -7,7 +7,7 @@
7config S3C2412_CPUFREQ 7config S3C2412_CPUFREQ
8 bool 8 bool
9 depends on CPU_FREQ_S3C24XX && CPU_S3C2412 9 depends on CPU_FREQ_S3C24XX && CPU_S3C2412
10 select S3C2412_IOTIMING
11 default y 10 default y
11 select S3C2412_IOTIMING
12 help 12 help
13 CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs. 13 CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs.
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index ece7a10fe3c..a4d7fd27bec 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -5,8 +5,8 @@
5config S3C2440_CPUFREQ 5config S3C2440_CPUFREQ
6 bool "S3C2440/S3C2442 CPU Frequency scaling support" 6 bool "S3C2440/S3C2442 CPU Frequency scaling support"
7 depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442) 7 depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442)
8 select S3C2410_CPUFREQ_UTILS
9 default y 8 default y
9 select S3C2410_CPUFREQ_UTILS
10 help 10 help
11 CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs. 11 CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs.
12 12
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index d56b0f7f2b2..2b6cb5f29c2 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -17,10 +17,10 @@ config CPU_S3C2410
17 bool "SAMSUNG S3C2410" 17 bool "SAMSUNG S3C2410"
18 default y 18 default y
19 select CPU_ARM920T 19 select CPU_ARM920T
20 select S3C2410_CLOCK
21 select CPU_LLSERIAL_S3C2410 20 select CPU_LLSERIAL_S3C2410
22 select S3C2410_PM if PM 21 select S3C2410_CLOCK
23 select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX 22 select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX
23 select S3C2410_PM if PM
24 help 24 help
25 Support for S3C2410 and S3C2410A family from the S3C24XX line 25 Support for S3C2410 and S3C2410A family from the S3C24XX line
26 of Samsung Mobile CPUs. 26 of Samsung Mobile CPUs.
@@ -30,8 +30,8 @@ config CPU_S3C2412
30 depends on ARCH_S3C24XX 30 depends on ARCH_S3C24XX
31 select CPU_ARM926T 31 select CPU_ARM926T
32 select CPU_LLSERIAL_S3C2440 32 select CPU_LLSERIAL_S3C2440
33 select S3C2412_PM if PM
34 select S3C2412_DMA if S3C24XX_DMA 33 select S3C2412_DMA if S3C24XX_DMA
34 select S3C2412_PM if PM
35 help 35 help
36 Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line 36 Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
37 37
@@ -40,10 +40,10 @@ config CPU_S3C2416
40 depends on ARCH_S3C24XX 40 depends on ARCH_S3C24XX
41 select CPU_ARM926T 41 select CPU_ARM926T
42 select CPU_LLSERIAL_S3C2440 42 select CPU_LLSERIAL_S3C2440
43 select SAMSUNG_CLKSRC 43 select S3C2416_PM if PM
44 select S3C2443_COMMON 44 select S3C2443_COMMON
45 select S3C2443_DMA if S3C24XX_DMA 45 select S3C2443_DMA if S3C24XX_DMA
46 select S3C2416_PM if PM 46 select SAMSUNG_CLKSRC
47 help 47 help
48 Support for the S3C2416 SoC from the S3C24XX line 48 Support for the S3C2416 SoC from the S3C24XX line
49 49
@@ -75,9 +75,9 @@ config CPU_S3C2443
75 depends on ARCH_S3C24XX 75 depends on ARCH_S3C24XX
76 select CPU_ARM920T 76 select CPU_ARM920T
77 select CPU_LLSERIAL_S3C2440 77 select CPU_LLSERIAL_S3C2440
78 select SAMSUNG_CLKSRC
79 select S3C2443_COMMON 78 select S3C2443_COMMON
80 select S3C2443_DMA if S3C24XX_DMA 79 select S3C2443_DMA if S3C24XX_DMA
80 select SAMSUNG_CLKSRC
81 help 81 help
82 Support for the S3C2443 SoC from the S3C24XX line 82 Support for the S3C2443 SoC from the S3C24XX line
83 83
@@ -156,16 +156,16 @@ config MACH_AML_M5900
156 156
157config ARCH_BAST 157config ARCH_BAST
158 bool "Simtec Electronics BAST (EB2410ITX)" 158 bool "Simtec Electronics BAST (EB2410ITX)"
159 select ISA
160 select MACH_BAST_IDE
159 select S3C2410_IOTIMING if S3C2410_CPUFREQ 161 select S3C2410_IOTIMING if S3C2410_CPUFREQ
160 select S3C24XX_SIMTEC_PM if PM 162 select S3C24XX_DCLK
161 select S3C24XX_SIMTEC_NOR 163 select S3C24XX_SIMTEC_NOR
164 select S3C24XX_SIMTEC_PM if PM
162 select S3C24XX_SIMTEC_USB 165 select S3C24XX_SIMTEC_USB
163 select MACH_BAST_IDE
164 select S3C24XX_DCLK
165 select ISA
166 select S3C_DEV_HWMON 166 select S3C_DEV_HWMON
167 select S3C_DEV_USB_HOST
168 select S3C_DEV_NAND 167 select S3C_DEV_NAND
168 select S3C_DEV_USB_HOST
169 help 169 help
170 Say Y here if you are using the Simtec Electronics EB2410ITX 170 Say Y here if you are using the Simtec Electronics EB2410ITX
171 development board (also known as BAST) 171 development board (also known as BAST)
@@ -181,9 +181,9 @@ config BAST_PC104_IRQ
181config ARCH_H1940 181config ARCH_H1940
182 bool "IPAQ H1940" 182 bool "IPAQ H1940"
183 select PM_H1940 if PM 183 select PM_H1940 if PM
184 select S3C_DEV_USB_HOST
185 select S3C_DEV_NAND
186 select S3C24XX_SETUP_TS 184 select S3C24XX_SETUP_TS
185 select S3C_DEV_NAND
186 select S3C_DEV_USB_HOST
187 help 187 help
188 Say Y here if you are using the HP IPAQ H1940 188 Say Y here if you are using the HP IPAQ H1940
189 189
@@ -203,23 +203,23 @@ config PM_H1940
203config MACH_N30 203config MACH_N30
204 bool "Acer N30 family" 204 bool "Acer N30 family"
205 select MACH_N35 205 select MACH_N35
206 select S3C_DEV_USB_HOST
207 select S3C_DEV_NAND 206 select S3C_DEV_NAND
207 select S3C_DEV_USB_HOST
208 help 208 help
209 Say Y here if you want suppt for the Acer N30, Acer N35, 209 Say Y here if you want suppt for the Acer N30, Acer N35,
210 Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs. 210 Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs.
211 211
212config MACH_OTOM 212config MACH_OTOM
213 bool "NexVision OTOM Board" 213 bool "NexVision OTOM Board"
214 select S3C_DEV_USB_HOST
215 select S3C_DEV_NAND 214 select S3C_DEV_NAND
215 select S3C_DEV_USB_HOST
216 help 216 help
217 Say Y here if you are using the Nex Vision OTOM board 217 Say Y here if you are using the Nex Vision OTOM board
218 218
219config MACH_QT2410 219config MACH_QT2410
220 bool "QT2410" 220 bool "QT2410"
221 select S3C_DEV_USB_HOST
222 select S3C_DEV_NAND 221 select S3C_DEV_NAND
222 select S3C_DEV_USB_HOST
223 help 223 help
224 Say Y here if you are using the Armzone QT2410 224 Say Y here if you are using the Armzone QT2410
225 225
@@ -239,12 +239,12 @@ config MACH_TCT_HAMMER
239 239
240config MACH_VR1000 240config MACH_VR1000
241 bool "Thorcom VR1000" 241 bool "Thorcom VR1000"
242 select S3C24XX_SIMTEC_PM if PM 242 select MACH_BAST_IDE
243 select S3C24XX_DCLK 243 select S3C24XX_DCLK
244 select S3C24XX_SIMTEC_NOR 244 select S3C24XX_SIMTEC_NOR
245 select MACH_BAST_IDE 245 select S3C24XX_SIMTEC_PM if PM
246 select S3C_DEV_USB_HOST
247 select S3C24XX_SIMTEC_USB 246 select S3C24XX_SIMTEC_USB
247 select S3C_DEV_USB_HOST
248 help 248 help
249 Say Y here if you are using the Thorcom VR1000 board. 249 Say Y here if you are using the Thorcom VR1000 board.
250 250
@@ -285,8 +285,8 @@ comment "S3C2412 Boards"
285 285
286config MACH_JIVE 286config MACH_JIVE
287 bool "Logitech Jive" 287 bool "Logitech Jive"
288 select S3C_DEV_USB_HOST
289 select S3C_DEV_NAND 288 select S3C_DEV_NAND
289 select S3C_DEV_USB_HOST
290 help 290 help
291 Say Y here if you are using the Logitech Jive. 291 Say Y here if you are using the Logitech Jive.
292 292
@@ -314,15 +314,15 @@ config MACH_SMDK2413
314 bool "SMDK2413" 314 bool "SMDK2413"
315 select MACH_S3C2413 315 select MACH_S3C2413
316 select S3C24XX_SMDK 316 select S3C24XX_SMDK
317 select S3C_DEV_USB_HOST
318 select S3C_DEV_NAND 317 select S3C_DEV_NAND
318 select S3C_DEV_USB_HOST
319 help 319 help
320 Say Y here if you are using an SMDK2413 320 Say Y here if you are using an SMDK2413
321 321
322config MACH_VSTMS 322config MACH_VSTMS
323 bool "VMSTMS" 323 bool "VMSTMS"
324 select S3C_DEV_USB_HOST
325 select S3C_DEV_NAND 324 select S3C_DEV_NAND
325 select S3C_DEV_USB_HOST
326 help 326 help
327 Say Y here if you are using an VSTMS board 327 Say Y here if you are using an VSTMS board
328 328
@@ -351,13 +351,13 @@ comment "S3C2416 Boards"
351 351
352config MACH_SMDK2416 352config MACH_SMDK2416
353 bool "SMDK2416" 353 bool "SMDK2416"
354 select S3C2416_SETUP_SDHCI
354 select S3C24XX_SMDK 355 select S3C24XX_SMDK
355 select S3C_DEV_FB 356 select S3C_DEV_FB
356 select S3C_DEV_HSMMC 357 select S3C_DEV_HSMMC
357 select S3C_DEV_HSMMC1 358 select S3C_DEV_HSMMC1
358 select S3C_DEV_NAND 359 select S3C_DEV_NAND
359 select S3C_DEV_USB_HOST 360 select S3C_DEV_USB_HOST
360 select S3C2416_SETUP_SDHCI
361 help 361 help
362 Say Y here if you are using an SMDK2416 362 Say Y here if you are using an SMDK2416
363 363
@@ -379,11 +379,11 @@ comment "S3C2440 Boards"
379 379
380config MACH_ANUBIS 380config MACH_ANUBIS
381 bool "Simtec Electronics ANUBIS" 381 bool "Simtec Electronics ANUBIS"
382 select S3C24XX_DCLK
383 select S3C24XX_SIMTEC_PM if PM
384 select HAVE_PATA_PLATFORM 382 select HAVE_PATA_PLATFORM
385 select S3C24XX_GPIO_EXTRA64
386 select S3C2440_XTAL_12000000 383 select S3C2440_XTAL_12000000
384 select S3C24XX_DCLK
385 select S3C24XX_GPIO_EXTRA64
386 select S3C24XX_SIMTEC_PM if PM
387 select S3C_DEV_USB_HOST 387 select S3C_DEV_USB_HOST
388 help 388 help
389 Say Y here if you are using the Simtec Electronics ANUBIS 389 Say Y here if you are using the Simtec Electronics ANUBIS
@@ -391,18 +391,18 @@ config MACH_ANUBIS
391 391
392config MACH_AT2440EVB 392config MACH_AT2440EVB
393 bool "Avantech AT2440EVB development board" 393 bool "Avantech AT2440EVB development board"
394 select S3C_DEV_USB_HOST
395 select S3C_DEV_NAND 394 select S3C_DEV_NAND
395 select S3C_DEV_USB_HOST
396 help 396 help
397 Say Y here if you are using the AT2440EVB development board 397 Say Y here if you are using the AT2440EVB development board
398 398
399config MACH_MINI2440 399config MACH_MINI2440
400 bool "MINI2440 development board" 400 bool "MINI2440 development board"
401 select EEPROM_AT24 401 select EEPROM_AT24
402 select NEW_LEDS
403 select LEDS_CLASS 402 select LEDS_CLASS
404 select LEDS_TRIGGER 403 select LEDS_TRIGGER
405 select LEDS_TRIGGER_BACKLIGHT 404 select LEDS_TRIGGER_BACKLIGHT
405 select NEW_LEDS
406 select S3C_DEV_NAND 406 select S3C_DEV_NAND
407 select S3C_DEV_USB_HOST 407 select S3C_DEV_USB_HOST
408 help 408 help
@@ -412,20 +412,20 @@ config MACH_MINI2440
412config MACH_NEXCODER_2440 412config MACH_NEXCODER_2440
413 bool "NexVision NEXCODER 2440 Light Board" 413 bool "NexVision NEXCODER 2440 Light Board"
414 select S3C2440_XTAL_12000000 414 select S3C2440_XTAL_12000000
415 select S3C_DEV_USB_HOST
416 select S3C_DEV_NAND 415 select S3C_DEV_NAND
416 select S3C_DEV_USB_HOST
417 help 417 help
418 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board 418 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board
419 419
420config MACH_OSIRIS 420config MACH_OSIRIS
421 bool "Simtec IM2440D20 (OSIRIS) module" 421 bool "Simtec IM2440D20 (OSIRIS) module"
422 select S3C2410_IOTIMING if S3C2440_CPUFREQ
423 select S3C2440_XTAL_12000000
422 select S3C24XX_DCLK 424 select S3C24XX_DCLK
423 select S3C24XX_SIMTEC_PM if PM
424 select S3C24XX_GPIO_EXTRA128 425 select S3C24XX_GPIO_EXTRA128
425 select S3C2440_XTAL_12000000 426 select S3C24XX_SIMTEC_PM if PM
426 select S3C2410_IOTIMING if S3C2440_CPUFREQ
427 select S3C_DEV_USB_HOST
428 select S3C_DEV_NAND 427 select S3C_DEV_NAND
428 select S3C_DEV_USB_HOST
429 help 429 help
430 Say Y here if you are using the Simtec IM2440D20 module, also 430 Say Y here if you are using the Simtec IM2440D20 module, also
431 known as the Osiris. 431 known as the Osiris.
@@ -445,8 +445,8 @@ config MACH_OSIRIS_DVS
445 445
446config MACH_RX3715 446config MACH_RX3715
447 bool "HP iPAQ rx3715" 447 bool "HP iPAQ rx3715"
448 select S3C2440_XTAL_16934400
449 select PM_H1940 if PM 448 select PM_H1940 if PM
449 select S3C2440_XTAL_16934400
450 select S3C_DEV_NAND 450 select S3C_DEV_NAND
451 help 451 help
452 Say Y here if you are using the HP iPAQ rx3715. 452 Say Y here if you are using the HP iPAQ rx3715.
@@ -455,8 +455,8 @@ config ARCH_S3C2440
455 bool "SMDK2440" 455 bool "SMDK2440"
456 select S3C2440_XTAL_16934400 456 select S3C2440_XTAL_16934400
457 select S3C24XX_SMDK 457 select S3C24XX_SMDK
458 select S3C_DEV_USB_HOST
459 select S3C_DEV_NAND 458 select S3C_DEV_NAND
459 select S3C_DEV_USB_HOST
460 help 460 help
461 Say Y here if you are using the SMDK2440. 461 Say Y here if you are using the SMDK2440.
462 462
@@ -478,11 +478,11 @@ comment "S3C2442 Boards"
478 478
479config MACH_NEO1973_GTA02 479config MACH_NEO1973_GTA02
480 bool "Openmoko GTA02 / Freerunner phone" 480 bool "Openmoko GTA02 / Freerunner phone"
481 select I2C
482 select MACH_NEO1973
481 select MFD_PCF50633 483 select MFD_PCF50633
482 select PCF50633_GPIO 484 select PCF50633_GPIO
483 select I2C
484 select POWER_SUPPLY 485 select POWER_SUPPLY
485 select MACH_NEO1973
486 select S3C24XX_PWM 486 select S3C24XX_PWM
487 select S3C_DEV_USB_HOST 487 select S3C_DEV_USB_HOST
488 help 488 help
@@ -490,13 +490,13 @@ config MACH_NEO1973_GTA02
490 490
491config MACH_RX1950 491config MACH_RX1950
492 bool "HP iPAQ rx1950" 492 bool "HP iPAQ rx1950"
493 select S3C24XX_DCLK
494 select PM_H1940 if PM
495 select I2C 493 select I2C
496 select S3C24XX_PWM 494 select PM_H1940 if PM
497 select S3C_DEV_NAND
498 select S3C2410_IOTIMING if S3C2440_CPUFREQ 495 select S3C2410_IOTIMING if S3C2440_CPUFREQ
499 select S3C2440_XTAL_16934400 496 select S3C2440_XTAL_16934400
497 select S3C24XX_DCLK
498 select S3C24XX_PWM
499 select S3C_DEV_NAND
500 help 500 help
501 Say Y here if you're using HP iPAQ rx1950 501 Say Y here if you're using HP iPAQ rx1950
502 502
diff --git a/arch/arm/mach-s3c24xx/clock-s3c2440.c b/arch/arm/mach-s3c24xx/clock-s3c2440.c
index cb2883d553b..749220f91a7 100644
--- a/arch/arm/mach-s3c24xx/clock-s3c2440.c
+++ b/arch/arm/mach-s3c24xx/clock-s3c2440.c
@@ -87,6 +87,19 @@ static int s3c2440_camif_upll_setrate(struct clk *clk, unsigned long rate)
87 return 0; 87 return 0;
88} 88}
89 89
90static unsigned long s3c2440_camif_upll_getrate(struct clk *clk)
91{
92 unsigned long parent_rate = clk_get_rate(clk->parent);
93 unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN);
94
95 if (!(camdivn & S3C2440_CAMDIVN_CAMCLK_SEL))
96 return parent_rate;
97
98 camdivn &= S3C2440_CAMDIVN_CAMCLK_MASK;
99
100 return parent_rate / (camdivn + 1) / 2;
101}
102
90/* Extra S3C2440 clocks */ 103/* Extra S3C2440 clocks */
91 104
92static struct clk s3c2440_clk_cam = { 105static struct clk s3c2440_clk_cam = {
@@ -99,6 +112,7 @@ static struct clk s3c2440_clk_cam_upll = {
99 .name = "camif-upll", 112 .name = "camif-upll",
100 .ops = &(struct clk_ops) { 113 .ops = &(struct clk_ops) {
101 .set_rate = s3c2440_camif_upll_setrate, 114 .set_rate = s3c2440_camif_upll_setrate,
115 .get_rate = s3c2440_camif_upll_getrate,
102 .round_rate = s3c2440_camif_upll_round, 116 .round_rate = s3c2440_camif_upll_round,
103 }, 117 },
104}; 118};
diff --git a/arch/arm/mach-s3c24xx/common-smdk.c b/arch/arm/mach-s3c24xx/common-smdk.c
index 87e75a250d5..3b2cf6db363 100644
--- a/arch/arm/mach-s3c24xx/common-smdk.c
+++ b/arch/arm/mach-s3c24xx/common-smdk.c
@@ -37,9 +37,9 @@
37#include <asm/irq.h> 37#include <asm/irq.h>
38 38
39#include <mach/regs-gpio.h> 39#include <mach/regs-gpio.h>
40#include <mach/leds-gpio.h> 40#include <linux/platform_data/leds-s3c24xx.h>
41 41
42#include <plat/nand.h> 42#include <linux/platform_data/mtd-nand-s3c2410.h>
43 43
44#include <plat/common-smdk.h> 44#include <plat/common-smdk.h>
45#include <plat/gpio-cfg.h> 45#include <plat/gpio-cfg.h>
diff --git a/arch/arm/mach-s3c24xx/h1940-bluetooth.c b/arch/arm/mach-s3c24xx/h1940-bluetooth.c
index a5eeb62ce1c..57aee916bdb 100644
--- a/arch/arm/mach-s3c24xx/h1940-bluetooth.c
+++ b/arch/arm/mach-s3c24xx/h1940-bluetooth.c
@@ -138,19 +138,7 @@ static struct platform_driver h1940bt_driver = {
138 .remove = h1940bt_remove, 138 .remove = h1940bt_remove,
139}; 139};
140 140
141 141module_platform_driver(h1940bt_driver);
142static int __init h1940bt_init(void)
143{
144 return platform_driver_register(&h1940bt_driver);
145}
146
147static void __exit h1940bt_exit(void)
148{
149 platform_driver_unregister(&h1940bt_driver);
150}
151
152module_init(h1940bt_init);
153module_exit(h1940bt_exit);
154 142
155MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>"); 143MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
156MODULE_DESCRIPTION("Driver for the iPAQ H1940 bluetooth chip"); 144MODULE_DESCRIPTION("Driver for the iPAQ H1940 bluetooth chip");
diff --git a/arch/arm/mach-s3c24xx/include/mach/leds-gpio.h b/arch/arm/mach-s3c24xx/include/mach/leds-gpio.h
deleted file mode 100644
index d8a7672519b..00000000000
--- a/arch/arm/mach-s3c24xx/include/mach/leds-gpio.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/leds-gpio.h
2 *
3 * Copyright (c) 2006 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX - LEDs GPIO connector
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_LEDSGPIO_H
15#define __ASM_ARCH_LEDSGPIO_H "leds-gpio.h"
16
17#define S3C24XX_LEDF_ACTLOW (1<<0) /* LED is on when GPIO low */
18#define S3C24XX_LEDF_TRISTATE (1<<1) /* tristate to turn off */
19
20struct s3c24xx_led_platdata {
21 unsigned int gpio;
22 unsigned int flags;
23
24 char *name;
25 char *def_trigger;
26};
27
28#endif /* __ASM_ARCH_LEDSGPIO_H */
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2416.c b/arch/arm/mach-s3c24xx/irq-s3c2416.c
index 23ec97370f3..ff141b0af26 100644
--- a/arch/arm/mach-s3c24xx/irq-s3c2416.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c2416.c
@@ -232,7 +232,7 @@ struct irq_chip s3c2416_irq_second = {
232 232
233/* IRQ initialisation code */ 233/* IRQ initialisation code */
234 234
235static int __init s3c2416_add_sub(unsigned int base, 235static int s3c2416_add_sub(unsigned int base,
236 void (*demux)(unsigned int, 236 void (*demux)(unsigned int,
237 struct irq_desc *), 237 struct irq_desc *),
238 struct irq_chip *chip, 238 struct irq_chip *chip,
@@ -251,7 +251,7 @@ static int __init s3c2416_add_sub(unsigned int base,
251 return 0; 251 return 0;
252} 252}
253 253
254static void __init s3c2416_irq_add_second(void) 254static void s3c2416_irq_add_second(void)
255{ 255{
256 unsigned long pend; 256 unsigned long pend;
257 unsigned long last; 257 unsigned long last;
@@ -287,7 +287,7 @@ static void __init s3c2416_irq_add_second(void)
287 } 287 }
288} 288}
289 289
290static int __init s3c2416_irq_add(struct device *dev, 290static int s3c2416_irq_add(struct device *dev,
291 struct subsys_interface *sif) 291 struct subsys_interface *sif)
292{ 292{
293 printk(KERN_INFO "S3C2416: IRQ Support\n"); 293 printk(KERN_INFO "S3C2416: IRQ Support\n");
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2443.c b/arch/arm/mach-s3c24xx/irq-s3c2443.c
index ac2829f56d1..5e69109c092 100644
--- a/arch/arm/mach-s3c24xx/irq-s3c2443.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c2443.c
@@ -222,7 +222,7 @@ static struct irq_chip s3c2443_irq_cam = {
222 222
223/* IRQ initialisation code */ 223/* IRQ initialisation code */
224 224
225static int __init s3c2443_add_sub(unsigned int base, 225static int s3c2443_add_sub(unsigned int base,
226 void (*demux)(unsigned int, 226 void (*demux)(unsigned int,
227 struct irq_desc *), 227 struct irq_desc *),
228 struct irq_chip *chip, 228 struct irq_chip *chip,
@@ -241,7 +241,7 @@ static int __init s3c2443_add_sub(unsigned int base,
241 return 0; 241 return 0;
242} 242}
243 243
244static int __init s3c2443_irq_add(struct device *dev, 244static int s3c2443_irq_add(struct device *dev,
245 struct subsys_interface *sif) 245 struct subsys_interface *sif)
246{ 246{
247 printk("S3C2443: IRQ Support\n"); 247 printk("S3C2443: IRQ Support\n");
diff --git a/arch/arm/mach-s3c24xx/mach-amlm5900.c b/arch/arm/mach-s3c24xx/mach-amlm5900.c
index ea2c4b003d5..f4ad99c1e47 100644
--- a/arch/arm/mach-s3c24xx/mach-amlm5900.c
+++ b/arch/arm/mach-s3c24xx/mach-amlm5900.c
@@ -53,7 +53,7 @@
53#include <mach/regs-lcd.h> 53#include <mach/regs-lcd.h>
54#include <mach/regs-gpio.h> 54#include <mach/regs-gpio.h>
55 55
56#include <plat/iic.h> 56#include <linux/platform_data/i2c-s3c2410.h>
57#include <plat/devs.h> 57#include <plat/devs.h>
58#include <plat/cpu.h> 58#include <plat/cpu.h>
59#include <plat/gpio-cfg.h> 59#include <plat/gpio-cfg.h>
diff --git a/arch/arm/mach-s3c24xx/mach-anubis.c b/arch/arm/mach-s3c24xx/mach-anubis.c
index 5a7d0c0010f..1ee8c463874 100644
--- a/arch/arm/mach-s3c24xx/mach-anubis.c
+++ b/arch/arm/mach-s3c24xx/mach-anubis.c
@@ -40,8 +40,8 @@
40#include <mach/regs-gpio.h> 40#include <mach/regs-gpio.h>
41#include <mach/regs-mem.h> 41#include <mach/regs-mem.h>
42#include <mach/regs-lcd.h> 42#include <mach/regs-lcd.h>
43#include <plat/nand.h> 43#include <linux/platform_data/mtd-nand-s3c2410.h>
44#include <plat/iic.h> 44#include <linux/platform_data/i2c-s3c2410.h>
45 45
46#include <linux/mtd/mtd.h> 46#include <linux/mtd/mtd.h>
47#include <linux/mtd/nand.h> 47#include <linux/mtd/nand.h>
@@ -53,7 +53,7 @@
53#include <plat/clock.h> 53#include <plat/clock.h>
54#include <plat/devs.h> 54#include <plat/devs.h>
55#include <plat/cpu.h> 55#include <plat/cpu.h>
56#include <plat/audio-simtec.h> 56#include <linux/platform_data/asoc-s3c24xx_simtec.h>
57 57
58#include "simtec.h" 58#include "simtec.h"
59#include "common.h" 59#include "common.h"
@@ -424,7 +424,8 @@ static void __init anubis_map_io(void)
424 anubis_nand_sets[0].nr_partitions = ARRAY_SIZE(anubis_default_nand_part_large); 424 anubis_nand_sets[0].nr_partitions = ARRAY_SIZE(anubis_default_nand_part_large);
425 } else { 425 } else {
426 /* ensure that the GPIO is setup */ 426 /* ensure that the GPIO is setup */
427 s3c2410_gpio_setpin(S3C2410_GPA(0), 1); 427 gpio_request_one(S3C2410_GPA(0), GPIOF_OUT_INIT_HIGH, NULL);
428 gpio_free(S3C2410_GPA(0));
428 } 429 }
429} 430}
430 431
diff --git a/arch/arm/mach-s3c24xx/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c
index 7a05abf1270..00381fe5de3 100644
--- a/arch/arm/mach-s3c24xx/mach-at2440evb.c
+++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c
@@ -36,8 +36,8 @@
36#include <mach/regs-gpio.h> 36#include <mach/regs-gpio.h>
37#include <mach/regs-mem.h> 37#include <mach/regs-mem.h>
38#include <mach/regs-lcd.h> 38#include <mach/regs-lcd.h>
39#include <plat/nand.h> 39#include <linux/platform_data/mtd-nand-s3c2410.h>
40#include <plat/iic.h> 40#include <linux/platform_data/i2c-s3c2410.h>
41 41
42#include <linux/mtd/mtd.h> 42#include <linux/mtd/mtd.h>
43#include <linux/mtd/nand.h> 43#include <linux/mtd/nand.h>
@@ -47,7 +47,7 @@
47#include <plat/clock.h> 47#include <plat/clock.h>
48#include <plat/devs.h> 48#include <plat/devs.h>
49#include <plat/cpu.h> 49#include <plat/cpu.h>
50#include <plat/mci.h> 50#include <linux/platform_data/mmc-s3cmci.h>
51 51
52#include "common.h" 52#include "common.h"
53 53
diff --git a/arch/arm/mach-s3c24xx/mach-bast.c b/arch/arm/mach-s3c24xx/mach-bast.c
index 1cf1720682d..6a30ce7e4aa 100644
--- a/arch/arm/mach-s3c24xx/mach-bast.c
+++ b/arch/arm/mach-s3c24xx/mach-bast.c
@@ -45,9 +45,9 @@
45#include <mach/regs-mem.h> 45#include <mach/regs-mem.h>
46#include <mach/regs-lcd.h> 46#include <mach/regs-lcd.h>
47 47
48#include <plat/hwmon.h> 48#include <linux/platform_data/hwmon-s3c.h>
49#include <plat/nand.h> 49#include <linux/platform_data/mtd-nand-s3c2410.h>
50#include <plat/iic.h> 50#include <linux/platform_data/i2c-s3c2410.h>
51#include <mach/fb.h> 51#include <mach/fb.h>
52 52
53#include <linux/mtd/mtd.h> 53#include <linux/mtd/mtd.h>
@@ -62,7 +62,7 @@
62#include <plat/cpu.h> 62#include <plat/cpu.h>
63#include <plat/cpu-freq.h> 63#include <plat/cpu-freq.h>
64#include <plat/gpio-cfg.h> 64#include <plat/gpio-cfg.h>
65#include <plat/audio-simtec.h> 65#include <linux/platform_data/asoc-s3c24xx_simtec.h>
66 66
67#include "simtec.h" 67#include "simtec.h"
68#include "common.h" 68#include "common.h"
diff --git a/arch/arm/mach-s3c24xx/mach-gta02.c b/arch/arm/mach-s3c24xx/mach-gta02.c
index 92e1f93a6bc..4a963467b7e 100644
--- a/arch/arm/mach-s3c24xx/mach-gta02.c
+++ b/arch/arm/mach-s3c24xx/mach-gta02.c
@@ -73,21 +73,21 @@
73#include <mach/regs-gpio.h> 73#include <mach/regs-gpio.h>
74#include <mach/fb.h> 74#include <mach/fb.h>
75 75
76#include <plat/usb-control.h> 76#include <linux/platform_data/usb-ohci-s3c2410.h>
77#include <mach/regs-mem.h> 77#include <mach/regs-mem.h>
78#include <mach/hardware.h> 78#include <mach/hardware.h>
79 79
80#include <mach/gta02.h> 80#include <mach/gta02.h>
81 81
82#include <plat/regs-serial.h> 82#include <plat/regs-serial.h>
83#include <plat/nand.h> 83#include <linux/platform_data/mtd-nand-s3c2410.h>
84#include <plat/devs.h> 84#include <plat/devs.h>
85#include <plat/cpu.h> 85#include <plat/cpu.h>
86#include <plat/pm.h> 86#include <plat/pm.h>
87#include <plat/udc.h> 87#include <linux/platform_data/usb-s3c2410_udc.h>
88#include <plat/gpio-cfg.h> 88#include <plat/gpio-cfg.h>
89#include <plat/iic.h> 89#include <linux/platform_data/i2c-s3c2410.h>
90#include <plat/ts.h> 90#include <linux/platform_data/touchscreen-s3c2410.h>
91 91
92#include "common.h" 92#include "common.h"
93 93
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
index bb8d008d5a5..63aaf076f61 100644
--- a/arch/arm/mach-s3c24xx/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -56,8 +56,8 @@
56#include <mach/h1940.h> 56#include <mach/h1940.h>
57#include <mach/h1940-latch.h> 57#include <mach/h1940-latch.h>
58#include <mach/fb.h> 58#include <mach/fb.h>
59#include <plat/udc.h> 59#include <linux/platform_data/usb-s3c2410_udc.h>
60#include <plat/iic.h> 60#include <linux/platform_data/i2c-s3c2410.h>
61 61
62#include <plat/gpio-cfg.h> 62#include <plat/gpio-cfg.h>
63#include <plat/clock.h> 63#include <plat/clock.h>
@@ -65,8 +65,8 @@
65#include <plat/cpu.h> 65#include <plat/cpu.h>
66#include <plat/pll.h> 66#include <plat/pll.h>
67#include <plat/pm.h> 67#include <plat/pm.h>
68#include <plat/mci.h> 68#include <linux/platform_data/mmc-s3cmci.h>
69#include <plat/ts.h> 69#include <linux/platform_data/touchscreen-s3c2410.h>
70 70
71#include <sound/uda1380.h> 71#include <sound/uda1380.h>
72 72
@@ -380,7 +380,7 @@ int h1940_led_blink_set(unsigned gpio, int state,
380 default: 380 default:
381 blink_gpio = S3C2410_GPA(3); 381 blink_gpio = S3C2410_GPA(3);
382 check_gpio1 = S3C2410_GPA(1); 382 check_gpio1 = S3C2410_GPA(1);
383 check_gpio1 = S3C2410_GPA(7); 383 check_gpio2 = S3C2410_GPA(7);
384 break; 384 break;
385 } 385 }
386 386
@@ -460,7 +460,7 @@ static void h1940_set_mmc_power(unsigned char power_mode, unsigned short vdd)
460 break; 460 break;
461 default: 461 default:
462 break; 462 break;
463 }; 463 }
464} 464}
465 465
466static struct s3c24xx_mci_pdata h1940_mmc_cfg __initdata = { 466static struct s3c24xx_mci_pdata h1940_mmc_cfg __initdata = {
diff --git a/arch/arm/mach-s3c24xx/mach-jive.c b/arch/arm/mach-s3c24xx/mach-jive.c
index ae73ba34ecc..c9954e26b49 100644
--- a/arch/arm/mach-s3c24xx/mach-jive.c
+++ b/arch/arm/mach-s3c24xx/mach-jive.c
@@ -32,8 +32,8 @@
32#include <asm/mach/irq.h> 32#include <asm/mach/irq.h>
33 33
34#include <plat/regs-serial.h> 34#include <plat/regs-serial.h>
35#include <plat/nand.h> 35#include <linux/platform_data/mtd-nand-s3c2410.h>
36#include <plat/iic.h> 36#include <linux/platform_data/i2c-s3c2410.h>
37 37
38#include <mach/regs-power.h> 38#include <mach/regs-power.h>
39#include <mach/regs-gpio.h> 39#include <mach/regs-gpio.h>
@@ -54,7 +54,7 @@
54#include <plat/devs.h> 54#include <plat/devs.h>
55#include <plat/cpu.h> 55#include <plat/cpu.h>
56#include <plat/pm.h> 56#include <plat/pm.h>
57#include <plat/udc.h> 57#include <linux/platform_data/usb-s3c2410_udc.h>
58 58
59static struct map_desc jive_iodesc[] __initdata = { 59static struct map_desc jive_iodesc[] __initdata = {
60}; 60};
@@ -512,8 +512,8 @@ static void jive_power_off(void)
512{ 512{
513 printk(KERN_INFO "powering system down...\n"); 513 printk(KERN_INFO "powering system down...\n");
514 514
515 s3c2410_gpio_setpin(S3C2410_GPC(5), 1); 515 gpio_request_one(S3C2410_GPC(5), GPIOF_OUT_INIT_HIGH, NULL);
516 s3c_gpio_cfgpin(S3C2410_GPC(5), S3C2410_GPIO_OUTPUT); 516 gpio_free(S3C2410_GPC(5));
517} 517}
518 518
519static void __init jive_machine_init(void) 519static void __init jive_machine_init(void)
@@ -623,11 +623,11 @@ static void __init jive_machine_init(void)
623 gpio_request(S3C2410_GPB(7), "jive spi"); 623 gpio_request(S3C2410_GPB(7), "jive spi");
624 gpio_direction_output(S3C2410_GPB(7), 1); 624 gpio_direction_output(S3C2410_GPB(7), 1);
625 625
626 s3c2410_gpio_setpin(S3C2410_GPB(6), 0); 626 gpio_request_one(S3C2410_GPB(6), GPIOF_OUT_INIT_LOW, NULL);
627 s3c_gpio_cfgpin(S3C2410_GPB(6), S3C2410_GPIO_OUTPUT); 627 gpio_free(S3C2410_GPB(6));
628 628
629 s3c2410_gpio_setpin(S3C2410_GPG(8), 1); 629 gpio_request_one(S3C2410_GPG(8), GPIOF_OUT_INIT_HIGH, NULL);
630 s3c_gpio_cfgpin(S3C2410_GPG(8), S3C2410_GPIO_OUTPUT); 630 gpio_free(S3C2410_GPG(8));
631 631
632 /* initialise the WM8750 spi */ 632 /* initialise the WM8750 spi */
633 633
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
index bd6d2525deb..393c0f1ac11 100644
--- a/arch/arm/mach-s3c24xx/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
@@ -39,14 +39,14 @@
39 39
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 <mach/leds-gpio.h> 42#include <linux/platform_data/leds-s3c24xx.h>
43#include <mach/regs-mem.h> 43#include <mach/regs-mem.h>
44#include <mach/regs-lcd.h> 44#include <mach/regs-lcd.h>
45#include <mach/irqs.h> 45#include <mach/irqs.h>
46#include <plat/nand.h> 46#include <linux/platform_data/mtd-nand-s3c2410.h>
47#include <plat/iic.h> 47#include <linux/platform_data/i2c-s3c2410.h>
48#include <plat/mci.h> 48#include <linux/platform_data/mmc-s3cmci.h>
49#include <plat/udc.h> 49#include <linux/platform_data/usb-s3c2410_udc.h>
50 50
51#include <linux/mtd/mtd.h> 51#include <linux/mtd/mtd.h>
52#include <linux/mtd/nand.h> 52#include <linux/mtd/nand.h>
@@ -638,9 +638,9 @@ static void __init mini2440_init(void)
638 gpio_free(S3C2410_GPG(4)); 638 gpio_free(S3C2410_GPG(4));
639 639
640 /* remove pullup on optional PWM backlight -- unused on 3.5 and 7"s */ 640 /* remove pullup on optional PWM backlight -- unused on 3.5 and 7"s */
641 gpio_request_one(S3C2410_GPB(1), GPIOF_IN, NULL);
641 s3c_gpio_setpull(S3C2410_GPB(1), S3C_GPIO_PULL_UP); 642 s3c_gpio_setpull(S3C2410_GPB(1), S3C_GPIO_PULL_UP);
642 s3c2410_gpio_setpin(S3C2410_GPB(1), 0); 643 gpio_free(S3C2410_GPB(1));
643 s3c_gpio_cfgpin(S3C2410_GPB(1), S3C2410_GPIO_INPUT);
644 644
645 /* mark the key as input, without pullups (there is one on the board) */ 645 /* mark the key as input, without pullups (there is one on the board) */
646 for (i = 0; i < ARRAY_SIZE(mini2440_buttons); i++) { 646 for (i = 0; i < ARRAY_SIZE(mini2440_buttons); i++) {
diff --git a/arch/arm/mach-s3c24xx/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c
index 383d00ca8f6..c53a9bfe141 100644
--- a/arch/arm/mach-s3c24xx/mach-n30.c
+++ b/arch/arm/mach-s3c24xx/mach-n30.c
@@ -33,7 +33,7 @@
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34 34
35#include <mach/fb.h> 35#include <mach/fb.h>
36#include <mach/leds-gpio.h> 36#include <linux/platform_data/leds-s3c24xx.h>
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
@@ -41,15 +41,15 @@
41#include <asm/mach/irq.h> 41#include <asm/mach/irq.h>
42#include <asm/mach/map.h> 42#include <asm/mach/map.h>
43 43
44#include <plat/iic.h> 44#include <linux/platform_data/i2c-s3c2410.h>
45#include <plat/regs-serial.h> 45#include <plat/regs-serial.h>
46 46
47#include <plat/clock.h> 47#include <plat/clock.h>
48#include <plat/cpu.h> 48#include <plat/cpu.h>
49#include <plat/devs.h> 49#include <plat/devs.h>
50#include <plat/mci.h> 50#include <linux/platform_data/mmc-s3cmci.h>
51#include <plat/s3c2410.h> 51#include <plat/s3c2410.h>
52#include <plat/udc.h> 52#include <linux/platform_data/usb-s3c2410_udc.h>
53 53
54#include "common.h" 54#include "common.h"
55 55
diff --git a/arch/arm/mach-s3c24xx/mach-nexcoder.c b/arch/arm/mach-s3c24xx/mach-nexcoder.c
index 5c05ba1c330..a2b92b0898e 100644
--- a/arch/arm/mach-s3c24xx/mach-nexcoder.c
+++ b/arch/arm/mach-s3c24xx/mach-nexcoder.c
@@ -38,7 +38,7 @@
38//#include <asm/debug-ll.h> 38//#include <asm/debug-ll.h>
39#include <mach/regs-gpio.h> 39#include <mach/regs-gpio.h>
40#include <plat/regs-serial.h> 40#include <plat/regs-serial.h>
41#include <plat/iic.h> 41#include <linux/platform_data/i2c-s3c2410.h>
42 42
43#include <plat/gpio-cfg.h> 43#include <plat/gpio-cfg.h>
44#include <plat/s3c2410.h> 44#include <plat/s3c2410.h>
@@ -119,17 +119,17 @@ static struct platform_device *nexcoder_devices[] __initdata = {
119 119
120static void __init nexcoder_sensorboard_init(void) 120static void __init nexcoder_sensorboard_init(void)
121{ 121{
122 // Initialize SCCB bus 122 /* Initialize SCCB bus */
123 s3c2410_gpio_setpin(S3C2410_GPE(14), 1); // IICSCL 123 gpio_request_one(S3C2410_GPE(14), GPIOF_OUT_INIT_HIGH, NULL);
124 s3c_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPIO_OUTPUT); 124 gpio_free(S3C2410_GPE(14)); /* IICSCL */
125 s3c2410_gpio_setpin(S3C2410_GPE(15), 1); // IICSDA 125 gpio_request_one(S3C2410_GPE(15), GPIOF_OUT_INIT_HIGH, NULL);
126 s3c_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPIO_OUTPUT); 126 gpio_free(S3C2410_GPE(15)); /* IICSDA */
127 127
128 // Power up the sensor board 128 /* Power up the sensor board */
129 s3c2410_gpio_setpin(S3C2410_GPF(1), 1); 129 gpio_request_one(S3C2410_GPF(1), GPIOF_OUT_INIT_HIGH, NULL);
130 s3c_gpio_cfgpin(S3C2410_GPF(1), S3C2410_GPIO_OUTPUT); // CAM_GPIO7 => nLDO_PWRDN 130 gpio_free(S3C2410_GPF(1)); /* CAM_GPIO7 => nLDO_PWRDN */
131 s3c2410_gpio_setpin(S3C2410_GPF(2), 0); 131 gpio_request_one(S3C2410_GPF(2), GPIOF_OUT_INIT_LOW, NULL);
132 s3c_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); // CAM_GPIO6 => CAM_PWRDN 132 gpio_free(S3C2410_GPF(2)); /* CAM_GPIO6 => CAM_PWRDN */
133} 133}
134 134
135static void __init nexcoder_map_io(void) 135static void __init nexcoder_map_io(void)
diff --git a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
index ad2792dfbee..5876c6ba750 100644
--- a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
@@ -175,18 +175,7 @@ static struct platform_driver osiris_dvs_driver = {
175 }, 175 },
176}; 176};
177 177
178static int __init osiris_dvs_init(void) 178module_platform_driver(osiris_dvs_driver);
179{
180 return platform_driver_register(&osiris_dvs_driver);
181}
182
183static void __exit osiris_dvs_exit(void)
184{
185 platform_driver_unregister(&osiris_dvs_driver);
186}
187
188module_init(osiris_dvs_init);
189module_exit(osiris_dvs_exit);
190 179
191MODULE_DESCRIPTION("Simtec OSIRIS DVS support"); 180MODULE_DESCRIPTION("Simtec OSIRIS DVS support");
192MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); 181MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
diff --git a/arch/arm/mach-s3c24xx/mach-osiris.c b/arch/arm/mach-s3c24xx/mach-osiris.c
index 95d07725502..bb36d832bd3 100644
--- a/arch/arm/mach-s3c24xx/mach-osiris.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris.c
@@ -41,8 +41,8 @@
41#include <mach/regs-gpio.h> 41#include <mach/regs-gpio.h>
42#include <mach/regs-mem.h> 42#include <mach/regs-mem.h>
43#include <mach/regs-lcd.h> 43#include <mach/regs-lcd.h>
44#include <plat/nand.h> 44#include <linux/platform_data/mtd-nand-s3c2410.h>
45#include <plat/iic.h> 45#include <linux/platform_data/i2c-s3c2410.h>
46 46
47#include <linux/mtd/mtd.h> 47#include <linux/mtd/mtd.h>
48#include <linux/mtd/nand.h> 48#include <linux/mtd/nand.h>
@@ -274,8 +274,8 @@ static int osiris_pm_suspend(void)
274 __raw_writeb(tmp, OSIRIS_VA_CTRL0); 274 __raw_writeb(tmp, OSIRIS_VA_CTRL0);
275 275
276 /* ensure that an nRESET is not generated on resume. */ 276 /* ensure that an nRESET is not generated on resume. */
277 s3c2410_gpio_setpin(S3C2410_GPA(21), 1); 277 gpio_request_one(S3C2410_GPA(21), GPIOF_OUT_INIT_HIGH, NULL);
278 s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPIO_OUTPUT); 278 gpio_free(S3C2410_GPA(21));
279 279
280 return 0; 280 return 0;
281} 281}
@@ -396,7 +396,8 @@ static void __init osiris_map_io(void)
396 osiris_nand_sets[0].nr_partitions = ARRAY_SIZE(osiris_default_nand_part_large); 396 osiris_nand_sets[0].nr_partitions = ARRAY_SIZE(osiris_default_nand_part_large);
397 } else { 397 } else {
398 /* write-protect line to the NAND */ 398 /* write-protect line to the NAND */
399 s3c2410_gpio_setpin(S3C2410_GPA(0), 1); 399 gpio_request_one(S3C2410_GPA(0), GPIOF_OUT_INIT_HIGH, NULL);
400 gpio_free(S3C2410_GPA(0));
400 } 401 }
401 402
402 /* fix bus configuration (nBE settings wrong on ABLE pre v2.20) */ 403 /* fix bus configuration (nBE settings wrong on ABLE pre v2.20) */
diff --git a/arch/arm/mach-s3c24xx/mach-otom.c b/arch/arm/mach-s3c24xx/mach-otom.c
index bc4b6efb3b2..bca39f0232b 100644
--- a/arch/arm/mach-s3c24xx/mach-otom.c
+++ b/arch/arm/mach-s3c24xx/mach-otom.c
@@ -35,7 +35,7 @@
35#include <plat/s3c2410.h> 35#include <plat/s3c2410.h>
36#include <plat/clock.h> 36#include <plat/clock.h>
37#include <plat/devs.h> 37#include <plat/devs.h>
38#include <plat/iic.h> 38#include <linux/platform_data/i2c-s3c2410.h>
39#include <plat/cpu.h> 39#include <plat/cpu.h>
40 40
41#include "common.h" 41#include "common.h"
diff --git a/arch/arm/mach-s3c24xx/mach-qt2410.c b/arch/arm/mach-s3c24xx/mach-qt2410.c
index 678bbca2b5e..7b6ba13d728 100644
--- a/arch/arm/mach-s3c24xx/mach-qt2410.c
+++ b/arch/arm/mach-s3c24xx/mach-qt2410.c
@@ -47,13 +47,13 @@
47#include <asm/irq.h> 47#include <asm/irq.h>
48#include <asm/mach-types.h> 48#include <asm/mach-types.h>
49 49
50#include <mach/leds-gpio.h> 50#include <linux/platform_data/leds-s3c24xx.h>
51#include <mach/regs-lcd.h> 51#include <mach/regs-lcd.h>
52#include <plat/regs-serial.h> 52#include <plat/regs-serial.h>
53#include <mach/fb.h> 53#include <mach/fb.h>
54#include <plat/nand.h> 54#include <linux/platform_data/mtd-nand-s3c2410.h>
55#include <plat/udc.h> 55#include <linux/platform_data/usb-s3c2410_udc.h>
56#include <plat/iic.h> 56#include <linux/platform_data/i2c-s3c2410.h>
57 57
58#include <plat/common-smdk.h> 58#include <plat/common-smdk.h>
59#include <plat/gpio-cfg.h> 59#include <plat/gpio-cfg.h>
diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c
index 7ee73f27f20..379fde521d3 100644
--- a/arch/arm/mach-s3c24xx/mach-rx1950.c
+++ b/arch/arm/mach-s3c24xx/mach-rx1950.c
@@ -49,15 +49,15 @@
49#include <plat/clock.h> 49#include <plat/clock.h>
50#include <plat/regs-serial.h> 50#include <plat/regs-serial.h>
51#include <plat/regs-iic.h> 51#include <plat/regs-iic.h>
52#include <plat/mci.h> 52#include <linux/platform_data/mmc-s3cmci.h>
53#include <plat/udc.h> 53#include <linux/platform_data/usb-s3c2410_udc.h>
54#include <plat/nand.h> 54#include <linux/platform_data/mtd-nand-s3c2410.h>
55#include <plat/iic.h> 55#include <linux/platform_data/i2c-s3c2410.h>
56#include <plat/devs.h> 56#include <plat/devs.h>
57#include <plat/cpu.h> 57#include <plat/cpu.h>
58#include <plat/pm.h> 58#include <plat/pm.h>
59#include <plat/irq.h> 59#include <plat/irq.h>
60#include <plat/ts.h> 60#include <linux/platform_data/touchscreen-s3c2410.h>
61 61
62#include <sound/uda1380.h> 62#include <sound/uda1380.h>
63 63
diff --git a/arch/arm/mach-s3c24xx/mach-rx3715.c b/arch/arm/mach-s3c24xx/mach-rx3715.c
index 56af3544759..dacbb9a2122 100644
--- a/arch/arm/mach-s3c24xx/mach-rx3715.c
+++ b/arch/arm/mach-s3c24xx/mach-rx3715.c
@@ -43,7 +43,7 @@
43#include <mach/regs-lcd.h> 43#include <mach/regs-lcd.h>
44 44
45#include <mach/h1940.h> 45#include <mach/h1940.h>
46#include <plat/nand.h> 46#include <linux/platform_data/mtd-nand-s3c2410.h>
47#include <mach/fb.h> 47#include <mach/fb.h>
48 48
49#include <plat/clock.h> 49#include <plat/clock.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2410.c b/arch/arm/mach-s3c24xx/mach-smdk2410.c
index bdc27e77287..82796b97cb0 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2410.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2410.c
@@ -47,7 +47,7 @@
47#include <asm/mach-types.h> 47#include <asm/mach-types.h>
48 48
49#include <plat/regs-serial.h> 49#include <plat/regs-serial.h>
50#include <plat/iic.h> 50#include <linux/platform_data/i2c-s3c2410.h>
51 51
52#include <plat/devs.h> 52#include <plat/devs.h>
53#include <plat/cpu.h> 53#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2413.c b/arch/arm/mach-s3c24xx/mach-smdk2413.c
index b11451b853d..ce99fd8bbbc 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2413.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2413.c
@@ -38,8 +38,8 @@
38#include <mach/regs-lcd.h> 38#include <mach/regs-lcd.h>
39 39
40#include <mach/idle.h> 40#include <mach/idle.h>
41#include <plat/udc.h> 41#include <linux/platform_data/usb-s3c2410_udc.h>
42#include <plat/iic.h> 42#include <linux/platform_data/i2c-s3c2410.h>
43#include <mach/fb.h> 43#include <mach/fb.h>
44 44
45#include <plat/s3c2410.h> 45#include <plat/s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2416.c b/arch/arm/mach-s3c24xx/mach-smdk2416.c
index c3100a044fb..f30d7fccbfe 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2416.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2416.c
@@ -29,6 +29,7 @@
29#include <asm/mach/map.h> 29#include <asm/mach/map.h>
30#include <asm/mach/irq.h> 30#include <asm/mach/irq.h>
31 31
32#include <video/samsung_fimd.h>
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>
@@ -39,20 +40,19 @@
39#include <mach/regs-s3c2443-clock.h> 40#include <mach/regs-s3c2443-clock.h>
40 41
41#include <mach/idle.h> 42#include <mach/idle.h>
42#include <mach/leds-gpio.h> 43#include <linux/platform_data/leds-s3c24xx.h>
43#include <plat/iic.h> 44#include <linux/platform_data/i2c-s3c2410.h>
44 45
45#include <plat/s3c2416.h> 46#include <plat/s3c2416.h>
46#include <plat/gpio-cfg.h> 47#include <plat/gpio-cfg.h>
47#include <plat/clock.h> 48#include <plat/clock.h>
48#include <plat/devs.h> 49#include <plat/devs.h>
49#include <plat/cpu.h> 50#include <plat/cpu.h>
50#include <plat/nand.h> 51#include <linux/platform_data/mtd-nand-s3c2410.h>
51#include <plat/sdhci.h> 52#include <plat/sdhci.h>
52#include <plat/udc.h> 53#include <linux/platform_data/usb-s3c2410_udc.h>
53#include <linux/platform_data/s3c-hsudc.h> 54#include <linux/platform_data/s3c-hsudc.h>
54 55
55#include <plat/regs-fb-v4.h>
56#include <plat/fb.h> 56#include <plat/fb.h>
57 57
58#include <plat/common-smdk.h> 58#include <plat/common-smdk.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c
index 83a1036d7dc..b7ff882c6ce 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2440.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2440.c
@@ -37,7 +37,7 @@
37 37
38#include <mach/idle.h> 38#include <mach/idle.h>
39#include <mach/fb.h> 39#include <mach/fb.h>
40#include <plat/iic.h> 40#include <linux/platform_data/i2c-s3c2410.h>
41 41
42#include <plat/s3c2410.h> 42#include <plat/s3c2410.h>
43#include <plat/s3c244x.h> 43#include <plat/s3c244x.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2443.c b/arch/arm/mach-s3c24xx/mach-smdk2443.c
index 20923695622..2568656f046 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2443.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2443.c
@@ -37,7 +37,7 @@
37 37
38#include <mach/idle.h> 38#include <mach/idle.h>
39#include <mach/fb.h> 39#include <mach/fb.h>
40#include <plat/iic.h> 40#include <linux/platform_data/i2c-s3c2410.h>
41 41
42#include <plat/s3c2410.h> 42#include <plat/s3c2410.h>
43#include <plat/s3c2443.h> 43#include <plat/s3c2443.h>
diff --git a/arch/arm/mach-s3c24xx/mach-tct_hammer.c b/arch/arm/mach-s3c24xx/mach-tct_hammer.c
index fe990289ee7..495bf5cf52e 100644
--- a/arch/arm/mach-s3c24xx/mach-tct_hammer.c
+++ b/arch/arm/mach-s3c24xx/mach-tct_hammer.c
@@ -45,7 +45,7 @@
45#include <asm/mach-types.h> 45#include <asm/mach-types.h>
46 46
47#include <plat/regs-serial.h> 47#include <plat/regs-serial.h>
48#include <plat/iic.h> 48#include <linux/platform_data/i2c-s3c2410.h>
49#include <plat/devs.h> 49#include <plat/devs.h>
50#include <plat/cpu.h> 50#include <plat/cpu.h>
51 51
diff --git a/arch/arm/mach-s3c24xx/mach-vr1000.c b/arch/arm/mach-s3c24xx/mach-vr1000.c
index bd5f189f042..14d5b12e388 100644
--- a/arch/arm/mach-s3c24xx/mach-vr1000.c
+++ b/arch/arm/mach-s3c24xx/mach-vr1000.c
@@ -43,13 +43,13 @@
43 43
44#include <plat/regs-serial.h> 44#include <plat/regs-serial.h>
45#include <mach/regs-gpio.h> 45#include <mach/regs-gpio.h>
46#include <mach/leds-gpio.h> 46#include <linux/platform_data/leds-s3c24xx.h>
47 47
48#include <plat/clock.h> 48#include <plat/clock.h>
49#include <plat/devs.h> 49#include <plat/devs.h>
50#include <plat/cpu.h> 50#include <plat/cpu.h>
51#include <plat/iic.h> 51#include <linux/platform_data/i2c-s3c2410.h>
52#include <plat/audio-simtec.h> 52#include <linux/platform_data/asoc-s3c24xx_simtec.h>
53 53
54#include "simtec.h" 54#include "simtec.h"
55#include "common.h" 55#include "common.h"
diff --git a/arch/arm/mach-s3c24xx/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c
index 94bfaa1fb14..f1d44ae1183 100644
--- a/arch/arm/mach-s3c24xx/mach-vstms.c
+++ b/arch/arm/mach-s3c24xx/mach-vstms.c
@@ -39,8 +39,8 @@
39#include <mach/idle.h> 39#include <mach/idle.h>
40#include <mach/fb.h> 40#include <mach/fb.h>
41 41
42#include <plat/iic.h> 42#include <linux/platform_data/i2c-s3c2410.h>
43#include <plat/nand.h> 43#include <linux/platform_data/mtd-nand-s3c2410.h>
44 44
45#include <plat/s3c2410.h> 45#include <plat/s3c2410.h>
46#include <plat/s3c2412.h> 46#include <plat/s3c2412.h>
diff --git a/arch/arm/mach-s3c24xx/setup-i2c.c b/arch/arm/mach-s3c24xx/setup-i2c.c
index 9e90a7cbd1d..7b4f33332d1 100644
--- a/arch/arm/mach-s3c24xx/setup-i2c.c
+++ b/arch/arm/mach-s3c24xx/setup-i2c.c
@@ -16,7 +16,7 @@
16struct platform_device; 16struct platform_device;
17 17
18#include <plat/gpio-cfg.h> 18#include <plat/gpio-cfg.h>
19#include <plat/iic.h> 19#include <linux/platform_data/i2c-s3c2410.h>
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21#include <mach/regs-gpio.h> 21#include <mach/regs-gpio.h>
22 22
diff --git a/arch/arm/mach-s3c24xx/simtec-audio.c b/arch/arm/mach-s3c24xx/simtec-audio.c
index 11881c9a38c..fd0ef05763a 100644
--- a/arch/arm/mach-s3c24xx/simtec-audio.c
+++ b/arch/arm/mach-s3c24xx/simtec-audio.c
@@ -24,7 +24,7 @@
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <mach/regs-gpio.h> 25#include <mach/regs-gpio.h>
26 26
27#include <plat/audio-simtec.h> 27#include <linux/platform_data/asoc-s3c24xx_simtec.h>
28#include <plat/devs.h> 28#include <plat/devs.h>
29 29
30#include "simtec.h" 30#include "simtec.h"
diff --git a/arch/arm/mach-s3c24xx/simtec-usb.c b/arch/arm/mach-s3c24xx/simtec-usb.c
index d91c1a72513..ddf7a3c743a 100644
--- a/arch/arm/mach-s3c24xx/simtec-usb.c
+++ b/arch/arm/mach-s3c24xx/simtec-usb.c
@@ -34,7 +34,7 @@
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35#include <asm/irq.h> 35#include <asm/irq.h>
36 36
37#include <plat/usb-control.h> 37#include <linux/platform_data/usb-ohci-s3c2410.h>
38#include <plat/devs.h> 38#include <plat/devs.h>
39 39
40#include "simtec.h" 40#include "simtec.h"
@@ -104,7 +104,7 @@ static struct s3c2410_hcd_info usb_simtec_info __initdata = {
104}; 104};
105 105
106 106
107int usb_simtec_init(void) 107int __init usb_simtec_init(void)
108{ 108{
109 int ret; 109 int ret;
110 110
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 06ca1cd4cae..63e7ae3ee9e 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -7,9 +7,9 @@
7config PLAT_S3C64XX 7config PLAT_S3C64XX
8 bool 8 bool
9 depends on ARCH_S3C64XX 9 depends on ARCH_S3C64XX
10 select SAMSUNG_WAKEMASK
11 select PM_GENERIC_DOMAINS
12 default y 10 default y
11 select PM_GENERIC_DOMAINS
12 select SAMSUNG_WAKEMASK
13 help 13 help
14 Base platform code for any Samsung S3C64XX device 14 Base platform code for any Samsung S3C64XX device
15 15
@@ -31,8 +31,8 @@ config S3C64XX_DMA
31 select S3C_DMA 31 select S3C_DMA
32 32
33config S3C64XX_SETUP_SDHCI 33config S3C64XX_SETUP_SDHCI
34 select S3C64XX_SETUP_SDHCI_GPIO
35 bool 34 bool
35 select S3C64XX_SETUP_SDHCI_GPIO
36 help 36 help
37 Internal configuration for default SDHCI setup for S3C6400 and 37 Internal configuration for default SDHCI setup for S3C6400 and
38 S3C6410 SoCs. 38 S3C6410 SoCs.
@@ -93,9 +93,9 @@ config S3C64XX_SETUP_USB_PHY
93config MACH_SMDK6400 93config MACH_SMDK6400
94 bool "SMDK6400" 94 bool "SMDK6400"
95 select CPU_S3C6400 95 select CPU_S3C6400
96 select S3C64XX_SETUP_SDHCI
96 select S3C_DEV_HSMMC 97 select S3C_DEV_HSMMC
97 select S3C_DEV_NAND 98 select S3C_DEV_NAND
98 select S3C64XX_SETUP_SDHCI
99 help 99 help
100 Machine support for the Samsung SMDK6400 100 Machine support for the Samsung SMDK6400
101 101
@@ -104,21 +104,21 @@ config MACH_SMDK6400
104config MACH_ANW6410 104config MACH_ANW6410
105 bool "A&W6410" 105 bool "A&W6410"
106 select CPU_S3C6410 106 select CPU_S3C6410
107 select S3C_DEV_FB
108 select S3C64XX_SETUP_FB_24BPP 107 select S3C64XX_SETUP_FB_24BPP
108 select S3C_DEV_FB
109 help 109 help
110 Machine support for the A&W6410 110 Machine support for the A&W6410
111 111
112config MACH_MINI6410 112config MACH_MINI6410
113 bool "MINI6410" 113 bool "MINI6410"
114 select CPU_S3C6410 114 select CPU_S3C6410
115 select S3C64XX_SETUP_FB_24BPP
116 select S3C64XX_SETUP_SDHCI
117 select S3C_DEV_FB
115 select S3C_DEV_HSMMC 118 select S3C_DEV_HSMMC
116 select S3C_DEV_HSMMC1 119 select S3C_DEV_HSMMC1
117 select S3C64XX_SETUP_SDHCI
118 select S3C_DEV_USB_HOST
119 select S3C_DEV_NAND 120 select S3C_DEV_NAND
120 select S3C_DEV_FB 121 select S3C_DEV_USB_HOST
121 select S3C64XX_SETUP_FB_24BPP
122 select SAMSUNG_DEV_ADC 122 select SAMSUNG_DEV_ADC
123 select SAMSUNG_DEV_TS 123 select SAMSUNG_DEV_TS
124 help 124 help
@@ -127,42 +127,42 @@ config MACH_MINI6410
127config MACH_REAL6410 127config MACH_REAL6410
128 bool "REAL6410" 128 bool "REAL6410"
129 select CPU_S3C6410 129 select CPU_S3C6410
130 select S3C_DEV_HSMMC 130 select S3C64XX_SETUP_FB_24BPP
131 select S3C_DEV_HSMMC1
132 select S3C64XX_SETUP_SDHCI 131 select S3C64XX_SETUP_SDHCI
133 select S3C_DEV_FB 132 select S3C_DEV_FB
134 select S3C64XX_SETUP_FB_24BPP 133 select S3C_DEV_HSMMC
134 select S3C_DEV_HSMMC1
135 select S3C_DEV_NAND 135 select S3C_DEV_NAND
136 select S3C_DEV_USB_HOST
136 select SAMSUNG_DEV_ADC 137 select SAMSUNG_DEV_ADC
137 select SAMSUNG_DEV_TS 138 select SAMSUNG_DEV_TS
138 select S3C_DEV_USB_HOST
139 help 139 help
140 Machine support for the CoreWind REAL6410 140 Machine support for the CoreWind REAL6410
141 141
142config MACH_SMDK6410 142config MACH_SMDK6410
143 bool "SMDK6410" 143 bool "SMDK6410"
144 select CPU_S3C6410 144 select CPU_S3C6410
145 select SAMSUNG_DEV_ADC 145 select HAVE_S3C2410_WATCHDOG if WATCHDOG
146 select S3C64XX_SETUP_FB_24BPP
147 select S3C64XX_SETUP_I2C1
148 select S3C64XX_SETUP_IDE
149 select S3C64XX_SETUP_KEYPAD
150 select S3C64XX_SETUP_SDHCI
151 select S3C64XX_SETUP_USB_PHY
152 select S3C_DEV_FB
146 select S3C_DEV_HSMMC 153 select S3C_DEV_HSMMC
147 select S3C_DEV_HSMMC1 154 select S3C_DEV_HSMMC1
148 select S3C_DEV_I2C1 155 select S3C_DEV_I2C1
149 select SAMSUNG_DEV_IDE
150 select S3C_DEV_FB
151 select S3C_DEV_RTC 156 select S3C_DEV_RTC
152 select SAMSUNG_DEV_TS
153 select S3C_DEV_USB_HOST 157 select S3C_DEV_USB_HOST
154 select S3C_DEV_USB_HSOTG 158 select S3C_DEV_USB_HSOTG
155 select S3C_DEV_WDT 159 select S3C_DEV_WDT
160 select SAMSUNG_DEV_ADC
156 select SAMSUNG_DEV_BACKLIGHT 161 select SAMSUNG_DEV_BACKLIGHT
162 select SAMSUNG_DEV_IDE
157 select SAMSUNG_DEV_KEYPAD 163 select SAMSUNG_DEV_KEYPAD
158 select SAMSUNG_DEV_PWM 164 select SAMSUNG_DEV_PWM
159 select HAVE_S3C2410_WATCHDOG if WATCHDOG 165 select SAMSUNG_DEV_TS
160 select S3C64XX_SETUP_SDHCI
161 select S3C64XX_SETUP_I2C1
162 select S3C64XX_SETUP_IDE
163 select S3C64XX_SETUP_FB_24BPP
164 select S3C64XX_SETUP_KEYPAD
165 select S3C64XX_SETUP_USB_PHY
166 help 166 help
167 Machine support for the Samsung SMDK6410 167 Machine support for the Samsung SMDK6410
168 168
@@ -198,13 +198,13 @@ endchoice
198config SMDK6410_WM1190_EV1 198config SMDK6410_WM1190_EV1
199 bool "Support Wolfson Microelectronics 1190-EV1 PMIC card" 199 bool "Support Wolfson Microelectronics 1190-EV1 PMIC card"
200 depends on MACH_SMDK6410 200 depends on MACH_SMDK6410
201 select REGULATOR
202 select REGULATOR_WM8350
203 select SAMSUNG_GPIO_EXTRA64
204 select MFD_WM8350_I2C
205 select MFD_WM8350_CONFIG_MODE_0 201 select MFD_WM8350_CONFIG_MODE_0
206 select MFD_WM8350_CONFIG_MODE_3 202 select MFD_WM8350_CONFIG_MODE_3
203 select MFD_WM8350_I2C
207 select MFD_WM8352_CONFIG_MODE_0 204 select MFD_WM8352_CONFIG_MODE_0
205 select REGULATOR
206 select REGULATOR_WM8350
207 select SAMSUNG_GPIO_EXTRA64
208 help 208 help
209 The Wolfson Microelectronics 1190-EV1 is a WM835x based PMIC 209 The Wolfson Microelectronics 1190-EV1 is a WM835x based PMIC
210 and audio daughtercard for the Samsung SMDK6410 reference 210 and audio daughtercard for the Samsung SMDK6410 reference
@@ -216,11 +216,11 @@ config SMDK6410_WM1190_EV1
216config SMDK6410_WM1192_EV1 216config SMDK6410_WM1192_EV1
217 bool "Support Wolfson Microelectronics 1192-EV1 PMIC card" 217 bool "Support Wolfson Microelectronics 1192-EV1 PMIC card"
218 depends on MACH_SMDK6410 218 depends on MACH_SMDK6410
219 select MFD_WM831X
220 select MFD_WM831X_I2C
219 select REGULATOR 221 select REGULATOR
220 select REGULATOR_WM831X 222 select REGULATOR_WM831X
221 select SAMSUNG_GPIO_EXTRA64 223 select SAMSUNG_GPIO_EXTRA64
222 select MFD_WM831X
223 select MFD_WM831X_I2C
224 help 224 help
225 The Wolfson Microelectronics 1192-EV1 is a WM831x based PMIC 225 The Wolfson Microelectronics 1192-EV1 is a WM831x based PMIC
226 daughtercard for the Samsung SMDK6410 reference platform. 226 daughtercard for the Samsung SMDK6410 reference platform.
@@ -232,19 +232,19 @@ config SMDK6410_WM1192_EV1
232config MACH_NCP 232config MACH_NCP
233 bool "NCP" 233 bool "NCP"
234 select CPU_S3C6410 234 select CPU_S3C6410
235 select S3C_DEV_I2C1
236 select S3C_DEV_HSMMC1
237 select S3C64XX_SETUP_I2C1 235 select S3C64XX_SETUP_I2C1
236 select S3C_DEV_HSMMC1
237 select S3C_DEV_I2C1
238 help 238 help
239 Machine support for the Samsung NCP 239 Machine support for the Samsung NCP
240 240
241config MACH_HMT 241config MACH_HMT
242 bool "Airgoo HMT" 242 bool "Airgoo HMT"
243 select CPU_S3C6410 243 select CPU_S3C6410
244 select S3C64XX_SETUP_FB_24BPP
244 select S3C_DEV_FB 245 select S3C_DEV_FB
245 select S3C_DEV_NAND 246 select S3C_DEV_NAND
246 select S3C_DEV_USB_HOST 247 select S3C_DEV_USB_HOST
247 select S3C64XX_SETUP_FB_24BPP
248 select SAMSUNG_DEV_PWM 248 select SAMSUNG_DEV_PWM
249 help 249 help
250 Machine support for the Airgoo HMT 250 Machine support for the Airgoo HMT
@@ -252,17 +252,17 @@ config MACH_HMT
252config MACH_SMARTQ 252config MACH_SMARTQ
253 bool 253 bool
254 select CPU_S3C6410 254 select CPU_S3C6410
255 select S3C64XX_SETUP_FB_24BPP
256 select S3C64XX_SETUP_SDHCI
257 select S3C64XX_SETUP_USB_PHY
258 select S3C_DEV_FB
255 select S3C_DEV_HSMMC 259 select S3C_DEV_HSMMC
256 select S3C_DEV_HSMMC1 260 select S3C_DEV_HSMMC1
257 select S3C_DEV_HSMMC2 261 select S3C_DEV_HSMMC2
258 select S3C_DEV_FB
259 select S3C_DEV_HWMON 262 select S3C_DEV_HWMON
260 select S3C_DEV_RTC 263 select S3C_DEV_RTC
261 select S3C_DEV_USB_HSOTG
262 select S3C_DEV_USB_HOST 264 select S3C_DEV_USB_HOST
263 select S3C64XX_SETUP_SDHCI 265 select S3C_DEV_USB_HSOTG
264 select S3C64XX_SETUP_FB_24BPP
265 select S3C64XX_SETUP_USB_PHY
266 select SAMSUNG_DEV_ADC 266 select SAMSUNG_DEV_ADC
267 select SAMSUNG_DEV_PWM 267 select SAMSUNG_DEV_PWM
268 select SAMSUNG_DEV_TS 268 select SAMSUNG_DEV_TS
@@ -284,26 +284,26 @@ config MACH_SMARTQ7
284config MACH_WLF_CRAGG_6410 284config MACH_WLF_CRAGG_6410
285 bool "Wolfson Cragganmore 6410" 285 bool "Wolfson Cragganmore 6410"
286 select CPU_S3C6410 286 select CPU_S3C6410
287 select S3C64XX_SETUP_SDHCI 287 select I2C
288 select LEDS_GPIO_REGISTER
289 select S3C64XX_DEV_SPI0
290 select S3C64XX_SETUP_FB_24BPP
288 select S3C64XX_SETUP_I2C1 291 select S3C64XX_SETUP_I2C1
289 select S3C64XX_SETUP_IDE 292 select S3C64XX_SETUP_IDE
290 select S3C64XX_SETUP_FB_24BPP
291 select S3C64XX_SETUP_KEYPAD 293 select S3C64XX_SETUP_KEYPAD
294 select S3C64XX_SETUP_SDHCI
292 select S3C64XX_SETUP_SPI 295 select S3C64XX_SETUP_SPI
293 select S3C64XX_SETUP_USB_PHY 296 select S3C64XX_SETUP_USB_PHY
294 select SAMSUNG_DEV_ADC
295 select SAMSUNG_DEV_KEYPAD
296 select S3C_DEV_USB_HOST
297 select S3C_DEV_USB_HSOTG
298 select S3C_DEV_HSMMC 297 select S3C_DEV_HSMMC
299 select S3C_DEV_HSMMC1 298 select S3C_DEV_HSMMC1
300 select S3C_DEV_HSMMC2 299 select S3C_DEV_HSMMC2
301 select S3C_DEV_I2C1 300 select S3C_DEV_I2C1
302 select S3C_DEV_WDT
303 select S3C_DEV_RTC 301 select S3C_DEV_RTC
304 select S3C64XX_DEV_SPI0 302 select S3C_DEV_USB_HOST
303 select S3C_DEV_USB_HSOTG
304 select S3C_DEV_WDT
305 select SAMSUNG_DEV_ADC
306 select SAMSUNG_DEV_KEYPAD
305 select SAMSUNG_GPIO_EXTRA128 307 select SAMSUNG_GPIO_EXTRA128
306 select I2C
307 select LEDS_GPIO_REGISTER
308 help 308 help
309 Machine support for the Wolfson Cragganmore S3C6410 variant. 309 Machine support for the Wolfson Cragganmore S3C6410 variant.
diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c
index 124fd5d6300..35f3e07eacc 100644
--- a/arch/arm/mach-s3c64xx/dev-audio.c
+++ b/arch/arm/mach-s3c64xx/dev-audio.c
@@ -20,7 +20,7 @@
20#include <mach/dma.h> 20#include <mach/dma.h>
21 21
22#include <plat/devs.h> 22#include <plat/devs.h>
23#include <plat/audio.h> 23#include <linux/platform_data/asoc-s3c.h>
24#include <plat/gpio-cfg.h> 24#include <plat/gpio-cfg.h>
25 25
26static const char *rclksrc[] = { 26static const char *rclksrc[] = {
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index ffa29ddfdfc..99e82ac81b6 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -29,6 +29,7 @@
29#include <linux/dm9000.h> 29#include <linux/dm9000.h>
30 30
31#include <video/platform_lcd.h> 31#include <video/platform_lcd.h>
32#include <video/samsung_fimd.h>
32 33
33#include <asm/hardware/vic.h> 34#include <asm/hardware/vic.h>
34#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
@@ -42,9 +43,8 @@
42#include <asm/mach-types.h> 43#include <asm/mach-types.h>
43 44
44#include <plat/regs-serial.h> 45#include <plat/regs-serial.h>
45#include <plat/iic.h> 46#include <linux/platform_data/i2c-s3c2410.h>
46#include <plat/fb.h> 47#include <plat/fb.h>
47#include <plat/regs-fb-v4.h>
48 48
49#include <plat/clock.h> 49#include <plat/clock.h>
50#include <plat/devs.h> 50#include <plat/devs.h>
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
index 9e382e7c77c..4e3fe57674c 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
@@ -16,6 +16,7 @@
16#include <linux/mfd/wm831x/irq.h> 16#include <linux/mfd/wm831x/irq.h>
17#include <linux/mfd/wm831x/gpio.h> 17#include <linux/mfd/wm831x/gpio.h>
18#include <linux/mfd/wm8994/pdata.h> 18#include <linux/mfd/wm8994/pdata.h>
19#include <linux/mfd/arizona/pdata.h>
19 20
20#include <linux/regulator/machine.h> 21#include <linux/regulator/machine.h>
21 22
@@ -24,7 +25,7 @@
24#include <sound/wm8962.h> 25#include <sound/wm8962.h>
25#include <sound/wm9081.h> 26#include <sound/wm9081.h>
26 27
27#include <plat/s3c64xx-spi.h> 28#include <linux/platform_data/spi-s3c64xx.h>
28 29
29#include <mach/crag6410.h> 30#include <mach/crag6410.h>
30 31
@@ -181,9 +182,33 @@ static const struct i2c_board_info wm1277_devs[] = {
181 }, 182 },
182}; 183};
183 184
184static const struct i2c_board_info wm5102_devs[] = { 185static struct arizona_pdata wm5102_pdata = {
185 { I2C_BOARD_INFO("wm5102", 0x1a), 186 .ldoena = S3C64XX_GPN(7),
186 .irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2, }, 187 .gpio_base = CODEC_GPIO_BASE,
188 .irq_active_high = true,
189 .micd_pol_gpio = CODEC_GPIO_BASE + 4,
190 .gpio_defaults = {
191 [2] = 0x10000, /* AIF3TXLRCLK */
192 [3] = 0x4, /* OPCLK */
193 },
194};
195
196static struct s3c64xx_spi_csinfo wm5102_spi_csinfo = {
197 .line = S3C64XX_GPN(5),
198};
199
200static struct spi_board_info wm5102_spi_devs[] = {
201 [0] = {
202 .modalias = "wm5102",
203 .max_speed_hz = 10 * 1000 * 1000,
204 .bus_num = 0,
205 .chip_select = 0,
206 .mode = SPI_MODE_0,
207 .irq = GLENFARCLAS_PMIC_IRQ_BASE +
208 WM831X_IRQ_GPIO_2,
209 .controller_data = &wm5102_spi_csinfo,
210 .platform_data = &wm5102_pdata,
211 },
187}; 212};
188 213
189static const struct i2c_board_info wm6230_i2c_devs[] = { 214static const struct i2c_board_info wm6230_i2c_devs[] = {
@@ -223,8 +248,9 @@ static __devinitdata const struct {
223 { .id = 0x3c, .name = "1273-EV1 Longmorn" }, 248 { .id = 0x3c, .name = "1273-EV1 Longmorn" },
224 { .id = 0x3d, .name = "1277-EV1 Littlemill", 249 { .id = 0x3d, .name = "1277-EV1 Littlemill",
225 .i2c_devs = wm1277_devs, .num_i2c_devs = ARRAY_SIZE(wm1277_devs) }, 250 .i2c_devs = wm1277_devs, .num_i2c_devs = ARRAY_SIZE(wm1277_devs) },
226 { .id = 0x3e, .name = "WM5102-6271-EV1-CS127", 251 { .id = 0x3e, .name = "WM5102-6271-EV1-CS127 Amrut",
227 .i2c_devs = wm5102_devs, .num_i2c_devs = ARRAY_SIZE(wm5102_devs) }, 252 .spi_devs = wm5102_spi_devs,
253 .num_spi_devs = ARRAY_SIZE(wm5102_spi_devs) },
228}; 254};
229 255
230static __devinit int wlf_gf_module_probe(struct i2c_client *i2c, 256static __devinit int wlf_gf_module_probe(struct i2c_client *i2c,
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index 09cd81207a3..13b7eaa45fd 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -46,6 +46,7 @@
46#include <asm/mach/arch.h> 46#include <asm/mach/arch.h>
47#include <asm/mach-types.h> 47#include <asm/mach-types.h>
48 48
49#include <video/samsung_fimd.h>
49#include <mach/hardware.h> 50#include <mach/hardware.h>
50#include <mach/map.h> 51#include <mach/map.h>
51 52
@@ -57,18 +58,17 @@
57#include <mach/regs-gpio-memport.h> 58#include <mach/regs-gpio-memport.h>
58 59
59#include <plat/regs-serial.h> 60#include <plat/regs-serial.h>
60#include <plat/regs-fb-v4.h>
61#include <plat/fb.h> 61#include <plat/fb.h>
62#include <plat/sdhci.h> 62#include <plat/sdhci.h>
63#include <plat/gpio-cfg.h> 63#include <plat/gpio-cfg.h>
64#include <plat/s3c64xx-spi.h> 64#include <linux/platform_data/spi-s3c64xx.h>
65 65
66#include <plat/keypad.h> 66#include <plat/keypad.h>
67#include <plat/clock.h> 67#include <plat/clock.h>
68#include <plat/devs.h> 68#include <plat/devs.h>
69#include <plat/cpu.h> 69#include <plat/cpu.h>
70#include <plat/adc.h> 70#include <plat/adc.h>
71#include <plat/iic.h> 71#include <linux/platform_data/i2c-s3c2410.h>
72#include <plat/pm.h> 72#include <plat/pm.h>
73 73
74#include "common.h" 74#include "common.h"
@@ -287,6 +287,16 @@ static struct platform_device littlemill_device = {
287 .id = -1, 287 .id = -1,
288}; 288};
289 289
290static struct platform_device bells_wm5102_device = {
291 .name = "bells",
292 .id = 0,
293};
294
295static struct platform_device bells_wm5110_device = {
296 .name = "bells",
297 .id = 1,
298};
299
290static struct regulator_consumer_supply wallvdd_consumers[] = { 300static struct regulator_consumer_supply wallvdd_consumers[] = {
291 REGULATOR_SUPPLY("SPKVDD", "1-001a"), 301 REGULATOR_SUPPLY("SPKVDD", "1-001a"),
292 REGULATOR_SUPPLY("SPKVDD1", "1-001a"), 302 REGULATOR_SUPPLY("SPKVDD1", "1-001a"),
@@ -359,6 +369,8 @@ static struct platform_device *crag6410_devices[] __initdata = {
359 &tobermory_device, 369 &tobermory_device,
360 &littlemill_device, 370 &littlemill_device,
361 &lowland_device, 371 &lowland_device,
372 &bells_wm5102_device,
373 &bells_wm5110_device,
362 &wallvdd_device, 374 &wallvdd_device,
363}; 375};
364 376
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index 689088162f7..2b144893ddc 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -26,6 +26,7 @@
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <asm/mach/irq.h> 27#include <asm/mach/irq.h>
28 28
29#include <video/samsung_fimd.h>
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <mach/map.h> 31#include <mach/map.h>
31 32
@@ -34,14 +35,13 @@
34#include <asm/mach-types.h> 35#include <asm/mach-types.h>
35 36
36#include <plat/regs-serial.h> 37#include <plat/regs-serial.h>
37#include <plat/iic.h> 38#include <linux/platform_data/i2c-s3c2410.h>
38#include <plat/fb.h> 39#include <plat/fb.h>
39#include <plat/nand.h> 40#include <linux/platform_data/mtd-nand-s3c2410.h>
40 41
41#include <plat/clock.h> 42#include <plat/clock.h>
42#include <plat/devs.h> 43#include <plat/devs.h>
43#include <plat/cpu.h> 44#include <plat/cpu.h>
44#include <plat/regs-fb-v4.h>
45 45
46#include "common.h" 46#include "common.h"
47 47
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index 5539a255a70..07c349cca33 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -38,12 +38,12 @@
38#include <plat/cpu.h> 38#include <plat/cpu.h>
39#include <plat/devs.h> 39#include <plat/devs.h>
40#include <plat/fb.h> 40#include <plat/fb.h>
41#include <plat/nand.h> 41#include <linux/platform_data/mtd-nand-s3c2410.h>
42#include <plat/regs-serial.h> 42#include <plat/regs-serial.h>
43#include <plat/ts.h> 43#include <linux/platform_data/touchscreen-s3c2410.h>
44#include <plat/regs-fb-v4.h>
45 44
46#include <video/platform_lcd.h> 45#include <video/platform_lcd.h>
46#include <video/samsung_fimd.h>
47 47
48#include "common.h" 48#include "common.h"
49 49
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index cad2e05eddf..e5f9a79b535 100644
--- a/arch/arm/mach-s3c64xx/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -24,6 +24,7 @@
24#include <linux/delay.h> 24#include <linux/delay.h>
25 25
26#include <video/platform_lcd.h> 26#include <video/platform_lcd.h>
27#include <video/samsung_fimd.h>
27 28
28#include <asm/hardware/vic.h> 29#include <asm/hardware/vic.h>
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
@@ -37,13 +38,12 @@
37#include <asm/mach-types.h> 38#include <asm/mach-types.h>
38 39
39#include <plat/regs-serial.h> 40#include <plat/regs-serial.h>
40#include <plat/iic.h> 41#include <linux/platform_data/i2c-s3c2410.h>
41#include <plat/fb.h> 42#include <plat/fb.h>
42 43
43#include <plat/clock.h> 44#include <plat/clock.h>
44#include <plat/devs.h> 45#include <plat/devs.h>
45#include <plat/cpu.h> 46#include <plat/cpu.h>
46#include <plat/regs-fb-v4.h>
47 47
48#include "common.h" 48#include "common.h"
49 49
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index 326b21604bc..7476f7c722a 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -39,12 +39,12 @@
39#include <plat/cpu.h> 39#include <plat/cpu.h>
40#include <plat/devs.h> 40#include <plat/devs.h>
41#include <plat/fb.h> 41#include <plat/fb.h>
42#include <plat/nand.h> 42#include <linux/platform_data/mtd-nand-s3c2410.h>
43#include <plat/regs-serial.h> 43#include <plat/regs-serial.h>
44#include <plat/ts.h> 44#include <linux/platform_data/touchscreen-s3c2410.h>
45#include <plat/regs-fb-v4.h>
46 45
47#include <video/platform_lcd.h> 46#include <video/platform_lcd.h>
47#include <video/samsung_fimd.h>
48 48
49#include "common.h" 49#include "common.h"
50 50
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index ceeb1de4037..c6d7390939a 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -30,13 +30,13 @@
30#include <plat/clock.h> 30#include <plat/clock.h>
31#include <plat/cpu.h> 31#include <plat/cpu.h>
32#include <plat/devs.h> 32#include <plat/devs.h>
33#include <plat/iic.h> 33#include <linux/platform_data/i2c-s3c2410.h>
34#include <plat/gpio-cfg.h> 34#include <plat/gpio-cfg.h>
35#include <plat/hwmon.h> 35#include <linux/platform_data/hwmon-s3c.h>
36#include <plat/regs-serial.h> 36#include <plat/regs-serial.h>
37#include <plat/usb-control.h> 37#include <linux/platform_data/usb-ohci-s3c2410.h>
38#include <plat/sdhci.h> 38#include <plat/sdhci.h>
39#include <plat/ts.h> 39#include <linux/platform_data/touchscreen-s3c2410.h>
40 40
41#include <video/platform_lcd.h> 41#include <video/platform_lcd.h>
42 42
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index d6266d8b43c..96d6da2b6b5 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -21,6 +21,7 @@
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23 23
24#include <video/samsung_fimd.h>
24#include <mach/map.h> 25#include <mach/map.h>
25#include <mach/regs-gpio.h> 26#include <mach/regs-gpio.h>
26 27
@@ -28,7 +29,6 @@
28#include <plat/devs.h> 29#include <plat/devs.h>
29#include <plat/fb.h> 30#include <plat/fb.h>
30#include <plat/gpio-cfg.h> 31#include <plat/gpio-cfg.h>
31#include <plat/regs-fb-v4.h>
32 32
33#include "common.h" 33#include "common.h"
34#include "mach-smartq.h" 34#include "mach-smartq.h"
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index 0957d2a980e..7d1167bdc92 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -21,6 +21,7 @@
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23 23
24#include <video/samsung_fimd.h>
24#include <mach/map.h> 25#include <mach/map.h>
25#include <mach/regs-gpio.h> 26#include <mach/regs-gpio.h>
26 27
@@ -28,7 +29,6 @@
28#include <plat/devs.h> 29#include <plat/devs.h>
29#include <plat/fb.h> 30#include <plat/fb.h>
30#include <plat/gpio-cfg.h> 31#include <plat/gpio-cfg.h>
31#include <plat/regs-fb-v4.h>
32 32
33#include "common.h" 33#include "common.h"
34#include "mach-smartq.h" 34#include "mach-smartq.h"
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index b0f4525c66b..a928fae5694 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
@@ -35,7 +35,7 @@
35#include <plat/clock.h> 35#include <plat/clock.h>
36#include <plat/devs.h> 36#include <plat/devs.h>
37#include <plat/cpu.h> 37#include <plat/cpu.h>
38#include <plat/iic.h> 38#include <linux/platform_data/i2c-s3c2410.h>
39 39
40#include "common.h" 40#include "common.h"
41 41
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 0fe4f1503f4..da1a771a29e 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -43,6 +43,7 @@
43#endif 43#endif
44 44
45#include <video/platform_lcd.h> 45#include <video/platform_lcd.h>
46#include <video/samsung_fimd.h>
46 47
47#include <asm/hardware/vic.h> 48#include <asm/hardware/vic.h>
48#include <asm/mach/arch.h> 49#include <asm/mach/arch.h>
@@ -60,8 +61,8 @@
60#include <mach/regs-gpio.h> 61#include <mach/regs-gpio.h>
61#include <mach/regs-sys.h> 62#include <mach/regs-sys.h>
62#include <mach/regs-srom.h> 63#include <mach/regs-srom.h>
63#include <plat/ata.h> 64#include <linux/platform_data/ata-samsung_cf.h>
64#include <plat/iic.h> 65#include <linux/platform_data/i2c-s3c2410.h>
65#include <plat/fb.h> 66#include <plat/fb.h>
66#include <plat/gpio-cfg.h> 67#include <plat/gpio-cfg.h>
67 68
@@ -69,10 +70,9 @@
69#include <plat/devs.h> 70#include <plat/devs.h>
70#include <plat/cpu.h> 71#include <plat/cpu.h>
71#include <plat/adc.h> 72#include <plat/adc.h>
72#include <plat/ts.h> 73#include <linux/platform_data/touchscreen-s3c2410.h>
73#include <plat/keypad.h> 74#include <plat/keypad.h>
74#include <plat/backlight.h> 75#include <plat/backlight.h>
75#include <plat/regs-fb-v4.h>
76 76
77#include "common.h" 77#include "common.h"
78 78
diff --git a/arch/arm/mach-s3c64xx/setup-i2c0.c b/arch/arm/mach-s3c64xx/setup-i2c0.c
index 241af94a9e7..40666ba8d60 100644
--- a/arch/arm/mach-s3c64xx/setup-i2c0.c
+++ b/arch/arm/mach-s3c64xx/setup-i2c0.c
@@ -18,7 +18,7 @@
18 18
19struct platform_device; /* don't need the contents */ 19struct platform_device; /* don't need the contents */
20 20
21#include <plat/iic.h> 21#include <linux/platform_data/i2c-s3c2410.h>
22#include <plat/gpio-cfg.h> 22#include <plat/gpio-cfg.h>
23 23
24void s3c_i2c0_cfg_gpio(struct platform_device *dev) 24void s3c_i2c0_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-s3c64xx/setup-i2c1.c b/arch/arm/mach-s3c64xx/setup-i2c1.c
index 3d13a961986..3fdb24c4e62 100644
--- a/arch/arm/mach-s3c64xx/setup-i2c1.c
+++ b/arch/arm/mach-s3c64xx/setup-i2c1.c
@@ -18,7 +18,7 @@
18 18
19struct platform_device; /* don't need the contents */ 19struct platform_device; /* don't need the contents */
20 20
21#include <plat/iic.h> 21#include <linux/platform_data/i2c-s3c2410.h>
22#include <plat/gpio-cfg.h> 22#include <plat/gpio-cfg.h>
23 23
24void s3c_i2c1_cfg_gpio(struct platform_device *dev) 24void s3c_i2c1_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-s3c64xx/setup-ide.c b/arch/arm/mach-s3c64xx/setup-ide.c
index 41b425602d8..648d8b85bf6 100644
--- a/arch/arm/mach-s3c64xx/setup-ide.c
+++ b/arch/arm/mach-s3c64xx/setup-ide.c
@@ -17,7 +17,7 @@
17#include <mach/map.h> 17#include <mach/map.h>
18#include <mach/regs-clock.h> 18#include <mach/regs-clock.h>
19#include <plat/gpio-cfg.h> 19#include <plat/gpio-cfg.h>
20#include <plat/ata.h> 20#include <linux/platform_data/ata-samsung_cf.h>
21 21
22void s3c64xx_ide_setup_gpio(void) 22void s3c64xx_ide_setup_gpio(void)
23{ 23{
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index c87f6108eeb..e8742cb7ddd 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -9,18 +9,18 @@ if ARCH_S5P64X0
9 9
10config CPU_S5P6440 10config CPU_S5P6440
11 bool 11 bool
12 select SAMSUNG_DMADEV
13 select S5P_HRT 12 select S5P_HRT
14 select S5P_SLEEP if PM 13 select S5P_SLEEP if PM
14 select SAMSUNG_DMADEV
15 select SAMSUNG_WAKEMASK if PM 15 select SAMSUNG_WAKEMASK if PM
16 help 16 help
17 Enable S5P6440 CPU support 17 Enable S5P6440 CPU support
18 18
19config CPU_S5P6450 19config CPU_S5P6450
20 bool 20 bool
21 select SAMSUNG_DMADEV
22 select S5P_HRT 21 select S5P_HRT
23 select S5P_SLEEP if PM 22 select S5P_SLEEP if PM
23 select SAMSUNG_DMADEV
24 select SAMSUNG_WAKEMASK if PM 24 select SAMSUNG_WAKEMASK if PM
25 help 25 help
26 Enable S5P6450 CPU support 26 Enable S5P6450 CPU support
@@ -52,19 +52,19 @@ config MACH_SMDK6440
52 bool "SMDK6440" 52 bool "SMDK6440"
53 select CPU_S5P6440 53 select CPU_S5P6440
54 select S3C_DEV_FB 54 select S3C_DEV_FB
55 select S3C_DEV_I2C1
56 select S3C_DEV_RTC
57 select S3C_DEV_WDT
58 select S3C_DEV_HSMMC 55 select S3C_DEV_HSMMC
59 select S3C_DEV_HSMMC1 56 select S3C_DEV_HSMMC1
60 select S3C_DEV_HSMMC2 57 select S3C_DEV_HSMMC2
58 select S3C_DEV_I2C1
59 select S3C_DEV_RTC
60 select S3C_DEV_WDT
61 select S5P64X0_SETUP_FB_24BPP
62 select S5P64X0_SETUP_I2C1
63 select S5P64X0_SETUP_SDHCI_GPIO
61 select SAMSUNG_DEV_ADC 64 select SAMSUNG_DEV_ADC
62 select SAMSUNG_DEV_BACKLIGHT 65 select SAMSUNG_DEV_BACKLIGHT
63 select SAMSUNG_DEV_PWM 66 select SAMSUNG_DEV_PWM
64 select SAMSUNG_DEV_TS 67 select SAMSUNG_DEV_TS
65 select S5P64X0_SETUP_FB_24BPP
66 select S5P64X0_SETUP_I2C1
67 select S5P64X0_SETUP_SDHCI_GPIO
68 help 68 help
69 Machine support for the Samsung SMDK6440 69 Machine support for the Samsung SMDK6440
70 70
@@ -72,19 +72,19 @@ config MACH_SMDK6450
72 bool "SMDK6450" 72 bool "SMDK6450"
73 select CPU_S5P6450 73 select CPU_S5P6450
74 select S3C_DEV_FB 74 select S3C_DEV_FB
75 select S3C_DEV_I2C1
76 select S3C_DEV_RTC
77 select S3C_DEV_WDT
78 select S3C_DEV_HSMMC 75 select S3C_DEV_HSMMC
79 select S3C_DEV_HSMMC1 76 select S3C_DEV_HSMMC1
80 select S3C_DEV_HSMMC2 77 select S3C_DEV_HSMMC2
78 select S3C_DEV_I2C1
79 select S3C_DEV_RTC
80 select S3C_DEV_WDT
81 select S5P64X0_SETUP_FB_24BPP
82 select S5P64X0_SETUP_I2C1
83 select S5P64X0_SETUP_SDHCI_GPIO
81 select SAMSUNG_DEV_ADC 84 select SAMSUNG_DEV_ADC
82 select SAMSUNG_DEV_BACKLIGHT 85 select SAMSUNG_DEV_BACKLIGHT
83 select SAMSUNG_DEV_PWM 86 select SAMSUNG_DEV_PWM
84 select SAMSUNG_DEV_TS 87 select SAMSUNG_DEV_TS
85 select S5P64X0_SETUP_FB_24BPP
86 select S5P64X0_SETUP_I2C1
87 select S5P64X0_SETUP_SDHCI_GPIO
88 help 88 help
89 Machine support for the Samsung SMDK6450 89 Machine support for the Samsung SMDK6450
90 90
diff --git a/arch/arm/mach-s5p64x0/dev-audio.c b/arch/arm/mach-s5p64x0/dev-audio.c
index 91113ddc51d..a0d6edfd23a 100644
--- a/arch/arm/mach-s5p64x0/dev-audio.c
+++ b/arch/arm/mach-s5p64x0/dev-audio.c
@@ -13,7 +13,7 @@
13#include <linux/gpio.h> 13#include <linux/gpio.h>
14 14
15#include <plat/gpio-cfg.h> 15#include <plat/gpio-cfg.h>
16#include <plat/audio.h> 16#include <linux/platform_data/asoc-s3c.h>
17 17
18#include <mach/map.h> 18#include <mach/map.h>
19#include <mach/dma.h> 19#include <mach/dma.h>
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 92fefad505c..96ea1fe0ec9 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -27,6 +27,7 @@
27#include <linux/mmc/host.h> 27#include <linux/mmc/host.h>
28 28
29#include <video/platform_lcd.h> 29#include <video/platform_lcd.h>
30#include <video/samsung_fimd.h>
30 31
31#include <asm/hardware/vic.h> 32#include <asm/hardware/vic.h>
32#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
@@ -45,14 +46,13 @@
45#include <plat/clock.h> 46#include <plat/clock.h>
46#include <plat/devs.h> 47#include <plat/devs.h>
47#include <plat/cpu.h> 48#include <plat/cpu.h>
48#include <plat/iic.h> 49#include <linux/platform_data/i2c-s3c2410.h>
49#include <plat/pll.h> 50#include <plat/pll.h>
50#include <plat/adc.h> 51#include <plat/adc.h>
51#include <plat/ts.h> 52#include <linux/platform_data/touchscreen-s3c2410.h>
52#include <plat/s5p-time.h> 53#include <plat/s5p-time.h>
53#include <plat/backlight.h> 54#include <plat/backlight.h>
54#include <plat/fb.h> 55#include <plat/fb.h>
55#include <plat/regs-fb.h>
56#include <plat/sdhci.h> 56#include <plat/sdhci.h>
57 57
58#include "common.h" 58#include "common.h"
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index e2335ecf6ea..12748b6eaa7 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -27,6 +27,7 @@
27#include <linux/mmc/host.h> 27#include <linux/mmc/host.h>
28 28
29#include <video/platform_lcd.h> 29#include <video/platform_lcd.h>
30#include <video/samsung_fimd.h>
30 31
31#include <asm/hardware/vic.h> 32#include <asm/hardware/vic.h>
32#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
@@ -45,14 +46,13 @@
45#include <plat/clock.h> 46#include <plat/clock.h>
46#include <plat/devs.h> 47#include <plat/devs.h>
47#include <plat/cpu.h> 48#include <plat/cpu.h>
48#include <plat/iic.h> 49#include <linux/platform_data/i2c-s3c2410.h>
49#include <plat/pll.h> 50#include <plat/pll.h>
50#include <plat/adc.h> 51#include <plat/adc.h>
51#include <plat/ts.h> 52#include <linux/platform_data/touchscreen-s3c2410.h>
52#include <plat/s5p-time.h> 53#include <plat/s5p-time.h>
53#include <plat/backlight.h> 54#include <plat/backlight.h>
54#include <plat/fb.h> 55#include <plat/fb.h>
55#include <plat/regs-fb.h>
56#include <plat/sdhci.h> 56#include <plat/sdhci.h>
57 57
58#include "common.h" 58#include "common.h"
diff --git a/arch/arm/mach-s5p64x0/setup-i2c0.c b/arch/arm/mach-s5p64x0/setup-i2c0.c
index 46b463917c5..a32edc545e6 100644
--- a/arch/arm/mach-s5p64x0/setup-i2c0.c
+++ b/arch/arm/mach-s5p64x0/setup-i2c0.c
@@ -19,7 +19,7 @@
19struct platform_device; /* don't need the contents */ 19struct platform_device; /* don't need the contents */
20 20
21#include <plat/gpio-cfg.h> 21#include <plat/gpio-cfg.h>
22#include <plat/iic.h> 22#include <linux/platform_data/i2c-s3c2410.h>
23 23
24#include <mach/i2c.h> 24#include <mach/i2c.h>
25 25
diff --git a/arch/arm/mach-s5p64x0/setup-i2c1.c b/arch/arm/mach-s5p64x0/setup-i2c1.c
index 6ad3b986021..ca2c5c7f8aa 100644
--- a/arch/arm/mach-s5p64x0/setup-i2c1.c
+++ b/arch/arm/mach-s5p64x0/setup-i2c1.c
@@ -19,7 +19,7 @@
19struct platform_device; /* don't need the contents */ 19struct platform_device; /* don't need the contents */
20 20
21#include <plat/gpio-cfg.h> 21#include <plat/gpio-cfg.h>
22#include <plat/iic.h> 22#include <linux/platform_data/i2c-s3c2410.h>
23 23
24#include <mach/i2c.h> 24#include <mach/i2c.h>
25 25
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index 75a26eaf263..15170be97a7 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -60,12 +60,6 @@ config MACH_SMDKC100
60 select S3C_DEV_I2C1 60 select S3C_DEV_I2C1
61 select S3C_DEV_RTC 61 select S3C_DEV_RTC
62 select S3C_DEV_WDT 62 select S3C_DEV_WDT
63 select SAMSUNG_DEV_ADC
64 select SAMSUNG_DEV_BACKLIGHT
65 select SAMSUNG_DEV_IDE
66 select SAMSUNG_DEV_KEYPAD
67 select SAMSUNG_DEV_PWM
68 select SAMSUNG_DEV_TS
69 select S5PC100_SETUP_FB_24BPP 63 select S5PC100_SETUP_FB_24BPP
70 select S5PC100_SETUP_I2C1 64 select S5PC100_SETUP_I2C1
71 select S5PC100_SETUP_IDE 65 select S5PC100_SETUP_IDE
@@ -74,6 +68,12 @@ config MACH_SMDKC100
74 select S5P_DEV_FIMC0 68 select S5P_DEV_FIMC0
75 select S5P_DEV_FIMC1 69 select S5P_DEV_FIMC1
76 select S5P_DEV_FIMC2 70 select S5P_DEV_FIMC2
71 select SAMSUNG_DEV_ADC
72 select SAMSUNG_DEV_BACKLIGHT
73 select SAMSUNG_DEV_IDE
74 select SAMSUNG_DEV_KEYPAD
75 select SAMSUNG_DEV_PWM
76 select SAMSUNG_DEV_TS
77 help 77 help
78 Machine support for the Samsung SMDKC100 78 Machine support for the Samsung SMDKC100
79 79
diff --git a/arch/arm/mach-s5pc100/dev-audio.c b/arch/arm/mach-s5pc100/dev-audio.c
index 9d4bde3f111..1cc252cef26 100644
--- a/arch/arm/mach-s5pc100/dev-audio.c
+++ b/arch/arm/mach-s5pc100/dev-audio.c
@@ -13,7 +13,7 @@
13#include <linux/gpio.h> 13#include <linux/gpio.h>
14 14
15#include <plat/gpio-cfg.h> 15#include <plat/gpio-cfg.h>
16#include <plat/audio.h> 16#include <linux/platform_data/asoc-s3c.h>
17 17
18#include <mach/map.h> 18#include <mach/map.h>
19#include <mach/dma.h> 19#include <mach/dma.h>
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 0c3ae38d27c..dba7384a87b 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -33,6 +33,7 @@
33#include <mach/regs-gpio.h> 33#include <mach/regs-gpio.h>
34 34
35#include <video/platform_lcd.h> 35#include <video/platform_lcd.h>
36#include <video/samsung_fimd.h>
36 37
37#include <asm/irq.h> 38#include <asm/irq.h>
38#include <asm/mach-types.h> 39#include <asm/mach-types.h>
@@ -44,14 +45,13 @@
44#include <plat/devs.h> 45#include <plat/devs.h>
45#include <plat/cpu.h> 46#include <plat/cpu.h>
46#include <plat/fb.h> 47#include <plat/fb.h>
47#include <plat/iic.h> 48#include <linux/platform_data/i2c-s3c2410.h>
48#include <plat/ata.h> 49#include <linux/platform_data/ata-samsung_cf.h>
49#include <plat/adc.h> 50#include <plat/adc.h>
50#include <plat/keypad.h> 51#include <plat/keypad.h>
51#include <plat/ts.h> 52#include <linux/platform_data/touchscreen-s3c2410.h>
52#include <plat/audio.h> 53#include <linux/platform_data/asoc-s3c.h>
53#include <plat/backlight.h> 54#include <plat/backlight.h>
54#include <plat/regs-fb-v4.h>
55 55
56#include "common.h" 56#include "common.h"
57 57
diff --git a/arch/arm/mach-s5pc100/setup-i2c0.c b/arch/arm/mach-s5pc100/setup-i2c0.c
index eaef7a3bda4..89a6a769d62 100644
--- a/arch/arm/mach-s5pc100/setup-i2c0.c
+++ b/arch/arm/mach-s5pc100/setup-i2c0.c
@@ -18,7 +18,7 @@
18struct platform_device; /* don't need the contents */ 18struct platform_device; /* don't need the contents */
19 19
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <plat/iic.h> 21#include <linux/platform_data/i2c-s3c2410.h>
22#include <plat/gpio-cfg.h> 22#include <plat/gpio-cfg.h>
23 23
24void s3c_i2c0_cfg_gpio(struct platform_device *dev) 24void s3c_i2c0_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-s5pc100/setup-i2c1.c b/arch/arm/mach-s5pc100/setup-i2c1.c
index aaff74a90de..faa667ef02c 100644
--- a/arch/arm/mach-s5pc100/setup-i2c1.c
+++ b/arch/arm/mach-s5pc100/setup-i2c1.c
@@ -18,7 +18,7 @@
18struct platform_device; /* don't need the contents */ 18struct platform_device; /* don't need the contents */
19 19
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <plat/iic.h> 21#include <linux/platform_data/i2c-s3c2410.h>
22#include <plat/gpio-cfg.h> 22#include <plat/gpio-cfg.h>
23 23
24void s3c_i2c1_cfg_gpio(struct platform_device *dev) 24void s3c_i2c1_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 77185c38188..92ad72f0ef9 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -11,11 +11,11 @@ if ARCH_S5PV210
11 11
12config CPU_S5PV210 12config CPU_S5PV210
13 bool 13 bool
14 select SAMSUNG_DMADEV
15 select S5P_EXT_INT 14 select S5P_EXT_INT
16 select S5P_HRT 15 select S5P_HRT
17 select S5P_PM if PM 16 select S5P_PM if PM
18 select S5P_SLEEP if PM 17 select S5P_SLEEP if PM
18 select SAMSUNG_DMADEV
19 help 19 help
20 Enable S5PV210 CPU support 20 Enable S5PV210 CPU support
21 21
@@ -76,44 +76,44 @@ config MACH_AQUILA
76 bool "Aquila" 76 bool "Aquila"
77 select CPU_S5PV210 77 select CPU_S5PV210
78 select S3C_DEV_FB 78 select S3C_DEV_FB
79 select S5P_DEV_FIMC0
80 select S5P_DEV_FIMC1
81 select S5P_DEV_FIMC2
82 select S3C_DEV_HSMMC 79 select S3C_DEV_HSMMC
83 select S3C_DEV_HSMMC1 80 select S3C_DEV_HSMMC1
84 select S3C_DEV_HSMMC2 81 select S3C_DEV_HSMMC2
85 select S5P_DEV_ONENAND
86 select S5PV210_SETUP_FB_24BPP 82 select S5PV210_SETUP_FB_24BPP
87 select S5PV210_SETUP_SDHCI 83 select S5PV210_SETUP_SDHCI
88 select S5PV210_SETUP_USB_PHY 84 select S5PV210_SETUP_USB_PHY
85 select S5P_DEV_FIMC0
86 select S5P_DEV_FIMC1
87 select S5P_DEV_FIMC2
88 select S5P_DEV_ONENAND
89 help 89 help
90 Machine support for the Samsung Aquila target based on S5PC110 SoC 90 Machine support for the Samsung Aquila target based on S5PC110 SoC
91 91
92config MACH_GONI 92config MACH_GONI
93 bool "GONI" 93 bool "GONI"
94 select CPU_S5PV210 94 select CPU_S5PV210
95 select S5P_GPIO_INT
96 select S3C_DEV_FB 95 select S3C_DEV_FB
97 select S5P_DEV_FIMC0
98 select S5P_DEV_FIMC1
99 select S5P_DEV_FIMC2
100 select S3C_DEV_HSMMC 96 select S3C_DEV_HSMMC
101 select S3C_DEV_HSMMC1 97 select S3C_DEV_HSMMC1
102 select S3C_DEV_HSMMC2 98 select S3C_DEV_HSMMC2
103 select S3C_DEV_I2C1 99 select S3C_DEV_I2C1
104 select S3C_DEV_I2C2 100 select S3C_DEV_I2C2
105 select S5P_DEV_MFC
106 select S3C_DEV_USB_HSOTG 101 select S3C_DEV_USB_HSOTG
107 select S5P_DEV_ONENAND
108 select SAMSUNG_DEV_KEYPAD
109 select S5P_DEV_TV
110 select S5PV210_SETUP_FB_24BPP 102 select S5PV210_SETUP_FB_24BPP
103 select S5PV210_SETUP_FIMC
111 select S5PV210_SETUP_I2C1 104 select S5PV210_SETUP_I2C1
112 select S5PV210_SETUP_I2C2 105 select S5PV210_SETUP_I2C2
113 select S5PV210_SETUP_KEYPAD 106 select S5PV210_SETUP_KEYPAD
114 select S5PV210_SETUP_SDHCI 107 select S5PV210_SETUP_SDHCI
115 select S5PV210_SETUP_FIMC
116 select S5PV210_SETUP_USB_PHY 108 select S5PV210_SETUP_USB_PHY
109 select S5P_DEV_FIMC0
110 select S5P_DEV_FIMC1
111 select S5P_DEV_FIMC2
112 select S5P_DEV_MFC
113 select S5P_DEV_ONENAND
114 select S5P_DEV_TV
115 select S5P_GPIO_INT
116 select SAMSUNG_DEV_KEYPAD
117 help 117 help
118 Machine support for Samsung GONI board 118 Machine support for Samsung GONI board
119 S5PC110(MCP) is one of package option of S5PV210 119 S5PC110(MCP) is one of package option of S5PV210
@@ -125,14 +125,14 @@ config MACH_SMDKC110
125 select S3C_DEV_I2C2 125 select S3C_DEV_I2C2
126 select S3C_DEV_RTC 126 select S3C_DEV_RTC
127 select S3C_DEV_WDT 127 select S3C_DEV_WDT
128 select S5PV210_SETUP_I2C1
129 select S5PV210_SETUP_I2C2
130 select S5PV210_SETUP_IDE
128 select S5P_DEV_FIMC0 131 select S5P_DEV_FIMC0
129 select S5P_DEV_FIMC1 132 select S5P_DEV_FIMC1
130 select S5P_DEV_FIMC2 133 select S5P_DEV_FIMC2
131 select S5P_DEV_MFC 134 select S5P_DEV_MFC
132 select SAMSUNG_DEV_IDE 135 select SAMSUNG_DEV_IDE
133 select S5PV210_SETUP_I2C1
134 select S5PV210_SETUP_I2C2
135 select S5PV210_SETUP_IDE
136 help 136 help
137 Machine support for Samsung SMDKC110 137 Machine support for Samsung SMDKC110
138 S5PC110(MCP) is one of package option of S5PV210 138 S5PC110(MCP) is one of package option of S5PV210
@@ -154,6 +154,13 @@ config MACH_SMDKV210
154 select S3C_DEV_RTC 154 select S3C_DEV_RTC
155 select S3C_DEV_USB_HSOTG 155 select S3C_DEV_USB_HSOTG
156 select S3C_DEV_WDT 156 select S3C_DEV_WDT
157 select S5PV210_SETUP_FB_24BPP
158 select S5PV210_SETUP_I2C1
159 select S5PV210_SETUP_I2C2
160 select S5PV210_SETUP_IDE
161 select S5PV210_SETUP_KEYPAD
162 select S5PV210_SETUP_SDHCI
163 select S5PV210_SETUP_USB_PHY
157 select S5P_DEV_FIMC0 164 select S5P_DEV_FIMC0
158 select S5P_DEV_FIMC1 165 select S5P_DEV_FIMC1
159 select S5P_DEV_FIMC2 166 select S5P_DEV_FIMC2
@@ -165,20 +172,13 @@ config MACH_SMDKV210
165 select SAMSUNG_DEV_KEYPAD 172 select SAMSUNG_DEV_KEYPAD
166 select SAMSUNG_DEV_PWM 173 select SAMSUNG_DEV_PWM
167 select SAMSUNG_DEV_TS 174 select SAMSUNG_DEV_TS
168 select S5PV210_SETUP_FB_24BPP
169 select S5PV210_SETUP_I2C1
170 select S5PV210_SETUP_I2C2
171 select S5PV210_SETUP_IDE
172 select S5PV210_SETUP_KEYPAD
173 select S5PV210_SETUP_SDHCI
174 select S5PV210_SETUP_USB_PHY
175 help 175 help
176 Machine support for Samsung SMDKV210 176 Machine support for Samsung SMDKV210
177 177
178config MACH_TORBRECK 178config MACH_TORBRECK
179 bool "Torbreck" 179 bool "Torbreck"
180 select CPU_S5PV210
181 select ARCH_SPARSEMEM_ENABLE 180 select ARCH_SPARSEMEM_ENABLE
181 select CPU_S5PV210
182 select S3C_DEV_HSMMC 182 select S3C_DEV_HSMMC
183 select S3C_DEV_HSMMC1 183 select S3C_DEV_HSMMC1
184 select S3C_DEV_HSMMC2 184 select S3C_DEV_HSMMC2
diff --git a/arch/arm/mach-s5pv210/dev-audio.c b/arch/arm/mach-s5pv210/dev-audio.c
index 8367749c3ee..0a5480bbcbd 100644
--- a/arch/arm/mach-s5pv210/dev-audio.c
+++ b/arch/arm/mach-s5pv210/dev-audio.c
@@ -13,7 +13,7 @@
13#include <linux/gpio.h> 13#include <linux/gpio.h>
14 14
15#include <plat/gpio-cfg.h> 15#include <plat/gpio-cfg.h>
16#include <plat/audio.h> 16#include <linux/platform_data/asoc-s3c.h>
17 17
18#include <mach/map.h> 18#include <mach/map.h>
19#include <mach/dma.h> 19#include <mach/dma.h>
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
index 78028df86c5..ee9fa5c2ef2 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -28,6 +28,7 @@
28#include <asm/setup.h> 28#include <asm/setup.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30 30
31#include <video/samsung_fimd.h>
31#include <mach/map.h> 32#include <mach/map.h>
32#include <mach/regs-clock.h> 33#include <mach/regs-clock.h>
33 34
@@ -39,7 +40,6 @@
39#include <plat/fimc-core.h> 40#include <plat/fimc-core.h>
40#include <plat/sdhci.h> 41#include <plat/sdhci.h>
41#include <plat/s5p-time.h> 42#include <plat/s5p-time.h>
42#include <plat/regs-fb-v4.h>
43 43
44#include "common.h" 44#include "common.h"
45 45
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index 822a5595068..55e1dba4ffd 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -35,6 +35,7 @@
35#include <asm/setup.h> 35#include <asm/setup.h>
36#include <asm/mach-types.h> 36#include <asm/mach-types.h>
37 37
38#include <video/samsung_fimd.h>
38#include <mach/map.h> 39#include <mach/map.h>
39#include <mach/regs-clock.h> 40#include <mach/regs-clock.h>
40 41
@@ -43,13 +44,12 @@
43#include <plat/devs.h> 44#include <plat/devs.h>
44#include <plat/cpu.h> 45#include <plat/cpu.h>
45#include <plat/fb.h> 46#include <plat/fb.h>
46#include <plat/iic.h> 47#include <linux/platform_data/i2c-s3c2410.h>
47#include <plat/keypad.h> 48#include <plat/keypad.h>
48#include <plat/sdhci.h> 49#include <plat/sdhci.h>
49#include <plat/clock.h> 50#include <plat/clock.h>
50#include <plat/s5p-time.h> 51#include <plat/s5p-time.h>
51#include <plat/mfc.h> 52#include <plat/mfc.h>
52#include <plat/regs-fb-v4.h>
53#include <plat/camport.h> 53#include <plat/camport.h>
54 54
55#include <media/v4l2-mediabus.h> 55#include <media/v4l2-mediabus.h>
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index dfc29236321..d9c99fcc1aa 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -27,8 +27,8 @@
27#include <plat/regs-serial.h> 27#include <plat/regs-serial.h>
28#include <plat/devs.h> 28#include <plat/devs.h>
29#include <plat/cpu.h> 29#include <plat/cpu.h>
30#include <plat/ata.h> 30#include <linux/platform_data/ata-samsung_cf.h>
31#include <plat/iic.h> 31#include <linux/platform_data/i2c-s3c2410.h>
32#include <plat/pm.h> 32#include <plat/pm.h>
33#include <plat/s5p-time.h> 33#include <plat/s5p-time.h>
34#include <plat/mfc.h> 34#include <plat/mfc.h>
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index 918b23d71fd..4cdb5bb7bbc 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -28,6 +28,7 @@
28#include <asm/mach-types.h> 28#include <asm/mach-types.h>
29 29
30#include <video/platform_lcd.h> 30#include <video/platform_lcd.h>
31#include <video/samsung_fimd.h>
31 32
32#include <mach/map.h> 33#include <mach/map.h>
33#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
@@ -38,15 +39,14 @@
38#include <plat/devs.h> 39#include <plat/devs.h>
39#include <plat/cpu.h> 40#include <plat/cpu.h>
40#include <plat/adc.h> 41#include <plat/adc.h>
41#include <plat/ts.h> 42#include <linux/platform_data/touchscreen-s3c2410.h>
42#include <plat/ata.h> 43#include <linux/platform_data/ata-samsung_cf.h>
43#include <plat/iic.h> 44#include <linux/platform_data/i2c-s3c2410.h>
44#include <plat/keypad.h> 45#include <plat/keypad.h>
45#include <plat/pm.h> 46#include <plat/pm.h>
46#include <plat/fb.h> 47#include <plat/fb.h>
47#include <plat/s5p-time.h> 48#include <plat/s5p-time.h>
48#include <plat/backlight.h> 49#include <plat/backlight.h>
49#include <plat/regs-fb-v4.h>
50#include <plat/mfc.h> 50#include <plat/mfc.h>
51#include <plat/clock.h> 51#include <plat/clock.h>
52 52
diff --git a/arch/arm/mach-s5pv210/mach-torbreck.c b/arch/arm/mach-s5pv210/mach-torbreck.c
index 74e99bc0dc9..18785cb5e1e 100644
--- a/arch/arm/mach-s5pv210/mach-torbreck.c
+++ b/arch/arm/mach-s5pv210/mach-torbreck.c
@@ -26,7 +26,7 @@
26#include <plat/regs-serial.h> 26#include <plat/regs-serial.h>
27#include <plat/devs.h> 27#include <plat/devs.h>
28#include <plat/cpu.h> 28#include <plat/cpu.h>
29#include <plat/iic.h> 29#include <linux/platform_data/i2c-s3c2410.h>
30#include <plat/s5p-time.h> 30#include <plat/s5p-time.h>
31 31
32#include "common.h" 32#include "common.h"
diff --git a/arch/arm/mach-s5pv210/setup-i2c0.c b/arch/arm/mach-s5pv210/setup-i2c0.c
index 0f1cc3a1c1e..4a15849766c 100644
--- a/arch/arm/mach-s5pv210/setup-i2c0.c
+++ b/arch/arm/mach-s5pv210/setup-i2c0.c
@@ -18,7 +18,7 @@
18 18
19struct platform_device; /* don't need the contents */ 19struct platform_device; /* don't need the contents */
20 20
21#include <plat/iic.h> 21#include <linux/platform_data/i2c-s3c2410.h>
22#include <plat/gpio-cfg.h> 22#include <plat/gpio-cfg.h>
23 23
24void s3c_i2c0_cfg_gpio(struct platform_device *dev) 24void s3c_i2c0_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-s5pv210/setup-i2c1.c b/arch/arm/mach-s5pv210/setup-i2c1.c
index f61365a34c5..4777f6b97a9 100644
--- a/arch/arm/mach-s5pv210/setup-i2c1.c
+++ b/arch/arm/mach-s5pv210/setup-i2c1.c
@@ -18,7 +18,7 @@
18 18
19struct platform_device; /* don't need the contents */ 19struct platform_device; /* don't need the contents */
20 20
21#include <plat/iic.h> 21#include <linux/platform_data/i2c-s3c2410.h>
22#include <plat/gpio-cfg.h> 22#include <plat/gpio-cfg.h>
23 23
24void s3c_i2c1_cfg_gpio(struct platform_device *dev) 24void s3c_i2c1_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-s5pv210/setup-i2c2.c b/arch/arm/mach-s5pv210/setup-i2c2.c
index 2f91b5cefbc..bbce6c74b91 100644
--- a/arch/arm/mach-s5pv210/setup-i2c2.c
+++ b/arch/arm/mach-s5pv210/setup-i2c2.c
@@ -18,7 +18,7 @@
18 18
19struct platform_device; /* don't need the contents */ 19struct platform_device; /* don't need the contents */
20 20
21#include <plat/iic.h> 21#include <linux/platform_data/i2c-s3c2410.h>
22#include <plat/gpio-cfg.h> 22#include <plat/gpio-cfg.h>
23 23
24void s3c_i2c2_cfg_gpio(struct platform_device *dev) 24void s3c_i2c2_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index 42625e4d949..ca14dbdcfb2 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -49,15 +49,15 @@ config SA1100_COLLIE
49 bool "Sharp Zaurus SL5500" 49 bool "Sharp Zaurus SL5500"
50 # FIXME: select CPU_FREQ_SA11x0 50 # FIXME: select CPU_FREQ_SA11x0
51 select SHARP_LOCOMO 51 select SHARP_LOCOMO
52 select SHARP_SCOOP
53 select SHARP_PARAM 52 select SHARP_PARAM
53 select SHARP_SCOOP
54 help 54 help
55 Say Y here to support the Sharp Zaurus SL5500 PDAs. 55 Say Y here to support the Sharp Zaurus SL5500 PDAs.
56 56
57config SA1100_H3100 57config SA1100_H3100
58 bool "Compaq iPAQ H3100" 58 bool "Compaq iPAQ H3100"
59 select HTC_EGPIO
60 select CPU_FREQ_SA1110 59 select CPU_FREQ_SA1110
60 select HTC_EGPIO
61 help 61 help
62 Say Y here if you intend to run this kernel on the Compaq iPAQ 62 Say Y here if you intend to run this kernel on the Compaq iPAQ
63 H3100 handheld computer. Information about this machine and the 63 H3100 handheld computer. Information about this machine and the
@@ -67,8 +67,8 @@ config SA1100_H3100
67 67
68config SA1100_H3600 68config SA1100_H3600
69 bool "Compaq iPAQ H3600/H3700" 69 bool "Compaq iPAQ H3600/H3700"
70 select HTC_EGPIO
71 select CPU_FREQ_SA1110 70 select CPU_FREQ_SA1110
71 select HTC_EGPIO
72 help 72 help
73 Say Y here if you intend to run this kernel on the Compaq iPAQ 73 Say Y here if you intend to run this kernel on the Compaq iPAQ
74 H3600 handheld computer. Information about this machine and the 74 H3600 handheld computer. Information about this machine and the
@@ -78,16 +78,16 @@ config SA1100_H3600
78 78
79config SA1100_BADGE4 79config SA1100_BADGE4
80 bool "HP Labs BadgePAD 4" 80 bool "HP Labs BadgePAD 4"
81 select SA1111
82 select CPU_FREQ_SA1100 81 select CPU_FREQ_SA1100
82 select SA1111
83 help 83 help
84 Say Y here if you want to build a kernel for the HP Laboratories 84 Say Y here if you want to build a kernel for the HP Laboratories
85 BadgePAD 4. 85 BadgePAD 4.
86 86
87config SA1100_JORNADA720 87config SA1100_JORNADA720
88 bool "HP Jornada 720" 88 bool "HP Jornada 720"
89 select SA1111
90 # FIXME: select CPU_FREQ_SA11x0 89 # FIXME: select CPU_FREQ_SA11x0
90 select SA1111
91 help 91 help
92 Say Y here if you want to build a kernel for the HP Jornada 720 92 Say Y here if you want to build a kernel for the HP Jornada 720
93 handheld computer. See 93 handheld computer. See
@@ -95,8 +95,8 @@ config SA1100_JORNADA720
95 95
96config SA1100_JORNADA720_SSP 96config SA1100_JORNADA720_SSP
97 bool "HP Jornada 720 Extended SSP driver" 97 bool "HP Jornada 720 Extended SSP driver"
98 select SA1100_SSP
99 depends on SA1100_JORNADA720 98 depends on SA1100_JORNADA720
99 select SA1100_SSP
100 help 100 help
101 Say Y here if you have a HP Jornada 7xx handheld computer and you 101 Say Y here if you have a HP Jornada 7xx handheld computer and you
102 want to access devices connected to the MCU. Those include the 102 want to access devices connected to the MCU. Those include the
diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile
index 60b97ec0167..1aed9e70465 100644
--- a/arch/arm/mach-sa1100/Makefile
+++ b/arch/arm/mach-sa1100/Makefile
@@ -7,21 +7,17 @@ obj-y := clock.o generic.o irq.o time.o #nmi-oopser.o
7obj-m := 7obj-m :=
8obj-n := 8obj-n :=
9obj- := 9obj- :=
10led-y := leds.o
11 10
12obj-$(CONFIG_CPU_FREQ_SA1100) += cpu-sa1100.o 11obj-$(CONFIG_CPU_FREQ_SA1100) += cpu-sa1100.o
13obj-$(CONFIG_CPU_FREQ_SA1110) += cpu-sa1110.o 12obj-$(CONFIG_CPU_FREQ_SA1110) += cpu-sa1110.o
14 13
15# Specific board support 14# Specific board support
16obj-$(CONFIG_SA1100_ASSABET) += assabet.o 15obj-$(CONFIG_SA1100_ASSABET) += assabet.o
17led-$(CONFIG_SA1100_ASSABET) += leds-assabet.o
18obj-$(CONFIG_ASSABET_NEPONSET) += neponset.o 16obj-$(CONFIG_ASSABET_NEPONSET) += neponset.o
19 17
20obj-$(CONFIG_SA1100_BADGE4) += badge4.o 18obj-$(CONFIG_SA1100_BADGE4) += badge4.o
21led-$(CONFIG_SA1100_BADGE4) += leds-badge4.o
22 19
23obj-$(CONFIG_SA1100_CERF) += cerf.o 20obj-$(CONFIG_SA1100_CERF) += cerf.o
24led-$(CONFIG_SA1100_CERF) += leds-cerf.o
25 21
26obj-$(CONFIG_SA1100_COLLIE) += collie.o 22obj-$(CONFIG_SA1100_COLLIE) += collie.o
27 23
@@ -29,13 +25,11 @@ obj-$(CONFIG_SA1100_H3100) += h3100.o h3xxx.o
29obj-$(CONFIG_SA1100_H3600) += h3600.o h3xxx.o 25obj-$(CONFIG_SA1100_H3600) += h3600.o h3xxx.o
30 26
31obj-$(CONFIG_SA1100_HACKKIT) += hackkit.o 27obj-$(CONFIG_SA1100_HACKKIT) += hackkit.o
32led-$(CONFIG_SA1100_HACKKIT) += leds-hackkit.o
33 28
34obj-$(CONFIG_SA1100_JORNADA720) += jornada720.o 29obj-$(CONFIG_SA1100_JORNADA720) += jornada720.o
35obj-$(CONFIG_SA1100_JORNADA720_SSP) += jornada720_ssp.o 30obj-$(CONFIG_SA1100_JORNADA720_SSP) += jornada720_ssp.o
36 31
37obj-$(CONFIG_SA1100_LART) += lart.o 32obj-$(CONFIG_SA1100_LART) += lart.o
38led-$(CONFIG_SA1100_LART) += leds-lart.o
39 33
40obj-$(CONFIG_SA1100_NANOENGINE) += nanoengine.o 34obj-$(CONFIG_SA1100_NANOENGINE) += nanoengine.o
41obj-$(CONFIG_PCI_NANOENGINE) += pci-nanoengine.o 35obj-$(CONFIG_PCI_NANOENGINE) += pci-nanoengine.o
@@ -46,9 +40,6 @@ obj-$(CONFIG_SA1100_SHANNON) += shannon.o
46 40
47obj-$(CONFIG_SA1100_SIMPAD) += simpad.o 41obj-$(CONFIG_SA1100_SIMPAD) += simpad.o
48 42
49# LEDs support
50obj-$(CONFIG_LEDS) += $(led-y)
51
52# Miscellaneous functions 43# Miscellaneous functions
53obj-$(CONFIG_PM) += pm.o sleep.o 44obj-$(CONFIG_PM) += pm.o sleep.o
54obj-$(CONFIG_SA1100_SSP) += ssp.o 45obj-$(CONFIG_SA1100_SSP) += ssp.o
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index d673211f121..6a7ad3c2a3f 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -20,6 +20,8 @@
20#include <linux/mtd/partitions.h> 20#include <linux/mtd/partitions.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/leds.h>
24#include <linux/slab.h>
23 25
24#include <video/sa1100fb.h> 26#include <video/sa1100fb.h>
25 27
@@ -37,7 +39,7 @@
37#include <asm/mach/map.h> 39#include <asm/mach/map.h>
38#include <asm/mach/serial_sa1100.h> 40#include <asm/mach/serial_sa1100.h>
39#include <mach/assabet.h> 41#include <mach/assabet.h>
40#include <mach/mcp.h> 42#include <linux/platform_data/mfd-mcp-sa11x0.h>
41#include <mach/irqs.h> 43#include <mach/irqs.h>
42 44
43#include "generic.h" 45#include "generic.h"
@@ -386,7 +388,7 @@ static void __init map_sa1100_gpio_regs( void )
386 */ 388 */
387static void __init get_assabet_scr(void) 389static void __init get_assabet_scr(void)
388{ 390{
389 unsigned long scr, i; 391 unsigned long uninitialized_var(scr), i;
390 392
391 GPDR |= 0x3fc; /* Configure GPIO 9:2 as outputs */ 393 GPDR |= 0x3fc; /* Configure GPIO 9:2 as outputs */
392 GPSR = 0x3fc; /* Write 0xFF to GPIO 9:2 */ 394 GPSR = 0x3fc; /* Write 0xFF to GPIO 9:2 */
@@ -529,6 +531,89 @@ static void __init assabet_map_io(void)
529 sa1100_register_uart(2, 3); 531 sa1100_register_uart(2, 3);
530} 532}
531 533
534/* LEDs */
535#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
536struct assabet_led {
537 struct led_classdev cdev;
538 u32 mask;
539};
540
541/*
542 * The triggers lines up below will only be used if the
543 * LED triggers are compiled in.
544 */
545static const struct {
546 const char *name;
547 const char *trigger;
548} assabet_leds[] = {
549 { "assabet:red", "cpu0",},
550 { "assabet:green", "heartbeat", },
551};
552
553/*
554 * The LED control in Assabet is reversed:
555 * - setting bit means turn off LED
556 * - clearing bit means turn on LED
557 */
558static void assabet_led_set(struct led_classdev *cdev,
559 enum led_brightness b)
560{
561 struct assabet_led *led = container_of(cdev,
562 struct assabet_led, cdev);
563
564 if (b != LED_OFF)
565 ASSABET_BCR_clear(led->mask);
566 else
567 ASSABET_BCR_set(led->mask);
568}
569
570static enum led_brightness assabet_led_get(struct led_classdev *cdev)
571{
572 struct assabet_led *led = container_of(cdev,
573 struct assabet_led, cdev);
574
575 return (ASSABET_BCR & led->mask) ? LED_OFF : LED_FULL;
576}
577
578static int __init assabet_leds_init(void)
579{
580 int i;
581
582 if (!machine_is_assabet())
583 return -ENODEV;
584
585 for (i = 0; i < ARRAY_SIZE(assabet_leds); i++) {
586 struct assabet_led *led;
587
588 led = kzalloc(sizeof(*led), GFP_KERNEL);
589 if (!led)
590 break;
591
592 led->cdev.name = assabet_leds[i].name;
593 led->cdev.brightness_set = assabet_led_set;
594 led->cdev.brightness_get = assabet_led_get;
595 led->cdev.default_trigger = assabet_leds[i].trigger;
596
597 if (!i)
598 led->mask = ASSABET_BCR_LED_RED;
599 else
600 led->mask = ASSABET_BCR_LED_GREEN;
601
602 if (led_classdev_register(NULL, &led->cdev) < 0) {
603 kfree(led);
604 break;
605 }
606 }
607
608 return 0;
609}
610
611/*
612 * Since we may have triggers on any subsystem, defer registration
613 * until after subsystem_init.
614 */
615fs_initcall(assabet_leds_init);
616#endif
532 617
533MACHINE_START(ASSABET, "Intel-Assabet") 618MACHINE_START(ASSABET, "Intel-Assabet")
534 .atag_offset = 0x100, 619 .atag_offset = 0x100,
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index b30fb99b587..038df4894b0 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -22,6 +22,8 @@
22#include <linux/mtd/mtd.h> 22#include <linux/mtd/mtd.h>
23#include <linux/mtd/partitions.h> 23#include <linux/mtd/partitions.h>
24#include <linux/errno.h> 24#include <linux/errno.h>
25#include <linux/gpio.h>
26#include <linux/leds.h>
25 27
26#include <mach/hardware.h> 28#include <mach/hardware.h>
27#include <asm/mach-types.h> 29#include <asm/mach-types.h>
@@ -76,8 +78,36 @@ static struct platform_device sa1111_device = {
76 .resource = sa1111_resources, 78 .resource = sa1111_resources,
77}; 79};
78 80
81/* LEDs */
82struct gpio_led badge4_gpio_leds[] = {
83 {
84 .name = "badge4:red",
85 .default_trigger = "heartbeat",
86 .gpio = 7,
87 },
88 {
89 .name = "badge4:green",
90 .default_trigger = "cpu0",
91 .gpio = 9,
92 },
93};
94
95static struct gpio_led_platform_data badge4_gpio_led_info = {
96 .leds = badge4_gpio_leds,
97 .num_leds = ARRAY_SIZE(badge4_gpio_leds),
98};
99
100static struct platform_device badge4_leds = {
101 .name = "leds-gpio",
102 .id = -1,
103 .dev = {
104 .platform_data = &badge4_gpio_led_info,
105 }
106};
107
79static struct platform_device *devices[] __initdata = { 108static struct platform_device *devices[] __initdata = {
80 &sa1111_device, 109 &sa1111_device,
110 &badge4_leds,
81}; 111};
82 112
83static int __init badge4_sa1111_init(void) 113static int __init badge4_sa1111_init(void)
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index 09d7f4b4b35..ad0eb08ea07 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -17,6 +17,8 @@
17#include <linux/irq.h> 17#include <linux/irq.h>
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19#include <linux/mtd/partitions.h> 19#include <linux/mtd/partitions.h>
20#include <linux/gpio.h>
21#include <linux/leds.h>
20 22
21#include <mach/hardware.h> 23#include <mach/hardware.h>
22#include <asm/setup.h> 24#include <asm/setup.h>
@@ -28,7 +30,7 @@
28#include <asm/mach/serial_sa1100.h> 30#include <asm/mach/serial_sa1100.h>
29 31
30#include <mach/cerf.h> 32#include <mach/cerf.h>
31#include <mach/mcp.h> 33#include <linux/platform_data/mfd-mcp-sa11x0.h>
32#include <mach/irqs.h> 34#include <mach/irqs.h>
33#include "generic.h" 35#include "generic.h"
34 36
@@ -43,8 +45,48 @@ static struct platform_device cerfuart2_device = {
43 .resource = cerfuart2_resources, 45 .resource = cerfuart2_resources,
44}; 46};
45 47
48/* LEDs */
49struct gpio_led cerf_gpio_leds[] = {
50 {
51 .name = "cerf:d0",
52 .default_trigger = "heartbeat",
53 .gpio = 0,
54 },
55 {
56 .name = "cerf:d1",
57 .default_trigger = "cpu0",
58 .gpio = 1,
59 },
60 {
61 .name = "cerf:d2",
62 .default_trigger = "default-on",
63 .gpio = 2,
64 },
65 {
66 .name = "cerf:d3",
67 .default_trigger = "default-on",
68 .gpio = 3,
69 },
70
71};
72
73static struct gpio_led_platform_data cerf_gpio_led_info = {
74 .leds = cerf_gpio_leds,
75 .num_leds = ARRAY_SIZE(cerf_gpio_leds),
76};
77
78static struct platform_device cerf_leds = {
79 .name = "leds-gpio",
80 .id = -1,
81 .dev = {
82 .platform_data = &cerf_gpio_led_info,
83 }
84};
85
86
46static struct platform_device *cerf_devices[] __initdata = { 87static struct platform_device *cerf_devices[] __initdata = {
47 &cerfuart2_device, 88 &cerfuart2_device,
89 &cerf_leds,
48}; 90};
49 91
50#ifdef CONFIG_SA1100_CERF_FLASH_32MB 92#ifdef CONFIG_SA1100_CERF_FLASH_32MB
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index ea5cff38745..170cb6107f6 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -45,7 +45,7 @@
45#include <asm/hardware/scoop.h> 45#include <asm/hardware/scoop.h>
46#include <asm/mach/sharpsl_param.h> 46#include <asm/mach/sharpsl_param.h>
47#include <asm/hardware/locomo.h> 47#include <asm/hardware/locomo.h>
48#include <mach/mcp.h> 48#include <linux/platform_data/mfd-mcp-sa11x0.h>
49#include <mach/irqs.h> 49#include <mach/irqs.h>
50 50
51#include "generic.h" 51#include "generic.h"
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index 7f86bd91182..fc106aab7c7 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -21,6 +21,10 @@
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/mtd/mtd.h> 22#include <linux/mtd/mtd.h>
23#include <linux/mtd/partitions.h> 23#include <linux/mtd/partitions.h>
24#include <linux/tty.h>
25#include <linux/gpio.h>
26#include <linux/leds.h>
27#include <linux/platform_device.h>
24 28
25#include <asm/mach-types.h> 29#include <asm/mach-types.h>
26#include <asm/setup.h> 30#include <asm/setup.h>
@@ -183,9 +187,37 @@ static struct flash_platform_data hackkit_flash_data = {
183static struct resource hackkit_flash_resource = 187static struct resource hackkit_flash_resource =
184 DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M); 188 DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M);
185 189
190/* LEDs */
191struct gpio_led hackkit_gpio_leds[] = {
192 {
193 .name = "hackkit:red",
194 .default_trigger = "cpu0",
195 .gpio = 22,
196 },
197 {
198 .name = "hackkit:green",
199 .default_trigger = "heartbeat",
200 .gpio = 23,
201 },
202};
203
204static struct gpio_led_platform_data hackkit_gpio_led_info = {
205 .leds = hackkit_gpio_leds,
206 .num_leds = ARRAY_SIZE(hackkit_gpio_leds),
207};
208
209static struct platform_device hackkit_leds = {
210 .name = "leds-gpio",
211 .id = -1,
212 .dev = {
213 .platform_data = &hackkit_gpio_led_info,
214 }
215};
216
186static void __init hackkit_init(void) 217static void __init hackkit_init(void)
187{ 218{
188 sa11x0_register_mtd(&hackkit_flash_data, &hackkit_flash_resource, 1); 219 sa11x0_register_mtd(&hackkit_flash_data, &hackkit_flash_resource, 1);
220 platform_device_register(&hackkit_leds);
189} 221}
190 222
191/********************************************************************** 223/**********************************************************************
diff --git a/arch/arm/mach-sa1100/include/mach/SA-1111.h b/arch/arm/mach-sa1100/include/mach/SA-1111.h
deleted file mode 100644
index c38f60915cb..00000000000
--- a/arch/arm/mach-sa1100/include/mach/SA-1111.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * Moved to new location
3 */
4#warning using old SA-1111.h - update to <asm/hardware/sa1111.h>
5#include <asm/hardware/sa1111.h>
diff --git a/arch/arm/mach-sa1100/include/mach/lart.h b/arch/arm/mach-sa1100/include/mach/lart.h
deleted file mode 100644
index 8a5482d908d..00000000000
--- a/arch/arm/mach-sa1100/include/mach/lart.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef _INCLUDE_LART_H
2#define _INCLUDE_LART_H
3
4#define LART_GPIO_ETH0 GPIO_GPIO0
5#define LART_IRQ_ETH0 IRQ_GPIO0
6
7#define LART_GPIO_IDE GPIO_GPIO1
8#define LART_IRQ_IDE IRQ_GPIO1
9
10#define LART_GPIO_UCB1200 GPIO_GPIO18
11#define LART_IRQ_UCB1200 IRQ_GPIO18
12
13#endif
diff --git a/arch/arm/mach-sa1100/include/mach/mcp.h b/arch/arm/mach-sa1100/include/mach/mcp.h
deleted file mode 100644
index 4b2860ae382..00000000000
--- a/arch/arm/mach-sa1100/include/mach/mcp.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * arch/arm/mach-sa1100/include/mach/mcp.h
3 *
4 * Copyright (C) 2005 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_ARM_ARCH_MCP_H
11#define __ASM_ARM_ARCH_MCP_H
12
13#include <linux/types.h>
14
15struct mcp_plat_data {
16 u32 mccr0;
17 u32 mccr1;
18 unsigned int sclk_rate;
19 void *codec_pdata;
20};
21
22#endif
diff --git a/arch/arm/mach-sa1100/include/mach/simpad.h b/arch/arm/mach-sa1100/include/mach/simpad.h
index cdea671e893..ac2ea767215 100644
--- a/arch/arm/mach-sa1100/include/mach/simpad.h
+++ b/arch/arm/mach-sa1100/include/mach/simpad.h
@@ -87,7 +87,7 @@
87#define SIMPAD_CS3_PCMCIA_SHORT (SIMPAD_CS3_GPIO_BASE + 22) 87#define SIMPAD_CS3_PCMCIA_SHORT (SIMPAD_CS3_GPIO_BASE + 22)
88#define SIMPAD_CS3_GPIO_23 (SIMPAD_CS3_GPIO_BASE + 23) 88#define SIMPAD_CS3_GPIO_23 (SIMPAD_CS3_GPIO_BASE + 23)
89 89
90#define CS3_BASE 0xf1000000 90#define CS3_BASE IOMEM(0xf1000000)
91 91
92long simpad_get_cs3_ro(void); 92long simpad_get_cs3_ro(void);
93long simpad_get_cs3_shadow(void); 93long simpad_get_cs3_shadow(void);
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index b775a0abec0..3048b17e84c 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -5,6 +5,9 @@
5#include <linux/init.h> 5#include <linux/init.h>
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/tty.h> 7#include <linux/tty.h>
8#include <linux/gpio.h>
9#include <linux/leds.h>
10#include <linux/platform_device.h>
8 11
9#include <video/sa1100fb.h> 12#include <video/sa1100fb.h>
10 13
@@ -16,7 +19,7 @@
16#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
17#include <asm/mach/map.h> 20#include <asm/mach/map.h>
18#include <asm/mach/serial_sa1100.h> 21#include <asm/mach/serial_sa1100.h>
19#include <mach/mcp.h> 22#include <linux/platform_data/mfd-mcp-sa11x0.h>
20#include <mach/irqs.h> 23#include <mach/irqs.h>
21 24
22#include "generic.h" 25#include "generic.h"
@@ -126,6 +129,27 @@ static struct map_desc lart_io_desc[] __initdata = {
126 } 129 }
127}; 130};
128 131
132/* LEDs */
133struct gpio_led lart_gpio_leds[] = {
134 {
135 .name = "lart:red",
136 .default_trigger = "cpu0",
137 .gpio = 23,
138 },
139};
140
141static struct gpio_led_platform_data lart_gpio_led_info = {
142 .leds = lart_gpio_leds,
143 .num_leds = ARRAY_SIZE(lart_gpio_leds),
144};
145
146static struct platform_device lart_leds = {
147 .name = "leds-gpio",
148 .id = -1,
149 .dev = {
150 .platform_data = &lart_gpio_led_info,
151 }
152};
129static void __init lart_map_io(void) 153static void __init lart_map_io(void)
130{ 154{
131 sa1100_map_io(); 155 sa1100_map_io();
@@ -139,6 +163,8 @@ static void __init lart_map_io(void)
139 GPDR |= GPIO_UART_TXD; 163 GPDR |= GPIO_UART_TXD;
140 GPDR &= ~GPIO_UART_RXD; 164 GPDR &= ~GPIO_UART_RXD;
141 PPAR |= PPAR_UPR; 165 PPAR |= PPAR_UPR;
166
167 platform_device_register(&lart_leds);
142} 168}
143 169
144MACHINE_START(LART, "LART") 170MACHINE_START(LART, "LART")
diff --git a/arch/arm/mach-sa1100/leds-assabet.c b/arch/arm/mach-sa1100/leds-assabet.c
deleted file mode 100644
index 3699176bca9..00000000000
--- a/arch/arm/mach-sa1100/leds-assabet.c
+++ /dev/null
@@ -1,113 +0,0 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds-assabet.c
3 *
4 * Copyright (C) 2000 John Dorsey <john+@cs.cmu.edu>
5 *
6 * Original (leds-footbridge.c) by Russell King
7 *
8 * Assabet uses the LEDs as follows:
9 * - Green - toggles state every 50 timer interrupts
10 * - Red - on if system is not idle
11 */
12#include <linux/init.h>
13
14#include <mach/hardware.h>
15#include <asm/leds.h>
16#include <mach/assabet.h>
17
18#include "leds.h"
19
20
21#define LED_STATE_ENABLED 1
22#define LED_STATE_CLAIMED 2
23
24static unsigned int led_state;
25static unsigned int hw_led_state;
26
27#define ASSABET_BCR_LED_MASK (ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED)
28
29void assabet_leds_event(led_event_t evt)
30{
31 unsigned long flags;
32
33 local_irq_save(flags);
34
35 switch (evt) {
36 case led_start:
37 hw_led_state = ASSABET_BCR_LED_RED | ASSABET_BCR_LED_GREEN;
38 led_state = LED_STATE_ENABLED;
39 break;
40
41 case led_stop:
42 led_state &= ~LED_STATE_ENABLED;
43 hw_led_state = ASSABET_BCR_LED_RED | ASSABET_BCR_LED_GREEN;
44 ASSABET_BCR_frob(ASSABET_BCR_LED_MASK, hw_led_state);
45 break;
46
47 case led_claim:
48 led_state |= LED_STATE_CLAIMED;
49 hw_led_state = ASSABET_BCR_LED_RED | ASSABET_BCR_LED_GREEN;
50 break;
51
52 case led_release:
53 led_state &= ~LED_STATE_CLAIMED;
54 hw_led_state = ASSABET_BCR_LED_RED | ASSABET_BCR_LED_GREEN;
55 break;
56
57#ifdef CONFIG_LEDS_TIMER
58 case led_timer:
59 if (!(led_state & LED_STATE_CLAIMED))
60 hw_led_state ^= ASSABET_BCR_LED_GREEN;
61 break;
62#endif
63
64#ifdef CONFIG_LEDS_CPU
65 case led_idle_start:
66 if (!(led_state & LED_STATE_CLAIMED))
67 hw_led_state |= ASSABET_BCR_LED_RED;
68 break;
69
70 case led_idle_end:
71 if (!(led_state & LED_STATE_CLAIMED))
72 hw_led_state &= ~ASSABET_BCR_LED_RED;
73 break;
74#endif
75
76 case led_halted:
77 break;
78
79 case led_green_on:
80 if (led_state & LED_STATE_CLAIMED)
81 hw_led_state &= ~ASSABET_BCR_LED_GREEN;
82 break;
83
84 case led_green_off:
85 if (led_state & LED_STATE_CLAIMED)
86 hw_led_state |= ASSABET_BCR_LED_GREEN;
87 break;
88
89 case led_amber_on:
90 break;
91
92 case led_amber_off:
93 break;
94
95 case led_red_on:
96 if (led_state & LED_STATE_CLAIMED)
97 hw_led_state &= ~ASSABET_BCR_LED_RED;
98 break;
99
100 case led_red_off:
101 if (led_state & LED_STATE_CLAIMED)
102 hw_led_state |= ASSABET_BCR_LED_RED;
103 break;
104
105 default:
106 break;
107 }
108
109 if (led_state & LED_STATE_ENABLED)
110 ASSABET_BCR_frob(ASSABET_BCR_LED_MASK, hw_led_state);
111
112 local_irq_restore(flags);
113}
diff --git a/arch/arm/mach-sa1100/leds-badge4.c b/arch/arm/mach-sa1100/leds-badge4.c
deleted file mode 100644
index f99fac3eedb..00000000000
--- a/arch/arm/mach-sa1100/leds-badge4.c
+++ /dev/null
@@ -1,110 +0,0 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds-badge4.c
3 *
4 * Author: Christopher Hoover <ch@hpl.hp.com>
5 * Copyright (C) 2002 Hewlett-Packard Company
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
13#include <linux/init.h>
14
15#include <mach/hardware.h>
16#include <asm/leds.h>
17
18#include "leds.h"
19
20#define LED_STATE_ENABLED 1
21#define LED_STATE_CLAIMED 2
22
23static unsigned int led_state;
24static unsigned int hw_led_state;
25
26#define LED_RED GPIO_GPIO(7)
27#define LED_GREEN GPIO_GPIO(9)
28#define LED_MASK (LED_RED|LED_GREEN)
29
30#define LED_IDLE LED_GREEN
31#define LED_TIMER LED_RED
32
33void badge4_leds_event(led_event_t evt)
34{
35 unsigned long flags;
36
37 local_irq_save(flags);
38
39 switch (evt) {
40 case led_start:
41 GPDR |= LED_MASK;
42 hw_led_state = LED_MASK;
43 led_state = LED_STATE_ENABLED;
44 break;
45
46 case led_stop:
47 led_state &= ~LED_STATE_ENABLED;
48 break;
49
50 case led_claim:
51 led_state |= LED_STATE_CLAIMED;
52 hw_led_state = LED_MASK;
53 break;
54
55 case led_release:
56 led_state &= ~LED_STATE_CLAIMED;
57 hw_led_state = LED_MASK;
58 break;
59
60#ifdef CONFIG_LEDS_TIMER
61 case led_timer:
62 if (!(led_state & LED_STATE_CLAIMED))
63 hw_led_state ^= LED_TIMER;
64 break;
65#endif
66
67#ifdef CONFIG_LEDS_CPU
68 case led_idle_start:
69 /* LED off when system is idle */
70 if (!(led_state & LED_STATE_CLAIMED))
71 hw_led_state &= ~LED_IDLE;
72 break;
73
74 case led_idle_end:
75 if (!(led_state & LED_STATE_CLAIMED))
76 hw_led_state |= LED_IDLE;
77 break;
78#endif
79
80 case led_red_on:
81 if (!(led_state & LED_STATE_CLAIMED))
82 hw_led_state &= ~LED_RED;
83 break;
84
85 case led_red_off:
86 if (!(led_state & LED_STATE_CLAIMED))
87 hw_led_state |= LED_RED;
88 break;
89
90 case led_green_on:
91 if (!(led_state & LED_STATE_CLAIMED))
92 hw_led_state &= ~LED_GREEN;
93 break;
94
95 case led_green_off:
96 if (!(led_state & LED_STATE_CLAIMED))
97 hw_led_state |= LED_GREEN;
98 break;
99
100 default:
101 break;
102 }
103
104 if (led_state & LED_STATE_ENABLED) {
105 GPSR = hw_led_state;
106 GPCR = hw_led_state ^ LED_MASK;
107 }
108
109 local_irq_restore(flags);
110}
diff --git a/arch/arm/mach-sa1100/leds-cerf.c b/arch/arm/mach-sa1100/leds-cerf.c
deleted file mode 100644
index 30fc3b2bf55..00000000000
--- a/arch/arm/mach-sa1100/leds-cerf.c
+++ /dev/null
@@ -1,110 +0,0 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds-cerf.c
3 *
4 * Author: ???
5 */
6#include <linux/init.h>
7#include <linux/io.h>
8
9#include <mach/hardware.h>
10#include <asm/leds.h>
11
12#include "leds.h"
13
14
15#define LED_STATE_ENABLED 1
16#define LED_STATE_CLAIMED 2
17
18static unsigned int led_state;
19static unsigned int hw_led_state;
20
21#define LED_D0 GPIO_GPIO(0)
22#define LED_D1 GPIO_GPIO(1)
23#define LED_D2 GPIO_GPIO(2)
24#define LED_D3 GPIO_GPIO(3)
25#define LED_MASK (LED_D0|LED_D1|LED_D2|LED_D3)
26
27void cerf_leds_event(led_event_t evt)
28{
29 unsigned long flags;
30
31 local_irq_save(flags);
32
33 switch (evt) {
34 case led_start:
35 hw_led_state = LED_MASK;
36 led_state = LED_STATE_ENABLED;
37 break;
38
39 case led_stop:
40 led_state &= ~LED_STATE_ENABLED;
41 break;
42
43 case led_claim:
44 led_state |= LED_STATE_CLAIMED;
45 hw_led_state = LED_MASK;
46 break;
47 case led_release:
48 led_state &= ~LED_STATE_CLAIMED;
49 hw_led_state = LED_MASK;
50 break;
51
52#ifdef CONFIG_LEDS_TIMER
53 case led_timer:
54 if (!(led_state & LED_STATE_CLAIMED))
55 hw_led_state ^= LED_D0;
56 break;
57#endif
58
59#ifdef CONFIG_LEDS_CPU
60 case led_idle_start:
61 if (!(led_state & LED_STATE_CLAIMED))
62 hw_led_state &= ~LED_D1;
63 break;
64
65 case led_idle_end:
66 if (!(led_state & LED_STATE_CLAIMED))
67 hw_led_state |= LED_D1;
68 break;
69#endif
70 case led_green_on:
71 if (!(led_state & LED_STATE_CLAIMED))
72 hw_led_state &= ~LED_D2;
73 break;
74
75 case led_green_off:
76 if (!(led_state & LED_STATE_CLAIMED))
77 hw_led_state |= LED_D2;
78 break;
79
80 case led_amber_on:
81 if (!(led_state & LED_STATE_CLAIMED))
82 hw_led_state &= ~LED_D3;
83 break;
84
85 case led_amber_off:
86 if (!(led_state & LED_STATE_CLAIMED))
87 hw_led_state |= LED_D3;
88 break;
89
90 case led_red_on:
91 if (!(led_state & LED_STATE_CLAIMED))
92 hw_led_state &= ~LED_D1;
93 break;
94
95 case led_red_off:
96 if (!(led_state & LED_STATE_CLAIMED))
97 hw_led_state |= LED_D1;
98 break;
99
100 default:
101 break;
102 }
103
104 if (led_state & LED_STATE_ENABLED) {
105 GPSR = hw_led_state;
106 GPCR = hw_led_state ^ LED_MASK;
107 }
108
109 local_irq_restore(flags);
110}
diff --git a/arch/arm/mach-sa1100/leds-hackkit.c b/arch/arm/mach-sa1100/leds-hackkit.c
deleted file mode 100644
index f8e47235bab..00000000000
--- a/arch/arm/mach-sa1100/leds-hackkit.c
+++ /dev/null
@@ -1,112 +0,0 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds-hackkit.c
3 *
4 * based on leds-lart.c
5 *
6 * (C) Erik Mouw (J.A.K.Mouw@its.tudelft.nl), April 21, 2000
7 * (C) Stefan Eletzhofer <stefan.eletzhofer@eletztrick.de>, 2002
8 *
9 * The HackKit has two leds (GPIO 22/23). The red led (gpio 22) is used
10 * as cpu led, the green one is used as timer led.
11 */
12#include <linux/init.h>
13#include <linux/io.h>
14
15#include <mach/hardware.h>
16#include <asm/leds.h>
17
18#include "leds.h"
19
20
21#define LED_STATE_ENABLED 1
22#define LED_STATE_CLAIMED 2
23
24static unsigned int led_state;
25static unsigned int hw_led_state;
26
27#define LED_GREEN GPIO_GPIO23
28#define LED_RED GPIO_GPIO22
29#define LED_MASK (LED_RED | LED_GREEN)
30
31void hackkit_leds_event(led_event_t evt)
32{
33 unsigned long flags;
34
35 local_irq_save(flags);
36
37 switch(evt) {
38 case led_start:
39 /* pin 22/23 are outputs */
40 GPDR |= LED_MASK;
41 hw_led_state = LED_MASK;
42 led_state = LED_STATE_ENABLED;
43 break;
44
45 case led_stop:
46 led_state &= ~LED_STATE_ENABLED;
47 break;
48
49 case led_claim:
50 led_state |= LED_STATE_CLAIMED;
51 hw_led_state = LED_MASK;
52 break;
53
54 case led_release:
55 led_state &= ~LED_STATE_CLAIMED;
56 hw_led_state = LED_MASK;
57 break;
58
59#ifdef CONFIG_LEDS_TIMER
60 case led_timer:
61 if (!(led_state & LED_STATE_CLAIMED))
62 hw_led_state ^= LED_GREEN;
63 break;
64#endif
65
66#ifdef CONFIG_LEDS_CPU
67 case led_idle_start:
68 /* The LART people like the LED to be off when the
69 system is idle... */
70 if (!(led_state & LED_STATE_CLAIMED))
71 hw_led_state &= ~LED_RED;
72 break;
73
74 case led_idle_end:
75 /* ... and on if the system is not idle */
76 if (!(led_state & LED_STATE_CLAIMED))
77 hw_led_state |= LED_RED;
78 break;
79#endif
80
81 case led_red_on:
82 if (led_state & LED_STATE_CLAIMED)
83 hw_led_state &= ~LED_RED;
84 break;
85
86 case led_red_off:
87 if (led_state & LED_STATE_CLAIMED)
88 hw_led_state |= LED_RED;
89 break;
90
91 case led_green_on:
92 if (led_state & LED_STATE_CLAIMED)
93 hw_led_state &= ~LED_GREEN;
94 break;
95
96 case led_green_off:
97 if (led_state & LED_STATE_CLAIMED)
98 hw_led_state |= LED_GREEN;
99 break;
100
101 default:
102 break;
103 }
104
105 /* Now set the GPIO state, or nothing will happen at all */
106 if (led_state & LED_STATE_ENABLED) {
107 GPSR = hw_led_state;
108 GPCR = hw_led_state ^ LED_MASK;
109 }
110
111 local_irq_restore(flags);
112}
diff --git a/arch/arm/mach-sa1100/leds-lart.c b/arch/arm/mach-sa1100/leds-lart.c
deleted file mode 100644
index 50a5b143b46..00000000000
--- a/arch/arm/mach-sa1100/leds-lart.c
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds-lart.c
3 *
4 * (C) Erik Mouw (J.A.K.Mouw@its.tudelft.nl), April 21, 2000
5 *
6 * LART uses the LED as follows:
7 * - GPIO23 is the LED, on if system is not idle
8 * You can use both CONFIG_LEDS_CPU and CONFIG_LEDS_TIMER at the same
9 * time, but in that case the timer events will still dictate the
10 * pace of the LED.
11 */
12#include <linux/init.h>
13#include <linux/io.h>
14
15#include <mach/hardware.h>
16#include <asm/leds.h>
17
18#include "leds.h"
19
20
21#define LED_STATE_ENABLED 1
22#define LED_STATE_CLAIMED 2
23
24static unsigned int led_state;
25static unsigned int hw_led_state;
26
27#define LED_23 GPIO_GPIO23
28#define LED_MASK (LED_23)
29
30void lart_leds_event(led_event_t evt)
31{
32 unsigned long flags;
33
34 local_irq_save(flags);
35
36 switch(evt) {
37 case led_start:
38 /* pin 23 is output pin */
39 GPDR |= LED_23;
40 hw_led_state = LED_MASK;
41 led_state = LED_STATE_ENABLED;
42 break;
43
44 case led_stop:
45 led_state &= ~LED_STATE_ENABLED;
46 break;
47
48 case led_claim:
49 led_state |= LED_STATE_CLAIMED;
50 hw_led_state = LED_MASK;
51 break;
52
53 case led_release:
54 led_state &= ~LED_STATE_CLAIMED;
55 hw_led_state = LED_MASK;
56 break;
57
58#ifdef CONFIG_LEDS_TIMER
59 case led_timer:
60 if (!(led_state & LED_STATE_CLAIMED))
61 hw_led_state ^= LED_23;
62 break;
63#endif
64
65#ifdef CONFIG_LEDS_CPU
66 case led_idle_start:
67 /* The LART people like the LED to be off when the
68 system is idle... */
69 if (!(led_state & LED_STATE_CLAIMED))
70 hw_led_state &= ~LED_23;
71 break;
72
73 case led_idle_end:
74 /* ... and on if the system is not idle */
75 if (!(led_state & LED_STATE_CLAIMED))
76 hw_led_state |= LED_23;
77 break;
78#endif
79
80 case led_red_on:
81 if (led_state & LED_STATE_CLAIMED)
82 hw_led_state &= ~LED_23;
83 break;
84
85 case led_red_off:
86 if (led_state & LED_STATE_CLAIMED)
87 hw_led_state |= LED_23;
88 break;
89
90 default:
91 break;
92 }
93
94 /* Now set the GPIO state, or nothing will happen at all */
95 if (led_state & LED_STATE_ENABLED) {
96 GPSR = hw_led_state;
97 GPCR = hw_led_state ^ LED_MASK;
98 }
99
100 local_irq_restore(flags);
101}
diff --git a/arch/arm/mach-sa1100/leds.c b/arch/arm/mach-sa1100/leds.c
deleted file mode 100644
index 5fe71a0f105..00000000000
--- a/arch/arm/mach-sa1100/leds.c
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * linux/arch/arm/mach-sa1100/leds.c
3 *
4 * SA1100 LEDs dispatcher
5 *
6 * Copyright (C) 2001 Nicolas Pitre
7 */
8#include <linux/compiler.h>
9#include <linux/init.h>
10
11#include <asm/leds.h>
12#include <asm/mach-types.h>
13
14#include "leds.h"
15
16static int __init
17sa1100_leds_init(void)
18{
19 if (machine_is_assabet())
20 leds_event = assabet_leds_event;
21 if (machine_is_consus())
22 leds_event = consus_leds_event;
23 if (machine_is_badge4())
24 leds_event = badge4_leds_event;
25 if (machine_is_brutus())
26 leds_event = brutus_leds_event;
27 if (machine_is_cerf())
28 leds_event = cerf_leds_event;
29 if (machine_is_flexanet())
30 leds_event = flexanet_leds_event;
31 if (machine_is_graphicsclient())
32 leds_event = graphicsclient_leds_event;
33 if (machine_is_hackkit())
34 leds_event = hackkit_leds_event;
35 if (machine_is_lart())
36 leds_event = lart_leds_event;
37 if (machine_is_pfs168())
38 leds_event = pfs168_leds_event;
39 if (machine_is_graphicsmaster())
40 leds_event = graphicsmaster_leds_event;
41 if (machine_is_adsbitsy())
42 leds_event = adsbitsy_leds_event;
43 if (machine_is_pt_system3())
44 leds_event = system3_leds_event;
45
46 leds_event(led_start);
47 return 0;
48}
49
50core_initcall(sa1100_leds_init);
diff --git a/arch/arm/mach-sa1100/leds.h b/arch/arm/mach-sa1100/leds.h
deleted file mode 100644
index 776b6020f55..00000000000
--- a/arch/arm/mach-sa1100/leds.h
+++ /dev/null
@@ -1,13 +0,0 @@
1extern void assabet_leds_event(led_event_t evt);
2extern void badge4_leds_event(led_event_t evt);
3extern void consus_leds_event(led_event_t evt);
4extern void brutus_leds_event(led_event_t evt);
5extern void cerf_leds_event(led_event_t evt);
6extern void flexanet_leds_event(led_event_t evt);
7extern void graphicsclient_leds_event(led_event_t evt);
8extern void hackkit_leds_event(led_event_t evt);
9extern void lart_leds_event(led_event_t evt);
10extern void pfs168_leds_event(led_event_t evt);
11extern void graphicsmaster_leds_event(led_event_t evt);
12extern void adsbitsy_leds_event(led_event_t evt);
13extern void system3_leds_event(led_event_t evt);
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index 5d33fc3108e..ff6b7b35bca 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -19,7 +19,7 @@
19#include <asm/mach/flash.h> 19#include <asm/mach/flash.h>
20#include <asm/mach/map.h> 20#include <asm/mach/map.h>
21#include <asm/mach/serial_sa1100.h> 21#include <asm/mach/serial_sa1100.h>
22#include <mach/mcp.h> 22#include <linux/platform_data/mfd-mcp-sa11x0.h>
23#include <mach/shannon.h> 23#include <mach/shannon.h>
24#include <mach/irqs.h> 24#include <mach/irqs.h>
25 25
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index fbd53593be5..71790e581d9 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -24,7 +24,7 @@
24#include <asm/mach/flash.h> 24#include <asm/mach/flash.h>
25#include <asm/mach/map.h> 25#include <asm/mach/map.h>
26#include <asm/mach/serial_sa1100.h> 26#include <asm/mach/serial_sa1100.h>
27#include <mach/mcp.h> 27#include <linux/platform_data/mfd-mcp-sa11x0.h>
28#include <mach/simpad.h> 28#include <mach/simpad.h>
29#include <mach/irqs.h> 29#include <mach/irqs.h>
30 30
@@ -124,7 +124,7 @@ static struct map_desc simpad_io_desc[] __initdata = {
124 .length = 0x00800000, 124 .length = 0x00800000,
125 .type = MT_DEVICE 125 .type = MT_DEVICE
126 }, { /* Simpad CS3 */ 126 }, { /* Simpad CS3 */
127 .virtual = CS3_BASE, 127 .virtual = (unsigned long)CS3_BASE,
128 .pfn = __phys_to_pfn(SA1100_CS3_PHYS), 128 .pfn = __phys_to_pfn(SA1100_CS3_PHYS),
129 .length = 0x00100000, 129 .length = 0x00100000,
130 .type = MT_DEVICE 130 .type = MT_DEVICE
diff --git a/arch/arm/mach-shark/Makefile b/arch/arm/mach-shark/Makefile
index 45be9b04e7b..29657183c45 100644
--- a/arch/arm/mach-shark/Makefile
+++ b/arch/arm/mach-shark/Makefile
@@ -4,9 +4,7 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := core.o dma.o irq.o pci.o 7obj-y := core.o dma.o irq.o pci.o leds.o
8obj-m := 8obj-m :=
9obj-n := 9obj-n :=
10obj- := 10obj- :=
11
12obj-$(CONFIG_LEDS) += leds.o
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index 2704bcd869c..9ad2e9737fb 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -13,7 +13,6 @@
13 13
14#include <asm/setup.h> 14#include <asm/setup.h>
15#include <asm/mach-types.h> 15#include <asm/mach-types.h>
16#include <asm/leds.h>
17#include <asm/param.h> 16#include <asm/param.h>
18#include <asm/system_misc.h> 17#include <asm/system_misc.h>
19 18
@@ -21,9 +20,6 @@
21#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
22#include <asm/mach/time.h> 21#include <asm/mach/time.h>
23 22
24#define IO_BASE 0xe0000000
25#define IO_SIZE 0x08000000
26#define IO_START 0x40000000
27#define ROMCARD_SIZE 0x08000000 23#define ROMCARD_SIZE 0x08000000
28#define ROMCARD_START 0x10000000 24#define ROMCARD_START 0x10000000
29 25
@@ -104,20 +100,6 @@ arch_initcall(shark_init);
104 100
105extern void shark_init_irq(void); 101extern void shark_init_irq(void);
106 102
107static struct map_desc shark_io_desc[] __initdata = {
108 {
109 .virtual = IO_BASE,
110 .pfn = __phys_to_pfn(IO_START),
111 .length = IO_SIZE,
112 .type = MT_DEVICE
113 }
114};
115
116static void __init shark_map_io(void)
117{
118 iotable_init(shark_io_desc, ARRAY_SIZE(shark_io_desc));
119}
120
121#define IRQ_TIMER 0 103#define IRQ_TIMER 0
122#define HZ_TIME ((1193180 + HZ/2) / HZ) 104#define HZ_TIME ((1193180 + HZ/2) / HZ)
123 105
@@ -158,7 +140,6 @@ static void shark_init_early(void)
158MACHINE_START(SHARK, "Shark") 140MACHINE_START(SHARK, "Shark")
159 /* Maintainer: Alexander Schulz */ 141 /* Maintainer: Alexander Schulz */
160 .atag_offset = 0x3000, 142 .atag_offset = 0x3000,
161 .map_io = shark_map_io,
162 .init_early = shark_init_early, 143 .init_early = shark_init_early,
163 .init_irq = shark_init_irq, 144 .init_irq = shark_init_irq,
164 .timer = &shark_timer, 145 .timer = &shark_timer,
diff --git a/arch/arm/mach-shark/include/mach/debug-macro.S b/arch/arm/mach-shark/include/mach/debug-macro.S
index 20eb2bf2a42..d129119a3f6 100644
--- a/arch/arm/mach-shark/include/mach/debug-macro.S
+++ b/arch/arm/mach-shark/include/mach/debug-macro.S
@@ -12,9 +12,10 @@
12*/ 12*/
13 13
14 .macro addruart, rp, rv, tmp 14 .macro addruart, rp, rv, tmp
15 mov \rp, #0xe0000000 15 mov \rp, #0x3f8
16 orr \rp, \rp, #0x000003f8 16 orr \rv, \rp, #0xfe000000
17 mov \rv, \rp 17 orr \rv, \rv, #0x00e00000
18 orr \rp, \rp, #0x40000000
18 .endm 19 .endm
19 20
20 .macro senduart,rd,rx 21 .macro senduart,rd,rx
diff --git a/arch/arm/mach-shark/include/mach/entry-macro.S b/arch/arm/mach-shark/include/mach/entry-macro.S
index 5901b09fc96..c9e49f04953 100644
--- a/arch/arm/mach-shark/include/mach/entry-macro.S
+++ b/arch/arm/mach-shark/include/mach/entry-macro.S
@@ -8,7 +8,8 @@
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10 .macro get_irqnr_preamble, base, tmp 10 .macro get_irqnr_preamble, base, tmp
11 mov \base, #0xe0000000 11 mov \base, #0xfe000000
12 orr \base, \base, #0x00e00000
12 .endm 13 .endm
13 14
14 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 15 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
diff --git a/arch/arm/mach-shark/include/mach/io.h b/arch/arm/mach-shark/include/mach/io.h
deleted file mode 100644
index 1a45fc01ff1..00000000000
--- a/arch/arm/mach-shark/include/mach/io.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * arch/arm/mach-shark/include/mach/io.h
3 *
4 * by Alexander Schulz
5 *
6 * derived from:
7 * arch/arm/mach-ebsa110/include/mach/io.h
8 * Copyright (C) 1997,1998 Russell King
9 */
10
11#ifndef __ASM_ARM_ARCH_IO_H
12#define __ASM_ARM_ARCH_IO_H
13
14#define IO_SPACE_LIMIT 0xffffffff
15
16#define __io(a) ((void __iomem *)(0xe0000000 + (a)))
17
18#endif
diff --git a/arch/arm/mach-shark/leds.c b/arch/arm/mach-shark/leds.c
index 25609076921..081c778a10a 100644
--- a/arch/arm/mach-shark/leds.c
+++ b/arch/arm/mach-shark/leds.c
@@ -1,165 +1,117 @@
1/* 1/*
2 * arch/arm/mach-shark/leds.c
3 * by Alexander Schulz
4 *
5 * derived from:
6 * arch/arm/kernel/leds-footbridge.c
7 * Copyright (C) 1998-1999 Russell King
8 *
9 * DIGITAL Shark LED control routines. 2 * DIGITAL Shark LED control routines.
10 * 3 *
11 * The leds use is as follows: 4 * Driver for the 3 user LEDs found on the Shark
12 * - Green front - toggles state every 50 timer interrupts 5 * Based on Versatile and RealView machine LED code
13 * - Amber front - Unused, this is a dual color led (Amber/Green)
14 * - Amber back - On if system is not idle
15 * 6 *
16 * Changelog: 7 * License terms: GNU General Public License (GPL) version 2
8 * Author: Bryan Wu <bryan.wu@canonical.com>
17 */ 9 */
18#include <linux/kernel.h> 10#include <linux/kernel.h>
19#include <linux/module.h>
20#include <linux/init.h> 11#include <linux/init.h>
21#include <linux/spinlock.h>
22#include <linux/ioport.h>
23#include <linux/io.h> 12#include <linux/io.h>
13#include <linux/ioport.h>
14#include <linux/slab.h>
15#include <linux/leds.h>
24 16
25#include <asm/leds.h> 17#include <asm/mach-types.h>
26 18
27#define LED_STATE_ENABLED 1 19#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
28#define LED_STATE_CLAIMED 2 20struct shark_led {
21 struct led_classdev cdev;
22 u8 mask;
23};
29 24
30#define SEQUOIA_LED_GREEN (1<<6) 25/*
31#define SEQUOIA_LED_AMBER (1<<5) 26 * The triggers lines up below will only be used if the
32#define SEQUOIA_LED_BACK (1<<7) 27 * LED triggers are compiled in.
28 */
29static const struct {
30 const char *name;
31 const char *trigger;
32} shark_leds[] = {
33 { "shark:amber0", "default-on", }, /* Bit 5 */
34 { "shark:green", "heartbeat", }, /* Bit 6 */
35 { "shark:amber1", "cpu0" }, /* Bit 7 */
36};
37
38static u16 led_reg_read(void)
39{
40 outw(0x09, 0x24);
41 return inw(0x26);
42}
33 43
34static char led_state; 44static void led_reg_write(u16 value)
35static short hw_led_state; 45{
36static short saved_state; 46 outw(0x09, 0x24);
47 outw(value, 0x26);
48}
37 49
38static DEFINE_RAW_SPINLOCK(leds_lock); 50static void shark_led_set(struct led_classdev *cdev,
51 enum led_brightness b)
52{
53 struct shark_led *led = container_of(cdev,
54 struct shark_led, cdev);
55 u16 reg = led_reg_read();
39 56
40short sequoia_read(int addr) { 57 if (b != LED_OFF)
41 outw(addr,0x24); 58 reg |= led->mask;
42 return inw(0x26); 59 else
43} 60 reg &= ~led->mask;
44 61
45void sequoia_write(short value,short addr) { 62 led_reg_write(reg);
46 outw(addr,0x24);
47 outw(value,0x26);
48} 63}
49 64
50static void sequoia_leds_event(led_event_t evt) 65static enum led_brightness shark_led_get(struct led_classdev *cdev)
51{ 66{
52 unsigned long flags; 67 struct shark_led *led = container_of(cdev,
53 68 struct shark_led, cdev);
54 raw_spin_lock_irqsave(&leds_lock, flags); 69 u16 reg = led_reg_read();
55 70
56 hw_led_state = sequoia_read(0x09); 71 return (reg & led->mask) ? LED_FULL : LED_OFF;
72}
57 73
58 switch (evt) { 74static int __init shark_leds_init(void)
59 case led_start: 75{
60 hw_led_state |= SEQUOIA_LED_GREEN; 76 int i;
61 hw_led_state |= SEQUOIA_LED_AMBER; 77 u16 reg;
62#ifdef CONFIG_LEDS_CPU
63 hw_led_state |= SEQUOIA_LED_BACK;
64#else
65 hw_led_state &= ~SEQUOIA_LED_BACK;
66#endif
67 led_state |= LED_STATE_ENABLED;
68 break;
69
70 case led_stop:
71 hw_led_state &= ~SEQUOIA_LED_BACK;
72 hw_led_state |= SEQUOIA_LED_GREEN;
73 hw_led_state |= SEQUOIA_LED_AMBER;
74 led_state &= ~LED_STATE_ENABLED;
75 break;
76
77 case led_claim:
78 led_state |= LED_STATE_CLAIMED;
79 saved_state = hw_led_state;
80 hw_led_state &= ~SEQUOIA_LED_BACK;
81 hw_led_state |= SEQUOIA_LED_GREEN;
82 hw_led_state |= SEQUOIA_LED_AMBER;
83 break;
84
85 case led_release:
86 led_state &= ~LED_STATE_CLAIMED;
87 hw_led_state = saved_state;
88 break;
89
90#ifdef CONFIG_LEDS_TIMER
91 case led_timer:
92 if (!(led_state & LED_STATE_CLAIMED))
93 hw_led_state ^= SEQUOIA_LED_GREEN;
94 break;
95#endif
96 78
97#ifdef CONFIG_LEDS_CPU 79 if (!machine_is_shark())
98 case led_idle_start: 80 return -ENODEV;
99 if (!(led_state & LED_STATE_CLAIMED))
100 hw_led_state &= ~SEQUOIA_LED_BACK;
101 break;
102 81
103 case led_idle_end: 82 for (i = 0; i < ARRAY_SIZE(shark_leds); i++) {
104 if (!(led_state & LED_STATE_CLAIMED)) 83 struct shark_led *led;
105 hw_led_state |= SEQUOIA_LED_BACK;
106 break;
107#endif
108 84
109 case led_green_on: 85 led = kzalloc(sizeof(*led), GFP_KERNEL);
110 if (led_state & LED_STATE_CLAIMED) 86 if (!led)
111 hw_led_state &= ~SEQUOIA_LED_GREEN; 87 break;
112 break;
113
114 case led_green_off:
115 if (led_state & LED_STATE_CLAIMED)
116 hw_led_state |= SEQUOIA_LED_GREEN;
117 break;
118
119 case led_amber_on:
120 if (led_state & LED_STATE_CLAIMED)
121 hw_led_state &= ~SEQUOIA_LED_AMBER;
122 break;
123
124 case led_amber_off:
125 if (led_state & LED_STATE_CLAIMED)
126 hw_led_state |= SEQUOIA_LED_AMBER;
127 break;
128
129 case led_red_on:
130 if (led_state & LED_STATE_CLAIMED)
131 hw_led_state |= SEQUOIA_LED_BACK;
132 break;
133
134 case led_red_off:
135 if (led_state & LED_STATE_CLAIMED)
136 hw_led_state &= ~SEQUOIA_LED_BACK;
137 break;
138
139 default:
140 break;
141 }
142 88
143 if (led_state & LED_STATE_ENABLED) 89 led->cdev.name = shark_leds[i].name;
144 sequoia_write(hw_led_state,0x09); 90 led->cdev.brightness_set = shark_led_set;
91 led->cdev.brightness_get = shark_led_get;
92 led->cdev.default_trigger = shark_leds[i].trigger;
145 93
146 raw_spin_unlock_irqrestore(&leds_lock, flags); 94 /* Count in 5 bits offset */
147} 95 led->mask = BIT(i + 5);
148 96
149static int __init leds_init(void) 97 if (led_classdev_register(NULL, &led->cdev) < 0) {
150{ 98 kfree(led);
151 extern void (*leds_event)(led_event_t); 99 break;
152 short temp; 100 }
153 101 }
154 leds_event = sequoia_leds_event;
155 102
156 /* Make LEDs independent of power-state */ 103 /* Make LEDs independent of power-state */
157 request_region(0x24,4,"sequoia"); 104 request_region(0x24, 4, "led_reg");
158 temp = sequoia_read(0x09); 105 reg = led_reg_read();
159 temp |= 1<<10; 106 reg |= 1 << 10;
160 sequoia_write(temp,0x09); 107 led_reg_write(reg);
161 leds_event(led_start); 108
162 return 0; 109 return 0;
163} 110}
164 111
165__initcall(leds_init); 112/*
113 * Since we may have triggers on any subsystem, defer registration
114 * until after subsystem_init.
115 */
116fs_initcall(shark_leds_init);
117#endif
diff --git a/arch/arm/mach-shark/pci.c b/arch/arm/mach-shark/pci.c
index 9089407d532..6d91a914c1d 100644
--- a/arch/arm/mach-shark/pci.c
+++ b/arch/arm/mach-shark/pci.c
@@ -8,12 +8,15 @@
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/pci.h> 9#include <linux/pci.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/io.h>
11#include <video/vga.h> 12#include <video/vga.h>
12 13
13#include <asm/irq.h> 14#include <asm/irq.h>
14#include <asm/mach/pci.h> 15#include <asm/mach/pci.h>
15#include <asm/mach-types.h> 16#include <asm/mach-types.h>
16 17
18#define IO_START 0x40000000
19
17static int __init shark_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 20static int __init shark_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
18{ 21{
19 if (dev->bus->number == 0) 22 if (dev->bus->number == 0)
@@ -38,12 +41,14 @@ static struct hw_pci shark_pci __initdata = {
38static int __init shark_pci_init(void) 41static int __init shark_pci_init(void)
39{ 42{
40 if (!machine_is_shark()) 43 if (!machine_is_shark())
41 return; 44 return -ENODEV;
42 45
43 pcibios_min_io = 0x6000; 46 pcibios_min_io = 0x6000;
44 pcibios_min_mem = 0x50000000; 47 pcibios_min_mem = 0x50000000;
45 vga_base = 0xe8000000; 48 vga_base = 0xe8000000;
46 49
50 pci_ioremap_io(0, IO_START);
51
47 pci_common_init(&shark_pci); 52 pci_common_init(&shark_pci);
48 53
49 return 0; 54 return 0;
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 4cacc2d22fb..8ae100cc655 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -4,49 +4,49 @@ comment "SH-Mobile System Type"
4 4
5config ARCH_SH7367 5config ARCH_SH7367
6 bool "SH-Mobile G3 (SH7367)" 6 bool "SH-Mobile G3 (SH7367)"
7 select ARCH_WANT_OPTIONAL_GPIOLIB
7 select CPU_V6 8 select CPU_V6
8 select SH_CLK_CPG 9 select SH_CLK_CPG
9 select ARCH_WANT_OPTIONAL_GPIOLIB
10 10
11config ARCH_SH7377 11config ARCH_SH7377
12 bool "SH-Mobile G4 (SH7377)" 12 bool "SH-Mobile G4 (SH7377)"
13 select ARCH_WANT_OPTIONAL_GPIOLIB
13 select CPU_V7 14 select CPU_V7
14 select SH_CLK_CPG 15 select SH_CLK_CPG
15 select ARCH_WANT_OPTIONAL_GPIOLIB
16 16
17config ARCH_SH7372 17config ARCH_SH7372
18 bool "SH-Mobile AP4 (SH7372)" 18 bool "SH-Mobile AP4 (SH7372)"
19 select CPU_V7
20 select SH_CLK_CPG
21 select ARCH_WANT_OPTIONAL_GPIOLIB 19 select ARCH_WANT_OPTIONAL_GPIOLIB
22 select ARM_CPU_SUSPEND if PM || CPU_IDLE 20 select ARM_CPU_SUSPEND if PM || CPU_IDLE
21 select CPU_V7
22 select SH_CLK_CPG
23 23
24config ARCH_SH73A0 24config ARCH_SH73A0
25 bool "SH-Mobile AG5 (R8A73A00)" 25 bool "SH-Mobile AG5 (R8A73A00)"
26 select CPU_V7
27 select SH_CLK_CPG
28 select ARCH_WANT_OPTIONAL_GPIOLIB 26 select ARCH_WANT_OPTIONAL_GPIOLIB
29 select ARM_GIC 27 select ARM_GIC
28 select CPU_V7
30 select I2C 29 select I2C
30 select SH_CLK_CPG
31 31
32config ARCH_R8A7740 32config ARCH_R8A7740
33 bool "R-Mobile A1 (R8A77400)" 33 bool "R-Mobile A1 (R8A77400)"
34 select ARCH_WANT_OPTIONAL_GPIOLIB
34 select CPU_V7 35 select CPU_V7
35 select SH_CLK_CPG 36 select SH_CLK_CPG
36 select ARCH_WANT_OPTIONAL_GPIOLIB
37 37
38config ARCH_R8A7779 38config ARCH_R8A7779
39 bool "R-Car H1 (R8A77790)" 39 bool "R-Car H1 (R8A77790)"
40 select ARCH_WANT_OPTIONAL_GPIOLIB
41 select ARM_GIC
40 select CPU_V7 42 select CPU_V7
41 select SH_CLK_CPG 43 select SH_CLK_CPG
42 select ARM_GIC
43 select ARCH_WANT_OPTIONAL_GPIOLIB
44 44
45config ARCH_EMEV2 45config ARCH_EMEV2
46 bool "Emma Mobile EV2" 46 bool "Emma Mobile EV2"
47 select CPU_V7
48 select ARM_GIC
49 select ARCH_WANT_OPTIONAL_GPIOLIB 47 select ARCH_WANT_OPTIONAL_GPIOLIB
48 select ARM_GIC
49 select CPU_V7
50 50
51comment "SH-Mobile Board Type" 51comment "SH-Mobile Board Type"
52 52
@@ -65,9 +65,9 @@ config MACH_AP4EVB
65 bool "AP4EVB board" 65 bool "AP4EVB board"
66 depends on ARCH_SH7372 66 depends on ARCH_SH7372
67 select ARCH_REQUIRE_GPIOLIB 67 select ARCH_REQUIRE_GPIOLIB
68 select REGULATOR_FIXED_VOLTAGE if REGULATOR
68 select SH_LCD_MIPI_DSI 69 select SH_LCD_MIPI_DSI
69 select SND_SOC_AK4642 if SND_SIMPLE_CARD 70 select SND_SOC_AK4642 if SND_SIMPLE_CARD
70 select REGULATOR_FIXED_VOLTAGE if REGULATOR
71 71
72choice 72choice
73 prompt "AP4EVB LCD panel selection" 73 prompt "AP4EVB LCD panel selection"
@@ -84,37 +84,37 @@ endchoice
84 84
85config MACH_AG5EVM 85config MACH_AG5EVM
86 bool "AG5EVM board" 86 bool "AG5EVM board"
87 depends on ARCH_SH73A0
87 select ARCH_REQUIRE_GPIOLIB 88 select ARCH_REQUIRE_GPIOLIB
88 select SH_LCD_MIPI_DSI
89 select REGULATOR_FIXED_VOLTAGE if REGULATOR 89 select REGULATOR_FIXED_VOLTAGE if REGULATOR
90 depends on ARCH_SH73A0 90 select SH_LCD_MIPI_DSI
91 91
92config MACH_MACKEREL 92config MACH_MACKEREL
93 bool "mackerel board" 93 bool "mackerel board"
94 depends on ARCH_SH7372 94 depends on ARCH_SH7372
95 select ARCH_REQUIRE_GPIOLIB 95 select ARCH_REQUIRE_GPIOLIB
96 select SND_SOC_AK4642 if SND_SIMPLE_CARD
97 select REGULATOR_FIXED_VOLTAGE if REGULATOR 96 select REGULATOR_FIXED_VOLTAGE if REGULATOR
97 select SND_SOC_AK4642 if SND_SIMPLE_CARD
98 98
99config MACH_KOTA2 99config MACH_KOTA2
100 bool "KOTA2 board" 100 bool "KOTA2 board"
101 depends on ARCH_SH73A0
101 select ARCH_REQUIRE_GPIOLIB 102 select ARCH_REQUIRE_GPIOLIB
102 select REGULATOR_FIXED_VOLTAGE if REGULATOR 103 select REGULATOR_FIXED_VOLTAGE if REGULATOR
103 depends on ARCH_SH73A0
104 104
105config MACH_BONITO 105config MACH_BONITO
106 bool "bonito board" 106 bool "bonito board"
107 depends on ARCH_R8A7740
107 select ARCH_REQUIRE_GPIOLIB 108 select ARCH_REQUIRE_GPIOLIB
108 select REGULATOR_FIXED_VOLTAGE if REGULATOR 109 select REGULATOR_FIXED_VOLTAGE if REGULATOR
109 depends on ARCH_R8A7740
110 110
111config MACH_ARMADILLO800EVA 111config MACH_ARMADILLO800EVA
112 bool "Armadillo-800 EVA board" 112 bool "Armadillo-800 EVA board"
113 depends on ARCH_R8A7740 113 depends on ARCH_R8A7740
114 select ARCH_REQUIRE_GPIOLIB 114 select ARCH_REQUIRE_GPIOLIB
115 select USE_OF
116 select REGULATOR_FIXED_VOLTAGE if REGULATOR 115 select REGULATOR_FIXED_VOLTAGE if REGULATOR
117 select SND_SOC_WM8978 if SND_SIMPLE_CARD 116 select SND_SOC_WM8978 if SND_SIMPLE_CARD
117 select USE_OF
118 118
119config MACH_MARZEN 119config MACH_MARZEN
120 bool "MARZEN board" 120 bool "MARZEN board"
@@ -125,16 +125,16 @@ config MACH_MARZEN
125config MACH_KZM9D 125config MACH_KZM9D
126 bool "KZM9D board" 126 bool "KZM9D board"
127 depends on ARCH_EMEV2 127 depends on ARCH_EMEV2
128 select USE_OF
129 select REGULATOR_FIXED_VOLTAGE if REGULATOR 128 select REGULATOR_FIXED_VOLTAGE if REGULATOR
129 select USE_OF
130 130
131config MACH_KZM9G 131config MACH_KZM9G
132 bool "KZM-A9-GT board" 132 bool "KZM-A9-GT board"
133 depends on ARCH_SH73A0 133 depends on ARCH_SH73A0
134 select ARCH_REQUIRE_GPIOLIB 134 select ARCH_REQUIRE_GPIOLIB
135 select USE_OF
136 select SND_SOC_AK4642 if SND_SIMPLE_CARD
137 select REGULATOR_FIXED_VOLTAGE if REGULATOR 135 select REGULATOR_FIXED_VOLTAGE if REGULATOR
136 select SND_SOC_AK4642 if SND_SIMPLE_CARD
137 select USE_OF
138 138
139comment "SH-Mobile System Configuration" 139comment "SH-Mobile System Configuration"
140 140
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 0df5ae6740c..fe2c97c179d 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Common objects 5# Common objects
6obj-y := timer.o console.o clock.o common.o 6obj-y := timer.o console.o clock.o
7 7
8# CPU objects 8# CPU objects
9obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o 9obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index d82c010fdfc..25eb88a923e 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -40,7 +40,6 @@
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/videodev2.h>
44#include <video/sh_mobile_lcdc.h> 43#include <video/sh_mobile_lcdc.h>
45#include <video/sh_mipi_dsi.h> 44#include <video/sh_mipi_dsi.h>
46#include <sound/sh_fsi.h> 45#include <sound/sh_fsi.h>
@@ -650,6 +649,7 @@ static void __init ag5evm_init(void)
650} 649}
651 650
652MACHINE_START(AG5EVM, "ag5evm") 651MACHINE_START(AG5EVM, "ag5evm")
652 .smp = smp_ops(sh73a0_smp_ops),
653 .map_io = sh73a0_map_io, 653 .map_io = sh73a0_map_io,
654 .init_early = sh73a0_add_early_devices, 654 .init_early = sh73a0_add_early_devices,
655 .nr_irqs = NR_IRQS_LEGACY, 655 .nr_irqs = NR_IRQS_LEGACY,
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index f172ca85905..790dc68c431 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -66,6 +66,8 @@
66#include <asm/mach/arch.h> 66#include <asm/mach/arch.h>
67#include <asm/setup.h> 67#include <asm/setup.h>
68 68
69#include "sh-gpio.h"
70
69/* 71/*
70 * Address Interface BusWidth note 72 * Address Interface BusWidth note
71 * ------------------------------------------------------------------ 73 * ------------------------------------------------------------------
@@ -432,7 +434,7 @@ static void usb1_host_port_power(int port, int power)
432 return; 434 return;
433 435
434 /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */ 436 /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */
435 __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008); 437 __raw_writew(__raw_readw(IOMEM(0xE68B0008)) | 0x600, IOMEM(0xE68B0008));
436} 438}
437 439
438static struct r8a66597_platdata usb1_host_data = { 440static struct r8a66597_platdata usb1_host_data = {
@@ -1224,11 +1226,20 @@ static struct i2c_board_info i2c1_devices[] = {
1224}; 1226};
1225 1227
1226 1228
1227#define GPIO_PORT9CR 0xE6051009 1229#define GPIO_PORT9CR IOMEM(0xE6051009)
1228#define GPIO_PORT10CR 0xE605100A 1230#define GPIO_PORT10CR IOMEM(0xE605100A)
1229#define USCCR1 0xE6058144 1231#define USCCR1 IOMEM(0xE6058144)
1230static void __init ap4evb_init(void) 1232static void __init ap4evb_init(void)
1231{ 1233{
1234 struct pm_domain_device domain_devices[] = {
1235 { "A4LC", &lcdc1_device, },
1236 { "A4LC", &lcdc_device, },
1237 { "A4MP", &fsi_device, },
1238 { "A3SP", &sh_mmcif_device, },
1239 { "A3SP", &sdhi0_device, },
1240 { "A3SP", &sdhi1_device, },
1241 { "A4R", &ceu_device, },
1242 };
1232 u32 srcr4; 1243 u32 srcr4;
1233 struct clk *clk; 1244 struct clk *clk;
1234 1245
@@ -1304,7 +1315,7 @@ static void __init ap4evb_init(void)
1304 gpio_request(GPIO_FN_OVCN2_1, NULL); 1315 gpio_request(GPIO_FN_OVCN2_1, NULL);
1305 1316
1306 /* setup USB phy */ 1317 /* setup USB phy */
1307 __raw_writew(0x8a0a, 0xE6058130); /* USBCR4 */ 1318 __raw_writew(0x8a0a, IOMEM(0xE6058130)); /* USBCR4 */
1308 1319
1309 /* enable FSI2 port A (ak4643) */ 1320 /* enable FSI2 port A (ak4643) */
1310 gpio_request(GPIO_FN_FSIAIBT, NULL); 1321 gpio_request(GPIO_FN_FSIAIBT, NULL);
@@ -1453,7 +1464,7 @@ static void __init ap4evb_init(void)
1453 gpio_request(GPIO_FN_HDMI_CEC, NULL); 1464 gpio_request(GPIO_FN_HDMI_CEC, NULL);
1454 1465
1455 /* Reset HDMI, must be held at least one EXTALR (32768Hz) period */ 1466 /* Reset HDMI, must be held at least one EXTALR (32768Hz) period */
1456#define SRCR4 0xe61580bc 1467#define SRCR4 IOMEM(0xe61580bc)
1457 srcr4 = __raw_readl(SRCR4); 1468 srcr4 = __raw_readl(SRCR4);
1458 __raw_writel(srcr4 | (1 << 13), SRCR4); 1469 __raw_writel(srcr4 | (1 << 13), SRCR4);
1459 udelay(50); 1470 udelay(50);
@@ -1461,14 +1472,8 @@ static void __init ap4evb_init(void)
1461 1472
1462 platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices)); 1473 platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
1463 1474
1464 rmobile_add_device_to_domain(&sh7372_pd_a4lc, &lcdc1_device); 1475 rmobile_add_devices_to_domains(domain_devices,
1465 rmobile_add_device_to_domain(&sh7372_pd_a4lc, &lcdc_device); 1476 ARRAY_SIZE(domain_devices));
1466 rmobile_add_device_to_domain(&sh7372_pd_a4mp, &fsi_device);
1467
1468 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sh_mmcif_device);
1469 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi0_device);
1470 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi1_device);
1471 rmobile_add_device_to_domain(&sh7372_pd_a4r, &ceu_device);
1472 1477
1473 hdmi_init_pm_clock(); 1478 hdmi_init_pm_clock();
1474 fsi_init_pm_clock(); 1479 fsi_init_pm_clock();
@@ -1483,6 +1488,6 @@ MACHINE_START(AP4EVB, "ap4evb")
1483 .init_irq = sh7372_init_irq, 1488 .init_irq = sh7372_init_irq,
1484 .handle_irq = shmobile_handle_irq_intc, 1489 .handle_irq = shmobile_handle_irq_intc,
1485 .init_machine = ap4evb_init, 1490 .init_machine = ap4evb_init,
1486 .init_late = shmobile_init_late, 1491 .init_late = sh7372_pm_init_late,
1487 .timer = &shmobile_timer, 1492 .timer = &shmobile_timer,
1488MACHINE_END 1493MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 453a6e50db8..2912eab3b96 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -37,6 +37,7 @@
37#include <linux/mmc/host.h> 37#include <linux/mmc/host.h>
38#include <linux/mmc/sh_mmcif.h> 38#include <linux/mmc/sh_mmcif.h>
39#include <linux/mmc/sh_mobile_sdhi.h> 39#include <linux/mmc/sh_mobile_sdhi.h>
40#include <linux/i2c-gpio.h>
40#include <mach/common.h> 41#include <mach/common.h>
41#include <mach/irqs.h> 42#include <mach/irqs.h>
42#include <mach/r8a7740.h> 43#include <mach/r8a7740.h>
@@ -54,6 +55,8 @@
54#include <sound/sh_fsi.h> 55#include <sound/sh_fsi.h>
55#include <sound/simple_card.h> 56#include <sound/simple_card.h>
56 57
58#include "sh-gpio.h"
59
57/* 60/*
58 * CON1 Camera Module 61 * CON1 Camera Module
59 * CON2 Extension Bus 62 * CON2 Extension Bus
@@ -135,7 +138,7 @@
135 * usbhsf_power_ctrl() 138 * usbhsf_power_ctrl()
136 */ 139 */
137#define IRQ7 evt2irq(0x02e0) 140#define IRQ7 evt2irq(0x02e0)
138#define USBCR1 0xe605810a 141#define USBCR1 IOMEM(0xe605810a)
139#define USBH 0xC6700000 142#define USBH 0xC6700000
140#define USBH_USBCTR 0x10834 143#define USBH_USBCTR 0x10834
141 144
@@ -877,6 +880,21 @@ static struct platform_device fsi_hdmi_device = {
877 }, 880 },
878}; 881};
879 882
883/* RTC: RTC connects i2c-gpio. */
884static struct i2c_gpio_platform_data i2c_gpio_data = {
885 .sda_pin = GPIO_PORT208,
886 .scl_pin = GPIO_PORT91,
887 .udelay = 5, /* 100 kHz */
888};
889
890static struct platform_device i2c_gpio_device = {
891 .name = "i2c-gpio",
892 .id = 2,
893 .dev = {
894 .platform_data = &i2c_gpio_data,
895 },
896};
897
880/* I2C */ 898/* I2C */
881static struct i2c_board_info i2c0_devices[] = { 899static struct i2c_board_info i2c0_devices[] = {
882 { 900 {
@@ -888,6 +906,13 @@ static struct i2c_board_info i2c0_devices[] = {
888 }, 906 },
889}; 907};
890 908
909static struct i2c_board_info i2c2_devices[] = {
910 {
911 I2C_BOARD_INFO("s35390a", 0x30),
912 .type = "s35390a",
913 },
914};
915
891/* 916/*
892 * board devices 917 * board devices
893 */ 918 */
@@ -904,6 +929,7 @@ static struct platform_device *eva_devices[] __initdata = {
904 &fsi_device, 929 &fsi_device,
905 &fsi_wm8978_device, 930 &fsi_wm8978_device,
906 &fsi_hdmi_device, 931 &fsi_hdmi_device,
932 &i2c_gpio_device,
907}; 933};
908 934
909static void __init eva_clock_init(void) 935static void __init eva_clock_init(void)
@@ -950,8 +976,8 @@ clock_error:
950/* 976/*
951 * board init 977 * board init
952 */ 978 */
953#define GPIO_PORT7CR 0xe6050007 979#define GPIO_PORT7CR IOMEM(0xe6050007)
954#define GPIO_PORT8CR 0xe6050008 980#define GPIO_PORT8CR IOMEM(0xe6050008)
955static void __init eva_init(void) 981static void __init eva_init(void)
956{ 982{
957 struct platform_device *usb = NULL; 983 struct platform_device *usb = NULL;
@@ -1174,6 +1200,7 @@ static void __init eva_init(void)
1174#endif 1200#endif
1175 1201
1176 i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices)); 1202 i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices));
1203 i2c_register_board_info(2, i2c2_devices, ARRAY_SIZE(i2c2_devices));
1177 1204
1178 r8a7740_add_standard_devices(); 1205 r8a7740_add_standard_devices();
1179 1206
@@ -1182,10 +1209,10 @@ static void __init eva_init(void)
1182 1209
1183 eva_clock_init(); 1210 eva_clock_init();
1184 1211
1185 rmobile_add_device_to_domain(&r8a7740_pd_a4lc, &lcdc0_device); 1212 rmobile_add_device_to_domain("A4LC", &lcdc0_device);
1186 rmobile_add_device_to_domain(&r8a7740_pd_a4lc, &hdmi_lcdc_device); 1213 rmobile_add_device_to_domain("A4LC", &hdmi_lcdc_device);
1187 if (usb) 1214 if (usb)
1188 rmobile_add_device_to_domain(&r8a7740_pd_a3sp, usb); 1215 rmobile_add_device_to_domain("A3SP", usb);
1189} 1216}
1190 1217
1191static void __init eva_earlytimer_init(void) 1218static void __init eva_earlytimer_init(void)
diff --git a/arch/arm/mach-shmobile/board-bonito.c b/arch/arm/mach-shmobile/board-bonito.c
index 4129008eae2..cb8c994e143 100644
--- a/arch/arm/mach-shmobile/board-bonito.c
+++ b/arch/arm/mach-shmobile/board-bonito.c
@@ -108,12 +108,12 @@ static struct regulator_consumer_supply dummy_supplies[] = {
108#define FPGA_ETH_IRQ (FPGA_IRQ0 + 15) 108#define FPGA_ETH_IRQ (FPGA_IRQ0 + 15)
109static u16 bonito_fpga_read(u32 offset) 109static u16 bonito_fpga_read(u32 offset)
110{ 110{
111 return __raw_readw(0xf0003000 + offset); 111 return __raw_readw(IOMEM(0xf0003000) + offset);
112} 112}
113 113
114static void bonito_fpga_write(u32 offset, u16 val) 114static void bonito_fpga_write(u32 offset, u16 val)
115{ 115{
116 __raw_writew(val, 0xf0003000 + offset); 116 __raw_writew(val, IOMEM(0xf0003000) + offset);
117} 117}
118 118
119static void bonito_fpga_irq_disable(struct irq_data *data) 119static void bonito_fpga_irq_disable(struct irq_data *data)
@@ -361,8 +361,8 @@ static void __init bonito_map_io(void)
361#define BIT_ON(sw, bit) (sw & (1 << bit)) 361#define BIT_ON(sw, bit) (sw & (1 << bit))
362#define BIT_OFF(sw, bit) (!(sw & (1 << bit))) 362#define BIT_OFF(sw, bit) (!(sw & (1 << bit)))
363 363
364#define VCCQ1CR 0xE6058140 364#define VCCQ1CR IOMEM(0xE6058140)
365#define VCCQ1LCDCR 0xE6058186 365#define VCCQ1LCDCR IOMEM(0xE6058186)
366 366
367static void __init bonito_init(void) 367static void __init bonito_init(void)
368{ 368{
diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c
index 796fa00ad3c..b179d4c213b 100644
--- a/arch/arm/mach-shmobile/board-g3evm.c
+++ b/arch/arm/mach-shmobile/board-g3evm.c
@@ -106,7 +106,7 @@ static void usb_host_port_power(int port, int power)
106 return; 106 return;
107 107
108 /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */ 108 /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */
109 __raw_writew(__raw_readw(0xe6890008) | 0x600, 0xe6890008); 109 __raw_writew(__raw_readw(IOMEM(0xe6890008)) | 0x600, IOMEM(0xe6890008));
110} 110}
111 111
112static struct r8a66597_platdata usb_host_data = { 112static struct r8a66597_platdata usb_host_data = {
@@ -279,10 +279,10 @@ static void __init g3evm_init(void)
279 gpio_request(GPIO_FN_IDIN, NULL); 279 gpio_request(GPIO_FN_IDIN, NULL);
280 280
281 /* setup USB phy */ 281 /* setup USB phy */
282 __raw_writew(0x0300, 0xe605810a); /* USBCR1 */ 282 __raw_writew(0x0300, IOMEM(0xe605810a)); /* USBCR1 */
283 __raw_writew(0x00e0, 0xe60581c0); /* CPFCH */ 283 __raw_writew(0x00e0, IOMEM(0xe60581c0)); /* CPFCH */
284 __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */ 284 __raw_writew(0x6010, IOMEM(0xe60581c6)); /* CGPOSR */
285 __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */ 285 __raw_writew(0x8a0a, IOMEM(0xe605810c)); /* USBCR2 */
286 286
287 /* KEYSC @ CN7 */ 287 /* KEYSC @ CN7 */
288 gpio_request(GPIO_FN_PORT42_KEYOUT0, NULL); 288 gpio_request(GPIO_FN_PORT42_KEYOUT0, NULL);
@@ -320,7 +320,7 @@ static void __init g3evm_init(void)
320 gpio_request(GPIO_FN_WE0_XWR0_FWE, NULL); 320 gpio_request(GPIO_FN_WE0_XWR0_FWE, NULL);
321 gpio_request(GPIO_FN_FRB, NULL); 321 gpio_request(GPIO_FN_FRB, NULL);
322 /* FOE, FCDE, FSC on dedicated pins */ 322 /* FOE, FCDE, FSC on dedicated pins */
323 __raw_writel(__raw_readl(0xe6158048) & ~(1 << 15), 0xe6158048); 323 __raw_writel(__raw_readl(IOMEM(0xe6158048)) & ~(1 << 15), IOMEM(0xe6158048));
324 324
325 /* IrDA */ 325 /* IrDA */
326 gpio_request(GPIO_FN_IRDA_OUT, NULL); 326 gpio_request(GPIO_FN_IRDA_OUT, NULL);
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c
index fa5dfc5c8ed..35c126caa4d 100644
--- a/arch/arm/mach-shmobile/board-g4evm.c
+++ b/arch/arm/mach-shmobile/board-g4evm.c
@@ -42,6 +42,8 @@
42#include <asm/mach-types.h> 42#include <asm/mach-types.h>
43#include <asm/mach/arch.h> 43#include <asm/mach/arch.h>
44 44
45#include "sh-gpio.h"
46
45/* 47/*
46 * SDHI 48 * SDHI
47 * 49 *
@@ -126,7 +128,7 @@ static void usb_host_port_power(int port, int power)
126 return; 128 return;
127 129
128 /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */ 130 /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */
129 __raw_writew(__raw_readw(0xe6890008) | 0x600, 0xe6890008); 131 __raw_writew(__raw_readw(IOMEM(0xe6890008)) | 0x600, IOMEM(0xe6890008));
130} 132}
131 133
132static struct r8a66597_platdata usb_host_data = { 134static struct r8a66597_platdata usb_host_data = {
@@ -270,17 +272,17 @@ static struct platform_device *g4evm_devices[] __initdata = {
270 &sdhi1_device, 272 &sdhi1_device,
271}; 273};
272 274
273#define GPIO_SDHID0_D0 0xe60520fc 275#define GPIO_SDHID0_D0 IOMEM(0xe60520fc)
274#define GPIO_SDHID0_D1 0xe60520fd 276#define GPIO_SDHID0_D1 IOMEM(0xe60520fd)
275#define GPIO_SDHID0_D2 0xe60520fe 277#define GPIO_SDHID0_D2 IOMEM(0xe60520fe)
276#define GPIO_SDHID0_D3 0xe60520ff 278#define GPIO_SDHID0_D3 IOMEM(0xe60520ff)
277#define GPIO_SDHICMD0 0xe6052100 279#define GPIO_SDHICMD0 IOMEM(0xe6052100)
278 280
279#define GPIO_SDHID1_D0 0xe6052103 281#define GPIO_SDHID1_D0 IOMEM(0xe6052103)
280#define GPIO_SDHID1_D1 0xe6052104 282#define GPIO_SDHID1_D1 IOMEM(0xe6052104)
281#define GPIO_SDHID1_D2 0xe6052105 283#define GPIO_SDHID1_D2 IOMEM(0xe6052105)
282#define GPIO_SDHID1_D3 0xe6052106 284#define GPIO_SDHID1_D3 IOMEM(0xe6052106)
283#define GPIO_SDHICMD1 0xe6052107 285#define GPIO_SDHICMD1 IOMEM(0xe6052107)
284 286
285static void __init g4evm_init(void) 287static void __init g4evm_init(void)
286{ 288{
@@ -318,10 +320,10 @@ static void __init g4evm_init(void)
318 gpio_request(GPIO_FN_IDIN, NULL); 320 gpio_request(GPIO_FN_IDIN, NULL);
319 321
320 /* setup USB phy */ 322 /* setup USB phy */
321 __raw_writew(0x0200, 0xe605810a); /* USBCR1 */ 323 __raw_writew(0x0200, IOMEM(0xe605810a)); /* USBCR1 */
322 __raw_writew(0x00e0, 0xe60581c0); /* CPFCH */ 324 __raw_writew(0x00e0, IOMEM(0xe60581c0)); /* CPFCH */
323 __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */ 325 __raw_writew(0x6010, IOMEM(0xe60581c6)); /* CGPOSR */
324 __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */ 326 __raw_writew(0x8a0a, IOMEM(0xe605810c)); /* USBCR2 */
325 327
326 /* KEYSC @ CN31 */ 328 /* KEYSC @ CN31 */
327 gpio_request(GPIO_FN_PORT60_KEYOUT5, NULL); 329 gpio_request(GPIO_FN_PORT60_KEYOUT5, NULL);
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c
index 21dbe54304d..bf88f9a8b7a 100644
--- a/arch/arm/mach-shmobile/board-kota2.c
+++ b/arch/arm/mach-shmobile/board-kota2.c
@@ -545,6 +545,7 @@ static void __init kota2_init(void)
545} 545}
546 546
547MACHINE_START(KOTA2, "kota2") 547MACHINE_START(KOTA2, "kota2")
548 .smp = smp_ops(sh73a0_smp_ops),
548 .map_io = sh73a0_map_io, 549 .map_io = sh73a0_map_io,
549 .init_early = sh73a0_add_early_devices, 550 .init_early = sh73a0_add_early_devices,
550 .nr_irqs = NR_IRQS_LEGACY, 551 .nr_irqs = NR_IRQS_LEGACY,
diff --git a/arch/arm/mach-shmobile/board-kzm9d.c b/arch/arm/mach-shmobile/board-kzm9d.c
index 2c986eaae7b..b52bc0d1273 100644
--- a/arch/arm/mach-shmobile/board-kzm9d.c
+++ b/arch/arm/mach-shmobile/board-kzm9d.c
@@ -84,6 +84,7 @@ static const char *kzm9d_boards_compat_dt[] __initdata = {
84}; 84};
85 85
86DT_MACHINE_START(KZM9D_DT, "kzm9d") 86DT_MACHINE_START(KZM9D_DT, "kzm9d")
87 .smp = smp_ops(emev2_smp_ops),
87 .map_io = emev2_map_io, 88 .map_io = emev2_map_io,
88 .init_early = emev2_add_early_devices, 89 .init_early = emev2_add_early_devices,
89 .nr_irqs = NR_IRQS_LEGACY, 90 .nr_irqs = NR_IRQS_LEGACY,
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index 53b7ea92c32..0a43f3189c2 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -133,8 +133,8 @@ static struct platform_device usb_host_device = {
133 133
134/* USB Func CN17 */ 134/* USB Func CN17 */
135struct usbhs_private { 135struct usbhs_private {
136 unsigned int phy; 136 void __iomem *phy;
137 unsigned int cr2; 137 void __iomem *cr2;
138 struct renesas_usbhs_platform_info info; 138 struct renesas_usbhs_platform_info info;
139}; 139};
140 140
@@ -232,8 +232,8 @@ static u32 usbhs_pipe_cfg[] = {
232}; 232};
233 233
234static struct usbhs_private usbhs_private = { 234static struct usbhs_private usbhs_private = {
235 .phy = 0xe60781e0, /* USBPHYINT */ 235 .phy = IOMEM(0xe60781e0), /* USBPHYINT */
236 .cr2 = 0xe605810c, /* USBCR2 */ 236 .cr2 = IOMEM(0xe605810c), /* USBCR2 */
237 .info = { 237 .info = {
238 .platform_callback = { 238 .platform_callback = {
239 .hardware_init = usbhs_hardware_init, 239 .hardware_init = usbhs_hardware_init,
@@ -346,11 +346,11 @@ static struct resource sh_mmcif_resources[] = {
346 .flags = IORESOURCE_MEM, 346 .flags = IORESOURCE_MEM,
347 }, 347 },
348 [1] = { 348 [1] = {
349 .start = gic_spi(141), 349 .start = gic_spi(140),
350 .flags = IORESOURCE_IRQ, 350 .flags = IORESOURCE_IRQ,
351 }, 351 },
352 [2] = { 352 [2] = {
353 .start = gic_spi(140), 353 .start = gic_spi(141),
354 .flags = IORESOURCE_IRQ, 354 .flags = IORESOURCE_IRQ,
355 }, 355 },
356}; 356};
@@ -482,12 +482,10 @@ static struct gpio_keys_button gpio_buttons[] = {
482static struct gpio_keys_platform_data gpio_key_info = { 482static struct gpio_keys_platform_data gpio_key_info = {
483 .buttons = gpio_buttons, 483 .buttons = gpio_buttons,
484 .nbuttons = ARRAY_SIZE(gpio_buttons), 484 .nbuttons = ARRAY_SIZE(gpio_buttons),
485 .poll_interval = 250, /* poling at this point */
486}; 485};
487 486
488static struct platform_device gpio_keys_device = { 487static struct platform_device gpio_keys_device = {
489 /* gpio-pcf857x.c driver doesn't support gpio_to_irq() */ 488 .name = "gpio-keys",
490 .name = "gpio-keys-polled",
491 .dev = { 489 .dev = {
492 .platform_data = &gpio_key_info, 490 .platform_data = &gpio_key_info,
493 }, 491 },
@@ -550,6 +548,7 @@ static struct platform_device fsi_ak4648_device = {
550/* I2C */ 548/* I2C */
551static struct pcf857x_platform_data pcf8575_pdata = { 549static struct pcf857x_platform_data pcf8575_pdata = {
552 .gpio_base = GPIO_PCF8575_BASE, 550 .gpio_base = GPIO_PCF8575_BASE,
551 .irq = intcs_evt2irq(0x3260), /* IRQ19 */
553}; 552};
554 553
555static struct i2c_board_info i2c0_devices[] = { 554static struct i2c_board_info i2c0_devices[] = {
@@ -763,12 +762,20 @@ static void __init kzm_init(void)
763 platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices)); 762 platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
764} 763}
765 764
765static void kzm9g_restart(char mode, const char *cmd)
766{
767#define RESCNT2 IOMEM(0xe6188020)
768 /* Do soft power on reset */
769 writel((1 << 31), RESCNT2);
770}
771
766static const char *kzm9g_boards_compat_dt[] __initdata = { 772static const char *kzm9g_boards_compat_dt[] __initdata = {
767 "renesas,kzm9g", 773 "renesas,kzm9g",
768 NULL, 774 NULL,
769}; 775};
770 776
771DT_MACHINE_START(KZM9G_DT, "kzm9g") 777DT_MACHINE_START(KZM9G_DT, "kzm9g")
778 .smp = smp_ops(sh73a0_smp_ops),
772 .map_io = sh73a0_map_io, 779 .map_io = sh73a0_map_io,
773 .init_early = sh73a0_add_early_devices, 780 .init_early = sh73a0_add_early_devices,
774 .nr_irqs = NR_IRQS_LEGACY, 781 .nr_irqs = NR_IRQS_LEGACY,
@@ -777,5 +784,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g")
777 .init_machine = kzm_init, 784 .init_machine = kzm_init,
778 .init_late = shmobile_init_late, 785 .init_late = shmobile_init_late,
779 .timer = &shmobile_timer, 786 .timer = &shmobile_timer,
787 .restart = kzm9g_restart,
780 .dt_compat = kzm9g_boards_compat_dt, 788 .dt_compat = kzm9g_boards_compat_dt,
781MACHINE_END 789MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index c129542f6ae..0c27c810cf9 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -64,6 +64,8 @@
64#include <asm/mach/arch.h> 64#include <asm/mach/arch.h>
65#include <asm/mach-types.h> 65#include <asm/mach-types.h>
66 66
67#include "sh-gpio.h"
68
67/* 69/*
68 * Address Interface BusWidth note 70 * Address Interface BusWidth note
69 * ------------------------------------------------------------------ 71 * ------------------------------------------------------------------
@@ -583,8 +585,8 @@ out:
583#define USBHS0_POLL_INTERVAL (HZ * 5) 585#define USBHS0_POLL_INTERVAL (HZ * 5)
584 586
585struct usbhs_private { 587struct usbhs_private {
586 unsigned int usbphyaddr; 588 void __iomem *usbphyaddr;
587 unsigned int usbcrcaddr; 589 void __iomem *usbcrcaddr;
588 struct renesas_usbhs_platform_info info; 590 struct renesas_usbhs_platform_info info;
589 struct delayed_work work; 591 struct delayed_work work;
590 struct platform_device *pdev; 592 struct platform_device *pdev;
@@ -642,7 +644,7 @@ static void usbhs0_hardware_exit(struct platform_device *pdev)
642} 644}
643 645
644static struct usbhs_private usbhs0_private = { 646static struct usbhs_private usbhs0_private = {
645 .usbcrcaddr = 0xe605810c, /* USBCR2 */ 647 .usbcrcaddr = IOMEM(0xe605810c), /* USBCR2 */
646 .info = { 648 .info = {
647 .platform_callback = { 649 .platform_callback = {
648 .hardware_init = usbhs0_hardware_init, 650 .hardware_init = usbhs0_hardware_init,
@@ -776,8 +778,8 @@ static u32 usbhs1_pipe_cfg[] = {
776}; 778};
777 779
778static struct usbhs_private usbhs1_private = { 780static struct usbhs_private usbhs1_private = {
779 .usbphyaddr = 0xe60581e2, /* USBPHY1INTAP */ 781 .usbphyaddr = IOMEM(0xe60581e2), /* USBPHY1INTAP */
780 .usbcrcaddr = 0xe6058130, /* USBCR4 */ 782 .usbcrcaddr = IOMEM(0xe6058130), /* USBCR4 */
781 .info = { 783 .info = {
782 .platform_callback = { 784 .platform_callback = {
783 .hardware_init = usbhs1_hardware_init, 785 .hardware_init = usbhs1_hardware_init,
@@ -1402,14 +1404,30 @@ static struct i2c_board_info i2c1_devices[] = {
1402 }, 1404 },
1403}; 1405};
1404 1406
1405#define GPIO_PORT9CR 0xE6051009 1407#define GPIO_PORT9CR IOMEM(0xE6051009)
1406#define GPIO_PORT10CR 0xE605100A 1408#define GPIO_PORT10CR IOMEM(0xE605100A)
1407#define GPIO_PORT167CR 0xE60520A7 1409#define GPIO_PORT167CR IOMEM(0xE60520A7)
1408#define GPIO_PORT168CR 0xE60520A8 1410#define GPIO_PORT168CR IOMEM(0xE60520A8)
1409#define SRCR4 0xe61580bc 1411#define SRCR4 IOMEM(0xe61580bc)
1410#define USCCR1 0xE6058144 1412#define USCCR1 IOMEM(0xE6058144)
1411static void __init mackerel_init(void) 1413static void __init mackerel_init(void)
1412{ 1414{
1415 struct pm_domain_device domain_devices[] = {
1416 { "A4LC", &lcdc_device, },
1417 { "A4LC", &hdmi_lcdc_device, },
1418 { "A4LC", &meram_device, },
1419 { "A4MP", &fsi_device, },
1420 { "A3SP", &usbhs0_device, },
1421 { "A3SP", &usbhs1_device, },
1422 { "A3SP", &nand_flash_device, },
1423 { "A3SP", &sh_mmcif_device, },
1424 { "A3SP", &sdhi0_device, },
1425#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1426 { "A3SP", &sdhi1_device, },
1427#endif
1428 { "A3SP", &sdhi2_device, },
1429 { "A4R", &ceu_device, },
1430 };
1413 u32 srcr4; 1431 u32 srcr4;
1414 struct clk *clk; 1432 struct clk *clk;
1415 1433
@@ -1624,20 +1642,8 @@ static void __init mackerel_init(void)
1624 1642
1625 platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices)); 1643 platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices));
1626 1644
1627 rmobile_add_device_to_domain(&sh7372_pd_a4lc, &lcdc_device); 1645 rmobile_add_devices_to_domains(domain_devices,
1628 rmobile_add_device_to_domain(&sh7372_pd_a4lc, &hdmi_lcdc_device); 1646 ARRAY_SIZE(domain_devices));
1629 rmobile_add_device_to_domain(&sh7372_pd_a4lc, &meram_device);
1630 rmobile_add_device_to_domain(&sh7372_pd_a4mp, &fsi_device);
1631 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &usbhs0_device);
1632 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &usbhs1_device);
1633 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &nand_flash_device);
1634 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sh_mmcif_device);
1635 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi0_device);
1636#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1637 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi1_device);
1638#endif
1639 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi2_device);
1640 rmobile_add_device_to_domain(&sh7372_pd_a4r, &ceu_device);
1641 1647
1642 hdmi_init_pm_clock(); 1648 hdmi_init_pm_clock();
1643 sh7372_pm_init(); 1649 sh7372_pm_init();
@@ -1651,6 +1657,6 @@ MACHINE_START(MACKEREL, "mackerel")
1651 .init_irq = sh7372_init_irq, 1657 .init_irq = sh7372_init_irq,
1652 .handle_irq = shmobile_handle_irq_intc, 1658 .handle_irq = shmobile_handle_irq_intc,
1653 .init_machine = mackerel_init, 1659 .init_machine = mackerel_init,
1654 .init_late = shmobile_init_late, 1660 .init_late = sh7372_pm_init_late,
1655 .timer = &shmobile_timer, 1661 .timer = &shmobile_timer,
1656MACHINE_END 1662MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index fcf5a47f477..b8a7525a4e2 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -30,6 +30,8 @@
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/smsc911x.h> 32#include <linux/smsc911x.h>
33#include <linux/mmc/sh_mobile_sdhi.h>
34#include <linux/mfd/tmio.h>
33#include <mach/hardware.h> 35#include <mach/hardware.h>
34#include <mach/r8a7779.h> 36#include <mach/r8a7779.h>
35#include <mach/common.h> 37#include <mach/common.h>
@@ -39,6 +41,12 @@
39#include <asm/hardware/gic.h> 41#include <asm/hardware/gic.h>
40#include <asm/traps.h> 42#include <asm/traps.h>
41 43
44/* Fixed 3.3V regulator to be used by SDHI0 */
45static struct regulator_consumer_supply fixed3v3_power_consumers[] = {
46 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
47 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
48};
49
42/* Dummy supplies, where voltage doesn't matter */ 50/* Dummy supplies, where voltage doesn't matter */
43static struct regulator_consumer_supply dummy_supplies[] = { 51static struct regulator_consumer_supply dummy_supplies[] = {
44 REGULATOR_SUPPLY("vddvario", "smsc911x"), 52 REGULATOR_SUPPLY("vddvario", "smsc911x"),
@@ -75,13 +83,61 @@ static struct platform_device eth_device = {
75 .num_resources = ARRAY_SIZE(smsc911x_resources), 83 .num_resources = ARRAY_SIZE(smsc911x_resources),
76}; 84};
77 85
86static struct resource sdhi0_resources[] = {
87 [0] = {
88 .name = "sdhi0",
89 .start = 0xffe4c000,
90 .end = 0xffe4c0ff,
91 .flags = IORESOURCE_MEM,
92 },
93 [1] = {
94 .start = gic_spi(104),
95 .flags = IORESOURCE_IRQ,
96 },
97};
98
99static struct sh_mobile_sdhi_info sdhi0_platform_data = {
100 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
101 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
102};
103
104static struct platform_device sdhi0_device = {
105 .name = "sh_mobile_sdhi",
106 .num_resources = ARRAY_SIZE(sdhi0_resources),
107 .resource = sdhi0_resources,
108 .id = 0,
109 .dev = {
110 .platform_data = &sdhi0_platform_data,
111 }
112};
113
114/* Thermal */
115static struct resource thermal_resources[] = {
116 [0] = {
117 .start = 0xFFC48000,
118 .end = 0xFFC48038 - 1,
119 .flags = IORESOURCE_MEM,
120 },
121};
122
123static struct platform_device thermal_device = {
124 .name = "rcar_thermal",
125 .resource = thermal_resources,
126 .num_resources = ARRAY_SIZE(thermal_resources),
127};
128
78static struct platform_device *marzen_devices[] __initdata = { 129static struct platform_device *marzen_devices[] __initdata = {
79 &eth_device, 130 &eth_device,
131 &sdhi0_device,
132 &thermal_device,
80}; 133};
81 134
82static void __init marzen_init(void) 135static void __init marzen_init(void)
83{ 136{
84 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 137 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
138 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
139 regulator_register_fixed(1, dummy_supplies,
140 ARRAY_SIZE(dummy_supplies));
85 141
86 r8a7779_pinmux_init(); 142 r8a7779_pinmux_init();
87 143
@@ -97,11 +153,22 @@ static void __init marzen_init(void)
97 gpio_request(GPIO_FN_EX_CS0, NULL); /* nCS */ 153 gpio_request(GPIO_FN_EX_CS0, NULL); /* nCS */
98 gpio_request(GPIO_FN_IRQ1_B, NULL); /* IRQ + PME */ 154 gpio_request(GPIO_FN_IRQ1_B, NULL); /* IRQ + PME */
99 155
156 /* SD0 (CN20) */
157 gpio_request(GPIO_FN_SD0_CLK, NULL);
158 gpio_request(GPIO_FN_SD0_CMD, NULL);
159 gpio_request(GPIO_FN_SD0_DAT0, NULL);
160 gpio_request(GPIO_FN_SD0_DAT1, NULL);
161 gpio_request(GPIO_FN_SD0_DAT2, NULL);
162 gpio_request(GPIO_FN_SD0_DAT3, NULL);
163 gpio_request(GPIO_FN_SD0_CD, NULL);
164 gpio_request(GPIO_FN_SD0_WP, NULL);
165
100 r8a7779_add_standard_devices(); 166 r8a7779_add_standard_devices();
101 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); 167 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
102} 168}
103 169
104MACHINE_START(MARZEN, "marzen") 170MACHINE_START(MARZEN, "marzen")
171 .smp = smp_ops(r8a7779_smp_ops),
105 .map_io = r8a7779_map_io, 172 .map_io = r8a7779_map_io,
106 .init_early = r8a7779_add_early_devices, 173 .init_early = r8a7779_add_early_devices,
107 .nr_irqs = NR_IRQS_LEGACY, 174 .nr_irqs = NR_IRQS_LEGACY,
diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
index ad5fccc7b5e..6729e003218 100644
--- a/arch/arm/mach-shmobile/clock-r8a7740.c
+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
@@ -41,29 +41,29 @@
41 */ 41 */
42 42
43/* CPG registers */ 43/* CPG registers */
44#define FRQCRA 0xe6150000 44#define FRQCRA IOMEM(0xe6150000)
45#define FRQCRB 0xe6150004 45#define FRQCRB IOMEM(0xe6150004)
46#define VCLKCR1 0xE6150008 46#define VCLKCR1 IOMEM(0xE6150008)
47#define VCLKCR2 0xE615000c 47#define VCLKCR2 IOMEM(0xE615000c)
48#define FRQCRC 0xe61500e0 48#define FRQCRC IOMEM(0xe61500e0)
49#define FSIACKCR 0xe6150018 49#define FSIACKCR IOMEM(0xe6150018)
50#define PLLC01CR 0xe6150028 50#define PLLC01CR IOMEM(0xe6150028)
51 51
52#define SUBCKCR 0xe6150080 52#define SUBCKCR IOMEM(0xe6150080)
53#define USBCKCR 0xe615008c 53#define USBCKCR IOMEM(0xe615008c)
54 54
55#define MSTPSR0 0xe6150030 55#define MSTPSR0 IOMEM(0xe6150030)
56#define MSTPSR1 0xe6150038 56#define MSTPSR1 IOMEM(0xe6150038)
57#define MSTPSR2 0xe6150040 57#define MSTPSR2 IOMEM(0xe6150040)
58#define MSTPSR3 0xe6150048 58#define MSTPSR3 IOMEM(0xe6150048)
59#define MSTPSR4 0xe615004c 59#define MSTPSR4 IOMEM(0xe615004c)
60#define FSIBCKCR 0xe6150090 60#define FSIBCKCR IOMEM(0xe6150090)
61#define HDMICKCR 0xe6150094 61#define HDMICKCR IOMEM(0xe6150094)
62#define SMSTPCR0 0xe6150130 62#define SMSTPCR0 IOMEM(0xe6150130)
63#define SMSTPCR1 0xe6150134 63#define SMSTPCR1 IOMEM(0xe6150134)
64#define SMSTPCR2 0xe6150138 64#define SMSTPCR2 IOMEM(0xe6150138)
65#define SMSTPCR3 0xe615013c 65#define SMSTPCR3 IOMEM(0xe615013c)
66#define SMSTPCR4 0xe6150140 66#define SMSTPCR4 IOMEM(0xe6150140)
67 67
68/* Fixed 32 KHz root clock from EXTALR pin */ 68/* Fixed 32 KHz root clock from EXTALR pin */
69static struct clk extalr_clk = { 69static struct clk extalr_clk = {
diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index 339c62c824d..3cafb6ab5e9 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -86,11 +86,16 @@ static struct clk div4_clks[DIV4_NR] = {
86 0x0300, CLK_ENABLE_ON_INIT), 86 0x0300, CLK_ENABLE_ON_INIT),
87}; 87};
88 88
89enum { MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, 89enum { MSTP323, MSTP322, MSTP321, MSTP320,
90 MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
90 MSTP016, MSTP015, MSTP014, 91 MSTP016, MSTP015, MSTP014,
91 MSTP_NR }; 92 MSTP_NR };
92 93
93static struct clk mstp_clks[MSTP_NR] = { 94static struct clk mstp_clks[MSTP_NR] = {
95 [MSTP323] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 23, 0), /* SDHI0 */
96 [MSTP322] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 22, 0), /* SDHI1 */
97 [MSTP321] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 21, 0), /* SDHI2 */
98 [MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 20, 0), /* SDHI3 */
94 [MSTP026] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 26, 0), /* SCIF0 */ 99 [MSTP026] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 26, 0), /* SCIF0 */
95 [MSTP025] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 25, 0), /* SCIF1 */ 100 [MSTP025] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 25, 0), /* SCIF1 */
96 [MSTP024] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 24, 0), /* SCIF2 */ 101 [MSTP024] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 24, 0), /* SCIF2 */
@@ -149,6 +154,10 @@ static struct clk_lookup lookups[] = {
149 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */ 154 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */
150 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */ 155 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */
151 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */ 156 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
157 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP323]), /* SDHI0 */
158 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */
159 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */
160 CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP320]), /* SDHI3 */
152}; 161};
153 162
154void __init r8a7779_clock_init(void) 163void __init r8a7779_clock_init(void)
diff --git a/arch/arm/mach-shmobile/clock-sh7367.c b/arch/arm/mach-shmobile/clock-sh7367.c
index 162b791b898..ef0a95e592c 100644
--- a/arch/arm/mach-shmobile/clock-sh7367.c
+++ b/arch/arm/mach-shmobile/clock-sh7367.c
@@ -24,28 +24,28 @@
24#include <mach/common.h> 24#include <mach/common.h>
25 25
26/* SH7367 registers */ 26/* SH7367 registers */
27#define RTFRQCR 0xe6150000 27#define RTFRQCR IOMEM(0xe6150000)
28#define SYFRQCR 0xe6150004 28#define SYFRQCR IOMEM(0xe6150004)
29#define CMFRQCR 0xe61500E0 29#define CMFRQCR IOMEM(0xe61500E0)
30#define VCLKCR1 0xe6150008 30#define VCLKCR1 IOMEM(0xe6150008)
31#define VCLKCR2 0xe615000C 31#define VCLKCR2 IOMEM(0xe615000C)
32#define VCLKCR3 0xe615001C 32#define VCLKCR3 IOMEM(0xe615001C)
33#define SCLKACR 0xe6150010 33#define SCLKACR IOMEM(0xe6150010)
34#define SCLKBCR 0xe6150014 34#define SCLKBCR IOMEM(0xe6150014)
35#define SUBUSBCKCR 0xe6158080 35#define SUBUSBCKCR IOMEM(0xe6158080)
36#define SPUCKCR 0xe6150084 36#define SPUCKCR IOMEM(0xe6150084)
37#define MSUCKCR 0xe6150088 37#define MSUCKCR IOMEM(0xe6150088)
38#define MVI3CKCR 0xe6150090 38#define MVI3CKCR IOMEM(0xe6150090)
39#define VOUCKCR 0xe6150094 39#define VOUCKCR IOMEM(0xe6150094)
40#define MFCK1CR 0xe6150098 40#define MFCK1CR IOMEM(0xe6150098)
41#define MFCK2CR 0xe615009C 41#define MFCK2CR IOMEM(0xe615009C)
42#define PLLC1CR 0xe6150028 42#define PLLC1CR IOMEM(0xe6150028)
43#define PLLC2CR 0xe615002C 43#define PLLC2CR IOMEM(0xe615002C)
44#define RTMSTPCR0 0xe6158030 44#define RTMSTPCR0 IOMEM(0xe6158030)
45#define RTMSTPCR2 0xe6158038 45#define RTMSTPCR2 IOMEM(0xe6158038)
46#define SYMSTPCR0 0xe6158040 46#define SYMSTPCR0 IOMEM(0xe6158040)
47#define SYMSTPCR2 0xe6158048 47#define SYMSTPCR2 IOMEM(0xe6158048)
48#define CMMSTPCR0 0xe615804c 48#define CMMSTPCR0 IOMEM(0xe615804c)
49 49
50/* Fixed 32 KHz root clock from EXTALR pin */ 50/* Fixed 32 KHz root clock from EXTALR pin */
51static struct clk r_clk = { 51static struct clk r_clk = {
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index 5a2894b1c96..430a90ffa12 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -24,36 +24,36 @@
24#include <mach/common.h> 24#include <mach/common.h>
25 25
26/* SH7372 registers */ 26/* SH7372 registers */
27#define FRQCRA 0xe6150000 27#define FRQCRA IOMEM(0xe6150000)
28#define FRQCRB 0xe6150004 28#define FRQCRB IOMEM(0xe6150004)
29#define FRQCRC 0xe61500e0 29#define FRQCRC IOMEM(0xe61500e0)
30#define FRQCRD 0xe61500e4 30#define FRQCRD IOMEM(0xe61500e4)
31#define VCLKCR1 0xe6150008 31#define VCLKCR1 IOMEM(0xe6150008)
32#define VCLKCR2 0xe615000c 32#define VCLKCR2 IOMEM(0xe615000c)
33#define VCLKCR3 0xe615001c 33#define VCLKCR3 IOMEM(0xe615001c)
34#define FMSICKCR 0xe6150010 34#define FMSICKCR IOMEM(0xe6150010)
35#define FMSOCKCR 0xe6150014 35#define FMSOCKCR IOMEM(0xe6150014)
36#define FSIACKCR 0xe6150018 36#define FSIACKCR IOMEM(0xe6150018)
37#define FSIBCKCR 0xe6150090 37#define FSIBCKCR IOMEM(0xe6150090)
38#define SUBCKCR 0xe6150080 38#define SUBCKCR IOMEM(0xe6150080)
39#define SPUCKCR 0xe6150084 39#define SPUCKCR IOMEM(0xe6150084)
40#define VOUCKCR 0xe6150088 40#define VOUCKCR IOMEM(0xe6150088)
41#define HDMICKCR 0xe6150094 41#define HDMICKCR IOMEM(0xe6150094)
42#define DSITCKCR 0xe6150060 42#define DSITCKCR IOMEM(0xe6150060)
43#define DSI0PCKCR 0xe6150064 43#define DSI0PCKCR IOMEM(0xe6150064)
44#define DSI1PCKCR 0xe6150098 44#define DSI1PCKCR IOMEM(0xe6150098)
45#define PLLC01CR 0xe6150028 45#define PLLC01CR IOMEM(0xe6150028)
46#define PLLC2CR 0xe615002c 46#define PLLC2CR IOMEM(0xe615002c)
47#define RMSTPCR0 0xe6150110 47#define RMSTPCR0 IOMEM(0xe6150110)
48#define RMSTPCR1 0xe6150114 48#define RMSTPCR1 IOMEM(0xe6150114)
49#define RMSTPCR2 0xe6150118 49#define RMSTPCR2 IOMEM(0xe6150118)
50#define RMSTPCR3 0xe615011c 50#define RMSTPCR3 IOMEM(0xe615011c)
51#define RMSTPCR4 0xe6150120 51#define RMSTPCR4 IOMEM(0xe6150120)
52#define SMSTPCR0 0xe6150130 52#define SMSTPCR0 IOMEM(0xe6150130)
53#define SMSTPCR1 0xe6150134 53#define SMSTPCR1 IOMEM(0xe6150134)
54#define SMSTPCR2 0xe6150138 54#define SMSTPCR2 IOMEM(0xe6150138)
55#define SMSTPCR3 0xe615013c 55#define SMSTPCR3 IOMEM(0xe615013c)
56#define SMSTPCR4 0xe6150140 56#define SMSTPCR4 IOMEM(0xe6150140)
57 57
58#define FSIDIVA 0xFE1F8000 58#define FSIDIVA 0xFE1F8000
59#define FSIDIVB 0xFE1F8008 59#define FSIDIVB 0xFE1F8008
diff --git a/arch/arm/mach-shmobile/clock-sh7377.c b/arch/arm/mach-shmobile/clock-sh7377.c
index 85f2a3ec2c4..b8480d19e1c 100644
--- a/arch/arm/mach-shmobile/clock-sh7377.c
+++ b/arch/arm/mach-shmobile/clock-sh7377.c
@@ -24,31 +24,31 @@
24#include <mach/common.h> 24#include <mach/common.h>
25 25
26/* SH7377 registers */ 26/* SH7377 registers */
27#define RTFRQCR 0xe6150000 27#define RTFRQCR IOMEM(0xe6150000)
28#define SYFRQCR 0xe6150004 28#define SYFRQCR IOMEM(0xe6150004)
29#define CMFRQCR 0xe61500E0 29#define CMFRQCR IOMEM(0xe61500E0)
30#define VCLKCR1 0xe6150008 30#define VCLKCR1 IOMEM(0xe6150008)
31#define VCLKCR2 0xe615000C 31#define VCLKCR2 IOMEM(0xe615000C)
32#define VCLKCR3 0xe615001C 32#define VCLKCR3 IOMEM(0xe615001C)
33#define FMSICKCR 0xe6150010 33#define FMSICKCR IOMEM(0xe6150010)
34#define FMSOCKCR 0xe6150014 34#define FMSOCKCR IOMEM(0xe6150014)
35#define FSICKCR 0xe6150018 35#define FSICKCR IOMEM(0xe6150018)
36#define PLLC1CR 0xe6150028 36#define PLLC1CR IOMEM(0xe6150028)
37#define PLLC2CR 0xe615002C 37#define PLLC2CR IOMEM(0xe615002C)
38#define SUBUSBCKCR 0xe6150080 38#define SUBUSBCKCR IOMEM(0xe6150080)
39#define SPUCKCR 0xe6150084 39#define SPUCKCR IOMEM(0xe6150084)
40#define MSUCKCR 0xe6150088 40#define MSUCKCR IOMEM(0xe6150088)
41#define MVI3CKCR 0xe6150090 41#define MVI3CKCR IOMEM(0xe6150090)
42#define HDMICKCR 0xe6150094 42#define HDMICKCR IOMEM(0xe6150094)
43#define MFCK1CR 0xe6150098 43#define MFCK1CR IOMEM(0xe6150098)
44#define MFCK2CR 0xe615009C 44#define MFCK2CR IOMEM(0xe615009C)
45#define DSITCKCR 0xe6150060 45#define DSITCKCR IOMEM(0xe6150060)
46#define DSIPCKCR 0xe6150064 46#define DSIPCKCR IOMEM(0xe6150064)
47#define SMSTPCR0 0xe6150130 47#define SMSTPCR0 IOMEM(0xe6150130)
48#define SMSTPCR1 0xe6150134 48#define SMSTPCR1 IOMEM(0xe6150134)
49#define SMSTPCR2 0xe6150138 49#define SMSTPCR2 IOMEM(0xe6150138)
50#define SMSTPCR3 0xe615013C 50#define SMSTPCR3 IOMEM(0xe615013C)
51#define SMSTPCR4 0xe6150140 51#define SMSTPCR4 IOMEM(0xe6150140)
52 52
53/* Fixed 32 KHz root clock from EXTALR pin */ 53/* Fixed 32 KHz root clock from EXTALR pin */
54static struct clk r_clk = { 54static struct clk r_clk = {
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 7f8da18a858..516ff7f3e43 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -23,43 +23,43 @@
23#include <linux/clkdev.h> 23#include <linux/clkdev.h>
24#include <mach/common.h> 24#include <mach/common.h>
25 25
26#define FRQCRA 0xe6150000 26#define FRQCRA IOMEM(0xe6150000)
27#define FRQCRB 0xe6150004 27#define FRQCRB IOMEM(0xe6150004)
28#define FRQCRD 0xe61500e4 28#define FRQCRD IOMEM(0xe61500e4)
29#define VCLKCR1 0xe6150008 29#define VCLKCR1 IOMEM(0xe6150008)
30#define VCLKCR2 0xe615000C 30#define VCLKCR2 IOMEM(0xe615000C)
31#define VCLKCR3 0xe615001C 31#define VCLKCR3 IOMEM(0xe615001C)
32#define ZBCKCR 0xe6150010 32#define ZBCKCR IOMEM(0xe6150010)
33#define FLCKCR 0xe6150014 33#define FLCKCR IOMEM(0xe6150014)
34#define SD0CKCR 0xe6150074 34#define SD0CKCR IOMEM(0xe6150074)
35#define SD1CKCR 0xe6150078 35#define SD1CKCR IOMEM(0xe6150078)
36#define SD2CKCR 0xe615007C 36#define SD2CKCR IOMEM(0xe615007C)
37#define FSIACKCR 0xe6150018 37#define FSIACKCR IOMEM(0xe6150018)
38#define FSIBCKCR 0xe6150090 38#define FSIBCKCR IOMEM(0xe6150090)
39#define SUBCKCR 0xe6150080 39#define SUBCKCR IOMEM(0xe6150080)
40#define SPUACKCR 0xe6150084 40#define SPUACKCR IOMEM(0xe6150084)
41#define SPUVCKCR 0xe6150094 41#define SPUVCKCR IOMEM(0xe6150094)
42#define MSUCKCR 0xe6150088 42#define MSUCKCR IOMEM(0xe6150088)
43#define HSICKCR 0xe615008C 43#define HSICKCR IOMEM(0xe615008C)
44#define MFCK1CR 0xe6150098 44#define MFCK1CR IOMEM(0xe6150098)
45#define MFCK2CR 0xe615009C 45#define MFCK2CR IOMEM(0xe615009C)
46#define DSITCKCR 0xe6150060 46#define DSITCKCR IOMEM(0xe6150060)
47#define DSI0PCKCR 0xe6150064 47#define DSI0PCKCR IOMEM(0xe6150064)
48#define DSI1PCKCR 0xe6150068 48#define DSI1PCKCR IOMEM(0xe6150068)
49#define DSI0PHYCR 0xe615006C 49#define DSI0PHYCR 0xe615006C
50#define DSI1PHYCR 0xe6150070 50#define DSI1PHYCR 0xe6150070
51#define PLLECR 0xe61500d0 51#define PLLECR IOMEM(0xe61500d0)
52#define PLL0CR 0xe61500d8 52#define PLL0CR IOMEM(0xe61500d8)
53#define PLL1CR 0xe6150028 53#define PLL1CR IOMEM(0xe6150028)
54#define PLL2CR 0xe615002c 54#define PLL2CR IOMEM(0xe615002c)
55#define PLL3CR 0xe61500dc 55#define PLL3CR IOMEM(0xe61500dc)
56#define SMSTPCR0 0xe6150130 56#define SMSTPCR0 IOMEM(0xe6150130)
57#define SMSTPCR1 0xe6150134 57#define SMSTPCR1 IOMEM(0xe6150134)
58#define SMSTPCR2 0xe6150138 58#define SMSTPCR2 IOMEM(0xe6150138)
59#define SMSTPCR3 0xe615013c 59#define SMSTPCR3 IOMEM(0xe615013c)
60#define SMSTPCR4 0xe6150140 60#define SMSTPCR4 IOMEM(0xe6150140)
61#define SMSTPCR5 0xe6150144 61#define SMSTPCR5 IOMEM(0xe6150144)
62#define CKSCR 0xe61500c0 62#define CKSCR IOMEM(0xe61500c0)
63 63
64/* Fixed 32 KHz root clock from EXTALR pin */ 64/* Fixed 32 KHz root clock from EXTALR pin */
65static struct clk r_clk = { 65static struct clk r_clk = {
diff --git a/arch/arm/mach-shmobile/common.c b/arch/arm/mach-shmobile/common.c
deleted file mode 100644
index 608aba9d60d..00000000000
--- a/arch/arm/mach-shmobile/common.c
+++ /dev/null
@@ -1,24 +0,0 @@
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 as published by
4 * the Free Software Foundation; version 2 of the License.
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 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
14 *
15 */
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <mach/common.h>
19
20void __init shmobile_init_late(void)
21{
22 shmobile_suspend_init();
23 shmobile_cpuidle_init();
24}
diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c
index 7b541e911ab..9e050268cde 100644
--- a/arch/arm/mach-shmobile/cpuidle.c
+++ b/arch/arm/mach-shmobile/cpuidle.c
@@ -16,51 +16,38 @@
16#include <asm/cpuidle.h> 16#include <asm/cpuidle.h>
17#include <asm/io.h> 17#include <asm/io.h>
18 18
19static void shmobile_enter_wfi(void) 19int shmobile_enter_wfi(struct cpuidle_device *dev, struct cpuidle_driver *drv,
20 int index)
20{ 21{
21 cpu_do_idle(); 22 cpu_do_idle();
22} 23 return 0;
23
24void (*shmobile_cpuidle_modes[CPUIDLE_STATE_MAX])(void) = {
25 shmobile_enter_wfi, /* regular sleep mode */
26};
27
28static int shmobile_cpuidle_enter(struct cpuidle_device *dev,
29 struct cpuidle_driver *drv,
30 int index)
31{
32 shmobile_cpuidle_modes[index]();
33
34 return index;
35} 24}
36 25
37static struct cpuidle_device shmobile_cpuidle_dev; 26static struct cpuidle_device shmobile_cpuidle_dev;
38static struct cpuidle_driver shmobile_cpuidle_driver = { 27static struct cpuidle_driver shmobile_cpuidle_default_driver = {
39 .name = "shmobile_cpuidle", 28 .name = "shmobile_cpuidle",
40 .owner = THIS_MODULE, 29 .owner = THIS_MODULE,
41 .en_core_tk_irqen = 1, 30 .en_core_tk_irqen = 1,
42 .states[0] = ARM_CPUIDLE_WFI_STATE, 31 .states[0] = ARM_CPUIDLE_WFI_STATE,
32 .states[0].enter = shmobile_enter_wfi,
43 .safe_state_index = 0, /* C1 */ 33 .safe_state_index = 0, /* C1 */
44 .state_count = 1, 34 .state_count = 1,
45}; 35};
46 36
47void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv); 37static struct cpuidle_driver *cpuidle_drv = &shmobile_cpuidle_default_driver;
38
39void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv)
40{
41 cpuidle_drv = drv;
42}
48 43
49int shmobile_cpuidle_init(void) 44int shmobile_cpuidle_init(void)
50{ 45{
51 struct cpuidle_device *dev = &shmobile_cpuidle_dev; 46 struct cpuidle_device *dev = &shmobile_cpuidle_dev;
52 struct cpuidle_driver *drv = &shmobile_cpuidle_driver;
53 int i;
54
55 for (i = 0; i < CPUIDLE_STATE_MAX; i++)
56 drv->states[i].enter = shmobile_cpuidle_enter;
57
58 if (shmobile_cpuidle_setup)
59 shmobile_cpuidle_setup(drv);
60 47
61 cpuidle_register_driver(drv); 48 cpuidle_register_driver(cpuidle_drv);
62 49
63 dev->state_count = drv->state_count; 50 dev->state_count = cpuidle_drv->state_count;
64 cpuidle_register_device(dev); 51 cpuidle_register_device(dev);
65 52
66 return 0; 53 return 0;
diff --git a/arch/arm/mach-shmobile/hotplug.c b/arch/arm/mach-shmobile/hotplug.c
index 828d22f3af5..b09a0bdbf81 100644
--- a/arch/arm/mach-shmobile/hotplug.c
+++ b/arch/arm/mach-shmobile/hotplug.c
@@ -14,30 +14,16 @@
14#include <linux/smp.h> 14#include <linux/smp.h>
15#include <linux/cpumask.h> 15#include <linux/cpumask.h>
16#include <linux/delay.h> 16#include <linux/delay.h>
17#include <linux/of.h>
17#include <mach/common.h> 18#include <mach/common.h>
19#include <mach/r8a7779.h>
20#include <mach/emev2.h>
18#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
22#include <asm/mach-types.h>
19 23
20static cpumask_t dead_cpus; 24static cpumask_t dead_cpus;
21 25
22int platform_cpu_kill(unsigned int cpu) 26void shmobile_cpu_die(unsigned int cpu)
23{
24 int k;
25
26 /* this function is running on another CPU than the offline target,
27 * here we need wait for shutdown code in platform_cpu_die() to
28 * finish before asking SoC-specific code to power off the CPU core.
29 */
30 for (k = 0; k < 1000; k++) {
31 if (cpumask_test_cpu(cpu, &dead_cpus))
32 return shmobile_platform_cpu_kill(cpu);
33
34 mdelay(1);
35 }
36
37 return 0;
38}
39
40void platform_cpu_die(unsigned int cpu)
41{ 27{
42 /* hardware shutdown code running on the CPU that is being offlined */ 28 /* hardware shutdown code running on the CPU that is being offlined */
43 flush_cache_all(); 29 flush_cache_all();
@@ -60,7 +46,7 @@ void platform_cpu_die(unsigned int cpu)
60 } 46 }
61} 47}
62 48
63int platform_cpu_disable(unsigned int cpu) 49int shmobile_cpu_disable(unsigned int cpu)
64{ 50{
65 cpumask_clear_cpu(cpu, &dead_cpus); 51 cpumask_clear_cpu(cpu, &dead_cpus);
66 /* 52 /*
@@ -69,3 +55,8 @@ int platform_cpu_disable(unsigned int cpu)
69 */ 55 */
70 return cpu == 0 ? -EPERM : 0; 56 return cpu == 0 ? -EPERM : 0;
71} 57}
58
59int shmobile_cpu_is_dead(unsigned int cpu)
60{
61 return cpumask_test_cpu(cpu, &dead_cpus);
62}
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index 45e61dada03..d47e215aca8 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -4,18 +4,19 @@
4extern void shmobile_earlytimer_init(void); 4extern void shmobile_earlytimer_init(void);
5extern struct sys_timer shmobile_timer; 5extern struct sys_timer shmobile_timer;
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;
9extern void shmobile_setup_console(void); 9extern void shmobile_setup_console(void);
10extern void shmobile_secondary_vector(void); 10extern void shmobile_secondary_vector(void);
11extern int shmobile_platform_cpu_kill(unsigned int cpu);
12struct clk; 11struct clk;
13extern int shmobile_clk_init(void); 12extern int shmobile_clk_init(void);
14extern void shmobile_handle_irq_intc(struct pt_regs *); 13extern void shmobile_handle_irq_intc(struct pt_regs *);
15extern struct platform_suspend_ops shmobile_suspend_ops; 14extern struct platform_suspend_ops shmobile_suspend_ops;
16struct cpuidle_driver; 15struct cpuidle_driver;
17extern void (*shmobile_cpuidle_modes[])(void); 16struct cpuidle_device;
18extern void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv); 17extern int shmobile_enter_wfi(struct cpuidle_device *dev,
18 struct cpuidle_driver *drv, int index);
19extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv);
19 20
20extern void sh7367_init_irq(void); 21extern void sh7367_init_irq(void);
21extern void sh7367_map_io(void); 22extern void sh7367_map_io(void);
@@ -58,11 +59,6 @@ extern struct clk sh73a0_extal2_clk;
58extern struct clk sh73a0_extcki_clk; 59extern struct clk sh73a0_extcki_clk;
59extern struct clk sh73a0_extalr_clk; 60extern struct clk sh73a0_extalr_clk;
60 61
61extern unsigned int sh73a0_get_core_count(void);
62extern void sh73a0_secondary_init(unsigned int cpu);
63extern int sh73a0_boot_secondary(unsigned int cpu);
64extern void sh73a0_smp_prepare_cpus(void);
65
66extern void r8a7740_init_irq(void); 62extern void r8a7740_init_irq(void);
67extern void r8a7740_map_io(void); 63extern void r8a7740_map_io(void);
68extern void r8a7740_add_early_devices(void); 64extern void r8a7740_add_early_devices(void);
@@ -79,15 +75,8 @@ extern void r8a7779_pinmux_init(void);
79extern void r8a7779_pm_init(void); 75extern void r8a7779_pm_init(void);
80extern void r8a7740_meram_workaround(void); 76extern void r8a7740_meram_workaround(void);
81 77
82extern unsigned int r8a7779_get_core_count(void);
83extern int r8a7779_platform_cpu_kill(unsigned int cpu);
84extern void r8a7779_secondary_init(unsigned int cpu);
85extern int r8a7779_boot_secondary(unsigned int cpu);
86extern void r8a7779_smp_prepare_cpus(void);
87extern void r8a7779_register_twd(void); 78extern void r8a7779_register_twd(void);
88 79
89extern void shmobile_init_late(void);
90
91#ifdef CONFIG_SUSPEND 80#ifdef CONFIG_SUSPEND
92int shmobile_suspend_init(void); 81int shmobile_suspend_init(void);
93#else 82#else
@@ -100,4 +89,21 @@ int shmobile_cpuidle_init(void);
100static inline int shmobile_cpuidle_init(void) { return 0; } 89static inline int shmobile_cpuidle_init(void) { return 0; }
101#endif 90#endif
102 91
92extern void shmobile_cpu_die(unsigned int cpu);
93extern int shmobile_cpu_disable(unsigned int cpu);
94
95#ifdef CONFIG_HOTPLUG_CPU
96extern int shmobile_cpu_is_dead(unsigned int cpu);
97#else
98static inline int shmobile_cpu_is_dead(unsigned int cpu) { return 1; }
99#endif
100
101extern void shmobile_smp_init_cpus(unsigned int ncores);
102
103static inline void __init shmobile_init_late(void)
104{
105 shmobile_suspend_init();
106 shmobile_cpuidle_init();
107}
108
103#endif /* __ARCH_MACH_COMMON_H */ 109#endif /* __ARCH_MACH_COMMON_H */
diff --git a/arch/arm/mach-shmobile/include/mach/emev2.h b/arch/arm/mach-shmobile/include/mach/emev2.h
index e6b0c1bf4b7..ac3751705ca 100644
--- a/arch/arm/mach-shmobile/include/mach/emev2.h
+++ b/arch/arm/mach-shmobile/include/mach/emev2.h
@@ -7,13 +7,10 @@ extern void emev2_add_early_devices(void);
7extern void emev2_add_standard_devices(void); 7extern void emev2_add_standard_devices(void);
8extern void emev2_clock_init(void); 8extern void emev2_clock_init(void);
9extern void emev2_set_boot_vector(unsigned long value); 9extern void emev2_set_boot_vector(unsigned long value);
10extern unsigned int emev2_get_core_count(void);
11extern int emev2_platform_cpu_kill(unsigned int cpu);
12extern void emev2_secondary_init(unsigned int cpu);
13extern int emev2_boot_secondary(unsigned int cpu);
14extern void emev2_smp_prepare_cpus(void);
15 10
16#define EMEV2_GPIO_BASE 200 11#define EMEV2_GPIO_BASE 200
17#define EMEV2_GPIO_IRQ(n) (EMEV2_GPIO_BASE + (n)) 12#define EMEV2_GPIO_IRQ(n) (EMEV2_GPIO_BASE + (n))
18 13
14extern struct smp_operations emev2_smp_ops;
15
19#endif /* __ASM_EMEV2_H__ */ 16#endif /* __ASM_EMEV2_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/pm-rmobile.h b/arch/arm/mach-shmobile/include/mach/pm-rmobile.h
index 5a402840fe2..690553a0688 100644
--- a/arch/arm/mach-shmobile/include/mach/pm-rmobile.h
+++ b/arch/arm/mach-shmobile/include/mach/pm-rmobile.h
@@ -12,6 +12,8 @@
12 12
13#include <linux/pm_domain.h> 13#include <linux/pm_domain.h>
14 14
15#define DEFAULT_DEV_LATENCY_NS 250000
16
15struct platform_device; 17struct platform_device;
16 18
17struct rmobile_pm_domain { 19struct rmobile_pm_domain {
@@ -29,16 +31,33 @@ struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d)
29 return container_of(d, struct rmobile_pm_domain, genpd); 31 return container_of(d, struct rmobile_pm_domain, genpd);
30} 32}
31 33
34struct pm_domain_device {
35 const char *domain_name;
36 struct platform_device *pdev;
37};
38
32#ifdef CONFIG_PM 39#ifdef CONFIG_PM
33extern void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd); 40extern void rmobile_init_domains(struct rmobile_pm_domain domains[], int num);
34extern void rmobile_add_device_to_domain(struct rmobile_pm_domain *rmobile_pd, 41extern void rmobile_add_device_to_domain_td(const char *domain_name,
35 struct platform_device *pdev); 42 struct platform_device *pdev,
36extern void rmobile_pm_add_subdomain(struct rmobile_pm_domain *rmobile_pd, 43 struct gpd_timing_data *td);
37 struct rmobile_pm_domain *rmobile_sd); 44
45static inline void rmobile_add_device_to_domain(const char *domain_name,
46 struct platform_device *pdev)
47{
48 rmobile_add_device_to_domain_td(domain_name, pdev, NULL);
49}
50
51extern void rmobile_add_devices_to_domains(struct pm_domain_device data[],
52 int size);
38#else 53#else
39#define rmobile_init_pm_domain(pd) do { } while (0) 54
40#define rmobile_add_device_to_domain(pd, pdev) do { } while (0) 55#define rmobile_init_domains(domains, num) do { } while (0)
41#define rmobile_pm_add_subdomain(pd, sd) do { } while (0) 56#define rmobile_add_device_to_domain_td(name, pdev, td) do { } while (0)
57#define rmobile_add_device_to_domain(name, pdev) do { } while (0)
58
59static inline void rmobile_add_devices_to_domains(struct pm_domain_device d[],
60 int size) {}
42#endif /* CONFIG_PM */ 61#endif /* CONFIG_PM */
43 62
44#endif /* PM_RMOBILE_H */ 63#endif /* PM_RMOBILE_H */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7740.h b/arch/arm/mach-shmobile/include/mach/r8a7740.h
index 7143147780d..59d252f4cf9 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7740.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7740.h
@@ -607,9 +607,9 @@ enum {
607}; 607};
608 608
609#ifdef CONFIG_PM 609#ifdef CONFIG_PM
610extern struct rmobile_pm_domain r8a7740_pd_a4s; 610extern void __init r8a7740_init_pm_domains(void);
611extern struct rmobile_pm_domain r8a7740_pd_a3sp; 611#else
612extern struct rmobile_pm_domain r8a7740_pd_a4lc; 612static inline void r8a7740_init_pm_domains(void) {}
613#endif /* CONFIG_PM */ 613#endif /* CONFIG_PM */
614 614
615#endif /* __ASM_R8A7740_H__ */ 615#endif /* __ASM_R8A7740_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index b07ad318eb2..499f52d2a4a 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -347,17 +347,11 @@ extern int r8a7779_sysc_power_down(struct r8a7779_pm_ch *r8a7779_ch);
347extern int r8a7779_sysc_power_up(struct r8a7779_pm_ch *r8a7779_ch); 347extern int r8a7779_sysc_power_up(struct r8a7779_pm_ch *r8a7779_ch);
348 348
349#ifdef CONFIG_PM 349#ifdef CONFIG_PM
350extern struct r8a7779_pm_domain r8a7779_sh4a; 350extern void __init r8a7779_init_pm_domains(void);
351extern struct r8a7779_pm_domain r8a7779_sgx;
352extern struct r8a7779_pm_domain r8a7779_vdp1;
353extern struct r8a7779_pm_domain r8a7779_impx3;
354
355extern void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd);
356extern void r8a7779_add_device_to_domain(struct r8a7779_pm_domain *r8a7779_pd,
357 struct platform_device *pdev);
358#else 351#else
359#define r8a7779_init_pm_domain(pd) do { } while (0) 352static inline void r8a7779_init_pm_domains(void) {}
360#define r8a7779_add_device_to_domain(pd, pdev) do { } while (0)
361#endif /* CONFIG_PM */ 353#endif /* CONFIG_PM */
362 354
355extern struct smp_operations r8a7779_smp_ops;
356
363#endif /* __ASM_R8A7779_H__ */ 357#endif /* __ASM_R8A7779_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
index b59048e6d8f..eb98b45c508 100644
--- a/arch/arm/mach-shmobile/include/mach/sh7372.h
+++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -478,21 +478,17 @@ extern struct clk sh7372_fsibck_clk;
478extern struct clk sh7372_fsidiva_clk; 478extern struct clk sh7372_fsidiva_clk;
479extern struct clk sh7372_fsidivb_clk; 479extern struct clk sh7372_fsidivb_clk;
480 480
481#ifdef CONFIG_PM
482extern struct rmobile_pm_domain sh7372_pd_a4lc;
483extern struct rmobile_pm_domain sh7372_pd_a4mp;
484extern struct rmobile_pm_domain sh7372_pd_d4;
485extern struct rmobile_pm_domain sh7372_pd_a4r;
486extern struct rmobile_pm_domain sh7372_pd_a3rv;
487extern struct rmobile_pm_domain sh7372_pd_a3ri;
488extern struct rmobile_pm_domain sh7372_pd_a4s;
489extern struct rmobile_pm_domain sh7372_pd_a3sp;
490extern struct rmobile_pm_domain sh7372_pd_a3sg;
491#endif /* CONFIG_PM */
492
493extern void sh7372_intcs_suspend(void); 481extern void sh7372_intcs_suspend(void);
494extern void sh7372_intcs_resume(void); 482extern void sh7372_intcs_resume(void);
495extern void sh7372_intca_suspend(void); 483extern void sh7372_intca_suspend(void);
496extern void sh7372_intca_resume(void); 484extern void sh7372_intca_resume(void);
497 485
486#ifdef CONFIG_PM
487extern void __init sh7372_init_pm_domains(void);
488#else
489static inline void sh7372_init_pm_domains(void) {}
490#endif
491
492extern void __init sh7372_pm_init_late(void);
493
498#endif /* __ASM_SH7372_H__ */ 494#endif /* __ASM_SH7372_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
index fe950f25d79..606d31d02a4 100644
--- a/arch/arm/mach-shmobile/include/mach/sh73a0.h
+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
@@ -557,4 +557,6 @@ enum {
557#define SH73A0_PINT0_IRQ(irq) ((irq) + 700) 557#define SH73A0_PINT0_IRQ(irq) ((irq) + 700)
558#define SH73A0_PINT1_IRQ(irq) ((irq) + 732) 558#define SH73A0_PINT1_IRQ(irq) ((irq) + 732)
559 559
560extern struct smp_operations sh73a0_smp_ops;
561
560#endif /* __ASM_SH73A0_H__ */ 562#endif /* __ASM_SH73A0_H__ */
diff --git a/arch/arm/mach-shmobile/intc-r8a7779.c b/arch/arm/mach-shmobile/intc-r8a7779.c
index f04fad4ec4f..ef66f1a8aa2 100644
--- a/arch/arm/mach-shmobile/intc-r8a7779.c
+++ b/arch/arm/mach-shmobile/intc-r8a7779.c
@@ -29,14 +29,14 @@
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
32#define INT2SMSKCR0 0xfe7822a0 32#define INT2SMSKCR0 IOMEM(0xfe7822a0)
33#define INT2SMSKCR1 0xfe7822a4 33#define INT2SMSKCR1 IOMEM(0xfe7822a4)
34#define INT2SMSKCR2 0xfe7822a8 34#define INT2SMSKCR2 IOMEM(0xfe7822a8)
35#define INT2SMSKCR3 0xfe7822ac 35#define INT2SMSKCR3 IOMEM(0xfe7822ac)
36#define INT2SMSKCR4 0xfe7822b0 36#define INT2SMSKCR4 IOMEM(0xfe7822b0)
37 37
38#define INT2NTSR0 0xfe700060 38#define INT2NTSR0 IOMEM(0xfe700060)
39#define INT2NTSR1 0xfe700064 39#define INT2NTSR1 IOMEM(0xfe700064)
40 40
41static int r8a7779_set_wake(struct irq_data *data, unsigned int on) 41static int r8a7779_set_wake(struct irq_data *data, unsigned int on)
42{ 42{
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c
index 2587a22842f..a91caad7db7 100644
--- a/arch/arm/mach-shmobile/intc-sh7372.c
+++ b/arch/arm/mach-shmobile/intc-sh7372.c
@@ -624,6 +624,9 @@ void sh7372_intcs_resume(void)
624 __raw_writeb(ffd5[k], intcs_ffd5 + k); 624 __raw_writeb(ffd5[k], intcs_ffd5 + k);
625} 625}
626 626
627#define E694_BASE IOMEM(0xe6940000)
628#define E695_BASE IOMEM(0xe6950000)
629
627static unsigned short e694[0x200]; 630static unsigned short e694[0x200];
628static unsigned short e695[0x200]; 631static unsigned short e695[0x200];
629 632
@@ -632,22 +635,22 @@ void sh7372_intca_suspend(void)
632 int k; 635 int k;
633 636
634 for (k = 0x00; k <= 0x38; k += 4) 637 for (k = 0x00; k <= 0x38; k += 4)
635 e694[k] = __raw_readw(0xe6940000 + k); 638 e694[k] = __raw_readw(E694_BASE + k);
636 639
637 for (k = 0x80; k <= 0xb4; k += 4) 640 for (k = 0x80; k <= 0xb4; k += 4)
638 e694[k] = __raw_readb(0xe6940000 + k); 641 e694[k] = __raw_readb(E694_BASE + k);
639 642
640 for (k = 0x180; k <= 0x1b4; k += 4) 643 for (k = 0x180; k <= 0x1b4; k += 4)
641 e694[k] = __raw_readb(0xe6940000 + k); 644 e694[k] = __raw_readb(E694_BASE + k);
642 645
643 for (k = 0x00; k <= 0x50; k += 4) 646 for (k = 0x00; k <= 0x50; k += 4)
644 e695[k] = __raw_readw(0xe6950000 + k); 647 e695[k] = __raw_readw(E695_BASE + k);
645 648
646 for (k = 0x80; k <= 0xa8; k += 4) 649 for (k = 0x80; k <= 0xa8; k += 4)
647 e695[k] = __raw_readb(0xe6950000 + k); 650 e695[k] = __raw_readb(E695_BASE + k);
648 651
649 for (k = 0x180; k <= 0x1a8; k += 4) 652 for (k = 0x180; k <= 0x1a8; k += 4)
650 e695[k] = __raw_readb(0xe6950000 + k); 653 e695[k] = __raw_readb(E695_BASE + k);
651} 654}
652 655
653void sh7372_intca_resume(void) 656void sh7372_intca_resume(void)
@@ -655,20 +658,20 @@ void sh7372_intca_resume(void)
655 int k; 658 int k;
656 659
657 for (k = 0x00; k <= 0x38; k += 4) 660 for (k = 0x00; k <= 0x38; k += 4)
658 __raw_writew(e694[k], 0xe6940000 + k); 661 __raw_writew(e694[k], E694_BASE + k);
659 662
660 for (k = 0x80; k <= 0xb4; k += 4) 663 for (k = 0x80; k <= 0xb4; k += 4)
661 __raw_writeb(e694[k], 0xe6940000 + k); 664 __raw_writeb(e694[k], E694_BASE + k);
662 665
663 for (k = 0x180; k <= 0x1b4; k += 4) 666 for (k = 0x180; k <= 0x1b4; k += 4)
664 __raw_writeb(e694[k], 0xe6940000 + k); 667 __raw_writeb(e694[k], E694_BASE + k);
665 668
666 for (k = 0x00; k <= 0x50; k += 4) 669 for (k = 0x00; k <= 0x50; k += 4)
667 __raw_writew(e695[k], 0xe6950000 + k); 670 __raw_writew(e695[k], E695_BASE + k);
668 671
669 for (k = 0x80; k <= 0xa8; k += 4) 672 for (k = 0x80; k <= 0xa8; k += 4)
670 __raw_writeb(e695[k], 0xe6950000 + k); 673 __raw_writeb(e695[k], E695_BASE + k);
671 674
672 for (k = 0x180; k <= 0x1a8; k += 4) 675 for (k = 0x180; k <= 0x1a8; k += 4)
673 __raw_writeb(e695[k], 0xe6950000 + k); 676 __raw_writeb(e695[k], E695_BASE + k);
674} 677}
diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c
index 588555a67d9..f0c5e519060 100644
--- a/arch/arm/mach-shmobile/intc-sh73a0.c
+++ b/arch/arm/mach-shmobile/intc-sh73a0.c
@@ -366,10 +366,12 @@ static irqreturn_t sh73a0_irq_pin_demux(int irq, void *dev_id)
366 366
367static struct irqaction sh73a0_irq_pin_cascade[32]; 367static struct irqaction sh73a0_irq_pin_cascade[32];
368 368
369#define PINTER0 0xe69000a0 369#define PINTER0_PHYS 0xe69000a0
370#define PINTER1 0xe69000a4 370#define PINTER1_PHYS 0xe69000a4
371#define PINTRR0 0xe69000d0 371#define PINTER0_VIRT IOMEM(0xe69000a0)
372#define PINTRR1 0xe69000d4 372#define PINTER1_VIRT IOMEM(0xe69000a4)
373#define PINTRR0 IOMEM(0xe69000d0)
374#define PINTRR1 IOMEM(0xe69000d4)
373 375
374#define PINT0A_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq)) 376#define PINT0A_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq))
375#define PINT0B_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 8)) 377#define PINT0B_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 8))
@@ -377,14 +379,14 @@ static struct irqaction sh73a0_irq_pin_cascade[32];
377#define PINT0D_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 24)) 379#define PINT0D_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 24))
378#define PINT1E_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT1_IRQ(irq)) 380#define PINT1E_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT1_IRQ(irq))
379 381
380INTC_PINT(intc_pint0, PINTER0, 0xe69000b0, "sh73a0-pint0", \ 382INTC_PINT(intc_pint0, PINTER0_PHYS, 0xe69000b0, "sh73a0-pint0", \
381 INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D), \ 383 INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D), \
382 INTC_PINT_V(A, PINT0A_IRQ), INTC_PINT_V(B, PINT0B_IRQ), \ 384 INTC_PINT_V(A, PINT0A_IRQ), INTC_PINT_V(B, PINT0B_IRQ), \
383 INTC_PINT_V(C, PINT0C_IRQ), INTC_PINT_V(D, PINT0D_IRQ), \ 385 INTC_PINT_V(C, PINT0C_IRQ), INTC_PINT_V(D, PINT0D_IRQ), \
384 INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D), \ 386 INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D), \
385 INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D)); 387 INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D));
386 388
387INTC_PINT(intc_pint1, PINTER1, 0xe69000c0, "sh73a0-pint1", \ 389INTC_PINT(intc_pint1, PINTER1_PHYS, 0xe69000c0, "sh73a0-pint1", \
388 INTC_PINT_E(E), INTC_PINT_E_EMPTY, INTC_PINT_E_EMPTY, INTC_PINT_E_EMPTY, \ 390 INTC_PINT_E(E), INTC_PINT_E_EMPTY, INTC_PINT_E_EMPTY, INTC_PINT_E_EMPTY, \
389 INTC_PINT_V(E, PINT1E_IRQ), INTC_PINT_V_NONE, \ 391 INTC_PINT_V(E, PINT1E_IRQ), INTC_PINT_V_NONE, \
390 INTC_PINT_V_NONE, INTC_PINT_V_NONE, \ 392 INTC_PINT_V_NONE, INTC_PINT_V_NONE, \
@@ -394,7 +396,7 @@ INTC_PINT(intc_pint1, PINTER1, 0xe69000c0, "sh73a0-pint1", \
394static struct irqaction sh73a0_pint0_cascade; 396static struct irqaction sh73a0_pint0_cascade;
395static struct irqaction sh73a0_pint1_cascade; 397static struct irqaction sh73a0_pint1_cascade;
396 398
397static void pint_demux(unsigned long rr, unsigned long er, int base_irq) 399static void pint_demux(void __iomem *rr, void __iomem *er, int base_irq)
398{ 400{
399 unsigned long value = ioread32(rr) & ioread32(er); 401 unsigned long value = ioread32(rr) & ioread32(er);
400 int k; 402 int k;
@@ -409,13 +411,13 @@ static void pint_demux(unsigned long rr, unsigned long er, int base_irq)
409 411
410static irqreturn_t sh73a0_pint0_demux(int irq, void *dev_id) 412static irqreturn_t sh73a0_pint0_demux(int irq, void *dev_id)
411{ 413{
412 pint_demux(PINTRR0, PINTER0, SH73A0_PINT0_IRQ(0)); 414 pint_demux(PINTRR0, PINTER0_VIRT, SH73A0_PINT0_IRQ(0));
413 return IRQ_HANDLED; 415 return IRQ_HANDLED;
414} 416}
415 417
416static irqreturn_t sh73a0_pint1_demux(int irq, void *dev_id) 418static irqreturn_t sh73a0_pint1_demux(int irq, void *dev_id)
417{ 419{
418 pint_demux(PINTRR1, PINTER1, SH73A0_PINT1_IRQ(0)); 420 pint_demux(PINTRR1, PINTER1_VIRT, SH73A0_PINT1_IRQ(0));
419 return IRQ_HANDLED; 421 return IRQ_HANDLED;
420} 422}
421 423
diff --git a/arch/arm/mach-shmobile/pfc-r8a7740.c b/arch/arm/mach-shmobile/pfc-r8a7740.c
index ce9e7fa5cc8..134d1b9a882 100644
--- a/arch/arm/mach-shmobile/pfc-r8a7740.c
+++ b/arch/arm/mach-shmobile/pfc-r8a7740.c
@@ -20,7 +20,7 @@
20 */ 20 */
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/gpio.h> 23#include <linux/sh_pfc.h>
24#include <mach/r8a7740.h> 24#include <mach/r8a7740.h>
25#include <mach/irqs.h> 25#include <mach/irqs.h>
26 26
diff --git a/arch/arm/mach-shmobile/pfc-r8a7779.c b/arch/arm/mach-shmobile/pfc-r8a7779.c
index d14c9b04807..cbc26ba2a0a 100644
--- a/arch/arm/mach-shmobile/pfc-r8a7779.c
+++ b/arch/arm/mach-shmobile/pfc-r8a7779.c
@@ -19,7 +19,7 @@
19 */ 19 */
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/gpio.h> 22#include <linux/sh_pfc.h>
23#include <linux/ioport.h> 23#include <linux/ioport.h>
24#include <mach/r8a7779.h> 24#include <mach/r8a7779.h>
25 25
diff --git a/arch/arm/mach-shmobile/pfc-sh7367.c b/arch/arm/mach-shmobile/pfc-sh7367.c
index e6e524654e6..c0c137f3905 100644
--- a/arch/arm/mach-shmobile/pfc-sh7367.c
+++ b/arch/arm/mach-shmobile/pfc-sh7367.c
@@ -18,7 +18,7 @@
18 */ 18 */
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/gpio.h> 21#include <linux/sh_pfc.h>
22#include <mach/sh7367.h> 22#include <mach/sh7367.h>
23 23
24#define CPU_ALL_PORT(fn, pfx, sfx) \ 24#define CPU_ALL_PORT(fn, pfx, sfx) \
diff --git a/arch/arm/mach-shmobile/pfc-sh7372.c b/arch/arm/mach-shmobile/pfc-sh7372.c
index 336093f9210..7a1525fd6ad 100644
--- a/arch/arm/mach-shmobile/pfc-sh7372.c
+++ b/arch/arm/mach-shmobile/pfc-sh7372.c
@@ -22,7 +22,7 @@
22 */ 22 */
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25#include <linux/gpio.h> 25#include <linux/sh_pfc.h>
26#include <mach/irqs.h> 26#include <mach/irqs.h>
27#include <mach/sh7372.h> 27#include <mach/sh7372.h>
28 28
diff --git a/arch/arm/mach-shmobile/pfc-sh7377.c b/arch/arm/mach-shmobile/pfc-sh7377.c
index 2f10511946a..f3117f67fa2 100644
--- a/arch/arm/mach-shmobile/pfc-sh7377.c
+++ b/arch/arm/mach-shmobile/pfc-sh7377.c
@@ -19,7 +19,7 @@
19 */ 19 */
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/gpio.h> 22#include <linux/sh_pfc.h>
23#include <mach/sh7377.h> 23#include <mach/sh7377.h>
24 24
25#define CPU_ALL_PORT(fn, pfx, sfx) \ 25#define CPU_ALL_PORT(fn, pfx, sfx) \
diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c
index 4a547b80326..b442f9d8c71 100644
--- a/arch/arm/mach-shmobile/pfc-sh73a0.c
+++ b/arch/arm/mach-shmobile/pfc-sh73a0.c
@@ -20,7 +20,7 @@
20 */ 20 */
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/gpio.h> 23#include <linux/sh_pfc.h>
24#include <mach/sh73a0.h> 24#include <mach/sh73a0.h>
25#include <mach/irqs.h> 25#include <mach/irqs.h>
26 26
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
index fde0d23121d..ed8d2351915 100644
--- a/arch/arm/mach-shmobile/platsmp.c
+++ b/arch/arm/mach-shmobile/platsmp.c
@@ -11,100 +11,11 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/errno.h>
15#include <linux/delay.h>
16#include <linux/device.h>
17#include <linux/smp.h> 14#include <linux/smp.h>
18#include <linux/io.h>
19#include <linux/of.h>
20#include <asm/hardware/gic.h> 15#include <asm/hardware/gic.h>
21#include <asm/mach-types.h>
22#include <mach/common.h>
23#include <mach/emev2.h>
24 16
25#ifdef CONFIG_ARCH_SH73A0 17void __init shmobile_smp_init_cpus(unsigned int ncores)
26#define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2() || \
27 of_machine_is_compatible("renesas,sh73a0"))
28#else
29#define is_sh73a0() (0)
30#endif
31
32#define is_r8a7779() machine_is_marzen()
33
34#ifdef CONFIG_ARCH_EMEV2
35#define is_emev2() of_machine_is_compatible("renesas,emev2")
36#else
37#define is_emev2() (0)
38#endif
39
40static unsigned int __init shmobile_smp_get_core_count(void)
41{
42 if (is_sh73a0())
43 return sh73a0_get_core_count();
44
45 if (is_r8a7779())
46 return r8a7779_get_core_count();
47
48 if (is_emev2())
49 return emev2_get_core_count();
50
51 return 1;
52}
53
54static void __init shmobile_smp_prepare_cpus(void)
55{
56 if (is_sh73a0())
57 sh73a0_smp_prepare_cpus();
58
59 if (is_r8a7779())
60 r8a7779_smp_prepare_cpus();
61
62 if (is_emev2())
63 emev2_smp_prepare_cpus();
64}
65
66int shmobile_platform_cpu_kill(unsigned int cpu)
67{
68 if (is_r8a7779())
69 return r8a7779_platform_cpu_kill(cpu);
70
71 if (is_emev2())
72 return emev2_platform_cpu_kill(cpu);
73
74 return 1;
75}
76
77void __cpuinit platform_secondary_init(unsigned int cpu)
78{ 18{
79 trace_hardirqs_off();
80
81 if (is_sh73a0())
82 sh73a0_secondary_init(cpu);
83
84 if (is_r8a7779())
85 r8a7779_secondary_init(cpu);
86
87 if (is_emev2())
88 emev2_secondary_init(cpu);
89}
90
91int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
92{
93 if (is_sh73a0())
94 return sh73a0_boot_secondary(cpu);
95
96 if (is_r8a7779())
97 return r8a7779_boot_secondary(cpu);
98
99 if (is_emev2())
100 return emev2_boot_secondary(cpu);
101
102 return -ENOSYS;
103}
104
105void __init smp_init_cpus(void)
106{
107 unsigned int ncores = shmobile_smp_get_core_count();
108 unsigned int i; 19 unsigned int i;
109 20
110 if (ncores > nr_cpu_ids) { 21 if (ncores > nr_cpu_ids) {
@@ -118,8 +29,3 @@ void __init smp_init_cpus(void)
118 29
119 set_smp_cross_call(gic_raise_softirq); 30 set_smp_cross_call(gic_raise_softirq);
120} 31}
121
122void __init platform_smp_prepare_cpus(unsigned int max_cpus)
123{
124 shmobile_smp_prepare_cpus();
125}
diff --git a/arch/arm/mach-shmobile/pm-r8a7740.c b/arch/arm/mach-shmobile/pm-r8a7740.c
index 893504d012a..21e5316d2d8 100644
--- a/arch/arm/mach-shmobile/pm-r8a7740.c
+++ b/arch/arm/mach-shmobile/pm-r8a7740.c
@@ -21,14 +21,6 @@ static int r8a7740_pd_a4s_suspend(void)
21 return -EBUSY; 21 return -EBUSY;
22} 22}
23 23
24struct rmobile_pm_domain r8a7740_pd_a4s = {
25 .genpd.name = "A4S",
26 .bit_shift = 10,
27 .gov = &pm_domain_always_on_gov,
28 .no_debug = true,
29 .suspend = r8a7740_pd_a4s_suspend,
30};
31
32static int r8a7740_pd_a3sp_suspend(void) 24static int r8a7740_pd_a3sp_suspend(void)
33{ 25{
34 /* 26 /*
@@ -38,17 +30,31 @@ static int r8a7740_pd_a3sp_suspend(void)
38 return console_suspend_enabled ? 0 : -EBUSY; 30 return console_suspend_enabled ? 0 : -EBUSY;
39} 31}
40 32
41struct rmobile_pm_domain r8a7740_pd_a3sp = { 33static struct rmobile_pm_domain r8a7740_pm_domains[] = {
42 .genpd.name = "A3SP", 34 {
43 .bit_shift = 11, 35 .genpd.name = "A4S",
44 .gov = &pm_domain_always_on_gov, 36 .bit_shift = 10,
45 .no_debug = true, 37 .gov = &pm_domain_always_on_gov,
46 .suspend = r8a7740_pd_a3sp_suspend, 38 .no_debug = true,
39 .suspend = r8a7740_pd_a4s_suspend,
40 },
41 {
42 .genpd.name = "A3SP",
43 .bit_shift = 11,
44 .gov = &pm_domain_always_on_gov,
45 .no_debug = true,
46 .suspend = r8a7740_pd_a3sp_suspend,
47 },
48 {
49 .genpd.name = "A4LC",
50 .bit_shift = 1,
51 },
47}; 52};
48 53
49struct rmobile_pm_domain r8a7740_pd_a4lc = { 54void __init r8a7740_init_pm_domains(void)
50 .genpd.name = "A4LC", 55{
51 .bit_shift = 1, 56 rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
52}; 57 pm_genpd_add_subdomain_names("A4S", "A3SP");
58}
53 59
54#endif /* CONFIG_PM */ 60#endif /* CONFIG_PM */
diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c
index a18a4ae16d2..d50a8e9b94a 100644
--- a/arch/arm/mach-shmobile/pm-r8a7779.c
+++ b/arch/arm/mach-shmobile/pm-r8a7779.c
@@ -183,7 +183,7 @@ static bool pd_active_wakeup(struct device *dev)
183 return true; 183 return true;
184} 184}
185 185
186void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd) 186static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
187{ 187{
188 struct generic_pm_domain *genpd = &r8a7779_pd->genpd; 188 struct generic_pm_domain *genpd = &r8a7779_pd->genpd;
189 189
@@ -199,43 +199,44 @@ void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
199 pd_power_up(&r8a7779_pd->genpd); 199 pd_power_up(&r8a7779_pd->genpd);
200} 200}
201 201
202void r8a7779_add_device_to_domain(struct r8a7779_pm_domain *r8a7779_pd, 202static struct r8a7779_pm_domain r8a7779_pm_domains[] = {
203 struct platform_device *pdev) 203 {
204{ 204 .genpd.name = "SH4A",
205 struct device *dev = &pdev->dev; 205 .ch = {
206 206 .chan_offs = 0x80, /* PWRSR1 .. PWRER1 */
207 pm_genpd_add_device(&r8a7779_pd->genpd, dev); 207 .isr_bit = 16, /* SH4A */
208 if (pm_clk_no_clocks(dev)) 208 },
209 pm_clk_add(dev, NULL); 209 },
210} 210 {
211 211 .genpd.name = "SGX",
212struct r8a7779_pm_domain r8a7779_sh4a = { 212 .ch = {
213 .ch = { 213 .chan_offs = 0xc0, /* PWRSR2 .. PWRER2 */
214 .chan_offs = 0x80, /* PWRSR1 .. PWRER1 */ 214 .isr_bit = 20, /* SGX */
215 .isr_bit = 16, /* SH4A */ 215 },
216 } 216 },
217}; 217 {
218 218 .genpd.name = "VDP1",
219struct r8a7779_pm_domain r8a7779_sgx = { 219 .ch = {
220 .ch = { 220 .chan_offs = 0x100, /* PWRSR3 .. PWRER3 */
221 .chan_offs = 0xc0, /* PWRSR2 .. PWRER2 */ 221 .isr_bit = 21, /* VDP */
222 .isr_bit = 20, /* SGX */ 222 },
223 } 223 },
224 {
225 .genpd.name = "IMPX3",
226 .ch = {
227 .chan_offs = 0x140, /* PWRSR4 .. PWRER4 */
228 .isr_bit = 24, /* IMP */
229 },
230 },
224}; 231};
225 232
226struct r8a7779_pm_domain r8a7779_vdp1 = { 233void __init r8a7779_init_pm_domains(void)
227 .ch = { 234{
228 .chan_offs = 0x100, /* PWRSR3 .. PWRER3 */ 235 int j;
229 .isr_bit = 21, /* VDP */
230 }
231};
232 236
233struct r8a7779_pm_domain r8a7779_impx3 = { 237 for (j = 0; j < ARRAY_SIZE(r8a7779_pm_domains); j++)
234 .ch = { 238 r8a7779_init_pm_domain(&r8a7779_pm_domains[j]);
235 .chan_offs = 0x140, /* PWRSR4 .. PWRER4 */ 239}
236 .isr_bit = 24, /* IMP */
237 }
238};
239 240
240#endif /* CONFIG_PM */ 241#endif /* CONFIG_PM */
241 242
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
index a8562540f1d..1fc05d9453d 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -20,9 +20,9 @@
20#include <mach/pm-rmobile.h> 20#include <mach/pm-rmobile.h>
21 21
22/* SYSC */ 22/* SYSC */
23#define SPDCR 0xe6180008 23#define SPDCR IOMEM(0xe6180008)
24#define SWUCR 0xe6180014 24#define SWUCR IOMEM(0xe6180014)
25#define PSTR 0xe6180080 25#define PSTR IOMEM(0xe6180080)
26 26
27#define PSTR_RETRIES 100 27#define PSTR_RETRIES 100
28#define PSTR_DELAY_US 10 28#define PSTR_DELAY_US 10
@@ -134,7 +134,7 @@ static int rmobile_pd_start_dev(struct device *dev)
134 return ret; 134 return ret;
135} 135}
136 136
137void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd) 137static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
138{ 138{
139 struct generic_pm_domain *genpd = &rmobile_pd->genpd; 139 struct generic_pm_domain *genpd = &rmobile_pd->genpd;
140 struct dev_power_governor *gov = rmobile_pd->gov; 140 struct dev_power_governor *gov = rmobile_pd->gov;
@@ -149,19 +149,38 @@ void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
149 __rmobile_pd_power_up(rmobile_pd, false); 149 __rmobile_pd_power_up(rmobile_pd, false);
150} 150}
151 151
152void rmobile_add_device_to_domain(struct rmobile_pm_domain *rmobile_pd, 152void rmobile_init_domains(struct rmobile_pm_domain domains[], int num)
153 struct platform_device *pdev) 153{
154 int j;
155
156 for (j = 0; j < num; j++)
157 rmobile_init_pm_domain(&domains[j]);
158}
159
160void rmobile_add_device_to_domain_td(const char *domain_name,
161 struct platform_device *pdev,
162 struct gpd_timing_data *td)
154{ 163{
155 struct device *dev = &pdev->dev; 164 struct device *dev = &pdev->dev;
156 165
157 pm_genpd_add_device(&rmobile_pd->genpd, dev); 166 __pm_genpd_name_add_device(domain_name, dev, td);
158 if (pm_clk_no_clocks(dev)) 167 if (pm_clk_no_clocks(dev))
159 pm_clk_add(dev, NULL); 168 pm_clk_add(dev, NULL);
160} 169}
161 170
162void rmobile_pm_add_subdomain(struct rmobile_pm_domain *rmobile_pd, 171void rmobile_add_devices_to_domains(struct pm_domain_device data[],
163 struct rmobile_pm_domain *rmobile_sd) 172 int size)
164{ 173{
165 pm_genpd_add_subdomain(&rmobile_pd->genpd, &rmobile_sd->genpd); 174 struct gpd_timing_data latencies = {
175 .stop_latency_ns = DEFAULT_DEV_LATENCY_NS,
176 .start_latency_ns = DEFAULT_DEV_LATENCY_NS,
177 .save_state_latency_ns = DEFAULT_DEV_LATENCY_NS,
178 .restore_state_latency_ns = DEFAULT_DEV_LATENCY_NS,
179 };
180 int j;
181
182 for (j = 0; j < size; j++)
183 rmobile_add_device_to_domain_td(data[j].domain_name,
184 data[j].pdev, &latencies);
166} 185}
167#endif /* CONFIG_PM */ 186#endif /* CONFIG_PM */
diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c
index 79203706922..a0826a48dd0 100644
--- a/arch/arm/mach-shmobile/pm-sh7372.c
+++ b/arch/arm/mach-shmobile/pm-sh7372.c
@@ -21,6 +21,7 @@
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/bitrev.h> 22#include <linux/bitrev.h>
23#include <linux/console.h> 23#include <linux/console.h>
24#include <asm/cpuidle.h>
24#include <asm/io.h> 25#include <asm/io.h>
25#include <asm/tlbflush.h> 26#include <asm/tlbflush.h>
26#include <asm/suspend.h> 27#include <asm/suspend.h>
@@ -29,62 +30,50 @@
29#include <mach/pm-rmobile.h> 30#include <mach/pm-rmobile.h>
30 31
31/* DBG */ 32/* DBG */
32#define DBGREG1 0xe6100020 33#define DBGREG1 IOMEM(0xe6100020)
33#define DBGREG9 0xe6100040 34#define DBGREG9 IOMEM(0xe6100040)
34 35
35/* CPGA */ 36/* CPGA */
36#define SYSTBCR 0xe6150024 37#define SYSTBCR IOMEM(0xe6150024)
37#define MSTPSR0 0xe6150030 38#define MSTPSR0 IOMEM(0xe6150030)
38#define MSTPSR1 0xe6150038 39#define MSTPSR1 IOMEM(0xe6150038)
39#define MSTPSR2 0xe6150040 40#define MSTPSR2 IOMEM(0xe6150040)
40#define MSTPSR3 0xe6150048 41#define MSTPSR3 IOMEM(0xe6150048)
41#define MSTPSR4 0xe615004c 42#define MSTPSR4 IOMEM(0xe615004c)
42#define PLLC01STPCR 0xe61500c8 43#define PLLC01STPCR IOMEM(0xe61500c8)
43 44
44/* SYSC */ 45/* SYSC */
45#define SBAR 0xe6180020 46#define SBAR IOMEM(0xe6180020)
46#define WUPRMSK 0xe6180028 47#define WUPRMSK IOMEM(0xe6180028)
47#define WUPSMSK 0xe618002c 48#define WUPSMSK IOMEM(0xe618002c)
48#define WUPSMSK2 0xe6180048 49#define WUPSMSK2 IOMEM(0xe6180048)
49#define WUPSFAC 0xe6180098 50#define WUPSFAC IOMEM(0xe6180098)
50#define IRQCR 0xe618022c 51#define IRQCR IOMEM(0xe618022c)
51#define IRQCR2 0xe6180238 52#define IRQCR2 IOMEM(0xe6180238)
52#define IRQCR3 0xe6180244 53#define IRQCR3 IOMEM(0xe6180244)
53#define IRQCR4 0xe6180248 54#define IRQCR4 IOMEM(0xe6180248)
54#define PDNSEL 0xe6180254 55#define PDNSEL IOMEM(0xe6180254)
55 56
56/* INTC */ 57/* INTC */
57#define ICR1A 0xe6900000 58#define ICR1A IOMEM(0xe6900000)
58#define ICR2A 0xe6900004 59#define ICR2A IOMEM(0xe6900004)
59#define ICR3A 0xe6900008 60#define ICR3A IOMEM(0xe6900008)
60#define ICR4A 0xe690000c 61#define ICR4A IOMEM(0xe690000c)
61#define INTMSK00A 0xe6900040 62#define INTMSK00A IOMEM(0xe6900040)
62#define INTMSK10A 0xe6900044 63#define INTMSK10A IOMEM(0xe6900044)
63#define INTMSK20A 0xe6900048 64#define INTMSK20A IOMEM(0xe6900048)
64#define INTMSK30A 0xe690004c 65#define INTMSK30A IOMEM(0xe690004c)
65 66
66/* MFIS */ 67/* MFIS */
68/* FIXME: pointing where? */
67#define SMFRAM 0xe6a70000 69#define SMFRAM 0xe6a70000
68 70
69/* AP-System Core */ 71/* AP-System Core */
70#define APARMBAREA 0xe6f10020 72#define APARMBAREA IOMEM(0xe6f10020)
71 73
72#ifdef CONFIG_PM 74#ifdef CONFIG_PM
73 75
74struct rmobile_pm_domain sh7372_pd_a4lc = { 76#define PM_DOMAIN_ON_OFF_LATENCY_NS 250000
75 .genpd.name = "A4LC",
76 .bit_shift = 1,
77};
78
79struct rmobile_pm_domain sh7372_pd_a4mp = {
80 .genpd.name = "A4MP",
81 .bit_shift = 2,
82};
83
84struct rmobile_pm_domain sh7372_pd_d4 = {
85 .genpd.name = "D4",
86 .bit_shift = 3,
87};
88 77
89static int sh7372_a4r_pd_suspend(void) 78static int sh7372_a4r_pd_suspend(void)
90{ 79{
@@ -93,39 +82,25 @@ static int sh7372_a4r_pd_suspend(void)
93 return 0; 82 return 0;
94} 83}
95 84
96struct rmobile_pm_domain sh7372_pd_a4r = { 85static bool a4s_suspend_ready;
97 .genpd.name = "A4R",
98 .bit_shift = 5,
99 .suspend = sh7372_a4r_pd_suspend,
100 .resume = sh7372_intcs_resume,
101};
102 86
103struct rmobile_pm_domain sh7372_pd_a3rv = { 87static int sh7372_a4s_pd_suspend(void)
104 .genpd.name = "A3RV",
105 .bit_shift = 6,
106};
107
108struct rmobile_pm_domain sh7372_pd_a3ri = {
109 .genpd.name = "A3RI",
110 .bit_shift = 8,
111};
112
113static int sh7372_pd_a4s_suspend(void)
114{ 88{
115 /* 89 /*
116 * The A4S domain contains the CPU core and therefore it should 90 * The A4S domain contains the CPU core and therefore it should
117 * only be turned off if the CPU is in use. 91 * only be turned off if the CPU is not in use. This may happen
92 * during system suspend, when SYSC is going to be used for generating
93 * resume signals and a4s_suspend_ready is set to let
94 * sh7372_enter_suspend() know that it can turn A4S off.
118 */ 95 */
96 a4s_suspend_ready = true;
119 return -EBUSY; 97 return -EBUSY;
120} 98}
121 99
122struct rmobile_pm_domain sh7372_pd_a4s = { 100static void sh7372_a4s_pd_resume(void)
123 .genpd.name = "A4S", 101{
124 .bit_shift = 10, 102 a4s_suspend_ready = false;
125 .gov = &pm_domain_always_on_gov, 103}
126 .no_debug = true,
127 .suspend = sh7372_pd_a4s_suspend,
128};
129 104
130static int sh7372_a3sp_pd_suspend(void) 105static int sh7372_a3sp_pd_suspend(void)
131{ 106{
@@ -136,18 +111,80 @@ static int sh7372_a3sp_pd_suspend(void)
136 return console_suspend_enabled ? 0 : -EBUSY; 111 return console_suspend_enabled ? 0 : -EBUSY;
137} 112}
138 113
139struct rmobile_pm_domain sh7372_pd_a3sp = { 114static struct rmobile_pm_domain sh7372_pm_domains[] = {
140 .genpd.name = "A3SP", 115 {
141 .bit_shift = 11, 116 .genpd.name = "A4LC",
142 .gov = &pm_domain_always_on_gov, 117 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
143 .no_debug = true, 118 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
144 .suspend = sh7372_a3sp_pd_suspend, 119 .bit_shift = 1,
120 },
121 {
122 .genpd.name = "A4MP",
123 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
124 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
125 .bit_shift = 2,
126 },
127 {
128 .genpd.name = "D4",
129 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
130 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
131 .bit_shift = 3,
132 },
133 {
134 .genpd.name = "A4R",
135 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
136 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
137 .bit_shift = 5,
138 .suspend = sh7372_a4r_pd_suspend,
139 .resume = sh7372_intcs_resume,
140 },
141 {
142 .genpd.name = "A3RV",
143 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
144 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
145 .bit_shift = 6,
146 },
147 {
148 .genpd.name = "A3RI",
149 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
150 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
151 .bit_shift = 8,
152 },
153 {
154 .genpd.name = "A4S",
155 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
156 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
157 .bit_shift = 10,
158 .gov = &pm_domain_always_on_gov,
159 .no_debug = true,
160 .suspend = sh7372_a4s_pd_suspend,
161 .resume = sh7372_a4s_pd_resume,
162 },
163 {
164 .genpd.name = "A3SP",
165 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
166 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
167 .bit_shift = 11,
168 .gov = &pm_domain_always_on_gov,
169 .no_debug = true,
170 .suspend = sh7372_a3sp_pd_suspend,
171 },
172 {
173 .genpd.name = "A3SG",
174 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
175 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
176 .bit_shift = 13,
177 },
145}; 178};
146 179
147struct rmobile_pm_domain sh7372_pd_a3sg = { 180void __init sh7372_init_pm_domains(void)
148 .genpd.name = "A3SG", 181{
149 .bit_shift = 13, 182 rmobile_init_domains(sh7372_pm_domains, ARRAY_SIZE(sh7372_pm_domains));
150}; 183 pm_genpd_add_subdomain_names("A4LC", "A3RV");
184 pm_genpd_add_subdomain_names("A4R", "A4LC");
185 pm_genpd_add_subdomain_names("A4S", "A3SG");
186 pm_genpd_add_subdomain_names("A4S", "A3SP");
187}
151 188
152#endif /* CONFIG_PM */ 189#endif /* CONFIG_PM */
153 190
@@ -303,6 +340,21 @@ static void sh7372_enter_a3sm_common(int pllc0_on)
303 sh7372_set_reset_vector(__pa(sh7372_resume_core_standby_sysc)); 340 sh7372_set_reset_vector(__pa(sh7372_resume_core_standby_sysc));
304 sh7372_enter_sysc(pllc0_on, 1 << 12); 341 sh7372_enter_sysc(pllc0_on, 1 << 12);
305} 342}
343
344static void sh7372_enter_a4s_common(int pllc0_on)
345{
346 sh7372_intca_suspend();
347 sh7372_set_reset_vector(SMFRAM);
348 sh7372_enter_sysc(pllc0_on, 1 << 10);
349 sh7372_intca_resume();
350}
351
352static void sh7372_pm_setup_smfram(void)
353{
354 memcpy((void *)SMFRAM, sh7372_resume_core_standby_sysc, 0x100);
355}
356#else
357static inline void sh7372_pm_setup_smfram(void) {}
306#endif /* CONFIG_SUSPEND || CONFIG_CPU_IDLE */ 358#endif /* CONFIG_SUSPEND || CONFIG_CPU_IDLE */
307 359
308#ifdef CONFIG_CPU_IDLE 360#ifdef CONFIG_CPU_IDLE
@@ -312,7 +364,8 @@ static int sh7372_do_idle_core_standby(unsigned long unused)
312 return 0; 364 return 0;
313} 365}
314 366
315static void sh7372_enter_core_standby(void) 367static int sh7372_enter_core_standby(struct cpuidle_device *dev,
368 struct cpuidle_driver *drv, int index)
316{ 369{
317 sh7372_set_reset_vector(__pa(sh7372_resume_core_standby_sysc)); 370 sh7372_set_reset_vector(__pa(sh7372_resume_core_standby_sysc));
318 371
@@ -323,83 +376,102 @@ static void sh7372_enter_core_standby(void)
323 376
324 /* disable reset vector translation */ 377 /* disable reset vector translation */
325 __raw_writel(0, SBAR); 378 __raw_writel(0, SBAR);
379
380 return 1;
326} 381}
327 382
328static void sh7372_enter_a3sm_pll_on(void) 383static int sh7372_enter_a3sm_pll_on(struct cpuidle_device *dev,
384 struct cpuidle_driver *drv, int index)
329{ 385{
330 sh7372_enter_a3sm_common(1); 386 sh7372_enter_a3sm_common(1);
387 return 2;
331} 388}
332 389
333static void sh7372_enter_a3sm_pll_off(void) 390static int sh7372_enter_a3sm_pll_off(struct cpuidle_device *dev,
391 struct cpuidle_driver *drv, int index)
334{ 392{
335 sh7372_enter_a3sm_common(0); 393 sh7372_enter_a3sm_common(0);
394 return 3;
336} 395}
337 396
338static void sh7372_cpuidle_setup(struct cpuidle_driver *drv) 397static int sh7372_enter_a4s(struct cpuidle_device *dev,
398 struct cpuidle_driver *drv, int index)
339{ 399{
340 struct cpuidle_state *state = &drv->states[drv->state_count]; 400 unsigned long msk, msk2;
341 401
342 snprintf(state->name, CPUIDLE_NAME_LEN, "C2"); 402 if (!sh7372_sysc_valid(&msk, &msk2))
343 strncpy(state->desc, "Core Standby Mode", CPUIDLE_DESC_LEN); 403 return sh7372_enter_a3sm_pll_off(dev, drv, index);
344 state->exit_latency = 10; 404
345 state->target_residency = 20 + 10; 405 sh7372_setup_sysc(msk, msk2);
346 state->flags = CPUIDLE_FLAG_TIME_VALID; 406 sh7372_enter_a4s_common(0);
347 shmobile_cpuidle_modes[drv->state_count] = sh7372_enter_core_standby; 407 return 4;
348 drv->state_count++;
349
350 state = &drv->states[drv->state_count];
351 snprintf(state->name, CPUIDLE_NAME_LEN, "C3");
352 strncpy(state->desc, "A3SM PLL ON", CPUIDLE_DESC_LEN);
353 state->exit_latency = 20;
354 state->target_residency = 30 + 20;
355 state->flags = CPUIDLE_FLAG_TIME_VALID;
356 shmobile_cpuidle_modes[drv->state_count] = sh7372_enter_a3sm_pll_on;
357 drv->state_count++;
358
359 state = &drv->states[drv->state_count];
360 snprintf(state->name, CPUIDLE_NAME_LEN, "C4");
361 strncpy(state->desc, "A3SM PLL OFF", CPUIDLE_DESC_LEN);
362 state->exit_latency = 120;
363 state->target_residency = 30 + 120;
364 state->flags = CPUIDLE_FLAG_TIME_VALID;
365 shmobile_cpuidle_modes[drv->state_count] = sh7372_enter_a3sm_pll_off;
366 drv->state_count++;
367} 408}
368 409
410static struct cpuidle_driver sh7372_cpuidle_driver = {
411 .name = "sh7372_cpuidle",
412 .owner = THIS_MODULE,
413 .en_core_tk_irqen = 1,
414 .state_count = 5,
415 .safe_state_index = 0, /* C1 */
416 .states[0] = ARM_CPUIDLE_WFI_STATE,
417 .states[0].enter = shmobile_enter_wfi,
418 .states[1] = {
419 .name = "C2",
420 .desc = "Core Standby Mode",
421 .exit_latency = 10,
422 .target_residency = 20 + 10,
423 .flags = CPUIDLE_FLAG_TIME_VALID,
424 .enter = sh7372_enter_core_standby,
425 },
426 .states[2] = {
427 .name = "C3",
428 .desc = "A3SM PLL ON",
429 .exit_latency = 20,
430 .target_residency = 30 + 20,
431 .flags = CPUIDLE_FLAG_TIME_VALID,
432 .enter = sh7372_enter_a3sm_pll_on,
433 },
434 .states[3] = {
435 .name = "C4",
436 .desc = "A3SM PLL OFF",
437 .exit_latency = 120,
438 .target_residency = 30 + 120,
439 .flags = CPUIDLE_FLAG_TIME_VALID,
440 .enter = sh7372_enter_a3sm_pll_off,
441 },
442 .states[4] = {
443 .name = "C5",
444 .desc = "A4S PLL OFF",
445 .exit_latency = 240,
446 .target_residency = 30 + 240,
447 .flags = CPUIDLE_FLAG_TIME_VALID,
448 .enter = sh7372_enter_a4s,
449 .disabled = true,
450 },
451};
452
369static void sh7372_cpuidle_init(void) 453static void sh7372_cpuidle_init(void)
370{ 454{
371 shmobile_cpuidle_setup = sh7372_cpuidle_setup; 455 shmobile_cpuidle_set_driver(&sh7372_cpuidle_driver);
372} 456}
373#else 457#else
374static void sh7372_cpuidle_init(void) {} 458static void sh7372_cpuidle_init(void) {}
375#endif 459#endif
376 460
377#ifdef CONFIG_SUSPEND 461#ifdef CONFIG_SUSPEND
378static void sh7372_enter_a4s_common(int pllc0_on)
379{
380 sh7372_intca_suspend();
381 memcpy((void *)SMFRAM, sh7372_resume_core_standby_sysc, 0x100);
382 sh7372_set_reset_vector(SMFRAM);
383 sh7372_enter_sysc(pllc0_on, 1 << 10);
384 sh7372_intca_resume();
385}
386
387static int sh7372_enter_suspend(suspend_state_t suspend_state) 462static int sh7372_enter_suspend(suspend_state_t suspend_state)
388{ 463{
389 unsigned long msk, msk2; 464 unsigned long msk, msk2;
390 465
391 /* check active clocks to determine potential wakeup sources */ 466 /* check active clocks to determine potential wakeup sources */
392 if (sh7372_sysc_valid(&msk, &msk2)) { 467 if (sh7372_sysc_valid(&msk, &msk2) && a4s_suspend_ready) {
393 if (!console_suspend_enabled && 468 /* convert INTC mask/sense to SYSC mask/sense */
394 sh7372_pd_a4s.genpd.status == GPD_STATE_POWER_OFF) { 469 sh7372_setup_sysc(msk, msk2);
395 /* convert INTC mask/sense to SYSC mask/sense */ 470
396 sh7372_setup_sysc(msk, msk2); 471 /* enter A4S sleep with PLLC0 off */
397 472 pr_debug("entering A4S\n");
398 /* enter A4S sleep with PLLC0 off */ 473 sh7372_enter_a4s_common(0);
399 pr_debug("entering A4S\n"); 474 return 0;
400 sh7372_enter_a4s_common(0);
401 return 0;
402 }
403 } 475 }
404 476
405 /* default to enter A3SM sleep with PLLC0 off */ 477 /* default to enter A3SM sleep with PLLC0 off */
@@ -425,7 +497,7 @@ static int sh7372_pm_notifier_fn(struct notifier_block *notifier,
425 * executed during system suspend and resume, respectively, so 497 * executed during system suspend and resume, respectively, so
426 * that those functions don't crash while accessing the INTCS. 498 * that those functions don't crash while accessing the INTCS.
427 */ 499 */
428 pm_genpd_poweron(&sh7372_pd_a4r.genpd); 500 pm_genpd_name_poweron("A4R");
429 break; 501 break;
430 case PM_POST_SUSPEND: 502 case PM_POST_SUSPEND:
431 pm_genpd_poweroff_unused(); 503 pm_genpd_poweroff_unused();
@@ -454,6 +526,14 @@ void __init sh7372_pm_init(void)
454 /* do not convert A3SM, A3SP, A3SG, A4R power down into A4S */ 526 /* do not convert A3SM, A3SP, A3SG, A4R power down into A4S */
455 __raw_writel(0, PDNSEL); 527 __raw_writel(0, PDNSEL);
456 528
529 sh7372_pm_setup_smfram();
530
457 sh7372_suspend_init(); 531 sh7372_suspend_init();
458 sh7372_cpuidle_init(); 532 sh7372_cpuidle_init();
459} 533}
534
535void __init sh7372_pm_init_late(void)
536{
537 shmobile_init_late();
538 pm_genpd_name_attach_cpuidle("A4S", 4);
539}
diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
index dae9aa68bb0..a47beeb1828 100644
--- a/arch/arm/mach-shmobile/setup-emev2.c
+++ b/arch/arm/mach-shmobile/setup-emev2.c
@@ -356,6 +356,26 @@ static struct platform_device gio4_device = {
356 }, 356 },
357}; 357};
358 358
359static struct resource pmu_resources[] = {
360 [0] = {
361 .start = 152,
362 .end = 152,
363 .flags = IORESOURCE_IRQ,
364 },
365 [1] = {
366 .start = 153,
367 .end = 153,
368 .flags = IORESOURCE_IRQ,
369 },
370};
371
372static struct platform_device pmu_device = {
373 .name = "arm-pmu",
374 .id = -1,
375 .num_resources = ARRAY_SIZE(pmu_resources),
376 .resource = pmu_resources,
377};
378
359static struct platform_device *emev2_early_devices[] __initdata = { 379static struct platform_device *emev2_early_devices[] __initdata = {
360 &uart0_device, 380 &uart0_device,
361 &uart1_device, 381 &uart1_device,
@@ -370,6 +390,7 @@ static struct platform_device *emev2_late_devices[] __initdata = {
370 &gio2_device, 390 &gio2_device,
371 &gio3_device, 391 &gio3_device,
372 &gio4_device, 392 &gio4_device,
393 &pmu_device,
373}; 394};
374 395
375void __init emev2_add_standard_devices(void) 396void __init emev2_add_standard_devices(void)
@@ -440,6 +461,7 @@ void __init emev2_init_irq_dt(void)
440} 461}
441 462
442DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)") 463DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)")
464 .smp = smp_ops(emev2_smp_ops),
443 .init_early = emev2_init_delay, 465 .init_early = emev2_init_delay,
444 .nr_irqs = NR_IRQS_LEGACY, 466 .nr_irqs = NR_IRQS_LEGACY,
445 .init_irq = emev2_init_irq_dt, 467 .init_irq = emev2_init_irq_dt,
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 78948a9dba0..11bb1d98419 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -673,12 +673,7 @@ void __init r8a7740_add_standard_devices(void)
673 r8a7740_i2c_workaround(&i2c0_device); 673 r8a7740_i2c_workaround(&i2c0_device);
674 r8a7740_i2c_workaround(&i2c1_device); 674 r8a7740_i2c_workaround(&i2c1_device);
675 675
676 /* PM domain */ 676 r8a7740_init_pm_domains();
677 rmobile_init_pm_domain(&r8a7740_pd_a4s);
678 rmobile_init_pm_domain(&r8a7740_pd_a3sp);
679 rmobile_init_pm_domain(&r8a7740_pd_a4lc);
680
681 rmobile_pm_add_subdomain(&r8a7740_pd_a4s, &r8a7740_pd_a3sp);
682 677
683 /* add devices */ 678 /* add devices */
684 platform_add_devices(r8a7740_early_devices, 679 platform_add_devices(r8a7740_early_devices,
@@ -688,16 +683,16 @@ void __init r8a7740_add_standard_devices(void)
688 683
689 /* add devices to PM domain */ 684 /* add devices to PM domain */
690 685
691 rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif0_device); 686 rmobile_add_device_to_domain("A3SP", &scif0_device);
692 rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif1_device); 687 rmobile_add_device_to_domain("A3SP", &scif1_device);
693 rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif2_device); 688 rmobile_add_device_to_domain("A3SP", &scif2_device);
694 rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif3_device); 689 rmobile_add_device_to_domain("A3SP", &scif3_device);
695 rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif4_device); 690 rmobile_add_device_to_domain("A3SP", &scif4_device);
696 rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif5_device); 691 rmobile_add_device_to_domain("A3SP", &scif5_device);
697 rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif6_device); 692 rmobile_add_device_to_domain("A3SP", &scif6_device);
698 rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif7_device); 693 rmobile_add_device_to_domain("A3SP", &scif7_device);
699 rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scifb_device); 694 rmobile_add_device_to_domain("A3SP", &scifb_device);
700 rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &i2c1_device); 695 rmobile_add_device_to_domain("A3SP", &i2c1_device);
701} 696}
702 697
703static void __init r8a7740_earlytimer_init(void) 698static void __init r8a7740_earlytimer_init(void)
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index e98e46f6cf5..2917668f009 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -251,10 +251,7 @@ void __init r8a7779_add_standard_devices(void)
251#endif 251#endif
252 r8a7779_pm_init(); 252 r8a7779_pm_init();
253 253
254 r8a7779_init_pm_domain(&r8a7779_sh4a); 254 r8a7779_init_pm_domains();
255 r8a7779_init_pm_domain(&r8a7779_sgx);
256 r8a7779_init_pm_domain(&r8a7779_vdp1);
257 r8a7779_init_pm_domain(&r8a7779_impx3);
258 255
259 platform_add_devices(r8a7779_early_devices, 256 platform_add_devices(r8a7779_early_devices,
260 ARRAY_SIZE(r8a7779_early_devices)); 257 ARRAY_SIZE(r8a7779_early_devices));
diff --git a/arch/arm/mach-shmobile/setup-sh7367.c b/arch/arm/mach-shmobile/setup-sh7367.c
index 2e3074ab75b..e647f541087 100644
--- a/arch/arm/mach-shmobile/setup-sh7367.c
+++ b/arch/arm/mach-shmobile/setup-sh7367.c
@@ -462,7 +462,7 @@ static void __init sh7367_earlytimer_init(void)
462 shmobile_earlytimer_init(); 462 shmobile_earlytimer_init();
463} 463}
464 464
465#define SYMSTPCR2 0xe6158048 465#define SYMSTPCR2 IOMEM(0xe6158048)
466#define SYMSTPCR2_CMT1 (1 << 29) 466#define SYMSTPCR2_CMT1 (1 << 29)
467 467
468void __init sh7367_add_early_devices(void) 468void __init sh7367_add_early_devices(void)
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index 838a87be1d5..a07954fbcd2 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -1001,21 +1001,34 @@ static struct platform_device *sh7372_late_devices[] __initdata = {
1001 1001
1002void __init sh7372_add_standard_devices(void) 1002void __init sh7372_add_standard_devices(void)
1003{ 1003{
1004 rmobile_init_pm_domain(&sh7372_pd_a4lc); 1004 struct pm_domain_device domain_devices[] = {
1005 rmobile_init_pm_domain(&sh7372_pd_a4mp); 1005 { "A3RV", &vpu_device, },
1006 rmobile_init_pm_domain(&sh7372_pd_d4); 1006 { "A4MP", &spu0_device, },
1007 rmobile_init_pm_domain(&sh7372_pd_a4r); 1007 { "A4MP", &spu1_device, },
1008 rmobile_init_pm_domain(&sh7372_pd_a3rv); 1008 { "A3SP", &scif0_device, },
1009 rmobile_init_pm_domain(&sh7372_pd_a3ri); 1009 { "A3SP", &scif1_device, },
1010 rmobile_init_pm_domain(&sh7372_pd_a4s); 1010 { "A3SP", &scif2_device, },
1011 rmobile_init_pm_domain(&sh7372_pd_a3sp); 1011 { "A3SP", &scif3_device, },
1012 rmobile_init_pm_domain(&sh7372_pd_a3sg); 1012 { "A3SP", &scif4_device, },
1013 1013 { "A3SP", &scif5_device, },
1014 rmobile_pm_add_subdomain(&sh7372_pd_a4lc, &sh7372_pd_a3rv); 1014 { "A3SP", &scif6_device, },
1015 rmobile_pm_add_subdomain(&sh7372_pd_a4r, &sh7372_pd_a4lc); 1015 { "A3SP", &iic1_device, },
1016 1016 { "A3SP", &dma0_device, },
1017 rmobile_pm_add_subdomain(&sh7372_pd_a4s, &sh7372_pd_a3sg); 1017 { "A3SP", &dma1_device, },
1018 rmobile_pm_add_subdomain(&sh7372_pd_a4s, &sh7372_pd_a3sp); 1018 { "A3SP", &dma2_device, },
1019 { "A3SP", &usb_dma0_device, },
1020 { "A3SP", &usb_dma1_device, },
1021 { "A4R", &iic0_device, },
1022 { "A4R", &veu0_device, },
1023 { "A4R", &veu1_device, },
1024 { "A4R", &veu2_device, },
1025 { "A4R", &veu3_device, },
1026 { "A4R", &jpu_device, },
1027 { "A4R", &tmu00_device, },
1028 { "A4R", &tmu01_device, },
1029 };
1030
1031 sh7372_init_pm_domains();
1019 1032
1020 platform_add_devices(sh7372_early_devices, 1033 platform_add_devices(sh7372_early_devices,
1021 ARRAY_SIZE(sh7372_early_devices)); 1034 ARRAY_SIZE(sh7372_early_devices));
@@ -1023,30 +1036,8 @@ void __init sh7372_add_standard_devices(void)
1023 platform_add_devices(sh7372_late_devices, 1036 platform_add_devices(sh7372_late_devices,
1024 ARRAY_SIZE(sh7372_late_devices)); 1037 ARRAY_SIZE(sh7372_late_devices));
1025 1038
1026 rmobile_add_device_to_domain(&sh7372_pd_a3rv, &vpu_device); 1039 rmobile_add_devices_to_domains(domain_devices,
1027 rmobile_add_device_to_domain(&sh7372_pd_a4mp, &spu0_device); 1040 ARRAY_SIZE(domain_devices));
1028 rmobile_add_device_to_domain(&sh7372_pd_a4mp, &spu1_device);
1029 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif0_device);
1030 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif1_device);
1031 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif2_device);
1032 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif3_device);
1033 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif4_device);
1034 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif5_device);
1035 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif6_device);
1036 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &iic1_device);
1037 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &dma0_device);
1038 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &dma1_device);
1039 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &dma2_device);
1040 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &usb_dma0_device);
1041 rmobile_add_device_to_domain(&sh7372_pd_a3sp, &usb_dma1_device);
1042 rmobile_add_device_to_domain(&sh7372_pd_a4r, &iic0_device);
1043 rmobile_add_device_to_domain(&sh7372_pd_a4r, &veu0_device);
1044 rmobile_add_device_to_domain(&sh7372_pd_a4r, &veu1_device);
1045 rmobile_add_device_to_domain(&sh7372_pd_a4r, &veu2_device);
1046 rmobile_add_device_to_domain(&sh7372_pd_a4r, &veu3_device);
1047 rmobile_add_device_to_domain(&sh7372_pd_a4r, &jpu_device);
1048 rmobile_add_device_to_domain(&sh7372_pd_a4r, &tmu00_device);
1049 rmobile_add_device_to_domain(&sh7372_pd_a4r, &tmu01_device);
1050} 1041}
1051 1042
1052static void __init sh7372_earlytimer_init(void) 1043static void __init sh7372_earlytimer_init(void)
diff --git a/arch/arm/mach-shmobile/setup-sh7377.c b/arch/arm/mach-shmobile/setup-sh7377.c
index 855b1506caf..edcf98bb701 100644
--- a/arch/arm/mach-shmobile/setup-sh7377.c
+++ b/arch/arm/mach-shmobile/setup-sh7377.c
@@ -484,7 +484,7 @@ static void __init sh7377_earlytimer_init(void)
484 shmobile_earlytimer_init(); 484 shmobile_earlytimer_init();
485} 485}
486 486
487#define SMSTPCR3 0xe615013c 487#define SMSTPCR3 IOMEM(0xe615013c)
488#define SMSTPCR3_CMT1 (1 << 29) 488#define SMSTPCR3_CMT1 (1 << 29)
489 489
490void __init sh7377_add_early_devices(void) 490void __init sh7377_add_early_devices(void)
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index d230af656fc..db99a4ade80 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -734,6 +734,26 @@ static struct platform_device mpdma0_device = {
734 }, 734 },
735}; 735};
736 736
737static struct resource pmu_resources[] = {
738 [0] = {
739 .start = gic_spi(55),
740 .end = gic_spi(55),
741 .flags = IORESOURCE_IRQ,
742 },
743 [1] = {
744 .start = gic_spi(56),
745 .end = gic_spi(56),
746 .flags = IORESOURCE_IRQ,
747 },
748};
749
750static struct platform_device pmu_device = {
751 .name = "arm-pmu",
752 .id = -1,
753 .num_resources = ARRAY_SIZE(pmu_resources),
754 .resource = pmu_resources,
755};
756
737static struct platform_device *sh73a0_early_devices[] __initdata = { 757static struct platform_device *sh73a0_early_devices[] __initdata = {
738 &scif0_device, 758 &scif0_device,
739 &scif1_device, 759 &scif1_device,
@@ -757,9 +777,10 @@ static struct platform_device *sh73a0_late_devices[] __initdata = {
757 &i2c4_device, 777 &i2c4_device,
758 &dma0_device, 778 &dma0_device,
759 &mpdma0_device, 779 &mpdma0_device,
780 &pmu_device,
760}; 781};
761 782
762#define SRCR2 0xe61580b0 783#define SRCR2 IOMEM(0xe61580b0)
763 784
764void __init sh73a0_add_standard_devices(void) 785void __init sh73a0_add_standard_devices(void)
765{ 786{
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/sh-gpio.h
index 844507d937c..e834763ac2a 100644
--- a/arch/arm/mach-shmobile/include/mach/gpio.h
+++ b/arch/arm/mach-shmobile/sh-gpio.h
@@ -12,22 +12,8 @@
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/sh_pfc.h>
16#include <linux/io.h> 15#include <linux/io.h>
17 16
18#ifdef CONFIG_GPIOLIB
19
20static inline int irq_to_gpio(unsigned int irq)
21{
22 return -ENOSYS;
23}
24
25#else
26
27#define __ARM_GPIOLIB_COMPLEX
28
29#endif /* CONFIG_GPIOLIB */
30
31/* 17/*
32 * FIXME !! 18 * FIXME !!
33 * 19 *
@@ -35,12 +21,12 @@ static inline int irq_to_gpio(unsigned int irq)
35 * the method to control only pull up/down/free. 21 * the method to control only pull up/down/free.
36 * this function should be replaced by correct gpio function 22 * this function should be replaced by correct gpio function
37 */ 23 */
38static inline void __init gpio_direction_none(u32 addr) 24static inline void __init gpio_direction_none(void __iomem * addr)
39{ 25{
40 __raw_writeb(0x00, addr); 26 __raw_writeb(0x00, addr);
41} 27}
42 28
43static inline void __init gpio_request_pullup(u32 addr) 29static inline void __init gpio_request_pullup(void __iomem * addr)
44{ 30{
45 u8 data = __raw_readb(addr); 31 u8 data = __raw_readb(addr);
46 32
@@ -49,7 +35,7 @@ static inline void __init gpio_request_pullup(u32 addr)
49 __raw_writeb(data, addr); 35 __raw_writeb(data, addr);
50} 36}
51 37
52static inline void __init gpio_request_pulldown(u32 addr) 38static inline void __init gpio_request_pulldown(void __iomem * addr)
53{ 39{
54 u8 data = __raw_readb(addr); 40 u8 data = __raw_readb(addr);
55 41
diff --git a/arch/arm/mach-shmobile/smp-emev2.c b/arch/arm/mach-shmobile/smp-emev2.c
index 6a35c4a31e6..f6745628628 100644
--- a/arch/arm/mach-shmobile/smp-emev2.c
+++ b/arch/arm/mach-shmobile/smp-emev2.c
@@ -50,7 +50,7 @@ static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
50 50
51} 51}
52 52
53unsigned int __init emev2_get_core_count(void) 53static unsigned int __init emev2_get_core_count(void)
54{ 54{
55 if (!scu_base) { 55 if (!scu_base) {
56 scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE); 56 scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE);
@@ -62,17 +62,35 @@ unsigned int __init emev2_get_core_count(void)
62 return scu_base ? scu_get_core_count(scu_base) : 1; 62 return scu_base ? scu_get_core_count(scu_base) : 1;
63} 63}
64 64
65int emev2_platform_cpu_kill(unsigned int cpu) 65static int emev2_platform_cpu_kill(unsigned int cpu)
66{ 66{
67 return 0; /* not supported yet */ 67 return 0; /* not supported yet */
68} 68}
69 69
70void __cpuinit emev2_secondary_init(unsigned int cpu) 70static int __maybe_unused emev2_cpu_kill(unsigned int cpu)
71{
72 int k;
73
74 /* this function is running on another CPU than the offline target,
75 * here we need wait for shutdown code in platform_cpu_die() to
76 * finish before asking SoC-specific code to power off the CPU core.
77 */
78 for (k = 0; k < 1000; k++) {
79 if (shmobile_cpu_is_dead(cpu))
80 return emev2_platform_cpu_kill(cpu);
81 mdelay(1);
82 }
83
84 return 0;
85}
86
87
88static void __cpuinit emev2_secondary_init(unsigned int cpu)
71{ 89{
72 gic_secondary_init(0); 90 gic_secondary_init(0);
73} 91}
74 92
75int __cpuinit emev2_boot_secondary(unsigned int cpu) 93static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct *idle)
76{ 94{
77 cpu = cpu_logical_map(cpu); 95 cpu = cpu_logical_map(cpu);
78 96
@@ -82,11 +100,11 @@ int __cpuinit emev2_boot_secondary(unsigned int cpu)
82 /* Tell ROM loader about our vector (in headsmp.S) */ 100 /* Tell ROM loader about our vector (in headsmp.S) */
83 emev2_set_boot_vector(__pa(shmobile_secondary_vector)); 101 emev2_set_boot_vector(__pa(shmobile_secondary_vector));
84 102
85 gic_raise_softirq(cpumask_of(cpu), 1); 103 gic_raise_softirq(cpumask_of(cpu), 0);
86 return 0; 104 return 0;
87} 105}
88 106
89void __init emev2_smp_prepare_cpus(void) 107static void __init emev2_smp_prepare_cpus(unsigned int max_cpus)
90{ 108{
91 int cpu = cpu_logical_map(0); 109 int cpu = cpu_logical_map(0);
92 110
@@ -95,3 +113,22 @@ void __init emev2_smp_prepare_cpus(void)
95 /* enable cache coherency on CPU0 */ 113 /* enable cache coherency on CPU0 */
96 modify_scu_cpu_psr(0, 3 << (cpu * 8)); 114 modify_scu_cpu_psr(0, 3 << (cpu * 8));
97} 115}
116
117static void __init emev2_smp_init_cpus(void)
118{
119 unsigned int ncores = emev2_get_core_count();
120
121 shmobile_smp_init_cpus(ncores);
122}
123
124struct smp_operations emev2_smp_ops __initdata = {
125 .smp_init_cpus = emev2_smp_init_cpus,
126 .smp_prepare_cpus = emev2_smp_prepare_cpus,
127 .smp_secondary_init = emev2_secondary_init,
128 .smp_boot_secondary = emev2_boot_secondary,
129#ifdef CONFIG_HOTPLUG_CPU
130 .cpu_kill = emev2_cpu_kill,
131 .cpu_die = shmobile_cpu_die,
132 .cpu_disable = shmobile_cpu_disable,
133#endif
134};
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
index 6d1d0238cbf..2ce6af9a6a3 100644
--- a/arch/arm/mach-shmobile/smp-r8a7779.c
+++ b/arch/arm/mach-shmobile/smp-r8a7779.c
@@ -87,14 +87,14 @@ static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
87 __raw_writel(tmp, scu_base + 8); 87 __raw_writel(tmp, scu_base + 8);
88} 88}
89 89
90unsigned int __init r8a7779_get_core_count(void) 90static unsigned int __init r8a7779_get_core_count(void)
91{ 91{
92 void __iomem *scu_base = scu_base_addr(); 92 void __iomem *scu_base = scu_base_addr();
93 93
94 return scu_get_core_count(scu_base); 94 return scu_get_core_count(scu_base);
95} 95}
96 96
97int r8a7779_platform_cpu_kill(unsigned int cpu) 97static int r8a7779_platform_cpu_kill(unsigned int cpu)
98{ 98{
99 struct r8a7779_pm_ch *ch = NULL; 99 struct r8a7779_pm_ch *ch = NULL;
100 int ret = -EIO; 100 int ret = -EIO;
@@ -113,12 +113,31 @@ int r8a7779_platform_cpu_kill(unsigned int cpu)
113 return ret ? ret : 1; 113 return ret ? ret : 1;
114} 114}
115 115
116void __cpuinit r8a7779_secondary_init(unsigned int cpu) 116static int __maybe_unused r8a7779_cpu_kill(unsigned int cpu)
117{
118 int k;
119
120 /* this function is running on another CPU than the offline target,
121 * here we need wait for shutdown code in platform_cpu_die() to
122 * finish before asking SoC-specific code to power off the CPU core.
123 */
124 for (k = 0; k < 1000; k++) {
125 if (shmobile_cpu_is_dead(cpu))
126 return r8a7779_platform_cpu_kill(cpu);
127
128 mdelay(1);
129 }
130
131 return 0;
132}
133
134
135static void __cpuinit r8a7779_secondary_init(unsigned int cpu)
117{ 136{
118 gic_secondary_init(0); 137 gic_secondary_init(0);
119} 138}
120 139
121int __cpuinit r8a7779_boot_secondary(unsigned int cpu) 140static int __cpuinit r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle)
122{ 141{
123 struct r8a7779_pm_ch *ch = NULL; 142 struct r8a7779_pm_ch *ch = NULL;
124 int ret = -EIO; 143 int ret = -EIO;
@@ -137,7 +156,7 @@ int __cpuinit r8a7779_boot_secondary(unsigned int cpu)
137 return ret; 156 return ret;
138} 157}
139 158
140void __init r8a7779_smp_prepare_cpus(void) 159static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus)
141{ 160{
142 int cpu = cpu_logical_map(0); 161 int cpu = cpu_logical_map(0);
143 162
@@ -156,3 +175,22 @@ void __init r8a7779_smp_prepare_cpus(void)
156 r8a7779_platform_cpu_kill(2); 175 r8a7779_platform_cpu_kill(2);
157 r8a7779_platform_cpu_kill(3); 176 r8a7779_platform_cpu_kill(3);
158} 177}
178
179static void __init r8a7779_smp_init_cpus(void)
180{
181 unsigned int ncores = r8a7779_get_core_count();
182
183 shmobile_smp_init_cpus(ncores);
184}
185
186struct smp_operations r8a7779_smp_ops __initdata = {
187 .smp_init_cpus = r8a7779_smp_init_cpus,
188 .smp_prepare_cpus = r8a7779_smp_prepare_cpus,
189 .smp_secondary_init = r8a7779_secondary_init,
190 .smp_boot_secondary = r8a7779_boot_secondary,
191#ifdef CONFIG_HOTPLUG_CPU
192 .cpu_kill = r8a7779_cpu_kill,
193 .cpu_die = shmobile_cpu_die,
194 .cpu_disable = shmobile_cpu_disable,
195#endif
196};
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c
index e36c41c4ab4..624f00f70ab 100644
--- a/arch/arm/mach-shmobile/smp-sh73a0.c
+++ b/arch/arm/mach-shmobile/smp-sh73a0.c
@@ -22,8 +22,10 @@
22#include <linux/smp.h> 22#include <linux/smp.h>
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 <mach/common.h> 26#include <mach/common.h>
26#include <asm/smp_plat.h> 27#include <asm/smp_plat.h>
28#include <mach/sh73a0.h>
27#include <asm/smp_scu.h> 29#include <asm/smp_scu.h>
28#include <asm/smp_twd.h> 30#include <asm/smp_twd.h>
29#include <asm/hardware/gic.h> 31#include <asm/hardware/gic.h>
@@ -64,19 +66,19 @@ static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
64 __raw_writel(tmp, scu_base + 8); 66 __raw_writel(tmp, scu_base + 8);
65} 67}
66 68
67unsigned int __init sh73a0_get_core_count(void) 69static unsigned int __init sh73a0_get_core_count(void)
68{ 70{
69 void __iomem *scu_base = scu_base_addr(); 71 void __iomem *scu_base = scu_base_addr();
70 72
71 return scu_get_core_count(scu_base); 73 return scu_get_core_count(scu_base);
72} 74}
73 75
74void __cpuinit sh73a0_secondary_init(unsigned int cpu) 76static void __cpuinit sh73a0_secondary_init(unsigned int cpu)
75{ 77{
76 gic_secondary_init(0); 78 gic_secondary_init(0);
77} 79}
78 80
79int __cpuinit sh73a0_boot_secondary(unsigned int cpu) 81static int __cpuinit sh73a0_boot_secondary(unsigned int cpu, struct task_struct *idle)
80{ 82{
81 cpu = cpu_logical_map(cpu); 83 cpu = cpu_logical_map(cpu);
82 84
@@ -91,7 +93,7 @@ int __cpuinit sh73a0_boot_secondary(unsigned int cpu)
91 return 0; 93 return 0;
92} 94}
93 95
94void __init sh73a0_smp_prepare_cpus(void) 96static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus)
95{ 97{
96 int cpu = cpu_logical_map(0); 98 int cpu = cpu_logical_map(0);
97 99
@@ -104,3 +106,41 @@ void __init sh73a0_smp_prepare_cpus(void)
104 /* enable cache coherency on CPU0 */ 106 /* enable cache coherency on CPU0 */
105 modify_scu_cpu_psr(0, 3 << (cpu * 8)); 107 modify_scu_cpu_psr(0, 3 << (cpu * 8));
106} 108}
109
110static void __init sh73a0_smp_init_cpus(void)
111{
112 unsigned int ncores = sh73a0_get_core_count();
113
114 shmobile_smp_init_cpus(ncores);
115}
116
117static int __maybe_unused sh73a0_cpu_kill(unsigned int cpu)
118{
119 int k;
120
121 /* this function is running on another CPU than the offline target,
122 * here we need wait for shutdown code in platform_cpu_die() to
123 * finish before asking SoC-specific code to power off the CPU core.
124 */
125 for (k = 0; k < 1000; k++) {
126 if (shmobile_cpu_is_dead(cpu))
127 return 1;
128
129 mdelay(1);
130 }
131
132 return 0;
133}
134
135
136struct smp_operations sh73a0_smp_ops __initdata = {
137 .smp_init_cpus = sh73a0_smp_init_cpus,
138 .smp_prepare_cpus = sh73a0_smp_prepare_cpus,
139 .smp_secondary_init = sh73a0_secondary_init,
140 .smp_boot_secondary = sh73a0_boot_secondary,
141#ifdef CONFIG_HOTPLUG_CPU
142 .cpu_kill = sh73a0_cpu_kill,
143 .cpu_die = shmobile_cpu_die,
144 .cpu_disable = shmobile_cpu_disable,
145#endif
146};
diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
new file mode 100644
index 00000000000..803a3281feb
--- /dev/null
+++ b/arch/arm/mach-socfpga/Kconfig
@@ -0,0 +1,16 @@
1config ARCH_SOCFPGA
2 bool "Altera SOCFPGA family" if ARCH_MULTI_V7
3 select ARCH_WANT_OPTIONAL_GPIOLIB
4 select ARM_AMBA
5 select ARM_GIC
6 select CACHE_L2X0
7 select CLKDEV_LOOKUP
8 select COMMON_CLK
9 select CPU_V7
10 select DW_APB_TIMER
11 select DW_APB_TIMER_OF
12 select GENERIC_CLOCKEVENTS
13 select GPIO_PL061 if GPIOLIB
14 select HAVE_ARM_SCU
15 select SPARSE_IRQ
16 select USE_OF
diff --git a/arch/arm/mach-socfpga/Makefile.boot b/arch/arm/mach-socfpga/Makefile.boot
deleted file mode 100644
index dae9661a768..00000000000
--- a/arch/arm/mach-socfpga/Makefile.boot
+++ /dev/null
@@ -1 +0,0 @@
1zreladdr-y := 0x00008000
diff --git a/arch/arm/mach-socfpga/include/mach/timex.h b/arch/arm/mach-socfpga/include/mach/timex.h
deleted file mode 100644
index 43df4354e46..00000000000
--- a/arch/arm/mach-socfpga/include/mach/timex.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Copyright (C) 2003 ARM Limited
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
19#define CLOCK_TICK_RATE (50000000 / 16)
diff --git a/arch/arm/mach-socfpga/include/mach/uncompress.h b/arch/arm/mach-socfpga/include/mach/uncompress.h
deleted file mode 100644
index bbe20e69632..00000000000
--- a/arch/arm/mach-socfpga/include/mach/uncompress.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef __MACH_UNCOMPRESS_H
2#define __MACH_UNCOMPRESS_H
3
4#define putc(c)
5#define flush()
6#define arch_decomp_setup()
7#define arch_decomp_wdog()
8
9#endif
diff --git a/arch/arm/mach-spear13xx/Makefile.boot b/arch/arm/mach-spear13xx/Makefile.boot
index 403efd7e6d2..4674a4c221d 100644
--- a/arch/arm/mach-spear13xx/Makefile.boot
+++ b/arch/arm/mach-spear13xx/Makefile.boot
@@ -1,6 +1,3 @@
1zreladdr-y += 0x00008000 1zreladdr-y += 0x00008000
2params_phys-y := 0x00000100 2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000 3initrd_phys-y := 0x00800000
4
5dtb-$(CONFIG_MACH_SPEAR1310) += spear1310-evb.dtb
6dtb-$(CONFIG_MACH_SPEAR1340) += spear1340-evb.dtb
diff --git a/arch/arm/mach-spear13xx/hotplug.c b/arch/arm/mach-spear13xx/hotplug.c
index 5c6867b46d0..a7d2dd11a4f 100644
--- a/arch/arm/mach-spear13xx/hotplug.c
+++ b/arch/arm/mach-spear13xx/hotplug.c
@@ -17,8 +17,6 @@
17#include <asm/cp15.h> 17#include <asm/cp15.h>
18#include <asm/smp_plat.h> 18#include <asm/smp_plat.h>
19 19
20extern volatile int pen_release;
21
22static inline void cpu_enter_lowpower(void) 20static inline void cpu_enter_lowpower(void)
23{ 21{
24 unsigned int v; 22 unsigned int v;
@@ -56,7 +54,7 @@ static inline void cpu_leave_lowpower(void)
56 : "cc"); 54 : "cc");
57} 55}
58 56
59static inline void platform_do_lowpower(unsigned int cpu, int *spurious) 57static inline void spear13xx_do_lowpower(unsigned int cpu, int *spurious)
60{ 58{
61 for (;;) { 59 for (;;) {
62 wfi(); 60 wfi();
@@ -79,17 +77,12 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
79 } 77 }
80} 78}
81 79
82int platform_cpu_kill(unsigned int cpu)
83{
84 return 1;
85}
86
87/* 80/*
88 * platform-specific code to shutdown a CPU 81 * platform-specific code to shutdown a CPU
89 * 82 *
90 * Called with IRQs disabled 83 * Called with IRQs disabled
91 */ 84 */
92void __cpuinit platform_cpu_die(unsigned int cpu) 85void __ref spear13xx_cpu_die(unsigned int cpu)
93{ 86{
94 int spurious = 0; 87 int spurious = 0;
95 88
@@ -97,7 +90,7 @@ void __cpuinit platform_cpu_die(unsigned int cpu)
97 * we're ready for shutdown now, so do it 90 * we're ready for shutdown now, so do it
98 */ 91 */
99 cpu_enter_lowpower(); 92 cpu_enter_lowpower();
100 platform_do_lowpower(cpu, &spurious); 93 spear13xx_do_lowpower(cpu, &spurious);
101 94
102 /* 95 /*
103 * bring this CPU back into the world of cache 96 * bring this CPU back into the world of cache
@@ -108,12 +101,3 @@ void __cpuinit platform_cpu_die(unsigned int cpu)
108 if (spurious) 101 if (spurious)
109 pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); 102 pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
110} 103}
111
112int platform_cpu_disable(unsigned int cpu)
113{
114 /*
115 * we don't allow CPU 0 to be shutdown (it is still too special
116 * e.g. clock tick interrupts)
117 */
118 return cpu == 0 ? -EPERM : 0;
119}
diff --git a/arch/arm/mach-spear13xx/include/mach/generic.h b/arch/arm/mach-spear13xx/include/mach/generic.h
index dac57fd0cdf..c33f4d9361b 100644
--- a/arch/arm/mach-spear13xx/include/mach/generic.h
+++ b/arch/arm/mach-spear13xx/include/mach/generic.h
@@ -33,6 +33,9 @@ void __init spear13xx_l2x0_init(void);
33bool dw_dma_filter(struct dma_chan *chan, void *slave); 33bool dw_dma_filter(struct dma_chan *chan, void *slave);
34void spear_restart(char, const char *); 34void spear_restart(char, const char *);
35void spear13xx_secondary_startup(void); 35void spear13xx_secondary_startup(void);
36void __cpuinit spear13xx_cpu_die(unsigned int cpu);
37
38extern struct smp_operations spear13xx_smp_ops;
36 39
37#ifdef CONFIG_MACH_SPEAR1310 40#ifdef CONFIG_MACH_SPEAR1310
38void __init spear1310_clk_init(void); 41void __init spear1310_clk_init(void);
diff --git a/arch/arm/mach-spear13xx/include/mach/gpio.h b/arch/arm/mach-spear13xx/include/mach/gpio.h
deleted file mode 100644
index 85f176311f6..00000000000
--- a/arch/arm/mach-spear13xx/include/mach/gpio.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-spear13xx/include/mach/gpio.h
3 *
4 * GPIO macros for SPEAr13xx machine family
5 *
6 * Copyright (C) 2012 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 __MACH_GPIO_H
15#define __MACH_GPIO_H
16
17#include <plat/gpio.h>
18
19#endif /* __MACH_GPIO_H */
diff --git a/arch/arm/mach-spear13xx/include/mach/spear.h b/arch/arm/mach-spear13xx/include/mach/spear.h
index 65f27def239..07d90acc92c 100644
--- a/arch/arm/mach-spear13xx/include/mach/spear.h
+++ b/arch/arm/mach-spear13xx/include/mach/spear.h
@@ -17,26 +17,26 @@
17#include <asm/memory.h> 17#include <asm/memory.h>
18 18
19#define PERIP_GRP2_BASE UL(0xB3000000) 19#define PERIP_GRP2_BASE UL(0xB3000000)
20#define VA_PERIP_GRP2_BASE UL(0xFE000000) 20#define VA_PERIP_GRP2_BASE IOMEM(0xFE000000)
21#define MCIF_SDHCI_BASE UL(0xB3000000) 21#define MCIF_SDHCI_BASE UL(0xB3000000)
22#define SYSRAM0_BASE UL(0xB3800000) 22#define SYSRAM0_BASE UL(0xB3800000)
23#define VA_SYSRAM0_BASE UL(0xFE800000) 23#define VA_SYSRAM0_BASE IOMEM(0xFE800000)
24#define SYS_LOCATION (VA_SYSRAM0_BASE + 0x600) 24#define SYS_LOCATION (VA_SYSRAM0_BASE + 0x600)
25 25
26#define PERIP_GRP1_BASE UL(0xE0000000) 26#define PERIP_GRP1_BASE UL(0xE0000000)
27#define VA_PERIP_GRP1_BASE UL(0xFD000000) 27#define VA_PERIP_GRP1_BASE IOMEM(0xFD000000)
28#define UART_BASE UL(0xE0000000) 28#define UART_BASE UL(0xE0000000)
29#define VA_UART_BASE UL(0xFD000000) 29#define VA_UART_BASE IOMEM(0xFD000000)
30#define SSP_BASE UL(0xE0100000) 30#define SSP_BASE UL(0xE0100000)
31#define MISC_BASE UL(0xE0700000) 31#define MISC_BASE UL(0xE0700000)
32#define VA_MISC_BASE IOMEM(UL(0xFD700000)) 32#define VA_MISC_BASE IOMEM(0xFD700000)
33 33
34#define A9SM_AND_MPMC_BASE UL(0xEC000000) 34#define A9SM_AND_MPMC_BASE UL(0xEC000000)
35#define VA_A9SM_AND_MPMC_BASE UL(0xFC000000) 35#define VA_A9SM_AND_MPMC_BASE IOMEM(0xFC000000)
36 36
37/* A9SM peripheral offsets */ 37/* A9SM peripheral offsets */
38#define A9SM_PERIP_BASE UL(0xEC800000) 38#define A9SM_PERIP_BASE UL(0xEC800000)
39#define VA_A9SM_PERIP_BASE UL(0xFC800000) 39#define VA_A9SM_PERIP_BASE IOMEM(0xFC800000)
40#define VA_SCU_BASE (VA_A9SM_PERIP_BASE + 0x00) 40#define VA_SCU_BASE (VA_A9SM_PERIP_BASE + 0x00)
41 41
42#define L2CC_BASE UL(0xED000000) 42#define L2CC_BASE UL(0xED000000)
diff --git a/arch/arm/mach-spear13xx/platsmp.c b/arch/arm/mach-spear13xx/platsmp.c
index f5d07f2663d..2eaa3fa7b43 100644
--- a/arch/arm/mach-spear13xx/platsmp.c
+++ b/arch/arm/mach-spear13xx/platsmp.c
@@ -19,18 +19,13 @@
19#include <asm/hardware/gic.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 23
23/*
24 * control for which core is the next to come out of the secondary
25 * boot "holding pen"
26 */
27volatile int __cpuinitdata pen_release = -1;
28static DEFINE_SPINLOCK(boot_lock); 24static DEFINE_SPINLOCK(boot_lock);
29 25
30static void __iomem *scu_base = IOMEM(VA_SCU_BASE); 26static void __iomem *scu_base = IOMEM(VA_SCU_BASE);
31extern void spear13xx_secondary_startup(void);
32 27
33void __cpuinit platform_secondary_init(unsigned int cpu) 28static void __cpuinit spear13xx_secondary_init(unsigned int cpu)
34{ 29{
35 /* 30 /*
36 * if any interrupts are already enabled for the primary 31 * if any interrupts are already enabled for the primary
@@ -53,7 +48,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
53 spin_unlock(&boot_lock); 48 spin_unlock(&boot_lock);
54} 49}
55 50
56int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 51static int __cpuinit spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle)
57{ 52{
58 unsigned long timeout; 53 unsigned long timeout;
59 54
@@ -97,7 +92,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
97 * Initialise the CPU possible map early - this describes the CPUs 92 * Initialise the CPU possible map early - this describes the CPUs
98 * which may be present or become present in the system. 93 * which may be present or become present in the system.
99 */ 94 */
100void __init smp_init_cpus(void) 95static void __init spear13xx_smp_init_cpus(void)
101{ 96{
102 unsigned int i, ncores = scu_get_core_count(scu_base); 97 unsigned int i, ncores = scu_get_core_count(scu_base);
103 98
@@ -113,7 +108,7 @@ void __init smp_init_cpus(void)
113 set_smp_cross_call(gic_raise_softirq); 108 set_smp_cross_call(gic_raise_softirq);
114} 109}
115 110
116void __init platform_smp_prepare_cpus(unsigned int max_cpus) 111static void __init spear13xx_smp_prepare_cpus(unsigned int max_cpus)
117{ 112{
118 113
119 scu_enable(scu_base); 114 scu_enable(scu_base);
@@ -125,3 +120,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
125 */ 120 */
126 __raw_writel(virt_to_phys(spear13xx_secondary_startup), SYS_LOCATION); 121 __raw_writel(virt_to_phys(spear13xx_secondary_startup), SYS_LOCATION);
127} 122}
123
124struct smp_operations spear13xx_smp_ops __initdata = {
125 .smp_init_cpus = spear13xx_smp_init_cpus,
126 .smp_prepare_cpus = spear13xx_smp_prepare_cpus,
127 .smp_secondary_init = spear13xx_secondary_init,
128 .smp_boot_secondary = spear13xx_boot_secondary,
129#ifdef CONFIG_HOTPLUG_CPU
130 .cpu_die = spear13xx_cpu_die,
131#endif
132};
diff --git a/arch/arm/mach-spear13xx/spear1310.c b/arch/arm/mach-spear13xx/spear1310.c
index 732d29bc733..9fbbfc5650a 100644
--- a/arch/arm/mach-spear13xx/spear1310.c
+++ b/arch/arm/mach-spear13xx/spear1310.c
@@ -78,6 +78,7 @@ static void __init spear1310_map_io(void)
78} 78}
79 79
80DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree") 80DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree")
81 .smp = smp_ops(spear13xx_smp_ops),
81 .map_io = spear1310_map_io, 82 .map_io = spear1310_map_io,
82 .init_irq = spear13xx_dt_init_irq, 83 .init_irq = spear13xx_dt_init_irq,
83 .handle_irq = gic_handle_irq, 84 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-spear13xx/spear1340.c b/arch/arm/mach-spear13xx/spear1340.c
index 81e4ed76ad0..081014fb314 100644
--- a/arch/arm/mach-spear13xx/spear1340.c
+++ b/arch/arm/mach-spear13xx/spear1340.c
@@ -182,6 +182,7 @@ static const char * const spear1340_dt_board_compat[] = {
182}; 182};
183 183
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 .map_io = spear13xx_map_io, 186 .map_io = spear13xx_map_io,
186 .init_irq = spear13xx_dt_init_irq, 187 .init_irq = spear13xx_dt_init_irq,
187 .handle_irq = gic_handle_irq, 188 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-spear13xx/spear13xx.c b/arch/arm/mach-spear13xx/spear13xx.c
index cf936b106e2..5633d698f1e 100644
--- a/arch/arm/mach-spear13xx/spear13xx.c
+++ b/arch/arm/mach-spear13xx/spear13xx.c
@@ -78,6 +78,9 @@ struct dw_dma_platform_data dmac_plat_data = {
78 .nr_channels = 8, 78 .nr_channels = 8,
79 .chan_allocation_order = CHAN_ALLOCATION_DESCENDING, 79 .chan_allocation_order = CHAN_ALLOCATION_DESCENDING,
80 .chan_priority = CHAN_PRIORITY_DESCENDING, 80 .chan_priority = CHAN_PRIORITY_DESCENDING,
81 .block_size = 4095U,
82 .nr_masters = 2,
83 .data_width = { 3, 3, 0, 0 },
81}; 84};
82 85
83void __init spear13xx_l2x0_init(void) 86void __init spear13xx_l2x0_init(void)
@@ -114,17 +117,17 @@ void __init spear13xx_l2x0_init(void)
114 */ 117 */
115struct map_desc spear13xx_io_desc[] __initdata = { 118struct map_desc spear13xx_io_desc[] __initdata = {
116 { 119 {
117 .virtual = VA_PERIP_GRP2_BASE, 120 .virtual = (unsigned long)VA_PERIP_GRP2_BASE,
118 .pfn = __phys_to_pfn(PERIP_GRP2_BASE), 121 .pfn = __phys_to_pfn(PERIP_GRP2_BASE),
119 .length = SZ_16M, 122 .length = SZ_16M,
120 .type = MT_DEVICE 123 .type = MT_DEVICE
121 }, { 124 }, {
122 .virtual = VA_PERIP_GRP1_BASE, 125 .virtual = (unsigned long)VA_PERIP_GRP1_BASE,
123 .pfn = __phys_to_pfn(PERIP_GRP1_BASE), 126 .pfn = __phys_to_pfn(PERIP_GRP1_BASE),
124 .length = SZ_16M, 127 .length = SZ_16M,
125 .type = MT_DEVICE 128 .type = MT_DEVICE
126 }, { 129 }, {
127 .virtual = VA_A9SM_AND_MPMC_BASE, 130 .virtual = (unsigned long)VA_A9SM_AND_MPMC_BASE,
128 .pfn = __phys_to_pfn(A9SM_AND_MPMC_BASE), 131 .pfn = __phys_to_pfn(A9SM_AND_MPMC_BASE),
129 .length = SZ_16M, 132 .length = SZ_16M,
130 .type = MT_DEVICE 133 .type = MT_DEVICE
diff --git a/arch/arm/mach-spear3xx/Makefile.boot b/arch/arm/mach-spear3xx/Makefile.boot
index d93e2177e6e..4674a4c221d 100644
--- a/arch/arm/mach-spear3xx/Makefile.boot
+++ b/arch/arm/mach-spear3xx/Makefile.boot
@@ -1,7 +1,3 @@
1zreladdr-y += 0x00008000 1zreladdr-y += 0x00008000
2params_phys-y := 0x00000100 2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000 3initrd_phys-y := 0x00800000
4
5dtb-$(CONFIG_MACH_SPEAR300) += spear300-evb.dtb
6dtb-$(CONFIG_MACH_SPEAR310) += spear310-evb.dtb
7dtb-$(CONFIG_MACH_SPEAR320) += spear320-evb.dtb
diff --git a/arch/arm/mach-spear3xx/include/mach/gpio.h b/arch/arm/mach-spear3xx/include/mach/gpio.h
deleted file mode 100644
index 2ac74c6db7f..00000000000
--- a/arch/arm/mach-spear3xx/include/mach/gpio.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/gpio.h
3 *
4 * GPIO macros for SPEAr3xx machine family
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 __MACH_GPIO_H
15#define __MACH_GPIO_H
16
17#include <plat/gpio.h>
18
19#endif /* __MACH_GPIO_H */
diff --git a/arch/arm/mach-spear6xx/Makefile.boot b/arch/arm/mach-spear6xx/Makefile.boot
index af493da37ab..4674a4c221d 100644
--- a/arch/arm/mach-spear6xx/Makefile.boot
+++ b/arch/arm/mach-spear6xx/Makefile.boot
@@ -1,5 +1,3 @@
1zreladdr-y += 0x00008000 1zreladdr-y += 0x00008000
2params_phys-y := 0x00000100 2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000 3initrd_phys-y := 0x00800000
4
5dtb-$(CONFIG_BOARD_SPEAR600_DT) += spear600-evb.dtb
diff --git a/arch/arm/mach-spear6xx/include/mach/gpio.h b/arch/arm/mach-spear6xx/include/mach/gpio.h
deleted file mode 100644
index d42cefc0356..00000000000
--- a/arch/arm/mach-spear6xx/include/mach/gpio.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/gpio.h
3 *
4 * GPIO macros for SPEAr6xx machine family
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 __MACH_GPIO_H
15#define __MACH_GPIO_H
16
17#include <plat/gpio.h>
18
19#endif /* __MACH_GPIO_H */
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 9077aaa398d..9ff6f6ea361 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -4,43 +4,42 @@ 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 CPU_V7
8 select ARM_GIC
9 select ARCH_REQUIRE_GPIOLIB 7 select ARCH_REQUIRE_GPIOLIB
10 select PINCTRL
11 select PINCTRL_TEGRA20
12 select USB_ARCH_HAS_EHCI if USB_SUPPORT
13 select USB_ULPI if USB
14 select USB_ULPI_VIEWPORT if USB_SUPPORT
15 select ARM_ERRATA_720789 8 select ARM_ERRATA_720789
16 select ARM_ERRATA_742230 9 select ARM_ERRATA_742230
17 select ARM_ERRATA_751472 10 select ARM_ERRATA_751472
18 select ARM_ERRATA_754327 11 select ARM_ERRATA_754327
19 select ARM_ERRATA_764369 12 select ARM_ERRATA_764369 if SMP
13 select ARM_GIC
14 select CPU_FREQ_TABLE if CPU_FREQ
15 select CPU_V7
16 select PINCTRL
17 select PINCTRL_TEGRA20
20 select PL310_ERRATA_727915 if CACHE_L2X0 18 select PL310_ERRATA_727915 if CACHE_L2X0
21 select PL310_ERRATA_769419 if CACHE_L2X0 19 select PL310_ERRATA_769419 if CACHE_L2X0
22 select CPU_FREQ_TABLE if CPU_FREQ 20 select USB_ARCH_HAS_EHCI if USB_SUPPORT
21 select USB_ULPI if USB
22 select USB_ULPI_VIEWPORT if USB_SUPPORT
23 help 23 help
24 Support for NVIDIA Tegra AP20 and T20 processors, based on the 24 Support for NVIDIA Tegra AP20 and T20 processors, based on the
25 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller 25 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
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 CPU_V7
30 select ARM_GIC
31 select ARCH_REQUIRE_GPIOLIB 29 select ARCH_REQUIRE_GPIOLIB
30 select ARM_ERRATA_743622
31 select ARM_ERRATA_751472
32 select ARM_ERRATA_754322
33 select ARM_ERRATA_764369 if SMP
34 select ARM_GIC
35 select CPU_FREQ_TABLE if CPU_FREQ
36 select CPU_V7
32 select PINCTRL 37 select PINCTRL
33 select PINCTRL_TEGRA30 38 select PINCTRL_TEGRA30
39 select PL310_ERRATA_769419 if CACHE_L2X0
34 select USB_ARCH_HAS_EHCI if USB_SUPPORT 40 select USB_ARCH_HAS_EHCI if USB_SUPPORT
35 select USB_ULPI if USB 41 select USB_ULPI if USB
36 select USB_ULPI_VIEWPORT if USB_SUPPORT 42 select USB_ULPI_VIEWPORT if USB_SUPPORT
37 select USE_OF
38 select ARM_ERRATA_743622
39 select ARM_ERRATA_751472
40 select ARM_ERRATA_754322
41 select ARM_ERRATA_764369
42 select PL310_ERRATA_769419 if CACHE_L2X0
43 select CPU_FREQ_TABLE if CPU_FREQ
44 help 43 help
45 Support for NVIDIA Tegra T30 processor family, based on the 44 Support for NVIDIA Tegra T30 processor family, based on the
46 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller 45 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
@@ -58,27 +57,6 @@ config TEGRA_AHB
58 which controls AHB bus master arbitration and some 57 which controls AHB bus master arbitration and some
59 perfomance parameters(priority, prefech size). 58 perfomance parameters(priority, prefech size).
60 59
61comment "Tegra board type"
62
63config MACH_HARMONY
64 bool "Harmony board"
65 depends on ARCH_TEGRA_2x_SOC
66 help
67 Support for nVidia Harmony development platform
68
69config MACH_PAZ00
70 bool "Paz00 board"
71 depends on ARCH_TEGRA_2x_SOC
72 help
73 Support for the Toshiba AC100/Dynabook AZ netbook
74
75config MACH_TRIMSLICE
76 bool "TrimSlice board"
77 depends on ARCH_TEGRA_2x_SOC
78 select TEGRA_PCI
79 help
80 Support for CompuLab TrimSlice platform
81
82choice 60choice
83 prompt "Default low-level debug console UART" 61 prompt "Default low-level debug console UART"
84 default TEGRA_DEBUG_UART_NONE 62 default TEGRA_DEBUG_UART_NONE
@@ -130,13 +108,6 @@ config TEGRA_DEBUG_UART_AUTO_SCRATCH
130 108
131endchoice 109endchoice
132 110
133config TEGRA_SYSTEM_DMA
134 bool "Enable system DMA driver for NVIDIA Tegra SoCs"
135 default y
136 help
137 Adds system DMA functionality for NVIDIA Tegra SoCs, used by
138 several Tegra device drivers
139
140config TEGRA_EMC_SCALING_ENABLE 111config TEGRA_EMC_SCALING_ENABLE
141 bool "Enable scaling the memory frequency" 112 bool "Enable scaling the memory frequency"
142 113
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index c3d7303b9ac..9aa653b3eb3 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -1,6 +1,4 @@
1obj-y += board-pinmux.o
2obj-y += common.o 1obj-y += common.o
3obj-y += devices.o
4obj-y += io.o 2obj-y += io.o
5obj-y += irq.o 3obj-y += irq.o
6obj-y += clock.o 4obj-y += clock.o
@@ -12,27 +10,22 @@ obj-y += powergate.o
12obj-y += apbio.o 10obj-y += apbio.o
13obj-$(CONFIG_CPU_IDLE) += cpuidle.o 11obj-$(CONFIG_CPU_IDLE) += cpuidle.o
14obj-$(CONFIG_CPU_IDLE) += sleep.o 12obj-$(CONFIG_CPU_IDLE) += sleep.o
15obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_clocks.o 13obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_clocks.o
14obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_clocks_data.o
16obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o 15obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o
16obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += sleep-t20.o
17obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks.o 17obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks.o
18obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks_data.o
19obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += sleep-t30.o
18obj-$(CONFIG_SMP) += platsmp.o headsmp.o 20obj-$(CONFIG_SMP) += platsmp.o headsmp.o
19obj-$(CONFIG_SMP) += reset.o 21obj-$(CONFIG_SMP) += reset.o
20obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 22obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
21obj-$(CONFIG_TEGRA_SYSTEM_DMA) += dma.o
22obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o 23obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o
23obj-$(CONFIG_TEGRA_PCI) += pcie.o 24obj-$(CONFIG_TEGRA_PCI) += pcie.o
24obj-$(CONFIG_USB_SUPPORT) += usb_phy.o
25 25
26obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o 26obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o
27obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o 27obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
28 28
29obj-$(CONFIG_MACH_HARMONY) += board-harmony.o 29obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-harmony-pcie.o
30obj-$(CONFIG_MACH_HARMONY) += board-harmony-pinmux.o
31obj-$(CONFIG_MACH_HARMONY) += board-harmony-pcie.o
32obj-$(CONFIG_MACH_HARMONY) += board-harmony-power.o
33 30
34obj-$(CONFIG_MACH_PAZ00) += board-paz00.o 31obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-paz00.o
35obj-$(CONFIG_MACH_PAZ00) += board-paz00-pinmux.o
36
37obj-$(CONFIG_MACH_TRIMSLICE) += board-trimslice.o
38obj-$(CONFIG_MACH_TRIMSLICE) += board-trimslice-pinmux.o
diff --git a/arch/arm/mach-tegra/Makefile.boot b/arch/arm/mach-tegra/Makefile.boot
index 7a1bb62ddcf..29433816233 100644
--- a/arch/arm/mach-tegra/Makefile.boot
+++ b/arch/arm/mach-tegra/Makefile.boot
@@ -1,11 +1,3 @@
1zreladdr-$(CONFIG_ARCH_TEGRA_2x_SOC) += 0x00008000 1zreladdr-$(CONFIG_ARCH_TEGRA_2x_SOC) += 0x00008000
2params_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00000100 2params_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00000100
3initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00800000 3initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00800000
4
5dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20-harmony.dtb
6dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20-paz00.dtb
7dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20-seaboard.dtb
8dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20-trimslice.dtb
9dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20-ventana.dtb
10dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20-whistler.dtb
11dtb-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30-cardhu.dtb
diff --git a/arch/arm/mach-tegra/apbio.c b/arch/arm/mach-tegra/apbio.c
index dc0fe389be5..b5015d0f191 100644
--- a/arch/arm/mach-tegra/apbio.c
+++ b/arch/arm/mach-tegra/apbio.c
@@ -28,7 +28,7 @@
28 28
29#include "apbio.h" 29#include "apbio.h"
30 30
31#if defined(CONFIG_TEGRA_SYSTEM_DMA) || defined(CONFIG_TEGRA20_APB_DMA) 31#if defined(CONFIG_TEGRA20_APB_DMA)
32static DEFINE_MUTEX(tegra_apb_dma_lock); 32static DEFINE_MUTEX(tegra_apb_dma_lock);
33static u32 *tegra_apb_bb; 33static u32 *tegra_apb_bb;
34static dma_addr_t tegra_apb_bb_phys; 34static dma_addr_t tegra_apb_bb_phys;
@@ -37,121 +37,6 @@ static DECLARE_COMPLETION(tegra_apb_wait);
37static u32 tegra_apb_readl_direct(unsigned long offset); 37static u32 tegra_apb_readl_direct(unsigned long offset);
38static void tegra_apb_writel_direct(u32 value, unsigned long offset); 38static void tegra_apb_writel_direct(u32 value, unsigned long offset);
39 39
40#if defined(CONFIG_TEGRA_SYSTEM_DMA)
41static struct tegra_dma_channel *tegra_apb_dma;
42
43bool tegra_apb_init(void)
44{
45 struct tegra_dma_channel *ch;
46
47 mutex_lock(&tegra_apb_dma_lock);
48
49 /* Check to see if we raced to setup */
50 if (tegra_apb_dma)
51 goto out;
52
53 ch = tegra_dma_allocate_channel(TEGRA_DMA_MODE_ONESHOT |
54 TEGRA_DMA_SHARED);
55
56 if (!ch)
57 goto out_fail;
58
59 tegra_apb_bb = dma_alloc_coherent(NULL, sizeof(u32),
60 &tegra_apb_bb_phys, GFP_KERNEL);
61 if (!tegra_apb_bb) {
62 pr_err("%s: can not allocate bounce buffer\n", __func__);
63 tegra_dma_free_channel(ch);
64 goto out_fail;
65 }
66
67 tegra_apb_dma = ch;
68out:
69 mutex_unlock(&tegra_apb_dma_lock);
70 return true;
71
72out_fail:
73 mutex_unlock(&tegra_apb_dma_lock);
74 return false;
75}
76
77static void apb_dma_complete(struct tegra_dma_req *req)
78{
79 complete(&tegra_apb_wait);
80}
81
82static u32 tegra_apb_readl_using_dma(unsigned long offset)
83{
84 struct tegra_dma_req req;
85 int ret;
86
87 if (!tegra_apb_dma && !tegra_apb_init())
88 return tegra_apb_readl_direct(offset);
89
90 mutex_lock(&tegra_apb_dma_lock);
91 req.complete = apb_dma_complete;
92 req.to_memory = 1;
93 req.dest_addr = tegra_apb_bb_phys;
94 req.dest_bus_width = 32;
95 req.dest_wrap = 1;
96 req.source_addr = offset;
97 req.source_bus_width = 32;
98 req.source_wrap = 4;
99 req.req_sel = TEGRA_DMA_REQ_SEL_CNTR;
100 req.size = 4;
101
102 INIT_COMPLETION(tegra_apb_wait);
103
104 tegra_dma_enqueue_req(tegra_apb_dma, &req);
105
106 ret = wait_for_completion_timeout(&tegra_apb_wait,
107 msecs_to_jiffies(50));
108
109 if (WARN(ret == 0, "apb read dma timed out")) {
110 tegra_dma_dequeue_req(tegra_apb_dma, &req);
111 *(u32 *)tegra_apb_bb = 0;
112 }
113
114 mutex_unlock(&tegra_apb_dma_lock);
115 return *((u32 *)tegra_apb_bb);
116}
117
118static void tegra_apb_writel_using_dma(u32 value, unsigned long offset)
119{
120 struct tegra_dma_req req;
121 int ret;
122
123 if (!tegra_apb_dma && !tegra_apb_init()) {
124 tegra_apb_writel_direct(value, offset);
125 return;
126 }
127
128 mutex_lock(&tegra_apb_dma_lock);
129 *((u32 *)tegra_apb_bb) = value;
130 req.complete = apb_dma_complete;
131 req.to_memory = 0;
132 req.dest_addr = offset;
133 req.dest_wrap = 4;
134 req.dest_bus_width = 32;
135 req.source_addr = tegra_apb_bb_phys;
136 req.source_bus_width = 32;
137 req.source_wrap = 1;
138 req.req_sel = TEGRA_DMA_REQ_SEL_CNTR;
139 req.size = 4;
140
141 INIT_COMPLETION(tegra_apb_wait);
142
143 tegra_dma_enqueue_req(tegra_apb_dma, &req);
144
145 ret = wait_for_completion_timeout(&tegra_apb_wait,
146 msecs_to_jiffies(50));
147
148 if (WARN(ret == 0, "apb write dma timed out"))
149 tegra_dma_dequeue_req(tegra_apb_dma, &req);
150
151 mutex_unlock(&tegra_apb_dma_lock);
152}
153
154#else
155static struct dma_chan *tegra_apb_dma_chan; 40static struct dma_chan *tegra_apb_dma_chan;
156static struct dma_slave_config dma_sconfig; 41static struct dma_slave_config dma_sconfig;
157 42
@@ -279,7 +164,6 @@ static void tegra_apb_writel_using_dma(u32 value, unsigned long offset)
279 pr_err("error in writing offset 0x%08lx using dma\n", offset); 164 pr_err("error in writing offset 0x%08lx using dma\n", offset);
280 mutex_unlock(&tegra_apb_dma_lock); 165 mutex_unlock(&tegra_apb_dma_lock);
281} 166}
282#endif
283#else 167#else
284#define tegra_apb_readl_using_dma tegra_apb_readl_direct 168#define tegra_apb_readl_using_dma tegra_apb_readl_direct
285#define tegra_apb_writel_using_dma tegra_apb_writel_direct 169#define tegra_apb_writel_using_dma tegra_apb_writel_direct
@@ -293,12 +177,12 @@ static apbio_write_fptr apbio_write;
293 177
294static u32 tegra_apb_readl_direct(unsigned long offset) 178static u32 tegra_apb_readl_direct(unsigned long offset)
295{ 179{
296 return readl(IO_TO_VIRT(offset)); 180 return readl(IO_ADDRESS(offset));
297} 181}
298 182
299static void tegra_apb_writel_direct(u32 value, unsigned long offset) 183static void tegra_apb_writel_direct(u32 value, unsigned long offset)
300{ 184{
301 writel(value, IO_TO_VIRT(offset)); 185 writel(value, IO_ADDRESS(offset));
302} 186}
303 187
304void tegra_apb_io_init(void) 188void tegra_apb_io_init(void)
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c
index c0999633a9a..57e235f4ac7 100644
--- a/arch/arm/mach-tegra/board-dt-tegra20.c
+++ b/arch/arm/mach-tegra/board-dt-tegra20.c
@@ -28,9 +28,11 @@
28#include <linux/of_irq.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/io.h> 32#include <linux/io.h>
32#include <linux/i2c.h> 33#include <linux/i2c.h>
33#include <linux/i2c-tegra.h> 34#include <linux/i2c-tegra.h>
35#include <linux/usb/tegra_usb_phy.h>
34 36
35#include <asm/hardware/gic.h> 37#include <asm/hardware/gic.h>
36#include <asm/mach-types.h> 38#include <asm/mach-types.h>
@@ -42,9 +44,32 @@
42#include <mach/irqs.h> 44#include <mach/irqs.h>
43 45
44#include "board.h" 46#include "board.h"
45#include "board-harmony.h"
46#include "clock.h" 47#include "clock.h"
47#include "devices.h" 48#include "common.h"
49
50struct tegra_ehci_platform_data tegra_ehci1_pdata = {
51 .operating_mode = TEGRA_USB_OTG,
52 .power_down_on_bus_suspend = 1,
53 .vbus_gpio = -1,
54};
55
56struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
57 .reset_gpio = -1,
58 .clk = "cdev2",
59};
60
61struct tegra_ehci_platform_data tegra_ehci2_pdata = {
62 .phy_config = &tegra_ehci2_ulpi_phy_config,
63 .operating_mode = TEGRA_USB_HOST,
64 .power_down_on_bus_suspend = 1,
65 .vbus_gpio = -1,
66};
67
68struct tegra_ehci_platform_data tegra_ehci3_pdata = {
69 .operating_mode = TEGRA_USB_HOST,
70 .power_down_on_bus_suspend = 1,
71 .vbus_gpio = -1,
72};
48 73
49struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = { 74struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
50 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC1_BASE, "sdhci-tegra.0", NULL), 75 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC1_BASE, "sdhci-tegra.0", NULL),
@@ -71,6 +96,7 @@ struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
71 96
72static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = { 97static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
73 /* name parent rate enabled */ 98 /* name parent rate enabled */
99 { "uarta", "pll_p", 216000000, true },
74 { "uartd", "pll_p", 216000000, true }, 100 { "uartd", "pll_p", 216000000, true },
75 { "usbd", "clk_m", 12000000, false }, 101 { "usbd", "clk_m", 12000000, false },
76 { "usb2", "clk_m", 12000000, false }, 102 { "usb2", "clk_m", 12000000, false },
@@ -95,54 +121,40 @@ static void __init tegra_dt_init(void)
95 tegra20_auxdata_lookup, NULL); 121 tegra20_auxdata_lookup, NULL);
96} 122}
97 123
98#ifdef CONFIG_MACH_TRIMSLICE
99static void __init trimslice_init(void) 124static void __init trimslice_init(void)
100{ 125{
126#ifdef CONFIG_TEGRA_PCI
101 int ret; 127 int ret;
102 128
103 ret = tegra_pcie_init(true, true); 129 ret = tegra_pcie_init(true, true);
104 if (ret) 130 if (ret)
105 pr_err("tegra_pci_init() failed: %d\n", ret); 131 pr_err("tegra_pci_init() failed: %d\n", ret);
106}
107#endif 132#endif
133}
108 134
109#ifdef CONFIG_MACH_HARMONY
110static void __init harmony_init(void) 135static void __init harmony_init(void)
111{ 136{
137#ifdef CONFIG_TEGRA_PCI
112 int ret; 138 int ret;
113 139
114 ret = harmony_regulator_init();
115 if (ret) {
116 pr_err("harmony_regulator_init() failed: %d\n", ret);
117 return;
118 }
119
120 ret = harmony_pcie_init(); 140 ret = harmony_pcie_init();
121 if (ret) 141 if (ret)
122 pr_err("harmony_pcie_init() failed: %d\n", ret); 142 pr_err("harmony_pcie_init() failed: %d\n", ret);
123}
124#endif 143#endif
144}
125 145
126#ifdef CONFIG_MACH_PAZ00
127static void __init paz00_init(void) 146static void __init paz00_init(void)
128{ 147{
129 tegra_paz00_wifikill_init(); 148 tegra_paz00_wifikill_init();
130} 149}
131#endif
132 150
133static struct { 151static struct {
134 char *machine; 152 char *machine;
135 void (*init)(void); 153 void (*init)(void);
136} board_init_funcs[] = { 154} board_init_funcs[] = {
137#ifdef CONFIG_MACH_TRIMSLICE
138 { "compulab,trimslice", trimslice_init }, 155 { "compulab,trimslice", trimslice_init },
139#endif
140#ifdef CONFIG_MACH_HARMONY
141 { "nvidia,harmony", harmony_init }, 156 { "nvidia,harmony", harmony_init },
142#endif
143#ifdef CONFIG_MACH_PAZ00
144 { "compal,paz00", paz00_init }, 157 { "compal,paz00", paz00_init },
145#endif
146}; 158};
147 159
148static void __init tegra_dt_init_late(void) 160static void __init tegra_dt_init_late(void)
@@ -166,6 +178,7 @@ static const char *tegra20_dt_board_compat[] = {
166 178
167DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)") 179DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)")
168 .map_io = tegra_map_common_io, 180 .map_io = tegra_map_common_io,
181 .smp = smp_ops(tegra_smp_ops),
169 .init_early = tegra20_init_early, 182 .init_early = tegra20_init_early,
170 .init_irq = tegra_dt_init_irq, 183 .init_irq = tegra_dt_init_irq,
171 .handle_irq = gic_handle_irq, 184 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index 53bf60f1158..e4a676d4ddf 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -37,6 +37,7 @@
37 37
38#include "board.h" 38#include "board.h"
39#include "clock.h" 39#include "clock.h"
40#include "common.h"
40 41
41struct of_dev_auxdata tegra30_auxdata_lookup[] __initdata = { 42struct 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", 0x78000000, "sdhci-tegra.0", NULL),
@@ -83,6 +84,7 @@ static const char *tegra30_dt_board_compat[] = {
83}; 84};
84 85
85DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)") 86DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
87 .smp = smp_ops(tegra_smp_ops),
86 .map_io = tegra_map_common_io, 88 .map_io = tegra_map_common_io,
87 .init_early = tegra30_init_early, 89 .init_early = tegra30_init_early,
88 .init_irq = tegra_dt_init_irq, 90 .init_irq = tegra_dt_init_irq,
diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c
index e8c3fda9bec..3cdc1bb8254 100644
--- a/arch/arm/mach-tegra/board-harmony-pcie.c
+++ b/arch/arm/mach-tegra/board-harmony-pcie.c
@@ -18,35 +18,57 @@
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/err.h> 20#include <linux/err.h>
21#include <linux/of_gpio.h>
21#include <linux/regulator/consumer.h> 22#include <linux/regulator/consumer.h>
22 23
23#include <asm/mach-types.h> 24#include <asm/mach-types.h>
24 25
25#include "board.h" 26#include "board.h"
26#include "board-harmony.h"
27 27
28#ifdef CONFIG_TEGRA_PCI 28#ifdef CONFIG_TEGRA_PCI
29 29
30int __init harmony_pcie_init(void) 30int __init harmony_pcie_init(void)
31{ 31{
32 struct device_node *np;
33 int en_vdd_1v05;
32 struct regulator *regulator = NULL; 34 struct regulator *regulator = NULL;
33 int err; 35 int err;
34 36
35 err = gpio_request(TEGRA_GPIO_EN_VDD_1V05_GPIO, "EN_VDD_1V05"); 37 np = of_find_node_by_path("/regulators/regulator@3");
36 if (err) 38 if (!np) {
39 pr_err("%s: of_find_node_by_path failed\n", __func__);
40 return -ENODEV;
41 }
42
43 en_vdd_1v05 = of_get_named_gpio(np, "gpio", 0);
44 if (en_vdd_1v05 < 0) {
45 pr_err("%s: of_get_named_gpio failed: %d\n", __func__,
46 en_vdd_1v05);
47 return en_vdd_1v05;
48 }
49
50 err = gpio_request(en_vdd_1v05, "EN_VDD_1V05");
51 if (err) {
52 pr_err("%s: gpio_request failed: %d\n", __func__, err);
37 return err; 53 return err;
54 }
38 55
39 gpio_direction_output(TEGRA_GPIO_EN_VDD_1V05_GPIO, 1); 56 gpio_direction_output(en_vdd_1v05, 1);
40 57
41 regulator = regulator_get(NULL, "pex_clk"); 58 regulator = regulator_get(NULL, "vdd_ldo0,vddio_pex_clk");
42 if (IS_ERR_OR_NULL(regulator)) 59 if (IS_ERR_OR_NULL(regulator)) {
60 pr_err("%s: regulator_get failed: %d\n", __func__,
61 (int)PTR_ERR(regulator));
43 goto err_reg; 62 goto err_reg;
63 }
44 64
45 regulator_enable(regulator); 65 regulator_enable(regulator);
46 66
47 err = tegra_pcie_init(true, true); 67 err = tegra_pcie_init(true, true);
48 if (err) 68 if (err) {
69 pr_err("%s: tegra_pcie_init failed: %d\n", __func__, err);
49 goto err_pcie; 70 goto err_pcie;
71 }
50 72
51 return 0; 73 return 0;
52 74
@@ -54,20 +76,9 @@ err_pcie:
54 regulator_disable(regulator); 76 regulator_disable(regulator);
55 regulator_put(regulator); 77 regulator_put(regulator);
56err_reg: 78err_reg:
57 gpio_free(TEGRA_GPIO_EN_VDD_1V05_GPIO); 79 gpio_free(en_vdd_1v05);
58 80
59 return err; 81 return err;
60} 82}
61 83
62static int __init harmony_pcie_initcall(void)
63{
64 if (!machine_is_harmony())
65 return 0;
66
67 return harmony_pcie_init();
68}
69
70/* PCI should be initialized after I2C, mfd and regulators */
71subsys_initcall_sync(harmony_pcie_initcall);
72
73#endif 84#endif
diff --git a/arch/arm/mach-tegra/board-harmony-pinmux.c b/arch/arm/mach-tegra/board-harmony-pinmux.c
deleted file mode 100644
index 83d420fbc58..00000000000
--- a/arch/arm/mach-tegra/board-harmony-pinmux.c
+++ /dev/null
@@ -1,156 +0,0 @@
1/*
2 * arch/arm/mach-tegra/board-harmony-pinmux.c
3 *
4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#include <linux/kernel.h>
19
20#include "board-harmony.h"
21#include "board-pinmux.h"
22
23static struct pinctrl_map harmony_map[] = {
24 TEGRA_MAP_MUXCONF("ata", "ide", none, driven),
25 TEGRA_MAP_MUXCONF("atb", "sdio4", none, driven),
26 TEGRA_MAP_MUXCONF("atc", "nand", none, driven),
27 TEGRA_MAP_MUXCONF("atd", "gmi", none, driven),
28 TEGRA_MAP_MUXCONF("ate", "gmi", none, driven),
29 TEGRA_MAP_MUXCONF("cdev1", "plla_out", none, driven),
30 TEGRA_MAP_MUXCONF("cdev2", "pllp_out4", down, tristate),
31 TEGRA_MAP_MUXCONF("crtp", "crt", none, tristate),
32 TEGRA_MAP_MUXCONF("csus", "vi_sensor_clk", down, tristate),
33 TEGRA_MAP_MUXCONF("dap1", "dap1", none, driven),
34 TEGRA_MAP_MUXCONF("dap2", "dap2", none, tristate),
35 TEGRA_MAP_MUXCONF("dap3", "dap3", none, tristate),
36 TEGRA_MAP_MUXCONF("dap4", "dap4", none, tristate),
37 TEGRA_MAP_MUXCONF("ddc", "i2c2", up, driven),
38 TEGRA_MAP_MUXCONF("dta", "sdio2", up, driven),
39 TEGRA_MAP_MUXCONF("dtb", "rsvd1", none, driven),
40 TEGRA_MAP_MUXCONF("dtc", "rsvd1", none, tristate),
41 TEGRA_MAP_MUXCONF("dtd", "sdio2", up, driven),
42 TEGRA_MAP_MUXCONF("dte", "rsvd1", none, tristate),
43 TEGRA_MAP_MUXCONF("dtf", "i2c3", none, tristate),
44 TEGRA_MAP_MUXCONF("gma", "sdio4", none, driven),
45 TEGRA_MAP_MUXCONF("gmb", "gmi", none, driven),
46 TEGRA_MAP_MUXCONF("gmc", "uartd", none, driven),
47 TEGRA_MAP_MUXCONF("gmd", "gmi", none, driven),
48 TEGRA_MAP_MUXCONF("gme", "sdio4", none, driven),
49 TEGRA_MAP_MUXCONF("gpu", "gmi", none, tristate),
50 TEGRA_MAP_MUXCONF("gpu7", "rtck", none, driven),
51 TEGRA_MAP_MUXCONF("gpv", "pcie", none, driven),
52 TEGRA_MAP_MUXCONF("hdint", "hdmi", na, tristate),
53 TEGRA_MAP_MUXCONF("i2cp", "i2cp", none, driven),
54 TEGRA_MAP_MUXCONF("irrx", "uarta", up, tristate),
55 TEGRA_MAP_MUXCONF("irtx", "uarta", up, tristate),
56 TEGRA_MAP_MUXCONF("kbca", "kbc", up, driven),
57 TEGRA_MAP_MUXCONF("kbcb", "kbc", up, driven),
58 TEGRA_MAP_MUXCONF("kbcc", "kbc", up, driven),
59 TEGRA_MAP_MUXCONF("kbcd", "kbc", up, driven),
60 TEGRA_MAP_MUXCONF("kbce", "kbc", up, driven),
61 TEGRA_MAP_MUXCONF("kbcf", "kbc", up, driven),
62 TEGRA_MAP_MUXCONF("lcsn", "displaya", na, tristate),
63 TEGRA_MAP_MUXCONF("ld0", "displaya", na, driven),
64 TEGRA_MAP_MUXCONF("ld1", "displaya", na, driven),
65 TEGRA_MAP_MUXCONF("ld10", "displaya", na, driven),
66 TEGRA_MAP_MUXCONF("ld11", "displaya", na, driven),
67 TEGRA_MAP_MUXCONF("ld12", "displaya", na, driven),
68 TEGRA_MAP_MUXCONF("ld13", "displaya", na, driven),
69 TEGRA_MAP_MUXCONF("ld14", "displaya", na, driven),
70 TEGRA_MAP_MUXCONF("ld15", "displaya", na, driven),
71 TEGRA_MAP_MUXCONF("ld16", "displaya", na, driven),
72 TEGRA_MAP_MUXCONF("ld17", "displaya", na, driven),
73 TEGRA_MAP_MUXCONF("ld2", "displaya", na, driven),
74 TEGRA_MAP_MUXCONF("ld3", "displaya", na, driven),
75 TEGRA_MAP_MUXCONF("ld4", "displaya", na, driven),
76 TEGRA_MAP_MUXCONF("ld5", "displaya", na, driven),
77 TEGRA_MAP_MUXCONF("ld6", "displaya", na, driven),
78 TEGRA_MAP_MUXCONF("ld7", "displaya", na, driven),
79 TEGRA_MAP_MUXCONF("ld8", "displaya", na, driven),
80 TEGRA_MAP_MUXCONF("ld9", "displaya", na, driven),
81 TEGRA_MAP_MUXCONF("ldc", "displaya", na, tristate),
82 TEGRA_MAP_MUXCONF("ldi", "displaya", na, driven),
83 TEGRA_MAP_MUXCONF("lhp0", "displaya", na, driven),
84 TEGRA_MAP_MUXCONF("lhp1", "displaya", na, driven),
85 TEGRA_MAP_MUXCONF("lhp2", "displaya", na, driven),
86 TEGRA_MAP_MUXCONF("lhs", "displaya", na, driven),
87 TEGRA_MAP_MUXCONF("lm0", "displaya", na, driven),
88 TEGRA_MAP_MUXCONF("lm1", "displaya", na, tristate),
89 TEGRA_MAP_MUXCONF("lpp", "displaya", na, driven),
90 TEGRA_MAP_MUXCONF("lpw0", "displaya", na, driven),
91 TEGRA_MAP_MUXCONF("lpw1", "displaya", na, tristate),
92 TEGRA_MAP_MUXCONF("lpw2", "displaya", na, driven),
93 TEGRA_MAP_MUXCONF("lsc0", "displaya", na, driven),
94 TEGRA_MAP_MUXCONF("lsc1", "displaya", na, tristate),
95 TEGRA_MAP_MUXCONF("lsck", "displaya", na, tristate),
96 TEGRA_MAP_MUXCONF("lsda", "displaya", na, tristate),
97 TEGRA_MAP_MUXCONF("lsdi", "displaya", na, tristate),
98 TEGRA_MAP_MUXCONF("lspi", "displaya", na, driven),
99 TEGRA_MAP_MUXCONF("lvp0", "displaya", na, tristate),
100 TEGRA_MAP_MUXCONF("lvp1", "displaya", na, driven),
101 TEGRA_MAP_MUXCONF("lvs", "displaya", na, driven),
102 TEGRA_MAP_MUXCONF("owc", "rsvd2", na, tristate),
103 TEGRA_MAP_MUXCONF("pmc", "pwr_on", na, driven),
104 TEGRA_MAP_MUXCONF("pta", "hdmi", none, driven),
105 TEGRA_MAP_MUXCONF("rm", "i2c1", none, driven),
106 TEGRA_MAP_MUXCONF("sdb", "pwm", na, tristate),
107 TEGRA_MAP_MUXCONF("sdc", "pwm", up, driven),
108 TEGRA_MAP_MUXCONF("sdd", "pwm", up, tristate),
109 TEGRA_MAP_MUXCONF("sdio1", "sdio1", none, tristate),
110 TEGRA_MAP_MUXCONF("slxa", "pcie", none, driven),
111 TEGRA_MAP_MUXCONF("slxc", "spdif", none, tristate),
112 TEGRA_MAP_MUXCONF("slxd", "spdif", none, tristate),
113 TEGRA_MAP_MUXCONF("slxk", "pcie", none, driven),
114 TEGRA_MAP_MUXCONF("spdi", "rsvd2", none, tristate),
115 TEGRA_MAP_MUXCONF("spdo", "rsvd2", none, tristate),
116 TEGRA_MAP_MUXCONF("spia", "gmi", none, driven),
117 TEGRA_MAP_MUXCONF("spib", "gmi", none, driven),
118 TEGRA_MAP_MUXCONF("spic", "gmi", up, tristate),
119 TEGRA_MAP_MUXCONF("spid", "spi1", down, tristate),
120 TEGRA_MAP_MUXCONF("spie", "spi1", up, tristate),
121 TEGRA_MAP_MUXCONF("spif", "spi1", down, tristate),
122 TEGRA_MAP_MUXCONF("spig", "spi2_alt", none, tristate),
123 TEGRA_MAP_MUXCONF("spih", "spi2_alt", up, tristate),
124 TEGRA_MAP_MUXCONF("uaa", "ulpi", up, tristate),
125 TEGRA_MAP_MUXCONF("uab", "ulpi", up, tristate),
126 TEGRA_MAP_MUXCONF("uac", "rsvd2", none, tristate),
127 TEGRA_MAP_MUXCONF("uad", "irda", up, tristate),
128 TEGRA_MAP_MUXCONF("uca", "uartc", up, tristate),
129 TEGRA_MAP_MUXCONF("ucb", "uartc", up, tristate),
130 TEGRA_MAP_MUXCONF("uda", "ulpi", none, tristate),
131 TEGRA_MAP_CONF("ck32", none, na),
132 TEGRA_MAP_CONF("ddrc", none, na),
133 TEGRA_MAP_CONF("pmca", none, na),
134 TEGRA_MAP_CONF("pmcb", none, na),
135 TEGRA_MAP_CONF("pmcc", none, na),
136 TEGRA_MAP_CONF("pmcd", none, na),
137 TEGRA_MAP_CONF("pmce", none, na),
138 TEGRA_MAP_CONF("xm2c", none, na),
139 TEGRA_MAP_CONF("xm2d", none, na),
140 TEGRA_MAP_CONF("ls", up, na),
141 TEGRA_MAP_CONF("lc", up, na),
142 TEGRA_MAP_CONF("ld17_0", down, na),
143 TEGRA_MAP_CONF("ld19_18", down, na),
144 TEGRA_MAP_CONF("ld21_20", down, na),
145 TEGRA_MAP_CONF("ld23_22", down, na),
146};
147
148static struct tegra_board_pinmux_conf conf = {
149 .maps = harmony_map,
150 .map_count = ARRAY_SIZE(harmony_map),
151};
152
153void harmony_pinmux_init(void)
154{
155 tegra_board_pinmux_init(&conf, NULL);
156}
diff --git a/arch/arm/mach-tegra/board-harmony-power.c b/arch/arm/mach-tegra/board-harmony-power.c
deleted file mode 100644
index b7344beec10..00000000000
--- a/arch/arm/mach-tegra/board-harmony-power.c
+++ /dev/null
@@ -1,148 +0,0 @@
1/*
2 * Copyright (C) 2010 NVIDIA, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
16 * 02111-1307, USA
17 */
18#include <linux/i2c.h>
19#include <linux/platform_device.h>
20#include <linux/gpio.h>
21#include <linux/regulator/machine.h>
22#include <linux/regulator/fixed.h>
23#include <linux/mfd/tps6586x.h>
24#include <linux/of.h>
25#include <linux/of_i2c.h>
26
27#include <asm/mach-types.h>
28
29#include <mach/irqs.h>
30
31#include "board-harmony.h"
32
33static struct regulator_consumer_supply tps658621_ldo0_supply[] = {
34 REGULATOR_SUPPLY("pex_clk", NULL),
35};
36
37static struct regulator_init_data ldo0_data = {
38 .supply_regulator = "vdd_sm2",
39 .constraints = {
40 .name = "vdd_ldo0",
41 .min_uV = 3300 * 1000,
42 .max_uV = 3300 * 1000,
43 .valid_modes_mask = (REGULATOR_MODE_NORMAL |
44 REGULATOR_MODE_STANDBY),
45 .valid_ops_mask = (REGULATOR_CHANGE_MODE |
46 REGULATOR_CHANGE_STATUS |
47 REGULATOR_CHANGE_VOLTAGE),
48 .apply_uV = 1,
49 },
50 .num_consumer_supplies = ARRAY_SIZE(tps658621_ldo0_supply),
51 .consumer_supplies = tps658621_ldo0_supply,
52};
53
54#define HARMONY_REGULATOR_INIT(_id, _name, _supply, _minmv, _maxmv, _on)\
55 static struct regulator_init_data _id##_data = { \
56 .supply_regulator = _supply, \
57 .constraints = { \
58 .name = _name, \
59 .min_uV = (_minmv)*1000, \
60 .max_uV = (_maxmv)*1000, \
61 .valid_modes_mask = (REGULATOR_MODE_NORMAL | \
62 REGULATOR_MODE_STANDBY), \
63 .valid_ops_mask = (REGULATOR_CHANGE_MODE | \
64 REGULATOR_CHANGE_STATUS | \
65 REGULATOR_CHANGE_VOLTAGE), \
66 .always_on = _on, \
67 }, \
68 }
69
70HARMONY_REGULATOR_INIT(sm0, "vdd_sm0", "vdd_sys", 725, 1500, 1);
71HARMONY_REGULATOR_INIT(sm1, "vdd_sm1", "vdd_sys", 725, 1500, 1);
72HARMONY_REGULATOR_INIT(sm2, "vdd_sm2", "vdd_sys", 3000, 4550, 1);
73HARMONY_REGULATOR_INIT(ldo1, "vdd_ldo1", "vdd_sm2", 725, 1500, 1);
74HARMONY_REGULATOR_INIT(ldo2, "vdd_ldo2", "vdd_sm2", 725, 1500, 0);
75HARMONY_REGULATOR_INIT(ldo3, "vdd_ldo3", "vdd_sm2", 1250, 3300, 1);
76HARMONY_REGULATOR_INIT(ldo4, "vdd_ldo4", "vdd_sm2", 1700, 2475, 1);
77HARMONY_REGULATOR_INIT(ldo5, "vdd_ldo5", NULL, 1250, 3300, 1);
78HARMONY_REGULATOR_INIT(ldo6, "vdd_ldo6", "vdd_sm2", 1250, 3300, 0);
79HARMONY_REGULATOR_INIT(ldo7, "vdd_ldo7", "vdd_sm2", 1250, 3300, 0);
80HARMONY_REGULATOR_INIT(ldo8, "vdd_ldo8", "vdd_sm2", 1250, 3300, 0);
81HARMONY_REGULATOR_INIT(ldo9, "vdd_ldo9", "vdd_sm2", 1250, 3300, 1);
82
83#define TPS_REG(_id, _data) \
84 { \
85 .id = TPS6586X_ID_##_id, \
86 .name = "tps6586x-regulator", \
87 .platform_data = _data, \
88 }
89
90static struct tps6586x_subdev_info tps_devs[] = {
91 TPS_REG(SM_0, &sm0_data),
92 TPS_REG(SM_1, &sm1_data),
93 TPS_REG(SM_2, &sm2_data),
94 TPS_REG(LDO_0, &ldo0_data),
95 TPS_REG(LDO_1, &ldo1_data),
96 TPS_REG(LDO_2, &ldo2_data),
97 TPS_REG(LDO_3, &ldo3_data),
98 TPS_REG(LDO_4, &ldo4_data),
99 TPS_REG(LDO_5, &ldo5_data),
100 TPS_REG(LDO_6, &ldo6_data),
101 TPS_REG(LDO_7, &ldo7_data),
102 TPS_REG(LDO_8, &ldo8_data),
103 TPS_REG(LDO_9, &ldo9_data),
104};
105
106static struct tps6586x_platform_data tps_platform = {
107 .irq_base = TEGRA_NR_IRQS,
108 .num_subdevs = ARRAY_SIZE(tps_devs),
109 .subdevs = tps_devs,
110 .gpio_base = HARMONY_GPIO_TPS6586X(0),
111};
112
113static struct i2c_board_info __initdata harmony_regulators[] = {
114 {
115 I2C_BOARD_INFO("tps6586x", 0x34),
116 .irq = INT_EXTERNAL_PMU,
117 .platform_data = &tps_platform,
118 },
119};
120
121int __init harmony_regulator_init(void)
122{
123 regulator_register_always_on(0, "vdd_sys",
124 NULL, 0, 5000000);
125
126 if (machine_is_harmony()) {
127 i2c_register_board_info(3, harmony_regulators, 1);
128 } else { /* Harmony, booted using device tree */
129 struct device_node *np;
130 struct i2c_adapter *adapter;
131
132 np = of_find_node_by_path("/i2c@7000d000");
133 if (np == NULL) {
134 pr_err("Could not find device_node for DVC I2C\n");
135 return -ENODEV;
136 }
137
138 adapter = of_find_i2c_adapter_by_node(np);
139 if (!adapter) {
140 pr_err("Could not find i2c_adapter for DVC I2C\n");
141 return -ENODEV;
142 }
143
144 i2c_new_device(adapter, harmony_regulators);
145 }
146
147 return 0;
148}
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
deleted file mode 100644
index e65e837f401..00000000000
--- a/arch/arm/mach-tegra/board-harmony.c
+++ /dev/null
@@ -1,197 +0,0 @@
1/*
2 * arch/arm/mach-tegra/board-harmony.c
3 *
4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (C) 2011 NVIDIA, Inc.
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/platform_device.h>
21#include <linux/serial_8250.h>
22#include <linux/of_serial.h>
23#include <linux/clk.h>
24#include <linux/dma-mapping.h>
25#include <linux/pda_power.h>
26#include <linux/io.h>
27#include <linux/gpio.h>
28#include <linux/i2c.h>
29
30#include <sound/wm8903.h>
31
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34#include <asm/mach/time.h>
35#include <asm/hardware/gic.h>
36#include <asm/setup.h>
37
38#include <mach/tegra_wm8903_pdata.h>
39#include <mach/iomap.h>
40#include <mach/irqs.h>
41#include <mach/sdhci.h>
42
43#include "board.h"
44#include "board-harmony.h"
45#include "clock.h"
46#include "devices.h"
47#include "gpio-names.h"
48
49static struct plat_serial8250_port debug_uart_platform_data[] = {
50 {
51 .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
52 .mapbase = TEGRA_UARTD_BASE,
53 .irq = INT_UARTD,
54 .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
55 .type = PORT_TEGRA,
56 .handle_break = tegra_serial_handle_break,
57 .iotype = UPIO_MEM,
58 .regshift = 2,
59 .uartclk = 216000000,
60 }, {
61 .flags = 0
62 }
63};
64
65static struct platform_device debug_uart = {
66 .name = "serial8250",
67 .id = PLAT8250_DEV_PLATFORM,
68 .dev = {
69 .platform_data = debug_uart_platform_data,
70 },
71};
72
73static struct tegra_wm8903_platform_data harmony_audio_pdata = {
74 .gpio_spkr_en = TEGRA_GPIO_SPKR_EN,
75 .gpio_hp_det = TEGRA_GPIO_HP_DET,
76 .gpio_hp_mute = -1,
77 .gpio_int_mic_en = TEGRA_GPIO_INT_MIC_EN,
78 .gpio_ext_mic_en = TEGRA_GPIO_EXT_MIC_EN,
79};
80
81static struct platform_device harmony_audio_device = {
82 .name = "tegra-snd-wm8903",
83 .id = 0,
84 .dev = {
85 .platform_data = &harmony_audio_pdata,
86 },
87};
88
89static struct wm8903_platform_data harmony_wm8903_pdata = {
90 .irq_active_low = 0,
91 .micdet_cfg = 0,
92 .micdet_delay = 100,
93 .gpio_base = HARMONY_GPIO_WM8903(0),
94 .gpio_cfg = {
95 0,
96 0,
97 WM8903_GPIO_CONFIG_ZERO,
98 0,
99 0,
100 },
101};
102
103static struct i2c_board_info __initdata wm8903_board_info = {
104 I2C_BOARD_INFO("wm8903", 0x1a),
105 .platform_data = &harmony_wm8903_pdata,
106};
107
108static void __init harmony_i2c_init(void)
109{
110 platform_device_register(&tegra_i2c_device1);
111 platform_device_register(&tegra_i2c_device2);
112 platform_device_register(&tegra_i2c_device3);
113 platform_device_register(&tegra_i2c_device4);
114
115 wm8903_board_info.irq = gpio_to_irq(TEGRA_GPIO_CDC_IRQ);
116 i2c_register_board_info(0, &wm8903_board_info, 1);
117}
118
119static struct platform_device *harmony_devices[] __initdata = {
120 &debug_uart,
121 &tegra_sdhci_device1,
122 &tegra_sdhci_device2,
123 &tegra_sdhci_device4,
124 &tegra_ehci3_device,
125 &tegra_i2s_device1,
126 &tegra_das_device,
127 &harmony_audio_device,
128};
129
130static void __init tegra_harmony_fixup(struct tag *tags, char **cmdline,
131 struct meminfo *mi)
132{
133 mi->nr_banks = 2;
134 mi->bank[0].start = PHYS_OFFSET;
135 mi->bank[0].size = 448 * SZ_1M;
136 mi->bank[1].start = SZ_512M;
137 mi->bank[1].size = SZ_512M;
138}
139
140static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = {
141 /* name parent rate enabled */
142 { "uartd", "pll_p", 216000000, true },
143 { "pll_a", "pll_p_out1", 56448000, true },
144 { "pll_a_out0", "pll_a", 11289600, true },
145 { "cdev1", NULL, 0, true },
146 { "i2s1", "pll_a_out0", 11289600, false},
147 { "usb3", "clk_m", 12000000, true },
148 { NULL, NULL, 0, 0},
149};
150
151
152static struct tegra_sdhci_platform_data sdhci_pdata1 = {
153 .cd_gpio = -1,
154 .wp_gpio = -1,
155 .power_gpio = -1,
156};
157
158static struct tegra_sdhci_platform_data sdhci_pdata2 = {
159 .cd_gpio = TEGRA_GPIO_SD2_CD,
160 .wp_gpio = TEGRA_GPIO_SD2_WP,
161 .power_gpio = TEGRA_GPIO_SD2_POWER,
162};
163
164static struct tegra_sdhci_platform_data sdhci_pdata4 = {
165 .cd_gpio = TEGRA_GPIO_SD4_CD,
166 .wp_gpio = TEGRA_GPIO_SD4_WP,
167 .power_gpio = TEGRA_GPIO_SD4_POWER,
168 .is_8bit = 1,
169};
170
171static void __init tegra_harmony_init(void)
172{
173 tegra_clk_init_from_table(harmony_clk_init_table);
174
175 harmony_pinmux_init();
176
177 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
178 tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
179 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
180
181 platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
182 harmony_i2c_init();
183 harmony_regulator_init();
184}
185
186MACHINE_START(HARMONY, "harmony")
187 .atag_offset = 0x100,
188 .fixup = tegra_harmony_fixup,
189 .map_io = tegra_map_common_io,
190 .init_early = tegra20_init_early,
191 .init_irq = tegra_init_irq,
192 .handle_irq = gic_handle_irq,
193 .timer = &tegra_timer,
194 .init_machine = tegra_harmony_init,
195 .init_late = tegra_init_late,
196 .restart = tegra_assert_system_reset,
197MACHINE_END
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h
deleted file mode 100644
index 139d96c9384..00000000000
--- a/arch/arm/mach-tegra/board-harmony.h
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * arch/arm/mach-tegra/board-harmony.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#ifndef _MACH_TEGRA_BOARD_HARMONY_H
18#define _MACH_TEGRA_BOARD_HARMONY_H
19
20#include <mach/gpio-tegra.h>
21
22#define HARMONY_GPIO_TPS6586X(_x_) (TEGRA_NR_GPIOS + (_x_))
23#define HARMONY_GPIO_WM8903(_x_) (HARMONY_GPIO_TPS6586X(4) + (_x_))
24
25#define TEGRA_GPIO_SD2_CD TEGRA_GPIO_PI5
26#define TEGRA_GPIO_SD2_WP TEGRA_GPIO_PH1
27#define TEGRA_GPIO_SD2_POWER TEGRA_GPIO_PT3
28#define TEGRA_GPIO_SD4_CD TEGRA_GPIO_PH2
29#define TEGRA_GPIO_SD4_WP TEGRA_GPIO_PH3
30#define TEGRA_GPIO_SD4_POWER TEGRA_GPIO_PI6
31#define TEGRA_GPIO_CDC_IRQ TEGRA_GPIO_PX3
32#define TEGRA_GPIO_SPKR_EN HARMONY_GPIO_WM8903(2)
33#define TEGRA_GPIO_HP_DET TEGRA_GPIO_PW2
34#define TEGRA_GPIO_INT_MIC_EN TEGRA_GPIO_PX0
35#define TEGRA_GPIO_EXT_MIC_EN TEGRA_GPIO_PX1
36#define TEGRA_GPIO_EN_VDD_1V05_GPIO HARMONY_GPIO_TPS6586X(2)
37
38void harmony_pinmux_init(void);
39int harmony_regulator_init(void);
40
41#endif
diff --git a/arch/arm/mach-tegra/board-paz00-pinmux.c b/arch/arm/mach-tegra/board-paz00-pinmux.c
deleted file mode 100644
index 6f1111b48e7..00000000000
--- a/arch/arm/mach-tegra/board-paz00-pinmux.c
+++ /dev/null
@@ -1,156 +0,0 @@
1/*
2 * arch/arm/mach-tegra/board-paz00-pinmux.c
3 *
4 * Copyright (C) 2010 Marc Dietrich <marvin24@gmx.de>
5 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#include <linux/kernel.h>
19
20#include "board-paz00.h"
21#include "board-pinmux.h"
22
23static struct pinctrl_map paz00_map[] = {
24 TEGRA_MAP_MUXCONF("ata", "gmi", none, driven),
25 TEGRA_MAP_MUXCONF("atb", "sdio4", none, driven),
26 TEGRA_MAP_MUXCONF("atc", "gmi", none, driven),
27 TEGRA_MAP_MUXCONF("atd", "gmi", none, driven),
28 TEGRA_MAP_MUXCONF("ate", "gmi", none, driven),
29 TEGRA_MAP_MUXCONF("cdev1", "plla_out", none, driven),
30 TEGRA_MAP_MUXCONF("cdev2", "pllp_out4", down, driven),
31 TEGRA_MAP_MUXCONF("crtp", "crt", none, tristate),
32 TEGRA_MAP_MUXCONF("csus", "pllc_out1", down, tristate),
33 TEGRA_MAP_MUXCONF("dap1", "dap1", none, driven),
34 TEGRA_MAP_MUXCONF("dap2", "gmi", none, driven),
35 TEGRA_MAP_MUXCONF("dap3", "dap3", none, tristate),
36 TEGRA_MAP_MUXCONF("dap4", "dap4", none, tristate),
37 TEGRA_MAP_MUXCONF("ddc", "i2c2", up, driven),
38 TEGRA_MAP_MUXCONF("dta", "rsvd1", up, tristate),
39 TEGRA_MAP_MUXCONF("dtb", "rsvd1", none, tristate),
40 TEGRA_MAP_MUXCONF("dtc", "rsvd1", none, tristate),
41 TEGRA_MAP_MUXCONF("dtd", "rsvd1", up, tristate),
42 TEGRA_MAP_MUXCONF("dte", "rsvd1", none, tristate),
43 TEGRA_MAP_MUXCONF("dtf", "i2c3", none, driven),
44 TEGRA_MAP_MUXCONF("gma", "sdio4", none, driven),
45 TEGRA_MAP_MUXCONF("gmb", "gmi", none, driven),
46 TEGRA_MAP_MUXCONF("gmc", "gmi", none, driven),
47 TEGRA_MAP_MUXCONF("gmd", "gmi", none, driven),
48 TEGRA_MAP_MUXCONF("gme", "sdio4", none, driven),
49 TEGRA_MAP_MUXCONF("gpu", "pwm", none, driven),
50 TEGRA_MAP_MUXCONF("gpu7", "rtck", none, driven),
51 TEGRA_MAP_MUXCONF("gpv", "pcie", none, driven),
52 TEGRA_MAP_MUXCONF("hdint", "hdmi", na, driven),
53 TEGRA_MAP_MUXCONF("i2cp", "i2cp", none, driven),
54 TEGRA_MAP_MUXCONF("irrx", "uarta", up, driven),
55 TEGRA_MAP_MUXCONF("irtx", "uarta", up, driven),
56 TEGRA_MAP_MUXCONF("kbca", "kbc", up, driven),
57 TEGRA_MAP_MUXCONF("kbcb", "sdio2", up, driven),
58 TEGRA_MAP_MUXCONF("kbcc", "kbc", up, driven),
59 TEGRA_MAP_MUXCONF("kbcd", "sdio2", up, driven),
60 TEGRA_MAP_MUXCONF("kbce", "kbc", up, driven),
61 TEGRA_MAP_MUXCONF("kbcf", "kbc", up, driven),
62 TEGRA_MAP_MUXCONF("lcsn", "displaya", na, tristate),
63 TEGRA_MAP_MUXCONF("ld0", "displaya", na, driven),
64 TEGRA_MAP_MUXCONF("ld1", "displaya", na, driven),
65 TEGRA_MAP_MUXCONF("ld10", "displaya", na, driven),
66 TEGRA_MAP_MUXCONF("ld11", "displaya", na, driven),
67 TEGRA_MAP_MUXCONF("ld12", "displaya", na, driven),
68 TEGRA_MAP_MUXCONF("ld13", "displaya", na, driven),
69 TEGRA_MAP_MUXCONF("ld14", "displaya", na, driven),
70 TEGRA_MAP_MUXCONF("ld15", "displaya", na, driven),
71 TEGRA_MAP_MUXCONF("ld16", "displaya", na, driven),
72 TEGRA_MAP_MUXCONF("ld17", "displaya", na, driven),
73 TEGRA_MAP_MUXCONF("ld2", "displaya", na, driven),
74 TEGRA_MAP_MUXCONF("ld3", "displaya", na, driven),
75 TEGRA_MAP_MUXCONF("ld4", "displaya", na, driven),
76 TEGRA_MAP_MUXCONF("ld5", "displaya", na, driven),
77 TEGRA_MAP_MUXCONF("ld6", "displaya", na, driven),
78 TEGRA_MAP_MUXCONF("ld7", "displaya", na, driven),
79 TEGRA_MAP_MUXCONF("ld8", "displaya", na, driven),
80 TEGRA_MAP_MUXCONF("ld9", "displaya", na, driven),
81 TEGRA_MAP_MUXCONF("ldc", "displaya", na, driven),
82 TEGRA_MAP_MUXCONF("ldi", "displaya", na, driven),
83 TEGRA_MAP_MUXCONF("lhp0", "displaya", na, tristate),
84 TEGRA_MAP_MUXCONF("lhp1", "displaya", na, tristate),
85 TEGRA_MAP_MUXCONF("lhp2", "displaya", na, tristate),
86 TEGRA_MAP_MUXCONF("lhs", "displaya", na, driven),
87 TEGRA_MAP_MUXCONF("lm0", "displaya", na, tristate),
88 TEGRA_MAP_MUXCONF("lm1", "displaya", na, tristate),
89 TEGRA_MAP_MUXCONF("lpp", "displaya", na, tristate),
90 TEGRA_MAP_MUXCONF("lpw0", "displaya", na, tristate),
91 TEGRA_MAP_MUXCONF("lpw1", "displaya", na, tristate),
92 TEGRA_MAP_MUXCONF("lpw2", "displaya", na, tristate),
93 TEGRA_MAP_MUXCONF("lsc0", "displaya", na, driven),
94 TEGRA_MAP_MUXCONF("lsc1", "displaya", na, tristate),
95 TEGRA_MAP_MUXCONF("lsck", "displaya", na, tristate),
96 TEGRA_MAP_MUXCONF("lsda", "displaya", na, tristate),
97 TEGRA_MAP_MUXCONF("lsdi", "displaya", na, tristate),
98 TEGRA_MAP_MUXCONF("lspi", "displaya", na, driven),
99 TEGRA_MAP_MUXCONF("lvp0", "displaya", na, tristate),
100 TEGRA_MAP_MUXCONF("lvp1", "displaya", na, tristate),
101 TEGRA_MAP_MUXCONF("lvs", "displaya", na, driven),
102 TEGRA_MAP_MUXCONF("owc", "owr", up, tristate),
103 TEGRA_MAP_MUXCONF("pmc", "pwr_on", na, driven),
104 TEGRA_MAP_MUXCONF("pta", "hdmi", none, driven),
105 TEGRA_MAP_MUXCONF("rm", "i2c1", none, driven),
106 TEGRA_MAP_MUXCONF("sdb", "pwm", na, tristate),
107 TEGRA_MAP_MUXCONF("sdc", "twc", up, tristate),
108 TEGRA_MAP_MUXCONF("sdd", "pwm", up, tristate),
109 TEGRA_MAP_MUXCONF("sdio1", "sdio1", none, driven),
110 TEGRA_MAP_MUXCONF("slxa", "pcie", none, tristate),
111 TEGRA_MAP_MUXCONF("slxc", "spi4", none, tristate),
112 TEGRA_MAP_MUXCONF("slxd", "spi4", none, tristate),
113 TEGRA_MAP_MUXCONF("slxk", "pcie", none, driven),
114 TEGRA_MAP_MUXCONF("spdi", "rsvd2", none, tristate),
115 TEGRA_MAP_MUXCONF("spdo", "rsvd2", none, driven),
116 TEGRA_MAP_MUXCONF("spia", "gmi", down, tristate),
117 TEGRA_MAP_MUXCONF("spib", "gmi", down, tristate),
118 TEGRA_MAP_MUXCONF("spic", "gmi", up, driven),
119 TEGRA_MAP_MUXCONF("spid", "gmi", down, tristate),
120 TEGRA_MAP_MUXCONF("spie", "gmi", up, tristate),
121 TEGRA_MAP_MUXCONF("spif", "rsvd4", down, tristate),
122 TEGRA_MAP_MUXCONF("spig", "spi2_alt", up, driven),
123 TEGRA_MAP_MUXCONF("spih", "spi2_alt", up, tristate),
124 TEGRA_MAP_MUXCONF("uaa", "ulpi", up, driven),
125 TEGRA_MAP_MUXCONF("uab", "ulpi", up, driven),
126 TEGRA_MAP_MUXCONF("uac", "rsvd4", none, driven),
127 TEGRA_MAP_MUXCONF("uad", "spdif", up, tristate),
128 TEGRA_MAP_MUXCONF("uca", "uartc", up, tristate),
129 TEGRA_MAP_MUXCONF("ucb", "uartc", up, tristate),
130 TEGRA_MAP_MUXCONF("uda", "ulpi", none, driven),
131 TEGRA_MAP_CONF("ck32", none, na),
132 TEGRA_MAP_CONF("ddrc", none, na),
133 TEGRA_MAP_CONF("pmca", none, na),
134 TEGRA_MAP_CONF("pmcb", none, na),
135 TEGRA_MAP_CONF("pmcc", none, na),
136 TEGRA_MAP_CONF("pmcd", none, na),
137 TEGRA_MAP_CONF("pmce", none, na),
138 TEGRA_MAP_CONF("xm2c", none, na),
139 TEGRA_MAP_CONF("xm2d", none, na),
140 TEGRA_MAP_CONF("ls", up, na),
141 TEGRA_MAP_CONF("lc", up, na),
142 TEGRA_MAP_CONF("ld17_0", down, na),
143 TEGRA_MAP_CONF("ld19_18", down, na),
144 TEGRA_MAP_CONF("ld21_20", down, na),
145 TEGRA_MAP_CONF("ld23_22", down, na),
146};
147
148static struct tegra_board_pinmux_conf conf = {
149 .maps = paz00_map,
150 .map_count = ARRAY_SIZE(paz00_map),
151};
152
153void paz00_pinmux_init(void)
154{
155 tegra_board_pinmux_init(&conf, NULL);
156}
diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c
index 4b64af5cab2..740e16f6472 100644
--- a/arch/arm/mach-tegra/board-paz00.c
+++ b/arch/arm/mach-tegra/board-paz00.c
@@ -17,72 +17,10 @@
17 * 17 *
18 */ 18 */
19 19
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/platform_device.h> 20#include <linux/platform_device.h>
23#include <linux/serial_8250.h>
24#include <linux/of_serial.h>
25#include <linux/clk.h>
26#include <linux/dma-mapping.h>
27#include <linux/gpio_keys.h>
28#include <linux/pda_power.h>
29#include <linux/io.h>
30#include <linux/input.h>
31#include <linux/i2c.h>
32#include <linux/gpio.h>
33#include <linux/rfkill-gpio.h> 21#include <linux/rfkill-gpio.h>
34
35#include <asm/hardware/gic.h>
36#include <asm/mach-types.h>
37#include <asm/mach/arch.h>
38#include <asm/mach/time.h>
39#include <asm/setup.h>
40
41#include <mach/iomap.h>
42#include <mach/irqs.h>
43#include <mach/sdhci.h>
44
45#include "board.h" 22#include "board.h"
46#include "board-paz00.h" 23#include "board-paz00.h"
47#include "clock.h"
48#include "devices.h"
49#include "gpio-names.h"
50
51static struct plat_serial8250_port debug_uart_platform_data[] = {
52 {
53 /* serial port on JP1 */
54 .membase = IO_ADDRESS(TEGRA_UARTA_BASE),
55 .mapbase = TEGRA_UARTA_BASE,
56 .irq = INT_UARTA,
57 .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
58 .type = PORT_TEGRA,
59 .handle_break = tegra_serial_handle_break,
60 .iotype = UPIO_MEM,
61 .regshift = 2,
62 .uartclk = 216000000,
63 }, {
64 /* serial port on mini-pcie */
65 .membase = IO_ADDRESS(TEGRA_UARTC_BASE),
66 .mapbase = TEGRA_UARTC_BASE,
67 .irq = INT_UARTC,
68 .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
69 .type = PORT_TEGRA,
70 .handle_break = tegra_serial_handle_break,
71 .iotype = UPIO_MEM,
72 .regshift = 2,
73 .uartclk = 216000000,
74 }, {
75 .flags = 0
76 }
77};
78
79static struct platform_device debug_uart = {
80 .name = "serial8250",
81 .id = PLAT8250_DEV_PLATFORM,
82 .dev = {
83 .platform_data = debug_uart_platform_data,
84 },
85};
86 24
87static struct rfkill_gpio_platform_data wifi_rfkill_platform_data = { 25static struct rfkill_gpio_platform_data wifi_rfkill_platform_data = {
88 .name = "wifi_rfkill", 26 .name = "wifi_rfkill",
@@ -99,137 +37,7 @@ static struct platform_device wifi_rfkill_device = {
99 }, 37 },
100}; 38};
101 39
102static struct gpio_led gpio_leds[] = {
103 {
104 .name = "wifi-led",
105 .default_trigger = "rfkill0",
106 .gpio = TEGRA_WIFI_LED,
107 },
108};
109
110static struct gpio_led_platform_data gpio_led_info = {
111 .leds = gpio_leds,
112 .num_leds = ARRAY_SIZE(gpio_leds),
113};
114
115static struct platform_device leds_gpio = {
116 .name = "leds-gpio",
117 .id = -1,
118 .dev = {
119 .platform_data = &gpio_led_info,
120 },
121};
122
123static struct gpio_keys_button paz00_gpio_keys_buttons[] = {
124 {
125 .code = KEY_POWER,
126 .gpio = TEGRA_GPIO_POWERKEY,
127 .active_low = 1,
128 .desc = "Power",
129 .type = EV_KEY,
130 .wakeup = 1,
131 },
132};
133
134static struct gpio_keys_platform_data paz00_gpio_keys = {
135 .buttons = paz00_gpio_keys_buttons,
136 .nbuttons = ARRAY_SIZE(paz00_gpio_keys_buttons),
137};
138
139static struct platform_device gpio_keys_device = {
140 .name = "gpio-keys",
141 .id = -1,
142 .dev = {
143 .platform_data = &paz00_gpio_keys,
144 },
145};
146
147static struct platform_device *paz00_devices[] __initdata = {
148 &debug_uart,
149 &tegra_sdhci_device4,
150 &tegra_sdhci_device1,
151 &leds_gpio,
152 &gpio_keys_device,
153};
154
155static void paz00_i2c_init(void)
156{
157 platform_device_register(&tegra_i2c_device1);
158 platform_device_register(&tegra_i2c_device2);
159 platform_device_register(&tegra_i2c_device4);
160}
161
162static void paz00_usb_init(void)
163{
164 tegra_ehci2_ulpi_phy_config.reset_gpio = TEGRA_ULPI_RST;
165
166 platform_device_register(&tegra_ehci2_device);
167 platform_device_register(&tegra_ehci3_device);
168}
169
170static void __init tegra_paz00_fixup(struct tag *tags, char **cmdline,
171 struct meminfo *mi)
172{
173 mi->nr_banks = 1;
174 mi->bank[0].start = PHYS_OFFSET;
175 mi->bank[0].size = 448 * SZ_1M;
176}
177
178static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
179 /* name parent rate enabled */
180 { "uarta", "pll_p", 216000000, true },
181 { "uartc", "pll_p", 216000000, true },
182
183 { "usbd", "clk_m", 12000000, false },
184 { "usb2", "clk_m", 12000000, false },
185 { "usb3", "clk_m", 12000000, false },
186
187 { NULL, NULL, 0, 0},
188};
189
190static struct tegra_sdhci_platform_data sdhci_pdata1 = {
191 .cd_gpio = TEGRA_GPIO_SD1_CD,
192 .wp_gpio = TEGRA_GPIO_SD1_WP,
193 .power_gpio = TEGRA_GPIO_SD1_POWER,
194};
195
196static struct tegra_sdhci_platform_data sdhci_pdata4 = {
197 .cd_gpio = -1,
198 .wp_gpio = -1,
199 .power_gpio = -1,
200 .is_8bit = 1,
201};
202
203void __init tegra_paz00_wifikill_init(void) 40void __init tegra_paz00_wifikill_init(void)
204{ 41{
205 platform_device_register(&wifi_rfkill_device); 42 platform_device_register(&wifi_rfkill_device);
206} 43}
207
208static void __init tegra_paz00_init(void)
209{
210 tegra_clk_init_from_table(paz00_clk_init_table);
211
212 paz00_pinmux_init();
213
214 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
215 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
216
217 platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices));
218 tegra_paz00_wifikill_init();
219
220 paz00_i2c_init();
221 paz00_usb_init();
222}
223
224MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
225 .atag_offset = 0x100,
226 .fixup = tegra_paz00_fixup,
227 .map_io = tegra_map_common_io,
228 .init_early = tegra20_init_early,
229 .init_irq = tegra_init_irq,
230 .handle_irq = gic_handle_irq,
231 .timer = &tegra_timer,
232 .init_machine = tegra_paz00_init,
233 .init_late = tegra_init_late,
234 .restart = tegra_assert_system_reset,
235MACHINE_END
diff --git a/arch/arm/mach-tegra/board-paz00.h b/arch/arm/mach-tegra/board-paz00.h
index 3c9f8da37ea..25c08ecef52 100644
--- a/arch/arm/mach-tegra/board-paz00.h
+++ b/arch/arm/mach-tegra/board-paz00.h
@@ -17,24 +17,9 @@
17#ifndef _MACH_TEGRA_BOARD_PAZ00_H 17#ifndef _MACH_TEGRA_BOARD_PAZ00_H
18#define _MACH_TEGRA_BOARD_PAZ00_H 18#define _MACH_TEGRA_BOARD_PAZ00_H
19 19
20#include <mach/gpio-tegra.h> 20#include "gpio-names.h"
21 21
22/* SDCARD */
23#define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5
24#define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1
25#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PV1
26
27/* ULPI */
28#define TEGRA_ULPI_RST TEGRA_GPIO_PV0
29
30/* WIFI */
31#define TEGRA_WIFI_PWRN TEGRA_GPIO_PK5 22#define TEGRA_WIFI_PWRN TEGRA_GPIO_PK5
32#define TEGRA_WIFI_RST TEGRA_GPIO_PD1 23#define TEGRA_WIFI_RST TEGRA_GPIO_PD1
33#define TEGRA_WIFI_LED TEGRA_GPIO_PD0
34
35/* WakeUp */
36#define TEGRA_GPIO_POWERKEY TEGRA_GPIO_PJ7
37
38void paz00_pinmux_init(void);
39 24
40#endif 25#endif
diff --git a/arch/arm/mach-tegra/board-pinmux.c b/arch/arm/mach-tegra/board-pinmux.c
deleted file mode 100644
index a5574c71b93..00000000000
--- a/arch/arm/mach-tegra/board-pinmux.c
+++ /dev/null
@@ -1,87 +0,0 @@
1/*
2 * Copyright (c) 2011,2012, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#include <linux/device.h>
16#include <linux/kernel.h>
17#include <linux/notifier.h>
18#include <linux/string.h>
19
20#include "board-pinmux.h"
21#include "devices.h"
22
23unsigned long tegra_pincfg_pullnone_driven[2] = {
24 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_NONE),
25 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_DRIVEN),
26};
27
28unsigned long tegra_pincfg_pullnone_tristate[2] = {
29 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_NONE),
30 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_TRISTATE),
31};
32
33unsigned long tegra_pincfg_pullnone_na[1] = {
34 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_NONE),
35};
36
37unsigned long tegra_pincfg_pullup_driven[2] = {
38 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_UP),
39 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_DRIVEN),
40};
41
42unsigned long tegra_pincfg_pullup_tristate[2] = {
43 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_UP),
44 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_TRISTATE),
45};
46
47unsigned long tegra_pincfg_pullup_na[1] = {
48 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_UP),
49};
50
51unsigned long tegra_pincfg_pulldown_driven[2] = {
52 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_DOWN),
53 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_DRIVEN),
54};
55
56unsigned long tegra_pincfg_pulldown_tristate[2] = {
57 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_DOWN),
58 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_TRISTATE),
59};
60
61unsigned long tegra_pincfg_pulldown_na[1] = {
62 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_DOWN),
63};
64
65unsigned long tegra_pincfg_pullna_driven[1] = {
66 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_DRIVEN),
67};
68
69unsigned long tegra_pincfg_pullna_tristate[1] = {
70 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_TRISTATE),
71};
72
73static struct platform_device *devices[] = {
74 &tegra_gpio_device,
75 &tegra_pinmux_device,
76};
77
78void tegra_board_pinmux_init(struct tegra_board_pinmux_conf *conf_a,
79 struct tegra_board_pinmux_conf *conf_b)
80{
81 if (conf_a)
82 pinctrl_register_mappings(conf_a->maps, conf_a->map_count);
83 if (conf_b)
84 pinctrl_register_mappings(conf_b->maps, conf_b->map_count);
85
86 platform_add_devices(devices, ARRAY_SIZE(devices));
87}
diff --git a/arch/arm/mach-tegra/board-pinmux.h b/arch/arm/mach-tegra/board-pinmux.h
deleted file mode 100644
index c5f3f3381e8..00000000000
--- a/arch/arm/mach-tegra/board-pinmux.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * Copyright (c) 2011,2012, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef __MACH_TEGRA_BOARD_PINMUX_H
16#define __MACH_TEGRA_BOARD_PINMUX_H
17
18#include <linux/pinctrl/machine.h>
19
20#include <mach/pinconf-tegra.h>
21
22#define PINMUX_DEV "tegra20-pinctrl"
23
24#define TEGRA_MAP_MUX(_group_, _function_) \
25 PIN_MAP_MUX_GROUP_HOG_DEFAULT(PINMUX_DEV, _group_, _function_)
26
27#define TEGRA_MAP_CONF(_group_, _pull_, _drive_) \
28 PIN_MAP_CONFIGS_GROUP_HOG_DEFAULT(PINMUX_DEV, _group_, tegra_pincfg_pull##_pull_##_##_drive_)
29
30#define TEGRA_MAP_MUXCONF(_group_, _function_, _pull_, _drive_) \
31 TEGRA_MAP_MUX(_group_, _function_), \
32 TEGRA_MAP_CONF(_group_, _pull_, _drive_)
33
34extern unsigned long tegra_pincfg_pullnone_driven[2];
35extern unsigned long tegra_pincfg_pullnone_tristate[2];
36extern unsigned long tegra_pincfg_pullnone_na[1];
37extern unsigned long tegra_pincfg_pullup_driven[2];
38extern unsigned long tegra_pincfg_pullup_tristate[2];
39extern unsigned long tegra_pincfg_pullup_na[1];
40extern unsigned long tegra_pincfg_pulldown_driven[2];
41extern unsigned long tegra_pincfg_pulldown_tristate[2];
42extern unsigned long tegra_pincfg_pulldown_na[1];
43extern unsigned long tegra_pincfg_pullna_driven[1];
44extern unsigned long tegra_pincfg_pullna_tristate[1];
45
46struct tegra_board_pinmux_conf {
47 struct pinctrl_map *maps;
48 int map_count;
49};
50
51void tegra_board_pinmux_init(struct tegra_board_pinmux_conf *conf_a,
52 struct tegra_board_pinmux_conf *conf_b);
53
54#endif
diff --git a/arch/arm/mach-tegra/board-trimslice-pinmux.c b/arch/arm/mach-tegra/board-trimslice-pinmux.c
deleted file mode 100644
index 7b39511c0d4..00000000000
--- a/arch/arm/mach-tegra/board-trimslice-pinmux.c
+++ /dev/null
@@ -1,155 +0,0 @@
1/*
2 * arch/arm/mach-tegra/board-trimslice-pinmux.c
3 *
4 * Copyright (C) 2011 CompuLab, Ltd.
5 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
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#include <linux/kernel.h>
18
19#include "board-trimslice.h"
20#include "board-pinmux.h"
21
22static struct pinctrl_map trimslice_map[] = {
23 TEGRA_MAP_MUXCONF("ata", "ide", none, tristate),
24 TEGRA_MAP_MUXCONF("atb", "sdio4", none, driven),
25 TEGRA_MAP_MUXCONF("atc", "nand", none, tristate),
26 TEGRA_MAP_MUXCONF("atd", "gmi", none, tristate),
27 TEGRA_MAP_MUXCONF("ate", "gmi", none, tristate),
28 TEGRA_MAP_MUXCONF("cdev1", "plla_out", none, driven),
29 TEGRA_MAP_MUXCONF("cdev2", "pllp_out4", down, tristate),
30 TEGRA_MAP_MUXCONF("crtp", "crt", none, tristate),
31 TEGRA_MAP_MUXCONF("csus", "vi_sensor_clk", down, tristate),
32 TEGRA_MAP_MUXCONF("dap1", "dap1", none, driven),
33 TEGRA_MAP_MUXCONF("dap2", "dap2", none, tristate),
34 TEGRA_MAP_MUXCONF("dap3", "dap3", none, tristate),
35 TEGRA_MAP_MUXCONF("dap4", "dap4", none, tristate),
36 TEGRA_MAP_MUXCONF("ddc", "i2c2", up, driven),
37 TEGRA_MAP_MUXCONF("dta", "vi", none, tristate),
38 TEGRA_MAP_MUXCONF("dtb", "vi", none, tristate),
39 TEGRA_MAP_MUXCONF("dtc", "vi", none, tristate),
40 TEGRA_MAP_MUXCONF("dtd", "vi", none, tristate),
41 TEGRA_MAP_MUXCONF("dte", "vi", none, tristate),
42 TEGRA_MAP_MUXCONF("dtf", "i2c3", up, driven),
43 TEGRA_MAP_MUXCONF("gma", "sdio4", none, driven),
44 TEGRA_MAP_MUXCONF("gmb", "nand", none, tristate),
45 TEGRA_MAP_MUXCONF("gmc", "sflash", none, driven),
46 TEGRA_MAP_MUXCONF("gmd", "sflash", none, driven),
47 TEGRA_MAP_MUXCONF("gme", "gmi", none, tristate),
48 TEGRA_MAP_MUXCONF("gpu", "uarta", none, driven),
49 TEGRA_MAP_MUXCONF("gpu7", "rtck", none, driven),
50 TEGRA_MAP_MUXCONF("gpv", "pcie", none, driven),
51 TEGRA_MAP_MUXCONF("hdint", "hdmi", na, tristate),
52 TEGRA_MAP_MUXCONF("i2cp", "i2cp", none, tristate),
53 TEGRA_MAP_MUXCONF("irrx", "uartb", up, tristate),
54 TEGRA_MAP_MUXCONF("irtx", "uartb", up, tristate),
55 TEGRA_MAP_MUXCONF("kbca", "kbc", up, tristate),
56 TEGRA_MAP_MUXCONF("kbcb", "kbc", up, tristate),
57 TEGRA_MAP_MUXCONF("kbcc", "kbc", up, tristate),
58 TEGRA_MAP_MUXCONF("kbcd", "kbc", up, tristate),
59 TEGRA_MAP_MUXCONF("kbce", "kbc", up, tristate),
60 TEGRA_MAP_MUXCONF("kbcf", "kbc", up, tristate),
61 TEGRA_MAP_MUXCONF("lcsn", "displaya", na, tristate),
62 TEGRA_MAP_MUXCONF("ld0", "displaya", na, driven),
63 TEGRA_MAP_MUXCONF("ld1", "displaya", na, driven),
64 TEGRA_MAP_MUXCONF("ld10", "displaya", na, driven),
65 TEGRA_MAP_MUXCONF("ld11", "displaya", na, driven),
66 TEGRA_MAP_MUXCONF("ld12", "displaya", na, driven),
67 TEGRA_MAP_MUXCONF("ld13", "displaya", na, driven),
68 TEGRA_MAP_MUXCONF("ld14", "displaya", na, driven),
69 TEGRA_MAP_MUXCONF("ld15", "displaya", na, driven),
70 TEGRA_MAP_MUXCONF("ld16", "displaya", na, driven),
71 TEGRA_MAP_MUXCONF("ld17", "displaya", na, driven),
72 TEGRA_MAP_MUXCONF("ld2", "displaya", na, driven),
73 TEGRA_MAP_MUXCONF("ld3", "displaya", na, driven),
74 TEGRA_MAP_MUXCONF("ld4", "displaya", na, driven),
75 TEGRA_MAP_MUXCONF("ld5", "displaya", na, driven),
76 TEGRA_MAP_MUXCONF("ld6", "displaya", na, driven),
77 TEGRA_MAP_MUXCONF("ld7", "displaya", na, driven),
78 TEGRA_MAP_MUXCONF("ld8", "displaya", na, driven),
79 TEGRA_MAP_MUXCONF("ld9", "displaya", na, driven),
80 TEGRA_MAP_MUXCONF("ldc", "displaya", na, tristate),
81 TEGRA_MAP_MUXCONF("ldi", "displaya", na, driven),
82 TEGRA_MAP_MUXCONF("lhp0", "displaya", na, driven),
83 TEGRA_MAP_MUXCONF("lhp1", "displaya", na, driven),
84 TEGRA_MAP_MUXCONF("lhp2", "displaya", na, driven),
85 TEGRA_MAP_MUXCONF("lhs", "displaya", na, driven),
86 TEGRA_MAP_MUXCONF("lm0", "displaya", na, driven),
87 TEGRA_MAP_MUXCONF("lm1", "displaya", na, tristate),
88 TEGRA_MAP_MUXCONF("lpp", "displaya", na, driven),
89 TEGRA_MAP_MUXCONF("lpw0", "displaya", na, driven),
90 TEGRA_MAP_MUXCONF("lpw1", "displaya", na, tristate),
91 TEGRA_MAP_MUXCONF("lpw2", "displaya", na, driven),
92 TEGRA_MAP_MUXCONF("lsc0", "displaya", na, driven),
93 TEGRA_MAP_MUXCONF("lsc1", "displaya", na, tristate),
94 TEGRA_MAP_MUXCONF("lsck", "displaya", na, tristate),
95 TEGRA_MAP_MUXCONF("lsda", "displaya", na, tristate),
96 TEGRA_MAP_MUXCONF("lsdi", "displaya", na, tristate),
97 TEGRA_MAP_MUXCONF("lspi", "displaya", na, driven),
98 TEGRA_MAP_MUXCONF("lvp0", "displaya", na, tristate),
99 TEGRA_MAP_MUXCONF("lvp1", "displaya", na, driven),
100 TEGRA_MAP_MUXCONF("lvs", "displaya", na, driven),
101 TEGRA_MAP_MUXCONF("owc", "rsvd2", up, tristate),
102 TEGRA_MAP_MUXCONF("pmc", "pwr_on", na, tristate),
103 TEGRA_MAP_MUXCONF("pta", "gmi", none, tristate),
104 TEGRA_MAP_MUXCONF("rm", "i2c1", up, driven),
105 TEGRA_MAP_MUXCONF("sdb", "pwm", na, driven),
106 TEGRA_MAP_MUXCONF("sdc", "pwm", up, driven),
107 TEGRA_MAP_MUXCONF("sdd", "pwm", up, driven),
108 TEGRA_MAP_MUXCONF("sdio1", "sdio1", none, driven),
109 TEGRA_MAP_MUXCONF("slxa", "pcie", none, driven),
110 TEGRA_MAP_MUXCONF("slxc", "sdio3", none, tristate),
111 TEGRA_MAP_MUXCONF("slxd", "sdio3", none, tristate),
112 TEGRA_MAP_MUXCONF("slxk", "pcie", none, driven),
113 TEGRA_MAP_MUXCONF("spdi", "spdif", none, tristate),
114 TEGRA_MAP_MUXCONF("spdo", "spdif", none, tristate),
115 TEGRA_MAP_MUXCONF("spia", "spi2", down, tristate),
116 TEGRA_MAP_MUXCONF("spib", "spi2", down, tristate),
117 TEGRA_MAP_MUXCONF("spic", "spi2", up, tristate),
118 TEGRA_MAP_MUXCONF("spid", "spi1", down, tristate),
119 TEGRA_MAP_MUXCONF("spie", "spi1", up, tristate),
120 TEGRA_MAP_MUXCONF("spif", "spi1", down, tristate),
121 TEGRA_MAP_MUXCONF("spig", "spi2_alt", up, tristate),
122 TEGRA_MAP_MUXCONF("spih", "spi2_alt", up, tristate),
123 TEGRA_MAP_MUXCONF("uaa", "ulpi", up, tristate),
124 TEGRA_MAP_MUXCONF("uab", "ulpi", up, tristate),
125 TEGRA_MAP_MUXCONF("uac", "rsvd2", none, driven),
126 TEGRA_MAP_MUXCONF("uad", "irda", up, tristate),
127 TEGRA_MAP_MUXCONF("uca", "uartc", up, tristate),
128 TEGRA_MAP_MUXCONF("ucb", "uartc", up, tristate),
129 TEGRA_MAP_MUXCONF("uda", "ulpi", none, tristate),
130 TEGRA_MAP_CONF("ck32", none, na),
131 TEGRA_MAP_CONF("ddrc", none, na),
132 TEGRA_MAP_CONF("pmca", none, na),
133 TEGRA_MAP_CONF("pmcb", none, na),
134 TEGRA_MAP_CONF("pmcc", none, na),
135 TEGRA_MAP_CONF("pmcd", none, na),
136 TEGRA_MAP_CONF("pmce", none, na),
137 TEGRA_MAP_CONF("xm2c", none, na),
138 TEGRA_MAP_CONF("xm2d", none, na),
139 TEGRA_MAP_CONF("ls", up, na),
140 TEGRA_MAP_CONF("lc", up, na),
141 TEGRA_MAP_CONF("ld17_0", down, na),
142 TEGRA_MAP_CONF("ld19_18", down, na),
143 TEGRA_MAP_CONF("ld21_20", down, na),
144 TEGRA_MAP_CONF("ld23_22", down, na),
145};
146
147static struct tegra_board_pinmux_conf conf = {
148 .maps = trimslice_map,
149 .map_count = ARRAY_SIZE(trimslice_map),
150};
151
152void trimslice_pinmux_init(void)
153{
154 tegra_board_pinmux_init(&conf, NULL);
155}
diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c
deleted file mode 100644
index 776aa9564d5..00000000000
--- a/arch/arm/mach-tegra/board-trimslice.c
+++ /dev/null
@@ -1,183 +0,0 @@
1/*
2 * arch/arm/mach-tegra/board-trimslice.c
3 *
4 * Copyright (C) 2011 CompuLab, Ltd.
5 * Author: Mike Rapoport <mike@compulab.co.il>
6 *
7 * Based on board-harmony.c
8 * Copyright (C) 2010 Google, Inc.
9 *
10 * This software is licensed under the terms of the GNU General Public
11 * License version 2, as published by the Free Software Foundation, and
12 * may be copied, distributed, and modified under those terms.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 */
20
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/platform_device.h>
24#include <linux/serial_8250.h>
25#include <linux/of_serial.h>
26#include <linux/io.h>
27#include <linux/i2c.h>
28#include <linux/gpio.h>
29#include <linux/platform_data/tegra_usb.h>
30
31#include <asm/hardware/gic.h>
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34#include <asm/setup.h>
35
36#include <mach/iomap.h>
37#include <mach/sdhci.h>
38
39#include "board.h"
40#include "clock.h"
41#include "devices.h"
42#include "gpio-names.h"
43
44#include "board-trimslice.h"
45
46static struct plat_serial8250_port debug_uart_platform_data[] = {
47 {
48 .membase = IO_ADDRESS(TEGRA_UARTA_BASE),
49 .mapbase = TEGRA_UARTA_BASE,
50 .irq = INT_UARTA,
51 .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
52 .type = PORT_TEGRA,
53 .handle_break = tegra_serial_handle_break,
54 .iotype = UPIO_MEM,
55 .regshift = 2,
56 .uartclk = 216000000,
57 }, {
58 .flags = 0
59 }
60};
61
62static struct platform_device debug_uart = {
63 .name = "serial8250",
64 .id = PLAT8250_DEV_PLATFORM,
65 .dev = {
66 .platform_data = debug_uart_platform_data,
67 },
68};
69static struct tegra_sdhci_platform_data sdhci_pdata1 = {
70 .cd_gpio = -1,
71 .wp_gpio = -1,
72 .power_gpio = -1,
73};
74
75static struct tegra_sdhci_platform_data sdhci_pdata4 = {
76 .cd_gpio = TRIMSLICE_GPIO_SD4_CD,
77 .wp_gpio = TRIMSLICE_GPIO_SD4_WP,
78 .power_gpio = -1,
79};
80
81static struct platform_device trimslice_audio_device = {
82 .name = "tegra-snd-trimslice",
83 .id = 0,
84};
85
86static struct platform_device *trimslice_devices[] __initdata = {
87 &debug_uart,
88 &tegra_sdhci_device1,
89 &tegra_sdhci_device4,
90 &tegra_i2s_device1,
91 &tegra_das_device,
92 &trimslice_audio_device,
93};
94
95static struct i2c_board_info trimslice_i2c3_board_info[] = {
96 {
97 I2C_BOARD_INFO("tlv320aic23", 0x1a),
98 },
99 {
100 I2C_BOARD_INFO("em3027", 0x56),
101 },
102};
103
104static void trimslice_i2c_init(void)
105{
106 platform_device_register(&tegra_i2c_device1);
107 platform_device_register(&tegra_i2c_device2);
108 platform_device_register(&tegra_i2c_device3);
109
110 i2c_register_board_info(2, trimslice_i2c3_board_info,
111 ARRAY_SIZE(trimslice_i2c3_board_info));
112}
113
114static void trimslice_usb_init(void)
115{
116 struct tegra_ehci_platform_data *pdata;
117
118 pdata = tegra_ehci1_device.dev.platform_data;
119 pdata->vbus_gpio = TRIMSLICE_GPIO_USB1_MODE;
120
121 tegra_ehci2_ulpi_phy_config.reset_gpio = TEGRA_GPIO_PV0;
122
123 platform_device_register(&tegra_ehci3_device);
124 platform_device_register(&tegra_ehci2_device);
125 platform_device_register(&tegra_ehci1_device);
126}
127
128static void __init tegra_trimslice_fixup(struct tag *tags, char **cmdline,
129 struct meminfo *mi)
130{
131 mi->nr_banks = 2;
132 mi->bank[0].start = PHYS_OFFSET;
133 mi->bank[0].size = 448 * SZ_1M;
134 mi->bank[1].start = SZ_512M;
135 mi->bank[1].size = SZ_512M;
136}
137
138static __initdata struct tegra_clk_init_table trimslice_clk_init_table[] = {
139 /* name parent rate enabled */
140 { "uarta", "pll_p", 216000000, true },
141 { "pll_a", "pll_p_out1", 56448000, true },
142 { "pll_a_out0", "pll_a", 11289600, true },
143 { "cdev1", NULL, 0, true },
144 { "i2s1", "pll_a_out0", 11289600, false},
145 { NULL, NULL, 0, 0},
146};
147
148static int __init tegra_trimslice_pci_init(void)
149{
150 if (!machine_is_trimslice())
151 return 0;
152
153 return tegra_pcie_init(true, true);
154}
155subsys_initcall(tegra_trimslice_pci_init);
156
157static void __init tegra_trimslice_init(void)
158{
159 tegra_clk_init_from_table(trimslice_clk_init_table);
160
161 trimslice_pinmux_init();
162
163 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
164 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
165
166 platform_add_devices(trimslice_devices, ARRAY_SIZE(trimslice_devices));
167
168 trimslice_i2c_init();
169 trimslice_usb_init();
170}
171
172MACHINE_START(TRIMSLICE, "trimslice")
173 .atag_offset = 0x100,
174 .fixup = tegra_trimslice_fixup,
175 .map_io = tegra_map_common_io,
176 .init_early = tegra20_init_early,
177 .init_irq = tegra_init_irq,
178 .handle_irq = gic_handle_irq,
179 .timer = &tegra_timer,
180 .init_machine = tegra_trimslice_init,
181 .init_late = tegra_init_late,
182 .restart = tegra_assert_system_reset,
183MACHINE_END
diff --git a/arch/arm/mach-tegra/board-trimslice.h b/arch/arm/mach-tegra/board-trimslice.h
deleted file mode 100644
index 50f128d8777..00000000000
--- a/arch/arm/mach-tegra/board-trimslice.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * arch/arm/mach-tegra/board-trimslice.h
3 *
4 * Copyright (C) 2011 CompuLab, Ltd.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#ifndef _MACH_TEGRA_BOARD_TRIMSLICE_H
18#define _MACH_TEGRA_BOARD_TRIMSLICE_H
19
20#include <mach/gpio-tegra.h>
21
22#define TRIMSLICE_GPIO_SD4_CD TEGRA_GPIO_PP1 /* mmc4 cd */
23#define TRIMSLICE_GPIO_SD4_WP TEGRA_GPIO_PP2 /* mmc4 wp */
24
25#define TRIMSLICE_GPIO_USB1_MODE TEGRA_GPIO_PV2 /* USB1 mode */
26#define TRIMSLICE_GPIO_USB2_RST TEGRA_GPIO_PV0 /* USB2 PHY reset */
27
28void trimslice_pinmux_init(void);
29
30#endif
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index 58f981c0819..fd82085eca5 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * 2 *
3 * Copyright (C) 2010 Google, Inc. 3 * Copyright (C) 2010 Google, Inc.
4 * Copyright (c) 2012 NVIDIA CORPORATION. All rights reserved.
4 * 5 *
5 * Author: 6 * Author:
6 * Colin Cross <ccross@google.com> 7 * Colin Cross <ccross@google.com>
@@ -19,8 +20,6 @@
19#include <linux/kernel.h> 20#include <linux/kernel.h>
20#include <linux/clk.h> 21#include <linux/clk.h>
21#include <linux/clkdev.h> 22#include <linux/clkdev.h>
22#include <linux/debugfs.h>
23#include <linux/delay.h>
24#include <linux/init.h> 23#include <linux/init.h>
25#include <linux/list.h> 24#include <linux/list.h>
26#include <linux/module.h> 25#include <linux/module.h>
@@ -32,325 +31,75 @@
32 31
33#include "board.h" 32#include "board.h"
34#include "clock.h" 33#include "clock.h"
34#include "tegra_cpu_car.h"
35
36/* Global data of Tegra CPU CAR ops */
37struct tegra_cpu_car_ops *tegra_cpu_car_ops;
35 38
36/* 39/*
37 * Locking: 40 * Locking:
38 * 41 *
39 * Each struct clk has a spinlock.
40 *
41 * To avoid AB-BA locking problems, locks must always be traversed from child
42 * clock to parent clock. For example, when enabling a clock, the clock's lock
43 * is taken, and then clk_enable is called on the parent, which take's the
44 * parent clock's lock. There is one exceptions to this ordering: When dumping
45 * the clock tree through debugfs. In this case, clk_lock_all is called,
46 * which attemps to iterate through the entire list of clocks and take every
47 * clock lock. If any call to spin_trylock fails, all locked clocks are
48 * unlocked, and the process is retried. When all the locks are held,
49 * the only clock operation that can be called is clk_get_rate_all_locked.
50 *
51 * Within a single clock, no clock operation can call another clock operation
52 * on itself, except for clk_get_rate_locked and clk_set_rate_locked. Any
53 * clock operation can call any other clock operation on any of it's possible
54 * parents.
55 *
56 * An additional mutex, clock_list_lock, is used to protect the list of all 42 * An additional mutex, clock_list_lock, is used to protect the list of all
57 * clocks. 43 * clocks.
58 * 44 *
59 * The clock operations must lock internally to protect against
60 * read-modify-write on registers that are shared by multiple clocks
61 */ 45 */
62static DEFINE_MUTEX(clock_list_lock); 46static DEFINE_MUTEX(clock_list_lock);
63static LIST_HEAD(clocks); 47static LIST_HEAD(clocks);
64 48
65struct clk *tegra_get_clock_by_name(const char *name) 49void tegra_clk_add(struct clk *clk)
66{
67 struct clk *c;
68 struct clk *ret = NULL;
69 mutex_lock(&clock_list_lock);
70 list_for_each_entry(c, &clocks, node) {
71 if (strcmp(c->name, name) == 0) {
72 ret = c;
73 break;
74 }
75 }
76 mutex_unlock(&clock_list_lock);
77 return ret;
78}
79
80/* Must be called with c->spinlock held */
81static unsigned long clk_predict_rate_from_parent(struct clk *c, struct clk *p)
82{
83 u64 rate;
84
85 rate = clk_get_rate(p);
86
87 if (c->mul != 0 && c->div != 0) {
88 rate *= c->mul;
89 rate += c->div - 1; /* round up */
90 do_div(rate, c->div);
91 }
92
93 return rate;
94}
95
96/* Must be called with c->spinlock held */
97unsigned long clk_get_rate_locked(struct clk *c)
98{
99 unsigned long rate;
100
101 if (c->parent)
102 rate = clk_predict_rate_from_parent(c, c->parent);
103 else
104 rate = c->rate;
105
106 return rate;
107}
108
109unsigned long clk_get_rate(struct clk *c)
110{ 50{
111 unsigned long flags; 51 struct clk_tegra *c = to_clk_tegra(__clk_get_hw(clk));
112 unsigned long rate;
113
114 spin_lock_irqsave(&c->spinlock, flags);
115
116 rate = clk_get_rate_locked(c);
117
118 spin_unlock_irqrestore(&c->spinlock, flags);
119
120 return rate;
121}
122EXPORT_SYMBOL(clk_get_rate);
123
124int clk_reparent(struct clk *c, struct clk *parent)
125{
126 c->parent = parent;
127 return 0;
128}
129
130void clk_init(struct clk *c)
131{
132 spin_lock_init(&c->spinlock);
133
134 if (c->ops && c->ops->init)
135 c->ops->init(c);
136
137 if (!c->ops || !c->ops->enable) {
138 c->refcnt++;
139 c->set = true;
140 if (c->parent)
141 c->state = c->parent->state;
142 else
143 c->state = ON;
144 }
145 52
146 mutex_lock(&clock_list_lock); 53 mutex_lock(&clock_list_lock);
147 list_add(&c->node, &clocks); 54 list_add(&c->node, &clocks);
148 mutex_unlock(&clock_list_lock); 55 mutex_unlock(&clock_list_lock);
149} 56}
150 57
151int clk_enable(struct clk *c) 58struct clk *tegra_get_clock_by_name(const char *name)
152{
153 int ret = 0;
154 unsigned long flags;
155
156 spin_lock_irqsave(&c->spinlock, flags);
157
158 if (c->refcnt == 0) {
159 if (c->parent) {
160 ret = clk_enable(c->parent);
161 if (ret)
162 goto out;
163 }
164
165 if (c->ops && c->ops->enable) {
166 ret = c->ops->enable(c);
167 if (ret) {
168 if (c->parent)
169 clk_disable(c->parent);
170 goto out;
171 }
172 c->state = ON;
173 c->set = true;
174 }
175 }
176 c->refcnt++;
177out:
178 spin_unlock_irqrestore(&c->spinlock, flags);
179 return ret;
180}
181EXPORT_SYMBOL(clk_enable);
182
183void clk_disable(struct clk *c)
184{
185 unsigned long flags;
186
187 spin_lock_irqsave(&c->spinlock, flags);
188
189 if (c->refcnt == 0) {
190 WARN(1, "Attempting to disable clock %s with refcnt 0", c->name);
191 spin_unlock_irqrestore(&c->spinlock, flags);
192 return;
193 }
194 if (c->refcnt == 1) {
195 if (c->ops && c->ops->disable)
196 c->ops->disable(c);
197
198 if (c->parent)
199 clk_disable(c->parent);
200
201 c->state = OFF;
202 }
203 c->refcnt--;
204
205 spin_unlock_irqrestore(&c->spinlock, flags);
206}
207EXPORT_SYMBOL(clk_disable);
208
209int clk_set_parent(struct clk *c, struct clk *parent)
210{
211 int ret;
212 unsigned long flags;
213 unsigned long new_rate;
214 unsigned long old_rate;
215
216 spin_lock_irqsave(&c->spinlock, flags);
217
218 if (!c->ops || !c->ops->set_parent) {
219 ret = -ENOSYS;
220 goto out;
221 }
222
223 new_rate = clk_predict_rate_from_parent(c, parent);
224 old_rate = clk_get_rate_locked(c);
225
226 ret = c->ops->set_parent(c, parent);
227 if (ret)
228 goto out;
229
230out:
231 spin_unlock_irqrestore(&c->spinlock, flags);
232 return ret;
233}
234EXPORT_SYMBOL(clk_set_parent);
235
236struct clk *clk_get_parent(struct clk *c)
237{
238 return c->parent;
239}
240EXPORT_SYMBOL(clk_get_parent);
241
242int clk_set_rate_locked(struct clk *c, unsigned long rate)
243{
244 long new_rate;
245
246 if (!c->ops || !c->ops->set_rate)
247 return -ENOSYS;
248
249 if (rate > c->max_rate)
250 rate = c->max_rate;
251
252 if (c->ops && c->ops->round_rate) {
253 new_rate = c->ops->round_rate(c, rate);
254
255 if (new_rate < 0)
256 return new_rate;
257
258 rate = new_rate;
259 }
260
261 return c->ops->set_rate(c, rate);
262}
263
264int clk_set_rate(struct clk *c, unsigned long rate)
265{
266 int ret;
267 unsigned long flags;
268
269 spin_lock_irqsave(&c->spinlock, flags);
270
271 ret = clk_set_rate_locked(c, rate);
272
273 spin_unlock_irqrestore(&c->spinlock, flags);
274
275 return ret;
276}
277EXPORT_SYMBOL(clk_set_rate);
278
279
280/* Must be called with clocks lock and all indvidual clock locks held */
281unsigned long clk_get_rate_all_locked(struct clk *c)
282{ 59{
283 u64 rate; 60 struct clk_tegra *c;
284 int mul = 1; 61 struct clk *ret = NULL;
285 int div = 1; 62 mutex_lock(&clock_list_lock);
286 struct clk *p = c; 63 list_for_each_entry(c, &clocks, node) {
287 64 if (strcmp(__clk_get_name(c->hw.clk), name) == 0) {
288 while (p) { 65 ret = c->hw.clk;
289 c = p; 66 break;
290 if (c->mul != 0 && c->div != 0) {
291 mul *= c->mul;
292 div *= c->div;
293 } 67 }
294 p = c->parent;
295 }
296
297 rate = c->rate;
298 rate *= mul;
299 do_div(rate, div);
300
301 return rate;
302}
303
304long clk_round_rate(struct clk *c, unsigned long rate)
305{
306 unsigned long flags;
307 long ret;
308
309 spin_lock_irqsave(&c->spinlock, flags);
310
311 if (!c->ops || !c->ops->round_rate) {
312 ret = -ENOSYS;
313 goto out;
314 } 68 }
315 69 mutex_unlock(&clock_list_lock);
316 if (rate > c->max_rate)
317 rate = c->max_rate;
318
319 ret = c->ops->round_rate(c, rate);
320
321out:
322 spin_unlock_irqrestore(&c->spinlock, flags);
323 return ret; 70 return ret;
324} 71}
325EXPORT_SYMBOL(clk_round_rate);
326 72
327static int tegra_clk_init_one_from_table(struct tegra_clk_init_table *table) 73static int tegra_clk_init_one_from_table(struct tegra_clk_init_table *table)
328{ 74{
329 struct clk *c; 75 struct clk *c;
330 struct clk *p; 76 struct clk *p;
77 struct clk *parent;
331 78
332 int ret = 0; 79 int ret = 0;
333 80
334 c = tegra_get_clock_by_name(table->name); 81 c = tegra_get_clock_by_name(table->name);
335 82
336 if (!c) { 83 if (!c) {
337 pr_warning("Unable to initialize clock %s\n", 84 pr_warn("Unable to initialize clock %s\n",
338 table->name); 85 table->name);
339 return -ENODEV; 86 return -ENODEV;
340 } 87 }
341 88
89 parent = clk_get_parent(c);
90
342 if (table->parent) { 91 if (table->parent) {
343 p = tegra_get_clock_by_name(table->parent); 92 p = tegra_get_clock_by_name(table->parent);
344 if (!p) { 93 if (!p) {
345 pr_warning("Unable to find parent %s of clock %s\n", 94 pr_warn("Unable to find parent %s of clock %s\n",
346 table->parent, table->name); 95 table->parent, table->name);
347 return -ENODEV; 96 return -ENODEV;
348 } 97 }
349 98
350 if (c->parent != p) { 99 if (parent != p) {
351 ret = clk_set_parent(c, p); 100 ret = clk_set_parent(c, p);
352 if (ret) { 101 if (ret) {
353 pr_warning("Unable to set parent %s of clock %s: %d\n", 102 pr_warn("Unable to set parent %s of clock %s: %d\n",
354 table->parent, table->name, ret); 103 table->parent, table->name, ret);
355 return -EINVAL; 104 return -EINVAL;
356 } 105 }
@@ -360,16 +109,16 @@ static int tegra_clk_init_one_from_table(struct tegra_clk_init_table *table)
360 if (table->rate && table->rate != clk_get_rate(c)) { 109 if (table->rate && table->rate != clk_get_rate(c)) {
361 ret = clk_set_rate(c, table->rate); 110 ret = clk_set_rate(c, table->rate);
362 if (ret) { 111 if (ret) {
363 pr_warning("Unable to set clock %s to rate %lu: %d\n", 112 pr_warn("Unable to set clock %s to rate %lu: %d\n",
364 table->name, table->rate, ret); 113 table->name, table->rate, ret);
365 return -EINVAL; 114 return -EINVAL;
366 } 115 }
367 } 116 }
368 117
369 if (table->enabled) { 118 if (table->enabled) {
370 ret = clk_enable(c); 119 ret = clk_prepare_enable(c);
371 if (ret) { 120 if (ret) {
372 pr_warning("Unable to enable clock %s: %d\n", 121 pr_warn("Unable to enable clock %s: %d\n",
373 table->name, ret); 122 table->name, ret);
374 return -EINVAL; 123 return -EINVAL;
375 } 124 }
@@ -383,19 +132,20 @@ void tegra_clk_init_from_table(struct tegra_clk_init_table *table)
383 for (; table->name; table++) 132 for (; table->name; table++)
384 tegra_clk_init_one_from_table(table); 133 tegra_clk_init_one_from_table(table);
385} 134}
386EXPORT_SYMBOL(tegra_clk_init_from_table);
387 135
388void tegra_periph_reset_deassert(struct clk *c) 136void tegra_periph_reset_deassert(struct clk *c)
389{ 137{
390 BUG_ON(!c->ops->reset); 138 struct clk_tegra *clk = to_clk_tegra(__clk_get_hw(c));
391 c->ops->reset(c, false); 139 BUG_ON(!clk->reset);
140 clk->reset(__clk_get_hw(c), false);
392} 141}
393EXPORT_SYMBOL(tegra_periph_reset_deassert); 142EXPORT_SYMBOL(tegra_periph_reset_deassert);
394 143
395void tegra_periph_reset_assert(struct clk *c) 144void tegra_periph_reset_assert(struct clk *c)
396{ 145{
397 BUG_ON(!c->ops->reset); 146 struct clk_tegra *clk = to_clk_tegra(__clk_get_hw(c));
398 c->ops->reset(c, true); 147 BUG_ON(!clk->reset);
148 clk->reset(__clk_get_hw(c), true);
399} 149}
400EXPORT_SYMBOL(tegra_periph_reset_assert); 150EXPORT_SYMBOL(tegra_periph_reset_assert);
401 151
@@ -405,268 +155,14 @@ EXPORT_SYMBOL(tegra_periph_reset_assert);
405int tegra_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting) 155int tegra_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting)
406{ 156{
407 int ret = 0; 157 int ret = 0;
408 unsigned long flags; 158 struct clk_tegra *clk = to_clk_tegra(__clk_get_hw(c));
409 159
410 spin_lock_irqsave(&c->spinlock, flags); 160 if (!clk->clk_cfg_ex) {
411
412 if (!c->ops || !c->ops->clk_cfg_ex) {
413 ret = -ENOSYS; 161 ret = -ENOSYS;
414 goto out; 162 goto out;
415 } 163 }
416 ret = c->ops->clk_cfg_ex(c, p, setting); 164 ret = clk->clk_cfg_ex(__clk_get_hw(c), p, setting);
417 165
418out: 166out:
419 spin_unlock_irqrestore(&c->spinlock, flags);
420
421 return ret; 167 return ret;
422} 168}
423
424#ifdef CONFIG_DEBUG_FS
425
426static int __clk_lock_all_spinlocks(void)
427{
428 struct clk *c;
429
430 list_for_each_entry(c, &clocks, node)
431 if (!spin_trylock(&c->spinlock))
432 goto unlock_spinlocks;
433
434 return 0;
435
436unlock_spinlocks:
437 list_for_each_entry_continue_reverse(c, &clocks, node)
438 spin_unlock(&c->spinlock);
439
440 return -EAGAIN;
441}
442
443static void __clk_unlock_all_spinlocks(void)
444{
445 struct clk *c;
446
447 list_for_each_entry_reverse(c, &clocks, node)
448 spin_unlock(&c->spinlock);
449}
450
451/*
452 * This function retries until it can take all locks, and may take
453 * an arbitrarily long time to complete.
454 * Must be called with irqs enabled, returns with irqs disabled
455 * Must be called with clock_list_lock held
456 */
457static void clk_lock_all(void)
458{
459 int ret;
460retry:
461 local_irq_disable();
462
463 ret = __clk_lock_all_spinlocks();
464 if (ret)
465 goto failed_spinlocks;
466
467 /* All locks taken successfully, return */
468 return;
469
470failed_spinlocks:
471 local_irq_enable();
472 yield();
473 goto retry;
474}
475
476/*
477 * Unlocks all clocks after a clk_lock_all
478 * Must be called with irqs disabled, returns with irqs enabled
479 * Must be called with clock_list_lock held
480 */
481static void clk_unlock_all(void)
482{
483 __clk_unlock_all_spinlocks();
484
485 local_irq_enable();
486}
487
488static struct dentry *clk_debugfs_root;
489
490
491static void clock_tree_show_one(struct seq_file *s, struct clk *c, int level)
492{
493 struct clk *child;
494 const char *state = "uninit";
495 char div[8] = {0};
496
497 if (c->state == ON)
498 state = "on";
499 else if (c->state == OFF)
500 state = "off";
501
502 if (c->mul != 0 && c->div != 0) {
503 if (c->mul > c->div) {
504 int mul = c->mul / c->div;
505 int mul2 = (c->mul * 10 / c->div) % 10;
506 int mul3 = (c->mul * 10) % c->div;
507 if (mul2 == 0 && mul3 == 0)
508 snprintf(div, sizeof(div), "x%d", mul);
509 else if (mul3 == 0)
510 snprintf(div, sizeof(div), "x%d.%d", mul, mul2);
511 else
512 snprintf(div, sizeof(div), "x%d.%d..", mul, mul2);
513 } else {
514 snprintf(div, sizeof(div), "%d%s", c->div / c->mul,
515 (c->div % c->mul) ? ".5" : "");
516 }
517 }
518
519 seq_printf(s, "%*s%c%c%-*s %-6s %-3d %-8s %-10lu\n",
520 level * 3 + 1, "",
521 c->rate > c->max_rate ? '!' : ' ',
522 !c->set ? '*' : ' ',
523 30 - level * 3, c->name,
524 state, c->refcnt, div, clk_get_rate_all_locked(c));
525
526 list_for_each_entry(child, &clocks, node) {
527 if (child->parent != c)
528 continue;
529
530 clock_tree_show_one(s, child, level + 1);
531 }
532}
533
534static int clock_tree_show(struct seq_file *s, void *data)
535{
536 struct clk *c;
537 seq_printf(s, " clock state ref div rate\n");
538 seq_printf(s, "--------------------------------------------------------------\n");
539
540 mutex_lock(&clock_list_lock);
541
542 clk_lock_all();
543
544 list_for_each_entry(c, &clocks, node)
545 if (c->parent == NULL)
546 clock_tree_show_one(s, c, 0);
547
548 clk_unlock_all();
549
550 mutex_unlock(&clock_list_lock);
551 return 0;
552}
553
554static int clock_tree_open(struct inode *inode, struct file *file)
555{
556 return single_open(file, clock_tree_show, inode->i_private);
557}
558
559static const struct file_operations clock_tree_fops = {
560 .open = clock_tree_open,
561 .read = seq_read,
562 .llseek = seq_lseek,
563 .release = single_release,
564};
565
566static int possible_parents_show(struct seq_file *s, void *data)
567{
568 struct clk *c = s->private;
569 int i;
570
571 for (i = 0; c->inputs[i].input; i++) {
572 char *first = (i == 0) ? "" : " ";
573 seq_printf(s, "%s%s", first, c->inputs[i].input->name);
574 }
575 seq_printf(s, "\n");
576 return 0;
577}
578
579static int possible_parents_open(struct inode *inode, struct file *file)
580{
581 return single_open(file, possible_parents_show, inode->i_private);
582}
583
584static const struct file_operations possible_parents_fops = {
585 .open = possible_parents_open,
586 .read = seq_read,
587 .llseek = seq_lseek,
588 .release = single_release,
589};
590
591static int clk_debugfs_register_one(struct clk *c)
592{
593 struct dentry *d;
594
595 d = debugfs_create_dir(c->name, clk_debugfs_root);
596 if (!d)
597 return -ENOMEM;
598 c->dent = d;
599
600 d = debugfs_create_u8("refcnt", S_IRUGO, c->dent, (u8 *)&c->refcnt);
601 if (!d)
602 goto err_out;
603
604 d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
605 if (!d)
606 goto err_out;
607
608 d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
609 if (!d)
610 goto err_out;
611
612 if (c->inputs) {
613 d = debugfs_create_file("possible_parents", S_IRUGO, c->dent,
614 c, &possible_parents_fops);
615 if (!d)
616 goto err_out;
617 }
618
619 return 0;
620
621err_out:
622 debugfs_remove_recursive(c->dent);
623 return -ENOMEM;
624}
625
626static int clk_debugfs_register(struct clk *c)
627{
628 int err;
629 struct clk *pa = c->parent;
630
631 if (pa && !pa->dent) {
632 err = clk_debugfs_register(pa);
633 if (err)
634 return err;
635 }
636
637 if (!c->dent) {
638 err = clk_debugfs_register_one(c);
639 if (err)
640 return err;
641 }
642 return 0;
643}
644
645int __init tegra_clk_debugfs_init(void)
646{
647 struct clk *c;
648 struct dentry *d;
649 int err = -ENOMEM;
650
651 d = debugfs_create_dir("clock", NULL);
652 if (!d)
653 return -ENOMEM;
654 clk_debugfs_root = d;
655
656 d = debugfs_create_file("clock_tree", S_IRUGO, clk_debugfs_root, NULL,
657 &clock_tree_fops);
658 if (!d)
659 goto err_out;
660
661 list_for_each_entry(c, &clocks, node) {
662 err = clk_debugfs_register(c);
663 if (err)
664 goto err_out;
665 }
666 return 0;
667err_out:
668 debugfs_remove_recursive(clk_debugfs_root);
669 return err;
670}
671
672#endif
diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h
index bc300657deb..2aa37f5c44c 100644
--- a/arch/arm/mach-tegra/clock.h
+++ b/arch/arm/mach-tegra/clock.h
@@ -2,6 +2,7 @@
2 * arch/arm/mach-tegra/include/mach/clock.h 2 * arch/arm/mach-tegra/include/mach/clock.h
3 * 3 *
4 * Copyright (C) 2010 Google, Inc. 4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (c) 2012 NVIDIA CORPORATION. All rights reserved.
5 * 6 *
6 * Author: 7 * Author:
7 * Colin Cross <ccross@google.com> 8 * Colin Cross <ccross@google.com>
@@ -20,9 +21,9 @@
20#ifndef __MACH_TEGRA_CLOCK_H 21#ifndef __MACH_TEGRA_CLOCK_H
21#define __MACH_TEGRA_CLOCK_H 22#define __MACH_TEGRA_CLOCK_H
22 23
24#include <linux/clk-provider.h>
23#include <linux/clkdev.h> 25#include <linux/clkdev.h>
24#include <linux/list.h> 26#include <linux/list.h>
25#include <linux/spinlock.h>
26 27
27#include <mach/clk.h> 28#include <mach/clk.h>
28 29
@@ -52,7 +53,8 @@
52#define ENABLE_ON_INIT (1 << 28) 53#define ENABLE_ON_INIT (1 << 28)
53#define PERIPH_ON_APB (1 << 29) 54#define PERIPH_ON_APB (1 << 29)
54 55
55struct clk; 56struct clk_tegra;
57#define to_clk_tegra(_hw) container_of(_hw, struct clk_tegra, hw)
56 58
57struct clk_mux_sel { 59struct clk_mux_sel {
58 struct clk *input; 60 struct clk *input;
@@ -68,47 +70,29 @@ struct clk_pll_freq_table {
68 u8 cpcon; 70 u8 cpcon;
69}; 71};
70 72
71struct clk_ops {
72 void (*init)(struct clk *);
73 int (*enable)(struct clk *);
74 void (*disable)(struct clk *);
75 int (*set_parent)(struct clk *, struct clk *);
76 int (*set_rate)(struct clk *, unsigned long);
77 long (*round_rate)(struct clk *, unsigned long);
78 void (*reset)(struct clk *, bool);
79 int (*clk_cfg_ex)(struct clk *,
80 enum tegra_clk_ex_param, u32);
81};
82
83enum clk_state { 73enum clk_state {
84 UNINITIALIZED = 0, 74 UNINITIALIZED = 0,
85 ON, 75 ON,
86 OFF, 76 OFF,
87}; 77};
88 78
89struct clk { 79struct clk_tegra {
90 /* node for master clocks list */ 80 /* node for master clocks list */
91 struct list_head node; /* node for list of all clocks */ 81 struct list_head node; /* node for list of all clocks */
92 struct clk_lookup lookup; 82 struct clk_lookup lookup;
83 struct clk_hw hw;
93 84
94#ifdef CONFIG_DEBUG_FS
95 struct dentry *dent;
96#endif
97 bool set; 85 bool set;
98 struct clk_ops *ops; 86 unsigned long fixed_rate;
99 unsigned long rate;
100 unsigned long max_rate; 87 unsigned long max_rate;
101 unsigned long min_rate; 88 unsigned long min_rate;
102 u32 flags; 89 u32 flags;
103 const char *name; 90 const char *name;
104 91
105 u32 refcnt;
106 enum clk_state state; 92 enum clk_state state;
107 struct clk *parent;
108 u32 div; 93 u32 div;
109 u32 mul; 94 u32 mul;
110 95
111 const struct clk_mux_sel *inputs;
112 u32 reg; 96 u32 reg;
113 u32 reg_shift; 97 u32 reg_shift;
114 98
@@ -144,7 +128,8 @@ struct clk {
144 } shared_bus_user; 128 } shared_bus_user;
145 } u; 129 } u;
146 130
147 spinlock_t spinlock; 131 void (*reset)(struct clk_hw *, bool);
132 int (*clk_cfg_ex)(struct clk_hw *, enum tegra_clk_ex_param, u32);
148}; 133};
149 134
150struct clk_duplicate { 135struct clk_duplicate {
@@ -159,13 +144,10 @@ struct tegra_clk_init_table {
159 bool enabled; 144 bool enabled;
160}; 145};
161 146
147void tegra_clk_add(struct clk *c);
162void tegra2_init_clocks(void); 148void tegra2_init_clocks(void);
163void tegra30_init_clocks(void); 149void tegra30_init_clocks(void);
164void clk_init(struct clk *clk);
165struct clk *tegra_get_clock_by_name(const char *name); 150struct clk *tegra_get_clock_by_name(const char *name);
166int clk_reparent(struct clk *c, struct clk *parent);
167void tegra_clk_init_from_table(struct tegra_clk_init_table *table); 151void tegra_clk_init_from_table(struct tegra_clk_init_table *table);
168unsigned long clk_get_rate_locked(struct clk *c);
169int clk_set_rate_locked(struct clk *c, unsigned long rate);
170 152
171#endif 153#endif
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 96fef6bcc65..0b0a5f556d3 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -31,9 +31,11 @@
31 31
32#include "board.h" 32#include "board.h"
33#include "clock.h" 33#include "clock.h"
34#include "common.h"
34#include "fuse.h" 35#include "fuse.h"
35#include "pmc.h" 36#include "pmc.h"
36#include "apbio.h" 37#include "apbio.h"
38#include "sleep.h"
37 39
38/* 40/*
39 * Storage for debug-macro.S's state. 41 * Storage for debug-macro.S's state.
@@ -135,6 +137,7 @@ void __init tegra20_init_early(void)
135 tegra_init_cache(0x331, 0x441); 137 tegra_init_cache(0x331, 0x441);
136 tegra_pmc_init(); 138 tegra_pmc_init();
137 tegra_powergate_init(); 139 tegra_powergate_init();
140 tegra20_hotplug_init();
138} 141}
139#endif 142#endif
140#ifdef CONFIG_ARCH_TEGRA_3x_SOC 143#ifdef CONFIG_ARCH_TEGRA_3x_SOC
@@ -147,11 +150,11 @@ void __init tegra30_init_early(void)
147 tegra_init_cache(0x441, 0x551); 150 tegra_init_cache(0x441, 0x551);
148 tegra_pmc_init(); 151 tegra_pmc_init();
149 tegra_powergate_init(); 152 tegra_powergate_init();
153 tegra30_hotplug_init();
150} 154}
151#endif 155#endif
152 156
153void __init tegra_init_late(void) 157void __init tegra_init_late(void)
154{ 158{
155 tegra_clk_debugfs_init();
156 tegra_powergate_debugfs_init(); 159 tegra_powergate_debugfs_init();
157} 160}
diff --git a/arch/arm/mach-tegra/common.h b/arch/arm/mach-tegra/common.h
new file mode 100644
index 00000000000..02f71b4f1e5
--- /dev/null
+++ b/arch/arm/mach-tegra/common.h
@@ -0,0 +1,4 @@
1extern struct smp_operations tegra_smp_ops;
2
3extern void tegra_cpu_die(unsigned int cpu);
4extern 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 ceb52db1e2f..627bf0f4262 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -49,6 +49,8 @@ static struct cpufreq_frequency_table freq_table[] = {
49#define NUM_CPUS 2 49#define NUM_CPUS 2
50 50
51static struct clk *cpu_clk; 51static struct clk *cpu_clk;
52static struct clk *pll_x_clk;
53static struct clk *pll_p_clk;
52static struct clk *emc_clk; 54static struct clk *emc_clk;
53 55
54static unsigned long target_cpu_speed[NUM_CPUS]; 56static unsigned long target_cpu_speed[NUM_CPUS];
@@ -71,6 +73,42 @@ static unsigned int tegra_getspeed(unsigned int cpu)
71 return rate; 73 return rate;
72} 74}
73 75
76static int tegra_cpu_clk_set_rate(unsigned long rate)
77{
78 int ret;
79
80 /*
81 * Take an extra reference to the main pll so it doesn't turn
82 * off when we move the cpu off of it
83 */
84 clk_prepare_enable(pll_x_clk);
85
86 ret = clk_set_parent(cpu_clk, pll_p_clk);
87 if (ret) {
88 pr_err("Failed to switch cpu to clock pll_p\n");
89 goto out;
90 }
91
92 if (rate == clk_get_rate(pll_p_clk))
93 goto out;
94
95 ret = clk_set_rate(pll_x_clk, rate);
96 if (ret) {
97 pr_err("Failed to change pll_x to %lu\n", rate);
98 goto out;
99 }
100
101 ret = clk_set_parent(cpu_clk, pll_x_clk);
102 if (ret) {
103 pr_err("Failed to switch cpu to clock pll_x\n");
104 goto out;
105 }
106
107out:
108 clk_disable_unprepare(pll_x_clk);
109 return ret;
110}
111
74static int tegra_update_cpu_speed(unsigned long rate) 112static int tegra_update_cpu_speed(unsigned long rate)
75{ 113{
76 int ret = 0; 114 int ret = 0;
@@ -101,7 +139,7 @@ static int tegra_update_cpu_speed(unsigned long rate)
101 freqs.old, freqs.new); 139 freqs.old, freqs.new);
102#endif 140#endif
103 141
104 ret = clk_set_rate(cpu_clk, freqs.new * 1000); 142 ret = tegra_cpu_clk_set_rate(freqs.new * 1000);
105 if (ret) { 143 if (ret) {
106 pr_err("cpu-tegra: Failed to set cpu frequency to %d kHz\n", 144 pr_err("cpu-tegra: Failed to set cpu frequency to %d kHz\n",
107 freqs.new); 145 freqs.new);
@@ -183,6 +221,14 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
183 if (IS_ERR(cpu_clk)) 221 if (IS_ERR(cpu_clk))
184 return PTR_ERR(cpu_clk); 222 return PTR_ERR(cpu_clk);
185 223
224 pll_x_clk = clk_get_sys(NULL, "pll_x");
225 if (IS_ERR(pll_x_clk))
226 return PTR_ERR(pll_x_clk);
227
228 pll_p_clk = clk_get_sys(NULL, "pll_p");
229 if (IS_ERR(pll_p_clk))
230 return PTR_ERR(pll_p_clk);
231
186 emc_clk = clk_get_sys("cpu", "emc"); 232 emc_clk = clk_get_sys("cpu", "emc");
187 if (IS_ERR(emc_clk)) { 233 if (IS_ERR(emc_clk)) {
188 clk_put(cpu_clk); 234 clk_put(cpu_clk);
diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c
deleted file mode 100644
index c70e65ffa36..00000000000
--- a/arch/arm/mach-tegra/devices.c
+++ /dev/null
@@ -1,702 +0,0 @@
1/*
2 * Copyright (C) 2010,2011 Google, Inc.
3 *
4 * Author:
5 * Colin Cross <ccross@android.com>
6 * Erik Gilling <ccross@android.com>
7 *
8 * This software is licensed under the terms of the GNU General Public
9 * License version 2, as published by the Free Software Foundation, and
10 * may be copied, distributed, and modified under those terms.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 */
18
19
20#include <linux/resource.h>
21#include <linux/platform_device.h>
22#include <linux/dma-mapping.h>
23#include <linux/fsl_devices.h>
24#include <linux/serial_8250.h>
25#include <linux/i2c-tegra.h>
26#include <asm/pmu.h>
27#include <mach/irqs.h>
28#include <mach/iomap.h>
29#include <mach/dma.h>
30#include <mach/usb_phy.h>
31
32#include "gpio-names.h"
33#include "devices.h"
34
35static struct resource gpio_resource[] = {
36 [0] = {
37 .start = TEGRA_GPIO_BASE,
38 .end = TEGRA_GPIO_BASE + TEGRA_GPIO_SIZE-1,
39 .flags = IORESOURCE_MEM,
40 },
41 [1] = {
42 .start = INT_GPIO1,
43 .end = INT_GPIO1,
44 .flags = IORESOURCE_IRQ,
45 },
46 [2] = {
47 .start = INT_GPIO2,
48 .end = INT_GPIO2,
49 .flags = IORESOURCE_IRQ,
50 },
51 [3] = {
52 .start = INT_GPIO3,
53 .end = INT_GPIO3,
54 .flags = IORESOURCE_IRQ,
55 },
56 [4] = {
57 .start = INT_GPIO4,
58 .end = INT_GPIO4,
59 .flags = IORESOURCE_IRQ,
60 },
61 [5] = {
62 .start = INT_GPIO5,
63 .end = INT_GPIO5,
64 .flags = IORESOURCE_IRQ,
65 },
66 [6] = {
67 .start = INT_GPIO6,
68 .end = INT_GPIO6,
69 .flags = IORESOURCE_IRQ,
70 },
71 [7] = {
72 .start = INT_GPIO7,
73 .end = INT_GPIO7,
74 .flags = IORESOURCE_IRQ,
75 },
76};
77
78struct platform_device tegra_gpio_device = {
79 .name = "tegra-gpio",
80 .id = -1,
81 .resource = gpio_resource,
82 .num_resources = ARRAY_SIZE(gpio_resource),
83};
84
85static struct resource pinmux_resource[] = {
86 [0] = {
87 /* Tri-state registers */
88 .start = TEGRA_APB_MISC_BASE + 0x14,
89 .end = TEGRA_APB_MISC_BASE + 0x20 + 3,
90 .flags = IORESOURCE_MEM,
91 },
92 [1] = {
93 /* Mux registers */
94 .start = TEGRA_APB_MISC_BASE + 0x80,
95 .end = TEGRA_APB_MISC_BASE + 0x9c + 3,
96 .flags = IORESOURCE_MEM,
97 },
98 [2] = {
99 /* Pull-up/down registers */
100 .start = TEGRA_APB_MISC_BASE + 0xa0,
101 .end = TEGRA_APB_MISC_BASE + 0xb0 + 3,
102 .flags = IORESOURCE_MEM,
103 },
104 [3] = {
105 /* Pad control registers */
106 .start = TEGRA_APB_MISC_BASE + 0x868,
107 .end = TEGRA_APB_MISC_BASE + 0x90c + 3,
108 .flags = IORESOURCE_MEM,
109 },
110};
111
112struct platform_device tegra_pinmux_device = {
113 .name = "tegra20-pinctrl",
114 .id = -1,
115 .resource = pinmux_resource,
116 .num_resources = ARRAY_SIZE(pinmux_resource),
117};
118
119static struct resource i2c_resource1[] = {
120 [0] = {
121 .start = INT_I2C,
122 .end = INT_I2C,
123 .flags = IORESOURCE_IRQ,
124 },
125 [1] = {
126 .start = TEGRA_I2C_BASE,
127 .end = TEGRA_I2C_BASE + TEGRA_I2C_SIZE-1,
128 .flags = IORESOURCE_MEM,
129 },
130};
131
132static struct resource i2c_resource2[] = {
133 [0] = {
134 .start = INT_I2C2,
135 .end = INT_I2C2,
136 .flags = IORESOURCE_IRQ,
137 },
138 [1] = {
139 .start = TEGRA_I2C2_BASE,
140 .end = TEGRA_I2C2_BASE + TEGRA_I2C2_SIZE-1,
141 .flags = IORESOURCE_MEM,
142 },
143};
144
145static struct resource i2c_resource3[] = {
146 [0] = {
147 .start = INT_I2C3,
148 .end = INT_I2C3,
149 .flags = IORESOURCE_IRQ,
150 },
151 [1] = {
152 .start = TEGRA_I2C3_BASE,
153 .end = TEGRA_I2C3_BASE + TEGRA_I2C3_SIZE-1,
154 .flags = IORESOURCE_MEM,
155 },
156};
157
158static struct resource i2c_resource4[] = {
159 [0] = {
160 .start = INT_DVC,
161 .end = INT_DVC,
162 .flags = IORESOURCE_IRQ,
163 },
164 [1] = {
165 .start = TEGRA_DVC_BASE,
166 .end = TEGRA_DVC_BASE + TEGRA_DVC_SIZE-1,
167 .flags = IORESOURCE_MEM,
168 },
169};
170
171static struct tegra_i2c_platform_data tegra_i2c1_platform_data = {
172 .bus_clk_rate = 400000,
173};
174
175static struct tegra_i2c_platform_data tegra_i2c2_platform_data = {
176 .bus_clk_rate = 400000,
177};
178
179static struct tegra_i2c_platform_data tegra_i2c3_platform_data = {
180 .bus_clk_rate = 400000,
181};
182
183static struct tegra_i2c_platform_data tegra_dvc_platform_data = {
184 .bus_clk_rate = 400000,
185};
186
187struct platform_device tegra_i2c_device1 = {
188 .name = "tegra-i2c",
189 .id = 0,
190 .resource = i2c_resource1,
191 .num_resources = ARRAY_SIZE(i2c_resource1),
192 .dev = {
193 .platform_data = &tegra_i2c1_platform_data,
194 },
195};
196
197struct platform_device tegra_i2c_device2 = {
198 .name = "tegra-i2c",
199 .id = 1,
200 .resource = i2c_resource2,
201 .num_resources = ARRAY_SIZE(i2c_resource2),
202 .dev = {
203 .platform_data = &tegra_i2c2_platform_data,
204 },
205};
206
207struct platform_device tegra_i2c_device3 = {
208 .name = "tegra-i2c",
209 .id = 2,
210 .resource = i2c_resource3,
211 .num_resources = ARRAY_SIZE(i2c_resource3),
212 .dev = {
213 .platform_data = &tegra_i2c3_platform_data,
214 },
215};
216
217struct platform_device tegra_i2c_device4 = {
218 .name = "tegra-i2c",
219 .id = 3,
220 .resource = i2c_resource4,
221 .num_resources = ARRAY_SIZE(i2c_resource4),
222 .dev = {
223 .platform_data = &tegra_dvc_platform_data,
224 },
225};
226
227static struct resource spi_resource1[] = {
228 [0] = {
229 .start = INT_S_LINK1,
230 .end = INT_S_LINK1,
231 .flags = IORESOURCE_IRQ,
232 },
233 [1] = {
234 .start = TEGRA_SPI1_BASE,
235 .end = TEGRA_SPI1_BASE + TEGRA_SPI1_SIZE-1,
236 .flags = IORESOURCE_MEM,
237 },
238};
239
240static struct resource spi_resource2[] = {
241 [0] = {
242 .start = INT_SPI_2,
243 .end = INT_SPI_2,
244 .flags = IORESOURCE_IRQ,
245 },
246 [1] = {
247 .start = TEGRA_SPI2_BASE,
248 .end = TEGRA_SPI2_BASE + TEGRA_SPI2_SIZE-1,
249 .flags = IORESOURCE_MEM,
250 },
251};
252
253static struct resource spi_resource3[] = {
254 [0] = {
255 .start = INT_SPI_3,
256 .end = INT_SPI_3,
257 .flags = IORESOURCE_IRQ,
258 },
259 [1] = {
260 .start = TEGRA_SPI3_BASE,
261 .end = TEGRA_SPI3_BASE + TEGRA_SPI3_SIZE-1,
262 .flags = IORESOURCE_MEM,
263 },
264};
265
266static struct resource spi_resource4[] = {
267 [0] = {
268 .start = INT_SPI_4,
269 .end = INT_SPI_4,
270 .flags = IORESOURCE_IRQ,
271 },
272 [1] = {
273 .start = TEGRA_SPI4_BASE,
274 .end = TEGRA_SPI4_BASE + TEGRA_SPI4_SIZE-1,
275 .flags = IORESOURCE_MEM,
276 },
277};
278
279struct platform_device tegra_spi_device1 = {
280 .name = "spi_tegra",
281 .id = 0,
282 .resource = spi_resource1,
283 .num_resources = ARRAY_SIZE(spi_resource1),
284 .dev = {
285 .coherent_dma_mask = 0xffffffff,
286 },
287};
288
289struct platform_device tegra_spi_device2 = {
290 .name = "spi_tegra",
291 .id = 1,
292 .resource = spi_resource2,
293 .num_resources = ARRAY_SIZE(spi_resource2),
294 .dev = {
295 .coherent_dma_mask = 0xffffffff,
296 },
297};
298
299struct platform_device tegra_spi_device3 = {
300 .name = "spi_tegra",
301 .id = 2,
302 .resource = spi_resource3,
303 .num_resources = ARRAY_SIZE(spi_resource3),
304 .dev = {
305 .coherent_dma_mask = 0xffffffff,
306 },
307};
308
309struct platform_device tegra_spi_device4 = {
310 .name = "spi_tegra",
311 .id = 3,
312 .resource = spi_resource4,
313 .num_resources = ARRAY_SIZE(spi_resource4),
314 .dev = {
315 .coherent_dma_mask = 0xffffffff,
316 },
317};
318
319
320static struct resource sdhci_resource1[] = {
321 [0] = {
322 .start = INT_SDMMC1,
323 .end = INT_SDMMC1,
324 .flags = IORESOURCE_IRQ,
325 },
326 [1] = {
327 .start = TEGRA_SDMMC1_BASE,
328 .end = TEGRA_SDMMC1_BASE + TEGRA_SDMMC1_SIZE-1,
329 .flags = IORESOURCE_MEM,
330 },
331};
332
333static struct resource sdhci_resource2[] = {
334 [0] = {
335 .start = INT_SDMMC2,
336 .end = INT_SDMMC2,
337 .flags = IORESOURCE_IRQ,
338 },
339 [1] = {
340 .start = TEGRA_SDMMC2_BASE,
341 .end = TEGRA_SDMMC2_BASE + TEGRA_SDMMC2_SIZE-1,
342 .flags = IORESOURCE_MEM,
343 },
344};
345
346static struct resource sdhci_resource3[] = {
347 [0] = {
348 .start = INT_SDMMC3,
349 .end = INT_SDMMC3,
350 .flags = IORESOURCE_IRQ,
351 },
352 [1] = {
353 .start = TEGRA_SDMMC3_BASE,
354 .end = TEGRA_SDMMC3_BASE + TEGRA_SDMMC3_SIZE-1,
355 .flags = IORESOURCE_MEM,
356 },
357};
358
359static struct resource sdhci_resource4[] = {
360 [0] = {
361 .start = INT_SDMMC4,
362 .end = INT_SDMMC4,
363 .flags = IORESOURCE_IRQ,
364 },
365 [1] = {
366 .start = TEGRA_SDMMC4_BASE,
367 .end = TEGRA_SDMMC4_BASE + TEGRA_SDMMC4_SIZE-1,
368 .flags = IORESOURCE_MEM,
369 },
370};
371
372/* board files should fill in platform_data register the devices themselvs.
373 * See board-harmony.c for an example
374 */
375struct platform_device tegra_sdhci_device1 = {
376 .name = "sdhci-tegra",
377 .id = 0,
378 .resource = sdhci_resource1,
379 .num_resources = ARRAY_SIZE(sdhci_resource1),
380};
381
382struct platform_device tegra_sdhci_device2 = {
383 .name = "sdhci-tegra",
384 .id = 1,
385 .resource = sdhci_resource2,
386 .num_resources = ARRAY_SIZE(sdhci_resource2),
387};
388
389struct platform_device tegra_sdhci_device3 = {
390 .name = "sdhci-tegra",
391 .id = 2,
392 .resource = sdhci_resource3,
393 .num_resources = ARRAY_SIZE(sdhci_resource3),
394};
395
396struct platform_device tegra_sdhci_device4 = {
397 .name = "sdhci-tegra",
398 .id = 3,
399 .resource = sdhci_resource4,
400 .num_resources = ARRAY_SIZE(sdhci_resource4),
401};
402
403static struct resource tegra_usb1_resources[] = {
404 [0] = {
405 .start = TEGRA_USB_BASE,
406 .end = TEGRA_USB_BASE + TEGRA_USB_SIZE - 1,
407 .flags = IORESOURCE_MEM,
408 },
409 [1] = {
410 .start = INT_USB,
411 .end = INT_USB,
412 .flags = IORESOURCE_IRQ,
413 },
414};
415
416static struct resource tegra_usb2_resources[] = {
417 [0] = {
418 .start = TEGRA_USB2_BASE,
419 .end = TEGRA_USB2_BASE + TEGRA_USB2_SIZE - 1,
420 .flags = IORESOURCE_MEM,
421 },
422 [1] = {
423 .start = INT_USB2,
424 .end = INT_USB2,
425 .flags = IORESOURCE_IRQ,
426 },
427};
428
429static struct resource tegra_usb3_resources[] = {
430 [0] = {
431 .start = TEGRA_USB3_BASE,
432 .end = TEGRA_USB3_BASE + TEGRA_USB3_SIZE - 1,
433 .flags = IORESOURCE_MEM,
434 },
435 [1] = {
436 .start = INT_USB3,
437 .end = INT_USB3,
438 .flags = IORESOURCE_IRQ,
439 },
440};
441
442struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
443 .reset_gpio = -1,
444 .clk = "cdev2",
445};
446
447struct tegra_ehci_platform_data tegra_ehci1_pdata = {
448 .operating_mode = TEGRA_USB_OTG,
449 .power_down_on_bus_suspend = 1,
450 .vbus_gpio = -1,
451};
452
453struct tegra_ehci_platform_data tegra_ehci2_pdata = {
454 .phy_config = &tegra_ehci2_ulpi_phy_config,
455 .operating_mode = TEGRA_USB_HOST,
456 .power_down_on_bus_suspend = 1,
457 .vbus_gpio = -1,
458};
459
460struct tegra_ehci_platform_data tegra_ehci3_pdata = {
461 .operating_mode = TEGRA_USB_HOST,
462 .power_down_on_bus_suspend = 1,
463 .vbus_gpio = -1,
464};
465
466static u64 tegra_ehci_dmamask = DMA_BIT_MASK(32);
467
468struct platform_device tegra_ehci1_device = {
469 .name = "tegra-ehci",
470 .id = 0,
471 .dev = {
472 .dma_mask = &tegra_ehci_dmamask,
473 .coherent_dma_mask = DMA_BIT_MASK(32),
474 .platform_data = &tegra_ehci1_pdata,
475 },
476 .resource = tegra_usb1_resources,
477 .num_resources = ARRAY_SIZE(tegra_usb1_resources),
478};
479
480struct platform_device tegra_ehci2_device = {
481 .name = "tegra-ehci",
482 .id = 1,
483 .dev = {
484 .dma_mask = &tegra_ehci_dmamask,
485 .coherent_dma_mask = DMA_BIT_MASK(32),
486 .platform_data = &tegra_ehci2_pdata,
487 },
488 .resource = tegra_usb2_resources,
489 .num_resources = ARRAY_SIZE(tegra_usb2_resources),
490};
491
492struct platform_device tegra_ehci3_device = {
493 .name = "tegra-ehci",
494 .id = 2,
495 .dev = {
496 .dma_mask = &tegra_ehci_dmamask,
497 .coherent_dma_mask = DMA_BIT_MASK(32),
498 .platform_data = &tegra_ehci3_pdata,
499 },
500 .resource = tegra_usb3_resources,
501 .num_resources = ARRAY_SIZE(tegra_usb3_resources),
502};
503
504static struct resource tegra_pmu_resources[] = {
505 [0] = {
506 .start = INT_CPU0_PMU_INTR,
507 .end = INT_CPU0_PMU_INTR,
508 .flags = IORESOURCE_IRQ,
509 },
510 [1] = {
511 .start = INT_CPU1_PMU_INTR,
512 .end = INT_CPU1_PMU_INTR,
513 .flags = IORESOURCE_IRQ,
514 },
515};
516
517struct platform_device tegra_pmu_device = {
518 .name = "arm-pmu",
519 .id = ARM_PMU_DEVICE_CPU,
520 .num_resources = ARRAY_SIZE(tegra_pmu_resources),
521 .resource = tegra_pmu_resources,
522};
523
524static struct resource tegra_uarta_resources[] = {
525 [0] = {
526 .start = TEGRA_UARTA_BASE,
527 .end = TEGRA_UARTA_BASE + TEGRA_UARTA_SIZE - 1,
528 .flags = IORESOURCE_MEM,
529 },
530 [1] = {
531 .start = INT_UARTA,
532 .end = INT_UARTA,
533 .flags = IORESOURCE_IRQ,
534 },
535};
536
537static struct resource tegra_uartb_resources[] = {
538 [0] = {
539 .start = TEGRA_UARTB_BASE,
540 .end = TEGRA_UARTB_BASE + TEGRA_UARTB_SIZE - 1,
541 .flags = IORESOURCE_MEM,
542 },
543 [1] = {
544 .start = INT_UARTB,
545 .end = INT_UARTB,
546 .flags = IORESOURCE_IRQ,
547 },
548};
549
550static struct resource tegra_uartc_resources[] = {
551 [0] = {
552 .start = TEGRA_UARTC_BASE,
553 .end = TEGRA_UARTC_BASE + TEGRA_UARTC_SIZE - 1,
554 .flags = IORESOURCE_MEM,
555 },
556 [1] = {
557 .start = INT_UARTC,
558 .end = INT_UARTC,
559 .flags = IORESOURCE_IRQ,
560 },
561};
562
563static struct resource tegra_uartd_resources[] = {
564 [0] = {
565 .start = TEGRA_UARTD_BASE,
566 .end = TEGRA_UARTD_BASE + TEGRA_UARTD_SIZE - 1,
567 .flags = IORESOURCE_MEM,
568 },
569 [1] = {
570 .start = INT_UARTD,
571 .end = INT_UARTD,
572 .flags = IORESOURCE_IRQ,
573 },
574};
575
576static struct resource tegra_uarte_resources[] = {
577 [0] = {
578 .start = TEGRA_UARTE_BASE,
579 .end = TEGRA_UARTE_BASE + TEGRA_UARTE_SIZE - 1,
580 .flags = IORESOURCE_MEM,
581 },
582 [1] = {
583 .start = INT_UARTE,
584 .end = INT_UARTE,
585 .flags = IORESOURCE_IRQ,
586 },
587};
588
589struct platform_device tegra_uarta_device = {
590 .name = "tegra_uart",
591 .id = 0,
592 .num_resources = ARRAY_SIZE(tegra_uarta_resources),
593 .resource = tegra_uarta_resources,
594 .dev = {
595 .coherent_dma_mask = DMA_BIT_MASK(32),
596 },
597};
598
599struct platform_device tegra_uartb_device = {
600 .name = "tegra_uart",
601 .id = 1,
602 .num_resources = ARRAY_SIZE(tegra_uartb_resources),
603 .resource = tegra_uartb_resources,
604 .dev = {
605 .coherent_dma_mask = DMA_BIT_MASK(32),
606 },
607};
608
609struct platform_device tegra_uartc_device = {
610 .name = "tegra_uart",
611 .id = 2,
612 .num_resources = ARRAY_SIZE(tegra_uartc_resources),
613 .resource = tegra_uartc_resources,
614 .dev = {
615 .coherent_dma_mask = DMA_BIT_MASK(32),
616 },
617};
618
619struct platform_device tegra_uartd_device = {
620 .name = "tegra_uart",
621 .id = 3,
622 .num_resources = ARRAY_SIZE(tegra_uartd_resources),
623 .resource = tegra_uartd_resources,
624 .dev = {
625 .coherent_dma_mask = DMA_BIT_MASK(32),
626 },
627};
628
629struct platform_device tegra_uarte_device = {
630 .name = "tegra_uart",
631 .id = 4,
632 .num_resources = ARRAY_SIZE(tegra_uarte_resources),
633 .resource = tegra_uarte_resources,
634 .dev = {
635 .coherent_dma_mask = DMA_BIT_MASK(32),
636 },
637};
638
639static struct resource i2s_resource1[] = {
640 [0] = {
641 .start = INT_I2S1,
642 .end = INT_I2S1,
643 .flags = IORESOURCE_IRQ
644 },
645 [1] = {
646 .start = TEGRA_DMA_REQ_SEL_I2S_1,
647 .end = TEGRA_DMA_REQ_SEL_I2S_1,
648 .flags = IORESOURCE_DMA
649 },
650 [2] = {
651 .start = TEGRA_I2S1_BASE,
652 .end = TEGRA_I2S1_BASE + TEGRA_I2S1_SIZE - 1,
653 .flags = IORESOURCE_MEM
654 }
655};
656
657static struct resource i2s_resource2[] = {
658 [0] = {
659 .start = INT_I2S2,
660 .end = INT_I2S2,
661 .flags = IORESOURCE_IRQ
662 },
663 [1] = {
664 .start = TEGRA_DMA_REQ_SEL_I2S2_1,
665 .end = TEGRA_DMA_REQ_SEL_I2S2_1,
666 .flags = IORESOURCE_DMA
667 },
668 [2] = {
669 .start = TEGRA_I2S2_BASE,
670 .end = TEGRA_I2S2_BASE + TEGRA_I2S2_SIZE - 1,
671 .flags = IORESOURCE_MEM
672 }
673};
674
675struct platform_device tegra_i2s_device1 = {
676 .name = "tegra20-i2s",
677 .id = 0,
678 .resource = i2s_resource1,
679 .num_resources = ARRAY_SIZE(i2s_resource1),
680};
681
682struct platform_device tegra_i2s_device2 = {
683 .name = "tegra20-i2s",
684 .id = 1,
685 .resource = i2s_resource2,
686 .num_resources = ARRAY_SIZE(i2s_resource2),
687};
688
689static struct resource tegra_das_resources[] = {
690 [0] = {
691 .start = TEGRA_APB_MISC_DAS_BASE,
692 .end = TEGRA_APB_MISC_DAS_BASE + TEGRA_APB_MISC_DAS_SIZE - 1,
693 .flags = IORESOURCE_MEM,
694 },
695};
696
697struct platform_device tegra_das_device = {
698 .name = "tegra20-das",
699 .id = -1,
700 .num_resources = ARRAY_SIZE(tegra_das_resources),
701 .resource = tegra_das_resources,
702};
diff --git a/arch/arm/mach-tegra/devices.h b/arch/arm/mach-tegra/devices.h
deleted file mode 100644
index 4f505272649..00000000000
--- a/arch/arm/mach-tegra/devices.h
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * Copyright (C) 2010,2011 Google, Inc.
3 *
4 * Author:
5 * Colin Cross <ccross@android.com>
6 * Erik Gilling <ccross@android.com>
7 *
8 * This software is licensed under the terms of the GNU General Public
9 * License version 2, as published by the Free Software Foundation, and
10 * may be copied, distributed, and modified under those terms.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 */
18
19#ifndef __MACH_TEGRA_DEVICES_H
20#define __MACH_TEGRA_DEVICES_H
21
22#include <linux/platform_device.h>
23#include <linux/platform_data/tegra_usb.h>
24
25#include <mach/usb_phy.h>
26
27extern struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config;
28
29extern struct tegra_ehci_platform_data tegra_ehci1_pdata;
30extern struct tegra_ehci_platform_data tegra_ehci2_pdata;
31extern struct tegra_ehci_platform_data tegra_ehci3_pdata;
32
33extern struct platform_device tegra_gpio_device;
34extern struct platform_device tegra_pinmux_device;
35extern struct platform_device tegra_sdhci_device1;
36extern struct platform_device tegra_sdhci_device2;
37extern struct platform_device tegra_sdhci_device3;
38extern struct platform_device tegra_sdhci_device4;
39extern struct platform_device tegra_i2c_device1;
40extern struct platform_device tegra_i2c_device2;
41extern struct platform_device tegra_i2c_device3;
42extern struct platform_device tegra_i2c_device4;
43extern struct platform_device tegra_spi_device1;
44extern struct platform_device tegra_spi_device2;
45extern struct platform_device tegra_spi_device3;
46extern struct platform_device tegra_spi_device4;
47extern struct platform_device tegra_ehci1_device;
48extern struct platform_device tegra_ehci2_device;
49extern struct platform_device tegra_ehci3_device;
50extern struct platform_device tegra_uarta_device;
51extern struct platform_device tegra_uartb_device;
52extern struct platform_device tegra_uartc_device;
53extern struct platform_device tegra_uartd_device;
54extern struct platform_device tegra_uarte_device;
55extern struct platform_device tegra_pmu_device;
56extern struct platform_device tegra_i2s_device1;
57extern struct platform_device tegra_i2s_device2;
58extern struct platform_device tegra_das_device;
59
60#endif
diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c
deleted file mode 100644
index 29c5114d607..00000000000
--- a/arch/arm/mach-tegra/dma.c
+++ /dev/null
@@ -1,823 +0,0 @@
1/*
2 * arch/arm/mach-tegra/dma.c
3 *
4 * System DMA driver for NVIDIA Tegra SoCs
5 *
6 * Copyright (c) 2008-2009, NVIDIA Corporation.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 */
22
23#include <linux/io.h>
24#include <linux/interrupt.h>
25#include <linux/module.h>
26#include <linux/spinlock.h>
27#include <linux/err.h>
28#include <linux/irq.h>
29#include <linux/delay.h>
30#include <linux/clk.h>
31#include <mach/dma.h>
32#include <mach/irqs.h>
33#include <mach/iomap.h>
34#include <mach/suspend.h>
35
36#include "apbio.h"
37
38#define APB_DMA_GEN 0x000
39#define GEN_ENABLE (1<<31)
40
41#define APB_DMA_CNTRL 0x010
42
43#define APB_DMA_IRQ_MASK 0x01c
44
45#define APB_DMA_IRQ_MASK_SET 0x020
46
47#define APB_DMA_CHAN_CSR 0x000
48#define CSR_ENB (1<<31)
49#define CSR_IE_EOC (1<<30)
50#define CSR_HOLD (1<<29)
51#define CSR_DIR (1<<28)
52#define CSR_ONCE (1<<27)
53#define CSR_FLOW (1<<21)
54#define CSR_REQ_SEL_SHIFT 16
55#define CSR_WCOUNT_SHIFT 2
56#define CSR_WCOUNT_MASK 0xFFFC
57
58#define APB_DMA_CHAN_STA 0x004
59#define STA_BUSY (1<<31)
60#define STA_ISE_EOC (1<<30)
61#define STA_HALT (1<<29)
62#define STA_PING_PONG (1<<28)
63#define STA_COUNT_SHIFT 2
64#define STA_COUNT_MASK 0xFFFC
65
66#define APB_DMA_CHAN_AHB_PTR 0x010
67
68#define APB_DMA_CHAN_AHB_SEQ 0x014
69#define AHB_SEQ_INTR_ENB (1<<31)
70#define AHB_SEQ_BUS_WIDTH_SHIFT 28
71#define AHB_SEQ_BUS_WIDTH_MASK (0x7<<AHB_SEQ_BUS_WIDTH_SHIFT)
72#define AHB_SEQ_BUS_WIDTH_8 (0<<AHB_SEQ_BUS_WIDTH_SHIFT)
73#define AHB_SEQ_BUS_WIDTH_16 (1<<AHB_SEQ_BUS_WIDTH_SHIFT)
74#define AHB_SEQ_BUS_WIDTH_32 (2<<AHB_SEQ_BUS_WIDTH_SHIFT)
75#define AHB_SEQ_BUS_WIDTH_64 (3<<AHB_SEQ_BUS_WIDTH_SHIFT)
76#define AHB_SEQ_BUS_WIDTH_128 (4<<AHB_SEQ_BUS_WIDTH_SHIFT)
77#define AHB_SEQ_DATA_SWAP (1<<27)
78#define AHB_SEQ_BURST_MASK (0x7<<24)
79#define AHB_SEQ_BURST_1 (4<<24)
80#define AHB_SEQ_BURST_4 (5<<24)
81#define AHB_SEQ_BURST_8 (6<<24)
82#define AHB_SEQ_DBL_BUF (1<<19)
83#define AHB_SEQ_WRAP_SHIFT 16
84#define AHB_SEQ_WRAP_MASK (0x7<<AHB_SEQ_WRAP_SHIFT)
85
86#define APB_DMA_CHAN_APB_PTR 0x018
87
88#define APB_DMA_CHAN_APB_SEQ 0x01c
89#define APB_SEQ_BUS_WIDTH_SHIFT 28
90#define APB_SEQ_BUS_WIDTH_MASK (0x7<<APB_SEQ_BUS_WIDTH_SHIFT)
91#define APB_SEQ_BUS_WIDTH_8 (0<<APB_SEQ_BUS_WIDTH_SHIFT)
92#define APB_SEQ_BUS_WIDTH_16 (1<<APB_SEQ_BUS_WIDTH_SHIFT)
93#define APB_SEQ_BUS_WIDTH_32 (2<<APB_SEQ_BUS_WIDTH_SHIFT)
94#define APB_SEQ_BUS_WIDTH_64 (3<<APB_SEQ_BUS_WIDTH_SHIFT)
95#define APB_SEQ_BUS_WIDTH_128 (4<<APB_SEQ_BUS_WIDTH_SHIFT)
96#define APB_SEQ_DATA_SWAP (1<<27)
97#define APB_SEQ_WRAP_SHIFT 16
98#define APB_SEQ_WRAP_MASK (0x7<<APB_SEQ_WRAP_SHIFT)
99
100#define TEGRA_SYSTEM_DMA_CH_NR 16
101#define TEGRA_SYSTEM_DMA_AVP_CH_NUM 4
102#define TEGRA_SYSTEM_DMA_CH_MIN 0
103#define TEGRA_SYSTEM_DMA_CH_MAX \
104 (TEGRA_SYSTEM_DMA_CH_NR - TEGRA_SYSTEM_DMA_AVP_CH_NUM - 1)
105
106#define NV_DMA_MAX_TRASFER_SIZE 0x10000
107
108static const unsigned int ahb_addr_wrap_table[8] = {
109 0, 32, 64, 128, 256, 512, 1024, 2048
110};
111
112static const unsigned int apb_addr_wrap_table[8] = {
113 0, 1, 2, 4, 8, 16, 32, 64
114};
115
116static const unsigned int bus_width_table[5] = {
117 8, 16, 32, 64, 128
118};
119
120#define TEGRA_DMA_NAME_SIZE 16
121struct tegra_dma_channel {
122 struct list_head list;
123 int id;
124 spinlock_t lock;
125 char name[TEGRA_DMA_NAME_SIZE];
126 void __iomem *addr;
127 int mode;
128 int irq;
129 int req_transfer_count;
130};
131
132#define NV_DMA_MAX_CHANNELS 32
133
134static bool tegra_dma_initialized;
135static DEFINE_MUTEX(tegra_dma_lock);
136static DEFINE_SPINLOCK(enable_lock);
137
138static DECLARE_BITMAP(channel_usage, NV_DMA_MAX_CHANNELS);
139static struct tegra_dma_channel dma_channels[NV_DMA_MAX_CHANNELS];
140
141static void tegra_dma_update_hw(struct tegra_dma_channel *ch,
142 struct tegra_dma_req *req);
143static void tegra_dma_update_hw_partial(struct tegra_dma_channel *ch,
144 struct tegra_dma_req *req);
145static void tegra_dma_stop(struct tegra_dma_channel *ch);
146
147void tegra_dma_flush(struct tegra_dma_channel *ch)
148{
149}
150EXPORT_SYMBOL(tegra_dma_flush);
151
152void tegra_dma_dequeue(struct tegra_dma_channel *ch)
153{
154 struct tegra_dma_req *req;
155
156 if (tegra_dma_is_empty(ch))
157 return;
158
159 req = list_entry(ch->list.next, typeof(*req), node);
160
161 tegra_dma_dequeue_req(ch, req);
162 return;
163}
164
165static void tegra_dma_stop(struct tegra_dma_channel *ch)
166{
167 u32 csr;
168 u32 status;
169
170 csr = readl(ch->addr + APB_DMA_CHAN_CSR);
171 csr &= ~CSR_IE_EOC;
172 writel(csr, ch->addr + APB_DMA_CHAN_CSR);
173
174 csr &= ~CSR_ENB;
175 writel(csr, ch->addr + APB_DMA_CHAN_CSR);
176
177 status = readl(ch->addr + APB_DMA_CHAN_STA);
178 if (status & STA_ISE_EOC)
179 writel(status, ch->addr + APB_DMA_CHAN_STA);
180}
181
182static int tegra_dma_cancel(struct tegra_dma_channel *ch)
183{
184 unsigned long irq_flags;
185
186 spin_lock_irqsave(&ch->lock, irq_flags);
187 while (!list_empty(&ch->list))
188 list_del(ch->list.next);
189
190 tegra_dma_stop(ch);
191
192 spin_unlock_irqrestore(&ch->lock, irq_flags);
193 return 0;
194}
195
196static unsigned int get_channel_status(struct tegra_dma_channel *ch,
197 struct tegra_dma_req *req, bool is_stop_dma)
198{
199 void __iomem *addr = IO_ADDRESS(TEGRA_APB_DMA_BASE);
200 unsigned int status;
201
202 if (is_stop_dma) {
203 /*
204 * STOP the DMA and get the transfer count.
205 * Getting the transfer count is tricky.
206 * - Globally disable DMA on all channels
207 * - Read the channel's status register to know the number
208 * of pending bytes to be transfered.
209 * - Stop the dma channel
210 * - Globally re-enable DMA to resume other transfers
211 */
212 spin_lock(&enable_lock);
213 writel(0, addr + APB_DMA_GEN);
214 udelay(20);
215 status = readl(ch->addr + APB_DMA_CHAN_STA);
216 tegra_dma_stop(ch);
217 writel(GEN_ENABLE, addr + APB_DMA_GEN);
218 spin_unlock(&enable_lock);
219 if (status & STA_ISE_EOC) {
220 pr_err("Got Dma Int here clearing");
221 writel(status, ch->addr + APB_DMA_CHAN_STA);
222 }
223 req->status = TEGRA_DMA_REQ_ERROR_ABORTED;
224 } else {
225 status = readl(ch->addr + APB_DMA_CHAN_STA);
226 }
227 return status;
228}
229
230/* should be called with the channel lock held */
231static unsigned int dma_active_count(struct tegra_dma_channel *ch,
232 struct tegra_dma_req *req, unsigned int status)
233{
234 unsigned int to_transfer;
235 unsigned int req_transfer_count;
236 unsigned int bytes_transferred;
237
238 to_transfer = ((status & STA_COUNT_MASK) >> STA_COUNT_SHIFT) + 1;
239 req_transfer_count = ch->req_transfer_count + 1;
240 bytes_transferred = req_transfer_count;
241 if (status & STA_BUSY)
242 bytes_transferred -= to_transfer;
243 /*
244 * In continuous transfer mode, DMA only tracks the count of the
245 * half DMA buffer. So, if the DMA already finished half the DMA
246 * then add the half buffer to the completed count.
247 */
248 if (ch->mode & TEGRA_DMA_MODE_CONTINOUS) {
249 if (req->buffer_status == TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL)
250 bytes_transferred += req_transfer_count;
251 if (status & STA_ISE_EOC)
252 bytes_transferred += req_transfer_count;
253 }
254 bytes_transferred *= 4;
255 return bytes_transferred;
256}
257
258int tegra_dma_dequeue_req(struct tegra_dma_channel *ch,
259 struct tegra_dma_req *_req)
260{
261 unsigned int status;
262 struct tegra_dma_req *req = NULL;
263 int found = 0;
264 unsigned long irq_flags;
265 int stop = 0;
266
267 spin_lock_irqsave(&ch->lock, irq_flags);
268
269 if (list_entry(ch->list.next, struct tegra_dma_req, node) == _req)
270 stop = 1;
271
272 list_for_each_entry(req, &ch->list, node) {
273 if (req == _req) {
274 list_del(&req->node);
275 found = 1;
276 break;
277 }
278 }
279 if (!found) {
280 spin_unlock_irqrestore(&ch->lock, irq_flags);
281 return 0;
282 }
283
284 if (!stop)
285 goto skip_stop_dma;
286
287 status = get_channel_status(ch, req, true);
288 req->bytes_transferred = dma_active_count(ch, req, status);
289
290 if (!list_empty(&ch->list)) {
291 /* if the list is not empty, queue the next request */
292 struct tegra_dma_req *next_req;
293 next_req = list_entry(ch->list.next,
294 typeof(*next_req), node);
295 tegra_dma_update_hw(ch, next_req);
296 }
297
298skip_stop_dma:
299 req->status = -TEGRA_DMA_REQ_ERROR_ABORTED;
300
301 spin_unlock_irqrestore(&ch->lock, irq_flags);
302
303 /* Callback should be called without any lock */
304 req->complete(req);
305 return 0;
306}
307EXPORT_SYMBOL(tegra_dma_dequeue_req);
308
309bool tegra_dma_is_empty(struct tegra_dma_channel *ch)
310{
311 unsigned long irq_flags;
312 bool is_empty;
313
314 spin_lock_irqsave(&ch->lock, irq_flags);
315 if (list_empty(&ch->list))
316 is_empty = true;
317 else
318 is_empty = false;
319 spin_unlock_irqrestore(&ch->lock, irq_flags);
320 return is_empty;
321}
322EXPORT_SYMBOL(tegra_dma_is_empty);
323
324bool tegra_dma_is_req_inflight(struct tegra_dma_channel *ch,
325 struct tegra_dma_req *_req)
326{
327 unsigned long irq_flags;
328 struct tegra_dma_req *req;
329
330 spin_lock_irqsave(&ch->lock, irq_flags);
331 list_for_each_entry(req, &ch->list, node) {
332 if (req == _req) {
333 spin_unlock_irqrestore(&ch->lock, irq_flags);
334 return true;
335 }
336 }
337 spin_unlock_irqrestore(&ch->lock, irq_flags);
338 return false;
339}
340EXPORT_SYMBOL(tegra_dma_is_req_inflight);
341
342int tegra_dma_enqueue_req(struct tegra_dma_channel *ch,
343 struct tegra_dma_req *req)
344{
345 unsigned long irq_flags;
346 struct tegra_dma_req *_req;
347 int start_dma = 0;
348
349 if (req->size > NV_DMA_MAX_TRASFER_SIZE ||
350 req->source_addr & 0x3 || req->dest_addr & 0x3) {
351 pr_err("Invalid DMA request for channel %d\n", ch->id);
352 return -EINVAL;
353 }
354
355 spin_lock_irqsave(&ch->lock, irq_flags);
356
357 list_for_each_entry(_req, &ch->list, node) {
358 if (req == _req) {
359 spin_unlock_irqrestore(&ch->lock, irq_flags);
360 return -EEXIST;
361 }
362 }
363
364 req->bytes_transferred = 0;
365 req->status = 0;
366 req->buffer_status = 0;
367 if (list_empty(&ch->list))
368 start_dma = 1;
369
370 list_add_tail(&req->node, &ch->list);
371
372 if (start_dma)
373 tegra_dma_update_hw(ch, req);
374
375 spin_unlock_irqrestore(&ch->lock, irq_flags);
376
377 return 0;
378}
379EXPORT_SYMBOL(tegra_dma_enqueue_req);
380
381struct tegra_dma_channel *tegra_dma_allocate_channel(int mode)
382{
383 int channel;
384 struct tegra_dma_channel *ch = NULL;
385
386 if (!tegra_dma_initialized)
387 return NULL;
388
389 mutex_lock(&tegra_dma_lock);
390
391 /* first channel is the shared channel */
392 if (mode & TEGRA_DMA_SHARED) {
393 channel = TEGRA_SYSTEM_DMA_CH_MIN;
394 } else {
395 channel = find_first_zero_bit(channel_usage,
396 ARRAY_SIZE(dma_channels));
397 if (channel >= ARRAY_SIZE(dma_channels))
398 goto out;
399 }
400 __set_bit(channel, channel_usage);
401 ch = &dma_channels[channel];
402 ch->mode = mode;
403
404out:
405 mutex_unlock(&tegra_dma_lock);
406 return ch;
407}
408EXPORT_SYMBOL(tegra_dma_allocate_channel);
409
410void tegra_dma_free_channel(struct tegra_dma_channel *ch)
411{
412 if (ch->mode & TEGRA_DMA_SHARED)
413 return;
414 tegra_dma_cancel(ch);
415 mutex_lock(&tegra_dma_lock);
416 __clear_bit(ch->id, channel_usage);
417 mutex_unlock(&tegra_dma_lock);
418}
419EXPORT_SYMBOL(tegra_dma_free_channel);
420
421static void tegra_dma_update_hw_partial(struct tegra_dma_channel *ch,
422 struct tegra_dma_req *req)
423{
424 u32 apb_ptr;
425 u32 ahb_ptr;
426
427 if (req->to_memory) {
428 apb_ptr = req->source_addr;
429 ahb_ptr = req->dest_addr;
430 } else {
431 apb_ptr = req->dest_addr;
432 ahb_ptr = req->source_addr;
433 }
434 writel(apb_ptr, ch->addr + APB_DMA_CHAN_APB_PTR);
435 writel(ahb_ptr, ch->addr + APB_DMA_CHAN_AHB_PTR);
436
437 req->status = TEGRA_DMA_REQ_INFLIGHT;
438 return;
439}
440
441static void tegra_dma_update_hw(struct tegra_dma_channel *ch,
442 struct tegra_dma_req *req)
443{
444 int ahb_addr_wrap;
445 int apb_addr_wrap;
446 int ahb_bus_width;
447 int apb_bus_width;
448 int index;
449
450 u32 ahb_seq;
451 u32 apb_seq;
452 u32 ahb_ptr;
453 u32 apb_ptr;
454 u32 csr;
455
456 csr = CSR_IE_EOC | CSR_FLOW;
457 ahb_seq = AHB_SEQ_INTR_ENB | AHB_SEQ_BURST_1;
458 apb_seq = 0;
459
460 csr |= req->req_sel << CSR_REQ_SEL_SHIFT;
461
462 /* One shot mode is always single buffered,
463 * continuous mode is always double buffered
464 * */
465 if (ch->mode & TEGRA_DMA_MODE_ONESHOT) {
466 csr |= CSR_ONCE;
467 ch->req_transfer_count = (req->size >> 2) - 1;
468 } else {
469 ahb_seq |= AHB_SEQ_DBL_BUF;
470
471 /* In double buffered mode, we set the size to half the
472 * requested size and interrupt when half the buffer
473 * is full */
474 ch->req_transfer_count = (req->size >> 3) - 1;
475 }
476
477 csr |= ch->req_transfer_count << CSR_WCOUNT_SHIFT;
478
479 if (req->to_memory) {
480 apb_ptr = req->source_addr;
481 ahb_ptr = req->dest_addr;
482
483 apb_addr_wrap = req->source_wrap;
484 ahb_addr_wrap = req->dest_wrap;
485 apb_bus_width = req->source_bus_width;
486 ahb_bus_width = req->dest_bus_width;
487
488 } else {
489 csr |= CSR_DIR;
490 apb_ptr = req->dest_addr;
491 ahb_ptr = req->source_addr;
492
493 apb_addr_wrap = req->dest_wrap;
494 ahb_addr_wrap = req->source_wrap;
495 apb_bus_width = req->dest_bus_width;
496 ahb_bus_width = req->source_bus_width;
497 }
498
499 apb_addr_wrap >>= 2;
500 ahb_addr_wrap >>= 2;
501
502 /* set address wrap for APB size */
503 index = 0;
504 do {
505 if (apb_addr_wrap_table[index] == apb_addr_wrap)
506 break;
507 index++;
508 } while (index < ARRAY_SIZE(apb_addr_wrap_table));
509 BUG_ON(index == ARRAY_SIZE(apb_addr_wrap_table));
510 apb_seq |= index << APB_SEQ_WRAP_SHIFT;
511
512 /* set address wrap for AHB size */
513 index = 0;
514 do {
515 if (ahb_addr_wrap_table[index] == ahb_addr_wrap)
516 break;
517 index++;
518 } while (index < ARRAY_SIZE(ahb_addr_wrap_table));
519 BUG_ON(index == ARRAY_SIZE(ahb_addr_wrap_table));
520 ahb_seq |= index << AHB_SEQ_WRAP_SHIFT;
521
522 for (index = 0; index < ARRAY_SIZE(bus_width_table); index++) {
523 if (bus_width_table[index] == ahb_bus_width)
524 break;
525 }
526 BUG_ON(index == ARRAY_SIZE(bus_width_table));
527 ahb_seq |= index << AHB_SEQ_BUS_WIDTH_SHIFT;
528
529 for (index = 0; index < ARRAY_SIZE(bus_width_table); index++) {
530 if (bus_width_table[index] == apb_bus_width)
531 break;
532 }
533 BUG_ON(index == ARRAY_SIZE(bus_width_table));
534 apb_seq |= index << APB_SEQ_BUS_WIDTH_SHIFT;
535
536 writel(csr, ch->addr + APB_DMA_CHAN_CSR);
537 writel(apb_seq, ch->addr + APB_DMA_CHAN_APB_SEQ);
538 writel(apb_ptr, ch->addr + APB_DMA_CHAN_APB_PTR);
539 writel(ahb_seq, ch->addr + APB_DMA_CHAN_AHB_SEQ);
540 writel(ahb_ptr, ch->addr + APB_DMA_CHAN_AHB_PTR);
541
542 csr |= CSR_ENB;
543 writel(csr, ch->addr + APB_DMA_CHAN_CSR);
544
545 req->status = TEGRA_DMA_REQ_INFLIGHT;
546}
547
548static void handle_oneshot_dma(struct tegra_dma_channel *ch)
549{
550 struct tegra_dma_req *req;
551 unsigned long irq_flags;
552
553 spin_lock_irqsave(&ch->lock, irq_flags);
554 if (list_empty(&ch->list)) {
555 spin_unlock_irqrestore(&ch->lock, irq_flags);
556 return;
557 }
558
559 req = list_entry(ch->list.next, typeof(*req), node);
560 if (req) {
561 int bytes_transferred;
562
563 bytes_transferred = ch->req_transfer_count;
564 bytes_transferred += 1;
565 bytes_transferred <<= 2;
566
567 list_del(&req->node);
568 req->bytes_transferred = bytes_transferred;
569 req->status = TEGRA_DMA_REQ_SUCCESS;
570
571 spin_unlock_irqrestore(&ch->lock, irq_flags);
572 /* Callback should be called without any lock */
573 pr_debug("%s: transferred %d bytes\n", __func__,
574 req->bytes_transferred);
575 req->complete(req);
576 spin_lock_irqsave(&ch->lock, irq_flags);
577 }
578
579 if (!list_empty(&ch->list)) {
580 req = list_entry(ch->list.next, typeof(*req), node);
581 /* the complete function we just called may have enqueued
582 another req, in which case dma has already started */
583 if (req->status != TEGRA_DMA_REQ_INFLIGHT)
584 tegra_dma_update_hw(ch, req);
585 }
586 spin_unlock_irqrestore(&ch->lock, irq_flags);
587}
588
589static void handle_continuous_dma(struct tegra_dma_channel *ch)
590{
591 struct tegra_dma_req *req;
592 unsigned long irq_flags;
593
594 spin_lock_irqsave(&ch->lock, irq_flags);
595 if (list_empty(&ch->list)) {
596 spin_unlock_irqrestore(&ch->lock, irq_flags);
597 return;
598 }
599
600 req = list_entry(ch->list.next, typeof(*req), node);
601 if (req) {
602 if (req->buffer_status == TEGRA_DMA_REQ_BUF_STATUS_EMPTY) {
603 bool is_dma_ping_complete;
604 is_dma_ping_complete = (readl(ch->addr + APB_DMA_CHAN_STA)
605 & STA_PING_PONG) ? true : false;
606 if (req->to_memory)
607 is_dma_ping_complete = !is_dma_ping_complete;
608 /* Out of sync - Release current buffer */
609 if (!is_dma_ping_complete) {
610 int bytes_transferred;
611
612 bytes_transferred = ch->req_transfer_count;
613 bytes_transferred += 1;
614 bytes_transferred <<= 3;
615 req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_FULL;
616 req->bytes_transferred = bytes_transferred;
617 req->status = TEGRA_DMA_REQ_SUCCESS;
618 tegra_dma_stop(ch);
619
620 if (!list_is_last(&req->node, &ch->list)) {
621 struct tegra_dma_req *next_req;
622
623 next_req = list_entry(req->node.next,
624 typeof(*next_req), node);
625 tegra_dma_update_hw(ch, next_req);
626 }
627
628 list_del(&req->node);
629
630 /* DMA lock is NOT held when callbak is called */
631 spin_unlock_irqrestore(&ch->lock, irq_flags);
632 req->complete(req);
633 return;
634 }
635 /* Load the next request into the hardware, if available
636 * */
637 if (!list_is_last(&req->node, &ch->list)) {
638 struct tegra_dma_req *next_req;
639
640 next_req = list_entry(req->node.next,
641 typeof(*next_req), node);
642 tegra_dma_update_hw_partial(ch, next_req);
643 }
644 req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL;
645 req->status = TEGRA_DMA_REQ_SUCCESS;
646 /* DMA lock is NOT held when callback is called */
647 spin_unlock_irqrestore(&ch->lock, irq_flags);
648 if (likely(req->threshold))
649 req->threshold(req);
650 return;
651
652 } else if (req->buffer_status ==
653 TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL) {
654 /* Callback when the buffer is completely full (i.e on
655 * the second interrupt */
656 int bytes_transferred;
657
658 bytes_transferred = ch->req_transfer_count;
659 bytes_transferred += 1;
660 bytes_transferred <<= 3;
661
662 req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_FULL;
663 req->bytes_transferred = bytes_transferred;
664 req->status = TEGRA_DMA_REQ_SUCCESS;
665 list_del(&req->node);
666
667 /* DMA lock is NOT held when callbak is called */
668 spin_unlock_irqrestore(&ch->lock, irq_flags);
669 req->complete(req);
670 return;
671
672 } else {
673 BUG();
674 }
675 }
676 spin_unlock_irqrestore(&ch->lock, irq_flags);
677}
678
679static irqreturn_t dma_isr(int irq, void *data)
680{
681 struct tegra_dma_channel *ch = data;
682 unsigned long status;
683
684 status = readl(ch->addr + APB_DMA_CHAN_STA);
685 if (status & STA_ISE_EOC)
686 writel(status, ch->addr + APB_DMA_CHAN_STA);
687 else {
688 pr_warning("Got a spurious ISR for DMA channel %d\n", ch->id);
689 return IRQ_HANDLED;
690 }
691 return IRQ_WAKE_THREAD;
692}
693
694static irqreturn_t dma_thread_fn(int irq, void *data)
695{
696 struct tegra_dma_channel *ch = data;
697
698 if (ch->mode & TEGRA_DMA_MODE_ONESHOT)
699 handle_oneshot_dma(ch);
700 else
701 handle_continuous_dma(ch);
702
703
704 return IRQ_HANDLED;
705}
706
707int __init tegra_dma_init(void)
708{
709 int ret = 0;
710 int i;
711 unsigned int irq;
712 void __iomem *addr;
713 struct clk *c;
714
715 bitmap_fill(channel_usage, NV_DMA_MAX_CHANNELS);
716
717 c = clk_get_sys("tegra-apbdma", NULL);
718 if (IS_ERR(c)) {
719 pr_err("Unable to get clock for APB DMA\n");
720 ret = PTR_ERR(c);
721 goto fail;
722 }
723 ret = clk_prepare_enable(c);
724 if (ret != 0) {
725 pr_err("Unable to enable clock for APB DMA\n");
726 goto fail;
727 }
728
729 addr = IO_ADDRESS(TEGRA_APB_DMA_BASE);
730 writel(GEN_ENABLE, addr + APB_DMA_GEN);
731 writel(0, addr + APB_DMA_CNTRL);
732 writel(0xFFFFFFFFul >> (31 - TEGRA_SYSTEM_DMA_CH_MAX),
733 addr + APB_DMA_IRQ_MASK_SET);
734
735 for (i = TEGRA_SYSTEM_DMA_CH_MIN; i <= TEGRA_SYSTEM_DMA_CH_MAX; i++) {
736 struct tegra_dma_channel *ch = &dma_channels[i];
737
738 ch->id = i;
739 snprintf(ch->name, TEGRA_DMA_NAME_SIZE, "dma_channel_%d", i);
740
741 ch->addr = IO_ADDRESS(TEGRA_APB_DMA_CH0_BASE +
742 TEGRA_APB_DMA_CH0_SIZE * i);
743
744 spin_lock_init(&ch->lock);
745 INIT_LIST_HEAD(&ch->list);
746
747 irq = INT_APB_DMA_CH0 + i;
748 ret = request_threaded_irq(irq, dma_isr, dma_thread_fn, 0,
749 dma_channels[i].name, ch);
750 if (ret) {
751 pr_err("Failed to register IRQ %d for DMA %d\n",
752 irq, i);
753 goto fail;
754 }
755 ch->irq = irq;
756
757 __clear_bit(i, channel_usage);
758 }
759 /* mark the shared channel allocated */
760 __set_bit(TEGRA_SYSTEM_DMA_CH_MIN, channel_usage);
761
762 tegra_dma_initialized = true;
763
764 return 0;
765fail:
766 writel(0, addr + APB_DMA_GEN);
767 for (i = TEGRA_SYSTEM_DMA_CH_MIN; i <= TEGRA_SYSTEM_DMA_CH_MAX; i++) {
768 struct tegra_dma_channel *ch = &dma_channels[i];
769 if (ch->irq)
770 free_irq(ch->irq, ch);
771 }
772 return ret;
773}
774postcore_initcall(tegra_dma_init);
775
776#ifdef CONFIG_PM
777static u32 apb_dma[5*TEGRA_SYSTEM_DMA_CH_NR + 3];
778
779void tegra_dma_suspend(void)
780{
781 void __iomem *addr = IO_ADDRESS(TEGRA_APB_DMA_BASE);
782 u32 *ctx = apb_dma;
783 int i;
784
785 *ctx++ = readl(addr + APB_DMA_GEN);
786 *ctx++ = readl(addr + APB_DMA_CNTRL);
787 *ctx++ = readl(addr + APB_DMA_IRQ_MASK);
788
789 for (i = 0; i < TEGRA_SYSTEM_DMA_CH_NR; i++) {
790 addr = IO_ADDRESS(TEGRA_APB_DMA_CH0_BASE +
791 TEGRA_APB_DMA_CH0_SIZE * i);
792
793 *ctx++ = readl(addr + APB_DMA_CHAN_CSR);
794 *ctx++ = readl(addr + APB_DMA_CHAN_AHB_PTR);
795 *ctx++ = readl(addr + APB_DMA_CHAN_AHB_SEQ);
796 *ctx++ = readl(addr + APB_DMA_CHAN_APB_PTR);
797 *ctx++ = readl(addr + APB_DMA_CHAN_APB_SEQ);
798 }
799}
800
801void tegra_dma_resume(void)
802{
803 void __iomem *addr = IO_ADDRESS(TEGRA_APB_DMA_BASE);
804 u32 *ctx = apb_dma;
805 int i;
806
807 writel(*ctx++, addr + APB_DMA_GEN);
808 writel(*ctx++, addr + APB_DMA_CNTRL);
809 writel(*ctx++, addr + APB_DMA_IRQ_MASK);
810
811 for (i = 0; i < TEGRA_SYSTEM_DMA_CH_NR; i++) {
812 addr = IO_ADDRESS(TEGRA_APB_DMA_CH0_BASE +
813 TEGRA_APB_DMA_CH0_SIZE * i);
814
815 writel(*ctx++, addr + APB_DMA_CHAN_CSR);
816 writel(*ctx++, addr + APB_DMA_CHAN_AHB_PTR);
817 writel(*ctx++, addr + APB_DMA_CHAN_AHB_SEQ);
818 writel(*ctx++, addr + APB_DMA_CHAN_APB_PTR);
819 writel(*ctx++, addr + APB_DMA_CHAN_APB_SEQ);
820 }
821}
822
823#endif
diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c
index f946d129423..0b7db174a5d 100644
--- a/arch/arm/mach-tegra/fuse.c
+++ b/arch/arm/mach-tegra/fuse.c
@@ -93,9 +93,9 @@ void tegra_init_fuse(void)
93{ 93{
94 u32 id; 94 u32 id;
95 95
96 u32 reg = readl(IO_TO_VIRT(TEGRA_CLK_RESET_BASE + 0x48)); 96 u32 reg = readl(IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x48));
97 reg |= 1 << 28; 97 reg |= 1 << 28;
98 writel(reg, IO_TO_VIRT(TEGRA_CLK_RESET_BASE + 0x48)); 98 writel(reg, IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x48));
99 99
100 reg = tegra_fuse_readl(FUSE_SKU_INFO); 100 reg = tegra_fuse_readl(FUSE_SKU_INFO);
101 tegra_sku_id = reg & 0xFF; 101 tegra_sku_id = reg & 0xFF;
diff --git a/arch/arm/mach-tegra/headsmp.S b/arch/arm/mach-tegra/headsmp.S
index fef9c2c5137..6addc78cb6b 100644
--- a/arch/arm/mach-tegra/headsmp.S
+++ b/arch/arm/mach-tegra/headsmp.S
@@ -7,17 +7,13 @@
7 7
8#include "flowctrl.h" 8#include "flowctrl.h"
9#include "reset.h" 9#include "reset.h"
10#include "sleep.h"
10 11
11#define APB_MISC_GP_HIDREV 0x804 12#define APB_MISC_GP_HIDREV 0x804
12#define PMC_SCRATCH41 0x140 13#define PMC_SCRATCH41 0x140
13 14
14#define RESET_DATA(x) ((TEGRA_RESET_##x)*4) 15#define RESET_DATA(x) ((TEGRA_RESET_##x)*4)
15 16
16 .macro mov32, reg, val
17 movw \reg, #:lower16:\val
18 movt \reg, #:upper16:\val
19 .endm
20
21 .section ".text.head", "ax" 17 .section ".text.head", "ax"
22 __CPUINIT 18 __CPUINIT
23 19
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
index d8dc9ddd6d1..dca5141a2c3 100644
--- a/arch/arm/mach-tegra/hotplug.c
+++ b/arch/arm/mach-tegra/hotplug.c
@@ -1,123 +1,48 @@
1/* 1/*
2 * linux/arch/arm/mach-realview/hotplug.c
3 * 2 *
4 * Copyright (C) 2002 ARM Ltd. 3 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved 4 * All Rights Reserved
5 * Copyright (c) 2010, 2012 NVIDIA Corporation. All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 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 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/errno.h>
13#include <linux/smp.h> 12#include <linux/smp.h>
14 13
15#include <asm/cacheflush.h> 14#include <asm/cacheflush.h>
16#include <asm/cp15.h> 15#include <asm/smp_plat.h>
17 16
18static inline void cpu_enter_lowpower(void) 17#include "sleep.h"
19{ 18#include "tegra_cpu_car.h"
20 unsigned int v;
21
22 flush_cache_all();
23 asm volatile(
24 " mcr p15, 0, %1, c7, c5, 0\n"
25 " mcr p15, 0, %1, c7, c10, 4\n"
26 /*
27 * Turn off coherency
28 */
29 " mrc p15, 0, %0, c1, c0, 1\n"
30 " bic %0, %0, #0x20\n"
31 " mcr p15, 0, %0, c1, c0, 1\n"
32 " mrc p15, 0, %0, c1, c0, 0\n"
33 " bic %0, %0, %2\n"
34 " mcr p15, 0, %0, c1, c0, 0\n"
35 : "=&r" (v)
36 : "r" (0), "Ir" (CR_C)
37 : "cc");
38}
39
40static inline void cpu_leave_lowpower(void)
41{
42 unsigned int v;
43 19
44 asm volatile( 20static void (*tegra_hotplug_shutdown)(void);
45 "mrc p15, 0, %0, c1, c0, 0\n"
46 " orr %0, %0, %1\n"
47 " mcr p15, 0, %0, c1, c0, 0\n"
48 " mrc p15, 0, %0, c1, c0, 1\n"
49 " orr %0, %0, #0x20\n"
50 " mcr p15, 0, %0, c1, c0, 1\n"
51 : "=&r" (v)
52 : "Ir" (CR_C)
53 : "cc");
54}
55
56static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
57{
58 /*
59 * there is no power-control hardware on this platform, so all
60 * we can do is put the core into WFI; this is safe as the calling
61 * code will have already disabled interrupts
62 */
63 for (;;) {
64 /*
65 * here's the WFI
66 */
67 asm(".word 0xe320f003\n"
68 :
69 :
70 : "memory", "cc");
71
72 /*if (pen_release == cpu) {*/
73 /*
74 * OK, proper wakeup, we're done
75 */
76 break;
77 /*}*/
78
79 /*
80 * Getting here, means that we have come out of WFI without
81 * having been woken up - this shouldn't happen
82 *
83 * Just note it happening - when we're woken, we can report
84 * its occurrence.
85 */
86 (*spurious)++;
87 }
88}
89
90int platform_cpu_kill(unsigned int cpu)
91{
92 return 1;
93}
94 21
95/* 22/*
96 * platform-specific code to shutdown a CPU 23 * platform-specific code to shutdown a CPU
97 * 24 *
98 * Called with IRQs disabled 25 * Called with IRQs disabled
99 */ 26 */
100void platform_cpu_die(unsigned int cpu) 27void __ref tegra_cpu_die(unsigned int cpu)
101{ 28{
102 int spurious = 0; 29 cpu = cpu_logical_map(cpu);
103 30
104 /* 31 /* Flush the L1 data cache. */
105 * we're ready for shutdown now, so do it 32 flush_cache_all();
106 */
107 cpu_enter_lowpower();
108 platform_do_lowpower(cpu, &spurious);
109 33
110 /* 34 /* Shut down the current CPU. */
111 * bring this CPU back into the world of cache 35 tegra_hotplug_shutdown();
112 * coherency, and then restore interrupts
113 */
114 cpu_leave_lowpower();
115 36
116 if (spurious) 37 /* Clock gate the CPU */
117 pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); 38 tegra_wait_cpu_in_reset(cpu);
39 tegra_disable_cpu_clock(cpu);
40
41 /* Should never return here. */
42 BUG();
118} 43}
119 44
120int platform_cpu_disable(unsigned int cpu) 45int tegra_cpu_disable(unsigned int cpu)
121{ 46{
122 /* 47 /*
123 * we don't allow CPU 0 to be shutdown (it is still too special 48 * we don't allow CPU 0 to be shutdown (it is still too special
@@ -125,3 +50,19 @@ int platform_cpu_disable(unsigned int cpu)
125 */ 50 */
126 return cpu == 0 ? -EPERM : 0; 51 return cpu == 0 ? -EPERM : 0;
127} 52}
53
54#ifdef CONFIG_ARCH_TEGRA_2x_SOC
55extern void tegra20_hotplug_shutdown(void);
56void __init tegra20_hotplug_init(void)
57{
58 tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
59}
60#endif
61
62#ifdef CONFIG_ARCH_TEGRA_3x_SOC
63extern void tegra30_hotplug_shutdown(void);
64void __init tegra30_hotplug_init(void)
65{
66 tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
67}
68#endif
diff --git a/arch/arm/mach-tegra/include/mach/clk.h b/arch/arm/mach-tegra/include/mach/clk.h
index d97e403303a..95f3a547c77 100644
--- a/arch/arm/mach-tegra/include/mach/clk.h
+++ b/arch/arm/mach-tegra/include/mach/clk.h
@@ -34,7 +34,10 @@ enum tegra_clk_ex_param {
34void tegra_periph_reset_deassert(struct clk *c); 34void tegra_periph_reset_deassert(struct clk *c);
35void tegra_periph_reset_assert(struct clk *c); 35void tegra_periph_reset_assert(struct clk *c);
36 36
37#ifndef CONFIG_COMMON_CLK
37unsigned long clk_get_rate_all_locked(struct clk *c); 38unsigned long clk_get_rate_all_locked(struct clk *c);
39#endif
40
38void tegra2_sdmmc_tap_delay(struct clk *c, int delay); 41void tegra2_sdmmc_tap_delay(struct clk *c, int delay);
39int tegra_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting); 42int tegra_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting);
40 43
diff --git a/arch/arm/mach-tegra/include/mach/dma.h b/arch/arm/mach-tegra/include/mach/dma.h
index 9077092812c..3081cc6dda3 100644
--- a/arch/arm/mach-tegra/include/mach/dma.h
+++ b/arch/arm/mach-tegra/include/mach/dma.h
@@ -51,101 +51,4 @@
51#define TEGRA_DMA_REQ_SEL_OWR 25 51#define TEGRA_DMA_REQ_SEL_OWR 25
52#define TEGRA_DMA_REQ_SEL_INVALID 31 52#define TEGRA_DMA_REQ_SEL_INVALID 31
53 53
54struct tegra_dma_req;
55struct tegra_dma_channel;
56
57enum tegra_dma_mode {
58 TEGRA_DMA_SHARED = 1,
59 TEGRA_DMA_MODE_CONTINOUS = 2,
60 TEGRA_DMA_MODE_ONESHOT = 4,
61};
62
63enum tegra_dma_req_error {
64 TEGRA_DMA_REQ_SUCCESS = 0,
65 TEGRA_DMA_REQ_ERROR_ABORTED,
66 TEGRA_DMA_REQ_INFLIGHT,
67};
68
69enum tegra_dma_req_buff_status {
70 TEGRA_DMA_REQ_BUF_STATUS_EMPTY = 0,
71 TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL,
72 TEGRA_DMA_REQ_BUF_STATUS_FULL,
73};
74
75struct tegra_dma_req {
76 struct list_head node;
77 unsigned int modid;
78 int instance;
79
80 /* Called when the req is complete and from the DMA ISR context.
81 * When this is called the req structure is no longer queued by
82 * the DMA channel.
83 *
84 * State of the DMA depends on the number of req it has. If there are
85 * no DMA requests queued up, then it will STOP the DMA. It there are
86 * more requests in the DMA, then it will queue the next request.
87 */
88 void (*complete)(struct tegra_dma_req *req);
89
90 /* This is a called from the DMA ISR context when the DMA is still in
91 * progress and is actively filling same buffer.
92 *
93 * In case of continuous mode receive, this threshold is 1/2 the buffer
94 * size. In other cases, this will not even be called as there is no
95 * hardware support for it.
96 *
97 * In the case of continuous mode receive, if there is next req already
98 * queued, DMA programs the HW to use that req when this req is
99 * completed. If there is no "next req" queued, then DMA ISR doesn't do
100 * anything before calling this callback.
101 *
102 * This is mainly used by the cases, where the clients has queued
103 * only one req and want to get some sort of DMA threshold
104 * callback to program the next buffer.
105 *
106 */
107 void (*threshold)(struct tegra_dma_req *req);
108
109 /* 1 to copy to memory.
110 * 0 to copy from the memory to device FIFO */
111 int to_memory;
112
113 void *virt_addr;
114
115 unsigned long source_addr;
116 unsigned long dest_addr;
117 unsigned long dest_wrap;
118 unsigned long source_wrap;
119 unsigned long source_bus_width;
120 unsigned long dest_bus_width;
121 unsigned long req_sel;
122 unsigned int size;
123
124 /* Updated by the DMA driver on the conpletion of the request. */
125 int bytes_transferred;
126 int status;
127
128 /* DMA completion tracking information */
129 int buffer_status;
130
131 /* Client specific data */
132 void *dev;
133};
134
135int tegra_dma_enqueue_req(struct tegra_dma_channel *ch,
136 struct tegra_dma_req *req);
137int tegra_dma_dequeue_req(struct tegra_dma_channel *ch,
138 struct tegra_dma_req *req);
139void tegra_dma_dequeue(struct tegra_dma_channel *ch);
140void tegra_dma_flush(struct tegra_dma_channel *ch);
141
142bool tegra_dma_is_req_inflight(struct tegra_dma_channel *ch,
143 struct tegra_dma_req *req);
144bool tegra_dma_is_empty(struct tegra_dma_channel *ch);
145
146struct tegra_dma_channel *tegra_dma_allocate_channel(int mode);
147void tegra_dma_free_channel(struct tegra_dma_channel *ch);
148
149int __init tegra_dma_init(void);
150
151#endif 54#endif
diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h
deleted file mode 100644
index 40a8c178f10..00000000000
--- a/arch/arm/mach-tegra/include/mach/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/mach-tegra/include/mach/io.h b/arch/arm/mach-tegra/include/mach/io.h
deleted file mode 100644
index fe700f9ce7d..00000000000
--- a/arch/arm/mach-tegra/include/mach/io.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * arch/arm/mach-tegra/include/mach/io.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Colin Cross <ccross@google.com>
8 * Erik Gilling <konkers@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_IO_H
22#define __MACH_TEGRA_IO_H
23
24#define IO_SPACE_LIMIT 0xffff
25
26#ifndef __ASSEMBLER__
27
28#ifdef CONFIG_TEGRA_PCI
29extern void __iomem *tegra_pcie_io_base;
30
31static inline void __iomem *__io(unsigned long addr)
32{
33 return tegra_pcie_io_base + (addr & IO_SPACE_LIMIT);
34}
35#else
36static inline void __iomem *__io(unsigned long addr)
37{
38 return (void __iomem *)addr;
39}
40#endif
41
42#define __io(a) __io(a)
43
44#endif
45
46#endif
diff --git a/arch/arm/mach-tegra/include/mach/iomap.h b/arch/arm/mach-tegra/include/mach/iomap.h
index 7e76da73121..fee3a94c454 100644
--- a/arch/arm/mach-tegra/include/mach/iomap.h
+++ b/arch/arm/mach-tegra/include/mach/iomap.h
@@ -303,6 +303,9 @@
303#define IO_APB_VIRT IOMEM(0xFE300000) 303#define IO_APB_VIRT IOMEM(0xFE300000)
304#define IO_APB_SIZE SZ_1M 304#define IO_APB_SIZE SZ_1M
305 305
306#define TEGRA_PCIE_BASE 0x80000000
307#define TEGRA_PCIE_IO_BASE (TEGRA_PCIE_BASE + SZ_4M)
308
306#define IO_TO_VIRT_BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz))) 309#define IO_TO_VIRT_BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz)))
307#define IO_TO_VIRT_XLATE(p, pst, vst) (((p) - (pst) + (vst))) 310#define IO_TO_VIRT_XLATE(p, pst, vst) (((p) - (pst) + (vst)))
308 311
diff --git a/arch/arm/mach-tegra/include/mach/kbc.h b/arch/arm/mach-tegra/include/mach/kbc.h
deleted file mode 100644
index a1302561293..00000000000
--- a/arch/arm/mach-tegra/include/mach/kbc.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * Platform definitions for tegra-kbc keyboard input driver
3 *
4 * Copyright (c) 2010-2011, NVIDIA Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef ASMARM_ARCH_TEGRA_KBC_H
22#define ASMARM_ARCH_TEGRA_KBC_H
23
24#include <linux/types.h>
25#include <linux/input/matrix_keypad.h>
26
27#define KBC_MAX_GPIO 24
28#define KBC_MAX_KPENT 8
29
30#define KBC_MAX_ROW 16
31#define KBC_MAX_COL 8
32#define KBC_MAX_KEY (KBC_MAX_ROW * KBC_MAX_COL)
33
34enum tegra_pin_type {
35 PIN_CFG_IGNORE,
36 PIN_CFG_COL,
37 PIN_CFG_ROW,
38};
39
40struct tegra_kbc_pin_cfg {
41 enum tegra_pin_type type;
42 unsigned char num;
43};
44
45struct tegra_kbc_wake_key {
46 u8 row:4;
47 u8 col:4;
48};
49
50struct tegra_kbc_platform_data {
51 unsigned int debounce_cnt;
52 unsigned int repeat_cnt;
53
54 struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO];
55 const struct matrix_keymap_data *keymap_data;
56
57 u32 wakeup_key;
58 bool wakeup;
59 bool use_fn_map;
60 bool use_ghost_filter;
61};
62#endif
diff --git a/arch/arm/mach-tegra/include/mach/pinconf-tegra.h b/arch/arm/mach-tegra/include/mach/pinconf-tegra.h
deleted file mode 100644
index 1f24d304921..00000000000
--- a/arch/arm/mach-tegra/include/mach/pinconf-tegra.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * pinctrl configuration definitions for the NVIDIA Tegra pinmux
3 *
4 * Copyright (c) 2011, NVIDIA CORPORATION. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef __PINCONF_TEGRA_H__
17#define __PINCONF_TEGRA_H__
18
19enum tegra_pinconf_param {
20 /* argument: tegra_pinconf_pull */
21 TEGRA_PINCONF_PARAM_PULL,
22 /* argument: tegra_pinconf_tristate */
23 TEGRA_PINCONF_PARAM_TRISTATE,
24 /* argument: Boolean */
25 TEGRA_PINCONF_PARAM_ENABLE_INPUT,
26 /* argument: Boolean */
27 TEGRA_PINCONF_PARAM_OPEN_DRAIN,
28 /* argument: Boolean */
29 TEGRA_PINCONF_PARAM_LOCK,
30 /* argument: Boolean */
31 TEGRA_PINCONF_PARAM_IORESET,
32 /* argument: Boolean */
33 TEGRA_PINCONF_PARAM_HIGH_SPEED_MODE,
34 /* argument: Boolean */
35 TEGRA_PINCONF_PARAM_SCHMITT,
36 /* argument: Boolean */
37 TEGRA_PINCONF_PARAM_LOW_POWER_MODE,
38 /* argument: Integer, range is HW-dependant */
39 TEGRA_PINCONF_PARAM_DRIVE_DOWN_STRENGTH,
40 /* argument: Integer, range is HW-dependant */
41 TEGRA_PINCONF_PARAM_DRIVE_UP_STRENGTH,
42 /* argument: Integer, range is HW-dependant */
43 TEGRA_PINCONF_PARAM_SLEW_RATE_FALLING,
44 /* argument: Integer, range is HW-dependant */
45 TEGRA_PINCONF_PARAM_SLEW_RATE_RISING,
46};
47
48enum tegra_pinconf_pull {
49 TEGRA_PINCONFIG_PULL_NONE,
50 TEGRA_PINCONFIG_PULL_DOWN,
51 TEGRA_PINCONFIG_PULL_UP,
52};
53
54enum tegra_pinconf_tristate {
55 TEGRA_PINCONFIG_DRIVEN,
56 TEGRA_PINCONFIG_TRISTATE,
57};
58
59#define TEGRA_PINCONF_PACK(_param_, _arg_) ((_param_) << 16 | (_arg_))
60#define TEGRA_PINCONF_UNPACK_PARAM(_conf_) ((_conf_) >> 16)
61#define TEGRA_PINCONF_UNPACK_ARG(_conf_) ((_conf_) & 0xffff)
62
63#endif
diff --git a/arch/arm/mach-tegra/include/mach/sdhci.h b/arch/arm/mach-tegra/include/mach/sdhci.h
deleted file mode 100644
index 4231bc7b865..00000000000
--- a/arch/arm/mach-tegra/include/mach/sdhci.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * include/asm-arm/arch-tegra/include/mach/sdhci.h
3 *
4 * Copyright (C) 2009 Palm, Inc.
5 * Author: Yvonne Yip <y@palm.com>
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17#ifndef __ASM_ARM_ARCH_TEGRA_SDHCI_H
18#define __ASM_ARM_ARCH_TEGRA_SDHCI_H
19
20#include <linux/mmc/host.h>
21
22struct tegra_sdhci_platform_data {
23 int cd_gpio;
24 int wp_gpio;
25 int power_gpio;
26 int is_8bit;
27 int pm_flags;
28};
29
30#endif
diff --git a/arch/arm/mach-tegra/include/mach/smmu.h b/arch/arm/mach-tegra/include/mach/smmu.h
deleted file mode 100644
index dad403a9cf0..00000000000
--- a/arch/arm/mach-tegra/include/mach/smmu.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * IOMMU API for SMMU in Tegra30
3 *
4 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope 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 with
16 * this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20#ifndef MACH_SMMU_H
21#define MACH_SMMU_H
22
23enum smmu_hwgrp {
24 HWGRP_AFI,
25 HWGRP_AVPC,
26 HWGRP_DC,
27 HWGRP_DCB,
28 HWGRP_EPP,
29 HWGRP_G2,
30 HWGRP_HC,
31 HWGRP_HDA,
32 HWGRP_ISP,
33 HWGRP_MPE,
34 HWGRP_NV,
35 HWGRP_NV2,
36 HWGRP_PPCS,
37 HWGRP_SATA,
38 HWGRP_VDE,
39 HWGRP_VI,
40
41 HWGRP_COUNT,
42
43 HWGRP_END = ~0,
44};
45
46#define HWG_AFI (1 << HWGRP_AFI)
47#define HWG_AVPC (1 << HWGRP_AVPC)
48#define HWG_DC (1 << HWGRP_DC)
49#define HWG_DCB (1 << HWGRP_DCB)
50#define HWG_EPP (1 << HWGRP_EPP)
51#define HWG_G2 (1 << HWGRP_G2)
52#define HWG_HC (1 << HWGRP_HC)
53#define HWG_HDA (1 << HWGRP_HDA)
54#define HWG_ISP (1 << HWGRP_ISP)
55#define HWG_MPE (1 << HWGRP_MPE)
56#define HWG_NV (1 << HWGRP_NV)
57#define HWG_NV2 (1 << HWGRP_NV2)
58#define HWG_PPCS (1 << HWGRP_PPCS)
59#define HWG_SATA (1 << HWGRP_SATA)
60#define HWG_VDE (1 << HWGRP_VDE)
61#define HWG_VI (1 << HWGRP_VI)
62
63#endif /* MACH_SMMU_H */
diff --git a/arch/arm/mach-tegra/include/mach/suspend.h b/arch/arm/mach-tegra/include/mach/suspend.h
deleted file mode 100644
index 5af8715d2e1..00000000000
--- a/arch/arm/mach-tegra/include/mach/suspend.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * arch/arm/mach-tegra/include/mach/suspend.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Colin Cross <ccross@google.com>
8 *
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 */
19
20
21#ifndef _MACH_TEGRA_SUSPEND_H_
22#define _MACH_TEGRA_SUSPEND_H_
23
24void tegra_pinmux_suspend(void);
25void tegra_irq_suspend(void);
26void tegra_gpio_suspend(void);
27void tegra_clk_suspend(void);
28void tegra_dma_suspend(void);
29void tegra_timer_suspend(void);
30
31void tegra_pinmux_resume(void);
32void tegra_irq_resume(void);
33void tegra_gpio_resume(void);
34void tegra_clk_resume(void);
35void tegra_dma_resume(void);
36void tegra_timer_resume(void);
37
38#endif /* _MACH_TEGRA_SUSPEND_H_ */
diff --git a/arch/arm/mach-tegra/include/mach/tegra_wm8903_pdata.h b/arch/arm/mach-tegra/include/mach/tegra_wm8903_pdata.h
deleted file mode 100644
index 9d293344a7f..00000000000
--- a/arch/arm/mach-tegra/include/mach/tegra_wm8903_pdata.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * arch/arm/mach-tegra/include/mach/tegra_wm8903_pdata.h
3 *
4 * Copyright 2011 NVIDIA, Inc.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17struct tegra_wm8903_platform_data {
18 int gpio_spkr_en;
19 int gpio_hp_det;
20 int gpio_hp_mute;
21 int gpio_int_mic_en;
22 int gpio_ext_mic_en;
23};
diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h
deleted file mode 100644
index 935ce9f6559..00000000000
--- a/arch/arm/mach-tegra/include/mach/usb_phy.h
+++ /dev/null
@@ -1,86 +0,0 @@
1/*
2 * arch/arm/mach-tegra/include/mach/usb_phy.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#ifndef __MACH_USB_PHY_H
18#define __MACH_USB_PHY_H
19
20#include <linux/clk.h>
21#include <linux/usb/otg.h>
22
23struct tegra_utmip_config {
24 u8 hssync_start_delay;
25 u8 elastic_limit;
26 u8 idle_wait_delay;
27 u8 term_range_adj;
28 u8 xcvr_setup;
29 u8 xcvr_lsfslew;
30 u8 xcvr_lsrslew;
31};
32
33struct tegra_ulpi_config {
34 int reset_gpio;
35 const char *clk;
36};
37
38enum tegra_usb_phy_port_speed {
39 TEGRA_USB_PHY_PORT_SPEED_FULL = 0,
40 TEGRA_USB_PHY_PORT_SPEED_LOW,
41 TEGRA_USB_PHY_PORT_SPEED_HIGH,
42};
43
44enum tegra_usb_phy_mode {
45 TEGRA_USB_PHY_MODE_DEVICE,
46 TEGRA_USB_PHY_MODE_HOST,
47};
48
49struct tegra_xtal_freq;
50
51struct tegra_usb_phy {
52 int instance;
53 const struct tegra_xtal_freq *freq;
54 void __iomem *regs;
55 void __iomem *pad_regs;
56 struct clk *clk;
57 struct clk *pll_u;
58 struct clk *pad_clk;
59 enum tegra_usb_phy_mode mode;
60 void *config;
61 struct usb_phy *ulpi;
62};
63
64struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance,
65 void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode);
66
67int tegra_usb_phy_power_on(struct tegra_usb_phy *phy);
68
69void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy);
70
71void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy);
72
73void tegra_usb_phy_power_off(struct tegra_usb_phy *phy);
74
75void tegra_usb_phy_preresume(struct tegra_usb_phy *phy);
76
77void tegra_usb_phy_postresume(struct tegra_usb_phy *phy);
78
79void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy,
80 enum tegra_usb_phy_port_speed port_speed);
81
82void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy);
83
84void tegra_usb_phy_close(struct tegra_usb_phy *phy);
85
86#endif /* __MACH_USB_PHY_H */
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c
index d3ad5150d66..a8dba6489c9 100644
--- a/arch/arm/mach-tegra/pcie.c
+++ b/arch/arm/mach-tegra/pcie.c
@@ -171,8 +171,6 @@ static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE);
171 * 0x90000000 - 0x9fffffff - non-prefetchable memory 171 * 0x90000000 - 0x9fffffff - non-prefetchable memory
172 * 0xa0000000 - 0xbfffffff - prefetchable memory 172 * 0xa0000000 - 0xbfffffff - prefetchable memory
173 */ 173 */
174#define TEGRA_PCIE_BASE 0x80000000
175
176#define PCIE_REGS_SZ SZ_16K 174#define PCIE_REGS_SZ SZ_16K
177#define PCIE_CFG_OFF PCIE_REGS_SZ 175#define PCIE_CFG_OFF PCIE_REGS_SZ
178#define PCIE_CFG_SZ SZ_1M 176#define PCIE_CFG_SZ SZ_1M
@@ -180,8 +178,6 @@ static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE);
180#define PCIE_EXT_CFG_SZ SZ_1M 178#define PCIE_EXT_CFG_SZ SZ_1M
181#define PCIE_IOMAP_SZ (PCIE_REGS_SZ + PCIE_CFG_SZ + PCIE_EXT_CFG_SZ) 179#define PCIE_IOMAP_SZ (PCIE_REGS_SZ + PCIE_CFG_SZ + PCIE_EXT_CFG_SZ)
182 180
183#define MMIO_BASE (TEGRA_PCIE_BASE + SZ_4M)
184#define MMIO_SIZE SZ_64K
185#define MEM_BASE_0 (TEGRA_PCIE_BASE + SZ_256M) 181#define MEM_BASE_0 (TEGRA_PCIE_BASE + SZ_256M)
186#define MEM_SIZE_0 SZ_128M 182#define MEM_SIZE_0 SZ_128M
187#define MEM_BASE_1 (MEM_BASE_0 + MEM_SIZE_0) 183#define MEM_BASE_1 (MEM_BASE_0 + MEM_SIZE_0)
@@ -204,10 +200,9 @@ struct tegra_pcie_port {
204 200
205 bool link_up; 201 bool link_up;
206 202
207 char io_space_name[16];
208 char mem_space_name[16]; 203 char mem_space_name[16];
209 char prefetch_space_name[20]; 204 char prefetch_space_name[20];
210 struct resource res[3]; 205 struct resource res[2];
211}; 206};
212 207
213struct tegra_pcie_info { 208struct tegra_pcie_info {
@@ -223,17 +218,7 @@ struct tegra_pcie_info {
223 struct clk *pll_e; 218 struct clk *pll_e;
224}; 219};
225 220
226static struct tegra_pcie_info tegra_pcie = { 221static struct tegra_pcie_info tegra_pcie;
227 .res_mmio = {
228 .name = "PCI IO",
229 .start = MMIO_BASE,
230 .end = MMIO_BASE + MMIO_SIZE - 1,
231 .flags = IORESOURCE_MEM,
232 },
233};
234
235void __iomem *tegra_pcie_io_base;
236EXPORT_SYMBOL(tegra_pcie_io_base);
237 222
238static inline void afi_writel(u32 value, unsigned long offset) 223static inline void afi_writel(u32 value, unsigned long offset)
239{ 224{
@@ -367,17 +352,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf1, tegra_pcie_fixup_class);
367/* Tegra PCIE requires relaxed ordering */ 352/* Tegra PCIE requires relaxed ordering */
368static void __devinit tegra_pcie_relax_enable(struct pci_dev *dev) 353static void __devinit tegra_pcie_relax_enable(struct pci_dev *dev)
369{ 354{
370 u16 val16; 355 pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_RELAX_EN);
371 int pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
372
373 if (pos <= 0) {
374 dev_err(&dev->dev, "skipping relaxed ordering fixup\n");
375 return;
376 }
377
378 pci_read_config_word(dev, pos + PCI_EXP_DEVCTL, &val16);
379 val16 |= PCI_EXP_DEVCTL_RELAX_EN;
380 pci_write_config_word(dev, pos + PCI_EXP_DEVCTL, val16);
381} 356}
382DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_relax_enable); 357DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_relax_enable);
383 358
@@ -391,24 +366,7 @@ static int tegra_pcie_setup(int nr, struct pci_sys_data *sys)
391 pp = tegra_pcie.port + nr; 366 pp = tegra_pcie.port + nr;
392 pp->root_bus_nr = sys->busnr; 367 pp->root_bus_nr = sys->busnr;
393 368
394 /* 369 pci_ioremap_io(nr * SZ_64K, TEGRA_PCIE_IO_BASE);
395 * IORESOURCE_IO
396 */
397 snprintf(pp->io_space_name, sizeof(pp->io_space_name),
398 "PCIe %d I/O", pp->index);
399 pp->io_space_name[sizeof(pp->io_space_name) - 1] = 0;
400 pp->res[0].name = pp->io_space_name;
401 if (pp->index == 0) {
402 pp->res[0].start = PCIBIOS_MIN_IO;
403 pp->res[0].end = pp->res[0].start + SZ_32K - 1;
404 } else {
405 pp->res[0].start = PCIBIOS_MIN_IO + SZ_32K;
406 pp->res[0].end = IO_SPACE_LIMIT;
407 }
408 pp->res[0].flags = IORESOURCE_IO;
409 if (request_resource(&ioport_resource, &pp->res[0]))
410 panic("Request PCIe IO resource failed\n");
411 pci_add_resource_offset(&sys->resources, &pp->res[0], sys->io_offset);
412 370
413 /* 371 /*
414 * IORESOURCE_MEM 372 * IORESOURCE_MEM
@@ -416,18 +374,18 @@ static int tegra_pcie_setup(int nr, struct pci_sys_data *sys)
416 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), 374 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name),
417 "PCIe %d MEM", pp->index); 375 "PCIe %d MEM", pp->index);
418 pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0; 376 pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0;
419 pp->res[1].name = pp->mem_space_name; 377 pp->res[0].name = pp->mem_space_name;
420 if (pp->index == 0) { 378 if (pp->index == 0) {
421 pp->res[1].start = MEM_BASE_0; 379 pp->res[0].start = MEM_BASE_0;
422 pp->res[1].end = pp->res[1].start + MEM_SIZE_0 - 1; 380 pp->res[0].end = pp->res[0].start + MEM_SIZE_0 - 1;
423 } else { 381 } else {
424 pp->res[1].start = MEM_BASE_1; 382 pp->res[0].start = MEM_BASE_1;
425 pp->res[1].end = pp->res[1].start + MEM_SIZE_1 - 1; 383 pp->res[0].end = pp->res[0].start + MEM_SIZE_1 - 1;
426 } 384 }
427 pp->res[1].flags = IORESOURCE_MEM; 385 pp->res[0].flags = IORESOURCE_MEM;
428 if (request_resource(&iomem_resource, &pp->res[1])) 386 if (request_resource(&iomem_resource, &pp->res[0]))
429 panic("Request PCIe Memory resource failed\n"); 387 panic("Request PCIe Memory resource failed\n");
430 pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset); 388 pci_add_resource_offset(&sys->resources, &pp->res[0], sys->mem_offset);
431 389
432 /* 390 /*
433 * IORESOURCE_MEM | IORESOURCE_PREFETCH 391 * IORESOURCE_MEM | IORESOURCE_PREFETCH
@@ -435,18 +393,18 @@ static int tegra_pcie_setup(int nr, struct pci_sys_data *sys)
435 snprintf(pp->prefetch_space_name, sizeof(pp->prefetch_space_name), 393 snprintf(pp->prefetch_space_name, sizeof(pp->prefetch_space_name),
436 "PCIe %d PREFETCH MEM", pp->index); 394 "PCIe %d PREFETCH MEM", pp->index);
437 pp->prefetch_space_name[sizeof(pp->prefetch_space_name) - 1] = 0; 395 pp->prefetch_space_name[sizeof(pp->prefetch_space_name) - 1] = 0;
438 pp->res[2].name = pp->prefetch_space_name; 396 pp->res[1].name = pp->prefetch_space_name;
439 if (pp->index == 0) { 397 if (pp->index == 0) {
440 pp->res[2].start = PREFETCH_MEM_BASE_0; 398 pp->res[1].start = PREFETCH_MEM_BASE_0;
441 pp->res[2].end = pp->res[2].start + PREFETCH_MEM_SIZE_0 - 1; 399 pp->res[1].end = pp->res[1].start + PREFETCH_MEM_SIZE_0 - 1;
442 } else { 400 } else {
443 pp->res[2].start = PREFETCH_MEM_BASE_1; 401 pp->res[1].start = PREFETCH_MEM_BASE_1;
444 pp->res[2].end = pp->res[2].start + PREFETCH_MEM_SIZE_1 - 1; 402 pp->res[1].end = pp->res[1].start + PREFETCH_MEM_SIZE_1 - 1;
445 } 403 }
446 pp->res[2].flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; 404 pp->res[1].flags = IORESOURCE_MEM | IORESOURCE_PREFETCH;
447 if (request_resource(&iomem_resource, &pp->res[2])) 405 if (request_resource(&iomem_resource, &pp->res[1]))
448 panic("Request PCIe Prefetch Memory resource failed\n"); 406 panic("Request PCIe Prefetch Memory resource failed\n");
449 pci_add_resource_offset(&sys->resources, &pp->res[2], sys->mem_offset); 407 pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset);
450 408
451 return 1; 409 return 1;
452} 410}
@@ -541,8 +499,8 @@ static void tegra_pcie_setup_translations(void)
541 499
542 /* Bar 2: downstream IO bar */ 500 /* Bar 2: downstream IO bar */
543 fpci_bar = ((__u32)0xfdfc << 16); 501 fpci_bar = ((__u32)0xfdfc << 16);
544 size = MMIO_SIZE; 502 size = SZ_128K;
545 axi_address = MMIO_BASE; 503 axi_address = TEGRA_PCIE_IO_BASE;
546 afi_writel(axi_address, AFI_AXI_BAR2_START); 504 afi_writel(axi_address, AFI_AXI_BAR2_START);
547 afi_writel(size >> 12, AFI_AXI_BAR2_SZ); 505 afi_writel(size >> 12, AFI_AXI_BAR2_SZ);
548 afi_writel(fpci_bar, AFI_FPCI_BAR2); 506 afi_writel(fpci_bar, AFI_FPCI_BAR2);
@@ -776,7 +734,6 @@ static void tegra_pcie_clocks_put(void)
776 734
777static int __init tegra_pcie_get_resources(void) 735static int __init tegra_pcie_get_resources(void)
778{ 736{
779 struct resource *res_mmio = &tegra_pcie.res_mmio;
780 int err; 737 int err;
781 738
782 err = tegra_pcie_clocks_get(); 739 err = tegra_pcie_clocks_get();
@@ -798,34 +755,16 @@ static int __init tegra_pcie_get_resources(void)
798 goto err_map_reg; 755 goto err_map_reg;
799 } 756 }
800 757
801 err = request_resource(&iomem_resource, res_mmio);
802 if (err) {
803 pr_err("PCIE: Failed to request resources: %d\n", err);
804 goto err_req_io;
805 }
806
807 tegra_pcie_io_base = ioremap_nocache(res_mmio->start,
808 resource_size(res_mmio));
809 if (tegra_pcie_io_base == NULL) {
810 pr_err("PCIE: Failed to map IO\n");
811 err = -ENOMEM;
812 goto err_map_io;
813 }
814
815 err = request_irq(INT_PCIE_INTR, tegra_pcie_isr, 758 err = request_irq(INT_PCIE_INTR, tegra_pcie_isr,
816 IRQF_SHARED, "PCIE", &tegra_pcie); 759 IRQF_SHARED, "PCIE", &tegra_pcie);
817 if (err) { 760 if (err) {
818 pr_err("PCIE: Failed to register IRQ: %d\n", err); 761 pr_err("PCIE: Failed to register IRQ: %d\n", err);
819 goto err_irq; 762 goto err_req_io;
820 } 763 }
821 set_irq_flags(INT_PCIE_INTR, IRQF_VALID); 764 set_irq_flags(INT_PCIE_INTR, IRQF_VALID);
822 765
823 return 0; 766 return 0;
824 767
825err_irq:
826 iounmap(tegra_pcie_io_base);
827err_map_io:
828 release_resource(&tegra_pcie.res_mmio);
829err_req_io: 768err_req_io:
830 iounmap(tegra_pcie.regs); 769 iounmap(tegra_pcie.regs);
831err_map_reg: 770err_map_reg:
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index 1a208dbf682..81cb26591ac 100644
--- a/arch/arm/mach-tegra/platsmp.c
+++ b/arch/arm/mach-tegra/platsmp.c
@@ -31,6 +31,9 @@
31#include "fuse.h" 31#include "fuse.h"
32#include "flowctrl.h" 32#include "flowctrl.h"
33#include "reset.h" 33#include "reset.h"
34#include "tegra_cpu_car.h"
35
36#include "common.h"
34 37
35extern void tegra_secondary_startup(void); 38extern void tegra_secondary_startup(void);
36 39
@@ -38,19 +41,8 @@ static void __iomem *scu_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE);
38 41
39#define EVP_CPU_RESET_VECTOR \ 42#define EVP_CPU_RESET_VECTOR \
40 (IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE) + 0x100) 43 (IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE) + 0x100)
41#define CLK_RST_CONTROLLER_CLK_CPU_CMPLX \ 44
42 (IO_ADDRESS(TEGRA_CLK_RESET_BASE) + 0x4c) 45static void __cpuinit tegra_secondary_init(unsigned int cpu)
43#define CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET \
44 (IO_ADDRESS(TEGRA_CLK_RESET_BASE) + 0x340)
45#define CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR \
46 (IO_ADDRESS(TEGRA_CLK_RESET_BASE) + 0x344)
47#define CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR \
48 (IO_ADDRESS(TEGRA_CLK_RESET_BASE) + 0x34c)
49
50#define CPU_CLOCK(cpu) (0x1<<(8+cpu))
51#define CPU_RESET(cpu) (0x1111ul<<(cpu))
52
53void __cpuinit platform_secondary_init(unsigned int cpu)
54{ 46{
55 /* 47 /*
56 * if any interrupts are already enabled for the primary 48 * if any interrupts are already enabled for the primary
@@ -63,13 +55,8 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
63 55
64static int tegra20_power_up_cpu(unsigned int cpu) 56static int tegra20_power_up_cpu(unsigned int cpu)
65{ 57{
66 u32 reg;
67
68 /* Enable the CPU clock. */ 58 /* Enable the CPU clock. */
69 reg = readl(CLK_RST_CONTROLLER_CLK_CPU_CMPLX); 59 tegra_enable_cpu_clock(cpu);
70 writel(reg & ~CPU_CLOCK(cpu), CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
71 barrier();
72 reg = readl(CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
73 60
74 /* Clear flow controller CSR. */ 61 /* Clear flow controller CSR. */
75 flowctrl_write_cpu_csr(cpu, 0); 62 flowctrl_write_cpu_csr(cpu, 0);
@@ -79,7 +66,6 @@ static int tegra20_power_up_cpu(unsigned int cpu)
79 66
80static int tegra30_power_up_cpu(unsigned int cpu) 67static int tegra30_power_up_cpu(unsigned int cpu)
81{ 68{
82 u32 reg;
83 int ret, pwrgateid; 69 int ret, pwrgateid;
84 unsigned long timeout; 70 unsigned long timeout;
85 71
@@ -103,8 +89,7 @@ static int tegra30_power_up_cpu(unsigned int cpu)
103 } 89 }
104 90
105 /* CPU partition is powered. Enable the CPU clock. */ 91 /* CPU partition is powered. Enable the CPU clock. */
106 writel(CPU_CLOCK(cpu), CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR); 92 tegra_enable_cpu_clock(cpu);
107 reg = readl(CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR);
108 udelay(10); 93 udelay(10);
109 94
110 /* Remove I/O clamps. */ 95 /* Remove I/O clamps. */
@@ -117,7 +102,7 @@ static int tegra30_power_up_cpu(unsigned int cpu)
117 return 0; 102 return 0;
118} 103}
119 104
120int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 105static int __cpuinit tegra_boot_secondary(unsigned int cpu, struct task_struct *idle)
121{ 106{
122 int status; 107 int status;
123 108
@@ -128,8 +113,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
128 * via the flow controller). This will have no effect on first boot 113 * via the flow controller). This will have no effect on first boot
129 * of the CPU since it should already be in reset. 114 * of the CPU since it should already be in reset.
130 */ 115 */
131 writel(CPU_RESET(cpu), CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET); 116 tegra_put_cpu_in_reset(cpu);
132 dmb();
133 117
134 /* 118 /*
135 * Unhalt the CPU. If the flow controller was used to power-gate the 119 * Unhalt the CPU. If the flow controller was used to power-gate the
@@ -155,8 +139,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
155 goto done; 139 goto done;
156 140
157 /* Take the CPU out of reset. */ 141 /* Take the CPU out of reset. */
158 writel(CPU_RESET(cpu), CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR); 142 tegra_cpu_out_of_reset(cpu);
159 wmb();
160done: 143done:
161 return status; 144 return status;
162} 145}
@@ -165,7 +148,7 @@ done:
165 * Initialise the CPU possible map early - this describes the CPUs 148 * Initialise the CPU possible map early - this describes the CPUs
166 * which may be present or become present in the system. 149 * which may be present or become present in the system.
167 */ 150 */
168void __init smp_init_cpus(void) 151static void __init tegra_smp_init_cpus(void)
169{ 152{
170 unsigned int i, ncores = scu_get_core_count(scu_base); 153 unsigned int i, ncores = scu_get_core_count(scu_base);
171 154
@@ -181,8 +164,19 @@ void __init smp_init_cpus(void)
181 set_smp_cross_call(gic_raise_softirq); 164 set_smp_cross_call(gic_raise_softirq);
182} 165}
183 166
184void __init platform_smp_prepare_cpus(unsigned int max_cpus) 167static void __init tegra_smp_prepare_cpus(unsigned int max_cpus)
185{ 168{
186 tegra_cpu_reset_handler_init(); 169 tegra_cpu_reset_handler_init();
187 scu_enable(scu_base); 170 scu_enable(scu_base);
188} 171}
172
173struct smp_operations tegra_smp_ops __initdata = {
174 .smp_init_cpus = tegra_smp_init_cpus,
175 .smp_prepare_cpus = tegra_smp_prepare_cpus,
176 .smp_secondary_init = tegra_secondary_init,
177 .smp_boot_secondary = tegra_boot_secondary,
178#ifdef CONFIG_HOTPLUG_CPU
179 .cpu_die = tegra_cpu_die,
180 .cpu_disable = tegra_cpu_disable,
181#endif
182};
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index 15d506501cc..de0662de28a 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -199,7 +199,9 @@ int __init tegra_powergate_init(void)
199 199
200#ifdef CONFIG_DEBUG_FS 200#ifdef CONFIG_DEBUG_FS
201 201
202static const char * const powergate_name[] = { 202static const char * const *powergate_name;
203
204static const char * const powergate_name_t20[] = {
203 [TEGRA_POWERGATE_CPU] = "cpu", 205 [TEGRA_POWERGATE_CPU] = "cpu",
204 [TEGRA_POWERGATE_3D] = "3d", 206 [TEGRA_POWERGATE_3D] = "3d",
205 [TEGRA_POWERGATE_VENC] = "venc", 207 [TEGRA_POWERGATE_VENC] = "venc",
@@ -209,6 +211,23 @@ static const char * const powergate_name[] = {
209 [TEGRA_POWERGATE_MPE] = "mpe", 211 [TEGRA_POWERGATE_MPE] = "mpe",
210}; 212};
211 213
214static const char * const powergate_name_t30[] = {
215 [TEGRA_POWERGATE_CPU] = "cpu0",
216 [TEGRA_POWERGATE_3D] = "3d0",
217 [TEGRA_POWERGATE_VENC] = "venc",
218 [TEGRA_POWERGATE_VDEC] = "vdec",
219 [TEGRA_POWERGATE_PCIE] = "pcie",
220 [TEGRA_POWERGATE_L2] = "l2",
221 [TEGRA_POWERGATE_MPE] = "mpe",
222 [TEGRA_POWERGATE_HEG] = "heg",
223 [TEGRA_POWERGATE_SATA] = "sata",
224 [TEGRA_POWERGATE_CPU1] = "cpu1",
225 [TEGRA_POWERGATE_CPU2] = "cpu2",
226 [TEGRA_POWERGATE_CPU3] = "cpu3",
227 [TEGRA_POWERGATE_CELP] = "celp",
228 [TEGRA_POWERGATE_3D1] = "3d1",
229};
230
212static int powergate_show(struct seq_file *s, void *data) 231static int powergate_show(struct seq_file *s, void *data)
213{ 232{
214 int i; 233 int i;
@@ -237,14 +256,24 @@ static const struct file_operations powergate_fops = {
237int __init tegra_powergate_debugfs_init(void) 256int __init tegra_powergate_debugfs_init(void)
238{ 257{
239 struct dentry *d; 258 struct dentry *d;
240 int err = -ENOMEM;
241 259
242 d = debugfs_create_file("powergate", S_IRUGO, NULL, NULL, 260 switch (tegra_chip_id) {
243 &powergate_fops); 261 case TEGRA20:
244 if (!d) 262 powergate_name = powergate_name_t20;
245 return -ENOMEM; 263 break;
264 case TEGRA30:
265 powergate_name = powergate_name_t30;
266 break;
267 }
268
269 if (powergate_name) {
270 d = debugfs_create_file("powergate", S_IRUGO, NULL, NULL,
271 &powergate_fops);
272 if (!d)
273 return -ENOMEM;
274 }
246 275
247 return err; 276 return 0;
248} 277}
249 278
250#endif 279#endif
diff --git a/arch/arm/mach-tegra/sleep-t20.S b/arch/arm/mach-tegra/sleep-t20.S
new file mode 100644
index 00000000000..a36ae413e2b
--- /dev/null
+++ b/arch/arm/mach-tegra/sleep-t20.S
@@ -0,0 +1,82 @@
1/*
2 * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved.
3 * Copyright (c) 2011, Google, Inc.
4 *
5 * Author: Colin Cross <ccross@android.com>
6 * Gary King <gking@nvidia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * 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/linkage.h>
22
23#include <asm/assembler.h>
24
25#include <mach/iomap.h>
26
27#include "sleep.h"
28#include "flowctrl.h"
29
30#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PM_SLEEP)
31/*
32 * tegra20_hotplug_shutdown(void)
33 *
34 * puts the current cpu in reset
35 * should never return
36 */
37ENTRY(tegra20_hotplug_shutdown)
38 /* Turn off SMP coherency */
39 exit_smp r4, r5
40
41 /* Put this CPU down */
42 cpu_id r0
43 bl tegra20_cpu_shutdown
44 mov pc, lr @ should never get here
45ENDPROC(tegra20_hotplug_shutdown)
46
47/*
48 * tegra20_cpu_shutdown(int cpu)
49 *
50 * r0 is cpu to reset
51 *
52 * puts the specified CPU in wait-for-event mode on the flow controller
53 * and puts the CPU in reset
54 * can be called on the current cpu or another cpu
55 * if called on the current cpu, does not return
56 * MUST NOT BE CALLED FOR CPU 0.
57 *
58 * corrupts r0-r3, r12
59 */
60ENTRY(tegra20_cpu_shutdown)
61 cmp r0, #0
62 moveq pc, lr @ must not be called for CPU 0
63
64 cpu_to_halt_reg r1, r0
65 ldr r3, =TEGRA_FLOW_CTRL_VIRT
66 mov r2, #FLOW_CTRL_WAITEVENT | FLOW_CTRL_JTAG_RESUME
67 str r2, [r3, r1] @ put flow controller in wait event mode
68 ldr r2, [r3, r1]
69 isb
70 dsb
71 movw r1, 0x1011
72 mov r1, r1, lsl r0
73 ldr r3, =TEGRA_CLK_RESET_VIRT
74 str r1, [r3, #0x340] @ put slave CPU in reset
75 isb
76 dsb
77 cpu_id r3
78 cmp r3, r0
79 beq .
80 mov pc, lr
81ENDPROC(tegra20_cpu_shutdown)
82#endif
diff --git a/arch/arm/mach-tegra/sleep-t30.S b/arch/arm/mach-tegra/sleep-t30.S
new file mode 100644
index 00000000000..777d9cee8b9
--- /dev/null
+++ b/arch/arm/mach-tegra/sleep-t30.S
@@ -0,0 +1,107 @@
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
19#include <asm/assembler.h>
20
21#include <mach/iomap.h>
22
23#include "sleep.h"
24#include "flowctrl.h"
25
26#define TEGRA30_POWER_HOTPLUG_SHUTDOWN (1 << 27) /* Hotplug shutdown */
27
28#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PM_SLEEP)
29/*
30 * tegra30_hotplug_shutdown(void)
31 *
32 * Powergates the current CPU.
33 * Should never return.
34 */
35ENTRY(tegra30_hotplug_shutdown)
36 /* Turn off SMP coherency */
37 exit_smp r4, r5
38
39 /* Powergate this CPU */
40 mov r0, #TEGRA30_POWER_HOTPLUG_SHUTDOWN
41 bl tegra30_cpu_shutdown
42 mov pc, lr @ should never get here
43ENDPROC(tegra30_hotplug_shutdown)
44
45/*
46 * tegra30_cpu_shutdown(unsigned long flags)
47 *
48 * Puts the current CPU in wait-for-event mode on the flow controller
49 * and powergates it -- flags (in R0) indicate the request type.
50 * Must never be called for CPU 0.
51 *
52 * corrupts r0-r4, r12
53 */
54ENTRY(tegra30_cpu_shutdown)
55 cpu_id r3
56 cmp r3, #0
57 moveq pc, lr @ Must never be called for CPU 0
58
59 ldr r12, =TEGRA_FLOW_CTRL_VIRT
60 cpu_to_csr_reg r1, r3
61 add r1, r1, r12 @ virtual CSR address for this CPU
62 cpu_to_halt_reg r2, r3
63 add r2, r2, r12 @ virtual HALT_EVENTS address for this CPU
64
65 /*
66 * Clear this CPU's "event" and "interrupt" flags and power gate
67 * it when halting but not before it is in the "WFE" state.
68 */
69 movw r12, \
70 FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG | \
71 FLOW_CTRL_CSR_ENABLE
72 mov r4, #(1 << 4)
73 orr r12, r12, r4, lsl r3
74 str r12, [r1]
75
76 /* Halt this CPU. */
77 mov r3, #0x400
78delay_1:
79 subs r3, r3, #1 @ delay as a part of wfe war.
80 bge delay_1;
81 cpsid a @ disable imprecise aborts.
82 ldr r3, [r1] @ read CSR
83 str r3, [r1] @ clear CSR
84 tst r0, #TEGRA30_POWER_HOTPLUG_SHUTDOWN
85 movne r3, #FLOW_CTRL_WAITEVENT @ For hotplug
86 str r3, [r2]
87 ldr r0, [r2]
88 b wfe_war
89
90__cpu_reset_again:
91 dsb
92 .align 5
93 wfe @ CPU should be power gated here
94wfe_war:
95 b __cpu_reset_again
96
97 /*
98 * 38 nop's, which fills reset of wfe cache line and
99 * 4 more cachelines with nop
100 */
101 .rept 38
102 nop
103 .endr
104 b . @ should never get here
105
106ENDPROC(tegra30_cpu_shutdown)
107#endif
diff --git a/arch/arm/mach-tegra/sleep.S b/arch/arm/mach-tegra/sleep.S
index d29b156a801..ea81554c483 100644
--- a/arch/arm/mach-tegra/sleep.S
+++ b/arch/arm/mach-tegra/sleep.S
@@ -29,36 +29,5 @@
29#include <mach/iomap.h> 29#include <mach/iomap.h>
30 30
31#include "flowctrl.h" 31#include "flowctrl.h"
32#include "sleep.h"
32 33
33#define TEGRA_FLOW_CTRL_VIRT (TEGRA_FLOW_CTRL_BASE - IO_PPSB_PHYS \
34 + IO_PPSB_VIRT)
35
36/* returns the offset of the flow controller halt register for a cpu */
37.macro cpu_to_halt_reg rd, rcpu
38 cmp \rcpu, #0
39 subne \rd, \rcpu, #1
40 movne \rd, \rd, lsl #3
41 addne \rd, \rd, #0x14
42 moveq \rd, #0
43.endm
44
45/* returns the offset of the flow controller csr register for a cpu */
46.macro cpu_to_csr_reg rd, rcpu
47 cmp \rcpu, #0
48 subne \rd, \rcpu, #1
49 movne \rd, \rd, lsl #3
50 addne \rd, \rd, #0x18
51 moveq \rd, #8
52.endm
53
54/* returns the ID of the current processor */
55.macro cpu_id, rd
56 mrc p15, 0, \rd, c0, c0, 5
57 and \rd, \rd, #0xF
58.endm
59
60/* loads a 32-bit value into a register without a data access */
61.macro mov32, reg, val
62 movw \reg, #:lower16:\val
63 movt \reg, #:upper16:\val
64.endm
diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
new file mode 100644
index 00000000000..e25a7cd703d
--- /dev/null
+++ b/arch/arm/mach-tegra/sleep.h
@@ -0,0 +1,85 @@
1/*
2 * Copyright (c) 2010-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_SLEEP_H
18#define __MACH_TEGRA_SLEEP_H
19
20#include <mach/iomap.h>
21
22#define TEGRA_ARM_PERIF_VIRT (TEGRA_ARM_PERIF_BASE - IO_CPU_PHYS \
23 + IO_CPU_VIRT)
24#define TEGRA_FLOW_CTRL_VIRT (TEGRA_FLOW_CTRL_BASE - IO_PPSB_PHYS \
25 + IO_PPSB_VIRT)
26#define TEGRA_CLK_RESET_VIRT (TEGRA_CLK_RESET_BASE - IO_PPSB_PHYS \
27 + IO_PPSB_VIRT)
28
29#ifdef __ASSEMBLY__
30/* returns the offset of the flow controller halt register for a cpu */
31.macro cpu_to_halt_reg rd, rcpu
32 cmp \rcpu, #0
33 subne \rd, \rcpu, #1
34 movne \rd, \rd, lsl #3
35 addne \rd, \rd, #0x14
36 moveq \rd, #0
37.endm
38
39/* returns the offset of the flow controller csr register for a cpu */
40.macro cpu_to_csr_reg rd, rcpu
41 cmp \rcpu, #0
42 subne \rd, \rcpu, #1
43 movne \rd, \rd, lsl #3
44 addne \rd, \rd, #0x18
45 moveq \rd, #8
46.endm
47
48/* returns the ID of the current processor */
49.macro cpu_id, rd
50 mrc p15, 0, \rd, c0, c0, 5
51 and \rd, \rd, #0xF
52.endm
53
54/* loads a 32-bit value into a register without a data access */
55.macro mov32, reg, val
56 movw \reg, #:lower16:\val
57 movt \reg, #:upper16:\val
58.endm
59
60/* Macro to exit SMP coherency. */
61.macro exit_smp, tmp1, tmp2
62 mrc p15, 0, \tmp1, c1, c0, 1 @ ACTLR
63 bic \tmp1, \tmp1, #(1<<6) | (1<<0) @ clear ACTLR.SMP | ACTLR.FW
64 mcr p15, 0, \tmp1, c1, c0, 1 @ ACTLR
65 isb
66 cpu_id \tmp1
67 mov \tmp1, \tmp1, lsl #2
68 mov \tmp2, #0xf
69 mov \tmp2, \tmp2, lsl \tmp1
70 mov32 \tmp1, TEGRA_ARM_PERIF_VIRT + 0xC
71 str \tmp2, [\tmp1] @ invalidate SCU tags for CPU
72 dsb
73.endm
74#else
75
76#ifdef CONFIG_HOTPLUG_CPU
77void tegra20_hotplug_init(void);
78void tegra30_hotplug_init(void);
79#else
80static inline void tegra20_hotplug_init(void) {}
81static inline void tegra30_hotplug_init(void) {}
82#endif
83
84#endif
85#endif
diff --git a/arch/arm/mach-tegra/tegra20_clocks.c b/arch/arm/mach-tegra/tegra20_clocks.c
new file mode 100644
index 00000000000..deb873fb12b
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra20_clocks.c
@@ -0,0 +1,1624 @@
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 <mach/iomap.h>
31
32#include "clock.h"
33#include "fuse.h"
34#include "tegra2_emc.h"
35#include "tegra_cpu_car.h"
36
37#define RST_DEVICES 0x004
38#define RST_DEVICES_SET 0x300
39#define RST_DEVICES_CLR 0x304
40#define RST_DEVICES_NUM 3
41
42#define CLK_OUT_ENB 0x010
43#define CLK_OUT_ENB_SET 0x320
44#define CLK_OUT_ENB_CLR 0x324
45#define CLK_OUT_ENB_NUM 3
46
47#define CLK_MASK_ARM 0x44
48#define MISC_CLK_ENB 0x48
49
50#define OSC_CTRL 0x50
51#define OSC_CTRL_OSC_FREQ_MASK (3<<30)
52#define OSC_CTRL_OSC_FREQ_13MHZ (0<<30)
53#define OSC_CTRL_OSC_FREQ_19_2MHZ (1<<30)
54#define OSC_CTRL_OSC_FREQ_12MHZ (2<<30)
55#define OSC_CTRL_OSC_FREQ_26MHZ (3<<30)
56#define OSC_CTRL_MASK (0x3f2 | OSC_CTRL_OSC_FREQ_MASK)
57
58#define OSC_FREQ_DET 0x58
59#define OSC_FREQ_DET_TRIG (1<<31)
60
61#define OSC_FREQ_DET_STATUS 0x5C
62#define OSC_FREQ_DET_BUSY (1<<31)
63#define OSC_FREQ_DET_CNT_MASK 0xFFFF
64
65#define PERIPH_CLK_SOURCE_I2S1 0x100
66#define PERIPH_CLK_SOURCE_EMC 0x19c
67#define PERIPH_CLK_SOURCE_OSC 0x1fc
68#define PERIPH_CLK_SOURCE_NUM \
69 ((PERIPH_CLK_SOURCE_OSC - PERIPH_CLK_SOURCE_I2S1) / 4)
70
71#define PERIPH_CLK_SOURCE_MASK (3<<30)
72#define PERIPH_CLK_SOURCE_SHIFT 30
73#define PERIPH_CLK_SOURCE_PWM_MASK (7<<28)
74#define PERIPH_CLK_SOURCE_PWM_SHIFT 28
75#define PERIPH_CLK_SOURCE_ENABLE (1<<28)
76#define PERIPH_CLK_SOURCE_DIVU71_MASK 0xFF
77#define PERIPH_CLK_SOURCE_DIVU16_MASK 0xFFFF
78#define PERIPH_CLK_SOURCE_DIV_SHIFT 0
79
80#define SDMMC_CLK_INT_FB_SEL (1 << 23)
81#define SDMMC_CLK_INT_FB_DLY_SHIFT 16
82#define SDMMC_CLK_INT_FB_DLY_MASK (0xF << SDMMC_CLK_INT_FB_DLY_SHIFT)
83
84#define PLL_BASE 0x0
85#define PLL_BASE_BYPASS (1<<31)
86#define PLL_BASE_ENABLE (1<<30)
87#define PLL_BASE_REF_ENABLE (1<<29)
88#define PLL_BASE_OVERRIDE (1<<28)
89#define PLL_BASE_DIVP_MASK (0x7<<20)
90#define PLL_BASE_DIVP_SHIFT 20
91#define PLL_BASE_DIVN_MASK (0x3FF<<8)
92#define PLL_BASE_DIVN_SHIFT 8
93#define PLL_BASE_DIVM_MASK (0x1F)
94#define PLL_BASE_DIVM_SHIFT 0
95
96#define PLL_OUT_RATIO_MASK (0xFF<<8)
97#define PLL_OUT_RATIO_SHIFT 8
98#define PLL_OUT_OVERRIDE (1<<2)
99#define PLL_OUT_CLKEN (1<<1)
100#define PLL_OUT_RESET_DISABLE (1<<0)
101
102#define PLL_MISC(c) (((c)->flags & PLL_ALT_MISC_REG) ? 0x4 : 0xc)
103
104#define PLL_MISC_DCCON_SHIFT 20
105#define PLL_MISC_CPCON_SHIFT 8
106#define PLL_MISC_CPCON_MASK (0xF<<PLL_MISC_CPCON_SHIFT)
107#define PLL_MISC_LFCON_SHIFT 4
108#define PLL_MISC_LFCON_MASK (0xF<<PLL_MISC_LFCON_SHIFT)
109#define PLL_MISC_VCOCON_SHIFT 0
110#define PLL_MISC_VCOCON_MASK (0xF<<PLL_MISC_VCOCON_SHIFT)
111
112#define PLLU_BASE_POST_DIV (1<<20)
113
114#define PLLD_MISC_CLKENABLE (1<<30)
115#define PLLD_MISC_DIV_RST (1<<23)
116#define PLLD_MISC_DCCON_SHIFT 12
117
118#define PLLE_MISC_READY (1 << 15)
119
120#define PERIPH_CLK_TO_ENB_REG(c) ((c->u.periph.clk_num / 32) * 4)
121#define PERIPH_CLK_TO_ENB_SET_REG(c) ((c->u.periph.clk_num / 32) * 8)
122#define PERIPH_CLK_TO_ENB_BIT(c) (1 << (c->u.periph.clk_num % 32))
123
124#define SUPER_CLK_MUX 0x00
125#define SUPER_STATE_SHIFT 28
126#define SUPER_STATE_MASK (0xF << SUPER_STATE_SHIFT)
127#define SUPER_STATE_STANDBY (0x0 << SUPER_STATE_SHIFT)
128#define SUPER_STATE_IDLE (0x1 << SUPER_STATE_SHIFT)
129#define SUPER_STATE_RUN (0x2 << SUPER_STATE_SHIFT)
130#define SUPER_STATE_IRQ (0x3 << SUPER_STATE_SHIFT)
131#define SUPER_STATE_FIQ (0x4 << SUPER_STATE_SHIFT)
132#define SUPER_SOURCE_MASK 0xF
133#define SUPER_FIQ_SOURCE_SHIFT 12
134#define SUPER_IRQ_SOURCE_SHIFT 8
135#define SUPER_RUN_SOURCE_SHIFT 4
136#define SUPER_IDLE_SOURCE_SHIFT 0
137
138#define SUPER_CLK_DIVIDER 0x04
139
140#define BUS_CLK_DISABLE (1<<3)
141#define BUS_CLK_DIV_MASK 0x3
142
143#define PMC_CTRL 0x0
144 #define PMC_CTRL_BLINK_ENB (1 << 7)
145
146#define PMC_DPD_PADS_ORIDE 0x1c
147 #define PMC_DPD_PADS_ORIDE_BLINK_ENB (1 << 20)
148
149#define PMC_BLINK_TIMER_DATA_ON_SHIFT 0
150#define PMC_BLINK_TIMER_DATA_ON_MASK 0x7fff
151#define PMC_BLINK_TIMER_ENB (1 << 15)
152#define PMC_BLINK_TIMER_DATA_OFF_SHIFT 16
153#define PMC_BLINK_TIMER_DATA_OFF_MASK 0xffff
154
155/* Tegra CPU clock and reset control regs */
156#define TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX 0x4c
157#define TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET 0x340
158#define TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR 0x344
159
160#define CPU_CLOCK(cpu) (0x1 << (8 + cpu))
161#define CPU_RESET(cpu) (0x1111ul << (cpu))
162
163static void __iomem *reg_clk_base = IO_ADDRESS(TEGRA_CLK_RESET_BASE);
164static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE);
165
166/*
167 * Some clocks share a register with other clocks. Any clock op that
168 * non-atomically modifies a register used by another clock must lock
169 * clock_register_lock first.
170 */
171static DEFINE_SPINLOCK(clock_register_lock);
172
173/*
174 * Some peripheral clocks share an enable bit, so refcount the enable bits
175 * in registers CLK_ENABLE_L, CLK_ENABLE_H, and CLK_ENABLE_U
176 */
177static int tegra_periph_clk_enable_refcount[3 * 32];
178
179#define clk_writel(value, reg) \
180 __raw_writel(value, reg_clk_base + (reg))
181#define clk_readl(reg) \
182 __raw_readl(reg_clk_base + (reg))
183#define pmc_writel(value, reg) \
184 __raw_writel(value, reg_pmc_base + (reg))
185#define pmc_readl(reg) \
186 __raw_readl(reg_pmc_base + (reg))
187
188static unsigned long clk_measure_input_freq(void)
189{
190 u32 clock_autodetect;
191 clk_writel(OSC_FREQ_DET_TRIG | 1, OSC_FREQ_DET);
192 do {} while (clk_readl(OSC_FREQ_DET_STATUS) & OSC_FREQ_DET_BUSY);
193 clock_autodetect = clk_readl(OSC_FREQ_DET_STATUS);
194 if (clock_autodetect >= 732 - 3 && clock_autodetect <= 732 + 3) {
195 return 12000000;
196 } else if (clock_autodetect >= 794 - 3 && clock_autodetect <= 794 + 3) {
197 return 13000000;
198 } else if (clock_autodetect >= 1172 - 3 && clock_autodetect <= 1172 + 3) {
199 return 19200000;
200 } else if (clock_autodetect >= 1587 - 3 && clock_autodetect <= 1587 + 3) {
201 return 26000000;
202 } else {
203 pr_err("%s: Unexpected clock autodetect value %d",
204 __func__, clock_autodetect);
205 BUG();
206 return 0;
207 }
208}
209
210static int clk_div71_get_divider(unsigned long parent_rate, unsigned long rate)
211{
212 s64 divider_u71 = parent_rate * 2;
213 divider_u71 += rate - 1;
214 do_div(divider_u71, rate);
215
216 if (divider_u71 - 2 < 0)
217 return 0;
218
219 if (divider_u71 - 2 > 255)
220 return -EINVAL;
221
222 return divider_u71 - 2;
223}
224
225static int clk_div16_get_divider(unsigned long parent_rate, unsigned long rate)
226{
227 s64 divider_u16;
228
229 divider_u16 = parent_rate;
230 divider_u16 += rate - 1;
231 do_div(divider_u16, rate);
232
233 if (divider_u16 - 1 < 0)
234 return 0;
235
236 if (divider_u16 - 1 > 0xFFFF)
237 return -EINVAL;
238
239 return divider_u16 - 1;
240}
241
242static unsigned long tegra_clk_fixed_recalc_rate(struct clk_hw *hw,
243 unsigned long parent_rate)
244{
245 return to_clk_tegra(hw)->fixed_rate;
246}
247
248struct clk_ops tegra_clk_32k_ops = {
249 .recalc_rate = tegra_clk_fixed_recalc_rate,
250};
251
252/* clk_m functions */
253static unsigned long tegra20_clk_m_recalc_rate(struct clk_hw *hw,
254 unsigned long prate)
255{
256 if (!to_clk_tegra(hw)->fixed_rate)
257 to_clk_tegra(hw)->fixed_rate = clk_measure_input_freq();
258 return to_clk_tegra(hw)->fixed_rate;
259}
260
261static void tegra20_clk_m_init(struct clk_hw *hw)
262{
263 struct clk_tegra *c = to_clk_tegra(hw);
264 u32 osc_ctrl = clk_readl(OSC_CTRL);
265 u32 auto_clock_control = osc_ctrl & ~OSC_CTRL_OSC_FREQ_MASK;
266
267 switch (c->fixed_rate) {
268 case 12000000:
269 auto_clock_control |= OSC_CTRL_OSC_FREQ_12MHZ;
270 break;
271 case 13000000:
272 auto_clock_control |= OSC_CTRL_OSC_FREQ_13MHZ;
273 break;
274 case 19200000:
275 auto_clock_control |= OSC_CTRL_OSC_FREQ_19_2MHZ;
276 break;
277 case 26000000:
278 auto_clock_control |= OSC_CTRL_OSC_FREQ_26MHZ;
279 break;
280 default:
281 BUG();
282 }
283 clk_writel(auto_clock_control, OSC_CTRL);
284}
285
286struct clk_ops tegra_clk_m_ops = {
287 .init = tegra20_clk_m_init,
288 .recalc_rate = tegra20_clk_m_recalc_rate,
289};
290
291/* super clock functions */
292/* "super clocks" on tegra have two-stage muxes and a clock skipping
293 * super divider. We will ignore the clock skipping divider, since we
294 * can't lower the voltage when using the clock skip, but we can if we
295 * lower the PLL frequency.
296 */
297static int tegra20_super_clk_is_enabled(struct clk_hw *hw)
298{
299 struct clk_tegra *c = to_clk_tegra(hw);
300 u32 val;
301
302 val = clk_readl(c->reg + SUPER_CLK_MUX);
303 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
304 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
305 c->state = ON;
306 return c->state;
307}
308
309static int tegra20_super_clk_enable(struct clk_hw *hw)
310{
311 struct clk_tegra *c = to_clk_tegra(hw);
312 clk_writel(0, c->reg + SUPER_CLK_DIVIDER);
313 return 0;
314}
315
316static void tegra20_super_clk_disable(struct clk_hw *hw)
317{
318 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
319
320 /* oops - don't disable the CPU clock! */
321 BUG();
322}
323
324static u8 tegra20_super_clk_get_parent(struct clk_hw *hw)
325{
326 struct clk_tegra *c = to_clk_tegra(hw);
327 int val = clk_readl(c->reg + SUPER_CLK_MUX);
328 int source;
329 int shift;
330
331 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
332 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
333 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
334 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
335 source = (val >> shift) & SUPER_SOURCE_MASK;
336 return source;
337}
338
339static int tegra20_super_clk_set_parent(struct clk_hw *hw, u8 index)
340{
341 struct clk_tegra *c = to_clk_tegra(hw);
342 u32 val = clk_readl(c->reg + SUPER_CLK_MUX);
343 int shift;
344
345 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
346 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
347 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
348 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
349 val &= ~(SUPER_SOURCE_MASK << shift);
350 val |= index << shift;
351
352 clk_writel(val, c->reg);
353
354 return 0;
355}
356
357/* FIX ME: Need to switch parents to change the source PLL rate */
358static unsigned long tegra20_super_clk_recalc_rate(struct clk_hw *hw,
359 unsigned long prate)
360{
361 return prate;
362}
363
364static long tegra20_super_clk_round_rate(struct clk_hw *hw, unsigned long rate,
365 unsigned long *prate)
366{
367 return *prate;
368}
369
370static int tegra20_super_clk_set_rate(struct clk_hw *hw, unsigned long rate,
371 unsigned long parent_rate)
372{
373 return 0;
374}
375
376struct clk_ops tegra_super_ops = {
377 .is_enabled = tegra20_super_clk_is_enabled,
378 .enable = tegra20_super_clk_enable,
379 .disable = tegra20_super_clk_disable,
380 .set_parent = tegra20_super_clk_set_parent,
381 .get_parent = tegra20_super_clk_get_parent,
382 .set_rate = tegra20_super_clk_set_rate,
383 .round_rate = tegra20_super_clk_round_rate,
384 .recalc_rate = tegra20_super_clk_recalc_rate,
385};
386
387static unsigned long tegra20_twd_clk_recalc_rate(struct clk_hw *hw,
388 unsigned long parent_rate)
389{
390 struct clk_tegra *c = to_clk_tegra(hw);
391 u64 rate = parent_rate;
392
393 if (c->mul != 0 && c->div != 0) {
394 rate *= c->mul;
395 rate += c->div - 1; /* round up */
396 do_div(rate, c->div);
397 }
398
399 return rate;
400}
401
402struct clk_ops tegra_twd_ops = {
403 .recalc_rate = tegra20_twd_clk_recalc_rate,
404};
405
406static u8 tegra20_cop_clk_get_parent(struct clk_hw *hw)
407{
408 return 0;
409}
410
411struct clk_ops tegra_cop_ops = {
412 .get_parent = tegra20_cop_clk_get_parent,
413};
414
415/* virtual cop clock functions. Used to acquire the fake 'cop' clock to
416 * reset the COP block (i.e. AVP) */
417void tegra2_cop_clk_reset(struct clk_hw *hw, bool assert)
418{
419 unsigned long reg = assert ? RST_DEVICES_SET : RST_DEVICES_CLR;
420
421 pr_debug("%s %s\n", __func__, assert ? "assert" : "deassert");
422 clk_writel(1 << 1, reg);
423}
424
425/* bus clock functions */
426static int tegra20_bus_clk_is_enabled(struct clk_hw *hw)
427{
428 struct clk_tegra *c = to_clk_tegra(hw);
429 u32 val = clk_readl(c->reg);
430
431 c->state = ((val >> c->reg_shift) & BUS_CLK_DISABLE) ? OFF : ON;
432 return c->state;
433}
434
435static int tegra20_bus_clk_enable(struct clk_hw *hw)
436{
437 struct clk_tegra *c = to_clk_tegra(hw);
438 unsigned long flags;
439 u32 val;
440
441 spin_lock_irqsave(&clock_register_lock, flags);
442
443 val = clk_readl(c->reg);
444 val &= ~(BUS_CLK_DISABLE << c->reg_shift);
445 clk_writel(val, c->reg);
446
447 spin_unlock_irqrestore(&clock_register_lock, flags);
448
449 return 0;
450}
451
452static void tegra20_bus_clk_disable(struct clk_hw *hw)
453{
454 struct clk_tegra *c = to_clk_tegra(hw);
455 unsigned long flags;
456 u32 val;
457
458 spin_lock_irqsave(&clock_register_lock, flags);
459
460 val = clk_readl(c->reg);
461 val |= BUS_CLK_DISABLE << c->reg_shift;
462 clk_writel(val, c->reg);
463
464 spin_unlock_irqrestore(&clock_register_lock, flags);
465}
466
467static unsigned long tegra20_bus_clk_recalc_rate(struct clk_hw *hw,
468 unsigned long prate)
469{
470 struct clk_tegra *c = to_clk_tegra(hw);
471 u32 val = clk_readl(c->reg);
472 u64 rate = prate;
473
474 c->div = ((val >> c->reg_shift) & BUS_CLK_DIV_MASK) + 1;
475 c->mul = 1;
476
477 if (c->mul != 0 && c->div != 0) {
478 rate *= c->mul;
479 rate += c->div - 1; /* round up */
480 do_div(rate, c->div);
481 }
482 return rate;
483}
484
485static int tegra20_bus_clk_set_rate(struct clk_hw *hw, unsigned long rate,
486 unsigned long parent_rate)
487{
488 struct clk_tegra *c = to_clk_tegra(hw);
489 int ret = -EINVAL;
490 unsigned long flags;
491 u32 val;
492 int i;
493
494 spin_lock_irqsave(&clock_register_lock, flags);
495
496 val = clk_readl(c->reg);
497 for (i = 1; i <= 4; i++) {
498 if (rate == parent_rate / i) {
499 val &= ~(BUS_CLK_DIV_MASK << c->reg_shift);
500 val |= (i - 1) << c->reg_shift;
501 clk_writel(val, c->reg);
502 c->div = i;
503 c->mul = 1;
504 ret = 0;
505 break;
506 }
507 }
508
509 spin_unlock_irqrestore(&clock_register_lock, flags);
510
511 return ret;
512}
513
514static long tegra20_bus_clk_round_rate(struct clk_hw *hw, unsigned long rate,
515 unsigned long *prate)
516{
517 unsigned long parent_rate = *prate;
518 s64 divider;
519
520 if (rate >= parent_rate)
521 return rate;
522
523 divider = parent_rate;
524 divider += rate - 1;
525 do_div(divider, rate);
526
527 if (divider < 0)
528 return divider;
529
530 if (divider > 4)
531 divider = 4;
532 do_div(parent_rate, divider);
533
534 return parent_rate;
535}
536
537struct clk_ops tegra_bus_ops = {
538 .is_enabled = tegra20_bus_clk_is_enabled,
539 .enable = tegra20_bus_clk_enable,
540 .disable = tegra20_bus_clk_disable,
541 .set_rate = tegra20_bus_clk_set_rate,
542 .round_rate = tegra20_bus_clk_round_rate,
543 .recalc_rate = tegra20_bus_clk_recalc_rate,
544};
545
546/* Blink output functions */
547static int tegra20_blink_clk_is_enabled(struct clk_hw *hw)
548{
549 struct clk_tegra *c = to_clk_tegra(hw);
550 u32 val;
551
552 val = pmc_readl(PMC_CTRL);
553 c->state = (val & PMC_CTRL_BLINK_ENB) ? ON : OFF;
554 return c->state;
555}
556
557static unsigned long tegra20_blink_clk_recalc_rate(struct clk_hw *hw,
558 unsigned long prate)
559{
560 struct clk_tegra *c = to_clk_tegra(hw);
561 u64 rate = prate;
562 u32 val;
563
564 c->mul = 1;
565 val = pmc_readl(c->reg);
566
567 if (val & PMC_BLINK_TIMER_ENB) {
568 unsigned int on_off;
569
570 on_off = (val >> PMC_BLINK_TIMER_DATA_ON_SHIFT) &
571 PMC_BLINK_TIMER_DATA_ON_MASK;
572 val >>= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
573 val &= PMC_BLINK_TIMER_DATA_OFF_MASK;
574 on_off += val;
575 /* each tick in the blink timer is 4 32KHz clocks */
576 c->div = on_off * 4;
577 } else {
578 c->div = 1;
579 }
580
581 if (c->mul != 0 && c->div != 0) {
582 rate *= c->mul;
583 rate += c->div - 1; /* round up */
584 do_div(rate, c->div);
585 }
586 return rate;
587}
588
589static int tegra20_blink_clk_enable(struct clk_hw *hw)
590{
591 u32 val;
592
593 val = pmc_readl(PMC_DPD_PADS_ORIDE);
594 pmc_writel(val | PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
595
596 val = pmc_readl(PMC_CTRL);
597 pmc_writel(val | PMC_CTRL_BLINK_ENB, PMC_CTRL);
598
599 return 0;
600}
601
602static void tegra20_blink_clk_disable(struct clk_hw *hw)
603{
604 u32 val;
605
606 val = pmc_readl(PMC_CTRL);
607 pmc_writel(val & ~PMC_CTRL_BLINK_ENB, PMC_CTRL);
608
609 val = pmc_readl(PMC_DPD_PADS_ORIDE);
610 pmc_writel(val & ~PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
611}
612
613static int tegra20_blink_clk_set_rate(struct clk_hw *hw, unsigned long rate,
614 unsigned long parent_rate)
615{
616 struct clk_tegra *c = to_clk_tegra(hw);
617
618 if (rate >= parent_rate) {
619 c->div = 1;
620 pmc_writel(0, c->reg);
621 } else {
622 unsigned int on_off;
623 u32 val;
624
625 on_off = DIV_ROUND_UP(parent_rate / 8, rate);
626 c->div = on_off * 8;
627
628 val = (on_off & PMC_BLINK_TIMER_DATA_ON_MASK) <<
629 PMC_BLINK_TIMER_DATA_ON_SHIFT;
630 on_off &= PMC_BLINK_TIMER_DATA_OFF_MASK;
631 on_off <<= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
632 val |= on_off;
633 val |= PMC_BLINK_TIMER_ENB;
634 pmc_writel(val, c->reg);
635 }
636
637 return 0;
638}
639
640static long tegra20_blink_clk_round_rate(struct clk_hw *hw, unsigned long rate,
641 unsigned long *prate)
642{
643 int div;
644 int mul;
645 long round_rate = *prate;
646
647 mul = 1;
648
649 if (rate >= *prate) {
650 div = 1;
651 } else {
652 div = DIV_ROUND_UP(*prate / 8, rate);
653 div *= 8;
654 }
655
656 round_rate *= mul;
657 round_rate += div - 1;
658 do_div(round_rate, div);
659
660 return round_rate;
661}
662
663struct clk_ops tegra_blink_clk_ops = {
664 .is_enabled = tegra20_blink_clk_is_enabled,
665 .enable = tegra20_blink_clk_enable,
666 .disable = tegra20_blink_clk_disable,
667 .set_rate = tegra20_blink_clk_set_rate,
668 .round_rate = tegra20_blink_clk_round_rate,
669 .recalc_rate = tegra20_blink_clk_recalc_rate,
670};
671
672/* PLL Functions */
673static int tegra20_pll_clk_wait_for_lock(struct clk_tegra *c)
674{
675 udelay(c->u.pll.lock_delay);
676 return 0;
677}
678
679static int tegra20_pll_clk_is_enabled(struct clk_hw *hw)
680{
681 struct clk_tegra *c = to_clk_tegra(hw);
682 u32 val = clk_readl(c->reg + PLL_BASE);
683
684 c->state = (val & PLL_BASE_ENABLE) ? ON : OFF;
685 return c->state;
686}
687
688static unsigned long tegra20_pll_clk_recalc_rate(struct clk_hw *hw,
689 unsigned long prate)
690{
691 struct clk_tegra *c = to_clk_tegra(hw);
692 u32 val = clk_readl(c->reg + PLL_BASE);
693 u64 rate = prate;
694
695 if (c->flags & PLL_FIXED && !(val & PLL_BASE_OVERRIDE)) {
696 const struct clk_pll_freq_table *sel;
697 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
698 if (sel->input_rate == prate &&
699 sel->output_rate == c->u.pll.fixed_rate) {
700 c->mul = sel->n;
701 c->div = sel->m * sel->p;
702 break;
703 }
704 }
705 pr_err("Clock %s has unknown fixed frequency\n",
706 __clk_get_name(hw->clk));
707 BUG();
708 } else if (val & PLL_BASE_BYPASS) {
709 c->mul = 1;
710 c->div = 1;
711 } else {
712 c->mul = (val & PLL_BASE_DIVN_MASK) >> PLL_BASE_DIVN_SHIFT;
713 c->div = (val & PLL_BASE_DIVM_MASK) >> PLL_BASE_DIVM_SHIFT;
714 if (c->flags & PLLU)
715 c->div *= (val & PLLU_BASE_POST_DIV) ? 1 : 2;
716 else
717 c->div *= (val & PLL_BASE_DIVP_MASK) ? 2 : 1;
718 }
719
720 if (c->mul != 0 && c->div != 0) {
721 rate *= c->mul;
722 rate += c->div - 1; /* round up */
723 do_div(rate, c->div);
724 }
725 return rate;
726}
727
728static int tegra20_pll_clk_enable(struct clk_hw *hw)
729{
730 struct clk_tegra *c = to_clk_tegra(hw);
731 u32 val;
732 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
733
734 val = clk_readl(c->reg + PLL_BASE);
735 val &= ~PLL_BASE_BYPASS;
736 val |= PLL_BASE_ENABLE;
737 clk_writel(val, c->reg + PLL_BASE);
738
739 tegra20_pll_clk_wait_for_lock(c);
740
741 return 0;
742}
743
744static void tegra20_pll_clk_disable(struct clk_hw *hw)
745{
746 struct clk_tegra *c = to_clk_tegra(hw);
747 u32 val;
748 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
749
750 val = clk_readl(c->reg);
751 val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE);
752 clk_writel(val, c->reg);
753}
754
755static int tegra20_pll_clk_set_rate(struct clk_hw *hw, unsigned long rate,
756 unsigned long parent_rate)
757{
758 struct clk_tegra *c = to_clk_tegra(hw);
759 unsigned long input_rate = parent_rate;
760 const struct clk_pll_freq_table *sel;
761 u32 val;
762
763 pr_debug("%s: %s %lu\n", __func__, __clk_get_name(hw->clk), rate);
764
765 if (c->flags & PLL_FIXED) {
766 int ret = 0;
767 if (rate != c->u.pll.fixed_rate) {
768 pr_err("%s: Can not change %s fixed rate %lu to %lu\n",
769 __func__, __clk_get_name(hw->clk),
770 c->u.pll.fixed_rate, rate);
771 ret = -EINVAL;
772 }
773 return ret;
774 }
775
776 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
777 if (sel->input_rate == input_rate && sel->output_rate == rate) {
778 c->mul = sel->n;
779 c->div = sel->m * sel->p;
780
781 val = clk_readl(c->reg + PLL_BASE);
782 if (c->flags & PLL_FIXED)
783 val |= PLL_BASE_OVERRIDE;
784 val &= ~(PLL_BASE_DIVP_MASK | PLL_BASE_DIVN_MASK |
785 PLL_BASE_DIVM_MASK);
786 val |= (sel->m << PLL_BASE_DIVM_SHIFT) |
787 (sel->n << PLL_BASE_DIVN_SHIFT);
788 BUG_ON(sel->p < 1 || sel->p > 2);
789 if (c->flags & PLLU) {
790 if (sel->p == 1)
791 val |= PLLU_BASE_POST_DIV;
792 } else {
793 if (sel->p == 2)
794 val |= 1 << PLL_BASE_DIVP_SHIFT;
795 }
796 clk_writel(val, c->reg + PLL_BASE);
797
798 if (c->flags & PLL_HAS_CPCON) {
799 val = clk_readl(c->reg + PLL_MISC(c));
800 val &= ~PLL_MISC_CPCON_MASK;
801 val |= sel->cpcon << PLL_MISC_CPCON_SHIFT;
802 clk_writel(val, c->reg + PLL_MISC(c));
803 }
804
805 if (c->state == ON)
806 tegra20_pll_clk_enable(hw);
807 return 0;
808 }
809 }
810 return -EINVAL;
811}
812
813static long tegra20_pll_clk_round_rate(struct clk_hw *hw, unsigned long rate,
814 unsigned long *prate)
815{
816 struct clk_tegra *c = to_clk_tegra(hw);
817 const struct clk_pll_freq_table *sel;
818 unsigned long input_rate = *prate;
819 u64 output_rate = *prate;
820 int mul;
821 int div;
822
823 if (c->flags & PLL_FIXED)
824 return c->u.pll.fixed_rate;
825
826 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++)
827 if (sel->input_rate == input_rate && sel->output_rate == rate) {
828 mul = sel->n;
829 div = sel->m * sel->p;
830 break;
831 }
832
833 if (sel->input_rate == 0)
834 return -EINVAL;
835
836 output_rate *= mul;
837 output_rate += div - 1; /* round up */
838 do_div(output_rate, div);
839
840 return output_rate;
841}
842
843struct clk_ops tegra_pll_ops = {
844 .is_enabled = tegra20_pll_clk_is_enabled,
845 .enable = tegra20_pll_clk_enable,
846 .disable = tegra20_pll_clk_disable,
847 .set_rate = tegra20_pll_clk_set_rate,
848 .recalc_rate = tegra20_pll_clk_recalc_rate,
849 .round_rate = tegra20_pll_clk_round_rate,
850};
851
852static void tegra20_pllx_clk_init(struct clk_hw *hw)
853{
854 struct clk_tegra *c = to_clk_tegra(hw);
855
856 if (tegra_sku_id == 7)
857 c->max_rate = 750000000;
858}
859
860struct clk_ops tegra_pllx_ops = {
861 .init = tegra20_pllx_clk_init,
862 .is_enabled = tegra20_pll_clk_is_enabled,
863 .enable = tegra20_pll_clk_enable,
864 .disable = tegra20_pll_clk_disable,
865 .set_rate = tegra20_pll_clk_set_rate,
866 .recalc_rate = tegra20_pll_clk_recalc_rate,
867 .round_rate = tegra20_pll_clk_round_rate,
868};
869
870static int tegra20_plle_clk_enable(struct clk_hw *hw)
871{
872 struct clk_tegra *c = to_clk_tegra(hw);
873 u32 val;
874
875 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
876
877 mdelay(1);
878
879 val = clk_readl(c->reg + PLL_BASE);
880 if (!(val & PLLE_MISC_READY))
881 return -EBUSY;
882
883 val = clk_readl(c->reg + PLL_BASE);
884 val |= PLL_BASE_ENABLE | PLL_BASE_BYPASS;
885 clk_writel(val, c->reg + PLL_BASE);
886
887 return 0;
888}
889
890struct clk_ops tegra_plle_ops = {
891 .is_enabled = tegra20_pll_clk_is_enabled,
892 .enable = tegra20_plle_clk_enable,
893 .set_rate = tegra20_pll_clk_set_rate,
894 .recalc_rate = tegra20_pll_clk_recalc_rate,
895 .round_rate = tegra20_pll_clk_round_rate,
896};
897
898/* Clock divider ops */
899static int tegra20_pll_div_clk_is_enabled(struct clk_hw *hw)
900{
901 struct clk_tegra *c = to_clk_tegra(hw);
902 u32 val = clk_readl(c->reg);
903
904 val >>= c->reg_shift;
905 c->state = (val & PLL_OUT_CLKEN) ? ON : OFF;
906 if (!(val & PLL_OUT_RESET_DISABLE))
907 c->state = OFF;
908 return c->state;
909}
910
911static unsigned long tegra20_pll_div_clk_recalc_rate(struct clk_hw *hw,
912 unsigned long prate)
913{
914 struct clk_tegra *c = to_clk_tegra(hw);
915 u64 rate = prate;
916 u32 val = clk_readl(c->reg);
917 u32 divu71;
918
919 val >>= c->reg_shift;
920
921 if (c->flags & DIV_U71) {
922 divu71 = (val & PLL_OUT_RATIO_MASK) >> PLL_OUT_RATIO_SHIFT;
923 c->div = (divu71 + 2);
924 c->mul = 2;
925 } else if (c->flags & DIV_2) {
926 c->div = 2;
927 c->mul = 1;
928 } else {
929 c->div = 1;
930 c->mul = 1;
931 }
932
933 rate *= c->mul;
934 rate += c->div - 1; /* round up */
935 do_div(rate, c->div);
936
937 return rate;
938}
939
940static int tegra20_pll_div_clk_enable(struct clk_hw *hw)
941{
942 struct clk_tegra *c = to_clk_tegra(hw);
943 unsigned long flags;
944 u32 new_val;
945 u32 val;
946
947 pr_debug("%s: %s\n", __func__, __clk_get_name(hw->clk));
948
949 if (c->flags & DIV_U71) {
950 spin_lock_irqsave(&clock_register_lock, flags);
951 val = clk_readl(c->reg);
952 new_val = val >> c->reg_shift;
953 new_val &= 0xFFFF;
954
955 new_val |= PLL_OUT_CLKEN | PLL_OUT_RESET_DISABLE;
956
957 val &= ~(0xFFFF << c->reg_shift);
958 val |= new_val << c->reg_shift;
959 clk_writel(val, c->reg);
960 spin_unlock_irqrestore(&clock_register_lock, flags);
961 return 0;
962 } else if (c->flags & DIV_2) {
963 BUG_ON(!(c->flags & PLLD));
964 spin_lock_irqsave(&clock_register_lock, flags);
965 val = clk_readl(c->reg);
966 val &= ~PLLD_MISC_DIV_RST;
967 clk_writel(val, c->reg);
968 spin_unlock_irqrestore(&clock_register_lock, flags);
969 return 0;
970 }
971 return -EINVAL;
972}
973
974static void tegra20_pll_div_clk_disable(struct clk_hw *hw)
975{
976 struct clk_tegra *c = to_clk_tegra(hw);
977 unsigned long flags;
978 u32 new_val;
979 u32 val;
980
981 pr_debug("%s: %s\n", __func__, __clk_get_name(hw->clk));
982
983 if (c->flags & DIV_U71) {
984 spin_lock_irqsave(&clock_register_lock, flags);
985 val = clk_readl(c->reg);
986 new_val = val >> c->reg_shift;
987 new_val &= 0xFFFF;
988
989 new_val &= ~(PLL_OUT_CLKEN | PLL_OUT_RESET_DISABLE);
990
991 val &= ~(0xFFFF << c->reg_shift);
992 val |= new_val << c->reg_shift;
993 clk_writel(val, c->reg);
994 spin_unlock_irqrestore(&clock_register_lock, flags);
995 } else if (c->flags & DIV_2) {
996 BUG_ON(!(c->flags & PLLD));
997 spin_lock_irqsave(&clock_register_lock, flags);
998 val = clk_readl(c->reg);
999 val |= PLLD_MISC_DIV_RST;
1000 clk_writel(val, c->reg);
1001 spin_unlock_irqrestore(&clock_register_lock, flags);
1002 }
1003}
1004
1005static int tegra20_pll_div_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1006 unsigned long parent_rate)
1007{
1008 struct clk_tegra *c = to_clk_tegra(hw);
1009 unsigned long flags;
1010 int divider_u71;
1011 u32 new_val;
1012 u32 val;
1013
1014 pr_debug("%s: %s %lu\n", __func__, __clk_get_name(hw->clk), rate);
1015
1016 if (c->flags & DIV_U71) {
1017 divider_u71 = clk_div71_get_divider(parent_rate, rate);
1018 if (divider_u71 >= 0) {
1019 spin_lock_irqsave(&clock_register_lock, flags);
1020 val = clk_readl(c->reg);
1021 new_val = val >> c->reg_shift;
1022 new_val &= 0xFFFF;
1023 if (c->flags & DIV_U71_FIXED)
1024 new_val |= PLL_OUT_OVERRIDE;
1025 new_val &= ~PLL_OUT_RATIO_MASK;
1026 new_val |= divider_u71 << PLL_OUT_RATIO_SHIFT;
1027
1028 val &= ~(0xFFFF << c->reg_shift);
1029 val |= new_val << c->reg_shift;
1030 clk_writel(val, c->reg);
1031 c->div = divider_u71 + 2;
1032 c->mul = 2;
1033 spin_unlock_irqrestore(&clock_register_lock, flags);
1034 return 0;
1035 }
1036 } else if (c->flags & DIV_2) {
1037 if (parent_rate == rate * 2)
1038 return 0;
1039 }
1040 return -EINVAL;
1041}
1042
1043static long tegra20_pll_div_clk_round_rate(struct clk_hw *hw, unsigned long rate,
1044 unsigned long *prate)
1045{
1046 struct clk_tegra *c = to_clk_tegra(hw);
1047 unsigned long parent_rate = *prate;
1048 int divider;
1049
1050 pr_debug("%s: %s %lu\n", __func__, __clk_get_name(hw->clk), rate);
1051
1052 if (c->flags & DIV_U71) {
1053 divider = clk_div71_get_divider(parent_rate, rate);
1054 if (divider < 0)
1055 return divider;
1056 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
1057 } else if (c->flags & DIV_2) {
1058 return DIV_ROUND_UP(parent_rate, 2);
1059 }
1060 return -EINVAL;
1061}
1062
1063struct clk_ops tegra_pll_div_ops = {
1064 .is_enabled = tegra20_pll_div_clk_is_enabled,
1065 .enable = tegra20_pll_div_clk_enable,
1066 .disable = tegra20_pll_div_clk_disable,
1067 .set_rate = tegra20_pll_div_clk_set_rate,
1068 .round_rate = tegra20_pll_div_clk_round_rate,
1069 .recalc_rate = tegra20_pll_div_clk_recalc_rate,
1070};
1071
1072/* Periph clk ops */
1073
1074static int tegra20_periph_clk_is_enabled(struct clk_hw *hw)
1075{
1076 struct clk_tegra *c = to_clk_tegra(hw);
1077
1078 c->state = ON;
1079
1080 if (!c->u.periph.clk_num)
1081 goto out;
1082
1083 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
1084 PERIPH_CLK_TO_ENB_BIT(c)))
1085 c->state = OFF;
1086
1087 if (!(c->flags & PERIPH_NO_RESET))
1088 if (clk_readl(RST_DEVICES + PERIPH_CLK_TO_ENB_REG(c)) &
1089 PERIPH_CLK_TO_ENB_BIT(c))
1090 c->state = OFF;
1091
1092out:
1093 return c->state;
1094}
1095
1096static int tegra20_periph_clk_enable(struct clk_hw *hw)
1097{
1098 struct clk_tegra *c = to_clk_tegra(hw);
1099 unsigned long flags;
1100 u32 val;
1101
1102 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
1103
1104 if (!c->u.periph.clk_num)
1105 return 0;
1106
1107 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]++;
1108 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] > 1)
1109 return 0;
1110
1111 spin_lock_irqsave(&clock_register_lock, flags);
1112
1113 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1114 CLK_OUT_ENB_SET + PERIPH_CLK_TO_ENB_SET_REG(c));
1115 if (!(c->flags & PERIPH_NO_RESET) && !(c->flags & PERIPH_MANUAL_RESET))
1116 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1117 RST_DEVICES_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1118 if (c->flags & PERIPH_EMC_ENB) {
1119 /* The EMC peripheral clock has 2 extra enable bits */
1120 /* FIXME: Do they need to be disabled? */
1121 val = clk_readl(c->reg);
1122 val |= 0x3 << 24;
1123 clk_writel(val, c->reg);
1124 }
1125
1126 spin_unlock_irqrestore(&clock_register_lock, flags);
1127
1128 return 0;
1129}
1130
1131static void tegra20_periph_clk_disable(struct clk_hw *hw)
1132{
1133 struct clk_tegra *c = to_clk_tegra(hw);
1134 unsigned long flags;
1135
1136 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
1137
1138 if (!c->u.periph.clk_num)
1139 return;
1140
1141 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]--;
1142
1143 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] > 0)
1144 return;
1145
1146 spin_lock_irqsave(&clock_register_lock, flags);
1147
1148 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1149 CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1150
1151 spin_unlock_irqrestore(&clock_register_lock, flags);
1152}
1153
1154void tegra2_periph_clk_reset(struct clk_hw *hw, bool assert)
1155{
1156 struct clk_tegra *c = to_clk_tegra(hw);
1157 unsigned long base = assert ? RST_DEVICES_SET : RST_DEVICES_CLR;
1158
1159 pr_debug("%s %s on clock %s\n", __func__,
1160 assert ? "assert" : "deassert", __clk_get_name(hw->clk));
1161
1162 BUG_ON(!c->u.periph.clk_num);
1163
1164 if (!(c->flags & PERIPH_NO_RESET))
1165 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1166 base + PERIPH_CLK_TO_ENB_SET_REG(c));
1167}
1168
1169static int tegra20_periph_clk_set_parent(struct clk_hw *hw, u8 index)
1170{
1171 struct clk_tegra *c = to_clk_tegra(hw);
1172 u32 val;
1173 u32 mask;
1174 u32 shift;
1175
1176 pr_debug("%s: %s %d\n", __func__, __clk_get_name(hw->clk), index);
1177
1178 if (c->flags & MUX_PWM) {
1179 shift = PERIPH_CLK_SOURCE_PWM_SHIFT;
1180 mask = PERIPH_CLK_SOURCE_PWM_MASK;
1181 } else {
1182 shift = PERIPH_CLK_SOURCE_SHIFT;
1183 mask = PERIPH_CLK_SOURCE_MASK;
1184 }
1185
1186 val = clk_readl(c->reg);
1187 val &= ~mask;
1188 val |= (index) << shift;
1189
1190 clk_writel(val, c->reg);
1191
1192 return 0;
1193}
1194
1195static u8 tegra20_periph_clk_get_parent(struct clk_hw *hw)
1196{
1197 struct clk_tegra *c = to_clk_tegra(hw);
1198 u32 val = clk_readl(c->reg);
1199 u32 mask;
1200 u32 shift;
1201
1202 if (c->flags & MUX_PWM) {
1203 shift = PERIPH_CLK_SOURCE_PWM_SHIFT;
1204 mask = PERIPH_CLK_SOURCE_PWM_MASK;
1205 } else {
1206 shift = PERIPH_CLK_SOURCE_SHIFT;
1207 mask = PERIPH_CLK_SOURCE_MASK;
1208 }
1209
1210 if (c->flags & MUX)
1211 return (val & mask) >> shift;
1212 else
1213 return 0;
1214}
1215
1216static unsigned long tegra20_periph_clk_recalc_rate(struct clk_hw *hw,
1217 unsigned long prate)
1218{
1219 struct clk_tegra *c = to_clk_tegra(hw);
1220 unsigned long rate = prate;
1221 u32 val = clk_readl(c->reg);
1222
1223 if (c->flags & DIV_U71) {
1224 u32 divu71 = val & PERIPH_CLK_SOURCE_DIVU71_MASK;
1225 c->div = divu71 + 2;
1226 c->mul = 2;
1227 } else if (c->flags & DIV_U16) {
1228 u32 divu16 = val & PERIPH_CLK_SOURCE_DIVU16_MASK;
1229 c->div = divu16 + 1;
1230 c->mul = 1;
1231 } else {
1232 c->div = 1;
1233 c->mul = 1;
1234 return rate;
1235 }
1236
1237 if (c->mul != 0 && c->div != 0) {
1238 rate *= c->mul;
1239 rate += c->div - 1; /* round up */
1240 do_div(rate, c->div);
1241 }
1242
1243 return rate;
1244}
1245
1246static int tegra20_periph_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1247 unsigned long parent_rate)
1248{
1249 struct clk_tegra *c = to_clk_tegra(hw);
1250 u32 val;
1251 int divider;
1252
1253 val = clk_readl(c->reg);
1254
1255 if (c->flags & DIV_U71) {
1256 divider = clk_div71_get_divider(parent_rate, rate);
1257
1258 if (divider >= 0) {
1259 val = clk_readl(c->reg);
1260 val &= ~PERIPH_CLK_SOURCE_DIVU71_MASK;
1261 val |= divider;
1262 clk_writel(val, c->reg);
1263 c->div = divider + 2;
1264 c->mul = 2;
1265 return 0;
1266 }
1267 } else if (c->flags & DIV_U16) {
1268 divider = clk_div16_get_divider(parent_rate, rate);
1269 if (divider >= 0) {
1270 val = clk_readl(c->reg);
1271 val &= ~PERIPH_CLK_SOURCE_DIVU16_MASK;
1272 val |= divider;
1273 clk_writel(val, c->reg);
1274 c->div = divider + 1;
1275 c->mul = 1;
1276 return 0;
1277 }
1278 } else if (parent_rate <= rate) {
1279 c->div = 1;
1280 c->mul = 1;
1281 return 0;
1282 }
1283
1284 return -EINVAL;
1285}
1286
1287static long tegra20_periph_clk_round_rate(struct clk_hw *hw,
1288 unsigned long rate, unsigned long *prate)
1289{
1290 struct clk_tegra *c = to_clk_tegra(hw);
1291 unsigned long parent_rate = __clk_get_rate(__clk_get_parent(hw->clk));
1292 int divider;
1293
1294 pr_debug("%s: %s %lu\n", __func__, __clk_get_name(hw->clk), rate);
1295
1296 if (prate)
1297 parent_rate = *prate;
1298
1299 if (c->flags & DIV_U71) {
1300 divider = clk_div71_get_divider(parent_rate, rate);
1301 if (divider < 0)
1302 return divider;
1303
1304 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
1305 } else if (c->flags & DIV_U16) {
1306 divider = clk_div16_get_divider(parent_rate, rate);
1307 if (divider < 0)
1308 return divider;
1309 return DIV_ROUND_UP(parent_rate, divider + 1);
1310 }
1311 return -EINVAL;
1312}
1313
1314struct clk_ops tegra_periph_clk_ops = {
1315 .is_enabled = tegra20_periph_clk_is_enabled,
1316 .enable = tegra20_periph_clk_enable,
1317 .disable = tegra20_periph_clk_disable,
1318 .set_parent = tegra20_periph_clk_set_parent,
1319 .get_parent = tegra20_periph_clk_get_parent,
1320 .set_rate = tegra20_periph_clk_set_rate,
1321 .round_rate = tegra20_periph_clk_round_rate,
1322 .recalc_rate = tegra20_periph_clk_recalc_rate,
1323};
1324
1325/* External memory controller clock ops */
1326static void tegra20_emc_clk_init(struct clk_hw *hw)
1327{
1328 struct clk_tegra *c = to_clk_tegra(hw);
1329 c->max_rate = __clk_get_rate(hw->clk);
1330}
1331
1332static long tegra20_emc_clk_round_rate(struct clk_hw *hw, unsigned long rate,
1333 unsigned long *prate)
1334{
1335 struct clk_tegra *c = to_clk_tegra(hw);
1336 long emc_rate;
1337 long clk_rate;
1338
1339 /*
1340 * The slowest entry in the EMC clock table that is at least as
1341 * fast as rate.
1342 */
1343 emc_rate = tegra_emc_round_rate(rate);
1344 if (emc_rate < 0)
1345 return c->max_rate;
1346
1347 /*
1348 * The fastest rate the PLL will generate that is at most the
1349 * requested rate.
1350 */
1351 clk_rate = tegra20_periph_clk_round_rate(hw, emc_rate, NULL);
1352
1353 /*
1354 * If this fails, and emc_rate > clk_rate, it's because the maximum
1355 * rate in the EMC tables is larger than the maximum rate of the EMC
1356 * clock. The EMC clock's max rate is the rate it was running when the
1357 * kernel booted. Such a mismatch is probably due to using the wrong
1358 * BCT, i.e. using a Tegra20 BCT with an EMC table written for Tegra25.
1359 */
1360 WARN_ONCE(emc_rate != clk_rate,
1361 "emc_rate %ld != clk_rate %ld",
1362 emc_rate, clk_rate);
1363
1364 return emc_rate;
1365}
1366
1367static int tegra20_emc_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1368 unsigned long parent_rate)
1369{
1370 int ret;
1371
1372 /*
1373 * The Tegra2 memory controller has an interlock with the clock
1374 * block that allows memory shadowed registers to be updated,
1375 * and then transfer them to the main registers at the same
1376 * time as the clock update without glitches.
1377 */
1378 ret = tegra_emc_set_rate(rate);
1379 if (ret < 0)
1380 return ret;
1381
1382 ret = tegra20_periph_clk_set_rate(hw, rate, parent_rate);
1383 udelay(1);
1384
1385 return ret;
1386}
1387
1388struct clk_ops tegra_emc_clk_ops = {
1389 .init = tegra20_emc_clk_init,
1390 .is_enabled = tegra20_periph_clk_is_enabled,
1391 .enable = tegra20_periph_clk_enable,
1392 .disable = tegra20_periph_clk_disable,
1393 .set_parent = tegra20_periph_clk_set_parent,
1394 .get_parent = tegra20_periph_clk_get_parent,
1395 .set_rate = tegra20_emc_clk_set_rate,
1396 .round_rate = tegra20_emc_clk_round_rate,
1397 .recalc_rate = tegra20_periph_clk_recalc_rate,
1398};
1399
1400/* Clock doubler ops */
1401static int tegra20_clk_double_is_enabled(struct clk_hw *hw)
1402{
1403 struct clk_tegra *c = to_clk_tegra(hw);
1404
1405 c->state = ON;
1406
1407 if (!c->u.periph.clk_num)
1408 goto out;
1409
1410 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
1411 PERIPH_CLK_TO_ENB_BIT(c)))
1412 c->state = OFF;
1413
1414out:
1415 return c->state;
1416};
1417
1418static unsigned long tegra20_clk_double_recalc_rate(struct clk_hw *hw,
1419 unsigned long prate)
1420{
1421 struct clk_tegra *c = to_clk_tegra(hw);
1422 u64 rate = prate;
1423
1424 c->mul = 2;
1425 c->div = 1;
1426
1427 rate *= c->mul;
1428 rate += c->div - 1; /* round up */
1429 do_div(rate, c->div);
1430
1431 return rate;
1432}
1433
1434static long tegra20_clk_double_round_rate(struct clk_hw *hw, unsigned long rate,
1435 unsigned long *prate)
1436{
1437 unsigned long output_rate = *prate;
1438
1439 do_div(output_rate, 2);
1440 return output_rate;
1441}
1442
1443static int tegra20_clk_double_set_rate(struct clk_hw *hw, unsigned long rate,
1444 unsigned long parent_rate)
1445{
1446 if (rate != 2 * parent_rate)
1447 return -EINVAL;
1448 return 0;
1449}
1450
1451struct clk_ops tegra_clk_double_ops = {
1452 .is_enabled = tegra20_clk_double_is_enabled,
1453 .enable = tegra20_periph_clk_enable,
1454 .disable = tegra20_periph_clk_disable,
1455 .set_rate = tegra20_clk_double_set_rate,
1456 .recalc_rate = tegra20_clk_double_recalc_rate,
1457 .round_rate = tegra20_clk_double_round_rate,
1458};
1459
1460/* Audio sync clock ops */
1461static int tegra20_audio_sync_clk_is_enabled(struct clk_hw *hw)
1462{
1463 struct clk_tegra *c = to_clk_tegra(hw);
1464 u32 val = clk_readl(c->reg);
1465
1466 c->state = (val & (1<<4)) ? OFF : ON;
1467 return c->state;
1468}
1469
1470static int tegra20_audio_sync_clk_enable(struct clk_hw *hw)
1471{
1472 struct clk_tegra *c = to_clk_tegra(hw);
1473
1474 clk_writel(0, c->reg);
1475 return 0;
1476}
1477
1478static void tegra20_audio_sync_clk_disable(struct clk_hw *hw)
1479{
1480 struct clk_tegra *c = to_clk_tegra(hw);
1481 clk_writel(1, c->reg);
1482}
1483
1484static u8 tegra20_audio_sync_clk_get_parent(struct clk_hw *hw)
1485{
1486 struct clk_tegra *c = to_clk_tegra(hw);
1487 u32 val = clk_readl(c->reg);
1488 int source;
1489
1490 source = val & 0xf;
1491 return source;
1492}
1493
1494static int tegra20_audio_sync_clk_set_parent(struct clk_hw *hw, u8 index)
1495{
1496 struct clk_tegra *c = to_clk_tegra(hw);
1497 u32 val;
1498
1499 val = clk_readl(c->reg);
1500 val &= ~0xf;
1501 val |= index;
1502
1503 clk_writel(val, c->reg);
1504
1505 return 0;
1506}
1507
1508struct clk_ops tegra_audio_sync_clk_ops = {
1509 .is_enabled = tegra20_audio_sync_clk_is_enabled,
1510 .enable = tegra20_audio_sync_clk_enable,
1511 .disable = tegra20_audio_sync_clk_disable,
1512 .set_parent = tegra20_audio_sync_clk_set_parent,
1513 .get_parent = tegra20_audio_sync_clk_get_parent,
1514};
1515
1516/* cdev1 and cdev2 (dap_mclk1 and dap_mclk2) ops */
1517
1518static int tegra20_cdev_clk_is_enabled(struct clk_hw *hw)
1519{
1520 struct clk_tegra *c = to_clk_tegra(hw);
1521 /* We could un-tristate the cdev1 or cdev2 pingroup here; this is
1522 * currently done in the pinmux code. */
1523 c->state = ON;
1524
1525 BUG_ON(!c->u.periph.clk_num);
1526
1527 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
1528 PERIPH_CLK_TO_ENB_BIT(c)))
1529 c->state = OFF;
1530 return c->state;
1531}
1532
1533static int tegra20_cdev_clk_enable(struct clk_hw *hw)
1534{
1535 struct clk_tegra *c = to_clk_tegra(hw);
1536 BUG_ON(!c->u.periph.clk_num);
1537
1538 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1539 CLK_OUT_ENB_SET + PERIPH_CLK_TO_ENB_SET_REG(c));
1540 return 0;
1541}
1542
1543static void tegra20_cdev_clk_disable(struct clk_hw *hw)
1544{
1545 struct clk_tegra *c = to_clk_tegra(hw);
1546 BUG_ON(!c->u.periph.clk_num);
1547
1548 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1549 CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1550}
1551
1552static unsigned long tegra20_cdev_recalc_rate(struct clk_hw *hw,
1553 unsigned long prate)
1554{
1555 return to_clk_tegra(hw)->fixed_rate;
1556}
1557
1558struct clk_ops tegra_cdev_clk_ops = {
1559 .is_enabled = tegra20_cdev_clk_is_enabled,
1560 .enable = tegra20_cdev_clk_enable,
1561 .disable = tegra20_cdev_clk_disable,
1562 .recalc_rate = tegra20_cdev_recalc_rate,
1563};
1564
1565/* Tegra20 CPU clock and reset control functions */
1566static void tegra20_wait_cpu_in_reset(u32 cpu)
1567{
1568 unsigned int reg;
1569
1570 do {
1571 reg = readl(reg_clk_base +
1572 TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET);
1573 cpu_relax();
1574 } while (!(reg & (1 << cpu))); /* check CPU been reset or not */
1575
1576 return;
1577}
1578
1579static void tegra20_put_cpu_in_reset(u32 cpu)
1580{
1581 writel(CPU_RESET(cpu),
1582 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET);
1583 dmb();
1584}
1585
1586static void tegra20_cpu_out_of_reset(u32 cpu)
1587{
1588 writel(CPU_RESET(cpu),
1589 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR);
1590 wmb();
1591}
1592
1593static void tegra20_enable_cpu_clock(u32 cpu)
1594{
1595 unsigned int reg;
1596
1597 reg = readl(reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1598 writel(reg & ~CPU_CLOCK(cpu),
1599 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1600 barrier();
1601 reg = readl(reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1602}
1603
1604static void tegra20_disable_cpu_clock(u32 cpu)
1605{
1606 unsigned int reg;
1607
1608 reg = readl(reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1609 writel(reg | CPU_CLOCK(cpu),
1610 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1611}
1612
1613static struct tegra_cpu_car_ops tegra20_cpu_car_ops = {
1614 .wait_for_reset = tegra20_wait_cpu_in_reset,
1615 .put_in_reset = tegra20_put_cpu_in_reset,
1616 .out_of_reset = tegra20_cpu_out_of_reset,
1617 .enable_clock = tegra20_enable_cpu_clock,
1618 .disable_clock = tegra20_disable_cpu_clock,
1619};
1620
1621void __init tegra20_cpu_car_ops_init(void)
1622{
1623 tegra_cpu_car_ops = &tegra20_cpu_car_ops;
1624}
diff --git a/arch/arm/mach-tegra/tegra20_clocks.h b/arch/arm/mach-tegra/tegra20_clocks.h
new file mode 100644
index 00000000000..8bfd31bcc49
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra20_clocks.h
@@ -0,0 +1,42 @@
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
new file mode 100644
index 00000000000..cc9b5fd8c3d
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra20_clocks_data.c
@@ -0,0 +1,1139 @@
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 <mach/iomap.h>
31
32#include "clock.h"
33#include "fuse.h"
34#include "tegra2_emc.h"
35#include "tegra20_clocks.h"
36#include "tegra_cpu_car.h"
37
38/* Clock definitions */
39
40#define DEFINE_CLK_TEGRA(_name, _rate, _ops, _flags, \
41 _parent_names, _parents, _parent) \
42 static struct clk tegra_##_name = { \
43 .hw = &tegra_##_name##_hw.hw, \
44 .name = #_name, \
45 .rate = _rate, \
46 .ops = _ops, \
47 .flags = _flags, \
48 .parent_names = _parent_names, \
49 .parents = _parents, \
50 .num_parents = ARRAY_SIZE(_parent_names), \
51 .parent = _parent, \
52 };
53
54static struct clk tegra_clk_32k;
55static struct clk_tegra tegra_clk_32k_hw = {
56 .hw = {
57 .clk = &tegra_clk_32k,
58 },
59 .fixed_rate = 32768,
60};
61
62static struct clk tegra_clk_32k = {
63 .name = "clk_32k",
64 .rate = 32768,
65 .ops = &tegra_clk_32k_ops,
66 .hw = &tegra_clk_32k_hw.hw,
67 .flags = CLK_IS_ROOT,
68};
69
70static struct clk tegra_clk_m;
71static struct clk_tegra tegra_clk_m_hw = {
72 .hw = {
73 .clk = &tegra_clk_m,
74 },
75 .flags = ENABLE_ON_INIT,
76 .reg = 0x1fc,
77 .reg_shift = 28,
78 .max_rate = 26000000,
79 .fixed_rate = 0,
80};
81
82static struct clk tegra_clk_m = {
83 .name = "clk_m",
84 .ops = &tegra_clk_m_ops,
85 .hw = &tegra_clk_m_hw.hw,
86 .flags = CLK_IS_ROOT,
87};
88
89#define DEFINE_PLL(_name, _flags, _reg, _max_rate, _input_min, \
90 _input_max, _cf_min, _cf_max, _vco_min, \
91 _vco_max, _freq_table, _lock_delay, _ops, \
92 _fixed_rate, _parent) \
93 static const char *tegra_##_name##_parent_names[] = { \
94 #_parent, \
95 }; \
96 static struct clk *tegra_##_name##_parents[] = { \
97 &tegra_##_parent, \
98 }; \
99 static struct clk tegra_##_name; \
100 static struct clk_tegra tegra_##_name##_hw = { \
101 .hw = { \
102 .clk = &tegra_##_name, \
103 }, \
104 .flags = _flags, \
105 .reg = _reg, \
106 .max_rate = _max_rate, \
107 .u.pll = { \
108 .input_min = _input_min, \
109 .input_max = _input_max, \
110 .cf_min = _cf_min, \
111 .cf_max = _cf_max, \
112 .vco_min = _vco_min, \
113 .vco_max = _vco_max, \
114 .freq_table = _freq_table, \
115 .lock_delay = _lock_delay, \
116 .fixed_rate = _fixed_rate, \
117 }, \
118 }; \
119 static struct clk tegra_##_name = { \
120 .name = #_name, \
121 .ops = &_ops, \
122 .hw = &tegra_##_name##_hw.hw, \
123 .parent = &tegra_##_parent, \
124 .parent_names = tegra_##_name##_parent_names, \
125 .parents = tegra_##_name##_parents, \
126 .num_parents = 1, \
127 };
128
129#define DEFINE_PLL_OUT(_name, _flags, _reg, _reg_shift, \
130 _max_rate, _ops, _parent, _clk_flags) \
131 static const char *tegra_##_name##_parent_names[] = { \
132 #_parent, \
133 }; \
134 static struct clk *tegra_##_name##_parents[] = { \
135 &tegra_##_parent, \
136 }; \
137 static struct clk tegra_##_name; \
138 static struct clk_tegra tegra_##_name##_hw = { \
139 .hw = { \
140 .clk = &tegra_##_name, \
141 }, \
142 .flags = _flags, \
143 .reg = _reg, \
144 .max_rate = _max_rate, \
145 .reg_shift = _reg_shift, \
146 }; \
147 static struct clk tegra_##_name = { \
148 .name = #_name, \
149 .ops = &tegra_pll_div_ops, \
150 .hw = &tegra_##_name##_hw.hw, \
151 .parent = &tegra_##_parent, \
152 .parent_names = tegra_##_name##_parent_names, \
153 .parents = tegra_##_name##_parents, \
154 .num_parents = 1, \
155 .flags = _clk_flags, \
156 };
157
158
159static struct clk_pll_freq_table tegra_pll_s_freq_table[] = {
160 {32768, 12000000, 366, 1, 1, 0},
161 {32768, 13000000, 397, 1, 1, 0},
162 {32768, 19200000, 586, 1, 1, 0},
163 {32768, 26000000, 793, 1, 1, 0},
164 {0, 0, 0, 0, 0, 0},
165};
166
167DEFINE_PLL(pll_s, PLL_ALT_MISC_REG, 0xf0, 26000000, 32768, 32768, 0,
168 0, 12000000, 26000000, tegra_pll_s_freq_table, 300,
169 tegra_pll_ops, 0, clk_32k);
170
171static struct clk_pll_freq_table tegra_pll_c_freq_table[] = {
172 { 12000000, 600000000, 600, 12, 1, 8 },
173 { 13000000, 600000000, 600, 13, 1, 8 },
174 { 19200000, 600000000, 500, 16, 1, 6 },
175 { 26000000, 600000000, 600, 26, 1, 8 },
176 { 0, 0, 0, 0, 0, 0 },
177};
178
179DEFINE_PLL(pll_c, PLL_HAS_CPCON, 0x80, 600000000, 2000000, 31000000, 1000000,
180 6000000, 20000000, 1400000000, tegra_pll_c_freq_table, 300,
181 tegra_pll_ops, 0, clk_m);
182
183DEFINE_PLL_OUT(pll_c_out1, DIV_U71, 0x84, 0, 600000000,
184 tegra_pll_div_ops, pll_c, 0);
185
186static struct clk_pll_freq_table tegra_pll_m_freq_table[] = {
187 { 12000000, 666000000, 666, 12, 1, 8},
188 { 13000000, 666000000, 666, 13, 1, 8},
189 { 19200000, 666000000, 555, 16, 1, 8},
190 { 26000000, 666000000, 666, 26, 1, 8},
191 { 12000000, 600000000, 600, 12, 1, 8},
192 { 13000000, 600000000, 600, 13, 1, 8},
193 { 19200000, 600000000, 375, 12, 1, 6},
194 { 26000000, 600000000, 600, 26, 1, 8},
195 { 0, 0, 0, 0, 0, 0 },
196};
197
198DEFINE_PLL(pll_m, PLL_HAS_CPCON, 0x90, 800000000, 2000000, 31000000, 1000000,
199 6000000, 20000000, 1200000000, tegra_pll_m_freq_table, 300,
200 tegra_pll_ops, 0, clk_m);
201
202DEFINE_PLL_OUT(pll_m_out1, DIV_U71, 0x94, 0, 600000000,
203 tegra_pll_div_ops, pll_m, 0);
204
205static struct clk_pll_freq_table tegra_pll_p_freq_table[] = {
206 { 12000000, 216000000, 432, 12, 2, 8},
207 { 13000000, 216000000, 432, 13, 2, 8},
208 { 19200000, 216000000, 90, 4, 2, 1},
209 { 26000000, 216000000, 432, 26, 2, 8},
210 { 12000000, 432000000, 432, 12, 1, 8},
211 { 13000000, 432000000, 432, 13, 1, 8},
212 { 19200000, 432000000, 90, 4, 1, 1},
213 { 26000000, 432000000, 432, 26, 1, 8},
214 { 0, 0, 0, 0, 0, 0 },
215};
216
217
218DEFINE_PLL(pll_p, ENABLE_ON_INIT | PLL_FIXED | PLL_HAS_CPCON, 0xa0, 432000000,
219 2000000, 31000000, 1000000, 6000000, 20000000, 1400000000,
220 tegra_pll_p_freq_table, 300, tegra_pll_ops, 216000000, clk_m);
221
222DEFINE_PLL_OUT(pll_p_out1, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa4, 0,
223 432000000, tegra_pll_div_ops, pll_p, 0);
224DEFINE_PLL_OUT(pll_p_out2, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa4, 16,
225 432000000, tegra_pll_div_ops, pll_p, 0);
226DEFINE_PLL_OUT(pll_p_out3, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa8, 0,
227 432000000, tegra_pll_div_ops, pll_p, 0);
228DEFINE_PLL_OUT(pll_p_out4, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa8, 16,
229 432000000, tegra_pll_div_ops, pll_p, 0);
230
231static struct clk_pll_freq_table tegra_pll_a_freq_table[] = {
232 { 28800000, 56448000, 49, 25, 1, 1},
233 { 28800000, 73728000, 64, 25, 1, 1},
234 { 28800000, 24000000, 5, 6, 1, 1},
235 { 0, 0, 0, 0, 0, 0 },
236};
237
238DEFINE_PLL(pll_a, PLL_HAS_CPCON, 0xb0, 73728000, 2000000, 31000000, 1000000,
239 6000000, 20000000, 1400000000, tegra_pll_a_freq_table, 300,
240 tegra_pll_ops, 0, pll_p_out1);
241
242DEFINE_PLL_OUT(pll_a_out0, DIV_U71, 0xb4, 0, 73728000,
243 tegra_pll_div_ops, pll_a, 0);
244
245static struct clk_pll_freq_table tegra_pll_d_freq_table[] = {
246 { 12000000, 216000000, 216, 12, 1, 4},
247 { 13000000, 216000000, 216, 13, 1, 4},
248 { 19200000, 216000000, 135, 12, 1, 3},
249 { 26000000, 216000000, 216, 26, 1, 4},
250
251 { 12000000, 594000000, 594, 12, 1, 8},
252 { 13000000, 594000000, 594, 13, 1, 8},
253 { 19200000, 594000000, 495, 16, 1, 8},
254 { 26000000, 594000000, 594, 26, 1, 8},
255
256 { 12000000, 1000000000, 1000, 12, 1, 12},
257 { 13000000, 1000000000, 1000, 13, 1, 12},
258 { 19200000, 1000000000, 625, 12, 1, 8},
259 { 26000000, 1000000000, 1000, 26, 1, 12},
260
261 { 0, 0, 0, 0, 0, 0 },
262};
263
264DEFINE_PLL(pll_d, PLL_HAS_CPCON | PLLD, 0xd0, 1000000000, 2000000, 40000000,
265 1000000, 6000000, 40000000, 1000000000, tegra_pll_d_freq_table,
266 1000, tegra_pll_ops, 0, clk_m);
267
268DEFINE_PLL_OUT(pll_d_out0, DIV_2 | PLLD, 0, 0, 500000000,
269 tegra_pll_div_ops, pll_d, CLK_SET_RATE_PARENT);
270
271static struct clk_pll_freq_table tegra_pll_u_freq_table[] = {
272 { 12000000, 480000000, 960, 12, 2, 0},
273 { 13000000, 480000000, 960, 13, 2, 0},
274 { 19200000, 480000000, 200, 4, 2, 0},
275 { 26000000, 480000000, 960, 26, 2, 0},
276 { 0, 0, 0, 0, 0, 0 },
277};
278
279DEFINE_PLL(pll_u, PLLU, 0xc0, 480000000, 2000000, 40000000, 1000000, 6000000,
280 48000000, 960000000, tegra_pll_u_freq_table, 1000,
281 tegra_pll_ops, 0, clk_m);
282
283static struct clk_pll_freq_table tegra_pll_x_freq_table[] = {
284 /* 1 GHz */
285 { 12000000, 1000000000, 1000, 12, 1, 12},
286 { 13000000, 1000000000, 1000, 13, 1, 12},
287 { 19200000, 1000000000, 625, 12, 1, 8},
288 { 26000000, 1000000000, 1000, 26, 1, 12},
289
290 /* 912 MHz */
291 { 12000000, 912000000, 912, 12, 1, 12},
292 { 13000000, 912000000, 912, 13, 1, 12},
293 { 19200000, 912000000, 760, 16, 1, 8},
294 { 26000000, 912000000, 912, 26, 1, 12},
295
296 /* 816 MHz */
297 { 12000000, 816000000, 816, 12, 1, 12},
298 { 13000000, 816000000, 816, 13, 1, 12},
299 { 19200000, 816000000, 680, 16, 1, 8},
300 { 26000000, 816000000, 816, 26, 1, 12},
301
302 /* 760 MHz */
303 { 12000000, 760000000, 760, 12, 1, 12},
304 { 13000000, 760000000, 760, 13, 1, 12},
305 { 19200000, 760000000, 950, 24, 1, 8},
306 { 26000000, 760000000, 760, 26, 1, 12},
307
308 /* 750 MHz */
309 { 12000000, 750000000, 750, 12, 1, 12},
310 { 13000000, 750000000, 750, 13, 1, 12},
311 { 19200000, 750000000, 625, 16, 1, 8},
312 { 26000000, 750000000, 750, 26, 1, 12},
313
314 /* 608 MHz */
315 { 12000000, 608000000, 608, 12, 1, 12},
316 { 13000000, 608000000, 608, 13, 1, 12},
317 { 19200000, 608000000, 380, 12, 1, 8},
318 { 26000000, 608000000, 608, 26, 1, 12},
319
320 /* 456 MHz */
321 { 12000000, 456000000, 456, 12, 1, 12},
322 { 13000000, 456000000, 456, 13, 1, 12},
323 { 19200000, 456000000, 380, 16, 1, 8},
324 { 26000000, 456000000, 456, 26, 1, 12},
325
326 /* 312 MHz */
327 { 12000000, 312000000, 312, 12, 1, 12},
328 { 13000000, 312000000, 312, 13, 1, 12},
329 { 19200000, 312000000, 260, 16, 1, 8},
330 { 26000000, 312000000, 312, 26, 1, 12},
331
332 { 0, 0, 0, 0, 0, 0 },
333};
334
335DEFINE_PLL(pll_x, PLL_HAS_CPCON | PLL_ALT_MISC_REG, 0xe0, 1000000000, 2000000,
336 31000000, 1000000, 6000000, 20000000, 1200000000,
337 tegra_pll_x_freq_table, 300, tegra_pllx_ops, 0, clk_m);
338
339static struct clk_pll_freq_table tegra_pll_e_freq_table[] = {
340 { 12000000, 100000000, 200, 24, 1, 0 },
341 { 0, 0, 0, 0, 0, 0 },
342};
343
344DEFINE_PLL(pll_e, PLL_ALT_MISC_REG, 0xe8, 100000000, 12000000, 12000000, 0, 0,
345 0, 0, tegra_pll_e_freq_table, 0, tegra_plle_ops, 0, clk_m);
346
347static const char *tegra_common_parent_names[] = {
348 "clk_m",
349};
350
351static struct clk *tegra_common_parents[] = {
352 &tegra_clk_m,
353};
354
355static struct clk tegra_clk_d;
356static struct clk_tegra tegra_clk_d_hw = {
357 .hw = {
358 .clk = &tegra_clk_d,
359 },
360 .flags = PERIPH_NO_RESET,
361 .reg = 0x34,
362 .reg_shift = 12,
363 .max_rate = 52000000,
364 .u.periph = {
365 .clk_num = 90,
366 },
367};
368
369static struct clk tegra_clk_d = {
370 .name = "clk_d",
371 .hw = &tegra_clk_d_hw.hw,
372 .ops = &tegra_clk_double_ops,
373 .parent = &tegra_clk_m,
374 .parent_names = tegra_common_parent_names,
375 .parents = tegra_common_parents,
376 .num_parents = ARRAY_SIZE(tegra_common_parent_names),
377};
378
379static struct clk tegra_cdev1;
380static struct clk_tegra tegra_cdev1_hw = {
381 .hw = {
382 .clk = &tegra_cdev1,
383 },
384 .fixed_rate = 26000000,
385 .u.periph = {
386 .clk_num = 94,
387 },
388};
389static struct clk tegra_cdev1 = {
390 .name = "cdev1",
391 .hw = &tegra_cdev1_hw.hw,
392 .ops = &tegra_cdev_clk_ops,
393 .flags = CLK_IS_ROOT,
394};
395
396/* dap_mclk2, belongs to the cdev2 pingroup. */
397static struct clk tegra_cdev2;
398static struct clk_tegra tegra_cdev2_hw = {
399 .hw = {
400 .clk = &tegra_cdev2,
401 },
402 .fixed_rate = 26000000,
403 .u.periph = {
404 .clk_num = 93,
405 },
406};
407static struct clk tegra_cdev2 = {
408 .name = "cdev2",
409 .hw = &tegra_cdev2_hw.hw,
410 .ops = &tegra_cdev_clk_ops,
411 .flags = CLK_IS_ROOT,
412};
413
414/* initialized before peripheral clocks */
415static struct clk_mux_sel mux_audio_sync_clk[8+1];
416static const struct audio_sources {
417 const char *name;
418 int value;
419} mux_audio_sync_clk_sources[] = {
420 { .name = "spdif_in", .value = 0 },
421 { .name = "i2s1", .value = 1 },
422 { .name = "i2s2", .value = 2 },
423 { .name = "pll_a_out0", .value = 4 },
424#if 0 /* FIXME: not implemented */
425 { .name = "ac97", .value = 3 },
426 { .name = "ext_audio_clk2", .value = 5 },
427 { .name = "ext_audio_clk1", .value = 6 },
428 { .name = "ext_vimclk", .value = 7 },
429#endif
430 { NULL, 0 }
431};
432
433static const char *audio_parent_names[] = {
434 "spdif_in",
435 "i2s1",
436 "i2s2",
437 "dummy",
438 "pll_a_out0",
439 "dummy",
440 "dummy",
441 "dummy",
442};
443
444static struct clk *audio_parents[] = {
445 NULL,
446 NULL,
447 NULL,
448 NULL,
449 NULL,
450 NULL,
451 NULL,
452 NULL,
453};
454
455static struct clk tegra_audio;
456static struct clk_tegra tegra_audio_hw = {
457 .hw = {
458 .clk = &tegra_audio,
459 },
460 .reg = 0x38,
461 .max_rate = 73728000,
462};
463DEFINE_CLK_TEGRA(audio, 0, &tegra_audio_sync_clk_ops, 0, audio_parent_names,
464 audio_parents, NULL);
465
466static const char *audio_2x_parent_names[] = {
467 "audio",
468};
469
470static struct clk *audio_2x_parents[] = {
471 &tegra_audio,
472};
473
474static struct clk tegra_audio_2x;
475static struct clk_tegra tegra_audio_2x_hw = {
476 .hw = {
477 .clk = &tegra_audio_2x,
478 },
479 .flags = PERIPH_NO_RESET,
480 .max_rate = 48000000,
481 .reg = 0x34,
482 .reg_shift = 8,
483 .u.periph = {
484 .clk_num = 89,
485 },
486};
487DEFINE_CLK_TEGRA(audio_2x, 0, &tegra_clk_double_ops, 0, audio_2x_parent_names,
488 audio_2x_parents, &tegra_audio);
489
490static struct clk_lookup tegra_audio_clk_lookups[] = {
491 { .con_id = "audio", .clk = &tegra_audio },
492 { .con_id = "audio_2x", .clk = &tegra_audio_2x }
493};
494
495/* This is called after peripheral clocks are initialized, as the
496 * audio_sync clock depends on some of the peripheral clocks.
497 */
498
499static void init_audio_sync_clock_mux(void)
500{
501 int i;
502 struct clk_mux_sel *sel = mux_audio_sync_clk;
503 const struct audio_sources *src = mux_audio_sync_clk_sources;
504 struct clk_lookup *lookup;
505
506 for (i = 0; src->name; i++, sel++, src++) {
507 sel->input = tegra_get_clock_by_name(src->name);
508 if (!sel->input)
509 pr_err("%s: could not find clk %s\n", __func__,
510 src->name);
511 audio_parents[src->value] = sel->input;
512 sel->value = src->value;
513 }
514
515 lookup = tegra_audio_clk_lookups;
516 for (i = 0; i < ARRAY_SIZE(tegra_audio_clk_lookups); i++, lookup++) {
517 struct clk *c = lookup->clk;
518 struct clk_tegra *clk = to_clk_tegra(c->hw);
519 __clk_init(NULL, c);
520 INIT_LIST_HEAD(&clk->shared_bus_list);
521 clk->lookup.con_id = lookup->con_id;
522 clk->lookup.clk = c;
523 clkdev_add(&clk->lookup);
524 tegra_clk_add(c);
525 }
526}
527
528static const char *mux_cclk[] = {
529 "clk_m",
530 "pll_c",
531 "clk_32k",
532 "pll_m",
533 "pll_p",
534 "pll_p_out4",
535 "pll_p_out3",
536 "clk_d",
537 "pll_x",
538};
539
540
541static struct clk *mux_cclk_p[] = {
542 &tegra_clk_m,
543 &tegra_pll_c,
544 &tegra_clk_32k,
545 &tegra_pll_m,
546 &tegra_pll_p,
547 &tegra_pll_p_out4,
548 &tegra_pll_p_out3,
549 &tegra_clk_d,
550 &tegra_pll_x,
551};
552
553static const char *mux_sclk[] = {
554 "clk_m",
555 "pll_c_out1",
556 "pll_p_out4",
557 "pllp_p_out3",
558 "pll_p_out2",
559 "clk_d",
560 "clk_32k",
561 "pll_m_out1",
562};
563
564static struct clk *mux_sclk_p[] = {
565 &tegra_clk_m,
566 &tegra_pll_c_out1,
567 &tegra_pll_p_out4,
568 &tegra_pll_p_out3,
569 &tegra_pll_p_out2,
570 &tegra_clk_d,
571 &tegra_clk_32k,
572 &tegra_pll_m_out1,
573};
574
575static struct clk tegra_cclk;
576static struct clk_tegra tegra_cclk_hw = {
577 .hw = {
578 .clk = &tegra_cclk,
579 },
580 .reg = 0x20,
581 .max_rate = 1000000000,
582};
583DEFINE_CLK_TEGRA(cclk, 0, &tegra_super_ops, 0, mux_cclk,
584 mux_cclk_p, NULL);
585
586static const char *mux_twd[] = {
587 "cclk",
588};
589
590static struct clk *mux_twd_p[] = {
591 &tegra_cclk,
592};
593
594static struct clk tegra_clk_twd;
595static struct clk_tegra tegra_clk_twd_hw = {
596 .hw = {
597 .clk = &tegra_clk_twd,
598 },
599 .max_rate = 1000000000,
600 .mul = 1,
601 .div = 4,
602};
603
604static struct clk tegra_clk_twd = {
605 .name = "twd",
606 .ops = &tegra_twd_ops,
607 .hw = &tegra_clk_twd_hw.hw,
608 .parent = &tegra_cclk,
609 .parent_names = mux_twd,
610 .parents = mux_twd_p,
611 .num_parents = ARRAY_SIZE(mux_twd),
612};
613
614static struct clk tegra_sclk;
615static struct clk_tegra tegra_sclk_hw = {
616 .hw = {
617 .clk = &tegra_sclk,
618 },
619 .reg = 0x28,
620 .max_rate = 240000000,
621 .min_rate = 120000000,
622};
623DEFINE_CLK_TEGRA(sclk, 0, &tegra_super_ops, 0, mux_sclk,
624 mux_sclk_p, NULL);
625
626static const char *tegra_cop_parent_names[] = {
627 "tegra_sclk",
628};
629
630static struct clk *tegra_cop_parents[] = {
631 &tegra_sclk,
632};
633
634static struct clk tegra_cop;
635static struct clk_tegra tegra_cop_hw = {
636 .hw = {
637 .clk = &tegra_cop,
638 },
639 .max_rate = 240000000,
640 .reset = &tegra2_cop_clk_reset,
641};
642DEFINE_CLK_TEGRA(cop, 0, &tegra_cop_ops, CLK_SET_RATE_PARENT,
643 tegra_cop_parent_names, tegra_cop_parents, &tegra_sclk);
644
645static const char *tegra_hclk_parent_names[] = {
646 "tegra_sclk",
647};
648
649static struct clk *tegra_hclk_parents[] = {
650 &tegra_sclk,
651};
652
653static struct clk tegra_hclk;
654static struct clk_tegra tegra_hclk_hw = {
655 .hw = {
656 .clk = &tegra_hclk,
657 },
658 .flags = DIV_BUS,
659 .reg = 0x30,
660 .reg_shift = 4,
661 .max_rate = 240000000,
662};
663DEFINE_CLK_TEGRA(hclk, 0, &tegra_bus_ops, 0, tegra_hclk_parent_names,
664 tegra_hclk_parents, &tegra_sclk);
665
666static const char *tegra_pclk_parent_names[] = {
667 "tegra_hclk",
668};
669
670static struct clk *tegra_pclk_parents[] = {
671 &tegra_hclk,
672};
673
674static struct clk tegra_pclk;
675static struct clk_tegra tegra_pclk_hw = {
676 .hw = {
677 .clk = &tegra_pclk,
678 },
679 .flags = DIV_BUS,
680 .reg = 0x30,
681 .reg_shift = 0,
682 .max_rate = 120000000,
683};
684DEFINE_CLK_TEGRA(pclk, 0, &tegra_bus_ops, 0, tegra_pclk_parent_names,
685 tegra_pclk_parents, &tegra_hclk);
686
687static const char *tegra_blink_parent_names[] = {
688 "clk_32k",
689};
690
691static struct clk *tegra_blink_parents[] = {
692 &tegra_clk_32k,
693};
694
695static struct clk tegra_blink;
696static struct clk_tegra tegra_blink_hw = {
697 .hw = {
698 .clk = &tegra_blink,
699 },
700 .reg = 0x40,
701 .max_rate = 32768,
702};
703DEFINE_CLK_TEGRA(blink, 0, &tegra_blink_clk_ops, 0, tegra_blink_parent_names,
704 tegra_blink_parents, &tegra_clk_32k);
705
706static const char *mux_pllm_pllc_pllp_plla[] = {
707 "pll_m",
708 "pll_c",
709 "pll_p",
710 "pll_a_out0",
711};
712
713static struct clk *mux_pllm_pllc_pllp_plla_p[] = {
714 &tegra_pll_m,
715 &tegra_pll_c,
716 &tegra_pll_p,
717 &tegra_pll_a_out0,
718};
719
720static const char *mux_pllm_pllc_pllp_clkm[] = {
721 "pll_m",
722 "pll_c",
723 "pll_p",
724 "clk_m",
725};
726
727static struct clk *mux_pllm_pllc_pllp_clkm_p[] = {
728 &tegra_pll_m,
729 &tegra_pll_c,
730 &tegra_pll_p,
731 &tegra_clk_m,
732};
733
734static const char *mux_pllp_pllc_pllm_clkm[] = {
735 "pll_p",
736 "pll_c",
737 "pll_m",
738 "clk_m",
739};
740
741static struct clk *mux_pllp_pllc_pllm_clkm_p[] = {
742 &tegra_pll_p,
743 &tegra_pll_c,
744 &tegra_pll_m,
745 &tegra_clk_m,
746};
747
748static const char *mux_pllaout0_audio2x_pllp_clkm[] = {
749 "pll_a_out0",
750 "audio_2x",
751 "pll_p",
752 "clk_m",
753};
754
755static struct clk *mux_pllaout0_audio2x_pllp_clkm_p[] = {
756 &tegra_pll_a_out0,
757 &tegra_audio_2x,
758 &tegra_pll_p,
759 &tegra_clk_m,
760};
761
762static const char *mux_pllp_plld_pllc_clkm[] = {
763 "pllp",
764 "pll_d_out0",
765 "pll_c",
766 "clk_m",
767};
768
769static struct clk *mux_pllp_plld_pllc_clkm_p[] = {
770 &tegra_pll_p,
771 &tegra_pll_d_out0,
772 &tegra_pll_c,
773 &tegra_clk_m,
774};
775
776static const char *mux_pllp_pllc_audio_clkm_clk32[] = {
777 "pll_p",
778 "pll_c",
779 "audio",
780 "clk_m",
781 "clk_32k",
782};
783
784static struct clk *mux_pllp_pllc_audio_clkm_clk32_p[] = {
785 &tegra_pll_p,
786 &tegra_pll_c,
787 &tegra_audio,
788 &tegra_clk_m,
789 &tegra_clk_32k,
790};
791
792static const char *mux_pllp_pllc_pllm[] = {
793 "pll_p",
794 "pll_c",
795 "pll_m"
796};
797
798static struct clk *mux_pllp_pllc_pllm_p[] = {
799 &tegra_pll_p,
800 &tegra_pll_c,
801 &tegra_pll_m,
802};
803
804static const char *mux_clk_m[] = {
805 "clk_m",
806};
807
808static struct clk *mux_clk_m_p[] = {
809 &tegra_clk_m,
810};
811
812static const char *mux_pllp_out3[] = {
813 "pll_p_out3",
814};
815
816static struct clk *mux_pllp_out3_p[] = {
817 &tegra_pll_p_out3,
818};
819
820static const char *mux_plld[] = {
821 "pll_d",
822};
823
824static struct clk *mux_plld_p[] = {
825 &tegra_pll_d,
826};
827
828static const char *mux_clk_32k[] = {
829 "clk_32k",
830};
831
832static struct clk *mux_clk_32k_p[] = {
833 &tegra_clk_32k,
834};
835
836static const char *mux_pclk[] = {
837 "pclk",
838};
839
840static struct clk *mux_pclk_p[] = {
841 &tegra_pclk,
842};
843
844static struct clk tegra_emc;
845static struct clk_tegra tegra_emc_hw = {
846 .hw = {
847 .clk = &tegra_emc,
848 },
849 .reg = 0x19c,
850 .max_rate = 800000000,
851 .flags = MUX | DIV_U71 | PERIPH_EMC_ENB,
852 .reset = &tegra2_periph_clk_reset,
853 .u.periph = {
854 .clk_num = 57,
855 },
856};
857DEFINE_CLK_TEGRA(emc, 0, &tegra_emc_clk_ops, 0, mux_pllm_pllc_pllp_clkm,
858 mux_pllm_pllc_pllp_clkm_p, NULL);
859
860#define PERIPH_CLK(_name, _dev, _con, _clk_num, _reg, \
861 _max, _inputs, _flags) \
862 static struct clk tegra_##_name; \
863 static struct clk_tegra tegra_##_name##_hw = { \
864 .hw = { \
865 .clk = &tegra_##_name, \
866 }, \
867 .lookup = { \
868 .dev_id = _dev, \
869 .con_id = _con, \
870 }, \
871 .reg = _reg, \
872 .flags = _flags, \
873 .max_rate = _max, \
874 .u.periph = { \
875 .clk_num = _clk_num, \
876 }, \
877 .reset = tegra2_periph_clk_reset, \
878 }; \
879 static struct clk tegra_##_name = { \
880 .name = #_name, \
881 .ops = &tegra_periph_clk_ops, \
882 .hw = &tegra_##_name##_hw.hw, \
883 .parent_names = _inputs, \
884 .parents = _inputs##_p, \
885 .num_parents = ARRAY_SIZE(_inputs), \
886 };
887
888PERIPH_CLK(apbdma, "tegra-apbdma", NULL, 34, 0, 108000000, mux_pclk, 0);
889PERIPH_CLK(rtc, "rtc-tegra", NULL, 4, 0, 32768, mux_clk_32k, PERIPH_NO_RESET);
890PERIPH_CLK(timer, "timer", NULL, 5, 0, 26000000, mux_clk_m, 0);
891PERIPH_CLK(i2s1, "tegra20-i2s.0", NULL, 11, 0x100, 26000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71);
892PERIPH_CLK(i2s2, "tegra20-i2s.1", NULL, 18, 0x104, 26000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71);
893PERIPH_CLK(spdif_out, "spdif_out", NULL, 10, 0x108, 100000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71);
894PERIPH_CLK(spdif_in, "spdif_in", NULL, 10, 0x10c, 100000000, mux_pllp_pllc_pllm, MUX | DIV_U71);
895PERIPH_CLK(pwm, "tegra-pwm", NULL, 17, 0x110, 432000000, mux_pllp_pllc_audio_clkm_clk32, MUX | DIV_U71 | MUX_PWM);
896PERIPH_CLK(spi, "spi", NULL, 43, 0x114, 40000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
897PERIPH_CLK(xio, "xio", NULL, 45, 0x120, 150000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
898PERIPH_CLK(twc, "twc", NULL, 16, 0x12c, 150000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
899PERIPH_CLK(sbc1, "spi_tegra.0", NULL, 41, 0x134, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
900PERIPH_CLK(sbc2, "spi_tegra.1", NULL, 44, 0x118, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
901PERIPH_CLK(sbc3, "spi_tegra.2", NULL, 46, 0x11c, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
902PERIPH_CLK(sbc4, "spi_tegra.3", NULL, 68, 0x1b4, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
903PERIPH_CLK(ide, "ide", NULL, 25, 0x144, 100000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* requires min voltage */
904PERIPH_CLK(ndflash, "tegra_nand", NULL, 13, 0x160, 164000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
905PERIPH_CLK(vfir, "vfir", NULL, 7, 0x168, 72000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
906PERIPH_CLK(sdmmc1, "sdhci-tegra.0", NULL, 14, 0x150, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
907PERIPH_CLK(sdmmc2, "sdhci-tegra.1", NULL, 9, 0x154, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
908PERIPH_CLK(sdmmc3, "sdhci-tegra.2", NULL, 69, 0x1bc, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
909PERIPH_CLK(sdmmc4, "sdhci-tegra.3", NULL, 15, 0x164, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
910PERIPH_CLK(vcp, "tegra-avp", "vcp", 29, 0, 250000000, mux_clk_m, 0);
911PERIPH_CLK(bsea, "tegra-avp", "bsea", 62, 0, 250000000, mux_clk_m, 0);
912PERIPH_CLK(bsev, "tegra-aes", "bsev", 63, 0, 250000000, mux_clk_m, 0);
913PERIPH_CLK(vde, "tegra-avp", "vde", 61, 0x1c8, 250000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage and process_id */
914PERIPH_CLK(csite, "csite", NULL, 73, 0x1d4, 144000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* max rate ??? */
915/* FIXME: what is la? */
916PERIPH_CLK(la, "la", NULL, 76, 0x1f8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
917PERIPH_CLK(owr, "tegra_w1", NULL, 71, 0x1cc, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
918PERIPH_CLK(nor, "nor", NULL, 42, 0x1d0, 92000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* requires min voltage */
919PERIPH_CLK(mipi, "mipi", NULL, 50, 0x174, 60000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
920PERIPH_CLK(i2c1, "tegra-i2c.0", "div-clk", 12, 0x124, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16);
921PERIPH_CLK(i2c2, "tegra-i2c.1", "div-clk", 54, 0x198, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16);
922PERIPH_CLK(i2c3, "tegra-i2c.2", "div-clk", 67, 0x1b8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16);
923PERIPH_CLK(dvc, "tegra-i2c.3", "div-clk", 47, 0x128, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16);
924PERIPH_CLK(uarta, "tegra-uart.0", NULL, 6, 0x178, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
925PERIPH_CLK(uartb, "tegra-uart.1", NULL, 7, 0x17c, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
926PERIPH_CLK(uartc, "tegra-uart.2", NULL, 55, 0x1a0, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
927PERIPH_CLK(uartd, "tegra-uart.3", NULL, 65, 0x1c0, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
928PERIPH_CLK(uarte, "tegra-uart.4", NULL, 66, 0x1c4, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
929PERIPH_CLK(3d, "3d", NULL, 24, 0x158, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_MANUAL_RESET); /* scales with voltage and process_id */
930PERIPH_CLK(2d, "2d", NULL, 21, 0x15c, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
931PERIPH_CLK(vi, "tegra_camera", "vi", 20, 0x148, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
932PERIPH_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 */
933PERIPH_CLK(epp, "epp", NULL, 19, 0x16c, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
934PERIPH_CLK(mpe, "mpe", NULL, 60, 0x170, 250000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
935PERIPH_CLK(host1x, "host1x", NULL, 28, 0x180, 166000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
936PERIPH_CLK(cve, "cve", NULL, 49, 0x140, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
937PERIPH_CLK(tvo, "tvo", NULL, 49, 0x188, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
938PERIPH_CLK(hdmi, "hdmi", NULL, 51, 0x18c, 600000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
939PERIPH_CLK(tvdac, "tvdac", NULL, 53, 0x194, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
940PERIPH_CLK(disp1, "tegradc.0", NULL, 27, 0x138, 600000000, mux_pllp_plld_pllc_clkm, MUX); /* scales with voltage and process_id */
941PERIPH_CLK(disp2, "tegradc.1", NULL, 26, 0x13c, 600000000, mux_pllp_plld_pllc_clkm, MUX); /* scales with voltage and process_id */
942PERIPH_CLK(usbd, "fsl-tegra-udc", NULL, 22, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
943PERIPH_CLK(usb2, "tegra-ehci.1", NULL, 58, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
944PERIPH_CLK(usb3, "tegra-ehci.2", NULL, 59, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
945PERIPH_CLK(dsi, "dsi", NULL, 48, 0, 500000000, mux_plld, 0); /* scales with voltage */
946PERIPH_CLK(csi, "tegra_camera", "csi", 52, 0, 72000000, mux_pllp_out3, 0);
947PERIPH_CLK(isp, "tegra_camera", "isp", 23, 0, 150000000, mux_clk_m, 0); /* same frequency as VI */
948PERIPH_CLK(csus, "tegra_camera", "csus", 92, 0, 150000000, mux_clk_m, PERIPH_NO_RESET);
949PERIPH_CLK(pex, NULL, "pex", 70, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET);
950PERIPH_CLK(afi, NULL, "afi", 72, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET);
951PERIPH_CLK(pcie_xclk, NULL, "pcie_xclk", 74, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET);
952
953static struct clk *tegra_list_clks[] = {
954 &tegra_apbdma,
955 &tegra_rtc,
956 &tegra_i2s1,
957 &tegra_i2s2,
958 &tegra_spdif_out,
959 &tegra_spdif_in,
960 &tegra_pwm,
961 &tegra_spi,
962 &tegra_xio,
963 &tegra_twc,
964 &tegra_sbc1,
965 &tegra_sbc2,
966 &tegra_sbc3,
967 &tegra_sbc4,
968 &tegra_ide,
969 &tegra_ndflash,
970 &tegra_vfir,
971 &tegra_sdmmc1,
972 &tegra_sdmmc2,
973 &tegra_sdmmc3,
974 &tegra_sdmmc4,
975 &tegra_vcp,
976 &tegra_bsea,
977 &tegra_bsev,
978 &tegra_vde,
979 &tegra_csite,
980 &tegra_la,
981 &tegra_owr,
982 &tegra_nor,
983 &tegra_mipi,
984 &tegra_i2c1,
985 &tegra_i2c2,
986 &tegra_i2c3,
987 &tegra_dvc,
988 &tegra_uarta,
989 &tegra_uartb,
990 &tegra_uartc,
991 &tegra_uartd,
992 &tegra_uarte,
993 &tegra_3d,
994 &tegra_2d,
995 &tegra_vi,
996 &tegra_vi_sensor,
997 &tegra_epp,
998 &tegra_mpe,
999 &tegra_host1x,
1000 &tegra_cve,
1001 &tegra_tvo,
1002 &tegra_hdmi,
1003 &tegra_tvdac,
1004 &tegra_disp1,
1005 &tegra_disp2,
1006 &tegra_usbd,
1007 &tegra_usb2,
1008 &tegra_usb3,
1009 &tegra_dsi,
1010 &tegra_csi,
1011 &tegra_isp,
1012 &tegra_csus,
1013 &tegra_pex,
1014 &tegra_afi,
1015 &tegra_pcie_xclk,
1016};
1017
1018#define CLK_DUPLICATE(_name, _dev, _con) \
1019 { \
1020 .name = _name, \
1021 .lookup = { \
1022 .dev_id = _dev, \
1023 .con_id = _con, \
1024 }, \
1025 }
1026
1027/* Some clocks may be used by different drivers depending on the board
1028 * configuration. List those here to register them twice in the clock lookup
1029 * table under two names.
1030 */
1031static struct clk_duplicate tegra_clk_duplicates[] = {
1032 CLK_DUPLICATE("uarta", "serial8250.0", NULL),
1033 CLK_DUPLICATE("uartb", "serial8250.1", NULL),
1034 CLK_DUPLICATE("uartc", "serial8250.2", NULL),
1035 CLK_DUPLICATE("uartd", "serial8250.3", NULL),
1036 CLK_DUPLICATE("uarte", "serial8250.4", NULL),
1037 CLK_DUPLICATE("usbd", "utmip-pad", NULL),
1038 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL),
1039 CLK_DUPLICATE("usbd", "tegra-otg", NULL),
1040 CLK_DUPLICATE("hdmi", "tegradc.0", "hdmi"),
1041 CLK_DUPLICATE("hdmi", "tegradc.1", "hdmi"),
1042 CLK_DUPLICATE("host1x", "tegra_grhost", "host1x"),
1043 CLK_DUPLICATE("2d", "tegra_grhost", "gr2d"),
1044 CLK_DUPLICATE("3d", "tegra_grhost", "gr3d"),
1045 CLK_DUPLICATE("epp", "tegra_grhost", "epp"),
1046 CLK_DUPLICATE("mpe", "tegra_grhost", "mpe"),
1047 CLK_DUPLICATE("cop", "tegra-avp", "cop"),
1048 CLK_DUPLICATE("vde", "tegra-aes", "vde"),
1049 CLK_DUPLICATE("cclk", NULL, "cpu"),
1050 CLK_DUPLICATE("twd", "smp_twd", NULL),
1051 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.0", "fast-clk"),
1052 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.1", "fast-clk"),
1053 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.2", "fast-clk"),
1054 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.3", "fast-clk"),
1055};
1056
1057#define CLK(dev, con, ck) \
1058 { \
1059 .dev_id = dev, \
1060 .con_id = con, \
1061 .clk = ck, \
1062 }
1063
1064static struct clk *tegra_ptr_clks[] = {
1065 &tegra_clk_32k,
1066 &tegra_pll_s,
1067 &tegra_clk_m,
1068 &tegra_pll_m,
1069 &tegra_pll_m_out1,
1070 &tegra_pll_c,
1071 &tegra_pll_c_out1,
1072 &tegra_pll_p,
1073 &tegra_pll_p_out1,
1074 &tegra_pll_p_out2,
1075 &tegra_pll_p_out3,
1076 &tegra_pll_p_out4,
1077 &tegra_pll_a,
1078 &tegra_pll_a_out0,
1079 &tegra_pll_d,
1080 &tegra_pll_d_out0,
1081 &tegra_pll_u,
1082 &tegra_pll_x,
1083 &tegra_pll_e,
1084 &tegra_cclk,
1085 &tegra_clk_twd,
1086 &tegra_sclk,
1087 &tegra_hclk,
1088 &tegra_pclk,
1089 &tegra_clk_d,
1090 &tegra_cdev1,
1091 &tegra_cdev2,
1092 &tegra_blink,
1093 &tegra_cop,
1094 &tegra_emc,
1095};
1096
1097static void tegra2_init_one_clock(struct clk *c)
1098{
1099 struct clk_tegra *clk = to_clk_tegra(c->hw);
1100 int ret;
1101
1102 ret = __clk_init(NULL, c);
1103 if (ret)
1104 pr_err("clk init failed %s\n", __clk_get_name(c));
1105
1106 INIT_LIST_HEAD(&clk->shared_bus_list);
1107 if (!clk->lookup.dev_id && !clk->lookup.con_id)
1108 clk->lookup.con_id = c->name;
1109 clk->lookup.clk = c;
1110 clkdev_add(&clk->lookup);
1111 tegra_clk_add(c);
1112}
1113
1114void __init tegra2_init_clocks(void)
1115{
1116 int i;
1117 struct clk *c;
1118
1119 for (i = 0; i < ARRAY_SIZE(tegra_ptr_clks); i++)
1120 tegra2_init_one_clock(tegra_ptr_clks[i]);
1121
1122 for (i = 0; i < ARRAY_SIZE(tegra_list_clks); i++)
1123 tegra2_init_one_clock(tegra_list_clks[i]);
1124
1125 for (i = 0; i < ARRAY_SIZE(tegra_clk_duplicates); i++) {
1126 c = tegra_get_clock_by_name(tegra_clk_duplicates[i].name);
1127 if (!c) {
1128 pr_err("%s: Unknown duplicate clock %s\n", __func__,
1129 tegra_clk_duplicates[i].name);
1130 continue;
1131 }
1132
1133 tegra_clk_duplicates[i].lookup.clk = c;
1134 clkdev_add(&tegra_clk_duplicates[i].lookup);
1135 }
1136
1137 init_audio_sync_clock_mux();
1138 tegra20_cpu_car_ops_init();
1139}
diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c
deleted file mode 100644
index a703844b206..00000000000
--- a/arch/arm/mach-tegra/tegra2_clocks.c
+++ /dev/null
@@ -1,2484 +0,0 @@
1/*
2 * arch/arm/mach-tegra/tegra2_clocks.c
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Colin Cross <ccross@google.com>
8 *
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 */
19
20#include <linux/kernel.h>
21#include <linux/module.h>
22#include <linux/list.h>
23#include <linux/spinlock.h>
24#include <linux/delay.h>
25#include <linux/io.h>
26#include <linux/clkdev.h>
27#include <linux/clk.h>
28
29#include <mach/iomap.h>
30#include <mach/suspend.h>
31
32#include "clock.h"
33#include "fuse.h"
34#include "tegra2_emc.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
154static void __iomem *reg_clk_base = IO_ADDRESS(TEGRA_CLK_RESET_BASE);
155static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE);
156
157/*
158 * Some clocks share a register with other clocks. Any clock op that
159 * non-atomically modifies a register used by another clock must lock
160 * clock_register_lock first.
161 */
162static DEFINE_SPINLOCK(clock_register_lock);
163
164/*
165 * Some peripheral clocks share an enable bit, so refcount the enable bits
166 * in registers CLK_ENABLE_L, CLK_ENABLE_H, and CLK_ENABLE_U
167 */
168static int tegra_periph_clk_enable_refcount[3 * 32];
169
170#define clk_writel(value, reg) \
171 __raw_writel(value, reg_clk_base + (reg))
172#define clk_readl(reg) \
173 __raw_readl(reg_clk_base + (reg))
174#define pmc_writel(value, reg) \
175 __raw_writel(value, reg_pmc_base + (reg))
176#define pmc_readl(reg) \
177 __raw_readl(reg_pmc_base + (reg))
178
179static unsigned long clk_measure_input_freq(void)
180{
181 u32 clock_autodetect;
182 clk_writel(OSC_FREQ_DET_TRIG | 1, OSC_FREQ_DET);
183 do {} while (clk_readl(OSC_FREQ_DET_STATUS) & OSC_FREQ_DET_BUSY);
184 clock_autodetect = clk_readl(OSC_FREQ_DET_STATUS);
185 if (clock_autodetect >= 732 - 3 && clock_autodetect <= 732 + 3) {
186 return 12000000;
187 } else if (clock_autodetect >= 794 - 3 && clock_autodetect <= 794 + 3) {
188 return 13000000;
189 } else if (clock_autodetect >= 1172 - 3 && clock_autodetect <= 1172 + 3) {
190 return 19200000;
191 } else if (clock_autodetect >= 1587 - 3 && clock_autodetect <= 1587 + 3) {
192 return 26000000;
193 } else {
194 pr_err("%s: Unexpected clock autodetect value %d", __func__, clock_autodetect);
195 BUG();
196 return 0;
197 }
198}
199
200static int clk_div71_get_divider(unsigned long parent_rate, unsigned long rate)
201{
202 s64 divider_u71 = parent_rate * 2;
203 divider_u71 += rate - 1;
204 do_div(divider_u71, rate);
205
206 if (divider_u71 - 2 < 0)
207 return 0;
208
209 if (divider_u71 - 2 > 255)
210 return -EINVAL;
211
212 return divider_u71 - 2;
213}
214
215static int clk_div16_get_divider(unsigned long parent_rate, unsigned long rate)
216{
217 s64 divider_u16;
218
219 divider_u16 = parent_rate;
220 divider_u16 += rate - 1;
221 do_div(divider_u16, rate);
222
223 if (divider_u16 - 1 < 0)
224 return 0;
225
226 if (divider_u16 - 1 > 255)
227 return -EINVAL;
228
229 return divider_u16 - 1;
230}
231
232/* clk_m functions */
233static unsigned long tegra2_clk_m_autodetect_rate(struct clk *c)
234{
235 u32 auto_clock_control = clk_readl(OSC_CTRL) & ~OSC_CTRL_OSC_FREQ_MASK;
236
237 c->rate = clk_measure_input_freq();
238 switch (c->rate) {
239 case 12000000:
240 auto_clock_control |= OSC_CTRL_OSC_FREQ_12MHZ;
241 break;
242 case 13000000:
243 auto_clock_control |= OSC_CTRL_OSC_FREQ_13MHZ;
244 break;
245 case 19200000:
246 auto_clock_control |= OSC_CTRL_OSC_FREQ_19_2MHZ;
247 break;
248 case 26000000:
249 auto_clock_control |= OSC_CTRL_OSC_FREQ_26MHZ;
250 break;
251 default:
252 pr_err("%s: Unexpected clock rate %ld", __func__, c->rate);
253 BUG();
254 }
255 clk_writel(auto_clock_control, OSC_CTRL);
256 return c->rate;
257}
258
259static void tegra2_clk_m_init(struct clk *c)
260{
261 pr_debug("%s on clock %s\n", __func__, c->name);
262 tegra2_clk_m_autodetect_rate(c);
263}
264
265static int tegra2_clk_m_enable(struct clk *c)
266{
267 pr_debug("%s on clock %s\n", __func__, c->name);
268 return 0;
269}
270
271static void tegra2_clk_m_disable(struct clk *c)
272{
273 pr_debug("%s on clock %s\n", __func__, c->name);
274 BUG();
275}
276
277static struct clk_ops tegra_clk_m_ops = {
278 .init = tegra2_clk_m_init,
279 .enable = tegra2_clk_m_enable,
280 .disable = tegra2_clk_m_disable,
281};
282
283/* super clock functions */
284/* "super clocks" on tegra have two-stage muxes and a clock skipping
285 * super divider. We will ignore the clock skipping divider, since we
286 * can't lower the voltage when using the clock skip, but we can if we
287 * lower the PLL frequency.
288 */
289static void tegra2_super_clk_init(struct clk *c)
290{
291 u32 val;
292 int source;
293 int shift;
294 const struct clk_mux_sel *sel;
295 val = clk_readl(c->reg + SUPER_CLK_MUX);
296 c->state = ON;
297 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
298 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
299 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
300 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
301 source = (val >> shift) & SUPER_SOURCE_MASK;
302 for (sel = c->inputs; sel->input != NULL; sel++) {
303 if (sel->value == source)
304 break;
305 }
306 BUG_ON(sel->input == NULL);
307 c->parent = sel->input;
308}
309
310static int tegra2_super_clk_enable(struct clk *c)
311{
312 clk_writel(0, c->reg + SUPER_CLK_DIVIDER);
313 return 0;
314}
315
316static void tegra2_super_clk_disable(struct clk *c)
317{
318 pr_debug("%s on clock %s\n", __func__, c->name);
319
320 /* oops - don't disable the CPU clock! */
321 BUG();
322}
323
324static int tegra2_super_clk_set_parent(struct clk *c, struct clk *p)
325{
326 u32 val;
327 const struct clk_mux_sel *sel;
328 int shift;
329
330 val = clk_readl(c->reg + SUPER_CLK_MUX);
331 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
332 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
333 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
334 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
335 for (sel = c->inputs; sel->input != NULL; sel++) {
336 if (sel->input == p) {
337 val &= ~(SUPER_SOURCE_MASK << shift);
338 val |= sel->value << shift;
339
340 if (c->refcnt)
341 clk_enable(p);
342
343 clk_writel(val, c->reg);
344
345 if (c->refcnt && c->parent)
346 clk_disable(c->parent);
347
348 clk_reparent(c, p);
349 return 0;
350 }
351 }
352 return -EINVAL;
353}
354
355/*
356 * Super clocks have "clock skippers" instead of dividers. Dividing using
357 * a clock skipper does not allow the voltage to be scaled down, so instead
358 * adjust the rate of the parent clock. This requires that the parent of a
359 * super clock have no other children, otherwise the rate will change
360 * underneath the other children.
361 */
362static int tegra2_super_clk_set_rate(struct clk *c, unsigned long rate)
363{
364 return clk_set_rate(c->parent, rate);
365}
366
367static struct clk_ops tegra_super_ops = {
368 .init = tegra2_super_clk_init,
369 .enable = tegra2_super_clk_enable,
370 .disable = tegra2_super_clk_disable,
371 .set_parent = tegra2_super_clk_set_parent,
372 .set_rate = tegra2_super_clk_set_rate,
373};
374
375/* virtual cpu clock functions */
376/* some clocks can not be stopped (cpu, memory bus) while the SoC is running.
377 To change the frequency of these clocks, the parent pll may need to be
378 reprogrammed, so the clock must be moved off the pll, the pll reprogrammed,
379 and then the clock moved back to the pll. To hide this sequence, a virtual
380 clock handles it.
381 */
382static void tegra2_cpu_clk_init(struct clk *c)
383{
384}
385
386static int tegra2_cpu_clk_enable(struct clk *c)
387{
388 return 0;
389}
390
391static void tegra2_cpu_clk_disable(struct clk *c)
392{
393 pr_debug("%s on clock %s\n", __func__, c->name);
394
395 /* oops - don't disable the CPU clock! */
396 BUG();
397}
398
399static int tegra2_cpu_clk_set_rate(struct clk *c, unsigned long rate)
400{
401 int ret;
402 /*
403 * Take an extra reference to the main pll so it doesn't turn
404 * off when we move the cpu off of it
405 */
406 clk_enable(c->u.cpu.main);
407
408 ret = clk_set_parent(c->parent, c->u.cpu.backup);
409 if (ret) {
410 pr_err("Failed to switch cpu to clock %s\n", c->u.cpu.backup->name);
411 goto out;
412 }
413
414 if (rate == clk_get_rate(c->u.cpu.backup))
415 goto out;
416
417 ret = clk_set_rate(c->u.cpu.main, rate);
418 if (ret) {
419 pr_err("Failed to change cpu pll to %lu\n", rate);
420 goto out;
421 }
422
423 ret = clk_set_parent(c->parent, c->u.cpu.main);
424 if (ret) {
425 pr_err("Failed to switch cpu to clock %s\n", c->u.cpu.main->name);
426 goto out;
427 }
428
429out:
430 clk_disable(c->u.cpu.main);
431 return ret;
432}
433
434static struct clk_ops tegra_cpu_ops = {
435 .init = tegra2_cpu_clk_init,
436 .enable = tegra2_cpu_clk_enable,
437 .disable = tegra2_cpu_clk_disable,
438 .set_rate = tegra2_cpu_clk_set_rate,
439};
440
441/* virtual cop clock functions. Used to acquire the fake 'cop' clock to
442 * reset the COP block (i.e. AVP) */
443static void tegra2_cop_clk_reset(struct clk *c, bool assert)
444{
445 unsigned long reg = assert ? RST_DEVICES_SET : RST_DEVICES_CLR;
446
447 pr_debug("%s %s\n", __func__, assert ? "assert" : "deassert");
448 clk_writel(1 << 1, reg);
449}
450
451static struct clk_ops tegra_cop_ops = {
452 .reset = tegra2_cop_clk_reset,
453};
454
455/* bus clock functions */
456static void tegra2_bus_clk_init(struct clk *c)
457{
458 u32 val = clk_readl(c->reg);
459 c->state = ((val >> c->reg_shift) & BUS_CLK_DISABLE) ? OFF : ON;
460 c->div = ((val >> c->reg_shift) & BUS_CLK_DIV_MASK) + 1;
461 c->mul = 1;
462}
463
464static int tegra2_bus_clk_enable(struct clk *c)
465{
466 u32 val;
467 unsigned long flags;
468
469 spin_lock_irqsave(&clock_register_lock, flags);
470
471 val = clk_readl(c->reg);
472 val &= ~(BUS_CLK_DISABLE << c->reg_shift);
473 clk_writel(val, c->reg);
474
475 spin_unlock_irqrestore(&clock_register_lock, flags);
476
477 return 0;
478}
479
480static void tegra2_bus_clk_disable(struct clk *c)
481{
482 u32 val;
483 unsigned long flags;
484
485 spin_lock_irqsave(&clock_register_lock, flags);
486
487 val = clk_readl(c->reg);
488 val |= BUS_CLK_DISABLE << c->reg_shift;
489 clk_writel(val, c->reg);
490
491 spin_unlock_irqrestore(&clock_register_lock, flags);
492}
493
494static int tegra2_bus_clk_set_rate(struct clk *c, unsigned long rate)
495{
496 u32 val;
497 unsigned long parent_rate = clk_get_rate(c->parent);
498 unsigned long flags;
499 int ret = -EINVAL;
500 int i;
501
502 spin_lock_irqsave(&clock_register_lock, flags);
503
504 val = clk_readl(c->reg);
505 for (i = 1; i <= 4; i++) {
506 if (rate == parent_rate / i) {
507 val &= ~(BUS_CLK_DIV_MASK << c->reg_shift);
508 val |= (i - 1) << c->reg_shift;
509 clk_writel(val, c->reg);
510 c->div = i;
511 c->mul = 1;
512 ret = 0;
513 break;
514 }
515 }
516
517 spin_unlock_irqrestore(&clock_register_lock, flags);
518
519 return ret;
520}
521
522static struct clk_ops tegra_bus_ops = {
523 .init = tegra2_bus_clk_init,
524 .enable = tegra2_bus_clk_enable,
525 .disable = tegra2_bus_clk_disable,
526 .set_rate = tegra2_bus_clk_set_rate,
527};
528
529/* Blink output functions */
530
531static void tegra2_blink_clk_init(struct clk *c)
532{
533 u32 val;
534
535 val = pmc_readl(PMC_CTRL);
536 c->state = (val & PMC_CTRL_BLINK_ENB) ? ON : OFF;
537 c->mul = 1;
538 val = pmc_readl(c->reg);
539
540 if (val & PMC_BLINK_TIMER_ENB) {
541 unsigned int on_off;
542
543 on_off = (val >> PMC_BLINK_TIMER_DATA_ON_SHIFT) &
544 PMC_BLINK_TIMER_DATA_ON_MASK;
545 val >>= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
546 val &= PMC_BLINK_TIMER_DATA_OFF_MASK;
547 on_off += val;
548 /* each tick in the blink timer is 4 32KHz clocks */
549 c->div = on_off * 4;
550 } else {
551 c->div = 1;
552 }
553}
554
555static int tegra2_blink_clk_enable(struct clk *c)
556{
557 u32 val;
558
559 val = pmc_readl(PMC_DPD_PADS_ORIDE);
560 pmc_writel(val | PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
561
562 val = pmc_readl(PMC_CTRL);
563 pmc_writel(val | PMC_CTRL_BLINK_ENB, PMC_CTRL);
564
565 return 0;
566}
567
568static void tegra2_blink_clk_disable(struct clk *c)
569{
570 u32 val;
571
572 val = pmc_readl(PMC_CTRL);
573 pmc_writel(val & ~PMC_CTRL_BLINK_ENB, PMC_CTRL);
574
575 val = pmc_readl(PMC_DPD_PADS_ORIDE);
576 pmc_writel(val & ~PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
577}
578
579static int tegra2_blink_clk_set_rate(struct clk *c, unsigned long rate)
580{
581 unsigned long parent_rate = clk_get_rate(c->parent);
582 if (rate >= parent_rate) {
583 c->div = 1;
584 pmc_writel(0, c->reg);
585 } else {
586 unsigned int on_off;
587 u32 val;
588
589 on_off = DIV_ROUND_UP(parent_rate / 8, rate);
590 c->div = on_off * 8;
591
592 val = (on_off & PMC_BLINK_TIMER_DATA_ON_MASK) <<
593 PMC_BLINK_TIMER_DATA_ON_SHIFT;
594 on_off &= PMC_BLINK_TIMER_DATA_OFF_MASK;
595 on_off <<= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
596 val |= on_off;
597 val |= PMC_BLINK_TIMER_ENB;
598 pmc_writel(val, c->reg);
599 }
600
601 return 0;
602}
603
604static struct clk_ops tegra_blink_clk_ops = {
605 .init = &tegra2_blink_clk_init,
606 .enable = &tegra2_blink_clk_enable,
607 .disable = &tegra2_blink_clk_disable,
608 .set_rate = &tegra2_blink_clk_set_rate,
609};
610
611/* PLL Functions */
612static int tegra2_pll_clk_wait_for_lock(struct clk *c)
613{
614 udelay(c->u.pll.lock_delay);
615
616 return 0;
617}
618
619static void tegra2_pll_clk_init(struct clk *c)
620{
621 u32 val = clk_readl(c->reg + PLL_BASE);
622
623 c->state = (val & PLL_BASE_ENABLE) ? ON : OFF;
624
625 if (c->flags & PLL_FIXED && !(val & PLL_BASE_OVERRIDE)) {
626 pr_warning("Clock %s has unknown fixed frequency\n", c->name);
627 c->mul = 1;
628 c->div = 1;
629 } else if (val & PLL_BASE_BYPASS) {
630 c->mul = 1;
631 c->div = 1;
632 } else {
633 c->mul = (val & PLL_BASE_DIVN_MASK) >> PLL_BASE_DIVN_SHIFT;
634 c->div = (val & PLL_BASE_DIVM_MASK) >> PLL_BASE_DIVM_SHIFT;
635 if (c->flags & PLLU)
636 c->div *= (val & PLLU_BASE_POST_DIV) ? 1 : 2;
637 else
638 c->div *= (val & PLL_BASE_DIVP_MASK) ? 2 : 1;
639 }
640}
641
642static int tegra2_pll_clk_enable(struct clk *c)
643{
644 u32 val;
645 pr_debug("%s on clock %s\n", __func__, c->name);
646
647 val = clk_readl(c->reg + PLL_BASE);
648 val &= ~PLL_BASE_BYPASS;
649 val |= PLL_BASE_ENABLE;
650 clk_writel(val, c->reg + PLL_BASE);
651
652 tegra2_pll_clk_wait_for_lock(c);
653
654 return 0;
655}
656
657static void tegra2_pll_clk_disable(struct clk *c)
658{
659 u32 val;
660 pr_debug("%s on clock %s\n", __func__, c->name);
661
662 val = clk_readl(c->reg);
663 val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE);
664 clk_writel(val, c->reg);
665}
666
667static int tegra2_pll_clk_set_rate(struct clk *c, unsigned long rate)
668{
669 u32 val;
670 unsigned long input_rate;
671 const struct clk_pll_freq_table *sel;
672
673 pr_debug("%s: %s %lu\n", __func__, c->name, rate);
674
675 input_rate = clk_get_rate(c->parent);
676 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
677 if (sel->input_rate == input_rate && sel->output_rate == rate) {
678 c->mul = sel->n;
679 c->div = sel->m * sel->p;
680
681 val = clk_readl(c->reg + PLL_BASE);
682 if (c->flags & PLL_FIXED)
683 val |= PLL_BASE_OVERRIDE;
684 val &= ~(PLL_BASE_DIVP_MASK | PLL_BASE_DIVN_MASK |
685 PLL_BASE_DIVM_MASK);
686 val |= (sel->m << PLL_BASE_DIVM_SHIFT) |
687 (sel->n << PLL_BASE_DIVN_SHIFT);
688 BUG_ON(sel->p < 1 || sel->p > 2);
689 if (c->flags & PLLU) {
690 if (sel->p == 1)
691 val |= PLLU_BASE_POST_DIV;
692 } else {
693 if (sel->p == 2)
694 val |= 1 << PLL_BASE_DIVP_SHIFT;
695 }
696 clk_writel(val, c->reg + PLL_BASE);
697
698 if (c->flags & PLL_HAS_CPCON) {
699 val = clk_readl(c->reg + PLL_MISC(c));
700 val &= ~PLL_MISC_CPCON_MASK;
701 val |= sel->cpcon << PLL_MISC_CPCON_SHIFT;
702 clk_writel(val, c->reg + PLL_MISC(c));
703 }
704
705 if (c->state == ON)
706 tegra2_pll_clk_enable(c);
707
708 return 0;
709 }
710 }
711 return -EINVAL;
712}
713
714static struct clk_ops tegra_pll_ops = {
715 .init = tegra2_pll_clk_init,
716 .enable = tegra2_pll_clk_enable,
717 .disable = tegra2_pll_clk_disable,
718 .set_rate = tegra2_pll_clk_set_rate,
719};
720
721static void tegra2_pllx_clk_init(struct clk *c)
722{
723 tegra2_pll_clk_init(c);
724
725 if (tegra_sku_id == 7)
726 c->max_rate = 750000000;
727}
728
729static struct clk_ops tegra_pllx_ops = {
730 .init = tegra2_pllx_clk_init,
731 .enable = tegra2_pll_clk_enable,
732 .disable = tegra2_pll_clk_disable,
733 .set_rate = tegra2_pll_clk_set_rate,
734};
735
736static int tegra2_plle_clk_enable(struct clk *c)
737{
738 u32 val;
739
740 pr_debug("%s on clock %s\n", __func__, c->name);
741
742 mdelay(1);
743
744 val = clk_readl(c->reg + PLL_BASE);
745 if (!(val & PLLE_MISC_READY))
746 return -EBUSY;
747
748 val = clk_readl(c->reg + PLL_BASE);
749 val |= PLL_BASE_ENABLE | PLL_BASE_BYPASS;
750 clk_writel(val, c->reg + PLL_BASE);
751
752 return 0;
753}
754
755static struct clk_ops tegra_plle_ops = {
756 .init = tegra2_pll_clk_init,
757 .enable = tegra2_plle_clk_enable,
758 .set_rate = tegra2_pll_clk_set_rate,
759};
760
761/* Clock divider ops */
762static void tegra2_pll_div_clk_init(struct clk *c)
763{
764 u32 val = clk_readl(c->reg);
765 u32 divu71;
766 val >>= c->reg_shift;
767 c->state = (val & PLL_OUT_CLKEN) ? ON : OFF;
768 if (!(val & PLL_OUT_RESET_DISABLE))
769 c->state = OFF;
770
771 if (c->flags & DIV_U71) {
772 divu71 = (val & PLL_OUT_RATIO_MASK) >> PLL_OUT_RATIO_SHIFT;
773 c->div = (divu71 + 2);
774 c->mul = 2;
775 } else if (c->flags & DIV_2) {
776 c->div = 2;
777 c->mul = 1;
778 } else {
779 c->div = 1;
780 c->mul = 1;
781 }
782}
783
784static int tegra2_pll_div_clk_enable(struct clk *c)
785{
786 u32 val;
787 u32 new_val;
788 unsigned long flags;
789
790 pr_debug("%s: %s\n", __func__, c->name);
791 if (c->flags & DIV_U71) {
792 spin_lock_irqsave(&clock_register_lock, flags);
793 val = clk_readl(c->reg);
794 new_val = val >> c->reg_shift;
795 new_val &= 0xFFFF;
796
797 new_val |= PLL_OUT_CLKEN | PLL_OUT_RESET_DISABLE;
798
799 val &= ~(0xFFFF << c->reg_shift);
800 val |= new_val << c->reg_shift;
801 clk_writel(val, c->reg);
802 spin_unlock_irqrestore(&clock_register_lock, flags);
803 return 0;
804 } else if (c->flags & DIV_2) {
805 BUG_ON(!(c->flags & PLLD));
806 spin_lock_irqsave(&clock_register_lock, flags);
807 val = clk_readl(c->reg);
808 val &= ~PLLD_MISC_DIV_RST;
809 clk_writel(val, c->reg);
810 spin_unlock_irqrestore(&clock_register_lock, flags);
811 return 0;
812 }
813 return -EINVAL;
814}
815
816static void tegra2_pll_div_clk_disable(struct clk *c)
817{
818 u32 val;
819 u32 new_val;
820 unsigned long flags;
821
822 pr_debug("%s: %s\n", __func__, c->name);
823 if (c->flags & DIV_U71) {
824 spin_lock_irqsave(&clock_register_lock, flags);
825 val = clk_readl(c->reg);
826 new_val = val >> c->reg_shift;
827 new_val &= 0xFFFF;
828
829 new_val &= ~(PLL_OUT_CLKEN | PLL_OUT_RESET_DISABLE);
830
831 val &= ~(0xFFFF << c->reg_shift);
832 val |= new_val << c->reg_shift;
833 clk_writel(val, c->reg);
834 spin_unlock_irqrestore(&clock_register_lock, flags);
835 } else if (c->flags & DIV_2) {
836 BUG_ON(!(c->flags & PLLD));
837 spin_lock_irqsave(&clock_register_lock, flags);
838 val = clk_readl(c->reg);
839 val |= PLLD_MISC_DIV_RST;
840 clk_writel(val, c->reg);
841 spin_unlock_irqrestore(&clock_register_lock, flags);
842 }
843}
844
845static int tegra2_pll_div_clk_set_rate(struct clk *c, unsigned long rate)
846{
847 u32 val;
848 u32 new_val;
849 int divider_u71;
850 unsigned long parent_rate = clk_get_rate(c->parent);
851 unsigned long flags;
852
853 pr_debug("%s: %s %lu\n", __func__, c->name, rate);
854 if (c->flags & DIV_U71) {
855 divider_u71 = clk_div71_get_divider(parent_rate, rate);
856 if (divider_u71 >= 0) {
857 spin_lock_irqsave(&clock_register_lock, flags);
858 val = clk_readl(c->reg);
859 new_val = val >> c->reg_shift;
860 new_val &= 0xFFFF;
861 if (c->flags & DIV_U71_FIXED)
862 new_val |= PLL_OUT_OVERRIDE;
863 new_val &= ~PLL_OUT_RATIO_MASK;
864 new_val |= divider_u71 << PLL_OUT_RATIO_SHIFT;
865
866 val &= ~(0xFFFF << c->reg_shift);
867 val |= new_val << c->reg_shift;
868 clk_writel(val, c->reg);
869 c->div = divider_u71 + 2;
870 c->mul = 2;
871 spin_unlock_irqrestore(&clock_register_lock, flags);
872 return 0;
873 }
874 } else if (c->flags & DIV_2) {
875 if (parent_rate == rate * 2)
876 return 0;
877 }
878 return -EINVAL;
879}
880
881static long tegra2_pll_div_clk_round_rate(struct clk *c, unsigned long rate)
882{
883 int divider;
884 unsigned long parent_rate = clk_get_rate(c->parent);
885 pr_debug("%s: %s %lu\n", __func__, c->name, rate);
886
887 if (c->flags & DIV_U71) {
888 divider = clk_div71_get_divider(parent_rate, rate);
889 if (divider < 0)
890 return divider;
891 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
892 } else if (c->flags & DIV_2) {
893 return DIV_ROUND_UP(parent_rate, 2);
894 }
895 return -EINVAL;
896}
897
898static struct clk_ops tegra_pll_div_ops = {
899 .init = tegra2_pll_div_clk_init,
900 .enable = tegra2_pll_div_clk_enable,
901 .disable = tegra2_pll_div_clk_disable,
902 .set_rate = tegra2_pll_div_clk_set_rate,
903 .round_rate = tegra2_pll_div_clk_round_rate,
904};
905
906/* Periph clk ops */
907
908static void tegra2_periph_clk_init(struct clk *c)
909{
910 u32 val = clk_readl(c->reg);
911 const struct clk_mux_sel *mux = NULL;
912 const struct clk_mux_sel *sel;
913 u32 shift;
914 u32 mask;
915
916 if (c->flags & MUX_PWM) {
917 shift = PERIPH_CLK_SOURCE_PWM_SHIFT;
918 mask = PERIPH_CLK_SOURCE_PWM_MASK;
919 } else {
920 shift = PERIPH_CLK_SOURCE_SHIFT;
921 mask = PERIPH_CLK_SOURCE_MASK;
922 }
923
924 if (c->flags & MUX) {
925 for (sel = c->inputs; sel->input != NULL; sel++) {
926 if ((val & mask) >> shift == sel->value)
927 mux = sel;
928 }
929 BUG_ON(!mux);
930
931 c->parent = mux->input;
932 } else {
933 c->parent = c->inputs[0].input;
934 }
935
936 if (c->flags & DIV_U71) {
937 u32 divu71 = val & PERIPH_CLK_SOURCE_DIVU71_MASK;
938 c->div = divu71 + 2;
939 c->mul = 2;
940 } else if (c->flags & DIV_U16) {
941 u32 divu16 = val & PERIPH_CLK_SOURCE_DIVU16_MASK;
942 c->div = divu16 + 1;
943 c->mul = 1;
944 } else {
945 c->div = 1;
946 c->mul = 1;
947 }
948
949 c->state = ON;
950
951 if (!c->u.periph.clk_num)
952 return;
953
954 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
955 PERIPH_CLK_TO_ENB_BIT(c)))
956 c->state = OFF;
957
958 if (!(c->flags & PERIPH_NO_RESET))
959 if (clk_readl(RST_DEVICES + PERIPH_CLK_TO_ENB_REG(c)) &
960 PERIPH_CLK_TO_ENB_BIT(c))
961 c->state = OFF;
962}
963
964static int tegra2_periph_clk_enable(struct clk *c)
965{
966 u32 val;
967 unsigned long flags;
968 int refcount;
969 pr_debug("%s on clock %s\n", __func__, c->name);
970
971 if (!c->u.periph.clk_num)
972 return 0;
973
974 spin_lock_irqsave(&clock_register_lock, flags);
975
976 refcount = tegra_periph_clk_enable_refcount[c->u.periph.clk_num]++;
977
978 if (refcount > 1)
979 goto out;
980
981 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
982 CLK_OUT_ENB_SET + PERIPH_CLK_TO_ENB_SET_REG(c));
983 if (!(c->flags & PERIPH_NO_RESET) && !(c->flags & PERIPH_MANUAL_RESET))
984 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
985 RST_DEVICES_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
986 if (c->flags & PERIPH_EMC_ENB) {
987 /* The EMC peripheral clock has 2 extra enable bits */
988 /* FIXME: Do they need to be disabled? */
989 val = clk_readl(c->reg);
990 val |= 0x3 << 24;
991 clk_writel(val, c->reg);
992 }
993
994out:
995 spin_unlock_irqrestore(&clock_register_lock, flags);
996
997 return 0;
998}
999
1000static void tegra2_periph_clk_disable(struct clk *c)
1001{
1002 unsigned long flags;
1003
1004 pr_debug("%s on clock %s\n", __func__, c->name);
1005
1006 if (!c->u.periph.clk_num)
1007 return;
1008
1009 spin_lock_irqsave(&clock_register_lock, flags);
1010
1011 if (c->refcnt)
1012 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]--;
1013
1014 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] == 0)
1015 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1016 CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1017
1018 spin_unlock_irqrestore(&clock_register_lock, flags);
1019}
1020
1021static void tegra2_periph_clk_reset(struct clk *c, bool assert)
1022{
1023 unsigned long base = assert ? RST_DEVICES_SET : RST_DEVICES_CLR;
1024
1025 pr_debug("%s %s on clock %s\n", __func__,
1026 assert ? "assert" : "deassert", c->name);
1027
1028 BUG_ON(!c->u.periph.clk_num);
1029
1030 if (!(c->flags & PERIPH_NO_RESET))
1031 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1032 base + PERIPH_CLK_TO_ENB_SET_REG(c));
1033}
1034
1035static int tegra2_periph_clk_set_parent(struct clk *c, struct clk *p)
1036{
1037 u32 val;
1038 const struct clk_mux_sel *sel;
1039 u32 mask, shift;
1040
1041 pr_debug("%s: %s %s\n", __func__, c->name, p->name);
1042
1043 if (c->flags & MUX_PWM) {
1044 shift = PERIPH_CLK_SOURCE_PWM_SHIFT;
1045 mask = PERIPH_CLK_SOURCE_PWM_MASK;
1046 } else {
1047 shift = PERIPH_CLK_SOURCE_SHIFT;
1048 mask = PERIPH_CLK_SOURCE_MASK;
1049 }
1050
1051 for (sel = c->inputs; sel->input != NULL; sel++) {
1052 if (sel->input == p) {
1053 val = clk_readl(c->reg);
1054 val &= ~mask;
1055 val |= (sel->value) << shift;
1056
1057 if (c->refcnt)
1058 clk_enable(p);
1059
1060 clk_writel(val, c->reg);
1061
1062 if (c->refcnt && c->parent)
1063 clk_disable(c->parent);
1064
1065 clk_reparent(c, p);
1066 return 0;
1067 }
1068 }
1069
1070 return -EINVAL;
1071}
1072
1073static int tegra2_periph_clk_set_rate(struct clk *c, unsigned long rate)
1074{
1075 u32 val;
1076 int divider;
1077 unsigned long parent_rate = clk_get_rate(c->parent);
1078
1079 if (c->flags & DIV_U71) {
1080 divider = clk_div71_get_divider(parent_rate, rate);
1081 if (divider >= 0) {
1082 val = clk_readl(c->reg);
1083 val &= ~PERIPH_CLK_SOURCE_DIVU71_MASK;
1084 val |= divider;
1085 clk_writel(val, c->reg);
1086 c->div = divider + 2;
1087 c->mul = 2;
1088 return 0;
1089 }
1090 } else if (c->flags & DIV_U16) {
1091 divider = clk_div16_get_divider(parent_rate, rate);
1092 if (divider >= 0) {
1093 val = clk_readl(c->reg);
1094 val &= ~PERIPH_CLK_SOURCE_DIVU16_MASK;
1095 val |= divider;
1096 clk_writel(val, c->reg);
1097 c->div = divider + 1;
1098 c->mul = 1;
1099 return 0;
1100 }
1101 } else if (parent_rate <= rate) {
1102 c->div = 1;
1103 c->mul = 1;
1104 return 0;
1105 }
1106 return -EINVAL;
1107}
1108
1109static long tegra2_periph_clk_round_rate(struct clk *c,
1110 unsigned long rate)
1111{
1112 int divider;
1113 unsigned long parent_rate = clk_get_rate(c->parent);
1114 pr_debug("%s: %s %lu\n", __func__, c->name, rate);
1115
1116 if (c->flags & DIV_U71) {
1117 divider = clk_div71_get_divider(parent_rate, rate);
1118 if (divider < 0)
1119 return divider;
1120
1121 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
1122 } else if (c->flags & DIV_U16) {
1123 divider = clk_div16_get_divider(parent_rate, rate);
1124 if (divider < 0)
1125 return divider;
1126 return DIV_ROUND_UP(parent_rate, divider + 1);
1127 }
1128 return -EINVAL;
1129}
1130
1131static struct clk_ops tegra_periph_clk_ops = {
1132 .init = &tegra2_periph_clk_init,
1133 .enable = &tegra2_periph_clk_enable,
1134 .disable = &tegra2_periph_clk_disable,
1135 .set_parent = &tegra2_periph_clk_set_parent,
1136 .set_rate = &tegra2_periph_clk_set_rate,
1137 .round_rate = &tegra2_periph_clk_round_rate,
1138 .reset = &tegra2_periph_clk_reset,
1139};
1140
1141/* The SDMMC controllers have extra bits in the clock source register that
1142 * adjust the delay between the clock and data to compenstate for delays
1143 * on the PCB. */
1144void tegra2_sdmmc_tap_delay(struct clk *c, int delay)
1145{
1146 u32 reg;
1147 unsigned long flags;
1148
1149 spin_lock_irqsave(&c->spinlock, flags);
1150
1151 delay = clamp(delay, 0, 15);
1152 reg = clk_readl(c->reg);
1153 reg &= ~SDMMC_CLK_INT_FB_DLY_MASK;
1154 reg |= SDMMC_CLK_INT_FB_SEL;
1155 reg |= delay << SDMMC_CLK_INT_FB_DLY_SHIFT;
1156 clk_writel(reg, c->reg);
1157
1158 spin_unlock_irqrestore(&c->spinlock, flags);
1159}
1160
1161/* External memory controller clock ops */
1162static void tegra2_emc_clk_init(struct clk *c)
1163{
1164 tegra2_periph_clk_init(c);
1165 c->max_rate = clk_get_rate_locked(c);
1166}
1167
1168static long tegra2_emc_clk_round_rate(struct clk *c, unsigned long rate)
1169{
1170 long emc_rate;
1171 long clk_rate;
1172
1173 /*
1174 * The slowest entry in the EMC clock table that is at least as
1175 * fast as rate.
1176 */
1177 emc_rate = tegra_emc_round_rate(rate);
1178 if (emc_rate < 0)
1179 return c->max_rate;
1180
1181 /*
1182 * The fastest rate the PLL will generate that is at most the
1183 * requested rate.
1184 */
1185 clk_rate = tegra2_periph_clk_round_rate(c, emc_rate);
1186
1187 /*
1188 * If this fails, and emc_rate > clk_rate, it's because the maximum
1189 * rate in the EMC tables is larger than the maximum rate of the EMC
1190 * clock. The EMC clock's max rate is the rate it was running when the
1191 * kernel booted. Such a mismatch is probably due to using the wrong
1192 * BCT, i.e. using a Tegra20 BCT with an EMC table written for Tegra25.
1193 */
1194 WARN_ONCE(emc_rate != clk_rate,
1195 "emc_rate %ld != clk_rate %ld",
1196 emc_rate, clk_rate);
1197
1198 return emc_rate;
1199}
1200
1201static int tegra2_emc_clk_set_rate(struct clk *c, unsigned long rate)
1202{
1203 int ret;
1204 /*
1205 * The Tegra2 memory controller has an interlock with the clock
1206 * block that allows memory shadowed registers to be updated,
1207 * and then transfer them to the main registers at the same
1208 * time as the clock update without glitches.
1209 */
1210 ret = tegra_emc_set_rate(rate);
1211 if (ret < 0)
1212 return ret;
1213
1214 ret = tegra2_periph_clk_set_rate(c, rate);
1215 udelay(1);
1216
1217 return ret;
1218}
1219
1220static struct clk_ops tegra_emc_clk_ops = {
1221 .init = &tegra2_emc_clk_init,
1222 .enable = &tegra2_periph_clk_enable,
1223 .disable = &tegra2_periph_clk_disable,
1224 .set_parent = &tegra2_periph_clk_set_parent,
1225 .set_rate = &tegra2_emc_clk_set_rate,
1226 .round_rate = &tegra2_emc_clk_round_rate,
1227 .reset = &tegra2_periph_clk_reset,
1228};
1229
1230/* Clock doubler ops */
1231static void tegra2_clk_double_init(struct clk *c)
1232{
1233 c->mul = 2;
1234 c->div = 1;
1235 c->state = ON;
1236
1237 if (!c->u.periph.clk_num)
1238 return;
1239
1240 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
1241 PERIPH_CLK_TO_ENB_BIT(c)))
1242 c->state = OFF;
1243};
1244
1245static int tegra2_clk_double_set_rate(struct clk *c, unsigned long rate)
1246{
1247 if (rate != 2 * clk_get_rate(c->parent))
1248 return -EINVAL;
1249 c->mul = 2;
1250 c->div = 1;
1251 return 0;
1252}
1253
1254static struct clk_ops tegra_clk_double_ops = {
1255 .init = &tegra2_clk_double_init,
1256 .enable = &tegra2_periph_clk_enable,
1257 .disable = &tegra2_periph_clk_disable,
1258 .set_rate = &tegra2_clk_double_set_rate,
1259};
1260
1261/* Audio sync clock ops */
1262static void tegra2_audio_sync_clk_init(struct clk *c)
1263{
1264 int source;
1265 const struct clk_mux_sel *sel;
1266 u32 val = clk_readl(c->reg);
1267 c->state = (val & (1<<4)) ? OFF : ON;
1268 source = val & 0xf;
1269 for (sel = c->inputs; sel->input != NULL; sel++)
1270 if (sel->value == source)
1271 break;
1272 BUG_ON(sel->input == NULL);
1273 c->parent = sel->input;
1274}
1275
1276static int tegra2_audio_sync_clk_enable(struct clk *c)
1277{
1278 clk_writel(0, c->reg);
1279 return 0;
1280}
1281
1282static void tegra2_audio_sync_clk_disable(struct clk *c)
1283{
1284 clk_writel(1, c->reg);
1285}
1286
1287static int tegra2_audio_sync_clk_set_parent(struct clk *c, struct clk *p)
1288{
1289 u32 val;
1290 const struct clk_mux_sel *sel;
1291 for (sel = c->inputs; sel->input != NULL; sel++) {
1292 if (sel->input == p) {
1293 val = clk_readl(c->reg);
1294 val &= ~0xf;
1295 val |= sel->value;
1296
1297 if (c->refcnt)
1298 clk_enable(p);
1299
1300 clk_writel(val, c->reg);
1301
1302 if (c->refcnt && c->parent)
1303 clk_disable(c->parent);
1304
1305 clk_reparent(c, p);
1306 return 0;
1307 }
1308 }
1309
1310 return -EINVAL;
1311}
1312
1313static struct clk_ops tegra_audio_sync_clk_ops = {
1314 .init = tegra2_audio_sync_clk_init,
1315 .enable = tegra2_audio_sync_clk_enable,
1316 .disable = tegra2_audio_sync_clk_disable,
1317 .set_parent = tegra2_audio_sync_clk_set_parent,
1318};
1319
1320/* cdev1 and cdev2 (dap_mclk1 and dap_mclk2) ops */
1321
1322static void tegra2_cdev_clk_init(struct clk *c)
1323{
1324 /* We could un-tristate the cdev1 or cdev2 pingroup here; this is
1325 * currently done in the pinmux code. */
1326 c->state = ON;
1327
1328 BUG_ON(!c->u.periph.clk_num);
1329
1330 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
1331 PERIPH_CLK_TO_ENB_BIT(c)))
1332 c->state = OFF;
1333}
1334
1335static int tegra2_cdev_clk_enable(struct clk *c)
1336{
1337 BUG_ON(!c->u.periph.clk_num);
1338
1339 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1340 CLK_OUT_ENB_SET + PERIPH_CLK_TO_ENB_SET_REG(c));
1341 return 0;
1342}
1343
1344static void tegra2_cdev_clk_disable(struct clk *c)
1345{
1346 BUG_ON(!c->u.periph.clk_num);
1347
1348 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1349 CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1350}
1351
1352static struct clk_ops tegra_cdev_clk_ops = {
1353 .init = &tegra2_cdev_clk_init,
1354 .enable = &tegra2_cdev_clk_enable,
1355 .disable = &tegra2_cdev_clk_disable,
1356};
1357
1358/* shared bus ops */
1359/*
1360 * Some clocks may have multiple downstream users that need to request a
1361 * higher clock rate. Shared bus clocks provide a unique shared_bus_user
1362 * clock to each user. The frequency of the bus is set to the highest
1363 * enabled shared_bus_user clock, with a minimum value set by the
1364 * shared bus.
1365 */
1366static int tegra_clk_shared_bus_update(struct clk *bus)
1367{
1368 struct clk *c;
1369 unsigned long rate = bus->min_rate;
1370
1371 list_for_each_entry(c, &bus->shared_bus_list, u.shared_bus_user.node)
1372 if (c->u.shared_bus_user.enabled)
1373 rate = max(c->u.shared_bus_user.rate, rate);
1374
1375 if (rate == clk_get_rate_locked(bus))
1376 return 0;
1377
1378 return clk_set_rate_locked(bus, rate);
1379};
1380
1381static void tegra_clk_shared_bus_init(struct clk *c)
1382{
1383 unsigned long flags;
1384
1385 c->max_rate = c->parent->max_rate;
1386 c->u.shared_bus_user.rate = c->parent->max_rate;
1387 c->state = OFF;
1388 c->set = true;
1389
1390 spin_lock_irqsave(&c->parent->spinlock, flags);
1391
1392 list_add_tail(&c->u.shared_bus_user.node,
1393 &c->parent->shared_bus_list);
1394
1395 spin_unlock_irqrestore(&c->parent->spinlock, flags);
1396}
1397
1398static int tegra_clk_shared_bus_set_rate(struct clk *c, unsigned long rate)
1399{
1400 unsigned long flags;
1401 int ret;
1402 long new_rate = rate;
1403
1404 new_rate = clk_round_rate(c->parent, new_rate);
1405 if (new_rate < 0)
1406 return new_rate;
1407
1408 spin_lock_irqsave(&c->parent->spinlock, flags);
1409
1410 c->u.shared_bus_user.rate = new_rate;
1411 ret = tegra_clk_shared_bus_update(c->parent);
1412
1413 spin_unlock_irqrestore(&c->parent->spinlock, flags);
1414
1415 return ret;
1416}
1417
1418static long tegra_clk_shared_bus_round_rate(struct clk *c, unsigned long rate)
1419{
1420 return clk_round_rate(c->parent, rate);
1421}
1422
1423static int tegra_clk_shared_bus_enable(struct clk *c)
1424{
1425 unsigned long flags;
1426 int ret;
1427
1428 spin_lock_irqsave(&c->parent->spinlock, flags);
1429
1430 c->u.shared_bus_user.enabled = true;
1431 ret = tegra_clk_shared_bus_update(c->parent);
1432
1433 spin_unlock_irqrestore(&c->parent->spinlock, flags);
1434
1435 return ret;
1436}
1437
1438static void tegra_clk_shared_bus_disable(struct clk *c)
1439{
1440 unsigned long flags;
1441 int ret;
1442
1443 spin_lock_irqsave(&c->parent->spinlock, flags);
1444
1445 c->u.shared_bus_user.enabled = false;
1446 ret = tegra_clk_shared_bus_update(c->parent);
1447 WARN_ON_ONCE(ret);
1448
1449 spin_unlock_irqrestore(&c->parent->spinlock, flags);
1450}
1451
1452static struct clk_ops tegra_clk_shared_bus_ops = {
1453 .init = tegra_clk_shared_bus_init,
1454 .enable = tegra_clk_shared_bus_enable,
1455 .disable = tegra_clk_shared_bus_disable,
1456 .set_rate = tegra_clk_shared_bus_set_rate,
1457 .round_rate = tegra_clk_shared_bus_round_rate,
1458};
1459
1460
1461/* Clock definitions */
1462static struct clk tegra_clk_32k = {
1463 .name = "clk_32k",
1464 .rate = 32768,
1465 .ops = NULL,
1466 .max_rate = 32768,
1467};
1468
1469static struct clk_pll_freq_table tegra_pll_s_freq_table[] = {
1470 {32768, 12000000, 366, 1, 1, 0},
1471 {32768, 13000000, 397, 1, 1, 0},
1472 {32768, 19200000, 586, 1, 1, 0},
1473 {32768, 26000000, 793, 1, 1, 0},
1474 {0, 0, 0, 0, 0, 0},
1475};
1476
1477static struct clk tegra_pll_s = {
1478 .name = "pll_s",
1479 .flags = PLL_ALT_MISC_REG,
1480 .ops = &tegra_pll_ops,
1481 .parent = &tegra_clk_32k,
1482 .max_rate = 26000000,
1483 .reg = 0xf0,
1484 .u.pll = {
1485 .input_min = 32768,
1486 .input_max = 32768,
1487 .cf_min = 0, /* FIXME */
1488 .cf_max = 0, /* FIXME */
1489 .vco_min = 12000000,
1490 .vco_max = 26000000,
1491 .freq_table = tegra_pll_s_freq_table,
1492 .lock_delay = 300,
1493 },
1494};
1495
1496static struct clk_mux_sel tegra_clk_m_sel[] = {
1497 { .input = &tegra_clk_32k, .value = 0},
1498 { .input = &tegra_pll_s, .value = 1},
1499 { NULL , 0},
1500};
1501
1502static struct clk tegra_clk_m = {
1503 .name = "clk_m",
1504 .flags = ENABLE_ON_INIT,
1505 .ops = &tegra_clk_m_ops,
1506 .inputs = tegra_clk_m_sel,
1507 .reg = 0x1fc,
1508 .reg_shift = 28,
1509 .max_rate = 26000000,
1510};
1511
1512static struct clk_pll_freq_table tegra_pll_c_freq_table[] = {
1513 { 12000000, 600000000, 600, 12, 1, 8 },
1514 { 13000000, 600000000, 600, 13, 1, 8 },
1515 { 19200000, 600000000, 500, 16, 1, 6 },
1516 { 26000000, 600000000, 600, 26, 1, 8 },
1517 { 0, 0, 0, 0, 0, 0 },
1518};
1519
1520static struct clk tegra_pll_c = {
1521 .name = "pll_c",
1522 .flags = PLL_HAS_CPCON,
1523 .ops = &tegra_pll_ops,
1524 .reg = 0x80,
1525 .parent = &tegra_clk_m,
1526 .max_rate = 600000000,
1527 .u.pll = {
1528 .input_min = 2000000,
1529 .input_max = 31000000,
1530 .cf_min = 1000000,
1531 .cf_max = 6000000,
1532 .vco_min = 20000000,
1533 .vco_max = 1400000000,
1534 .freq_table = tegra_pll_c_freq_table,
1535 .lock_delay = 300,
1536 },
1537};
1538
1539static struct clk tegra_pll_c_out1 = {
1540 .name = "pll_c_out1",
1541 .ops = &tegra_pll_div_ops,
1542 .flags = DIV_U71,
1543 .parent = &tegra_pll_c,
1544 .reg = 0x84,
1545 .reg_shift = 0,
1546 .max_rate = 600000000,
1547};
1548
1549static struct clk_pll_freq_table tegra_pll_m_freq_table[] = {
1550 { 12000000, 666000000, 666, 12, 1, 8},
1551 { 13000000, 666000000, 666, 13, 1, 8},
1552 { 19200000, 666000000, 555, 16, 1, 8},
1553 { 26000000, 666000000, 666, 26, 1, 8},
1554 { 12000000, 600000000, 600, 12, 1, 8},
1555 { 13000000, 600000000, 600, 13, 1, 8},
1556 { 19200000, 600000000, 375, 12, 1, 6},
1557 { 26000000, 600000000, 600, 26, 1, 8},
1558 { 0, 0, 0, 0, 0, 0 },
1559};
1560
1561static struct clk tegra_pll_m = {
1562 .name = "pll_m",
1563 .flags = PLL_HAS_CPCON,
1564 .ops = &tegra_pll_ops,
1565 .reg = 0x90,
1566 .parent = &tegra_clk_m,
1567 .max_rate = 800000000,
1568 .u.pll = {
1569 .input_min = 2000000,
1570 .input_max = 31000000,
1571 .cf_min = 1000000,
1572 .cf_max = 6000000,
1573 .vco_min = 20000000,
1574 .vco_max = 1200000000,
1575 .freq_table = tegra_pll_m_freq_table,
1576 .lock_delay = 300,
1577 },
1578};
1579
1580static struct clk tegra_pll_m_out1 = {
1581 .name = "pll_m_out1",
1582 .ops = &tegra_pll_div_ops,
1583 .flags = DIV_U71,
1584 .parent = &tegra_pll_m,
1585 .reg = 0x94,
1586 .reg_shift = 0,
1587 .max_rate = 600000000,
1588};
1589
1590static struct clk_pll_freq_table tegra_pll_p_freq_table[] = {
1591 { 12000000, 216000000, 432, 12, 2, 8},
1592 { 13000000, 216000000, 432, 13, 2, 8},
1593 { 19200000, 216000000, 90, 4, 2, 1},
1594 { 26000000, 216000000, 432, 26, 2, 8},
1595 { 12000000, 432000000, 432, 12, 1, 8},
1596 { 13000000, 432000000, 432, 13, 1, 8},
1597 { 19200000, 432000000, 90, 4, 1, 1},
1598 { 26000000, 432000000, 432, 26, 1, 8},
1599 { 0, 0, 0, 0, 0, 0 },
1600};
1601
1602static struct clk tegra_pll_p = {
1603 .name = "pll_p",
1604 .flags = ENABLE_ON_INIT | PLL_FIXED | PLL_HAS_CPCON,
1605 .ops = &tegra_pll_ops,
1606 .reg = 0xa0,
1607 .parent = &tegra_clk_m,
1608 .max_rate = 432000000,
1609 .u.pll = {
1610 .input_min = 2000000,
1611 .input_max = 31000000,
1612 .cf_min = 1000000,
1613 .cf_max = 6000000,
1614 .vco_min = 20000000,
1615 .vco_max = 1400000000,
1616 .freq_table = tegra_pll_p_freq_table,
1617 .lock_delay = 300,
1618 },
1619};
1620
1621static struct clk tegra_pll_p_out1 = {
1622 .name = "pll_p_out1",
1623 .ops = &tegra_pll_div_ops,
1624 .flags = ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED,
1625 .parent = &tegra_pll_p,
1626 .reg = 0xa4,
1627 .reg_shift = 0,
1628 .max_rate = 432000000,
1629};
1630
1631static struct clk tegra_pll_p_out2 = {
1632 .name = "pll_p_out2",
1633 .ops = &tegra_pll_div_ops,
1634 .flags = ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED,
1635 .parent = &tegra_pll_p,
1636 .reg = 0xa4,
1637 .reg_shift = 16,
1638 .max_rate = 432000000,
1639};
1640
1641static struct clk tegra_pll_p_out3 = {
1642 .name = "pll_p_out3",
1643 .ops = &tegra_pll_div_ops,
1644 .flags = ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED,
1645 .parent = &tegra_pll_p,
1646 .reg = 0xa8,
1647 .reg_shift = 0,
1648 .max_rate = 432000000,
1649};
1650
1651static struct clk tegra_pll_p_out4 = {
1652 .name = "pll_p_out4",
1653 .ops = &tegra_pll_div_ops,
1654 .flags = ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED,
1655 .parent = &tegra_pll_p,
1656 .reg = 0xa8,
1657 .reg_shift = 16,
1658 .max_rate = 432000000,
1659};
1660
1661static struct clk_pll_freq_table tegra_pll_a_freq_table[] = {
1662 { 28800000, 56448000, 49, 25, 1, 1},
1663 { 28800000, 73728000, 64, 25, 1, 1},
1664 { 28800000, 24000000, 5, 6, 1, 1},
1665 { 0, 0, 0, 0, 0, 0 },
1666};
1667
1668static struct clk tegra_pll_a = {
1669 .name = "pll_a",
1670 .flags = PLL_HAS_CPCON,
1671 .ops = &tegra_pll_ops,
1672 .reg = 0xb0,
1673 .parent = &tegra_pll_p_out1,
1674 .max_rate = 73728000,
1675 .u.pll = {
1676 .input_min = 2000000,
1677 .input_max = 31000000,
1678 .cf_min = 1000000,
1679 .cf_max = 6000000,
1680 .vco_min = 20000000,
1681 .vco_max = 1400000000,
1682 .freq_table = tegra_pll_a_freq_table,
1683 .lock_delay = 300,
1684 },
1685};
1686
1687static struct clk tegra_pll_a_out0 = {
1688 .name = "pll_a_out0",
1689 .ops = &tegra_pll_div_ops,
1690 .flags = DIV_U71,
1691 .parent = &tegra_pll_a,
1692 .reg = 0xb4,
1693 .reg_shift = 0,
1694 .max_rate = 73728000,
1695};
1696
1697static struct clk_pll_freq_table tegra_pll_d_freq_table[] = {
1698 { 12000000, 216000000, 216, 12, 1, 4},
1699 { 13000000, 216000000, 216, 13, 1, 4},
1700 { 19200000, 216000000, 135, 12, 1, 3},
1701 { 26000000, 216000000, 216, 26, 1, 4},
1702
1703 { 12000000, 594000000, 594, 12, 1, 8},
1704 { 13000000, 594000000, 594, 13, 1, 8},
1705 { 19200000, 594000000, 495, 16, 1, 8},
1706 { 26000000, 594000000, 594, 26, 1, 8},
1707
1708 { 12000000, 1000000000, 1000, 12, 1, 12},
1709 { 13000000, 1000000000, 1000, 13, 1, 12},
1710 { 19200000, 1000000000, 625, 12, 1, 8},
1711 { 26000000, 1000000000, 1000, 26, 1, 12},
1712
1713 { 0, 0, 0, 0, 0, 0 },
1714};
1715
1716static struct clk tegra_pll_d = {
1717 .name = "pll_d",
1718 .flags = PLL_HAS_CPCON | PLLD,
1719 .ops = &tegra_pll_ops,
1720 .reg = 0xd0,
1721 .parent = &tegra_clk_m,
1722 .max_rate = 1000000000,
1723 .u.pll = {
1724 .input_min = 2000000,
1725 .input_max = 40000000,
1726 .cf_min = 1000000,
1727 .cf_max = 6000000,
1728 .vco_min = 40000000,
1729 .vco_max = 1000000000,
1730 .freq_table = tegra_pll_d_freq_table,
1731 .lock_delay = 1000,
1732 },
1733};
1734
1735static struct clk tegra_pll_d_out0 = {
1736 .name = "pll_d_out0",
1737 .ops = &tegra_pll_div_ops,
1738 .flags = DIV_2 | PLLD,
1739 .parent = &tegra_pll_d,
1740 .max_rate = 500000000,
1741};
1742
1743static struct clk_pll_freq_table tegra_pll_u_freq_table[] = {
1744 { 12000000, 480000000, 960, 12, 2, 0},
1745 { 13000000, 480000000, 960, 13, 2, 0},
1746 { 19200000, 480000000, 200, 4, 2, 0},
1747 { 26000000, 480000000, 960, 26, 2, 0},
1748 { 0, 0, 0, 0, 0, 0 },
1749};
1750
1751static struct clk tegra_pll_u = {
1752 .name = "pll_u",
1753 .flags = PLLU,
1754 .ops = &tegra_pll_ops,
1755 .reg = 0xc0,
1756 .parent = &tegra_clk_m,
1757 .max_rate = 480000000,
1758 .u.pll = {
1759 .input_min = 2000000,
1760 .input_max = 40000000,
1761 .cf_min = 1000000,
1762 .cf_max = 6000000,
1763 .vco_min = 480000000,
1764 .vco_max = 960000000,
1765 .freq_table = tegra_pll_u_freq_table,
1766 .lock_delay = 1000,
1767 },
1768};
1769
1770static struct clk_pll_freq_table tegra_pll_x_freq_table[] = {
1771 /* 1 GHz */
1772 { 12000000, 1000000000, 1000, 12, 1, 12},
1773 { 13000000, 1000000000, 1000, 13, 1, 12},
1774 { 19200000, 1000000000, 625, 12, 1, 8},
1775 { 26000000, 1000000000, 1000, 26, 1, 12},
1776
1777 /* 912 MHz */
1778 { 12000000, 912000000, 912, 12, 1, 12},
1779 { 13000000, 912000000, 912, 13, 1, 12},
1780 { 19200000, 912000000, 760, 16, 1, 8},
1781 { 26000000, 912000000, 912, 26, 1, 12},
1782
1783 /* 816 MHz */
1784 { 12000000, 816000000, 816, 12, 1, 12},
1785 { 13000000, 816000000, 816, 13, 1, 12},
1786 { 19200000, 816000000, 680, 16, 1, 8},
1787 { 26000000, 816000000, 816, 26, 1, 12},
1788
1789 /* 760 MHz */
1790 { 12000000, 760000000, 760, 12, 1, 12},
1791 { 13000000, 760000000, 760, 13, 1, 12},
1792 { 19200000, 760000000, 950, 24, 1, 8},
1793 { 26000000, 760000000, 760, 26, 1, 12},
1794
1795 /* 750 MHz */
1796 { 12000000, 750000000, 750, 12, 1, 12},
1797 { 13000000, 750000000, 750, 13, 1, 12},
1798 { 19200000, 750000000, 625, 16, 1, 8},
1799 { 26000000, 750000000, 750, 26, 1, 12},
1800
1801 /* 608 MHz */
1802 { 12000000, 608000000, 608, 12, 1, 12},
1803 { 13000000, 608000000, 608, 13, 1, 12},
1804 { 19200000, 608000000, 380, 12, 1, 8},
1805 { 26000000, 608000000, 608, 26, 1, 12},
1806
1807 /* 456 MHz */
1808 { 12000000, 456000000, 456, 12, 1, 12},
1809 { 13000000, 456000000, 456, 13, 1, 12},
1810 { 19200000, 456000000, 380, 16, 1, 8},
1811 { 26000000, 456000000, 456, 26, 1, 12},
1812
1813 /* 312 MHz */
1814 { 12000000, 312000000, 312, 12, 1, 12},
1815 { 13000000, 312000000, 312, 13, 1, 12},
1816 { 19200000, 312000000, 260, 16, 1, 8},
1817 { 26000000, 312000000, 312, 26, 1, 12},
1818
1819 { 0, 0, 0, 0, 0, 0 },
1820};
1821
1822static struct clk tegra_pll_x = {
1823 .name = "pll_x",
1824 .flags = PLL_HAS_CPCON | PLL_ALT_MISC_REG,
1825 .ops = &tegra_pllx_ops,
1826 .reg = 0xe0,
1827 .parent = &tegra_clk_m,
1828 .max_rate = 1000000000,
1829 .u.pll = {
1830 .input_min = 2000000,
1831 .input_max = 31000000,
1832 .cf_min = 1000000,
1833 .cf_max = 6000000,
1834 .vco_min = 20000000,
1835 .vco_max = 1200000000,
1836 .freq_table = tegra_pll_x_freq_table,
1837 .lock_delay = 300,
1838 },
1839};
1840
1841static struct clk_pll_freq_table tegra_pll_e_freq_table[] = {
1842 { 12000000, 100000000, 200, 24, 1, 0 },
1843 { 0, 0, 0, 0, 0, 0 },
1844};
1845
1846static struct clk tegra_pll_e = {
1847 .name = "pll_e",
1848 .flags = PLL_ALT_MISC_REG,
1849 .ops = &tegra_plle_ops,
1850 .parent = &tegra_clk_m,
1851 .reg = 0xe8,
1852 .max_rate = 100000000,
1853 .u.pll = {
1854 .input_min = 12000000,
1855 .input_max = 12000000,
1856 .freq_table = tegra_pll_e_freq_table,
1857 },
1858};
1859
1860static struct clk tegra_clk_d = {
1861 .name = "clk_d",
1862 .flags = PERIPH_NO_RESET,
1863 .ops = &tegra_clk_double_ops,
1864 .reg = 0x34,
1865 .reg_shift = 12,
1866 .parent = &tegra_clk_m,
1867 .max_rate = 52000000,
1868 .u.periph = {
1869 .clk_num = 90,
1870 },
1871};
1872
1873/* dap_mclk1, belongs to the cdev1 pingroup. */
1874static struct clk tegra_clk_cdev1 = {
1875 .name = "cdev1",
1876 .ops = &tegra_cdev_clk_ops,
1877 .rate = 26000000,
1878 .max_rate = 26000000,
1879 .u.periph = {
1880 .clk_num = 94,
1881 },
1882};
1883
1884/* dap_mclk2, belongs to the cdev2 pingroup. */
1885static struct clk tegra_clk_cdev2 = {
1886 .name = "cdev2",
1887 .ops = &tegra_cdev_clk_ops,
1888 .rate = 26000000,
1889 .max_rate = 26000000,
1890 .u.periph = {
1891 .clk_num = 93,
1892 },
1893};
1894
1895/* initialized before peripheral clocks */
1896static struct clk_mux_sel mux_audio_sync_clk[8+1];
1897static const struct audio_sources {
1898 const char *name;
1899 int value;
1900} mux_audio_sync_clk_sources[] = {
1901 { .name = "spdif_in", .value = 0 },
1902 { .name = "i2s1", .value = 1 },
1903 { .name = "i2s2", .value = 2 },
1904 { .name = "pll_a_out0", .value = 4 },
1905#if 0 /* FIXME: not implemented */
1906 { .name = "ac97", .value = 3 },
1907 { .name = "ext_audio_clk2", .value = 5 },
1908 { .name = "ext_audio_clk1", .value = 6 },
1909 { .name = "ext_vimclk", .value = 7 },
1910#endif
1911 { NULL, 0 }
1912};
1913
1914static struct clk tegra_clk_audio = {
1915 .name = "audio",
1916 .inputs = mux_audio_sync_clk,
1917 .reg = 0x38,
1918 .max_rate = 73728000,
1919 .ops = &tegra_audio_sync_clk_ops
1920};
1921
1922static struct clk tegra_clk_audio_2x = {
1923 .name = "audio_2x",
1924 .flags = PERIPH_NO_RESET,
1925 .max_rate = 48000000,
1926 .ops = &tegra_clk_double_ops,
1927 .reg = 0x34,
1928 .reg_shift = 8,
1929 .parent = &tegra_clk_audio,
1930 .u.periph = {
1931 .clk_num = 89,
1932 },
1933};
1934
1935static struct clk_lookup tegra_audio_clk_lookups[] = {
1936 { .con_id = "audio", .clk = &tegra_clk_audio },
1937 { .con_id = "audio_2x", .clk = &tegra_clk_audio_2x }
1938};
1939
1940/* This is called after peripheral clocks are initialized, as the
1941 * audio_sync clock depends on some of the peripheral clocks.
1942 */
1943
1944static void init_audio_sync_clock_mux(void)
1945{
1946 int i;
1947 struct clk_mux_sel *sel = mux_audio_sync_clk;
1948 const struct audio_sources *src = mux_audio_sync_clk_sources;
1949 struct clk_lookup *lookup;
1950
1951 for (i = 0; src->name; i++, sel++, src++) {
1952 sel->input = tegra_get_clock_by_name(src->name);
1953 if (!sel->input)
1954 pr_err("%s: could not find clk %s\n", __func__,
1955 src->name);
1956 sel->value = src->value;
1957 }
1958
1959 lookup = tegra_audio_clk_lookups;
1960 for (i = 0; i < ARRAY_SIZE(tegra_audio_clk_lookups); i++, lookup++) {
1961 clk_init(lookup->clk);
1962 clkdev_add(lookup);
1963 }
1964}
1965
1966static struct clk_mux_sel mux_cclk[] = {
1967 { .input = &tegra_clk_m, .value = 0},
1968 { .input = &tegra_pll_c, .value = 1},
1969 { .input = &tegra_clk_32k, .value = 2},
1970 { .input = &tegra_pll_m, .value = 3},
1971 { .input = &tegra_pll_p, .value = 4},
1972 { .input = &tegra_pll_p_out4, .value = 5},
1973 { .input = &tegra_pll_p_out3, .value = 6},
1974 { .input = &tegra_clk_d, .value = 7},
1975 { .input = &tegra_pll_x, .value = 8},
1976 { NULL, 0},
1977};
1978
1979static struct clk_mux_sel mux_sclk[] = {
1980 { .input = &tegra_clk_m, .value = 0},
1981 { .input = &tegra_pll_c_out1, .value = 1},
1982 { .input = &tegra_pll_p_out4, .value = 2},
1983 { .input = &tegra_pll_p_out3, .value = 3},
1984 { .input = &tegra_pll_p_out2, .value = 4},
1985 { .input = &tegra_clk_d, .value = 5},
1986 { .input = &tegra_clk_32k, .value = 6},
1987 { .input = &tegra_pll_m_out1, .value = 7},
1988 { NULL, 0},
1989};
1990
1991static struct clk tegra_clk_cclk = {
1992 .name = "cclk",
1993 .inputs = mux_cclk,
1994 .reg = 0x20,
1995 .ops = &tegra_super_ops,
1996 .max_rate = 1000000000,
1997};
1998
1999static struct clk tegra_clk_sclk = {
2000 .name = "sclk",
2001 .inputs = mux_sclk,
2002 .reg = 0x28,
2003 .ops = &tegra_super_ops,
2004 .max_rate = 240000000,
2005 .min_rate = 120000000,
2006};
2007
2008static struct clk tegra_clk_virtual_cpu = {
2009 .name = "cpu",
2010 .parent = &tegra_clk_cclk,
2011 .ops = &tegra_cpu_ops,
2012 .max_rate = 1000000000,
2013 .u.cpu = {
2014 .main = &tegra_pll_x,
2015 .backup = &tegra_pll_p,
2016 },
2017};
2018
2019static struct clk tegra_clk_cop = {
2020 .name = "cop",
2021 .parent = &tegra_clk_sclk,
2022 .ops = &tegra_cop_ops,
2023 .max_rate = 240000000,
2024};
2025
2026static struct clk tegra_clk_hclk = {
2027 .name = "hclk",
2028 .flags = DIV_BUS,
2029 .parent = &tegra_clk_sclk,
2030 .reg = 0x30,
2031 .reg_shift = 4,
2032 .ops = &tegra_bus_ops,
2033 .max_rate = 240000000,
2034};
2035
2036static struct clk tegra_clk_pclk = {
2037 .name = "pclk",
2038 .flags = DIV_BUS,
2039 .parent = &tegra_clk_hclk,
2040 .reg = 0x30,
2041 .reg_shift = 0,
2042 .ops = &tegra_bus_ops,
2043 .max_rate = 120000000,
2044};
2045
2046static struct clk tegra_clk_blink = {
2047 .name = "blink",
2048 .parent = &tegra_clk_32k,
2049 .reg = 0x40,
2050 .ops = &tegra_blink_clk_ops,
2051 .max_rate = 32768,
2052};
2053
2054static struct clk_mux_sel mux_pllm_pllc_pllp_plla[] = {
2055 { .input = &tegra_pll_m, .value = 0},
2056 { .input = &tegra_pll_c, .value = 1},
2057 { .input = &tegra_pll_p, .value = 2},
2058 { .input = &tegra_pll_a_out0, .value = 3},
2059 { NULL, 0},
2060};
2061
2062static struct clk_mux_sel mux_pllm_pllc_pllp_clkm[] = {
2063 { .input = &tegra_pll_m, .value = 0},
2064 { .input = &tegra_pll_c, .value = 1},
2065 { .input = &tegra_pll_p, .value = 2},
2066 { .input = &tegra_clk_m, .value = 3},
2067 { NULL, 0},
2068};
2069
2070static struct clk_mux_sel mux_pllp_pllc_pllm_clkm[] = {
2071 { .input = &tegra_pll_p, .value = 0},
2072 { .input = &tegra_pll_c, .value = 1},
2073 { .input = &tegra_pll_m, .value = 2},
2074 { .input = &tegra_clk_m, .value = 3},
2075 { NULL, 0},
2076};
2077
2078static struct clk_mux_sel mux_pllaout0_audio2x_pllp_clkm[] = {
2079 {.input = &tegra_pll_a_out0, .value = 0},
2080 {.input = &tegra_clk_audio_2x, .value = 1},
2081 {.input = &tegra_pll_p, .value = 2},
2082 {.input = &tegra_clk_m, .value = 3},
2083 { NULL, 0},
2084};
2085
2086static struct clk_mux_sel mux_pllp_plld_pllc_clkm[] = {
2087 {.input = &tegra_pll_p, .value = 0},
2088 {.input = &tegra_pll_d_out0, .value = 1},
2089 {.input = &tegra_pll_c, .value = 2},
2090 {.input = &tegra_clk_m, .value = 3},
2091 { NULL, 0},
2092};
2093
2094static struct clk_mux_sel mux_pllp_pllc_audio_clkm_clk32[] = {
2095 {.input = &tegra_pll_p, .value = 0},
2096 {.input = &tegra_pll_c, .value = 1},
2097 {.input = &tegra_clk_audio, .value = 2},
2098 {.input = &tegra_clk_m, .value = 3},
2099 {.input = &tegra_clk_32k, .value = 4},
2100 { NULL, 0},
2101};
2102
2103static struct clk_mux_sel mux_pllp_pllc_pllm[] = {
2104 {.input = &tegra_pll_p, .value = 0},
2105 {.input = &tegra_pll_c, .value = 1},
2106 {.input = &tegra_pll_m, .value = 2},
2107 { NULL, 0},
2108};
2109
2110static struct clk_mux_sel mux_clk_m[] = {
2111 { .input = &tegra_clk_m, .value = 0},
2112 { NULL, 0},
2113};
2114
2115static struct clk_mux_sel mux_pllp_out3[] = {
2116 { .input = &tegra_pll_p_out3, .value = 0},
2117 { NULL, 0},
2118};
2119
2120static struct clk_mux_sel mux_plld[] = {
2121 { .input = &tegra_pll_d, .value = 0},
2122 { NULL, 0},
2123};
2124
2125static struct clk_mux_sel mux_clk_32k[] = {
2126 { .input = &tegra_clk_32k, .value = 0},
2127 { NULL, 0},
2128};
2129
2130static struct clk_mux_sel mux_pclk[] = {
2131 { .input = &tegra_clk_pclk, .value = 0},
2132 { NULL, 0},
2133};
2134
2135static struct clk tegra_clk_emc = {
2136 .name = "emc",
2137 .ops = &tegra_emc_clk_ops,
2138 .reg = 0x19c,
2139 .max_rate = 800000000,
2140 .inputs = mux_pllm_pllc_pllp_clkm,
2141 .flags = MUX | DIV_U71 | PERIPH_EMC_ENB,
2142 .u.periph = {
2143 .clk_num = 57,
2144 },
2145};
2146
2147#define PERIPH_CLK(_name, _dev, _con, _clk_num, _reg, _max, _inputs, _flags) \
2148 { \
2149 .name = _name, \
2150 .lookup = { \
2151 .dev_id = _dev, \
2152 .con_id = _con, \
2153 }, \
2154 .ops = &tegra_periph_clk_ops, \
2155 .reg = _reg, \
2156 .inputs = _inputs, \
2157 .flags = _flags, \
2158 .max_rate = _max, \
2159 .u.periph = { \
2160 .clk_num = _clk_num, \
2161 }, \
2162 }
2163
2164#define SHARED_CLK(_name, _dev, _con, _parent) \
2165 { \
2166 .name = _name, \
2167 .lookup = { \
2168 .dev_id = _dev, \
2169 .con_id = _con, \
2170 }, \
2171 .ops = &tegra_clk_shared_bus_ops, \
2172 .parent = _parent, \
2173 }
2174
2175static struct clk tegra_list_clks[] = {
2176 PERIPH_CLK("apbdma", "tegra-apbdma", NULL, 34, 0, 108000000, mux_pclk, 0),
2177 PERIPH_CLK("rtc", "rtc-tegra", NULL, 4, 0, 32768, mux_clk_32k, PERIPH_NO_RESET),
2178 PERIPH_CLK("timer", "timer", NULL, 5, 0, 26000000, mux_clk_m, 0),
2179 PERIPH_CLK("i2s1", "tegra20-i2s.0", NULL, 11, 0x100, 26000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71),
2180 PERIPH_CLK("i2s2", "tegra20-i2s.1", NULL, 18, 0x104, 26000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71),
2181 PERIPH_CLK("spdif_out", "spdif_out", NULL, 10, 0x108, 100000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71),
2182 PERIPH_CLK("spdif_in", "spdif_in", NULL, 10, 0x10c, 100000000, mux_pllp_pllc_pllm, MUX | DIV_U71),
2183 PERIPH_CLK("pwm", "tegra-pwm", NULL, 17, 0x110, 432000000, mux_pllp_pllc_audio_clkm_clk32, MUX | DIV_U71 | MUX_PWM),
2184 PERIPH_CLK("spi", "spi", NULL, 43, 0x114, 40000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2185 PERIPH_CLK("xio", "xio", NULL, 45, 0x120, 150000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2186 PERIPH_CLK("twc", "twc", NULL, 16, 0x12c, 150000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2187 PERIPH_CLK("sbc1", "spi_tegra.0", NULL, 41, 0x134, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2188 PERIPH_CLK("sbc2", "spi_tegra.1", NULL, 44, 0x118, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2189 PERIPH_CLK("sbc3", "spi_tegra.2", NULL, 46, 0x11c, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2190 PERIPH_CLK("sbc4", "spi_tegra.3", NULL, 68, 0x1b4, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2191 PERIPH_CLK("ide", "ide", NULL, 25, 0x144, 100000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* requires min voltage */
2192 PERIPH_CLK("ndflash", "tegra_nand", NULL, 13, 0x160, 164000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
2193 PERIPH_CLK("vfir", "vfir", NULL, 7, 0x168, 72000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2194 PERIPH_CLK("sdmmc1", "sdhci-tegra.0", NULL, 14, 0x150, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
2195 PERIPH_CLK("sdmmc2", "sdhci-tegra.1", NULL, 9, 0x154, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
2196 PERIPH_CLK("sdmmc3", "sdhci-tegra.2", NULL, 69, 0x1bc, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
2197 PERIPH_CLK("sdmmc4", "sdhci-tegra.3", NULL, 15, 0x164, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
2198 PERIPH_CLK("vcp", "tegra-avp", "vcp", 29, 0, 250000000, mux_clk_m, 0),
2199 PERIPH_CLK("bsea", "tegra-avp", "bsea", 62, 0, 250000000, mux_clk_m, 0),
2200 PERIPH_CLK("bsev", "tegra-aes", "bsev", 63, 0, 250000000, mux_clk_m, 0),
2201 PERIPH_CLK("vde", "tegra-avp", "vde", 61, 0x1c8, 250000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage and process_id */
2202 PERIPH_CLK("csite", "csite", NULL, 73, 0x1d4, 144000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* max rate ??? */
2203 /* FIXME: what is la? */
2204 PERIPH_CLK("la", "la", NULL, 76, 0x1f8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2205 PERIPH_CLK("owr", "tegra_w1", NULL, 71, 0x1cc, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2206 PERIPH_CLK("nor", "nor", NULL, 42, 0x1d0, 92000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* requires min voltage */
2207 PERIPH_CLK("mipi", "mipi", NULL, 50, 0x174, 60000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
2208 PERIPH_CLK("i2c1", "tegra-i2c.0", NULL, 12, 0x124, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16),
2209 PERIPH_CLK("i2c2", "tegra-i2c.1", NULL, 54, 0x198, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16),
2210 PERIPH_CLK("i2c3", "tegra-i2c.2", NULL, 67, 0x1b8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16),
2211 PERIPH_CLK("dvc", "tegra-i2c.3", NULL, 47, 0x128, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16),
2212 PERIPH_CLK("i2c1_i2c", "tegra-i2c.0", "i2c", 0, 0, 72000000, mux_pllp_out3, 0),
2213 PERIPH_CLK("i2c2_i2c", "tegra-i2c.1", "i2c", 0, 0, 72000000, mux_pllp_out3, 0),
2214 PERIPH_CLK("i2c3_i2c", "tegra-i2c.2", "i2c", 0, 0, 72000000, mux_pllp_out3, 0),
2215 PERIPH_CLK("dvc_i2c", "tegra-i2c.3", "i2c", 0, 0, 72000000, mux_pllp_out3, 0),
2216 PERIPH_CLK("uarta", "tegra-uart.0", NULL, 6, 0x178, 600000000, mux_pllp_pllc_pllm_clkm, MUX),
2217 PERIPH_CLK("uartb", "tegra-uart.1", NULL, 7, 0x17c, 600000000, mux_pllp_pllc_pllm_clkm, MUX),
2218 PERIPH_CLK("uartc", "tegra-uart.2", NULL, 55, 0x1a0, 600000000, mux_pllp_pllc_pllm_clkm, MUX),
2219 PERIPH_CLK("uartd", "tegra-uart.3", NULL, 65, 0x1c0, 600000000, mux_pllp_pllc_pllm_clkm, MUX),
2220 PERIPH_CLK("uarte", "tegra-uart.4", NULL, 66, 0x1c4, 600000000, mux_pllp_pllc_pllm_clkm, MUX),
2221 PERIPH_CLK("3d", "3d", NULL, 24, 0x158, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_MANUAL_RESET), /* scales with voltage and process_id */
2222 PERIPH_CLK("2d", "2d", NULL, 21, 0x15c, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */
2223 PERIPH_CLK("vi", "tegra_camera", "vi", 20, 0x148, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */
2224 PERIPH_CLK("vi_sensor", "tegra_camera", "vi_sensor", 20, 0x1a8, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_NO_RESET), /* scales with voltage and process_id */
2225 PERIPH_CLK("epp", "epp", NULL, 19, 0x16c, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */
2226 PERIPH_CLK("mpe", "mpe", NULL, 60, 0x170, 250000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */
2227 PERIPH_CLK("host1x", "host1x", NULL, 28, 0x180, 166000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */
2228 PERIPH_CLK("cve", "cve", NULL, 49, 0x140, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */
2229 PERIPH_CLK("tvo", "tvo", NULL, 49, 0x188, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */
2230 PERIPH_CLK("hdmi", "hdmi", NULL, 51, 0x18c, 600000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */
2231 PERIPH_CLK("tvdac", "tvdac", NULL, 53, 0x194, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */
2232 PERIPH_CLK("disp1", "tegradc.0", NULL, 27, 0x138, 600000000, mux_pllp_plld_pllc_clkm, MUX), /* scales with voltage and process_id */
2233 PERIPH_CLK("disp2", "tegradc.1", NULL, 26, 0x13c, 600000000, mux_pllp_plld_pllc_clkm, MUX), /* scales with voltage and process_id */
2234 PERIPH_CLK("usbd", "fsl-tegra-udc", NULL, 22, 0, 480000000, mux_clk_m, 0), /* requires min voltage */
2235 PERIPH_CLK("usb2", "tegra-ehci.1", NULL, 58, 0, 480000000, mux_clk_m, 0), /* requires min voltage */
2236 PERIPH_CLK("usb3", "tegra-ehci.2", NULL, 59, 0, 480000000, mux_clk_m, 0), /* requires min voltage */
2237 PERIPH_CLK("dsi", "dsi", NULL, 48, 0, 500000000, mux_plld, 0), /* scales with voltage */
2238 PERIPH_CLK("csi", "tegra_camera", "csi", 52, 0, 72000000, mux_pllp_out3, 0),
2239 PERIPH_CLK("isp", "tegra_camera", "isp", 23, 0, 150000000, mux_clk_m, 0), /* same frequency as VI */
2240 PERIPH_CLK("csus", "tegra_camera", "csus", 92, 0, 150000000, mux_clk_m, PERIPH_NO_RESET),
2241 PERIPH_CLK("pex", NULL, "pex", 70, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET),
2242 PERIPH_CLK("afi", NULL, "afi", 72, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET),
2243 PERIPH_CLK("pcie_xclk", NULL, "pcie_xclk", 74, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET),
2244
2245 SHARED_CLK("avp.sclk", "tegra-avp", "sclk", &tegra_clk_sclk),
2246 SHARED_CLK("avp.emc", "tegra-avp", "emc", &tegra_clk_emc),
2247 SHARED_CLK("cpu.emc", "cpu", "emc", &tegra_clk_emc),
2248 SHARED_CLK("disp1.emc", "tegradc.0", "emc", &tegra_clk_emc),
2249 SHARED_CLK("disp2.emc", "tegradc.1", "emc", &tegra_clk_emc),
2250 SHARED_CLK("hdmi.emc", "hdmi", "emc", &tegra_clk_emc),
2251 SHARED_CLK("host.emc", "tegra_grhost", "emc", &tegra_clk_emc),
2252 SHARED_CLK("usbd.emc", "fsl-tegra-udc", "emc", &tegra_clk_emc),
2253 SHARED_CLK("usb1.emc", "tegra-ehci.0", "emc", &tegra_clk_emc),
2254 SHARED_CLK("usb2.emc", "tegra-ehci.1", "emc", &tegra_clk_emc),
2255 SHARED_CLK("usb3.emc", "tegra-ehci.2", "emc", &tegra_clk_emc),
2256};
2257
2258#define CLK_DUPLICATE(_name, _dev, _con) \
2259 { \
2260 .name = _name, \
2261 .lookup = { \
2262 .dev_id = _dev, \
2263 .con_id = _con, \
2264 }, \
2265 }
2266
2267/* Some clocks may be used by different drivers depending on the board
2268 * configuration. List those here to register them twice in the clock lookup
2269 * table under two names.
2270 */
2271static struct clk_duplicate tegra_clk_duplicates[] = {
2272 CLK_DUPLICATE("uarta", "serial8250.0", NULL),
2273 CLK_DUPLICATE("uartb", "serial8250.1", NULL),
2274 CLK_DUPLICATE("uartc", "serial8250.2", NULL),
2275 CLK_DUPLICATE("uartd", "serial8250.3", NULL),
2276 CLK_DUPLICATE("uarte", "serial8250.4", NULL),
2277 CLK_DUPLICATE("usbd", "utmip-pad", NULL),
2278 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL),
2279 CLK_DUPLICATE("usbd", "tegra-otg", NULL),
2280 CLK_DUPLICATE("hdmi", "tegradc.0", "hdmi"),
2281 CLK_DUPLICATE("hdmi", "tegradc.1", "hdmi"),
2282 CLK_DUPLICATE("host1x", "tegra_grhost", "host1x"),
2283 CLK_DUPLICATE("2d", "tegra_grhost", "gr2d"),
2284 CLK_DUPLICATE("3d", "tegra_grhost", "gr3d"),
2285 CLK_DUPLICATE("epp", "tegra_grhost", "epp"),
2286 CLK_DUPLICATE("mpe", "tegra_grhost", "mpe"),
2287 CLK_DUPLICATE("cop", "tegra-avp", "cop"),
2288 CLK_DUPLICATE("vde", "tegra-aes", "vde"),
2289};
2290
2291#define CLK(dev, con, ck) \
2292 { \
2293 .dev_id = dev, \
2294 .con_id = con, \
2295 .clk = ck, \
2296 }
2297
2298static struct clk *tegra_ptr_clks[] = {
2299 &tegra_clk_32k,
2300 &tegra_pll_s,
2301 &tegra_clk_m,
2302 &tegra_pll_m,
2303 &tegra_pll_m_out1,
2304 &tegra_pll_c,
2305 &tegra_pll_c_out1,
2306 &tegra_pll_p,
2307 &tegra_pll_p_out1,
2308 &tegra_pll_p_out2,
2309 &tegra_pll_p_out3,
2310 &tegra_pll_p_out4,
2311 &tegra_pll_a,
2312 &tegra_pll_a_out0,
2313 &tegra_pll_d,
2314 &tegra_pll_d_out0,
2315 &tegra_pll_u,
2316 &tegra_pll_x,
2317 &tegra_pll_e,
2318 &tegra_clk_cclk,
2319 &tegra_clk_sclk,
2320 &tegra_clk_hclk,
2321 &tegra_clk_pclk,
2322 &tegra_clk_d,
2323 &tegra_clk_cdev1,
2324 &tegra_clk_cdev2,
2325 &tegra_clk_virtual_cpu,
2326 &tegra_clk_blink,
2327 &tegra_clk_cop,
2328 &tegra_clk_emc,
2329};
2330
2331static void tegra2_init_one_clock(struct clk *c)
2332{
2333 clk_init(c);
2334 INIT_LIST_HEAD(&c->shared_bus_list);
2335 if (!c->lookup.dev_id && !c->lookup.con_id)
2336 c->lookup.con_id = c->name;
2337 c->lookup.clk = c;
2338 clkdev_add(&c->lookup);
2339}
2340
2341void __init tegra2_init_clocks(void)
2342{
2343 int i;
2344 struct clk *c;
2345
2346 for (i = 0; i < ARRAY_SIZE(tegra_ptr_clks); i++)
2347 tegra2_init_one_clock(tegra_ptr_clks[i]);
2348
2349 for (i = 0; i < ARRAY_SIZE(tegra_list_clks); i++)
2350 tegra2_init_one_clock(&tegra_list_clks[i]);
2351
2352 for (i = 0; i < ARRAY_SIZE(tegra_clk_duplicates); i++) {
2353 c = tegra_get_clock_by_name(tegra_clk_duplicates[i].name);
2354 if (!c) {
2355 pr_err("%s: Unknown duplicate clock %s\n", __func__,
2356 tegra_clk_duplicates[i].name);
2357 continue;
2358 }
2359
2360 tegra_clk_duplicates[i].lookup.clk = c;
2361 clkdev_add(&tegra_clk_duplicates[i].lookup);
2362 }
2363
2364 init_audio_sync_clock_mux();
2365}
2366
2367#ifdef CONFIG_PM
2368static u32 clk_rst_suspend[RST_DEVICES_NUM + CLK_OUT_ENB_NUM +
2369 PERIPH_CLK_SOURCE_NUM + 22];
2370
2371void tegra_clk_suspend(void)
2372{
2373 unsigned long off, i;
2374 u32 *ctx = clk_rst_suspend;
2375
2376 *ctx++ = clk_readl(OSC_CTRL) & OSC_CTRL_MASK;
2377 *ctx++ = clk_readl(tegra_pll_c.reg + PLL_BASE);
2378 *ctx++ = clk_readl(tegra_pll_c.reg + PLL_MISC(&tegra_pll_c));
2379 *ctx++ = clk_readl(tegra_pll_a.reg + PLL_BASE);
2380 *ctx++ = clk_readl(tegra_pll_a.reg + PLL_MISC(&tegra_pll_a));
2381 *ctx++ = clk_readl(tegra_pll_s.reg + PLL_BASE);
2382 *ctx++ = clk_readl(tegra_pll_s.reg + PLL_MISC(&tegra_pll_s));
2383 *ctx++ = clk_readl(tegra_pll_d.reg + PLL_BASE);
2384 *ctx++ = clk_readl(tegra_pll_d.reg + PLL_MISC(&tegra_pll_d));
2385 *ctx++ = clk_readl(tegra_pll_u.reg + PLL_BASE);
2386 *ctx++ = clk_readl(tegra_pll_u.reg + PLL_MISC(&tegra_pll_u));
2387
2388 *ctx++ = clk_readl(tegra_pll_m_out1.reg);
2389 *ctx++ = clk_readl(tegra_pll_a_out0.reg);
2390 *ctx++ = clk_readl(tegra_pll_c_out1.reg);
2391
2392 *ctx++ = clk_readl(tegra_clk_cclk.reg);
2393 *ctx++ = clk_readl(tegra_clk_cclk.reg + SUPER_CLK_DIVIDER);
2394
2395 *ctx++ = clk_readl(tegra_clk_sclk.reg);
2396 *ctx++ = clk_readl(tegra_clk_sclk.reg + SUPER_CLK_DIVIDER);
2397 *ctx++ = clk_readl(tegra_clk_pclk.reg);
2398
2399 *ctx++ = clk_readl(tegra_clk_audio.reg);
2400
2401 for (off = PERIPH_CLK_SOURCE_I2S1; off <= PERIPH_CLK_SOURCE_OSC;
2402 off += 4) {
2403 if (off == PERIPH_CLK_SOURCE_EMC)
2404 continue;
2405 *ctx++ = clk_readl(off);
2406 }
2407
2408 off = RST_DEVICES;
2409 for (i = 0; i < RST_DEVICES_NUM; i++, off += 4)
2410 *ctx++ = clk_readl(off);
2411
2412 off = CLK_OUT_ENB;
2413 for (i = 0; i < CLK_OUT_ENB_NUM; i++, off += 4)
2414 *ctx++ = clk_readl(off);
2415
2416 *ctx++ = clk_readl(MISC_CLK_ENB);
2417 *ctx++ = clk_readl(CLK_MASK_ARM);
2418
2419 BUG_ON(ctx - clk_rst_suspend != ARRAY_SIZE(clk_rst_suspend));
2420}
2421
2422void tegra_clk_resume(void)
2423{
2424 unsigned long off, i;
2425 const u32 *ctx = clk_rst_suspend;
2426 u32 val;
2427
2428 val = clk_readl(OSC_CTRL) & ~OSC_CTRL_MASK;
2429 val |= *ctx++;
2430 clk_writel(val, OSC_CTRL);
2431
2432 clk_writel(*ctx++, tegra_pll_c.reg + PLL_BASE);
2433 clk_writel(*ctx++, tegra_pll_c.reg + PLL_MISC(&tegra_pll_c));
2434 clk_writel(*ctx++, tegra_pll_a.reg + PLL_BASE);
2435 clk_writel(*ctx++, tegra_pll_a.reg + PLL_MISC(&tegra_pll_a));
2436 clk_writel(*ctx++, tegra_pll_s.reg + PLL_BASE);
2437 clk_writel(*ctx++, tegra_pll_s.reg + PLL_MISC(&tegra_pll_s));
2438 clk_writel(*ctx++, tegra_pll_d.reg + PLL_BASE);
2439 clk_writel(*ctx++, tegra_pll_d.reg + PLL_MISC(&tegra_pll_d));
2440 clk_writel(*ctx++, tegra_pll_u.reg + PLL_BASE);
2441 clk_writel(*ctx++, tegra_pll_u.reg + PLL_MISC(&tegra_pll_u));
2442 udelay(1000);
2443
2444 clk_writel(*ctx++, tegra_pll_m_out1.reg);
2445 clk_writel(*ctx++, tegra_pll_a_out0.reg);
2446 clk_writel(*ctx++, tegra_pll_c_out1.reg);
2447
2448 clk_writel(*ctx++, tegra_clk_cclk.reg);
2449 clk_writel(*ctx++, tegra_clk_cclk.reg + SUPER_CLK_DIVIDER);
2450
2451 clk_writel(*ctx++, tegra_clk_sclk.reg);
2452 clk_writel(*ctx++, tegra_clk_sclk.reg + SUPER_CLK_DIVIDER);
2453 clk_writel(*ctx++, tegra_clk_pclk.reg);
2454
2455 clk_writel(*ctx++, tegra_clk_audio.reg);
2456
2457 /* enable all clocks before configuring clock sources */
2458 clk_writel(0xbffffff9ul, CLK_OUT_ENB);
2459 clk_writel(0xfefffff7ul, CLK_OUT_ENB + 4);
2460 clk_writel(0x77f01bfful, CLK_OUT_ENB + 8);
2461 wmb();
2462
2463 for (off = PERIPH_CLK_SOURCE_I2S1; off <= PERIPH_CLK_SOURCE_OSC;
2464 off += 4) {
2465 if (off == PERIPH_CLK_SOURCE_EMC)
2466 continue;
2467 clk_writel(*ctx++, off);
2468 }
2469 wmb();
2470
2471 off = RST_DEVICES;
2472 for (i = 0; i < RST_DEVICES_NUM; i++, off += 4)
2473 clk_writel(*ctx++, off);
2474 wmb();
2475
2476 off = CLK_OUT_ENB;
2477 for (i = 0; i < CLK_OUT_ENB_NUM; i++, off += 4)
2478 clk_writel(*ctx++, off);
2479 wmb();
2480
2481 clk_writel(*ctx++, MISC_CLK_ENB);
2482 clk_writel(*ctx++, CLK_MASK_ARM);
2483}
2484#endif
diff --git a/arch/arm/mach-tegra/tegra30_clocks.c b/arch/arm/mach-tegra/tegra30_clocks.c
index 6674f100e16..5cd502c2716 100644
--- a/arch/arm/mach-tegra/tegra30_clocks.c
+++ b/arch/arm/mach-tegra/tegra30_clocks.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-tegra/tegra30_clocks.c 2 * arch/arm/mach-tegra/tegra30_clocks.c
3 * 3 *
4 * Copyright (c) 2010-2011 NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2010-2012 NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -35,6 +35,7 @@
35 35
36#include "clock.h" 36#include "clock.h"
37#include "fuse.h" 37#include "fuse.h"
38#include "tegra_cpu_car.h"
38 39
39#define USE_PLL_LOCK_BITS 0 40#define USE_PLL_LOCK_BITS 0
40 41
@@ -299,6 +300,16 @@
299/* FIXME: recommended safety delay after lock is detected */ 300/* FIXME: recommended safety delay after lock is detected */
300#define PLL_POST_LOCK_DELAY 100 301#define PLL_POST_LOCK_DELAY 100
301 302
303/* Tegra CPU clock and reset control regs */
304#define TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX 0x4c
305#define TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET 0x340
306#define TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR 0x344
307#define TEGRA30_CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR 0x34c
308#define TEGRA30_CLK_RST_CONTROLLER_CPU_CMPLX_STATUS 0x470
309
310#define CPU_CLOCK(cpu) (0x1 << (8 + cpu))
311#define CPU_RESET(cpu) (0x1111ul << (cpu))
312
302/** 313/**
303* Structure defining the fields for USB UTMI clocks Parameters. 314* Structure defining the fields for USB UTMI clocks Parameters.
304*/ 315*/
@@ -365,30 +376,32 @@ static void __iomem *misc_gp_hidrev_base = IO_ADDRESS(TEGRA_APB_MISC_BASE);
365static int tegra_periph_clk_enable_refcount[CLK_OUT_ENB_NUM * 32]; 376static int tegra_periph_clk_enable_refcount[CLK_OUT_ENB_NUM * 32];
366 377
367#define clk_writel(value, reg) \ 378#define clk_writel(value, reg) \
368 __raw_writel(value, (u32)reg_clk_base + (reg)) 379 __raw_writel(value, reg_clk_base + (reg))
369#define clk_readl(reg) \ 380#define clk_readl(reg) \
370 __raw_readl((u32)reg_clk_base + (reg)) 381 __raw_readl(reg_clk_base + (reg))
371#define pmc_writel(value, reg) \ 382#define pmc_writel(value, reg) \
372 __raw_writel(value, (u32)reg_pmc_base + (reg)) 383 __raw_writel(value, reg_pmc_base + (reg))
373#define pmc_readl(reg) \ 384#define pmc_readl(reg) \
374 __raw_readl((u32)reg_pmc_base + (reg)) 385 __raw_readl(reg_pmc_base + (reg))
375#define chipid_readl() \ 386#define chipid_readl() \
376 __raw_readl((u32)misc_gp_hidrev_base + MISC_GP_HIDREV) 387 __raw_readl(misc_gp_hidrev_base + MISC_GP_HIDREV)
377 388
378#define clk_writel_delay(value, reg) \ 389#define clk_writel_delay(value, reg) \
379 do { \ 390 do { \
380 __raw_writel((value), (u32)reg_clk_base + (reg)); \ 391 __raw_writel((value), reg_clk_base + (reg)); \
381 udelay(2); \ 392 udelay(2); \
382 } while (0) 393 } while (0)
383 394
384 395static inline int clk_set_div(struct clk_tegra *c, u32 n)
385static inline int clk_set_div(struct clk *c, u32 n)
386{ 396{
387 return clk_set_rate(c, (clk_get_rate(c->parent) + n-1) / n); 397 struct clk *clk = c->hw.clk;
398
399 return clk_set_rate(clk,
400 (__clk_get_rate(__clk_get_parent(clk)) + n - 1) / n);
388} 401}
389 402
390static inline u32 periph_clk_to_reg( 403static inline u32 periph_clk_to_reg(
391 struct clk *c, u32 reg_L, u32 reg_V, int offs) 404 struct clk_tegra *c, u32 reg_L, u32 reg_V, int offs)
392{ 405{
393 u32 reg = c->u.periph.clk_num / 32; 406 u32 reg = c->u.periph.clk_num / 32;
394 BUG_ON(reg >= RST_DEVICES_NUM); 407 BUG_ON(reg >= RST_DEVICES_NUM);
@@ -470,15 +483,32 @@ static int clk_div16_get_divider(unsigned long parent_rate, unsigned long rate)
470 return divider_u16 - 1; 483 return divider_u16 - 1;
471} 484}
472 485
486static unsigned long tegra30_clk_fixed_recalc_rate(struct clk_hw *hw,
487 unsigned long parent_rate)
488{
489 return to_clk_tegra(hw)->fixed_rate;
490}
491
492struct clk_ops tegra30_clk_32k_ops = {
493 .recalc_rate = tegra30_clk_fixed_recalc_rate,
494};
495
473/* clk_m functions */ 496/* clk_m functions */
474static unsigned long tegra30_clk_m_autodetect_rate(struct clk *c) 497static unsigned long tegra30_clk_m_recalc_rate(struct clk_hw *hw,
498 unsigned long parent_rate)
499{
500 if (!to_clk_tegra(hw)->fixed_rate)
501 to_clk_tegra(hw)->fixed_rate = clk_measure_input_freq();
502 return to_clk_tegra(hw)->fixed_rate;
503}
504
505static void tegra30_clk_m_init(struct clk_hw *hw)
475{ 506{
476 u32 osc_ctrl = clk_readl(OSC_CTRL); 507 u32 osc_ctrl = clk_readl(OSC_CTRL);
477 u32 auto_clock_control = osc_ctrl & ~OSC_CTRL_OSC_FREQ_MASK; 508 u32 auto_clock_control = osc_ctrl & ~OSC_CTRL_OSC_FREQ_MASK;
478 u32 pll_ref_div = osc_ctrl & OSC_CTRL_PLL_REF_DIV_MASK; 509 u32 pll_ref_div = osc_ctrl & OSC_CTRL_PLL_REF_DIV_MASK;
479 510
480 c->rate = clk_measure_input_freq(); 511 switch (to_clk_tegra(hw)->fixed_rate) {
481 switch (c->rate) {
482 case 12000000: 512 case 12000000:
483 auto_clock_control |= OSC_CTRL_OSC_FREQ_12MHZ; 513 auto_clock_control |= OSC_CTRL_OSC_FREQ_12MHZ;
484 BUG_ON(pll_ref_div != OSC_CTRL_PLL_REF_DIV_1); 514 BUG_ON(pll_ref_div != OSC_CTRL_PLL_REF_DIV_1);
@@ -508,46 +538,44 @@ static unsigned long tegra30_clk_m_autodetect_rate(struct clk *c)
508 BUG_ON(pll_ref_div != OSC_CTRL_PLL_REF_DIV_4); 538 BUG_ON(pll_ref_div != OSC_CTRL_PLL_REF_DIV_4);
509 break; 539 break;
510 default: 540 default:
511 pr_err("%s: Unexpected clock rate %ld", __func__, c->rate); 541 pr_err("%s: Unexpected clock rate %ld", __func__,
542 to_clk_tegra(hw)->fixed_rate);
512 BUG(); 543 BUG();
513 } 544 }
514 clk_writel(auto_clock_control, OSC_CTRL); 545 clk_writel(auto_clock_control, OSC_CTRL);
515 return c->rate;
516} 546}
517 547
518static void tegra30_clk_m_init(struct clk *c) 548struct clk_ops tegra30_clk_m_ops = {
519{ 549 .init = tegra30_clk_m_init,
520 pr_debug("%s on clock %s\n", __func__, c->name); 550 .recalc_rate = tegra30_clk_m_recalc_rate,
521 tegra30_clk_m_autodetect_rate(c); 551};
522}
523 552
524static int tegra30_clk_m_enable(struct clk *c) 553static unsigned long tegra30_clk_m_div_recalc_rate(struct clk_hw *hw,
554 unsigned long parent_rate)
525{ 555{
526 pr_debug("%s on clock %s\n", __func__, c->name); 556 struct clk_tegra *c = to_clk_tegra(hw);
527 return 0; 557 u64 rate = parent_rate;
528}
529 558
530static void tegra30_clk_m_disable(struct clk *c) 559 if (c->mul != 0 && c->div != 0) {
531{ 560 rate *= c->mul;
532 pr_debug("%s on clock %s\n", __func__, c->name); 561 rate += c->div - 1; /* round up */
533 WARN(1, "Attempting to disable main SoC clock\n"); 562 do_div(rate, c->div);
534} 563 }
535 564
536static struct clk_ops tegra_clk_m_ops = { 565 return rate;
537 .init = tegra30_clk_m_init, 566}
538 .enable = tegra30_clk_m_enable,
539 .disable = tegra30_clk_m_disable,
540};
541 567
542static struct clk_ops tegra_clk_m_div_ops = { 568struct clk_ops tegra_clk_m_div_ops = {
543 .enable = tegra30_clk_m_enable, 569 .recalc_rate = tegra30_clk_m_div_recalc_rate,
544}; 570};
545 571
546/* PLL reference divider functions */ 572/* PLL reference divider functions */
547static void tegra30_pll_ref_init(struct clk *c) 573static unsigned long tegra30_pll_ref_recalc_rate(struct clk_hw *hw,
574 unsigned long parent_rate)
548{ 575{
576 struct clk_tegra *c = to_clk_tegra(hw);
577 unsigned long rate = parent_rate;
549 u32 pll_ref_div = clk_readl(OSC_CTRL) & OSC_CTRL_PLL_REF_DIV_MASK; 578 u32 pll_ref_div = clk_readl(OSC_CTRL) & OSC_CTRL_PLL_REF_DIV_MASK;
550 pr_debug("%s on clock %s\n", __func__, c->name);
551 579
552 switch (pll_ref_div) { 580 switch (pll_ref_div) {
553 case OSC_CTRL_PLL_REF_DIV_1: 581 case OSC_CTRL_PLL_REF_DIV_1:
@@ -564,13 +592,18 @@ static void tegra30_pll_ref_init(struct clk *c)
564 BUG(); 592 BUG();
565 } 593 }
566 c->mul = 1; 594 c->mul = 1;
567 c->state = ON; 595
596 if (c->mul != 0 && c->div != 0) {
597 rate *= c->mul;
598 rate += c->div - 1; /* round up */
599 do_div(rate, c->div);
600 }
601
602 return rate;
568} 603}
569 604
570static struct clk_ops tegra_pll_ref_ops = { 605struct clk_ops tegra_pll_ref_ops = {
571 .init = tegra30_pll_ref_init, 606 .recalc_rate = tegra30_pll_ref_recalc_rate,
572 .enable = tegra30_clk_m_enable,
573 .disable = tegra30_clk_m_disable,
574}; 607};
575 608
576/* super clock functions */ 609/* super clock functions */
@@ -581,56 +614,50 @@ static struct clk_ops tegra_pll_ref_ops = {
581 * only when its parent is a fixed rate PLL, since we can't change PLL rate 614 * only when its parent is a fixed rate PLL, since we can't change PLL rate
582 * in this case. 615 * in this case.
583 */ 616 */
584static void tegra30_super_clk_init(struct clk *c) 617static void tegra30_super_clk_init(struct clk_hw *hw)
585{ 618{
586 u32 val; 619 struct clk_tegra *c = to_clk_tegra(hw);
587 int source; 620 struct clk_tegra *p =
588 int shift; 621 to_clk_tegra(__clk_get_hw(__clk_get_parent(hw->clk)));
589 const struct clk_mux_sel *sel;
590 val = clk_readl(c->reg + SUPER_CLK_MUX);
591 c->state = ON;
592 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
593 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
594 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
595 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
596 source = (val >> shift) & SUPER_SOURCE_MASK;
597 if (c->flags & DIV_2)
598 source |= val & SUPER_LP_DIV2_BYPASS;
599 for (sel = c->inputs; sel->input != NULL; sel++) {
600 if (sel->value == source)
601 break;
602 }
603 BUG_ON(sel->input == NULL);
604 c->parent = sel->input;
605 622
623 c->state = ON;
606 if (c->flags & DIV_U71) { 624 if (c->flags & DIV_U71) {
607 /* Init safe 7.1 divider value (does not affect PLLX path) */ 625 /* Init safe 7.1 divider value (does not affect PLLX path) */
608 clk_writel(SUPER_CLOCK_DIV_U71_MIN << SUPER_CLOCK_DIV_U71_SHIFT, 626 clk_writel(SUPER_CLOCK_DIV_U71_MIN << SUPER_CLOCK_DIV_U71_SHIFT,
609 c->reg + SUPER_CLK_DIVIDER); 627 c->reg + SUPER_CLK_DIVIDER);
610 c->mul = 2; 628 c->mul = 2;
611 c->div = 2; 629 c->div = 2;
612 if (!(c->parent->flags & PLLX)) 630 if (!(p->flags & PLLX))
613 c->div += SUPER_CLOCK_DIV_U71_MIN; 631 c->div += SUPER_CLOCK_DIV_U71_MIN;
614 } else 632 } else
615 clk_writel(0, c->reg + SUPER_CLK_DIVIDER); 633 clk_writel(0, c->reg + SUPER_CLK_DIVIDER);
616} 634}
617 635
618static int tegra30_super_clk_enable(struct clk *c) 636static u8 tegra30_super_clk_get_parent(struct clk_hw *hw)
619{ 637{
620 return 0; 638 struct clk_tegra *c = to_clk_tegra(hw);
621} 639 u32 val;
640 int source;
641 int shift;
622 642
623static void tegra30_super_clk_disable(struct clk *c) 643 val = clk_readl(c->reg + SUPER_CLK_MUX);
624{ 644 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
625 /* since tegra 3 has 2 CPU super clocks - low power lp-mode clock and 645 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
626 geared up g-mode super clock - mode switch may request to disable 646 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
627 either of them; accept request with no affect on h/w */ 647 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
648 source = (val >> shift) & SUPER_SOURCE_MASK;
649 if (c->flags & DIV_2)
650 source |= val & SUPER_LP_DIV2_BYPASS;
651
652 return source;
628} 653}
629 654
630static int tegra30_super_clk_set_parent(struct clk *c, struct clk *p) 655static int tegra30_super_clk_set_parent(struct clk_hw *hw, u8 index)
631{ 656{
657 struct clk_tegra *c = to_clk_tegra(hw);
658 struct clk_tegra *p =
659 to_clk_tegra(__clk_get_hw(clk_get_parent(hw->clk)));
632 u32 val; 660 u32 val;
633 const struct clk_mux_sel *sel;
634 int shift; 661 int shift;
635 662
636 val = clk_readl(c->reg + SUPER_CLK_MUX); 663 val = clk_readl(c->reg + SUPER_CLK_MUX);
@@ -638,48 +665,36 @@ static int tegra30_super_clk_set_parent(struct clk *c, struct clk *p)
638 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE)); 665 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
639 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ? 666 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
640 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT; 667 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
641 for (sel = c->inputs; sel->input != NULL; sel++) {
642 if (sel->input == p) {
643 /* For LP mode super-clock switch between PLLX direct
644 and divided-by-2 outputs is allowed only when other
645 than PLLX clock source is current parent */
646 if ((c->flags & DIV_2) && (p->flags & PLLX) &&
647 ((sel->value ^ val) & SUPER_LP_DIV2_BYPASS)) {
648 if (c->parent->flags & PLLX)
649 return -EINVAL;
650 val ^= SUPER_LP_DIV2_BYPASS;
651 clk_writel_delay(val, c->reg);
652 }
653 val &= ~(SUPER_SOURCE_MASK << shift);
654 val |= (sel->value & SUPER_SOURCE_MASK) << shift;
655
656 /* 7.1 divider for CPU super-clock does not affect
657 PLLX path */
658 if (c->flags & DIV_U71) {
659 u32 div = 0;
660 if (!(p->flags & PLLX)) {
661 div = clk_readl(c->reg +
662 SUPER_CLK_DIVIDER);
663 div &= SUPER_CLOCK_DIV_U71_MASK;
664 div >>= SUPER_CLOCK_DIV_U71_SHIFT;
665 }
666 c->div = div + 2;
667 c->mul = 2;
668 }
669
670 if (c->refcnt)
671 clk_enable(p);
672
673 clk_writel_delay(val, c->reg);
674 668
675 if (c->refcnt && c->parent) 669 /* For LP mode super-clock switch between PLLX direct
676 clk_disable(c->parent); 670 and divided-by-2 outputs is allowed only when other
671 than PLLX clock source is current parent */
672 if ((c->flags & DIV_2) && (p->flags & PLLX) &&
673 ((index ^ val) & SUPER_LP_DIV2_BYPASS)) {
674 if (p->flags & PLLX)
675 return -EINVAL;
676 val ^= SUPER_LP_DIV2_BYPASS;
677 clk_writel_delay(val, c->reg);
678 }
679 val &= ~(SUPER_SOURCE_MASK << shift);
680 val |= (index & SUPER_SOURCE_MASK) << shift;
677 681
678 clk_reparent(c, p); 682 /* 7.1 divider for CPU super-clock does not affect
679 return 0; 683 PLLX path */
684 if (c->flags & DIV_U71) {
685 u32 div = 0;
686 if (!(p->flags & PLLX)) {
687 div = clk_readl(c->reg +
688 SUPER_CLK_DIVIDER);
689 div &= SUPER_CLOCK_DIV_U71_MASK;
690 div >>= SUPER_CLOCK_DIV_U71_SHIFT;
680 } 691 }
692 c->div = div + 2;
693 c->mul = 2;
681 } 694 }
682 return -EINVAL; 695 clk_writel_delay(val, c->reg);
696
697 return 0;
683} 698}
684 699
685/* 700/*
@@ -691,10 +706,15 @@ static int tegra30_super_clk_set_parent(struct clk *c, struct clk *p)
691 * rate of this PLL can't be changed, and it has many other children. In 706 * rate of this PLL can't be changed, and it has many other children. In
692 * this case use 7.1 fractional divider to adjust the super clock rate. 707 * this case use 7.1 fractional divider to adjust the super clock rate.
693 */ 708 */
694static int tegra30_super_clk_set_rate(struct clk *c, unsigned long rate) 709static int tegra30_super_clk_set_rate(struct clk_hw *hw, unsigned long rate,
710 unsigned long parent_rate)
695{ 711{
696 if ((c->flags & DIV_U71) && (c->parent->flags & PLL_FIXED)) { 712 struct clk_tegra *c = to_clk_tegra(hw);
697 int div = clk_div71_get_divider(c->parent->u.pll.fixed_rate, 713 struct clk *parent = __clk_get_parent(hw->clk);
714 struct clk_tegra *cparent = to_clk_tegra(__clk_get_hw(parent));
715
716 if ((c->flags & DIV_U71) && (cparent->flags & PLL_FIXED)) {
717 int div = clk_div71_get_divider(parent_rate,
698 rate, c->flags, ROUND_DIVIDER_DOWN); 718 rate, c->flags, ROUND_DIVIDER_DOWN);
699 div = max(div, SUPER_CLOCK_DIV_U71_MIN); 719 div = max(div, SUPER_CLOCK_DIV_U71_MIN);
700 720
@@ -704,55 +724,86 @@ static int tegra30_super_clk_set_rate(struct clk *c, unsigned long rate)
704 c->mul = 2; 724 c->mul = 2;
705 return 0; 725 return 0;
706 } 726 }
707 return clk_set_rate(c->parent, rate); 727 return 0;
728}
729
730static unsigned long tegra30_super_clk_recalc_rate(struct clk_hw *hw,
731 unsigned long parent_rate)
732{
733 struct clk_tegra *c = to_clk_tegra(hw);
734 u64 rate = parent_rate;
735
736 if (c->mul != 0 && c->div != 0) {
737 rate *= c->mul;
738 rate += c->div - 1; /* round up */
739 do_div(rate, c->div);
740 }
741
742 return rate;
708} 743}
709 744
710static struct clk_ops tegra_super_ops = { 745static long tegra30_super_clk_round_rate(struct clk_hw *hw, unsigned long rate,
711 .init = tegra30_super_clk_init, 746 unsigned long *prate)
712 .enable = tegra30_super_clk_enable, 747{
713 .disable = tegra30_super_clk_disable, 748 struct clk_tegra *c = to_clk_tegra(hw);
714 .set_parent = tegra30_super_clk_set_parent, 749 struct clk *parent = __clk_get_parent(hw->clk);
715 .set_rate = tegra30_super_clk_set_rate, 750 struct clk_tegra *cparent = to_clk_tegra(__clk_get_hw(parent));
751 int mul = 2;
752 int div;
753
754 if ((c->flags & DIV_U71) && (cparent->flags & PLL_FIXED)) {
755 div = clk_div71_get_divider(*prate,
756 rate, c->flags, ROUND_DIVIDER_DOWN);
757 div = max(div, SUPER_CLOCK_DIV_U71_MIN) + 2;
758 rate = *prate * mul;
759 rate += div - 1; /* round up */
760 do_div(rate, c->div);
761
762 return rate;
763 }
764 return *prate;
765}
766
767struct clk_ops tegra30_super_ops = {
768 .init = tegra30_super_clk_init,
769 .set_parent = tegra30_super_clk_set_parent,
770 .get_parent = tegra30_super_clk_get_parent,
771 .recalc_rate = tegra30_super_clk_recalc_rate,
772 .round_rate = tegra30_super_clk_round_rate,
773 .set_rate = tegra30_super_clk_set_rate,
716}; 774};
717 775
718static int tegra30_twd_clk_set_rate(struct clk *c, unsigned long rate) 776static unsigned long tegra30_twd_clk_recalc_rate(struct clk_hw *hw,
777 unsigned long parent_rate)
719{ 778{
720 /* The input value 'rate' is the clock rate of the CPU complex. */ 779 struct clk_tegra *c = to_clk_tegra(hw);
721 c->rate = (rate * c->mul) / c->div; 780 u64 rate = parent_rate;
722 return 0; 781
782 if (c->mul != 0 && c->div != 0) {
783 rate *= c->mul;
784 rate += c->div - 1; /* round up */
785 do_div(rate, c->div);
786 }
787
788 return rate;
723} 789}
724 790
725static struct clk_ops tegra30_twd_ops = { 791struct clk_ops tegra30_twd_ops = {
726 .set_rate = tegra30_twd_clk_set_rate, 792 .recalc_rate = tegra30_twd_clk_recalc_rate,
727}; 793};
728 794
729/* Blink output functions */ 795/* Blink output functions */
730 796static int tegra30_blink_clk_is_enabled(struct clk_hw *hw)
731static void tegra30_blink_clk_init(struct clk *c)
732{ 797{
798 struct clk_tegra *c = to_clk_tegra(hw);
733 u32 val; 799 u32 val;
734 800
735 val = pmc_readl(PMC_CTRL); 801 val = pmc_readl(PMC_CTRL);
736 c->state = (val & PMC_CTRL_BLINK_ENB) ? ON : OFF; 802 c->state = (val & PMC_CTRL_BLINK_ENB) ? ON : OFF;
737 c->mul = 1; 803 return c->state;
738 val = pmc_readl(c->reg);
739
740 if (val & PMC_BLINK_TIMER_ENB) {
741 unsigned int on_off;
742
743 on_off = (val >> PMC_BLINK_TIMER_DATA_ON_SHIFT) &
744 PMC_BLINK_TIMER_DATA_ON_MASK;
745 val >>= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
746 val &= PMC_BLINK_TIMER_DATA_OFF_MASK;
747 on_off += val;
748 /* each tick in the blink timer is 4 32KHz clocks */
749 c->div = on_off * 4;
750 } else {
751 c->div = 1;
752 }
753} 804}
754 805
755static int tegra30_blink_clk_enable(struct clk *c) 806static int tegra30_blink_clk_enable(struct clk_hw *hw)
756{ 807{
757 u32 val; 808 u32 val;
758 809
@@ -765,7 +816,7 @@ static int tegra30_blink_clk_enable(struct clk *c)
765 return 0; 816 return 0;
766} 817}
767 818
768static void tegra30_blink_clk_disable(struct clk *c) 819static void tegra30_blink_clk_disable(struct clk_hw *hw)
769{ 820{
770 u32 val; 821 u32 val;
771 822
@@ -776,9 +827,11 @@ static void tegra30_blink_clk_disable(struct clk *c)
776 pmc_writel(val & ~PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE); 827 pmc_writel(val & ~PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
777} 828}
778 829
779static int tegra30_blink_clk_set_rate(struct clk *c, unsigned long rate) 830static int tegra30_blink_clk_set_rate(struct clk_hw *hw, unsigned long rate,
831 unsigned long parent_rate)
780{ 832{
781 unsigned long parent_rate = clk_get_rate(c->parent); 833 struct clk_tegra *c = to_clk_tegra(hw);
834
782 if (rate >= parent_rate) { 835 if (rate >= parent_rate) {
783 c->div = 1; 836 c->div = 1;
784 pmc_writel(0, c->reg); 837 pmc_writel(0, c->reg);
@@ -801,41 +854,77 @@ static int tegra30_blink_clk_set_rate(struct clk *c, unsigned long rate)
801 return 0; 854 return 0;
802} 855}
803 856
804static struct clk_ops tegra_blink_clk_ops = { 857static unsigned long tegra30_blink_clk_recalc_rate(struct clk_hw *hw,
805 .init = &tegra30_blink_clk_init, 858 unsigned long parent_rate)
806 .enable = &tegra30_blink_clk_enable, 859{
807 .disable = &tegra30_blink_clk_disable, 860 struct clk_tegra *c = to_clk_tegra(hw);
808 .set_rate = &tegra30_blink_clk_set_rate, 861 u64 rate = parent_rate;
809}; 862 u32 val;
863 u32 mul;
864 u32 div;
865 u32 on_off;
810 866
811/* PLL Functions */ 867 mul = 1;
812static int tegra30_pll_clk_wait_for_lock(struct clk *c, u32 lock_reg, 868 val = pmc_readl(c->reg);
813 u32 lock_bit) 869
870 if (val & PMC_BLINK_TIMER_ENB) {
871 on_off = (val >> PMC_BLINK_TIMER_DATA_ON_SHIFT) &
872 PMC_BLINK_TIMER_DATA_ON_MASK;
873 val >>= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
874 val &= PMC_BLINK_TIMER_DATA_OFF_MASK;
875 on_off += val;
876 /* each tick in the blink timer is 4 32KHz clocks */
877 div = on_off * 4;
878 } else {
879 div = 1;
880 }
881
882 if (mul != 0 && div != 0) {
883 rate *= mul;
884 rate += div - 1; /* round up */
885 do_div(rate, div);
886 }
887 return rate;
888}
889
890static long tegra30_blink_clk_round_rate(struct clk_hw *hw, unsigned long rate,
891 unsigned long *prate)
814{ 892{
815#if USE_PLL_LOCK_BITS 893 int div;
816 int i; 894 int mul;
817 for (i = 0; i < c->u.pll.lock_delay; i++) { 895 long round_rate = *prate;
818 if (clk_readl(lock_reg) & lock_bit) { 896
819 udelay(PLL_POST_LOCK_DELAY); 897 mul = 1;
820 return 0; 898
821 } 899 if (rate >= *prate) {
822 udelay(2); /* timeout = 2 * lock time */ 900 div = 1;
901 } else {
902 div = DIV_ROUND_UP(*prate / 8, rate);
903 div *= 8;
823 } 904 }
824 pr_err("Timed out waiting for lock bit on pll %s", c->name);
825 return -1;
826#endif
827 udelay(c->u.pll.lock_delay);
828 905
829 return 0; 906 round_rate *= mul;
907 round_rate += div - 1;
908 do_div(round_rate, div);
909
910 return round_rate;
830} 911}
831 912
913struct clk_ops tegra30_blink_clk_ops = {
914 .is_enabled = tegra30_blink_clk_is_enabled,
915 .enable = tegra30_blink_clk_enable,
916 .disable = tegra30_blink_clk_disable,
917 .recalc_rate = tegra30_blink_clk_recalc_rate,
918 .round_rate = tegra30_blink_clk_round_rate,
919 .set_rate = tegra30_blink_clk_set_rate,
920};
832 921
833static void tegra30_utmi_param_configure(struct clk *c) 922static void tegra30_utmi_param_configure(struct clk_hw *hw)
834{ 923{
924 unsigned long main_rate =
925 __clk_get_rate(__clk_get_parent(__clk_get_parent(hw->clk)));
835 u32 reg; 926 u32 reg;
836 int i; 927 int i;
837 unsigned long main_rate =
838 clk_get_rate(c->parent->parent);
839 928
840 for (i = 0; i < ARRAY_SIZE(utmi_parameters); i++) { 929 for (i = 0; i < ARRAY_SIZE(utmi_parameters); i++) {
841 if (main_rate == utmi_parameters[i].osc_frequency) 930 if (main_rate == utmi_parameters[i].osc_frequency)
@@ -886,50 +975,52 @@ static void tegra30_utmi_param_configure(struct clk *c)
886 clk_writel(reg, UTMIP_PLL_CFG1); 975 clk_writel(reg, UTMIP_PLL_CFG1);
887} 976}
888 977
889static void tegra30_pll_clk_init(struct clk *c) 978/* PLL Functions */
979static int tegra30_pll_clk_wait_for_lock(struct clk_tegra *c, u32 lock_reg,
980 u32 lock_bit)
981{
982 int ret = 0;
983
984#if USE_PLL_LOCK_BITS
985 int i;
986 for (i = 0; i < c->u.pll.lock_delay; i++) {
987 if (clk_readl(lock_reg) & lock_bit) {
988 udelay(PLL_POST_LOCK_DELAY);
989 return 0;
990 }
991 udelay(2); /* timeout = 2 * lock time */
992 }
993 pr_err("Timed out waiting for lock bit on pll %s",
994 __clk_get_name(hw->clk));
995 ret = -1;
996#else
997 udelay(c->u.pll.lock_delay);
998#endif
999 return ret;
1000}
1001
1002static int tegra30_pll_clk_is_enabled(struct clk_hw *hw)
890{ 1003{
1004 struct clk_tegra *c = to_clk_tegra(hw);
891 u32 val = clk_readl(c->reg + PLL_BASE); 1005 u32 val = clk_readl(c->reg + PLL_BASE);
892 1006
893 c->state = (val & PLL_BASE_ENABLE) ? ON : OFF; 1007 c->state = (val & PLL_BASE_ENABLE) ? ON : OFF;
1008 return c->state;
1009}
894 1010
895 if (c->flags & PLL_FIXED && !(val & PLL_BASE_OVERRIDE)) { 1011static void tegra30_pll_clk_init(struct clk_hw *hw)
896 const struct clk_pll_freq_table *sel; 1012{
897 unsigned long input_rate = clk_get_rate(c->parent); 1013 struct clk_tegra *c = to_clk_tegra(hw);
898 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
899 if (sel->input_rate == input_rate &&
900 sel->output_rate == c->u.pll.fixed_rate) {
901 c->mul = sel->n;
902 c->div = sel->m * sel->p;
903 return;
904 }
905 }
906 pr_err("Clock %s has unknown fixed frequency\n", c->name);
907 BUG();
908 } else if (val & PLL_BASE_BYPASS) {
909 c->mul = 1;
910 c->div = 1;
911 } else {
912 c->mul = (val & PLL_BASE_DIVN_MASK) >> PLL_BASE_DIVN_SHIFT;
913 c->div = (val & PLL_BASE_DIVM_MASK) >> PLL_BASE_DIVM_SHIFT;
914 if (c->flags & PLLU)
915 c->div *= (val & PLLU_BASE_POST_DIV) ? 1 : 2;
916 else
917 c->div *= (0x1 << ((val & PLL_BASE_DIVP_MASK) >>
918 PLL_BASE_DIVP_SHIFT));
919 if (c->flags & PLL_FIXED) {
920 unsigned long rate = clk_get_rate_locked(c);
921 BUG_ON(rate != c->u.pll.fixed_rate);
922 }
923 }
924 1014
925 if (c->flags & PLLU) 1015 if (c->flags & PLLU)
926 tegra30_utmi_param_configure(c); 1016 tegra30_utmi_param_configure(hw);
927} 1017}
928 1018
929static int tegra30_pll_clk_enable(struct clk *c) 1019static int tegra30_pll_clk_enable(struct clk_hw *hw)
930{ 1020{
1021 struct clk_tegra *c = to_clk_tegra(hw);
931 u32 val; 1022 u32 val;
932 pr_debug("%s on clock %s\n", __func__, c->name); 1023 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
933 1024
934#if USE_PLL_LOCK_BITS 1025#if USE_PLL_LOCK_BITS
935 val = clk_readl(c->reg + PLL_MISC(c)); 1026 val = clk_readl(c->reg + PLL_MISC(c));
@@ -952,10 +1043,11 @@ static int tegra30_pll_clk_enable(struct clk *c)
952 return 0; 1043 return 0;
953} 1044}
954 1045
955static void tegra30_pll_clk_disable(struct clk *c) 1046static void tegra30_pll_clk_disable(struct clk_hw *hw)
956{ 1047{
1048 struct clk_tegra *c = to_clk_tegra(hw);
957 u32 val; 1049 u32 val;
958 pr_debug("%s on clock %s\n", __func__, c->name); 1050 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
959 1051
960 val = clk_readl(c->reg); 1052 val = clk_readl(c->reg);
961 val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE); 1053 val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE);
@@ -968,36 +1060,36 @@ static void tegra30_pll_clk_disable(struct clk *c)
968 } 1060 }
969} 1061}
970 1062
971static int tegra30_pll_clk_set_rate(struct clk *c, unsigned long rate) 1063static int tegra30_pll_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1064 unsigned long parent_rate)
972{ 1065{
1066 struct clk_tegra *c = to_clk_tegra(hw);
973 u32 val, p_div, old_base; 1067 u32 val, p_div, old_base;
974 unsigned long input_rate; 1068 unsigned long input_rate;
975 const struct clk_pll_freq_table *sel; 1069 const struct clk_pll_freq_table *sel;
976 struct clk_pll_freq_table cfg; 1070 struct clk_pll_freq_table cfg;
977 1071
978 pr_debug("%s: %s %lu\n", __func__, c->name, rate);
979
980 if (c->flags & PLL_FIXED) { 1072 if (c->flags & PLL_FIXED) {
981 int ret = 0; 1073 int ret = 0;
982 if (rate != c->u.pll.fixed_rate) { 1074 if (rate != c->u.pll.fixed_rate) {
983 pr_err("%s: Can not change %s fixed rate %lu to %lu\n", 1075 pr_err("%s: Can not change %s fixed rate %lu to %lu\n",
984 __func__, c->name, c->u.pll.fixed_rate, rate); 1076 __func__, __clk_get_name(hw->clk),
1077 c->u.pll.fixed_rate, rate);
985 ret = -EINVAL; 1078 ret = -EINVAL;
986 } 1079 }
987 return ret; 1080 return ret;
988 } 1081 }
989 1082
990 if (c->flags & PLLM) { 1083 if (c->flags & PLLM) {
991 if (rate != clk_get_rate_locked(c)) { 1084 if (rate != __clk_get_rate(hw->clk)) {
992 pr_err("%s: Can not change memory %s rate in flight\n", 1085 pr_err("%s: Can not change memory %s rate in flight\n",
993 __func__, c->name); 1086 __func__, __clk_get_name(hw->clk));
994 return -EINVAL; 1087 return -EINVAL;
995 } 1088 }
996 return 0;
997 } 1089 }
998 1090
999 p_div = 0; 1091 p_div = 0;
1000 input_rate = clk_get_rate(c->parent); 1092 input_rate = parent_rate;
1001 1093
1002 /* Check if the target rate is tabulated */ 1094 /* Check if the target rate is tabulated */
1003 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) { 1095 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
@@ -1055,7 +1147,7 @@ static int tegra30_pll_clk_set_rate(struct clk *c, unsigned long rate)
1055 (p_div > (PLL_BASE_DIVP_MASK >> PLL_BASE_DIVP_SHIFT)) || 1147 (p_div > (PLL_BASE_DIVP_MASK >> PLL_BASE_DIVP_SHIFT)) ||
1056 (cfg.output_rate > c->u.pll.vco_max)) { 1148 (cfg.output_rate > c->u.pll.vco_max)) {
1057 pr_err("%s: Failed to set %s out-of-table rate %lu\n", 1149 pr_err("%s: Failed to set %s out-of-table rate %lu\n",
1058 __func__, c->name, rate); 1150 __func__, __clk_get_name(hw->clk), rate);
1059 return -EINVAL; 1151 return -EINVAL;
1060 } 1152 }
1061 p_div <<= PLL_BASE_DIVP_SHIFT; 1153 p_div <<= PLL_BASE_DIVP_SHIFT;
@@ -1073,7 +1165,7 @@ static int tegra30_pll_clk_set_rate(struct clk *c, unsigned long rate)
1073 return 0; 1165 return 0;
1074 1166
1075 if (c->state == ON) { 1167 if (c->state == ON) {
1076 tegra30_pll_clk_disable(c); 1168 tegra30_pll_clk_disable(hw);
1077 val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE); 1169 val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE);
1078 } 1170 }
1079 clk_writel(val, c->reg + PLL_BASE); 1171 clk_writel(val, c->reg + PLL_BASE);
@@ -1095,21 +1187,149 @@ static int tegra30_pll_clk_set_rate(struct clk *c, unsigned long rate)
1095 } 1187 }
1096 1188
1097 if (c->state == ON) 1189 if (c->state == ON)
1098 tegra30_pll_clk_enable(c); 1190 tegra30_pll_clk_enable(hw);
1191
1192 c->u.pll.fixed_rate = rate;
1099 1193
1100 return 0; 1194 return 0;
1101} 1195}
1102 1196
1103static struct clk_ops tegra_pll_ops = { 1197static long tegra30_pll_round_rate(struct clk_hw *hw, unsigned long rate,
1104 .init = tegra30_pll_clk_init, 1198 unsigned long *prate)
1105 .enable = tegra30_pll_clk_enable, 1199{
1106 .disable = tegra30_pll_clk_disable, 1200 struct clk_tegra *c = to_clk_tegra(hw);
1107 .set_rate = tegra30_pll_clk_set_rate, 1201 unsigned long input_rate = *prate;
1202 unsigned long output_rate = *prate;
1203 const struct clk_pll_freq_table *sel;
1204 struct clk_pll_freq_table cfg;
1205 int mul;
1206 int div;
1207 u32 p_div;
1208 u32 val;
1209
1210 if (c->flags & PLL_FIXED)
1211 return c->u.pll.fixed_rate;
1212
1213 if (c->flags & PLLM)
1214 return __clk_get_rate(hw->clk);
1215
1216 p_div = 0;
1217 /* Check if the target rate is tabulated */
1218 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
1219 if (sel->input_rate == input_rate && sel->output_rate == rate) {
1220 if (c->flags & PLLU) {
1221 BUG_ON(sel->p < 1 || sel->p > 2);
1222 if (sel->p == 1)
1223 p_div = PLLU_BASE_POST_DIV;
1224 } else {
1225 BUG_ON(sel->p < 1);
1226 for (val = sel->p; val > 1; val >>= 1)
1227 p_div++;
1228 p_div <<= PLL_BASE_DIVP_SHIFT;
1229 }
1230 break;
1231 }
1232 }
1233
1234 if (sel->input_rate == 0) {
1235 unsigned long cfreq;
1236 BUG_ON(c->flags & PLLU);
1237 sel = &cfg;
1238
1239 switch (input_rate) {
1240 case 12000000:
1241 case 26000000:
1242 cfreq = (rate <= 1000000 * 1000) ? 1000000 : 2000000;
1243 break;
1244 case 13000000:
1245 cfreq = (rate <= 1000000 * 1000) ? 1000000 : 2600000;
1246 break;
1247 case 16800000:
1248 case 19200000:
1249 cfreq = (rate <= 1200000 * 1000) ? 1200000 : 2400000;
1250 break;
1251 default:
1252 pr_err("%s: Unexpected reference rate %lu\n",
1253 __func__, input_rate);
1254 BUG();
1255 }
1256
1257 /* Raise VCO to guarantee 0.5% accuracy */
1258 for (cfg.output_rate = rate; cfg.output_rate < 200 * cfreq;
1259 cfg.output_rate <<= 1)
1260 p_div++;
1261
1262 cfg.p = 0x1 << p_div;
1263 cfg.m = input_rate / cfreq;
1264 cfg.n = cfg.output_rate / cfreq;
1265 }
1266
1267 mul = sel->n;
1268 div = sel->m * sel->p;
1269
1270 output_rate *= mul;
1271 output_rate += div - 1; /* round up */
1272 do_div(output_rate, div);
1273
1274 return output_rate;
1275}
1276
1277static unsigned long tegra30_pll_recalc_rate(struct clk_hw *hw,
1278 unsigned long parent_rate)
1279{
1280 struct clk_tegra *c = to_clk_tegra(hw);
1281 u64 rate = parent_rate;
1282 u32 val = clk_readl(c->reg + PLL_BASE);
1283
1284 if (c->flags & PLL_FIXED && !(val & PLL_BASE_OVERRIDE)) {
1285 const struct clk_pll_freq_table *sel;
1286 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
1287 if (sel->input_rate == parent_rate &&
1288 sel->output_rate == c->u.pll.fixed_rate) {
1289 c->mul = sel->n;
1290 c->div = sel->m * sel->p;
1291 break;
1292 }
1293 }
1294 pr_err("Clock %s has unknown fixed frequency\n",
1295 __clk_get_name(hw->clk));
1296 BUG();
1297 } else if (val & PLL_BASE_BYPASS) {
1298 c->mul = 1;
1299 c->div = 1;
1300 } else {
1301 c->mul = (val & PLL_BASE_DIVN_MASK) >> PLL_BASE_DIVN_SHIFT;
1302 c->div = (val & PLL_BASE_DIVM_MASK) >> PLL_BASE_DIVM_SHIFT;
1303 if (c->flags & PLLU)
1304 c->div *= (val & PLLU_BASE_POST_DIV) ? 1 : 2;
1305 else
1306 c->div *= (0x1 << ((val & PLL_BASE_DIVP_MASK) >>
1307 PLL_BASE_DIVP_SHIFT));
1308 }
1309
1310 if (c->mul != 0 && c->div != 0) {
1311 rate *= c->mul;
1312 rate += c->div - 1; /* round up */
1313 do_div(rate, c->div);
1314 }
1315
1316 return rate;
1317}
1318
1319struct clk_ops tegra30_pll_ops = {
1320 .is_enabled = tegra30_pll_clk_is_enabled,
1321 .init = tegra30_pll_clk_init,
1322 .enable = tegra30_pll_clk_enable,
1323 .disable = tegra30_pll_clk_disable,
1324 .recalc_rate = tegra30_pll_recalc_rate,
1325 .round_rate = tegra30_pll_round_rate,
1326 .set_rate = tegra30_pll_clk_set_rate,
1108}; 1327};
1109 1328
1110static int 1329int tegra30_plld_clk_cfg_ex(struct clk_hw *hw,
1111tegra30_plld_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting) 1330 enum tegra_clk_ex_param p, u32 setting)
1112{ 1331{
1332 struct clk_tegra *c = to_clk_tegra(hw);
1113 u32 val, mask, reg; 1333 u32 val, mask, reg;
1114 1334
1115 switch (p) { 1335 switch (p) {
@@ -1141,41 +1361,27 @@ tegra30_plld_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting)
1141 return 0; 1361 return 0;
1142} 1362}
1143 1363
1144static struct clk_ops tegra_plld_ops = { 1364static int tegra30_plle_clk_is_enabled(struct clk_hw *hw)
1145 .init = tegra30_pll_clk_init,
1146 .enable = tegra30_pll_clk_enable,
1147 .disable = tegra30_pll_clk_disable,
1148 .set_rate = tegra30_pll_clk_set_rate,
1149 .clk_cfg_ex = tegra30_plld_clk_cfg_ex,
1150};
1151
1152static void tegra30_plle_clk_init(struct clk *c)
1153{ 1365{
1366 struct clk_tegra *c = to_clk_tegra(hw);
1154 u32 val; 1367 u32 val;
1155 1368
1156 val = clk_readl(PLLE_AUX);
1157 c->parent = (val & PLLE_AUX_PLLP_SEL) ?
1158 tegra_get_clock_by_name("pll_p") :
1159 tegra_get_clock_by_name("pll_ref");
1160
1161 val = clk_readl(c->reg + PLL_BASE); 1369 val = clk_readl(c->reg + PLL_BASE);
1162 c->state = (val & PLLE_BASE_ENABLE) ? ON : OFF; 1370 c->state = (val & PLLE_BASE_ENABLE) ? ON : OFF;
1163 c->mul = (val & PLLE_BASE_DIVN_MASK) >> PLLE_BASE_DIVN_SHIFT; 1371 return c->state;
1164 c->div = (val & PLLE_BASE_DIVM_MASK) >> PLLE_BASE_DIVM_SHIFT;
1165 c->div *= (val & PLLE_BASE_DIVP_MASK) >> PLLE_BASE_DIVP_SHIFT;
1166} 1372}
1167 1373
1168static void tegra30_plle_clk_disable(struct clk *c) 1374static void tegra30_plle_clk_disable(struct clk_hw *hw)
1169{ 1375{
1376 struct clk_tegra *c = to_clk_tegra(hw);
1170 u32 val; 1377 u32 val;
1171 pr_debug("%s on clock %s\n", __func__, c->name);
1172 1378
1173 val = clk_readl(c->reg + PLL_BASE); 1379 val = clk_readl(c->reg + PLL_BASE);
1174 val &= ~(PLLE_BASE_CML_ENABLE | PLLE_BASE_ENABLE); 1380 val &= ~(PLLE_BASE_CML_ENABLE | PLLE_BASE_ENABLE);
1175 clk_writel(val, c->reg + PLL_BASE); 1381 clk_writel(val, c->reg + PLL_BASE);
1176} 1382}
1177 1383
1178static void tegra30_plle_training(struct clk *c) 1384static void tegra30_plle_training(struct clk_tegra *c)
1179{ 1385{
1180 u32 val; 1386 u32 val;
1181 1387
@@ -1198,12 +1404,15 @@ static void tegra30_plle_training(struct clk *c)
1198 } while (!(val & PLLE_MISC_READY)); 1404 } while (!(val & PLLE_MISC_READY));
1199} 1405}
1200 1406
1201static int tegra30_plle_configure(struct clk *c, bool force_training) 1407static int tegra30_plle_configure(struct clk_hw *hw, bool force_training)
1202{ 1408{
1203 u32 val; 1409 struct clk_tegra *c = to_clk_tegra(hw);
1410 struct clk *parent = __clk_get_parent(hw->clk);
1204 const struct clk_pll_freq_table *sel; 1411 const struct clk_pll_freq_table *sel;
1412 u32 val;
1413
1205 unsigned long rate = c->u.pll.fixed_rate; 1414 unsigned long rate = c->u.pll.fixed_rate;
1206 unsigned long input_rate = clk_get_rate(c->parent); 1415 unsigned long input_rate = __clk_get_rate(parent);
1207 1416
1208 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) { 1417 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
1209 if (sel->input_rate == input_rate && sel->output_rate == rate) 1418 if (sel->input_rate == input_rate && sel->output_rate == rate)
@@ -1214,7 +1423,7 @@ static int tegra30_plle_configure(struct clk *c, bool force_training)
1214 return -ENOSYS; 1423 return -ENOSYS;
1215 1424
1216 /* disable PLLE, clear setup fiels */ 1425 /* disable PLLE, clear setup fiels */
1217 tegra30_plle_clk_disable(c); 1426 tegra30_plle_clk_disable(hw);
1218 1427
1219 val = clk_readl(c->reg + PLL_MISC(c)); 1428 val = clk_readl(c->reg + PLL_MISC(c));
1220 val &= ~(PLLE_MISC_LOCK_ENABLE | PLLE_MISC_SETUP_MASK); 1429 val &= ~(PLLE_MISC_LOCK_ENABLE | PLLE_MISC_SETUP_MASK);
@@ -1252,52 +1461,64 @@ static int tegra30_plle_configure(struct clk *c, bool force_training)
1252 return 0; 1461 return 0;
1253} 1462}
1254 1463
1255static int tegra30_plle_clk_enable(struct clk *c) 1464static int tegra30_plle_clk_enable(struct clk_hw *hw)
1465{
1466 struct clk_tegra *c = to_clk_tegra(hw);
1467
1468 return tegra30_plle_configure(hw, !c->set);
1469}
1470
1471static unsigned long tegra30_plle_clk_recalc_rate(struct clk_hw *hw,
1472 unsigned long parent_rate)
1256{ 1473{
1257 pr_debug("%s on clock %s\n", __func__, c->name); 1474 struct clk_tegra *c = to_clk_tegra(hw);
1258 return tegra30_plle_configure(c, !c->set); 1475 unsigned long rate = parent_rate;
1476 u32 val;
1477
1478 val = clk_readl(c->reg + PLL_BASE);
1479 c->mul = (val & PLLE_BASE_DIVN_MASK) >> PLLE_BASE_DIVN_SHIFT;
1480 c->div = (val & PLLE_BASE_DIVM_MASK) >> PLLE_BASE_DIVM_SHIFT;
1481 c->div *= (val & PLLE_BASE_DIVP_MASK) >> PLLE_BASE_DIVP_SHIFT;
1482
1483 if (c->mul != 0 && c->div != 0) {
1484 rate *= c->mul;
1485 rate += c->div - 1; /* round up */
1486 do_div(rate, c->div);
1487 }
1488 return rate;
1259} 1489}
1260 1490
1261static struct clk_ops tegra_plle_ops = { 1491struct clk_ops tegra30_plle_ops = {
1262 .init = tegra30_plle_clk_init, 1492 .is_enabled = tegra30_plle_clk_is_enabled,
1263 .enable = tegra30_plle_clk_enable, 1493 .enable = tegra30_plle_clk_enable,
1264 .disable = tegra30_plle_clk_disable, 1494 .disable = tegra30_plle_clk_disable,
1495 .recalc_rate = tegra30_plle_clk_recalc_rate,
1265}; 1496};
1266 1497
1267/* Clock divider ops */ 1498/* Clock divider ops */
1268static void tegra30_pll_div_clk_init(struct clk *c) 1499static int tegra30_pll_div_clk_is_enabled(struct clk_hw *hw)
1269{ 1500{
1501 struct clk_tegra *c = to_clk_tegra(hw);
1502
1270 if (c->flags & DIV_U71) { 1503 if (c->flags & DIV_U71) {
1271 u32 divu71;
1272 u32 val = clk_readl(c->reg); 1504 u32 val = clk_readl(c->reg);
1273 val >>= c->reg_shift; 1505 val >>= c->reg_shift;
1274 c->state = (val & PLL_OUT_CLKEN) ? ON : OFF; 1506 c->state = (val & PLL_OUT_CLKEN) ? ON : OFF;
1275 if (!(val & PLL_OUT_RESET_DISABLE)) 1507 if (!(val & PLL_OUT_RESET_DISABLE))
1276 c->state = OFF; 1508 c->state = OFF;
1277
1278 divu71 = (val & PLL_OUT_RATIO_MASK) >> PLL_OUT_RATIO_SHIFT;
1279 c->div = (divu71 + 2);
1280 c->mul = 2;
1281 } else if (c->flags & DIV_2) {
1282 c->state = ON;
1283 if (c->flags & (PLLD | PLLX)) {
1284 c->div = 2;
1285 c->mul = 1;
1286 } else
1287 BUG();
1288 } else { 1509 } else {
1289 c->state = ON; 1510 c->state = ON;
1290 c->div = 1;
1291 c->mul = 1;
1292 } 1511 }
1512 return c->state;
1293} 1513}
1294 1514
1295static int tegra30_pll_div_clk_enable(struct clk *c) 1515static int tegra30_pll_div_clk_enable(struct clk_hw *hw)
1296{ 1516{
1517 struct clk_tegra *c = to_clk_tegra(hw);
1297 u32 val; 1518 u32 val;
1298 u32 new_val; 1519 u32 new_val;
1299 1520
1300 pr_debug("%s: %s\n", __func__, c->name); 1521 pr_debug("%s: %s\n", __func__, __clk_get_name(hw->clk));
1301 if (c->flags & DIV_U71) { 1522 if (c->flags & DIV_U71) {
1302 val = clk_readl(c->reg); 1523 val = clk_readl(c->reg);
1303 new_val = val >> c->reg_shift; 1524 new_val = val >> c->reg_shift;
@@ -1315,12 +1536,13 @@ static int tegra30_pll_div_clk_enable(struct clk *c)
1315 return -EINVAL; 1536 return -EINVAL;
1316} 1537}
1317 1538
1318static void tegra30_pll_div_clk_disable(struct clk *c) 1539static void tegra30_pll_div_clk_disable(struct clk_hw *hw)
1319{ 1540{
1541 struct clk_tegra *c = to_clk_tegra(hw);
1320 u32 val; 1542 u32 val;
1321 u32 new_val; 1543 u32 new_val;
1322 1544
1323 pr_debug("%s: %s\n", __func__, c->name); 1545 pr_debug("%s: %s\n", __func__, __clk_get_name(hw->clk));
1324 if (c->flags & DIV_U71) { 1546 if (c->flags & DIV_U71) {
1325 val = clk_readl(c->reg); 1547 val = clk_readl(c->reg);
1326 new_val = val >> c->reg_shift; 1548 new_val = val >> c->reg_shift;
@@ -1334,14 +1556,14 @@ static void tegra30_pll_div_clk_disable(struct clk *c)
1334 } 1556 }
1335} 1557}
1336 1558
1337static int tegra30_pll_div_clk_set_rate(struct clk *c, unsigned long rate) 1559static int tegra30_pll_div_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1560 unsigned long parent_rate)
1338{ 1561{
1562 struct clk_tegra *c = to_clk_tegra(hw);
1339 u32 val; 1563 u32 val;
1340 u32 new_val; 1564 u32 new_val;
1341 int divider_u71; 1565 int divider_u71;
1342 unsigned long parent_rate = clk_get_rate(c->parent);
1343 1566
1344 pr_debug("%s: %s %lu\n", __func__, c->name, rate);
1345 if (c->flags & DIV_U71) { 1567 if (c->flags & DIV_U71) {
1346 divider_u71 = clk_div71_get_divider( 1568 divider_u71 = clk_div71_get_divider(
1347 parent_rate, rate, c->flags, ROUND_DIVIDER_UP); 1569 parent_rate, rate, c->flags, ROUND_DIVIDER_UP);
@@ -1359,19 +1581,59 @@ static int tegra30_pll_div_clk_set_rate(struct clk *c, unsigned long rate)
1359 clk_writel_delay(val, c->reg); 1581 clk_writel_delay(val, c->reg);
1360 c->div = divider_u71 + 2; 1582 c->div = divider_u71 + 2;
1361 c->mul = 2; 1583 c->mul = 2;
1584 c->fixed_rate = rate;
1362 return 0; 1585 return 0;
1363 } 1586 }
1364 } else if (c->flags & DIV_2) 1587 } else if (c->flags & DIV_2) {
1365 return clk_set_rate(c->parent, rate * 2); 1588 c->fixed_rate = rate;
1589 return 0;
1590 }
1366 1591
1367 return -EINVAL; 1592 return -EINVAL;
1368} 1593}
1369 1594
1370static long tegra30_pll_div_clk_round_rate(struct clk *c, unsigned long rate) 1595static unsigned long tegra30_pll_div_clk_recalc_rate(struct clk_hw *hw,
1596 unsigned long parent_rate)
1597{
1598 struct clk_tegra *c = to_clk_tegra(hw);
1599 u64 rate = parent_rate;
1600
1601 if (c->flags & DIV_U71) {
1602 u32 divu71;
1603 u32 val = clk_readl(c->reg);
1604 val >>= c->reg_shift;
1605
1606 divu71 = (val & PLL_OUT_RATIO_MASK) >> PLL_OUT_RATIO_SHIFT;
1607 c->div = (divu71 + 2);
1608 c->mul = 2;
1609 } else if (c->flags & DIV_2) {
1610 if (c->flags & (PLLD | PLLX)) {
1611 c->div = 2;
1612 c->mul = 1;
1613 } else
1614 BUG();
1615 } else {
1616 c->div = 1;
1617 c->mul = 1;
1618 }
1619 if (c->mul != 0 && c->div != 0) {
1620 rate *= c->mul;
1621 rate += c->div - 1; /* round up */
1622 do_div(rate, c->div);
1623 }
1624
1625 return rate;
1626}
1627
1628static long tegra30_pll_div_clk_round_rate(struct clk_hw *hw,
1629 unsigned long rate, unsigned long *prate)
1371{ 1630{
1631 struct clk_tegra *c = to_clk_tegra(hw);
1632 unsigned long parent_rate = __clk_get_rate(__clk_get_parent(hw->clk));
1372 int divider; 1633 int divider;
1373 unsigned long parent_rate = clk_get_rate(c->parent); 1634
1374 pr_debug("%s: %s %lu\n", __func__, c->name, rate); 1635 if (prate)
1636 parent_rate = *prate;
1375 1637
1376 if (c->flags & DIV_U71) { 1638 if (c->flags & DIV_U71) {
1377 divider = clk_div71_get_divider( 1639 divider = clk_div71_get_divider(
@@ -1379,23 +1641,25 @@ static long tegra30_pll_div_clk_round_rate(struct clk *c, unsigned long rate)
1379 if (divider < 0) 1641 if (divider < 0)
1380 return divider; 1642 return divider;
1381 return DIV_ROUND_UP(parent_rate * 2, divider + 2); 1643 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
1382 } else if (c->flags & DIV_2) 1644 } else if (c->flags & DIV_2) {
1383 /* no rounding - fixed DIV_2 dividers pass rate to parent PLL */ 1645 *prate = rate * 2;
1384 return rate; 1646 return rate;
1647 }
1385 1648
1386 return -EINVAL; 1649 return -EINVAL;
1387} 1650}
1388 1651
1389static struct clk_ops tegra_pll_div_ops = { 1652struct clk_ops tegra30_pll_div_ops = {
1390 .init = tegra30_pll_div_clk_init, 1653 .is_enabled = tegra30_pll_div_clk_is_enabled,
1391 .enable = tegra30_pll_div_clk_enable, 1654 .enable = tegra30_pll_div_clk_enable,
1392 .disable = tegra30_pll_div_clk_disable, 1655 .disable = tegra30_pll_div_clk_disable,
1393 .set_rate = tegra30_pll_div_clk_set_rate, 1656 .set_rate = tegra30_pll_div_clk_set_rate,
1394 .round_rate = tegra30_pll_div_clk_round_rate, 1657 .recalc_rate = tegra30_pll_div_clk_recalc_rate,
1658 .round_rate = tegra30_pll_div_clk_round_rate,
1395}; 1659};
1396 1660
1397/* Periph clk ops */ 1661/* Periph clk ops */
1398static inline u32 periph_clk_source_mask(struct clk *c) 1662static inline u32 periph_clk_source_mask(struct clk_tegra *c)
1399{ 1663{
1400 if (c->flags & MUX8) 1664 if (c->flags & MUX8)
1401 return 7 << 29; 1665 return 7 << 29;
@@ -1409,7 +1673,7 @@ static inline u32 periph_clk_source_mask(struct clk *c)
1409 return 3 << 30; 1673 return 3 << 30;
1410} 1674}
1411 1675
1412static inline u32 periph_clk_source_shift(struct clk *c) 1676static inline u32 periph_clk_source_shift(struct clk_tegra *c)
1413{ 1677{
1414 if (c->flags & MUX8) 1678 if (c->flags & MUX8)
1415 return 29; 1679 return 29;
@@ -1423,47 +1687,9 @@ static inline u32 periph_clk_source_shift(struct clk *c)
1423 return 30; 1687 return 30;
1424} 1688}
1425 1689
1426static void tegra30_periph_clk_init(struct clk *c) 1690static int tegra30_periph_clk_is_enabled(struct clk_hw *hw)
1427{ 1691{
1428 u32 val = clk_readl(c->reg); 1692 struct clk_tegra *c = to_clk_tegra(hw);
1429 const struct clk_mux_sel *mux = 0;
1430 const struct clk_mux_sel *sel;
1431 if (c->flags & MUX) {
1432 for (sel = c->inputs; sel->input != NULL; sel++) {
1433 if (((val & periph_clk_source_mask(c)) >>
1434 periph_clk_source_shift(c)) == sel->value)
1435 mux = sel;
1436 }
1437 BUG_ON(!mux);
1438
1439 c->parent = mux->input;
1440 } else {
1441 c->parent = c->inputs[0].input;
1442 }
1443
1444 if (c->flags & DIV_U71) {
1445 u32 divu71 = val & PERIPH_CLK_SOURCE_DIVU71_MASK;
1446 if ((c->flags & DIV_U71_UART) &&
1447 (!(val & PERIPH_CLK_UART_DIV_ENB))) {
1448 divu71 = 0;
1449 }
1450 if (c->flags & DIV_U71_IDLE) {
1451 val &= ~(PERIPH_CLK_SOURCE_DIVU71_MASK <<
1452 PERIPH_CLK_SOURCE_DIVIDLE_SHIFT);
1453 val |= (PERIPH_CLK_SOURCE_DIVIDLE_VAL <<
1454 PERIPH_CLK_SOURCE_DIVIDLE_SHIFT);
1455 clk_writel(val, c->reg);
1456 }
1457 c->div = divu71 + 2;
1458 c->mul = 2;
1459 } else if (c->flags & DIV_U16) {
1460 u32 divu16 = val & PERIPH_CLK_SOURCE_DIVU16_MASK;
1461 c->div = divu16 + 1;
1462 c->mul = 1;
1463 } else {
1464 c->div = 1;
1465 c->mul = 1;
1466 }
1467 1693
1468 c->state = ON; 1694 c->state = ON;
1469 if (!(clk_readl(PERIPH_CLK_TO_ENB_REG(c)) & PERIPH_CLK_TO_BIT(c))) 1695 if (!(clk_readl(PERIPH_CLK_TO_ENB_REG(c)) & PERIPH_CLK_TO_BIT(c)))
@@ -1471,11 +1697,12 @@ static void tegra30_periph_clk_init(struct clk *c)
1471 if (!(c->flags & PERIPH_NO_RESET)) 1697 if (!(c->flags & PERIPH_NO_RESET))
1472 if (clk_readl(PERIPH_CLK_TO_RST_REG(c)) & PERIPH_CLK_TO_BIT(c)) 1698 if (clk_readl(PERIPH_CLK_TO_RST_REG(c)) & PERIPH_CLK_TO_BIT(c))
1473 c->state = OFF; 1699 c->state = OFF;
1700 return c->state;
1474} 1701}
1475 1702
1476static int tegra30_periph_clk_enable(struct clk *c) 1703static int tegra30_periph_clk_enable(struct clk_hw *hw)
1477{ 1704{
1478 pr_debug("%s on clock %s\n", __func__, c->name); 1705 struct clk_tegra *c = to_clk_tegra(hw);
1479 1706
1480 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]++; 1707 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]++;
1481 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] > 1) 1708 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] > 1)
@@ -1494,31 +1721,29 @@ static int tegra30_periph_clk_enable(struct clk *c)
1494 return 0; 1721 return 0;
1495} 1722}
1496 1723
1497static void tegra30_periph_clk_disable(struct clk *c) 1724static void tegra30_periph_clk_disable(struct clk_hw *hw)
1498{ 1725{
1726 struct clk_tegra *c = to_clk_tegra(hw);
1499 unsigned long val; 1727 unsigned long val;
1500 pr_debug("%s on clock %s\n", __func__, c->name);
1501 1728
1502 if (c->refcnt) 1729 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]--;
1503 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]--; 1730
1731 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] > 0)
1732 return;
1504 1733
1505 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] == 0) { 1734 /* If peripheral is in the APB bus then read the APB bus to
1506 /* If peripheral is in the APB bus then read the APB bus to 1735 * flush the write operation in apb bus. This will avoid the
1507 * flush the write operation in apb bus. This will avoid the 1736 * peripheral access after disabling clock*/
1508 * peripheral access after disabling clock*/ 1737 if (c->flags & PERIPH_ON_APB)
1509 if (c->flags & PERIPH_ON_APB) 1738 val = chipid_readl();
1510 val = chipid_readl();
1511 1739
1512 clk_writel_delay( 1740 clk_writel_delay(PERIPH_CLK_TO_BIT(c), PERIPH_CLK_TO_ENB_CLR_REG(c));
1513 PERIPH_CLK_TO_BIT(c), PERIPH_CLK_TO_ENB_CLR_REG(c));
1514 }
1515} 1741}
1516 1742
1517static void tegra30_periph_clk_reset(struct clk *c, bool assert) 1743void tegra30_periph_clk_reset(struct clk_hw *hw, bool assert)
1518{ 1744{
1745 struct clk_tegra *c = to_clk_tegra(hw);
1519 unsigned long val; 1746 unsigned long val;
1520 pr_debug("%s %s on clock %s\n", __func__,
1521 assert ? "assert" : "deassert", c->name);
1522 1747
1523 if (!(c->flags & PERIPH_NO_RESET)) { 1748 if (!(c->flags & PERIPH_NO_RESET)) {
1524 if (assert) { 1749 if (assert) {
@@ -1537,42 +1762,40 @@ static void tegra30_periph_clk_reset(struct clk *c, bool assert)
1537 } 1762 }
1538} 1763}
1539 1764
1540static int tegra30_periph_clk_set_parent(struct clk *c, struct clk *p) 1765static int tegra30_periph_clk_set_parent(struct clk_hw *hw, u8 index)
1541{ 1766{
1767 struct clk_tegra *c = to_clk_tegra(hw);
1542 u32 val; 1768 u32 val;
1543 const struct clk_mux_sel *sel;
1544 pr_debug("%s: %s %s\n", __func__, c->name, p->name);
1545 1769
1546 if (!(c->flags & MUX)) 1770 if (!(c->flags & MUX))
1547 return (p == c->parent) ? 0 : (-EINVAL); 1771 return (index == 0) ? 0 : (-EINVAL);
1548
1549 for (sel = c->inputs; sel->input != NULL; sel++) {
1550 if (sel->input == p) {
1551 val = clk_readl(c->reg);
1552 val &= ~periph_clk_source_mask(c);
1553 val |= (sel->value << periph_clk_source_shift(c));
1554
1555 if (c->refcnt)
1556 clk_enable(p);
1557 1772
1558 clk_writel_delay(val, c->reg); 1773 val = clk_readl(c->reg);
1774 val &= ~periph_clk_source_mask(c);
1775 val |= (index << periph_clk_source_shift(c));
1776 clk_writel_delay(val, c->reg);
1777 return 0;
1778}
1559 1779
1560 if (c->refcnt && c->parent) 1780static u8 tegra30_periph_clk_get_parent(struct clk_hw *hw)
1561 clk_disable(c->parent); 1781{
1782 struct clk_tegra *c = to_clk_tegra(hw);
1783 u32 val = clk_readl(c->reg);
1784 int source = (val & periph_clk_source_mask(c)) >>
1785 periph_clk_source_shift(c);
1562 1786
1563 clk_reparent(c, p); 1787 if (!(c->flags & MUX))
1564 return 0; 1788 return 0;
1565 }
1566 }
1567 1789
1568 return -EINVAL; 1790 return source;
1569} 1791}
1570 1792
1571static int tegra30_periph_clk_set_rate(struct clk *c, unsigned long rate) 1793static int tegra30_periph_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1794 unsigned long parent_rate)
1572{ 1795{
1796 struct clk_tegra *c = to_clk_tegra(hw);
1573 u32 val; 1797 u32 val;
1574 int divider; 1798 int divider;
1575 unsigned long parent_rate = clk_get_rate(c->parent);
1576 1799
1577 if (c->flags & DIV_U71) { 1800 if (c->flags & DIV_U71) {
1578 divider = clk_div71_get_divider( 1801 divider = clk_div71_get_divider(
@@ -1611,12 +1834,15 @@ static int tegra30_periph_clk_set_rate(struct clk *c, unsigned long rate)
1611 return -EINVAL; 1834 return -EINVAL;
1612} 1835}
1613 1836
1614static long tegra30_periph_clk_round_rate(struct clk *c, 1837static long tegra30_periph_clk_round_rate(struct clk_hw *hw, unsigned long rate,
1615 unsigned long rate) 1838 unsigned long *prate)
1616{ 1839{
1840 struct clk_tegra *c = to_clk_tegra(hw);
1841 unsigned long parent_rate = __clk_get_rate(__clk_get_parent(hw->clk));
1617 int divider; 1842 int divider;
1618 unsigned long parent_rate = clk_get_rate(c->parent); 1843
1619 pr_debug("%s: %s %lu\n", __func__, c->name, rate); 1844 if (prate)
1845 parent_rate = *prate;
1620 1846
1621 if (c->flags & DIV_U71) { 1847 if (c->flags & DIV_U71) {
1622 divider = clk_div71_get_divider( 1848 divider = clk_div71_get_divider(
@@ -1634,21 +1860,85 @@ static long tegra30_periph_clk_round_rate(struct clk *c,
1634 return -EINVAL; 1860 return -EINVAL;
1635} 1861}
1636 1862
1637static struct clk_ops tegra_periph_clk_ops = { 1863static unsigned long tegra30_periph_clk_recalc_rate(struct clk_hw *hw,
1638 .init = &tegra30_periph_clk_init, 1864 unsigned long parent_rate)
1865{
1866 struct clk_tegra *c = to_clk_tegra(hw);
1867 u64 rate = parent_rate;
1868 u32 val = clk_readl(c->reg);
1869
1870 if (c->flags & DIV_U71) {
1871 u32 divu71 = val & PERIPH_CLK_SOURCE_DIVU71_MASK;
1872 if ((c->flags & DIV_U71_UART) &&
1873 (!(val & PERIPH_CLK_UART_DIV_ENB))) {
1874 divu71 = 0;
1875 }
1876 if (c->flags & DIV_U71_IDLE) {
1877 val &= ~(PERIPH_CLK_SOURCE_DIVU71_MASK <<
1878 PERIPH_CLK_SOURCE_DIVIDLE_SHIFT);
1879 val |= (PERIPH_CLK_SOURCE_DIVIDLE_VAL <<
1880 PERIPH_CLK_SOURCE_DIVIDLE_SHIFT);
1881 clk_writel(val, c->reg);
1882 }
1883 c->div = divu71 + 2;
1884 c->mul = 2;
1885 } else if (c->flags & DIV_U16) {
1886 u32 divu16 = val & PERIPH_CLK_SOURCE_DIVU16_MASK;
1887 c->div = divu16 + 1;
1888 c->mul = 1;
1889 } else {
1890 c->div = 1;
1891 c->mul = 1;
1892 }
1893
1894 if (c->mul != 0 && c->div != 0) {
1895 rate *= c->mul;
1896 rate += c->div - 1; /* round up */
1897 do_div(rate, c->div);
1898 }
1899 return rate;
1900}
1901
1902struct clk_ops tegra30_periph_clk_ops = {
1903 .is_enabled = tegra30_periph_clk_is_enabled,
1904 .enable = tegra30_periph_clk_enable,
1905 .disable = tegra30_periph_clk_disable,
1906 .set_parent = tegra30_periph_clk_set_parent,
1907 .get_parent = tegra30_periph_clk_get_parent,
1908 .set_rate = tegra30_periph_clk_set_rate,
1909 .round_rate = tegra30_periph_clk_round_rate,
1910 .recalc_rate = tegra30_periph_clk_recalc_rate,
1911};
1912
1913static int tegra30_dsib_clk_set_parent(struct clk_hw *hw, u8 index)
1914{
1915 struct clk *d = clk_get_sys(NULL, "pll_d");
1916 /* The DSIB parent selection bit is in PLLD base
1917 register - can not do direct r-m-w, must be
1918 protected by PLLD lock */
1919 tegra_clk_cfg_ex(
1920 d, TEGRA_CLK_PLLD_MIPI_MUX_SEL, index);
1921
1922 return 0;
1923}
1924
1925struct clk_ops tegra30_dsib_clk_ops = {
1926 .is_enabled = tegra30_periph_clk_is_enabled,
1639 .enable = &tegra30_periph_clk_enable, 1927 .enable = &tegra30_periph_clk_enable,
1640 .disable = &tegra30_periph_clk_disable, 1928 .disable = &tegra30_periph_clk_disable,
1641 .set_parent = &tegra30_periph_clk_set_parent, 1929 .set_parent = &tegra30_dsib_clk_set_parent,
1930 .get_parent = &tegra30_periph_clk_get_parent,
1642 .set_rate = &tegra30_periph_clk_set_rate, 1931 .set_rate = &tegra30_periph_clk_set_rate,
1643 .round_rate = &tegra30_periph_clk_round_rate, 1932 .round_rate = &tegra30_periph_clk_round_rate,
1644 .reset = &tegra30_periph_clk_reset, 1933 .recalc_rate = &tegra30_periph_clk_recalc_rate,
1645}; 1934};
1646 1935
1647
1648/* Periph extended clock configuration ops */ 1936/* Periph extended clock configuration ops */
1649static int 1937int tegra30_vi_clk_cfg_ex(struct clk_hw *hw,
1650tegra30_vi_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting) 1938 enum tegra_clk_ex_param p, u32 setting)
1651{ 1939{
1940 struct clk_tegra *c = to_clk_tegra(hw);
1941
1652 if (p == TEGRA_CLK_VI_INP_SEL) { 1942 if (p == TEGRA_CLK_VI_INP_SEL) {
1653 u32 val = clk_readl(c->reg); 1943 u32 val = clk_readl(c->reg);
1654 val &= ~PERIPH_CLK_VI_SEL_EX_MASK; 1944 val &= ~PERIPH_CLK_VI_SEL_EX_MASK;
@@ -1660,20 +1950,11 @@ tegra30_vi_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting)
1660 return -EINVAL; 1950 return -EINVAL;
1661} 1951}
1662 1952
1663static struct clk_ops tegra_vi_clk_ops = { 1953int tegra30_nand_clk_cfg_ex(struct clk_hw *hw,
1664 .init = &tegra30_periph_clk_init, 1954 enum tegra_clk_ex_param p, u32 setting)
1665 .enable = &tegra30_periph_clk_enable,
1666 .disable = &tegra30_periph_clk_disable,
1667 .set_parent = &tegra30_periph_clk_set_parent,
1668 .set_rate = &tegra30_periph_clk_set_rate,
1669 .round_rate = &tegra30_periph_clk_round_rate,
1670 .clk_cfg_ex = &tegra30_vi_clk_cfg_ex,
1671 .reset = &tegra30_periph_clk_reset,
1672};
1673
1674static int
1675tegra30_nand_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting)
1676{ 1955{
1956 struct clk_tegra *c = to_clk_tegra(hw);
1957
1677 if (p == TEGRA_CLK_NAND_PAD_DIV2_ENB) { 1958 if (p == TEGRA_CLK_NAND_PAD_DIV2_ENB) {
1678 u32 val = clk_readl(c->reg); 1959 u32 val = clk_readl(c->reg);
1679 if (setting) 1960 if (setting)
@@ -1686,21 +1967,11 @@ tegra30_nand_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting)
1686 return -EINVAL; 1967 return -EINVAL;
1687} 1968}
1688 1969
1689static struct clk_ops tegra_nand_clk_ops = { 1970int tegra30_dtv_clk_cfg_ex(struct clk_hw *hw,
1690 .init = &tegra30_periph_clk_init, 1971 enum tegra_clk_ex_param p, u32 setting)
1691 .enable = &tegra30_periph_clk_enable,
1692 .disable = &tegra30_periph_clk_disable,
1693 .set_parent = &tegra30_periph_clk_set_parent,
1694 .set_rate = &tegra30_periph_clk_set_rate,
1695 .round_rate = &tegra30_periph_clk_round_rate,
1696 .clk_cfg_ex = &tegra30_nand_clk_cfg_ex,
1697 .reset = &tegra30_periph_clk_reset,
1698};
1699
1700
1701static int
1702tegra30_dtv_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting)
1703{ 1972{
1973 struct clk_tegra *c = to_clk_tegra(hw);
1974
1704 if (p == TEGRA_CLK_DTV_INVERT) { 1975 if (p == TEGRA_CLK_DTV_INVERT) {
1705 u32 val = clk_readl(c->reg); 1976 u32 val = clk_readl(c->reg);
1706 if (setting) 1977 if (setting)
@@ -1713,91 +1984,27 @@ tegra30_dtv_clk_cfg_ex(struct clk *c, enum tegra_clk_ex_param p, u32 setting)
1713 return -EINVAL; 1984 return -EINVAL;
1714} 1985}
1715 1986
1716static struct clk_ops tegra_dtv_clk_ops = {
1717 .init = &tegra30_periph_clk_init,
1718 .enable = &tegra30_periph_clk_enable,
1719 .disable = &tegra30_periph_clk_disable,
1720 .set_parent = &tegra30_periph_clk_set_parent,
1721 .set_rate = &tegra30_periph_clk_set_rate,
1722 .round_rate = &tegra30_periph_clk_round_rate,
1723 .clk_cfg_ex = &tegra30_dtv_clk_cfg_ex,
1724 .reset = &tegra30_periph_clk_reset,
1725};
1726
1727static int tegra30_dsib_clk_set_parent(struct clk *c, struct clk *p)
1728{
1729 const struct clk_mux_sel *sel;
1730 struct clk *d = tegra_get_clock_by_name("pll_d");
1731
1732 pr_debug("%s: %s %s\n", __func__, c->name, p->name);
1733
1734 for (sel = c->inputs; sel->input != NULL; sel++) {
1735 if (sel->input == p) {
1736 if (c->refcnt)
1737 clk_enable(p);
1738
1739 /* The DSIB parent selection bit is in PLLD base
1740 register - can not do direct r-m-w, must be
1741 protected by PLLD lock */
1742 tegra_clk_cfg_ex(
1743 d, TEGRA_CLK_PLLD_MIPI_MUX_SEL, sel->value);
1744
1745 if (c->refcnt && c->parent)
1746 clk_disable(c->parent);
1747
1748 clk_reparent(c, p);
1749 return 0;
1750 }
1751 }
1752
1753 return -EINVAL;
1754}
1755
1756static struct clk_ops tegra_dsib_clk_ops = {
1757 .init = &tegra30_periph_clk_init,
1758 .enable = &tegra30_periph_clk_enable,
1759 .disable = &tegra30_periph_clk_disable,
1760 .set_parent = &tegra30_dsib_clk_set_parent,
1761 .set_rate = &tegra30_periph_clk_set_rate,
1762 .round_rate = &tegra30_periph_clk_round_rate,
1763 .reset = &tegra30_periph_clk_reset,
1764};
1765
1766/* pciex clock support only reset function */
1767static struct clk_ops tegra_pciex_clk_ops = {
1768 .reset = tegra30_periph_clk_reset,
1769};
1770
1771/* Output clock ops */ 1987/* Output clock ops */
1772 1988
1773static DEFINE_SPINLOCK(clk_out_lock); 1989static DEFINE_SPINLOCK(clk_out_lock);
1774 1990
1775static void tegra30_clk_out_init(struct clk *c) 1991static int tegra30_clk_out_is_enabled(struct clk_hw *hw)
1776{ 1992{
1777 const struct clk_mux_sel *mux = 0; 1993 struct clk_tegra *c = to_clk_tegra(hw);
1778 const struct clk_mux_sel *sel;
1779 u32 val = pmc_readl(c->reg); 1994 u32 val = pmc_readl(c->reg);
1780 1995
1781 c->state = (val & (0x1 << c->u.periph.clk_num)) ? ON : OFF; 1996 c->state = (val & (0x1 << c->u.periph.clk_num)) ? ON : OFF;
1782 c->mul = 1; 1997 c->mul = 1;
1783 c->div = 1; 1998 c->div = 1;
1784 1999 return c->state;
1785 for (sel = c->inputs; sel->input != NULL; sel++) {
1786 if (((val & periph_clk_source_mask(c)) >>
1787 periph_clk_source_shift(c)) == sel->value)
1788 mux = sel;
1789 }
1790 BUG_ON(!mux);
1791 c->parent = mux->input;
1792} 2000}
1793 2001
1794static int tegra30_clk_out_enable(struct clk *c) 2002static int tegra30_clk_out_enable(struct clk_hw *hw)
1795{ 2003{
2004 struct clk_tegra *c = to_clk_tegra(hw);
1796 u32 val; 2005 u32 val;
1797 unsigned long flags; 2006 unsigned long flags;
1798 2007
1799 pr_debug("%s on clock %s\n", __func__, c->name);
1800
1801 spin_lock_irqsave(&clk_out_lock, flags); 2008 spin_lock_irqsave(&clk_out_lock, flags);
1802 val = pmc_readl(c->reg); 2009 val = pmc_readl(c->reg);
1803 val |= (0x1 << c->u.periph.clk_num); 2010 val |= (0x1 << c->u.periph.clk_num);
@@ -1807,13 +2014,12 @@ static int tegra30_clk_out_enable(struct clk *c)
1807 return 0; 2014 return 0;
1808} 2015}
1809 2016
1810static void tegra30_clk_out_disable(struct clk *c) 2017static void tegra30_clk_out_disable(struct clk_hw *hw)
1811{ 2018{
2019 struct clk_tegra *c = to_clk_tegra(hw);
1812 u32 val; 2020 u32 val;
1813 unsigned long flags; 2021 unsigned long flags;
1814 2022
1815 pr_debug("%s on clock %s\n", __func__, c->name);
1816
1817 spin_lock_irqsave(&clk_out_lock, flags); 2023 spin_lock_irqsave(&clk_out_lock, flags);
1818 val = pmc_readl(c->reg); 2024 val = pmc_readl(c->reg);
1819 val &= ~(0x1 << c->u.periph.clk_num); 2025 val &= ~(0x1 << c->u.periph.clk_num);
@@ -1821,59 +2027,59 @@ static void tegra30_clk_out_disable(struct clk *c)
1821 spin_unlock_irqrestore(&clk_out_lock, flags); 2027 spin_unlock_irqrestore(&clk_out_lock, flags);
1822} 2028}
1823 2029
1824static int tegra30_clk_out_set_parent(struct clk *c, struct clk *p) 2030static int tegra30_clk_out_set_parent(struct clk_hw *hw, u8 index)
1825{ 2031{
2032 struct clk_tegra *c = to_clk_tegra(hw);
1826 u32 val; 2033 u32 val;
1827 unsigned long flags; 2034 unsigned long flags;
1828 const struct clk_mux_sel *sel;
1829 2035
1830 pr_debug("%s: %s %s\n", __func__, c->name, p->name); 2036 spin_lock_irqsave(&clk_out_lock, flags);
1831 2037 val = pmc_readl(c->reg);
1832 for (sel = c->inputs; sel->input != NULL; sel++) { 2038 val &= ~periph_clk_source_mask(c);
1833 if (sel->input == p) { 2039 val |= (index << periph_clk_source_shift(c));
1834 if (c->refcnt) 2040 pmc_writel(val, c->reg);
1835 clk_enable(p); 2041 spin_unlock_irqrestore(&clk_out_lock, flags);
1836 2042
1837 spin_lock_irqsave(&clk_out_lock, flags); 2043 return 0;
1838 val = pmc_readl(c->reg); 2044}
1839 val &= ~periph_clk_source_mask(c);
1840 val |= (sel->value << periph_clk_source_shift(c));
1841 pmc_writel(val, c->reg);
1842 spin_unlock_irqrestore(&clk_out_lock, flags);
1843 2045
1844 if (c->refcnt && c->parent) 2046static u8 tegra30_clk_out_get_parent(struct clk_hw *hw)
1845 clk_disable(c->parent); 2047{
2048 struct clk_tegra *c = to_clk_tegra(hw);
2049 u32 val = pmc_readl(c->reg);
2050 int source;
1846 2051
1847 clk_reparent(c, p); 2052 source = (val & periph_clk_source_mask(c)) >>
1848 return 0; 2053 periph_clk_source_shift(c);
1849 } 2054 return source;
1850 }
1851 return -EINVAL;
1852} 2055}
1853 2056
1854static struct clk_ops tegra_clk_out_ops = { 2057struct clk_ops tegra_clk_out_ops = {
1855 .init = &tegra30_clk_out_init, 2058 .is_enabled = tegra30_clk_out_is_enabled,
1856 .enable = &tegra30_clk_out_enable, 2059 .enable = tegra30_clk_out_enable,
1857 .disable = &tegra30_clk_out_disable, 2060 .disable = tegra30_clk_out_disable,
1858 .set_parent = &tegra30_clk_out_set_parent, 2061 .set_parent = tegra30_clk_out_set_parent,
2062 .get_parent = tegra30_clk_out_get_parent,
2063 .recalc_rate = tegra30_clk_fixed_recalc_rate,
1859}; 2064};
1860 2065
1861
1862/* Clock doubler ops */ 2066/* Clock doubler ops */
1863static void tegra30_clk_double_init(struct clk *c) 2067static int tegra30_clk_double_is_enabled(struct clk_hw *hw)
1864{ 2068{
1865 u32 val = clk_readl(c->reg); 2069 struct clk_tegra *c = to_clk_tegra(hw);
1866 c->mul = val & (0x1 << c->reg_shift) ? 1 : 2; 2070
1867 c->div = 1;
1868 c->state = ON; 2071 c->state = ON;
1869 if (!(clk_readl(PERIPH_CLK_TO_ENB_REG(c)) & PERIPH_CLK_TO_BIT(c))) 2072 if (!(clk_readl(PERIPH_CLK_TO_ENB_REG(c)) & PERIPH_CLK_TO_BIT(c)))
1870 c->state = OFF; 2073 c->state = OFF;
2074 return c->state;
1871}; 2075};
1872 2076
1873static int tegra30_clk_double_set_rate(struct clk *c, unsigned long rate) 2077static int tegra30_clk_double_set_rate(struct clk_hw *hw, unsigned long rate,
2078 unsigned long parent_rate)
1874{ 2079{
2080 struct clk_tegra *c = to_clk_tegra(hw);
1875 u32 val; 2081 u32 val;
1876 unsigned long parent_rate = clk_get_rate(c->parent); 2082
1877 if (rate == parent_rate) { 2083 if (rate == parent_rate) {
1878 val = clk_readl(c->reg) | (0x1 << c->reg_shift); 2084 val = clk_readl(c->reg) | (0x1 << c->reg_shift);
1879 clk_writel(val, c->reg); 2085 clk_writel(val, c->reg);
@@ -1890,1215 +2096,200 @@ static int tegra30_clk_double_set_rate(struct clk *c, unsigned long rate)
1890 return -EINVAL; 2096 return -EINVAL;
1891} 2097}
1892 2098
1893static struct clk_ops tegra_clk_double_ops = { 2099static unsigned long tegra30_clk_double_recalc_rate(struct clk_hw *hw,
1894 .init = &tegra30_clk_double_init, 2100 unsigned long parent_rate)
1895 .enable = &tegra30_periph_clk_enable, 2101{
1896 .disable = &tegra30_periph_clk_disable, 2102 struct clk_tegra *c = to_clk_tegra(hw);
1897 .set_rate = &tegra30_clk_double_set_rate, 2103 u64 rate = parent_rate;
1898};
1899 2104
1900/* Audio sync clock ops */ 2105 u32 val = clk_readl(c->reg);
1901static int tegra30_sync_source_set_rate(struct clk *c, unsigned long rate) 2106 c->mul = val & (0x1 << c->reg_shift) ? 1 : 2;
2107 c->div = 1;
2108
2109 if (c->mul != 0 && c->div != 0) {
2110 rate *= c->mul;
2111 rate += c->div - 1; /* round up */
2112 do_div(rate, c->div);
2113 }
2114
2115 return rate;
2116}
2117
2118static long tegra30_clk_double_round_rate(struct clk_hw *hw, unsigned long rate,
2119 unsigned long *prate)
1902{ 2120{
1903 c->rate = rate; 2121 unsigned long output_rate = *prate;
1904 return 0; 2122
2123 do_div(output_rate, 2);
2124 return output_rate;
1905} 2125}
1906 2126
1907static struct clk_ops tegra_sync_source_ops = { 2127struct clk_ops tegra30_clk_double_ops = {
1908 .set_rate = &tegra30_sync_source_set_rate, 2128 .is_enabled = tegra30_clk_double_is_enabled,
2129 .enable = tegra30_periph_clk_enable,
2130 .disable = tegra30_periph_clk_disable,
2131 .recalc_rate = tegra30_clk_double_recalc_rate,
2132 .round_rate = tegra30_clk_double_round_rate,
2133 .set_rate = tegra30_clk_double_set_rate,
2134};
2135
2136/* Audio sync clock ops */
2137struct clk_ops tegra_sync_source_ops = {
2138 .recalc_rate = tegra30_clk_fixed_recalc_rate,
1909}; 2139};
1910 2140
1911static void tegra30_audio_sync_clk_init(struct clk *c) 2141static int tegra30_audio_sync_clk_is_enabled(struct clk_hw *hw)
1912{ 2142{
1913 int source; 2143 struct clk_tegra *c = to_clk_tegra(hw);
1914 const struct clk_mux_sel *sel;
1915 u32 val = clk_readl(c->reg); 2144 u32 val = clk_readl(c->reg);
1916 c->state = (val & AUDIO_SYNC_DISABLE_BIT) ? OFF : ON; 2145 c->state = (val & AUDIO_SYNC_DISABLE_BIT) ? OFF : ON;
1917 source = val & AUDIO_SYNC_SOURCE_MASK; 2146 return c->state;
1918 for (sel = c->inputs; sel->input != NULL; sel++)
1919 if (sel->value == source)
1920 break;
1921 BUG_ON(sel->input == NULL);
1922 c->parent = sel->input;
1923} 2147}
1924 2148
1925static int tegra30_audio_sync_clk_enable(struct clk *c) 2149static int tegra30_audio_sync_clk_enable(struct clk_hw *hw)
1926{ 2150{
2151 struct clk_tegra *c = to_clk_tegra(hw);
1927 u32 val = clk_readl(c->reg); 2152 u32 val = clk_readl(c->reg);
1928 clk_writel((val & (~AUDIO_SYNC_DISABLE_BIT)), c->reg); 2153 clk_writel((val & (~AUDIO_SYNC_DISABLE_BIT)), c->reg);
1929 return 0; 2154 return 0;
1930} 2155}
1931 2156
1932static void tegra30_audio_sync_clk_disable(struct clk *c) 2157static void tegra30_audio_sync_clk_disable(struct clk_hw *hw)
1933{ 2158{
2159 struct clk_tegra *c = to_clk_tegra(hw);
1934 u32 val = clk_readl(c->reg); 2160 u32 val = clk_readl(c->reg);
1935 clk_writel((val | AUDIO_SYNC_DISABLE_BIT), c->reg); 2161 clk_writel((val | AUDIO_SYNC_DISABLE_BIT), c->reg);
1936} 2162}
1937 2163
1938static int tegra30_audio_sync_clk_set_parent(struct clk *c, struct clk *p) 2164static int tegra30_audio_sync_clk_set_parent(struct clk_hw *hw, u8 index)
1939{ 2165{
2166 struct clk_tegra *c = to_clk_tegra(hw);
1940 u32 val; 2167 u32 val;
1941 const struct clk_mux_sel *sel;
1942 for (sel = c->inputs; sel->input != NULL; sel++) {
1943 if (sel->input == p) {
1944 val = clk_readl(c->reg);
1945 val &= ~AUDIO_SYNC_SOURCE_MASK;
1946 val |= sel->value;
1947
1948 if (c->refcnt)
1949 clk_enable(p);
1950 2168
1951 clk_writel(val, c->reg); 2169 val = clk_readl(c->reg);
2170 val &= ~AUDIO_SYNC_SOURCE_MASK;
2171 val |= index;
1952 2172
1953 if (c->refcnt && c->parent) 2173 clk_writel(val, c->reg);
1954 clk_disable(c->parent); 2174 return 0;
2175}
1955 2176
1956 clk_reparent(c, p); 2177static u8 tegra30_audio_sync_clk_get_parent(struct clk_hw *hw)
1957 return 0; 2178{
1958 } 2179 struct clk_tegra *c = to_clk_tegra(hw);
1959 } 2180 u32 val = clk_readl(c->reg);
2181 int source;
1960 2182
1961 return -EINVAL; 2183 source = val & AUDIO_SYNC_SOURCE_MASK;
2184 return source;
1962} 2185}
1963 2186
1964static struct clk_ops tegra_audio_sync_clk_ops = { 2187struct clk_ops tegra30_audio_sync_clk_ops = {
1965 .init = tegra30_audio_sync_clk_init, 2188 .is_enabled = tegra30_audio_sync_clk_is_enabled,
1966 .enable = tegra30_audio_sync_clk_enable, 2189 .enable = tegra30_audio_sync_clk_enable,
1967 .disable = tegra30_audio_sync_clk_disable, 2190 .disable = tegra30_audio_sync_clk_disable,
1968 .set_parent = tegra30_audio_sync_clk_set_parent, 2191 .set_parent = tegra30_audio_sync_clk_set_parent,
2192 .get_parent = tegra30_audio_sync_clk_get_parent,
2193 .recalc_rate = tegra30_clk_fixed_recalc_rate,
1969}; 2194};
1970 2195
1971/* cml0 (pcie), and cml1 (sata) clock ops */ 2196/* cml0 (pcie), and cml1 (sata) clock ops */
1972static void tegra30_cml_clk_init(struct clk *c) 2197static int tegra30_cml_clk_is_enabled(struct clk_hw *hw)
1973{ 2198{
2199 struct clk_tegra *c = to_clk_tegra(hw);
1974 u32 val = clk_readl(c->reg); 2200 u32 val = clk_readl(c->reg);
1975 c->state = val & (0x1 << c->u.periph.clk_num) ? ON : OFF; 2201 c->state = val & (0x1 << c->u.periph.clk_num) ? ON : OFF;
2202 return c->state;
1976} 2203}
1977 2204
1978static int tegra30_cml_clk_enable(struct clk *c) 2205static int tegra30_cml_clk_enable(struct clk_hw *hw)
1979{ 2206{
2207 struct clk_tegra *c = to_clk_tegra(hw);
2208
1980 u32 val = clk_readl(c->reg); 2209 u32 val = clk_readl(c->reg);
1981 val |= (0x1 << c->u.periph.clk_num); 2210 val |= (0x1 << c->u.periph.clk_num);
1982 clk_writel(val, c->reg); 2211 clk_writel(val, c->reg);
2212
1983 return 0; 2213 return 0;
1984} 2214}
1985 2215
1986static void tegra30_cml_clk_disable(struct clk *c) 2216static void tegra30_cml_clk_disable(struct clk_hw *hw)
1987{ 2217{
2218 struct clk_tegra *c = to_clk_tegra(hw);
2219
1988 u32 val = clk_readl(c->reg); 2220 u32 val = clk_readl(c->reg);
1989 val &= ~(0x1 << c->u.periph.clk_num); 2221 val &= ~(0x1 << c->u.periph.clk_num);
1990 clk_writel(val, c->reg); 2222 clk_writel(val, c->reg);
1991} 2223}
1992 2224
1993static struct clk_ops tegra_cml_clk_ops = { 2225struct clk_ops tegra_cml_clk_ops = {
1994 .init = &tegra30_cml_clk_init, 2226 .is_enabled = tegra30_cml_clk_is_enabled,
1995 .enable = &tegra30_cml_clk_enable, 2227 .enable = tegra30_cml_clk_enable,
1996 .disable = &tegra30_cml_clk_disable, 2228 .disable = tegra30_cml_clk_disable,
1997}; 2229 .recalc_rate = tegra30_clk_fixed_recalc_rate,
1998
1999/* Clock definitions */
2000static struct clk tegra_clk_32k = {
2001 .name = "clk_32k",
2002 .rate = 32768,
2003 .ops = NULL,
2004 .max_rate = 32768,
2005};
2006
2007static struct clk tegra_clk_m = {
2008 .name = "clk_m",
2009 .flags = ENABLE_ON_INIT,
2010 .ops = &tegra_clk_m_ops,
2011 .reg = 0x1fc,
2012 .reg_shift = 28,
2013 .max_rate = 48000000,
2014};
2015
2016static struct clk tegra_clk_m_div2 = {
2017 .name = "clk_m_div2",
2018 .ops = &tegra_clk_m_div_ops,
2019 .parent = &tegra_clk_m,
2020 .mul = 1,
2021 .div = 2,
2022 .state = ON,
2023 .max_rate = 24000000,
2024};
2025
2026static struct clk tegra_clk_m_div4 = {
2027 .name = "clk_m_div4",
2028 .ops = &tegra_clk_m_div_ops,
2029 .parent = &tegra_clk_m,
2030 .mul = 1,
2031 .div = 4,
2032 .state = ON,
2033 .max_rate = 12000000,
2034};
2035
2036static struct clk tegra_pll_ref = {
2037 .name = "pll_ref",
2038 .flags = ENABLE_ON_INIT,
2039 .ops = &tegra_pll_ref_ops,
2040 .parent = &tegra_clk_m,
2041 .max_rate = 26000000,
2042};
2043
2044static struct clk_pll_freq_table tegra_pll_c_freq_table[] = {
2045 { 12000000, 1040000000, 520, 6, 1, 8},
2046 { 13000000, 1040000000, 480, 6, 1, 8},
2047 { 16800000, 1040000000, 495, 8, 1, 8}, /* actual: 1039.5 MHz */
2048 { 19200000, 1040000000, 325, 6, 1, 6},
2049 { 26000000, 1040000000, 520, 13, 1, 8},
2050
2051 { 12000000, 832000000, 416, 6, 1, 8},
2052 { 13000000, 832000000, 832, 13, 1, 8},
2053 { 16800000, 832000000, 396, 8, 1, 8}, /* actual: 831.6 MHz */
2054 { 19200000, 832000000, 260, 6, 1, 8},
2055 { 26000000, 832000000, 416, 13, 1, 8},
2056
2057 { 12000000, 624000000, 624, 12, 1, 8},
2058 { 13000000, 624000000, 624, 13, 1, 8},
2059 { 16800000, 600000000, 520, 14, 1, 8},
2060 { 19200000, 624000000, 520, 16, 1, 8},
2061 { 26000000, 624000000, 624, 26, 1, 8},
2062
2063 { 12000000, 600000000, 600, 12, 1, 8},
2064 { 13000000, 600000000, 600, 13, 1, 8},
2065 { 16800000, 600000000, 500, 14, 1, 8},
2066 { 19200000, 600000000, 375, 12, 1, 6},
2067 { 26000000, 600000000, 600, 26, 1, 8},
2068
2069 { 12000000, 520000000, 520, 12, 1, 8},
2070 { 13000000, 520000000, 520, 13, 1, 8},
2071 { 16800000, 520000000, 495, 16, 1, 8}, /* actual: 519.75 MHz */
2072 { 19200000, 520000000, 325, 12, 1, 6},
2073 { 26000000, 520000000, 520, 26, 1, 8},
2074
2075 { 12000000, 416000000, 416, 12, 1, 8},
2076 { 13000000, 416000000, 416, 13, 1, 8},
2077 { 16800000, 416000000, 396, 16, 1, 8}, /* actual: 415.8 MHz */
2078 { 19200000, 416000000, 260, 12, 1, 6},
2079 { 26000000, 416000000, 416, 26, 1, 8},
2080 { 0, 0, 0, 0, 0, 0 },
2081};
2082
2083static struct clk tegra_pll_c = {
2084 .name = "pll_c",
2085 .flags = PLL_HAS_CPCON,
2086 .ops = &tegra_pll_ops,
2087 .reg = 0x80,
2088 .parent = &tegra_pll_ref,
2089 .max_rate = 1400000000,
2090 .u.pll = {
2091 .input_min = 2000000,
2092 .input_max = 31000000,
2093 .cf_min = 1000000,
2094 .cf_max = 6000000,
2095 .vco_min = 20000000,
2096 .vco_max = 1400000000,
2097 .freq_table = tegra_pll_c_freq_table,
2098 .lock_delay = 300,
2099 },
2100};
2101
2102static struct clk tegra_pll_c_out1 = {
2103 .name = "pll_c_out1",
2104 .ops = &tegra_pll_div_ops,
2105 .flags = DIV_U71,
2106 .parent = &tegra_pll_c,
2107 .reg = 0x84,
2108 .reg_shift = 0,
2109 .max_rate = 700000000,
2110};
2111
2112static struct clk_pll_freq_table tegra_pll_m_freq_table[] = {
2113 { 12000000, 666000000, 666, 12, 1, 8},
2114 { 13000000, 666000000, 666, 13, 1, 8},
2115 { 16800000, 666000000, 555, 14, 1, 8},
2116 { 19200000, 666000000, 555, 16, 1, 8},
2117 { 26000000, 666000000, 666, 26, 1, 8},
2118 { 12000000, 600000000, 600, 12, 1, 8},
2119 { 13000000, 600000000, 600, 13, 1, 8},
2120 { 16800000, 600000000, 500, 14, 1, 8},
2121 { 19200000, 600000000, 375, 12, 1, 6},
2122 { 26000000, 600000000, 600, 26, 1, 8},
2123 { 0, 0, 0, 0, 0, 0 },
2124};
2125
2126static struct clk tegra_pll_m = {
2127 .name = "pll_m",
2128 .flags = PLL_HAS_CPCON | PLLM,
2129 .ops = &tegra_pll_ops,
2130 .reg = 0x90,
2131 .parent = &tegra_pll_ref,
2132 .max_rate = 800000000,
2133 .u.pll = {
2134 .input_min = 2000000,
2135 .input_max = 31000000,
2136 .cf_min = 1000000,
2137 .cf_max = 6000000,
2138 .vco_min = 20000000,
2139 .vco_max = 1200000000,
2140 .freq_table = tegra_pll_m_freq_table,
2141 .lock_delay = 300,
2142 },
2143};
2144
2145static struct clk tegra_pll_m_out1 = {
2146 .name = "pll_m_out1",
2147 .ops = &tegra_pll_div_ops,
2148 .flags = DIV_U71,
2149 .parent = &tegra_pll_m,
2150 .reg = 0x94,
2151 .reg_shift = 0,
2152 .max_rate = 600000000,
2153};
2154
2155static struct clk_pll_freq_table tegra_pll_p_freq_table[] = {
2156 { 12000000, 216000000, 432, 12, 2, 8},
2157 { 13000000, 216000000, 432, 13, 2, 8},
2158 { 16800000, 216000000, 360, 14, 2, 8},
2159 { 19200000, 216000000, 360, 16, 2, 8},
2160 { 26000000, 216000000, 432, 26, 2, 8},
2161 { 0, 0, 0, 0, 0, 0 },
2162};
2163
2164static struct clk tegra_pll_p = {
2165 .name = "pll_p",
2166 .flags = ENABLE_ON_INIT | PLL_FIXED | PLL_HAS_CPCON,
2167 .ops = &tegra_pll_ops,
2168 .reg = 0xa0,
2169 .parent = &tegra_pll_ref,
2170 .max_rate = 432000000,
2171 .u.pll = {
2172 .input_min = 2000000,
2173 .input_max = 31000000,
2174 .cf_min = 1000000,
2175 .cf_max = 6000000,
2176 .vco_min = 20000000,
2177 .vco_max = 1400000000,
2178 .freq_table = tegra_pll_p_freq_table,
2179 .lock_delay = 300,
2180 .fixed_rate = 408000000,
2181 },
2182};
2183
2184static struct clk tegra_pll_p_out1 = {
2185 .name = "pll_p_out1",
2186 .ops = &tegra_pll_div_ops,
2187 .flags = ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED,
2188 .parent = &tegra_pll_p,
2189 .reg = 0xa4,
2190 .reg_shift = 0,
2191 .max_rate = 432000000,
2192};
2193
2194static struct clk tegra_pll_p_out2 = {
2195 .name = "pll_p_out2",
2196 .ops = &tegra_pll_div_ops,
2197 .flags = ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED,
2198 .parent = &tegra_pll_p,
2199 .reg = 0xa4,
2200 .reg_shift = 16,
2201 .max_rate = 432000000,
2202};
2203
2204static struct clk tegra_pll_p_out3 = {
2205 .name = "pll_p_out3",
2206 .ops = &tegra_pll_div_ops,
2207 .flags = ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED,
2208 .parent = &tegra_pll_p,
2209 .reg = 0xa8,
2210 .reg_shift = 0,
2211 .max_rate = 432000000,
2212};
2213
2214static struct clk tegra_pll_p_out4 = {
2215 .name = "pll_p_out4",
2216 .ops = &tegra_pll_div_ops,
2217 .flags = ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED,
2218 .parent = &tegra_pll_p,
2219 .reg = 0xa8,
2220 .reg_shift = 16,
2221 .max_rate = 432000000,
2222};
2223
2224static struct clk_pll_freq_table tegra_pll_a_freq_table[] = {
2225 { 9600000, 564480000, 294, 5, 1, 4},
2226 { 9600000, 552960000, 288, 5, 1, 4},
2227 { 9600000, 24000000, 5, 2, 1, 1},
2228
2229 { 28800000, 56448000, 49, 25, 1, 1},
2230 { 28800000, 73728000, 64, 25, 1, 1},
2231 { 28800000, 24000000, 5, 6, 1, 1},
2232 { 0, 0, 0, 0, 0, 0 },
2233};
2234
2235static struct clk tegra_pll_a = {
2236 .name = "pll_a",
2237 .flags = PLL_HAS_CPCON,
2238 .ops = &tegra_pll_ops,
2239 .reg = 0xb0,
2240 .parent = &tegra_pll_p_out1,
2241 .max_rate = 700000000,
2242 .u.pll = {
2243 .input_min = 2000000,
2244 .input_max = 31000000,
2245 .cf_min = 1000000,
2246 .cf_max = 6000000,
2247 .vco_min = 20000000,
2248 .vco_max = 1400000000,
2249 .freq_table = tegra_pll_a_freq_table,
2250 .lock_delay = 300,
2251 },
2252};
2253
2254static struct clk tegra_pll_a_out0 = {
2255 .name = "pll_a_out0",
2256 .ops = &tegra_pll_div_ops,
2257 .flags = DIV_U71,
2258 .parent = &tegra_pll_a,
2259 .reg = 0xb4,
2260 .reg_shift = 0,
2261 .max_rate = 100000000,
2262};
2263
2264static struct clk_pll_freq_table tegra_pll_d_freq_table[] = {
2265 { 12000000, 216000000, 216, 12, 1, 4},
2266 { 13000000, 216000000, 216, 13, 1, 4},
2267 { 16800000, 216000000, 180, 14, 1, 4},
2268 { 19200000, 216000000, 180, 16, 1, 4},
2269 { 26000000, 216000000, 216, 26, 1, 4},
2270
2271 { 12000000, 594000000, 594, 12, 1, 8},
2272 { 13000000, 594000000, 594, 13, 1, 8},
2273 { 16800000, 594000000, 495, 14, 1, 8},
2274 { 19200000, 594000000, 495, 16, 1, 8},
2275 { 26000000, 594000000, 594, 26, 1, 8},
2276
2277 { 12000000, 1000000000, 1000, 12, 1, 12},
2278 { 13000000, 1000000000, 1000, 13, 1, 12},
2279 { 19200000, 1000000000, 625, 12, 1, 8},
2280 { 26000000, 1000000000, 1000, 26, 1, 12},
2281
2282 { 0, 0, 0, 0, 0, 0 },
2283};
2284
2285static struct clk tegra_pll_d = {
2286 .name = "pll_d",
2287 .flags = PLL_HAS_CPCON | PLLD,
2288 .ops = &tegra_plld_ops,
2289 .reg = 0xd0,
2290 .parent = &tegra_pll_ref,
2291 .max_rate = 1000000000,
2292 .u.pll = {
2293 .input_min = 2000000,
2294 .input_max = 40000000,
2295 .cf_min = 1000000,
2296 .cf_max = 6000000,
2297 .vco_min = 40000000,
2298 .vco_max = 1000000000,
2299 .freq_table = tegra_pll_d_freq_table,
2300 .lock_delay = 1000,
2301 },
2302};
2303
2304static struct clk tegra_pll_d_out0 = {
2305 .name = "pll_d_out0",
2306 .ops = &tegra_pll_div_ops,
2307 .flags = DIV_2 | PLLD,
2308 .parent = &tegra_pll_d,
2309 .max_rate = 500000000,
2310};
2311
2312static struct clk tegra_pll_d2 = {
2313 .name = "pll_d2",
2314 .flags = PLL_HAS_CPCON | PLL_ALT_MISC_REG | PLLD,
2315 .ops = &tegra_plld_ops,
2316 .reg = 0x4b8,
2317 .parent = &tegra_pll_ref,
2318 .max_rate = 1000000000,
2319 .u.pll = {
2320 .input_min = 2000000,
2321 .input_max = 40000000,
2322 .cf_min = 1000000,
2323 .cf_max = 6000000,
2324 .vco_min = 40000000,
2325 .vco_max = 1000000000,
2326 .freq_table = tegra_pll_d_freq_table,
2327 .lock_delay = 1000,
2328 },
2329};
2330
2331static struct clk tegra_pll_d2_out0 = {
2332 .name = "pll_d2_out0",
2333 .ops = &tegra_pll_div_ops,
2334 .flags = DIV_2 | PLLD,
2335 .parent = &tegra_pll_d2,
2336 .max_rate = 500000000,
2337};
2338
2339static struct clk_pll_freq_table tegra_pll_u_freq_table[] = {
2340 { 12000000, 480000000, 960, 12, 2, 12},
2341 { 13000000, 480000000, 960, 13, 2, 12},
2342 { 16800000, 480000000, 400, 7, 2, 5},
2343 { 19200000, 480000000, 200, 4, 2, 3},
2344 { 26000000, 480000000, 960, 26, 2, 12},
2345 { 0, 0, 0, 0, 0, 0 },
2346};
2347
2348static struct clk tegra_pll_u = {
2349 .name = "pll_u",
2350 .flags = PLL_HAS_CPCON | PLLU,
2351 .ops = &tegra_pll_ops,
2352 .reg = 0xc0,
2353 .parent = &tegra_pll_ref,
2354 .max_rate = 480000000,
2355 .u.pll = {
2356 .input_min = 2000000,
2357 .input_max = 40000000,
2358 .cf_min = 1000000,
2359 .cf_max = 6000000,
2360 .vco_min = 480000000,
2361 .vco_max = 960000000,
2362 .freq_table = tegra_pll_u_freq_table,
2363 .lock_delay = 1000,
2364 },
2365};
2366
2367static struct clk_pll_freq_table tegra_pll_x_freq_table[] = {
2368 /* 1.7 GHz */
2369 { 12000000, 1700000000, 850, 6, 1, 8},
2370 { 13000000, 1700000000, 915, 7, 1, 8}, /* actual: 1699.2 MHz */
2371 { 16800000, 1700000000, 708, 7, 1, 8}, /* actual: 1699.2 MHz */
2372 { 19200000, 1700000000, 885, 10, 1, 8}, /* actual: 1699.2 MHz */
2373 { 26000000, 1700000000, 850, 13, 1, 8},
2374
2375 /* 1.6 GHz */
2376 { 12000000, 1600000000, 800, 6, 1, 8},
2377 { 13000000, 1600000000, 738, 6, 1, 8}, /* actual: 1599.0 MHz */
2378 { 16800000, 1600000000, 857, 9, 1, 8}, /* actual: 1599.7 MHz */
2379 { 19200000, 1600000000, 500, 6, 1, 8},
2380 { 26000000, 1600000000, 800, 13, 1, 8},
2381
2382 /* 1.5 GHz */
2383 { 12000000, 1500000000, 750, 6, 1, 8},
2384 { 13000000, 1500000000, 923, 8, 1, 8}, /* actual: 1499.8 MHz */
2385 { 16800000, 1500000000, 625, 7, 1, 8},
2386 { 19200000, 1500000000, 625, 8, 1, 8},
2387 { 26000000, 1500000000, 750, 13, 1, 8},
2388
2389 /* 1.4 GHz */
2390 { 12000000, 1400000000, 700, 6, 1, 8},
2391 { 13000000, 1400000000, 969, 9, 1, 8}, /* actual: 1399.7 MHz */
2392 { 16800000, 1400000000, 1000, 12, 1, 8},
2393 { 19200000, 1400000000, 875, 12, 1, 8},
2394 { 26000000, 1400000000, 700, 13, 1, 8},
2395
2396 /* 1.3 GHz */
2397 { 12000000, 1300000000, 975, 9, 1, 8},
2398 { 13000000, 1300000000, 1000, 10, 1, 8},
2399 { 16800000, 1300000000, 928, 12, 1, 8}, /* actual: 1299.2 MHz */
2400 { 19200000, 1300000000, 812, 12, 1, 8}, /* actual: 1299.2 MHz */
2401 { 26000000, 1300000000, 650, 13, 1, 8},
2402
2403 /* 1.2 GHz */
2404 { 12000000, 1200000000, 1000, 10, 1, 8},
2405 { 13000000, 1200000000, 923, 10, 1, 8}, /* actual: 1199.9 MHz */
2406 { 16800000, 1200000000, 1000, 14, 1, 8},
2407 { 19200000, 1200000000, 1000, 16, 1, 8},
2408 { 26000000, 1200000000, 600, 13, 1, 8},
2409
2410 /* 1.1 GHz */
2411 { 12000000, 1100000000, 825, 9, 1, 8},
2412 { 13000000, 1100000000, 846, 10, 1, 8}, /* actual: 1099.8 MHz */
2413 { 16800000, 1100000000, 982, 15, 1, 8}, /* actual: 1099.8 MHz */
2414 { 19200000, 1100000000, 859, 15, 1, 8}, /* actual: 1099.5 MHz */
2415 { 26000000, 1100000000, 550, 13, 1, 8},
2416
2417 /* 1 GHz */
2418 { 12000000, 1000000000, 1000, 12, 1, 8},
2419 { 13000000, 1000000000, 1000, 13, 1, 8},
2420 { 16800000, 1000000000, 833, 14, 1, 8}, /* actual: 999.6 MHz */
2421 { 19200000, 1000000000, 625, 12, 1, 8},
2422 { 26000000, 1000000000, 1000, 26, 1, 8},
2423
2424 { 0, 0, 0, 0, 0, 0 },
2425};
2426
2427static struct clk tegra_pll_x = {
2428 .name = "pll_x",
2429 .flags = PLL_HAS_CPCON | PLL_ALT_MISC_REG | PLLX,
2430 .ops = &tegra_pll_ops,
2431 .reg = 0xe0,
2432 .parent = &tegra_pll_ref,
2433 .max_rate = 1700000000,
2434 .u.pll = {
2435 .input_min = 2000000,
2436 .input_max = 31000000,
2437 .cf_min = 1000000,
2438 .cf_max = 6000000,
2439 .vco_min = 20000000,
2440 .vco_max = 1700000000,
2441 .freq_table = tegra_pll_x_freq_table,
2442 .lock_delay = 300,
2443 },
2444};
2445
2446static struct clk tegra_pll_x_out0 = {
2447 .name = "pll_x_out0",
2448 .ops = &tegra_pll_div_ops,
2449 .flags = DIV_2 | PLLX,
2450 .parent = &tegra_pll_x,
2451 .max_rate = 850000000,
2452};
2453
2454
2455static struct clk_pll_freq_table tegra_pll_e_freq_table[] = {
2456 /* PLLE special case: use cpcon field to store cml divider value */
2457 { 12000000, 100000000, 150, 1, 18, 11},
2458 { 216000000, 100000000, 200, 18, 24, 13},
2459 { 0, 0, 0, 0, 0, 0 },
2460};
2461
2462static struct clk tegra_pll_e = {
2463 .name = "pll_e",
2464 .flags = PLL_ALT_MISC_REG,
2465 .ops = &tegra_plle_ops,
2466 .reg = 0xe8,
2467 .max_rate = 100000000,
2468 .u.pll = {
2469 .input_min = 12000000,
2470 .input_max = 216000000,
2471 .cf_min = 12000000,
2472 .cf_max = 12000000,
2473 .vco_min = 1200000000,
2474 .vco_max = 2400000000U,
2475 .freq_table = tegra_pll_e_freq_table,
2476 .lock_delay = 300,
2477 .fixed_rate = 100000000,
2478 },
2479};
2480
2481static struct clk tegra_cml0_clk = {
2482 .name = "cml0",
2483 .parent = &tegra_pll_e,
2484 .ops = &tegra_cml_clk_ops,
2485 .reg = PLLE_AUX,
2486 .max_rate = 100000000,
2487 .u.periph = {
2488 .clk_num = 0,
2489 },
2490};
2491
2492static struct clk tegra_cml1_clk = {
2493 .name = "cml1",
2494 .parent = &tegra_pll_e,
2495 .ops = &tegra_cml_clk_ops,
2496 .reg = PLLE_AUX,
2497 .max_rate = 100000000,
2498 .u.periph = {
2499 .clk_num = 1,
2500 },
2501};
2502
2503static struct clk tegra_pciex_clk = {
2504 .name = "pciex",
2505 .parent = &tegra_pll_e,
2506 .ops = &tegra_pciex_clk_ops,
2507 .max_rate = 100000000,
2508 .u.periph = {
2509 .clk_num = 74,
2510 },
2511};
2512
2513/* Audio sync clocks */
2514#define SYNC_SOURCE(_id) \
2515 { \
2516 .name = #_id "_sync", \
2517 .rate = 24000000, \
2518 .max_rate = 24000000, \
2519 .ops = &tegra_sync_source_ops \
2520 }
2521static struct clk tegra_sync_source_list[] = {
2522 SYNC_SOURCE(spdif_in),
2523 SYNC_SOURCE(i2s0),
2524 SYNC_SOURCE(i2s1),
2525 SYNC_SOURCE(i2s2),
2526 SYNC_SOURCE(i2s3),
2527 SYNC_SOURCE(i2s4),
2528 SYNC_SOURCE(vimclk),
2529};
2530
2531static struct clk_mux_sel mux_audio_sync_clk[] = {
2532 { .input = &tegra_sync_source_list[0], .value = 0},
2533 { .input = &tegra_sync_source_list[1], .value = 1},
2534 { .input = &tegra_sync_source_list[2], .value = 2},
2535 { .input = &tegra_sync_source_list[3], .value = 3},
2536 { .input = &tegra_sync_source_list[4], .value = 4},
2537 { .input = &tegra_sync_source_list[5], .value = 5},
2538 { .input = &tegra_pll_a_out0, .value = 6},
2539 { .input = &tegra_sync_source_list[6], .value = 7},
2540 { 0, 0 }
2541}; 2230};
2542 2231
2543#define AUDIO_SYNC_CLK(_id, _index) \ 2232struct clk_ops tegra_pciex_clk_ops = {
2544 { \ 2233 .recalc_rate = tegra30_clk_fixed_recalc_rate,
2545 .name = #_id, \
2546 .inputs = mux_audio_sync_clk, \
2547 .reg = 0x4A0 + (_index) * 4, \
2548 .max_rate = 24000000, \
2549 .ops = &tegra_audio_sync_clk_ops \
2550 }
2551static struct clk tegra_clk_audio_list[] = {
2552 AUDIO_SYNC_CLK(audio0, 0),
2553 AUDIO_SYNC_CLK(audio1, 1),
2554 AUDIO_SYNC_CLK(audio2, 2),
2555 AUDIO_SYNC_CLK(audio3, 3),
2556 AUDIO_SYNC_CLK(audio4, 4),
2557 AUDIO_SYNC_CLK(audio, 5), /* SPDIF */
2558}; 2234};
2559 2235
2560#define AUDIO_SYNC_2X_CLK(_id, _index) \ 2236/* Tegra30 CPU clock and reset control functions */
2561 { \ 2237static void tegra30_wait_cpu_in_reset(u32 cpu)
2562 .name = #_id "_2x", \ 2238{
2563 .flags = PERIPH_NO_RESET, \ 2239 unsigned int reg;
2564 .max_rate = 48000000, \
2565 .ops = &tegra_clk_double_ops, \
2566 .reg = 0x49C, \
2567 .reg_shift = 24 + (_index), \
2568 .parent = &tegra_clk_audio_list[(_index)], \
2569 .u.periph = { \
2570 .clk_num = 113 + (_index), \
2571 }, \
2572 }
2573static struct clk tegra_clk_audio_2x_list[] = {
2574 AUDIO_SYNC_2X_CLK(audio0, 0),
2575 AUDIO_SYNC_2X_CLK(audio1, 1),
2576 AUDIO_SYNC_2X_CLK(audio2, 2),
2577 AUDIO_SYNC_2X_CLK(audio3, 3),
2578 AUDIO_SYNC_2X_CLK(audio4, 4),
2579 AUDIO_SYNC_2X_CLK(audio, 5), /* SPDIF */
2580};
2581 2240
2582#define MUX_I2S_SPDIF(_id, _index) \ 2241 do {
2583static struct clk_mux_sel mux_pllaout0_##_id##_2x_pllp_clkm[] = { \ 2242 reg = readl(reg_clk_base +
2584 {.input = &tegra_pll_a_out0, .value = 0}, \ 2243 TEGRA30_CLK_RST_CONTROLLER_CPU_CMPLX_STATUS);
2585 {.input = &tegra_clk_audio_2x_list[(_index)], .value = 1}, \ 2244 cpu_relax();
2586 {.input = &tegra_pll_p, .value = 2}, \ 2245 } while (!(reg & (1 << cpu))); /* check CPU been reset or not */
2587 {.input = &tegra_clk_m, .value = 3}, \
2588 { 0, 0}, \
2589}
2590MUX_I2S_SPDIF(audio0, 0);
2591MUX_I2S_SPDIF(audio1, 1);
2592MUX_I2S_SPDIF(audio2, 2);
2593MUX_I2S_SPDIF(audio3, 3);
2594MUX_I2S_SPDIF(audio4, 4);
2595MUX_I2S_SPDIF(audio, 5); /* SPDIF */
2596
2597/* External clock outputs (through PMC) */
2598#define MUX_EXTERN_OUT(_id) \
2599static struct clk_mux_sel mux_clkm_clkm2_clkm4_extern##_id[] = { \
2600 {.input = &tegra_clk_m, .value = 0}, \
2601 {.input = &tegra_clk_m_div2, .value = 1}, \
2602 {.input = &tegra_clk_m_div4, .value = 2}, \
2603 {.input = NULL, .value = 3}, /* placeholder */ \
2604 { 0, 0}, \
2605}
2606MUX_EXTERN_OUT(1);
2607MUX_EXTERN_OUT(2);
2608MUX_EXTERN_OUT(3);
2609
2610static struct clk_mux_sel *mux_extern_out_list[] = {
2611 mux_clkm_clkm2_clkm4_extern1,
2612 mux_clkm_clkm2_clkm4_extern2,
2613 mux_clkm_clkm2_clkm4_extern3,
2614};
2615 2246
2616#define CLK_OUT_CLK(_id) \ 2247 return;
2617 { \ 2248}
2618 .name = "clk_out_" #_id, \
2619 .lookup = { \
2620 .dev_id = "clk_out_" #_id, \
2621 .con_id = "extern" #_id, \
2622 }, \
2623 .ops = &tegra_clk_out_ops, \
2624 .reg = 0x1a8, \
2625 .inputs = mux_clkm_clkm2_clkm4_extern##_id, \
2626 .flags = MUX_CLK_OUT, \
2627 .max_rate = 216000000, \
2628 .u.periph = { \
2629 .clk_num = (_id - 1) * 8 + 2, \
2630 }, \
2631 }
2632static struct clk tegra_clk_out_list[] = {
2633 CLK_OUT_CLK(1),
2634 CLK_OUT_CLK(2),
2635 CLK_OUT_CLK(3),
2636};
2637 2249
2638/* called after peripheral external clocks are initialized */ 2250static void tegra30_put_cpu_in_reset(u32 cpu)
2639static void init_clk_out_mux(void)
2640{ 2251{
2641 int i; 2252 writel(CPU_RESET(cpu),
2642 struct clk *c; 2253 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET);
2643 2254 dmb();
2644 /* output clock con_id is the name of peripheral
2645 external clock connected to input 3 of the output mux */
2646 for (i = 0; i < ARRAY_SIZE(tegra_clk_out_list); i++) {
2647 c = tegra_get_clock_by_name(
2648 tegra_clk_out_list[i].lookup.con_id);
2649 if (!c)
2650 pr_err("%s: could not find clk %s\n", __func__,
2651 tegra_clk_out_list[i].lookup.con_id);
2652 mux_extern_out_list[i][3].input = c;
2653 }
2654} 2255}
2655 2256
2656/* Peripheral muxes */ 2257static void tegra30_cpu_out_of_reset(u32 cpu)
2657static struct clk_mux_sel mux_sclk[] = {
2658 { .input = &tegra_clk_m, .value = 0},
2659 { .input = &tegra_pll_c_out1, .value = 1},
2660 { .input = &tegra_pll_p_out4, .value = 2},
2661 { .input = &tegra_pll_p_out3, .value = 3},
2662 { .input = &tegra_pll_p_out2, .value = 4},
2663 /* { .input = &tegra_clk_d, .value = 5}, - no use on tegra30 */
2664 { .input = &tegra_clk_32k, .value = 6},
2665 { .input = &tegra_pll_m_out1, .value = 7},
2666 { 0, 0},
2667};
2668
2669static struct clk tegra_clk_sclk = {
2670 .name = "sclk",
2671 .inputs = mux_sclk,
2672 .reg = 0x28,
2673 .ops = &tegra_super_ops,
2674 .max_rate = 334000000,
2675 .min_rate = 40000000,
2676};
2677
2678static struct clk tegra_clk_blink = {
2679 .name = "blink",
2680 .parent = &tegra_clk_32k,
2681 .reg = 0x40,
2682 .ops = &tegra_blink_clk_ops,
2683 .max_rate = 32768,
2684};
2685
2686static struct clk_mux_sel mux_pllm_pllc_pllp_plla[] = {
2687 { .input = &tegra_pll_m, .value = 0},
2688 { .input = &tegra_pll_c, .value = 1},
2689 { .input = &tegra_pll_p, .value = 2},
2690 { .input = &tegra_pll_a_out0, .value = 3},
2691 { 0, 0},
2692};
2693
2694static struct clk_mux_sel mux_pllp_pllc_pllm_clkm[] = {
2695 { .input = &tegra_pll_p, .value = 0},
2696 { .input = &tegra_pll_c, .value = 1},
2697 { .input = &tegra_pll_m, .value = 2},
2698 { .input = &tegra_clk_m, .value = 3},
2699 { 0, 0},
2700};
2701
2702static struct clk_mux_sel mux_pllp_clkm[] = {
2703 { .input = &tegra_pll_p, .value = 0},
2704 { .input = &tegra_clk_m, .value = 3},
2705 { 0, 0},
2706};
2707
2708static struct clk_mux_sel mux_pllp_plld_pllc_clkm[] = {
2709 {.input = &tegra_pll_p, .value = 0},
2710 {.input = &tegra_pll_d_out0, .value = 1},
2711 {.input = &tegra_pll_c, .value = 2},
2712 {.input = &tegra_clk_m, .value = 3},
2713 { 0, 0},
2714};
2715
2716static struct clk_mux_sel mux_pllp_pllm_plld_plla_pllc_plld2_clkm[] = {
2717 {.input = &tegra_pll_p, .value = 0},
2718 {.input = &tegra_pll_m, .value = 1},
2719 {.input = &tegra_pll_d_out0, .value = 2},
2720 {.input = &tegra_pll_a_out0, .value = 3},
2721 {.input = &tegra_pll_c, .value = 4},
2722 {.input = &tegra_pll_d2_out0, .value = 5},
2723 {.input = &tegra_clk_m, .value = 6},
2724 { 0, 0},
2725};
2726
2727static struct clk_mux_sel mux_plla_pllc_pllp_clkm[] = {
2728 { .input = &tegra_pll_a_out0, .value = 0},
2729 /* { .input = &tegra_pll_c, .value = 1}, no use on tegra30 */
2730 { .input = &tegra_pll_p, .value = 2},
2731 { .input = &tegra_clk_m, .value = 3},
2732 { 0, 0},
2733};
2734
2735static struct clk_mux_sel mux_pllp_pllc_clk32_clkm[] = {
2736 {.input = &tegra_pll_p, .value = 0},
2737 {.input = &tegra_pll_c, .value = 1},
2738 {.input = &tegra_clk_32k, .value = 2},
2739 {.input = &tegra_clk_m, .value = 3},
2740 { 0, 0},
2741};
2742
2743static struct clk_mux_sel mux_pllp_pllc_clkm_clk32[] = {
2744 {.input = &tegra_pll_p, .value = 0},
2745 {.input = &tegra_pll_c, .value = 1},
2746 {.input = &tegra_clk_m, .value = 2},
2747 {.input = &tegra_clk_32k, .value = 3},
2748 { 0, 0},
2749};
2750
2751static struct clk_mux_sel mux_pllp_pllc_pllm[] = {
2752 {.input = &tegra_pll_p, .value = 0},
2753 {.input = &tegra_pll_c, .value = 1},
2754 {.input = &tegra_pll_m, .value = 2},
2755 { 0, 0},
2756};
2757
2758static struct clk_mux_sel mux_clk_m[] = {
2759 { .input = &tegra_clk_m, .value = 0},
2760 { 0, 0},
2761};
2762
2763static struct clk_mux_sel mux_pllp_out3[] = {
2764 { .input = &tegra_pll_p_out3, .value = 0},
2765 { 0, 0},
2766};
2767
2768static struct clk_mux_sel mux_plld_out0[] = {
2769 { .input = &tegra_pll_d_out0, .value = 0},
2770 { 0, 0},
2771};
2772
2773static struct clk_mux_sel mux_plld_out0_plld2_out0[] = {
2774 { .input = &tegra_pll_d_out0, .value = 0},
2775 { .input = &tegra_pll_d2_out0, .value = 1},
2776 { 0, 0},
2777};
2778
2779static struct clk_mux_sel mux_clk_32k[] = {
2780 { .input = &tegra_clk_32k, .value = 0},
2781 { 0, 0},
2782};
2783
2784static struct clk_mux_sel mux_plla_clk32_pllp_clkm_plle[] = {
2785 { .input = &tegra_pll_a_out0, .value = 0},
2786 { .input = &tegra_clk_32k, .value = 1},
2787 { .input = &tegra_pll_p, .value = 2},
2788 { .input = &tegra_clk_m, .value = 3},
2789 { .input = &tegra_pll_e, .value = 4},
2790 { 0, 0},
2791};
2792
2793static struct clk_mux_sel mux_cclk_g[] = {
2794 { .input = &tegra_clk_m, .value = 0},
2795 { .input = &tegra_pll_c, .value = 1},
2796 { .input = &tegra_clk_32k, .value = 2},
2797 { .input = &tegra_pll_m, .value = 3},
2798 { .input = &tegra_pll_p, .value = 4},
2799 { .input = &tegra_pll_p_out4, .value = 5},
2800 { .input = &tegra_pll_p_out3, .value = 6},
2801 { .input = &tegra_pll_x, .value = 8},
2802 { 0, 0},
2803};
2804
2805static struct clk tegra_clk_cclk_g = {
2806 .name = "cclk_g",
2807 .flags = DIV_U71 | DIV_U71_INT,
2808 .inputs = mux_cclk_g,
2809 .reg = 0x368,
2810 .ops = &tegra_super_ops,
2811 .max_rate = 1700000000,
2812};
2813
2814static struct clk tegra30_clk_twd = {
2815 .parent = &tegra_clk_cclk_g,
2816 .name = "twd",
2817 .ops = &tegra30_twd_ops,
2818 .max_rate = 1400000000, /* Same as tegra_clk_cpu_cmplx.max_rate */
2819 .mul = 1,
2820 .div = 2,
2821};
2822
2823#define PERIPH_CLK(_name, _dev, _con, _clk_num, _reg, _max, _inputs, _flags) \
2824 { \
2825 .name = _name, \
2826 .lookup = { \
2827 .dev_id = _dev, \
2828 .con_id = _con, \
2829 }, \
2830 .ops = &tegra_periph_clk_ops, \
2831 .reg = _reg, \
2832 .inputs = _inputs, \
2833 .flags = _flags, \
2834 .max_rate = _max, \
2835 .u.periph = { \
2836 .clk_num = _clk_num, \
2837 }, \
2838 }
2839
2840#define PERIPH_CLK_EX(_name, _dev, _con, _clk_num, _reg, _max, _inputs, \
2841 _flags, _ops) \
2842 { \
2843 .name = _name, \
2844 .lookup = { \
2845 .dev_id = _dev, \
2846 .con_id = _con, \
2847 }, \
2848 .ops = _ops, \
2849 .reg = _reg, \
2850 .inputs = _inputs, \
2851 .flags = _flags, \
2852 .max_rate = _max, \
2853 .u.periph = { \
2854 .clk_num = _clk_num, \
2855 }, \
2856 }
2857
2858#define SHARED_CLK(_name, _dev, _con, _parent, _id, _div, _mode)\
2859 { \
2860 .name = _name, \
2861 .lookup = { \
2862 .dev_id = _dev, \
2863 .con_id = _con, \
2864 }, \
2865 .ops = &tegra_clk_shared_bus_ops, \
2866 .parent = _parent, \
2867 .u.shared_bus_user = { \
2868 .client_id = _id, \
2869 .client_div = _div, \
2870 .mode = _mode, \
2871 }, \
2872 }
2873struct clk tegra_list_clks[] = {
2874 PERIPH_CLK("apbdma", "tegra-apbdma", NULL, 34, 0, 26000000, mux_clk_m, 0),
2875 PERIPH_CLK("rtc", "rtc-tegra", NULL, 4, 0, 32768, mux_clk_32k, PERIPH_NO_RESET | PERIPH_ON_APB),
2876 PERIPH_CLK("kbc", "tegra-kbc", NULL, 36, 0, 32768, mux_clk_32k, PERIPH_NO_RESET | PERIPH_ON_APB),
2877 PERIPH_CLK("timer", "timer", NULL, 5, 0, 26000000, mux_clk_m, 0),
2878 PERIPH_CLK("kfuse", "kfuse-tegra", NULL, 40, 0, 26000000, mux_clk_m, 0),
2879 PERIPH_CLK("fuse", "fuse-tegra", "fuse", 39, 0, 26000000, mux_clk_m, PERIPH_ON_APB),
2880 PERIPH_CLK("fuse_burn", "fuse-tegra", "fuse_burn", 39, 0, 26000000, mux_clk_m, PERIPH_ON_APB),
2881 PERIPH_CLK("apbif", "tegra30-ahub", "apbif", 107, 0, 26000000, mux_clk_m, 0),
2882 PERIPH_CLK("i2s0", "tegra30-i2s.0", NULL, 30, 0x1d8, 26000000, mux_pllaout0_audio0_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2883 PERIPH_CLK("i2s1", "tegra30-i2s.1", NULL, 11, 0x100, 26000000, mux_pllaout0_audio1_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2884 PERIPH_CLK("i2s2", "tegra30-i2s.2", NULL, 18, 0x104, 26000000, mux_pllaout0_audio2_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2885 PERIPH_CLK("i2s3", "tegra30-i2s.3", NULL, 101, 0x3bc, 26000000, mux_pllaout0_audio3_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2886 PERIPH_CLK("i2s4", "tegra30-i2s.4", NULL, 102, 0x3c0, 26000000, mux_pllaout0_audio4_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2887 PERIPH_CLK("spdif_out", "tegra30-spdif", "spdif_out", 10, 0x108, 100000000, mux_pllaout0_audio_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2888 PERIPH_CLK("spdif_in", "tegra30-spdif", "spdif_in", 10, 0x10c, 100000000, mux_pllp_pllc_pllm, MUX | DIV_U71 | PERIPH_ON_APB),
2889 PERIPH_CLK("pwm", "tegra-pwm", NULL, 17, 0x110, 432000000, mux_pllp_pllc_clk32_clkm, MUX | MUX_PWM | DIV_U71 | PERIPH_ON_APB),
2890 PERIPH_CLK("d_audio", "tegra30-ahub", "d_audio", 106, 0x3d0, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71),
2891 PERIPH_CLK("dam0", "tegra30-dam.0", NULL, 108, 0x3d8, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71),
2892 PERIPH_CLK("dam1", "tegra30-dam.1", NULL, 109, 0x3dc, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71),
2893 PERIPH_CLK("dam2", "tegra30-dam.2", NULL, 110, 0x3e0, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71),
2894 PERIPH_CLK("hda", "tegra30-hda", "hda", 125, 0x428, 108000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2895 PERIPH_CLK("hda2codec_2x", "tegra30-hda", "hda2codec", 111, 0x3e4, 48000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2896 PERIPH_CLK("hda2hdmi", "tegra30-hda", "hda2hdmi", 128, 0, 48000000, mux_clk_m, 0),
2897 PERIPH_CLK("sbc1", "spi_tegra.0", NULL, 41, 0x134, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2898 PERIPH_CLK("sbc2", "spi_tegra.1", NULL, 44, 0x118, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2899 PERIPH_CLK("sbc3", "spi_tegra.2", NULL, 46, 0x11c, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2900 PERIPH_CLK("sbc4", "spi_tegra.3", NULL, 68, 0x1b4, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2901 PERIPH_CLK("sbc5", "spi_tegra.4", NULL, 104, 0x3c8, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2902 PERIPH_CLK("sbc6", "spi_tegra.5", NULL, 105, 0x3cc, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2903 PERIPH_CLK("sata_oob", "tegra_sata_oob", NULL, 123, 0x420, 216000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2904 PERIPH_CLK("sata", "tegra_sata", NULL, 124, 0x424, 216000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2905 PERIPH_CLK("sata_cold", "tegra_sata_cold", NULL, 129, 0, 48000000, mux_clk_m, 0),
2906 PERIPH_CLK_EX("ndflash", "tegra_nand", NULL, 13, 0x160, 240000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71, &tegra_nand_clk_ops),
2907 PERIPH_CLK("ndspeed", "tegra_nand_speed", NULL, 80, 0x3f8, 240000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2908 PERIPH_CLK("vfir", "vfir", NULL, 7, 0x168, 72000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2909 PERIPH_CLK("sdmmc1", "sdhci-tegra.0", NULL, 14, 0x150, 208000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
2910 PERIPH_CLK("sdmmc2", "sdhci-tegra.1", NULL, 9, 0x154, 104000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
2911 PERIPH_CLK("sdmmc3", "sdhci-tegra.2", NULL, 69, 0x1bc, 208000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
2912 PERIPH_CLK("sdmmc4", "sdhci-tegra.3", NULL, 15, 0x164, 104000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
2913 PERIPH_CLK("vcp", "tegra-avp", "vcp", 29, 0, 250000000, mux_clk_m, 0),
2914 PERIPH_CLK("bsea", "tegra-avp", "bsea", 62, 0, 250000000, mux_clk_m, 0),
2915 PERIPH_CLK("bsev", "tegra-aes", "bsev", 63, 0, 250000000, mux_clk_m, 0),
2916 PERIPH_CLK("vde", "vde", NULL, 61, 0x1c8, 520000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_INT),
2917 PERIPH_CLK("csite", "csite", NULL, 73, 0x1d4, 144000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* max rate ??? */
2918 PERIPH_CLK("la", "la", NULL, 76, 0x1f8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
2919 PERIPH_CLK("owr", "tegra_w1", NULL, 71, 0x1cc, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2920 PERIPH_CLK("nor", "nor", NULL, 42, 0x1d0, 127000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* requires min voltage */
2921 PERIPH_CLK("mipi", "mipi", NULL, 50, 0x174, 60000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB), /* scales with voltage */
2922 PERIPH_CLK("i2c1", "tegra-i2c.0", NULL, 12, 0x124, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB),
2923 PERIPH_CLK("i2c2", "tegra-i2c.1", NULL, 54, 0x198, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB),
2924 PERIPH_CLK("i2c3", "tegra-i2c.2", NULL, 67, 0x1b8, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB),
2925 PERIPH_CLK("i2c4", "tegra-i2c.3", NULL, 103, 0x3c4, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB),
2926 PERIPH_CLK("i2c5", "tegra-i2c.4", NULL, 47, 0x128, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB),
2927 PERIPH_CLK("uarta", "tegra-uart.0", NULL, 6, 0x178, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB),
2928 PERIPH_CLK("uartb", "tegra-uart.1", NULL, 7, 0x17c, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB),
2929 PERIPH_CLK("uartc", "tegra-uart.2", NULL, 55, 0x1a0, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB),
2930 PERIPH_CLK("uartd", "tegra-uart.3", NULL, 65, 0x1c0, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB),
2931 PERIPH_CLK("uarte", "tegra-uart.4", NULL, 66, 0x1c4, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB),
2932 PERIPH_CLK_EX("vi", "tegra_camera", "vi", 20, 0x148, 425000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT, &tegra_vi_clk_ops),
2933 PERIPH_CLK("3d", "3d", NULL, 24, 0x158, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT | DIV_U71_IDLE | PERIPH_MANUAL_RESET),
2934 PERIPH_CLK("3d2", "3d2", NULL, 98, 0x3b0, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT | DIV_U71_IDLE | PERIPH_MANUAL_RESET),
2935 PERIPH_CLK("2d", "2d", NULL, 21, 0x15c, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT | DIV_U71_IDLE),
2936 PERIPH_CLK("vi_sensor", "tegra_camera", "vi_sensor", 20, 0x1a8, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_NO_RESET),
2937 PERIPH_CLK("epp", "epp", NULL, 19, 0x16c, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT),
2938 PERIPH_CLK("mpe", "mpe", NULL, 60, 0x170, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT),
2939 PERIPH_CLK("host1x", "host1x", NULL, 28, 0x180, 260000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT),
2940 PERIPH_CLK("cve", "cve", NULL, 49, 0x140, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */
2941 PERIPH_CLK("tvo", "tvo", NULL, 49, 0x188, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */
2942 PERIPH_CLK_EX("dtv", "dtv", NULL, 79, 0x1dc, 250000000, mux_clk_m, 0, &tegra_dtv_clk_ops),
2943 PERIPH_CLK("hdmi", "hdmi", NULL, 51, 0x18c, 148500000, mux_pllp_pllm_plld_plla_pllc_plld2_clkm, MUX | MUX8 | DIV_U71),
2944 PERIPH_CLK("tvdac", "tvdac", NULL, 53, 0x194, 220000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */
2945 PERIPH_CLK("disp1", "tegradc.0", NULL, 27, 0x138, 600000000, mux_pllp_pllm_plld_plla_pllc_plld2_clkm, MUX | MUX8),
2946 PERIPH_CLK("disp2", "tegradc.1", NULL, 26, 0x13c, 600000000, mux_pllp_pllm_plld_plla_pllc_plld2_clkm, MUX | MUX8),
2947 PERIPH_CLK("usbd", "fsl-tegra-udc", NULL, 22, 0, 480000000, mux_clk_m, 0), /* requires min voltage */
2948 PERIPH_CLK("usb2", "tegra-ehci.1", NULL, 58, 0, 480000000, mux_clk_m, 0), /* requires min voltage */
2949 PERIPH_CLK("usb3", "tegra-ehci.2", NULL, 59, 0, 480000000, mux_clk_m, 0), /* requires min voltage */
2950 PERIPH_CLK("dsia", "tegradc.0", "dsia", 48, 0, 500000000, mux_plld_out0, 0),
2951 PERIPH_CLK_EX("dsib", "tegradc.1", "dsib", 82, 0xd0, 500000000, mux_plld_out0_plld2_out0, MUX | PLLD, &tegra_dsib_clk_ops),
2952 PERIPH_CLK("csi", "tegra_camera", "csi", 52, 0, 102000000, mux_pllp_out3, 0),
2953 PERIPH_CLK("isp", "tegra_camera", "isp", 23, 0, 150000000, mux_clk_m, 0), /* same frequency as VI */
2954 PERIPH_CLK("csus", "tegra_camera", "csus", 92, 0, 150000000, mux_clk_m, PERIPH_NO_RESET),
2955
2956 PERIPH_CLK("tsensor", "tegra-tsensor", NULL, 100, 0x3b8, 216000000, mux_pllp_pllc_clkm_clk32, MUX | DIV_U71),
2957 PERIPH_CLK("actmon", "actmon", NULL, 119, 0x3e8, 216000000, mux_pllp_pllc_clk32_clkm, MUX | DIV_U71),
2958 PERIPH_CLK("extern1", "extern1", NULL, 120, 0x3ec, 216000000, mux_plla_clk32_pllp_clkm_plle, MUX | MUX8 | DIV_U71),
2959 PERIPH_CLK("extern2", "extern2", NULL, 121, 0x3f0, 216000000, mux_plla_clk32_pllp_clkm_plle, MUX | MUX8 | DIV_U71),
2960 PERIPH_CLK("extern3", "extern3", NULL, 122, 0x3f4, 216000000, mux_plla_clk32_pllp_clkm_plle, MUX | MUX8 | DIV_U71),
2961 PERIPH_CLK("i2cslow", "i2cslow", NULL, 81, 0x3fc, 26000000, mux_pllp_pllc_clk32_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
2962 PERIPH_CLK("pcie", "tegra-pcie", "pcie", 70, 0, 250000000, mux_clk_m, 0),
2963 PERIPH_CLK("afi", "tegra-pcie", "afi", 72, 0, 250000000, mux_clk_m, 0),
2964 PERIPH_CLK("se", "se", NULL, 127, 0x42c, 520000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_INT),
2965};
2966
2967#define CLK_DUPLICATE(_name, _dev, _con) \
2968 { \
2969 .name = _name, \
2970 .lookup = { \
2971 .dev_id = _dev, \
2972 .con_id = _con, \
2973 }, \
2974 }
2975
2976/* Some clocks may be used by different drivers depending on the board
2977 * configuration. List those here to register them twice in the clock lookup
2978 * table under two names.
2979 */
2980struct clk_duplicate tegra_clk_duplicates[] = {
2981 CLK_DUPLICATE("uarta", "serial8250.0", NULL),
2982 CLK_DUPLICATE("uartb", "serial8250.1", NULL),
2983 CLK_DUPLICATE("uartc", "serial8250.2", NULL),
2984 CLK_DUPLICATE("uartd", "serial8250.3", NULL),
2985 CLK_DUPLICATE("uarte", "serial8250.4", NULL),
2986 CLK_DUPLICATE("usbd", "utmip-pad", NULL),
2987 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL),
2988 CLK_DUPLICATE("usbd", "tegra-otg", NULL),
2989 CLK_DUPLICATE("hdmi", "tegradc.0", "hdmi"),
2990 CLK_DUPLICATE("hdmi", "tegradc.1", "hdmi"),
2991 CLK_DUPLICATE("dsib", "tegradc.0", "dsib"),
2992 CLK_DUPLICATE("dsia", "tegradc.1", "dsia"),
2993 CLK_DUPLICATE("bsev", "tegra-avp", "bsev"),
2994 CLK_DUPLICATE("bsev", "nvavp", "bsev"),
2995 CLK_DUPLICATE("vde", "tegra-aes", "vde"),
2996 CLK_DUPLICATE("bsea", "tegra-aes", "bsea"),
2997 CLK_DUPLICATE("bsea", "nvavp", "bsea"),
2998 CLK_DUPLICATE("cml1", "tegra_sata_cml", NULL),
2999 CLK_DUPLICATE("cml0", "tegra_pcie", "cml"),
3000 CLK_DUPLICATE("pciex", "tegra_pcie", "pciex"),
3001 CLK_DUPLICATE("i2c1", "tegra-i2c-slave.0", NULL),
3002 CLK_DUPLICATE("i2c2", "tegra-i2c-slave.1", NULL),
3003 CLK_DUPLICATE("i2c3", "tegra-i2c-slave.2", NULL),
3004 CLK_DUPLICATE("i2c4", "tegra-i2c-slave.3", NULL),
3005 CLK_DUPLICATE("i2c5", "tegra-i2c-slave.4", NULL),
3006 CLK_DUPLICATE("sbc1", "spi_slave_tegra.0", NULL),
3007 CLK_DUPLICATE("sbc2", "spi_slave_tegra.1", NULL),
3008 CLK_DUPLICATE("sbc3", "spi_slave_tegra.2", NULL),
3009 CLK_DUPLICATE("sbc4", "spi_slave_tegra.3", NULL),
3010 CLK_DUPLICATE("sbc5", "spi_slave_tegra.4", NULL),
3011 CLK_DUPLICATE("sbc6", "spi_slave_tegra.5", NULL),
3012 CLK_DUPLICATE("twd", "smp_twd", NULL),
3013 CLK_DUPLICATE("vcp", "nvavp", "vcp"),
3014 CLK_DUPLICATE("i2s0", NULL, "i2s0"),
3015 CLK_DUPLICATE("i2s1", NULL, "i2s1"),
3016 CLK_DUPLICATE("i2s2", NULL, "i2s2"),
3017 CLK_DUPLICATE("i2s3", NULL, "i2s3"),
3018 CLK_DUPLICATE("i2s4", NULL, "i2s4"),
3019 CLK_DUPLICATE("dam0", NULL, "dam0"),
3020 CLK_DUPLICATE("dam1", NULL, "dam1"),
3021 CLK_DUPLICATE("dam2", NULL, "dam2"),
3022 CLK_DUPLICATE("spdif_in", NULL, "spdif_in"),
3023};
3024
3025struct clk *tegra_ptr_clks[] = {
3026 &tegra_clk_32k,
3027 &tegra_clk_m,
3028 &tegra_clk_m_div2,
3029 &tegra_clk_m_div4,
3030 &tegra_pll_ref,
3031 &tegra_pll_m,
3032 &tegra_pll_m_out1,
3033 &tegra_pll_c,
3034 &tegra_pll_c_out1,
3035 &tegra_pll_p,
3036 &tegra_pll_p_out1,
3037 &tegra_pll_p_out2,
3038 &tegra_pll_p_out3,
3039 &tegra_pll_p_out4,
3040 &tegra_pll_a,
3041 &tegra_pll_a_out0,
3042 &tegra_pll_d,
3043 &tegra_pll_d_out0,
3044 &tegra_pll_d2,
3045 &tegra_pll_d2_out0,
3046 &tegra_pll_u,
3047 &tegra_pll_x,
3048 &tegra_pll_x_out0,
3049 &tegra_pll_e,
3050 &tegra_clk_cclk_g,
3051 &tegra_cml0_clk,
3052 &tegra_cml1_clk,
3053 &tegra_pciex_clk,
3054 &tegra_clk_sclk,
3055 &tegra_clk_blink,
3056 &tegra30_clk_twd,
3057};
3058
3059
3060static void tegra30_init_one_clock(struct clk *c)
3061{ 2258{
3062 clk_init(c); 2259 writel(CPU_RESET(cpu),
3063 INIT_LIST_HEAD(&c->shared_bus_list); 2260 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR);
3064 if (!c->lookup.dev_id && !c->lookup.con_id) 2261 wmb();
3065 c->lookup.con_id = c->name;
3066 c->lookup.clk = c;
3067 clkdev_add(&c->lookup);
3068} 2262}
3069 2263
3070void __init tegra30_init_clocks(void) 2264static void tegra30_enable_cpu_clock(u32 cpu)
3071{ 2265{
3072 int i; 2266 unsigned int reg;
3073 struct clk *c;
3074 2267
3075 for (i = 0; i < ARRAY_SIZE(tegra_ptr_clks); i++) 2268 writel(CPU_CLOCK(cpu),
3076 tegra30_init_one_clock(tegra_ptr_clks[i]); 2269 reg_clk_base + TEGRA30_CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR);
3077 2270 reg = readl(reg_clk_base +
3078 for (i = 0; i < ARRAY_SIZE(tegra_list_clks); i++) 2271 TEGRA30_CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR);
3079 tegra30_init_one_clock(&tegra_list_clks[i]); 2272}
3080 2273
3081 for (i = 0; i < ARRAY_SIZE(tegra_clk_duplicates); i++) { 2274static void tegra30_disable_cpu_clock(u32 cpu)
3082 c = tegra_get_clock_by_name(tegra_clk_duplicates[i].name); 2275{
3083 if (!c) {
3084 pr_err("%s: Unknown duplicate clock %s\n", __func__,
3085 tegra_clk_duplicates[i].name);
3086 continue;
3087 }
3088 2276
3089 tegra_clk_duplicates[i].lookup.clk = c; 2277 unsigned int reg;
3090 clkdev_add(&tegra_clk_duplicates[i].lookup);
3091 }
3092 2278
3093 for (i = 0; i < ARRAY_SIZE(tegra_sync_source_list); i++) 2279 reg = readl(reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
3094 tegra30_init_one_clock(&tegra_sync_source_list[i]); 2280 writel(reg | CPU_CLOCK(cpu),
3095 for (i = 0; i < ARRAY_SIZE(tegra_clk_audio_list); i++) 2281 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
3096 tegra30_init_one_clock(&tegra_clk_audio_list[i]); 2282}
3097 for (i = 0; i < ARRAY_SIZE(tegra_clk_audio_2x_list); i++)
3098 tegra30_init_one_clock(&tegra_clk_audio_2x_list[i]);
3099 2283
3100 init_clk_out_mux(); 2284static struct tegra_cpu_car_ops tegra30_cpu_car_ops = {
3101 for (i = 0; i < ARRAY_SIZE(tegra_clk_out_list); i++) 2285 .wait_for_reset = tegra30_wait_cpu_in_reset,
3102 tegra30_init_one_clock(&tegra_clk_out_list[i]); 2286 .put_in_reset = tegra30_put_cpu_in_reset,
2287 .out_of_reset = tegra30_cpu_out_of_reset,
2288 .enable_clock = tegra30_enable_cpu_clock,
2289 .disable_clock = tegra30_disable_cpu_clock,
2290};
3103 2291
2292void __init tegra30_cpu_car_ops_init(void)
2293{
2294 tegra_cpu_car_ops = &tegra30_cpu_car_ops;
3104} 2295}
diff --git a/arch/arm/mach-tegra/tegra30_clocks.h b/arch/arm/mach-tegra/tegra30_clocks.h
new file mode 100644
index 00000000000..f2f88fef6b8
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra30_clocks.h
@@ -0,0 +1,53 @@
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_periph_clk_ops;
38extern struct clk_ops tegra30_dsib_clk_ops;
39extern struct clk_ops tegra_nand_clk_ops;
40extern struct clk_ops tegra_vi_clk_ops;
41extern struct clk_ops tegra_dtv_clk_ops;
42extern struct clk_ops tegra_clk_shared_bus_ops;
43
44int tegra30_plld_clk_cfg_ex(struct clk_hw *hw,
45 enum tegra_clk_ex_param p, u32 setting);
46void tegra30_periph_clk_reset(struct clk_hw *hw, bool assert);
47int tegra30_vi_clk_cfg_ex(struct clk_hw *hw,
48 enum tegra_clk_ex_param p, u32 setting);
49int tegra30_nand_clk_cfg_ex(struct clk_hw *hw,
50 enum tegra_clk_ex_param p, u32 setting);
51int tegra30_dtv_clk_cfg_ex(struct clk_hw *hw,
52 enum tegra_clk_ex_param p, u32 setting);
53#endif
diff --git a/arch/arm/mach-tegra/tegra30_clocks_data.c b/arch/arm/mach-tegra/tegra30_clocks_data.c
new file mode 100644
index 00000000000..d92cb556ae3
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra30_clocks_data.c
@@ -0,0 +1,1377 @@
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 *mux_blink[] = {
715 "clk_32k",
716};
717
718static struct clk *mux_blink_p[] = {
719 &tegra_clk_32k,
720};
721
722static struct clk tegra_clk_blink;
723static struct clk_tegra tegra_clk_blink_hw = {
724 .hw = {
725 .clk = &tegra_clk_blink,
726 },
727 .reg = 0x40,
728 .max_rate = 32768,
729};
730static struct clk tegra_clk_blink = {
731 .name = "blink",
732 .ops = &tegra30_blink_clk_ops,
733 .hw = &tegra_clk_blink_hw.hw,
734 .parent = &tegra_clk_32k,
735 .parent_names = mux_blink,
736 .parents = mux_blink_p,
737 .num_parents = ARRAY_SIZE(mux_blink),
738};
739
740static const char *mux_pllm_pllc_pllp_plla[] = {
741 "pll_m",
742 "pll_c",
743 "pll_p",
744 "pll_a_out0",
745};
746
747static const char *mux_pllp_pllc_pllm_clkm[] = {
748 "pll_p",
749 "pll_c",
750 "pll_m",
751 "clk_m",
752};
753
754static const char *mux_pllp_clkm[] = {
755 "pll_p",
756 "dummy",
757 "dummy",
758 "clk_m",
759};
760
761static const char *mux_pllp_plld_pllc_clkm[] = {
762 "pll_p",
763 "pll_d_out0",
764 "pll_c",
765 "clk_m",
766};
767
768static const char *mux_pllp_pllm_plld_plla_pllc_plld2_clkm[] = {
769 "pll_p",
770 "pll_m",
771 "pll_d_out0",
772 "pll_a_out0",
773 "pll_c",
774 "pll_d2_out0",
775 "clk_m",
776};
777
778static const char *mux_plla_pllc_pllp_clkm[] = {
779 "pll_a_out0",
780 "dummy",
781 "pll_p",
782 "clk_m"
783};
784
785static const char *mux_pllp_pllc_clk32_clkm[] = {
786 "pll_p",
787 "pll_c",
788 "clk_32k",
789 "clk_m",
790};
791
792static const char *mux_pllp_pllc_clkm_clk32[] = {
793 "pll_p",
794 "pll_c",
795 "clk_m",
796 "clk_32k",
797};
798
799static const char *mux_pllp_pllc_pllm[] = {
800 "pll_p",
801 "pll_c",
802 "pll_m",
803};
804
805static const char *mux_clk_m[] = {
806 "clk_m",
807};
808
809static const char *mux_pllp_out3[] = {
810 "pll_p_out3",
811};
812
813static const char *mux_plld_out0[] = {
814 "pll_d_out0",
815};
816
817static const char *mux_plld_out0_plld2_out0[] = {
818 "pll_d_out0",
819 "pll_d2_out0",
820};
821
822static const char *mux_clk_32k[] = {
823 "clk_32k",
824};
825
826static const char *mux_plla_clk32_pllp_clkm_plle[] = {
827 "pll_a_out0",
828 "clk_32k",
829 "pll_p",
830 "clk_m",
831 "pll_e",
832};
833
834static const char *mux_cclk_g[] = {
835 "clk_m",
836 "pll_c",
837 "clk_32k",
838 "pll_m",
839 "pll_p",
840 "pll_p_out4",
841 "pll_p_out3",
842 "dummy",
843 "pll_x",
844};
845
846static struct clk *mux_pllm_pllc_pllp_plla_p[] = {
847 &tegra_pll_m,
848 &tegra_pll_c,
849 &tegra_pll_p,
850 &tegra_pll_a_out0,
851};
852
853static struct clk *mux_pllp_pllc_pllm_clkm_p[] = {
854 &tegra_pll_p,
855 &tegra_pll_c,
856 &tegra_pll_m,
857 &tegra_clk_m,
858};
859
860static struct clk *mux_pllp_clkm_p[] = {
861 &tegra_pll_p,
862 NULL,
863 NULL,
864 &tegra_clk_m,
865};
866
867static struct clk *mux_pllp_plld_pllc_clkm_p[] = {
868 &tegra_pll_p,
869 &tegra_pll_d_out0,
870 &tegra_pll_c,
871 &tegra_clk_m,
872};
873
874static struct clk *mux_pllp_pllm_plld_plla_pllc_plld2_clkm_p[] = {
875 &tegra_pll_p,
876 &tegra_pll_m,
877 &tegra_pll_d_out0,
878 &tegra_pll_a_out0,
879 &tegra_pll_c,
880 &tegra_pll_d2_out0,
881 &tegra_clk_m,
882};
883
884static struct clk *mux_plla_pllc_pllp_clkm_p[] = {
885 &tegra_pll_a_out0,
886 NULL,
887 &tegra_pll_p,
888 &tegra_clk_m,
889};
890
891static struct clk *mux_pllp_pllc_clk32_clkm_p[] = {
892 &tegra_pll_p,
893 &tegra_pll_c,
894 &tegra_clk_32k,
895 &tegra_clk_m,
896};
897
898static struct clk *mux_pllp_pllc_clkm_clk32_p[] = {
899 &tegra_pll_p,
900 &tegra_pll_c,
901 &tegra_clk_m,
902 &tegra_clk_32k,
903};
904
905static struct clk *mux_pllp_pllc_pllm_p[] = {
906 &tegra_pll_p,
907 &tegra_pll_c,
908 &tegra_pll_m,
909};
910
911static struct clk *mux_clk_m_p[] = {
912 &tegra_clk_m,
913};
914
915static struct clk *mux_pllp_out3_p[] = {
916 &tegra_pll_p_out3,
917};
918
919static struct clk *mux_plld_out0_p[] = {
920 &tegra_pll_d_out0,
921};
922
923static struct clk *mux_plld_out0_plld2_out0_p[] = {
924 &tegra_pll_d_out0,
925 &tegra_pll_d2_out0,
926};
927
928static struct clk *mux_clk_32k_p[] = {
929 &tegra_clk_32k,
930};
931
932static struct clk *mux_plla_clk32_pllp_clkm_plle_p[] = {
933 &tegra_pll_a_out0,
934 &tegra_clk_32k,
935 &tegra_pll_p,
936 &tegra_clk_m,
937 &tegra_pll_e,
938};
939
940static struct clk *mux_cclk_g_p[] = {
941 &tegra_clk_m,
942 &tegra_pll_c,
943 &tegra_clk_32k,
944 &tegra_pll_m,
945 &tegra_pll_p,
946 &tegra_pll_p_out4,
947 &tegra_pll_p_out3,
948 NULL,
949 &tegra_pll_x,
950};
951
952static struct clk tegra_clk_cclk_g;
953static struct clk_tegra tegra_clk_cclk_g_hw = {
954 .hw = {
955 .clk = &tegra_clk_cclk_g,
956 },
957 .flags = DIV_U71 | DIV_U71_INT,
958 .reg = 0x368,
959 .max_rate = 1700000000,
960};
961static struct clk tegra_clk_cclk_g = {
962 .name = "cclk_g",
963 .ops = &tegra30_super_ops,
964 .hw = &tegra_clk_cclk_g_hw.hw,
965 .parent_names = mux_cclk_g,
966 .parents = mux_cclk_g_p,
967 .num_parents = ARRAY_SIZE(mux_cclk_g),
968};
969
970static const char *mux_twd[] = {
971 "cclk_g",
972};
973
974static struct clk *mux_twd_p[] = {
975 &tegra_clk_cclk_g,
976};
977
978static struct clk tegra30_clk_twd;
979static struct clk_tegra tegra30_clk_twd_hw = {
980 .hw = {
981 .clk = &tegra30_clk_twd,
982 },
983 .max_rate = 1400000000,
984 .mul = 1,
985 .div = 2,
986};
987
988static struct clk tegra30_clk_twd = {
989 .name = "twd",
990 .ops = &tegra30_twd_ops,
991 .hw = &tegra30_clk_twd_hw.hw,
992 .parent = &tegra_clk_cclk_g,
993 .parent_names = mux_twd,
994 .parents = mux_twd_p,
995 .num_parents = ARRAY_SIZE(mux_twd),
996};
997
998#define PERIPH_CLK(_name, _dev, _con, _clk_num, _reg, \
999 _max, _inputs, _flags) \
1000 static struct clk tegra_##_name; \
1001 static struct clk_tegra tegra_##_name##_hw = { \
1002 .hw = { \
1003 .clk = &tegra_##_name, \
1004 }, \
1005 .lookup = { \
1006 .dev_id = _dev, \
1007 .con_id = _con, \
1008 }, \
1009 .reg = _reg, \
1010 .flags = _flags, \
1011 .max_rate = _max, \
1012 .u.periph = { \
1013 .clk_num = _clk_num, \
1014 }, \
1015 .reset = &tegra30_periph_clk_reset, \
1016 }; \
1017 static struct clk tegra_##_name = { \
1018 .name = #_name, \
1019 .ops = &tegra30_periph_clk_ops, \
1020 .hw = &tegra_##_name##_hw.hw, \
1021 .parent_names = _inputs, \
1022 .parents = _inputs##_p, \
1023 .num_parents = ARRAY_SIZE(_inputs), \
1024 };
1025
1026PERIPH_CLK(apbdma, "tegra-apbdma", NULL, 34, 0, 26000000, mux_clk_m, 0);
1027PERIPH_CLK(rtc, "rtc-tegra", NULL, 4, 0, 32768, mux_clk_32k, PERIPH_NO_RESET | PERIPH_ON_APB);
1028PERIPH_CLK(kbc, "tegra-kbc", NULL, 36, 0, 32768, mux_clk_32k, PERIPH_NO_RESET | PERIPH_ON_APB);
1029PERIPH_CLK(timer, "timer", NULL, 5, 0, 26000000, mux_clk_m, 0);
1030PERIPH_CLK(kfuse, "kfuse-tegra", NULL, 40, 0, 26000000, mux_clk_m, 0);
1031PERIPH_CLK(fuse, "fuse-tegra", "fuse", 39, 0, 26000000, mux_clk_m, PERIPH_ON_APB);
1032PERIPH_CLK(fuse_burn, "fuse-tegra", "fuse_burn", 39, 0, 26000000, mux_clk_m, PERIPH_ON_APB);
1033PERIPH_CLK(apbif, "tegra30-ahub", "apbif", 107, 0, 26000000, mux_clk_m, 0);
1034PERIPH_CLK(i2s0, "tegra30-i2s.0", NULL, 30, 0x1d8, 26000000, mux_pllaout0_audio0_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1035PERIPH_CLK(i2s1, "tegra30-i2s.1", NULL, 11, 0x100, 26000000, mux_pllaout0_audio1_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1036PERIPH_CLK(i2s2, "tegra30-i2s.2", NULL, 18, 0x104, 26000000, mux_pllaout0_audio2_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1037PERIPH_CLK(i2s3, "tegra30-i2s.3", NULL, 101, 0x3bc, 26000000, mux_pllaout0_audio3_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1038PERIPH_CLK(i2s4, "tegra30-i2s.4", NULL, 102, 0x3c0, 26000000, mux_pllaout0_audio4_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1039PERIPH_CLK(spdif_out, "tegra30-spdif", "spdif_out", 10, 0x108, 100000000, mux_pllaout0_audio5_2x_pllp_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1040PERIPH_CLK(spdif_in, "tegra30-spdif", "spdif_in", 10, 0x10c, 100000000, mux_pllp_pllc_pllm, MUX | DIV_U71 | PERIPH_ON_APB);
1041PERIPH_CLK(pwm, "tegra-pwm", NULL, 17, 0x110, 432000000, mux_pllp_pllc_clk32_clkm, MUX | MUX_PWM | DIV_U71 | PERIPH_ON_APB);
1042PERIPH_CLK(d_audio, "tegra30-ahub", "d_audio", 106, 0x3d0, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71);
1043PERIPH_CLK(dam0, "tegra30-dam.0", NULL, 108, 0x3d8, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71);
1044PERIPH_CLK(dam1, "tegra30-dam.1", NULL, 109, 0x3dc, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71);
1045PERIPH_CLK(dam2, "tegra30-dam.2", NULL, 110, 0x3e0, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71);
1046PERIPH_CLK(hda, "tegra30-hda", "hda", 125, 0x428, 108000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1047PERIPH_CLK(hda2codec_2x, "tegra30-hda", "hda2codec", 111, 0x3e4, 48000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1048PERIPH_CLK(hda2hdmi, "tegra30-hda", "hda2hdmi", 128, 0, 48000000, mux_clk_m, 0);
1049PERIPH_CLK(sbc1, "spi_tegra.0", NULL, 41, 0x134, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1050PERIPH_CLK(sbc2, "spi_tegra.1", NULL, 44, 0x118, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1051PERIPH_CLK(sbc3, "spi_tegra.2", NULL, 46, 0x11c, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1052PERIPH_CLK(sbc4, "spi_tegra.3", NULL, 68, 0x1b4, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1053PERIPH_CLK(sbc5, "spi_tegra.4", NULL, 104, 0x3c8, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1054PERIPH_CLK(sbc6, "spi_tegra.5", NULL, 105, 0x3cc, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1055PERIPH_CLK(sata_oob, "tegra_sata_oob", NULL, 123, 0x420, 216000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1056PERIPH_CLK(sata, "tegra_sata", NULL, 124, 0x424, 216000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1057PERIPH_CLK(sata_cold, "tegra_sata_cold", NULL, 129, 0, 48000000, mux_clk_m, 0);
1058PERIPH_CLK(ndflash, "tegra_nand", NULL, 13, 0x160, 240000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1059PERIPH_CLK(ndspeed, "tegra_nand_speed", NULL, 80, 0x3f8, 240000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1060PERIPH_CLK(vfir, "vfir", NULL, 7, 0x168, 72000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1061PERIPH_CLK(sdmmc1, "sdhci-tegra.0", NULL, 14, 0x150, 208000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
1062PERIPH_CLK(sdmmc2, "sdhci-tegra.1", NULL, 9, 0x154, 104000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
1063PERIPH_CLK(sdmmc3, "sdhci-tegra.2", NULL, 69, 0x1bc, 208000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
1064PERIPH_CLK(sdmmc4, "sdhci-tegra.3", NULL, 15, 0x164, 104000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
1065PERIPH_CLK(vcp, "tegra-avp", "vcp", 29, 0, 250000000, mux_clk_m, 0);
1066PERIPH_CLK(bsea, "tegra-avp", "bsea", 62, 0, 250000000, mux_clk_m, 0);
1067PERIPH_CLK(bsev, "tegra-aes", "bsev", 63, 0, 250000000, mux_clk_m, 0);
1068PERIPH_CLK(vde, "vde", NULL, 61, 0x1c8, 520000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_INT);
1069PERIPH_CLK(csite, "csite", NULL, 73, 0x1d4, 144000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* max rate ??? */
1070PERIPH_CLK(la, "la", NULL, 76, 0x1f8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
1071PERIPH_CLK(owr, "tegra_w1", NULL, 71, 0x1cc, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1072PERIPH_CLK(nor, "nor", NULL, 42, 0x1d0, 127000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* requires min voltage */
1073PERIPH_CLK(mipi, "mipi", NULL, 50, 0x174, 60000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB); /* scales with voltage */
1074PERIPH_CLK(i2c1, "tegra-i2c.0", "div-clk", 12, 0x124, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1075PERIPH_CLK(i2c2, "tegra-i2c.1", "div-clk", 54, 0x198, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1076PERIPH_CLK(i2c3, "tegra-i2c.2", "div-clk", 67, 0x1b8, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1077PERIPH_CLK(i2c4, "tegra-i2c.3", "div-clk", 103, 0x3c4, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1078PERIPH_CLK(i2c5, "tegra-i2c.4", "div-clk", 47, 0x128, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1079PERIPH_CLK(uarta, "tegra-uart.0", NULL, 6, 0x178, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
1080PERIPH_CLK(uartb, "tegra-uart.1", NULL, 7, 0x17c, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
1081PERIPH_CLK(uartc, "tegra-uart.2", NULL, 55, 0x1a0, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
1082PERIPH_CLK(uartd, "tegra-uart.3", NULL, 65, 0x1c0, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
1083PERIPH_CLK(uarte, "tegra-uart.4", NULL, 66, 0x1c4, 800000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_UART | PERIPH_ON_APB);
1084PERIPH_CLK(vi, "tegra_camera", "vi", 20, 0x148, 425000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT);
1085PERIPH_CLK(3d, "3d", NULL, 24, 0x158, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT | DIV_U71_IDLE | PERIPH_MANUAL_RESET);
1086PERIPH_CLK(3d2, "3d2", NULL, 98, 0x3b0, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT | DIV_U71_IDLE | PERIPH_MANUAL_RESET);
1087PERIPH_CLK(2d, "2d", NULL, 21, 0x15c, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT | DIV_U71_IDLE);
1088PERIPH_CLK(vi_sensor, "tegra_camera", "vi_sensor", 20, 0x1a8, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_NO_RESET);
1089PERIPH_CLK(epp, "epp", NULL, 19, 0x16c, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT);
1090PERIPH_CLK(mpe, "mpe", NULL, 60, 0x170, 520000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT);
1091PERIPH_CLK(host1x, "host1x", NULL, 28, 0x180, 260000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | DIV_U71_INT);
1092PERIPH_CLK(cve, "cve", NULL, 49, 0x140, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
1093PERIPH_CLK(tvo, "tvo", NULL, 49, 0x188, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
1094PERIPH_CLK(dtv, "dtv", NULL, 79, 0x1dc, 250000000, mux_clk_m, 0);
1095PERIPH_CLK(hdmi, "hdmi", NULL, 51, 0x18c, 148500000, mux_pllp_pllm_plld_plla_pllc_plld2_clkm, MUX | MUX8 | DIV_U71);
1096PERIPH_CLK(tvdac, "tvdac", NULL, 53, 0x194, 220000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
1097PERIPH_CLK(disp1, "tegradc.0", NULL, 27, 0x138, 600000000, mux_pllp_pllm_plld_plla_pllc_plld2_clkm, MUX | MUX8);
1098PERIPH_CLK(disp2, "tegradc.1", NULL, 26, 0x13c, 600000000, mux_pllp_pllm_plld_plla_pllc_plld2_clkm, MUX | MUX8);
1099PERIPH_CLK(usbd, "fsl-tegra-udc", NULL, 22, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
1100PERIPH_CLK(usb2, "tegra-ehci.1", NULL, 58, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
1101PERIPH_CLK(usb3, "tegra-ehci.2", NULL, 59, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
1102PERIPH_CLK(dsia, "tegradc.0", "dsia", 48, 0, 500000000, mux_plld_out0, 0);
1103PERIPH_CLK(csi, "tegra_camera", "csi", 52, 0, 102000000, mux_pllp_out3, 0);
1104PERIPH_CLK(isp, "tegra_camera", "isp", 23, 0, 150000000, mux_clk_m, 0); /* same frequency as VI */
1105PERIPH_CLK(csus, "tegra_camera", "csus", 92, 0, 150000000, mux_clk_m, PERIPH_NO_RESET);
1106PERIPH_CLK(tsensor, "tegra-tsensor", NULL, 100, 0x3b8, 216000000, mux_pllp_pllc_clkm_clk32, MUX | DIV_U71);
1107PERIPH_CLK(actmon, "actmon", NULL, 119, 0x3e8, 216000000, mux_pllp_pllc_clk32_clkm, MUX | DIV_U71);
1108PERIPH_CLK(extern1, "extern1", NULL, 120, 0x3ec, 216000000, mux_plla_clk32_pllp_clkm_plle, MUX | MUX8 | DIV_U71);
1109PERIPH_CLK(extern2, "extern2", NULL, 121, 0x3f0, 216000000, mux_plla_clk32_pllp_clkm_plle, MUX | MUX8 | DIV_U71);
1110PERIPH_CLK(extern3, "extern3", NULL, 122, 0x3f4, 216000000, mux_plla_clk32_pllp_clkm_plle, MUX | MUX8 | DIV_U71);
1111PERIPH_CLK(i2cslow, "i2cslow", NULL, 81, 0x3fc, 26000000, mux_pllp_pllc_clk32_clkm, MUX | DIV_U71 | PERIPH_ON_APB);
1112PERIPH_CLK(pcie, "tegra-pcie", "pcie", 70, 0, 250000000, mux_clk_m, 0);
1113PERIPH_CLK(afi, "tegra-pcie", "afi", 72, 0, 250000000, mux_clk_m, 0);
1114PERIPH_CLK(se, "se", NULL, 127, 0x42c, 520000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | DIV_U71_INT);
1115
1116static struct clk tegra_dsib;
1117static struct clk_tegra tegra_dsib_hw = {
1118 .hw = {
1119 .clk = &tegra_dsib,
1120 },
1121 .lookup = {
1122 .dev_id = "tegradc.1",
1123 .con_id = "dsib",
1124 },
1125 .reg = 0xd0,
1126 .flags = MUX | PLLD,
1127 .max_rate = 500000000,
1128 .u.periph = {
1129 .clk_num = 82,
1130 },
1131 .reset = &tegra30_periph_clk_reset,
1132};
1133static struct clk tegra_dsib = {
1134 .name = "dsib",
1135 .ops = &tegra30_dsib_clk_ops,
1136 .hw = &tegra_dsib_hw.hw,
1137 .parent_names = mux_plld_out0_plld2_out0,
1138 .parents = mux_plld_out0_plld2_out0_p,
1139 .num_parents = ARRAY_SIZE(mux_plld_out0_plld2_out0),
1140};
1141
1142struct clk *tegra_list_clks[] = {
1143 &tegra_apbdma,
1144 &tegra_rtc,
1145 &tegra_kbc,
1146 &tegra_kfuse,
1147 &tegra_fuse,
1148 &tegra_fuse_burn,
1149 &tegra_apbif,
1150 &tegra_i2s0,
1151 &tegra_i2s1,
1152 &tegra_i2s2,
1153 &tegra_i2s3,
1154 &tegra_i2s4,
1155 &tegra_spdif_out,
1156 &tegra_spdif_in,
1157 &tegra_pwm,
1158 &tegra_d_audio,
1159 &tegra_dam0,
1160 &tegra_dam1,
1161 &tegra_dam2,
1162 &tegra_hda,
1163 &tegra_hda2codec_2x,
1164 &tegra_hda2hdmi,
1165 &tegra_sbc1,
1166 &tegra_sbc2,
1167 &tegra_sbc3,
1168 &tegra_sbc4,
1169 &tegra_sbc5,
1170 &tegra_sbc6,
1171 &tegra_sata_oob,
1172 &tegra_sata,
1173 &tegra_sata_cold,
1174 &tegra_ndflash,
1175 &tegra_ndspeed,
1176 &tegra_vfir,
1177 &tegra_sdmmc1,
1178 &tegra_sdmmc2,
1179 &tegra_sdmmc3,
1180 &tegra_sdmmc4,
1181 &tegra_vcp,
1182 &tegra_bsea,
1183 &tegra_bsev,
1184 &tegra_vde,
1185 &tegra_csite,
1186 &tegra_la,
1187 &tegra_owr,
1188 &tegra_nor,
1189 &tegra_mipi,
1190 &tegra_i2c1,
1191 &tegra_i2c2,
1192 &tegra_i2c3,
1193 &tegra_i2c4,
1194 &tegra_i2c5,
1195 &tegra_uarta,
1196 &tegra_uartb,
1197 &tegra_uartc,
1198 &tegra_uartd,
1199 &tegra_uarte,
1200 &tegra_vi,
1201 &tegra_3d,
1202 &tegra_3d2,
1203 &tegra_2d,
1204 &tegra_vi_sensor,
1205 &tegra_epp,
1206 &tegra_mpe,
1207 &tegra_host1x,
1208 &tegra_cve,
1209 &tegra_tvo,
1210 &tegra_dtv,
1211 &tegra_hdmi,
1212 &tegra_tvdac,
1213 &tegra_disp1,
1214 &tegra_disp2,
1215 &tegra_usbd,
1216 &tegra_usb2,
1217 &tegra_usb3,
1218 &tegra_dsia,
1219 &tegra_dsib,
1220 &tegra_csi,
1221 &tegra_isp,
1222 &tegra_csus,
1223 &tegra_tsensor,
1224 &tegra_actmon,
1225 &tegra_extern1,
1226 &tegra_extern2,
1227 &tegra_extern3,
1228 &tegra_i2cslow,
1229 &tegra_pcie,
1230 &tegra_afi,
1231 &tegra_se,
1232};
1233
1234#define CLK_DUPLICATE(_name, _dev, _con) \
1235 { \
1236 .name = _name, \
1237 .lookup = { \
1238 .dev_id = _dev, \
1239 .con_id = _con, \
1240 }, \
1241 }
1242
1243/* Some clocks may be used by different drivers depending on the board
1244 * configuration. List those here to register them twice in the clock lookup
1245 * table under two names.
1246 */
1247struct clk_duplicate tegra_clk_duplicates[] = {
1248 CLK_DUPLICATE("uarta", "serial8250.0", NULL),
1249 CLK_DUPLICATE("uartb", "serial8250.1", NULL),
1250 CLK_DUPLICATE("uartc", "serial8250.2", NULL),
1251 CLK_DUPLICATE("uartd", "serial8250.3", NULL),
1252 CLK_DUPLICATE("uarte", "serial8250.4", NULL),
1253 CLK_DUPLICATE("usbd", "utmip-pad", NULL),
1254 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL),
1255 CLK_DUPLICATE("usbd", "tegra-otg", NULL),
1256 CLK_DUPLICATE("hdmi", "tegradc.0", "hdmi"),
1257 CLK_DUPLICATE("hdmi", "tegradc.1", "hdmi"),
1258 CLK_DUPLICATE("dsib", "tegradc.0", "dsib"),
1259 CLK_DUPLICATE("dsia", "tegradc.1", "dsia"),
1260 CLK_DUPLICATE("bsev", "tegra-avp", "bsev"),
1261 CLK_DUPLICATE("bsev", "nvavp", "bsev"),
1262 CLK_DUPLICATE("vde", "tegra-aes", "vde"),
1263 CLK_DUPLICATE("bsea", "tegra-aes", "bsea"),
1264 CLK_DUPLICATE("bsea", "nvavp", "bsea"),
1265 CLK_DUPLICATE("cml1", "tegra_sata_cml", NULL),
1266 CLK_DUPLICATE("cml0", "tegra_pcie", "cml"),
1267 CLK_DUPLICATE("pciex", "tegra_pcie", "pciex"),
1268 CLK_DUPLICATE("i2c1", "tegra-i2c-slave.0", NULL),
1269 CLK_DUPLICATE("i2c2", "tegra-i2c-slave.1", NULL),
1270 CLK_DUPLICATE("i2c3", "tegra-i2c-slave.2", NULL),
1271 CLK_DUPLICATE("i2c4", "tegra-i2c-slave.3", NULL),
1272 CLK_DUPLICATE("i2c5", "tegra-i2c-slave.4", NULL),
1273 CLK_DUPLICATE("sbc1", "spi_slave_tegra.0", NULL),
1274 CLK_DUPLICATE("sbc2", "spi_slave_tegra.1", NULL),
1275 CLK_DUPLICATE("sbc3", "spi_slave_tegra.2", NULL),
1276 CLK_DUPLICATE("sbc4", "spi_slave_tegra.3", NULL),
1277 CLK_DUPLICATE("sbc5", "spi_slave_tegra.4", NULL),
1278 CLK_DUPLICATE("sbc6", "spi_slave_tegra.5", NULL),
1279 CLK_DUPLICATE("twd", "smp_twd", NULL),
1280 CLK_DUPLICATE("vcp", "nvavp", "vcp"),
1281 CLK_DUPLICATE("i2s0", NULL, "i2s0"),
1282 CLK_DUPLICATE("i2s1", NULL, "i2s1"),
1283 CLK_DUPLICATE("i2s2", NULL, "i2s2"),
1284 CLK_DUPLICATE("i2s3", NULL, "i2s3"),
1285 CLK_DUPLICATE("i2s4", NULL, "i2s4"),
1286 CLK_DUPLICATE("dam0", NULL, "dam0"),
1287 CLK_DUPLICATE("dam1", NULL, "dam1"),
1288 CLK_DUPLICATE("dam2", NULL, "dam2"),
1289 CLK_DUPLICATE("spdif_in", NULL, "spdif_in"),
1290 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.0", "fast-clk"),
1291 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.1", "fast-clk"),
1292 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.2", "fast-clk"),
1293 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.3", "fast-clk"),
1294 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.4", "fast-clk"),
1295};
1296
1297struct clk *tegra_ptr_clks[] = {
1298 &tegra_clk_32k,
1299 &tegra_clk_m,
1300 &tegra_clk_m_div2,
1301 &tegra_clk_m_div4,
1302 &tegra_pll_ref,
1303 &tegra_pll_m,
1304 &tegra_pll_m_out1,
1305 &tegra_pll_c,
1306 &tegra_pll_c_out1,
1307 &tegra_pll_p,
1308 &tegra_pll_p_out1,
1309 &tegra_pll_p_out2,
1310 &tegra_pll_p_out3,
1311 &tegra_pll_p_out4,
1312 &tegra_pll_a,
1313 &tegra_pll_a_out0,
1314 &tegra_pll_d,
1315 &tegra_pll_d_out0,
1316 &tegra_pll_d2,
1317 &tegra_pll_d2_out0,
1318 &tegra_pll_u,
1319 &tegra_pll_x,
1320 &tegra_pll_x_out0,
1321 &tegra_pll_e,
1322 &tegra_clk_cclk_g,
1323 &tegra_cml0,
1324 &tegra_cml1,
1325 &tegra_pciex,
1326 &tegra_clk_sclk,
1327 &tegra_clk_blink,
1328 &tegra30_clk_twd,
1329};
1330
1331static void tegra30_init_one_clock(struct clk *c)
1332{
1333 struct clk_tegra *clk = to_clk_tegra(c->hw);
1334 __clk_init(NULL, c);
1335 INIT_LIST_HEAD(&clk->shared_bus_list);
1336 if (!clk->lookup.dev_id && !clk->lookup.con_id)
1337 clk->lookup.con_id = c->name;
1338 clk->lookup.clk = c;
1339 clkdev_add(&clk->lookup);
1340 tegra_clk_add(c);
1341}
1342
1343void __init tegra30_init_clocks(void)
1344{
1345 int i;
1346 struct clk *c;
1347
1348 for (i = 0; i < ARRAY_SIZE(tegra_ptr_clks); i++)
1349 tegra30_init_one_clock(tegra_ptr_clks[i]);
1350
1351 for (i = 0; i < ARRAY_SIZE(tegra_list_clks); i++)
1352 tegra30_init_one_clock(tegra_list_clks[i]);
1353
1354 for (i = 0; i < ARRAY_SIZE(tegra_clk_duplicates); i++) {
1355 c = tegra_get_clock_by_name(tegra_clk_duplicates[i].name);
1356 if (!c) {
1357 pr_err("%s: Unknown duplicate clock %s\n", __func__,
1358 tegra_clk_duplicates[i].name);
1359 continue;
1360 }
1361
1362 tegra_clk_duplicates[i].lookup.clk = c;
1363 clkdev_add(&tegra_clk_duplicates[i].lookup);
1364 }
1365
1366 for (i = 0; i < ARRAY_SIZE(tegra_sync_source_list); i++)
1367 tegra30_init_one_clock(tegra_sync_source_list[i]);
1368 for (i = 0; i < ARRAY_SIZE(tegra_clk_audio_list); i++)
1369 tegra30_init_one_clock(tegra_clk_audio_list[i]);
1370 for (i = 0; i < ARRAY_SIZE(tegra_clk_audio_2x_list); i++)
1371 tegra30_init_one_clock(tegra_clk_audio_2x_list[i]);
1372
1373 for (i = 0; i < ARRAY_SIZE(tegra_clk_out_list); i++)
1374 tegra30_init_one_clock(tegra_clk_out_list[i]);
1375
1376 tegra30_cpu_car_ops_init();
1377}
diff --git a/arch/arm/mach-tegra/tegra_cpu_car.h b/arch/arm/mach-tegra/tegra_cpu_car.h
new file mode 100644
index 00000000000..30d063ad2be
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra_cpu_car.h
@@ -0,0 +1,87 @@
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 */
34struct tegra_cpu_car_ops {
35 void (*wait_for_reset)(u32 cpu);
36 void (*put_in_reset)(u32 cpu);
37 void (*out_of_reset)(u32 cpu);
38 void (*enable_clock)(u32 cpu);
39 void (*disable_clock)(u32 cpu);
40};
41
42extern struct tegra_cpu_car_ops *tegra_cpu_car_ops;
43
44static inline void tegra_wait_cpu_in_reset(u32 cpu)
45{
46 if (WARN_ON(!tegra_cpu_car_ops->wait_for_reset))
47 return;
48
49 tegra_cpu_car_ops->wait_for_reset(cpu);
50}
51
52static inline void tegra_put_cpu_in_reset(u32 cpu)
53{
54 if (WARN_ON(!tegra_cpu_car_ops->put_in_reset))
55 return;
56
57 tegra_cpu_car_ops->put_in_reset(cpu);
58}
59
60static inline void tegra_cpu_out_of_reset(u32 cpu)
61{
62 if (WARN_ON(!tegra_cpu_car_ops->out_of_reset))
63 return;
64
65 tegra_cpu_car_ops->out_of_reset(cpu);
66}
67
68static inline void tegra_enable_cpu_clock(u32 cpu)
69{
70 if (WARN_ON(!tegra_cpu_car_ops->enable_clock))
71 return;
72
73 tegra_cpu_car_ops->enable_clock(cpu);
74}
75
76static inline void tegra_disable_cpu_clock(u32 cpu)
77{
78 if (WARN_ON(!tegra_cpu_car_ops->disable_clock))
79 return;
80
81 tegra_cpu_car_ops->disable_clock(cpu);
82}
83
84void tegra20_cpu_car_ops_init(void);
85void tegra30_cpu_car_ops_init(void);
86
87#endif /* __MACH_TEGRA_CPU_CAR_H */
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index 57b5bdc13b9..eccdce98304 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -33,7 +33,6 @@
33 33
34#include <mach/iomap.h> 34#include <mach/iomap.h>
35#include <mach/irqs.h> 35#include <mach/irqs.h>
36#include <mach/suspend.h>
37 36
38#include "board.h" 37#include "board.h"
39#include "clock.h" 38#include "clock.h"
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c
deleted file mode 100644
index 022b33a05c3..00000000000
--- a/arch/arm/mach-tegra/usb_phy.c
+++ /dev/null
@@ -1,817 +0,0 @@
1/*
2 * arch/arm/mach-tegra/usb_phy.c
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Erik Gilling <konkers@google.com>
8 * Benoit Goby <benoit@android.com>
9 *
10 * This software is licensed under the terms of the GNU General Public
11 * License version 2, as published by the Free Software Foundation, and
12 * may be copied, distributed, and modified under those terms.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 */
20
21#include <linux/resource.h>
22#include <linux/delay.h>
23#include <linux/slab.h>
24#include <linux/err.h>
25#include <linux/export.h>
26#include <linux/platform_device.h>
27#include <linux/io.h>
28#include <linux/gpio.h>
29#include <linux/of_gpio.h>
30#include <linux/usb/otg.h>
31#include <linux/usb/ulpi.h>
32#include <asm/mach-types.h>
33#include <mach/gpio-tegra.h>
34#include <mach/usb_phy.h>
35#include <mach/iomap.h>
36
37#define ULPI_VIEWPORT 0x170
38
39#define USB_PORTSC1 0x184
40#define USB_PORTSC1_PTS(x) (((x) & 0x3) << 30)
41#define USB_PORTSC1_PSPD(x) (((x) & 0x3) << 26)
42#define USB_PORTSC1_PHCD (1 << 23)
43#define USB_PORTSC1_WKOC (1 << 22)
44#define USB_PORTSC1_WKDS (1 << 21)
45#define USB_PORTSC1_WKCN (1 << 20)
46#define USB_PORTSC1_PTC(x) (((x) & 0xf) << 16)
47#define USB_PORTSC1_PP (1 << 12)
48#define USB_PORTSC1_SUSP (1 << 7)
49#define USB_PORTSC1_PE (1 << 2)
50#define USB_PORTSC1_CCS (1 << 0)
51
52#define USB_SUSP_CTRL 0x400
53#define USB_WAKE_ON_CNNT_EN_DEV (1 << 3)
54#define USB_WAKE_ON_DISCON_EN_DEV (1 << 4)
55#define USB_SUSP_CLR (1 << 5)
56#define USB_PHY_CLK_VALID (1 << 7)
57#define UTMIP_RESET (1 << 11)
58#define UHSIC_RESET (1 << 11)
59#define UTMIP_PHY_ENABLE (1 << 12)
60#define ULPI_PHY_ENABLE (1 << 13)
61#define USB_SUSP_SET (1 << 14)
62#define USB_WAKEUP_DEBOUNCE_COUNT(x) (((x) & 0x7) << 16)
63
64#define USB1_LEGACY_CTRL 0x410
65#define USB1_NO_LEGACY_MODE (1 << 0)
66#define USB1_VBUS_SENSE_CTL_MASK (3 << 1)
67#define USB1_VBUS_SENSE_CTL_VBUS_WAKEUP (0 << 1)
68#define USB1_VBUS_SENSE_CTL_AB_SESS_VLD_OR_VBUS_WAKEUP \
69 (1 << 1)
70#define USB1_VBUS_SENSE_CTL_AB_SESS_VLD (2 << 1)
71#define USB1_VBUS_SENSE_CTL_A_SESS_VLD (3 << 1)
72
73#define ULPI_TIMING_CTRL_0 0x424
74#define ULPI_OUTPUT_PINMUX_BYP (1 << 10)
75#define ULPI_CLKOUT_PINMUX_BYP (1 << 11)
76
77#define ULPI_TIMING_CTRL_1 0x428
78#define ULPI_DATA_TRIMMER_LOAD (1 << 0)
79#define ULPI_DATA_TRIMMER_SEL(x) (((x) & 0x7) << 1)
80#define ULPI_STPDIRNXT_TRIMMER_LOAD (1 << 16)
81#define ULPI_STPDIRNXT_TRIMMER_SEL(x) (((x) & 0x7) << 17)
82#define ULPI_DIR_TRIMMER_LOAD (1 << 24)
83#define ULPI_DIR_TRIMMER_SEL(x) (((x) & 0x7) << 25)
84
85#define UTMIP_PLL_CFG1 0x804
86#define UTMIP_XTAL_FREQ_COUNT(x) (((x) & 0xfff) << 0)
87#define UTMIP_PLLU_ENABLE_DLY_COUNT(x) (((x) & 0x1f) << 27)
88
89#define UTMIP_XCVR_CFG0 0x808
90#define UTMIP_XCVR_SETUP(x) (((x) & 0xf) << 0)
91#define UTMIP_XCVR_LSRSLEW(x) (((x) & 0x3) << 8)
92#define UTMIP_XCVR_LSFSLEW(x) (((x) & 0x3) << 10)
93#define UTMIP_FORCE_PD_POWERDOWN (1 << 14)
94#define UTMIP_FORCE_PD2_POWERDOWN (1 << 16)
95#define UTMIP_FORCE_PDZI_POWERDOWN (1 << 18)
96#define UTMIP_XCVR_HSSLEW_MSB(x) (((x) & 0x7f) << 25)
97
98#define UTMIP_BIAS_CFG0 0x80c
99#define UTMIP_OTGPD (1 << 11)
100#define UTMIP_BIASPD (1 << 10)
101
102#define UTMIP_HSRX_CFG0 0x810
103#define UTMIP_ELASTIC_LIMIT(x) (((x) & 0x1f) << 10)
104#define UTMIP_IDLE_WAIT(x) (((x) & 0x1f) << 15)
105
106#define UTMIP_HSRX_CFG1 0x814
107#define UTMIP_HS_SYNC_START_DLY(x) (((x) & 0x1f) << 1)
108
109#define UTMIP_TX_CFG0 0x820
110#define UTMIP_FS_PREABMLE_J (1 << 19)
111#define UTMIP_HS_DISCON_DISABLE (1 << 8)
112
113#define UTMIP_MISC_CFG0 0x824
114#define UTMIP_DPDM_OBSERVE (1 << 26)
115#define UTMIP_DPDM_OBSERVE_SEL(x) (((x) & 0xf) << 27)
116#define UTMIP_DPDM_OBSERVE_SEL_FS_J UTMIP_DPDM_OBSERVE_SEL(0xf)
117#define UTMIP_DPDM_OBSERVE_SEL_FS_K UTMIP_DPDM_OBSERVE_SEL(0xe)
118#define UTMIP_DPDM_OBSERVE_SEL_FS_SE1 UTMIP_DPDM_OBSERVE_SEL(0xd)
119#define UTMIP_DPDM_OBSERVE_SEL_FS_SE0 UTMIP_DPDM_OBSERVE_SEL(0xc)
120#define UTMIP_SUSPEND_EXIT_ON_EDGE (1 << 22)
121
122#define UTMIP_MISC_CFG1 0x828
123#define UTMIP_PLL_ACTIVE_DLY_COUNT(x) (((x) & 0x1f) << 18)
124#define UTMIP_PLLU_STABLE_COUNT(x) (((x) & 0xfff) << 6)
125
126#define UTMIP_DEBOUNCE_CFG0 0x82c
127#define UTMIP_BIAS_DEBOUNCE_A(x) (((x) & 0xffff) << 0)
128
129#define UTMIP_BAT_CHRG_CFG0 0x830
130#define UTMIP_PD_CHRG (1 << 0)
131
132#define UTMIP_SPARE_CFG0 0x834
133#define FUSE_SETUP_SEL (1 << 3)
134
135#define UTMIP_XCVR_CFG1 0x838
136#define UTMIP_FORCE_PDDISC_POWERDOWN (1 << 0)
137#define UTMIP_FORCE_PDCHRP_POWERDOWN (1 << 2)
138#define UTMIP_FORCE_PDDR_POWERDOWN (1 << 4)
139#define UTMIP_XCVR_TERM_RANGE_ADJ(x) (((x) & 0xf) << 18)
140
141#define UTMIP_BIAS_CFG1 0x83c
142#define UTMIP_BIAS_PDTRK_COUNT(x) (((x) & 0x1f) << 3)
143
144static DEFINE_SPINLOCK(utmip_pad_lock);
145static int utmip_pad_count;
146
147struct tegra_xtal_freq {
148 int freq;
149 u8 enable_delay;
150 u8 stable_count;
151 u8 active_delay;
152 u8 xtal_freq_count;
153 u16 debounce;
154};
155
156static const struct tegra_xtal_freq tegra_freq_table[] = {
157 {
158 .freq = 12000000,
159 .enable_delay = 0x02,
160 .stable_count = 0x2F,
161 .active_delay = 0x04,
162 .xtal_freq_count = 0x76,
163 .debounce = 0x7530,
164 },
165 {
166 .freq = 13000000,
167 .enable_delay = 0x02,
168 .stable_count = 0x33,
169 .active_delay = 0x05,
170 .xtal_freq_count = 0x7F,
171 .debounce = 0x7EF4,
172 },
173 {
174 .freq = 19200000,
175 .enable_delay = 0x03,
176 .stable_count = 0x4B,
177 .active_delay = 0x06,
178 .xtal_freq_count = 0xBB,
179 .debounce = 0xBB80,
180 },
181 {
182 .freq = 26000000,
183 .enable_delay = 0x04,
184 .stable_count = 0x66,
185 .active_delay = 0x09,
186 .xtal_freq_count = 0xFE,
187 .debounce = 0xFDE8,
188 },
189};
190
191static struct tegra_utmip_config utmip_default[] = {
192 [0] = {
193 .hssync_start_delay = 9,
194 .idle_wait_delay = 17,
195 .elastic_limit = 16,
196 .term_range_adj = 6,
197 .xcvr_setup = 9,
198 .xcvr_lsfslew = 1,
199 .xcvr_lsrslew = 1,
200 },
201 [2] = {
202 .hssync_start_delay = 9,
203 .idle_wait_delay = 17,
204 .elastic_limit = 16,
205 .term_range_adj = 6,
206 .xcvr_setup = 9,
207 .xcvr_lsfslew = 2,
208 .xcvr_lsrslew = 2,
209 },
210};
211
212static inline bool phy_is_ulpi(struct tegra_usb_phy *phy)
213{
214 return (phy->instance == 1);
215}
216
217static int utmip_pad_open(struct tegra_usb_phy *phy)
218{
219 phy->pad_clk = clk_get_sys("utmip-pad", NULL);
220 if (IS_ERR(phy->pad_clk)) {
221 pr_err("%s: can't get utmip pad clock\n", __func__);
222 return PTR_ERR(phy->pad_clk);
223 }
224
225 if (phy->instance == 0) {
226 phy->pad_regs = phy->regs;
227 } else {
228 phy->pad_regs = ioremap(TEGRA_USB_BASE, TEGRA_USB_SIZE);
229 if (!phy->pad_regs) {
230 pr_err("%s: can't remap usb registers\n", __func__);
231 clk_put(phy->pad_clk);
232 return -ENOMEM;
233 }
234 }
235 return 0;
236}
237
238static void utmip_pad_close(struct tegra_usb_phy *phy)
239{
240 if (phy->instance != 0)
241 iounmap(phy->pad_regs);
242 clk_put(phy->pad_clk);
243}
244
245static void utmip_pad_power_on(struct tegra_usb_phy *phy)
246{
247 unsigned long val, flags;
248 void __iomem *base = phy->pad_regs;
249
250 clk_prepare_enable(phy->pad_clk);
251
252 spin_lock_irqsave(&utmip_pad_lock, flags);
253
254 if (utmip_pad_count++ == 0) {
255 val = readl(base + UTMIP_BIAS_CFG0);
256 val &= ~(UTMIP_OTGPD | UTMIP_BIASPD);
257 writel(val, base + UTMIP_BIAS_CFG0);
258 }
259
260 spin_unlock_irqrestore(&utmip_pad_lock, flags);
261
262 clk_disable_unprepare(phy->pad_clk);
263}
264
265static int utmip_pad_power_off(struct tegra_usb_phy *phy)
266{
267 unsigned long val, flags;
268 void __iomem *base = phy->pad_regs;
269
270 if (!utmip_pad_count) {
271 pr_err("%s: utmip pad already powered off\n", __func__);
272 return -EINVAL;
273 }
274
275 clk_prepare_enable(phy->pad_clk);
276
277 spin_lock_irqsave(&utmip_pad_lock, flags);
278
279 if (--utmip_pad_count == 0) {
280 val = readl(base + UTMIP_BIAS_CFG0);
281 val |= UTMIP_OTGPD | UTMIP_BIASPD;
282 writel(val, base + UTMIP_BIAS_CFG0);
283 }
284
285 spin_unlock_irqrestore(&utmip_pad_lock, flags);
286
287 clk_disable_unprepare(phy->pad_clk);
288
289 return 0;
290}
291
292static int utmi_wait_register(void __iomem *reg, u32 mask, u32 result)
293{
294 unsigned long timeout = 2000;
295 do {
296 if ((readl(reg) & mask) == result)
297 return 0;
298 udelay(1);
299 timeout--;
300 } while (timeout);
301 return -1;
302}
303
304static void utmi_phy_clk_disable(struct tegra_usb_phy *phy)
305{
306 unsigned long val;
307 void __iomem *base = phy->regs;
308
309 if (phy->instance == 0) {
310 val = readl(base + USB_SUSP_CTRL);
311 val |= USB_SUSP_SET;
312 writel(val, base + USB_SUSP_CTRL);
313
314 udelay(10);
315
316 val = readl(base + USB_SUSP_CTRL);
317 val &= ~USB_SUSP_SET;
318 writel(val, base + USB_SUSP_CTRL);
319 }
320
321 if (phy->instance == 2) {
322 val = readl(base + USB_PORTSC1);
323 val |= USB_PORTSC1_PHCD;
324 writel(val, base + USB_PORTSC1);
325 }
326
327 if (utmi_wait_register(base + USB_SUSP_CTRL, USB_PHY_CLK_VALID, 0) < 0)
328 pr_err("%s: timeout waiting for phy to stabilize\n", __func__);
329}
330
331static void utmi_phy_clk_enable(struct tegra_usb_phy *phy)
332{
333 unsigned long val;
334 void __iomem *base = phy->regs;
335
336 if (phy->instance == 0) {
337 val = readl(base + USB_SUSP_CTRL);
338 val |= USB_SUSP_CLR;
339 writel(val, base + USB_SUSP_CTRL);
340
341 udelay(10);
342
343 val = readl(base + USB_SUSP_CTRL);
344 val &= ~USB_SUSP_CLR;
345 writel(val, base + USB_SUSP_CTRL);
346 }
347
348 if (phy->instance == 2) {
349 val = readl(base + USB_PORTSC1);
350 val &= ~USB_PORTSC1_PHCD;
351 writel(val, base + USB_PORTSC1);
352 }
353
354 if (utmi_wait_register(base + USB_SUSP_CTRL, USB_PHY_CLK_VALID,
355 USB_PHY_CLK_VALID))
356 pr_err("%s: timeout waiting for phy to stabilize\n", __func__);
357}
358
359static int utmi_phy_power_on(struct tegra_usb_phy *phy)
360{
361 unsigned long val;
362 void __iomem *base = phy->regs;
363 struct tegra_utmip_config *config = phy->config;
364
365 val = readl(base + USB_SUSP_CTRL);
366 val |= UTMIP_RESET;
367 writel(val, base + USB_SUSP_CTRL);
368
369 if (phy->instance == 0) {
370 val = readl(base + USB1_LEGACY_CTRL);
371 val |= USB1_NO_LEGACY_MODE;
372 writel(val, base + USB1_LEGACY_CTRL);
373 }
374
375 val = readl(base + UTMIP_TX_CFG0);
376 val &= ~UTMIP_FS_PREABMLE_J;
377 writel(val, base + UTMIP_TX_CFG0);
378
379 val = readl(base + UTMIP_HSRX_CFG0);
380 val &= ~(UTMIP_IDLE_WAIT(~0) | UTMIP_ELASTIC_LIMIT(~0));
381 val |= UTMIP_IDLE_WAIT(config->idle_wait_delay);
382 val |= UTMIP_ELASTIC_LIMIT(config->elastic_limit);
383 writel(val, base + UTMIP_HSRX_CFG0);
384
385 val = readl(base + UTMIP_HSRX_CFG1);
386 val &= ~UTMIP_HS_SYNC_START_DLY(~0);
387 val |= UTMIP_HS_SYNC_START_DLY(config->hssync_start_delay);
388 writel(val, base + UTMIP_HSRX_CFG1);
389
390 val = readl(base + UTMIP_DEBOUNCE_CFG0);
391 val &= ~UTMIP_BIAS_DEBOUNCE_A(~0);
392 val |= UTMIP_BIAS_DEBOUNCE_A(phy->freq->debounce);
393 writel(val, base + UTMIP_DEBOUNCE_CFG0);
394
395 val = readl(base + UTMIP_MISC_CFG0);
396 val &= ~UTMIP_SUSPEND_EXIT_ON_EDGE;
397 writel(val, base + UTMIP_MISC_CFG0);
398
399 val = readl(base + UTMIP_MISC_CFG1);
400 val &= ~(UTMIP_PLL_ACTIVE_DLY_COUNT(~0) | UTMIP_PLLU_STABLE_COUNT(~0));
401 val |= UTMIP_PLL_ACTIVE_DLY_COUNT(phy->freq->active_delay) |
402 UTMIP_PLLU_STABLE_COUNT(phy->freq->stable_count);
403 writel(val, base + UTMIP_MISC_CFG1);
404
405 val = readl(base + UTMIP_PLL_CFG1);
406 val &= ~(UTMIP_XTAL_FREQ_COUNT(~0) | UTMIP_PLLU_ENABLE_DLY_COUNT(~0));
407 val |= UTMIP_XTAL_FREQ_COUNT(phy->freq->xtal_freq_count) |
408 UTMIP_PLLU_ENABLE_DLY_COUNT(phy->freq->enable_delay);
409 writel(val, base + UTMIP_PLL_CFG1);
410
411 if (phy->mode == TEGRA_USB_PHY_MODE_DEVICE) {
412 val = readl(base + USB_SUSP_CTRL);
413 val &= ~(USB_WAKE_ON_CNNT_EN_DEV | USB_WAKE_ON_DISCON_EN_DEV);
414 writel(val, base + USB_SUSP_CTRL);
415 }
416
417 utmip_pad_power_on(phy);
418
419 val = readl(base + UTMIP_XCVR_CFG0);
420 val &= ~(UTMIP_FORCE_PD_POWERDOWN | UTMIP_FORCE_PD2_POWERDOWN |
421 UTMIP_FORCE_PDZI_POWERDOWN | UTMIP_XCVR_SETUP(~0) |
422 UTMIP_XCVR_LSFSLEW(~0) | UTMIP_XCVR_LSRSLEW(~0) |
423 UTMIP_XCVR_HSSLEW_MSB(~0));
424 val |= UTMIP_XCVR_SETUP(config->xcvr_setup);
425 val |= UTMIP_XCVR_LSFSLEW(config->xcvr_lsfslew);
426 val |= UTMIP_XCVR_LSRSLEW(config->xcvr_lsrslew);
427 writel(val, base + UTMIP_XCVR_CFG0);
428
429 val = readl(base + UTMIP_XCVR_CFG1);
430 val &= ~(UTMIP_FORCE_PDDISC_POWERDOWN | UTMIP_FORCE_PDCHRP_POWERDOWN |
431 UTMIP_FORCE_PDDR_POWERDOWN | UTMIP_XCVR_TERM_RANGE_ADJ(~0));
432 val |= UTMIP_XCVR_TERM_RANGE_ADJ(config->term_range_adj);
433 writel(val, base + UTMIP_XCVR_CFG1);
434
435 val = readl(base + UTMIP_BAT_CHRG_CFG0);
436 val &= ~UTMIP_PD_CHRG;
437 writel(val, base + UTMIP_BAT_CHRG_CFG0);
438
439 val = readl(base + UTMIP_BIAS_CFG1);
440 val &= ~UTMIP_BIAS_PDTRK_COUNT(~0);
441 val |= UTMIP_BIAS_PDTRK_COUNT(0x5);
442 writel(val, base + UTMIP_BIAS_CFG1);
443
444 if (phy->instance == 0) {
445 val = readl(base + UTMIP_SPARE_CFG0);
446 if (phy->mode == TEGRA_USB_PHY_MODE_DEVICE)
447 val &= ~FUSE_SETUP_SEL;
448 else
449 val |= FUSE_SETUP_SEL;
450 writel(val, base + UTMIP_SPARE_CFG0);
451 }
452
453 if (phy->instance == 2) {
454 val = readl(base + USB_SUSP_CTRL);
455 val |= UTMIP_PHY_ENABLE;
456 writel(val, base + USB_SUSP_CTRL);
457 }
458
459 val = readl(base + USB_SUSP_CTRL);
460 val &= ~UTMIP_RESET;
461 writel(val, base + USB_SUSP_CTRL);
462
463 if (phy->instance == 0) {
464 val = readl(base + USB1_LEGACY_CTRL);
465 val &= ~USB1_VBUS_SENSE_CTL_MASK;
466 val |= USB1_VBUS_SENSE_CTL_A_SESS_VLD;
467 writel(val, base + USB1_LEGACY_CTRL);
468
469 val = readl(base + USB_SUSP_CTRL);
470 val &= ~USB_SUSP_SET;
471 writel(val, base + USB_SUSP_CTRL);
472 }
473
474 utmi_phy_clk_enable(phy);
475
476 if (phy->instance == 2) {
477 val = readl(base + USB_PORTSC1);
478 val &= ~USB_PORTSC1_PTS(~0);
479 writel(val, base + USB_PORTSC1);
480 }
481
482 return 0;
483}
484
485static void utmi_phy_power_off(struct tegra_usb_phy *phy)
486{
487 unsigned long val;
488 void __iomem *base = phy->regs;
489
490 utmi_phy_clk_disable(phy);
491
492 if (phy->mode == TEGRA_USB_PHY_MODE_DEVICE) {
493 val = readl(base + USB_SUSP_CTRL);
494 val &= ~USB_WAKEUP_DEBOUNCE_COUNT(~0);
495 val |= USB_WAKE_ON_CNNT_EN_DEV | USB_WAKEUP_DEBOUNCE_COUNT(5);
496 writel(val, base + USB_SUSP_CTRL);
497 }
498
499 val = readl(base + USB_SUSP_CTRL);
500 val |= UTMIP_RESET;
501 writel(val, base + USB_SUSP_CTRL);
502
503 val = readl(base + UTMIP_BAT_CHRG_CFG0);
504 val |= UTMIP_PD_CHRG;
505 writel(val, base + UTMIP_BAT_CHRG_CFG0);
506
507 val = readl(base + UTMIP_XCVR_CFG0);
508 val |= UTMIP_FORCE_PD_POWERDOWN | UTMIP_FORCE_PD2_POWERDOWN |
509 UTMIP_FORCE_PDZI_POWERDOWN;
510 writel(val, base + UTMIP_XCVR_CFG0);
511
512 val = readl(base + UTMIP_XCVR_CFG1);
513 val |= UTMIP_FORCE_PDDISC_POWERDOWN | UTMIP_FORCE_PDCHRP_POWERDOWN |
514 UTMIP_FORCE_PDDR_POWERDOWN;
515 writel(val, base + UTMIP_XCVR_CFG1);
516
517 utmip_pad_power_off(phy);
518}
519
520static void utmi_phy_preresume(struct tegra_usb_phy *phy)
521{
522 unsigned long val;
523 void __iomem *base = phy->regs;
524
525 val = readl(base + UTMIP_TX_CFG0);
526 val |= UTMIP_HS_DISCON_DISABLE;
527 writel(val, base + UTMIP_TX_CFG0);
528}
529
530static void utmi_phy_postresume(struct tegra_usb_phy *phy)
531{
532 unsigned long val;
533 void __iomem *base = phy->regs;
534
535 val = readl(base + UTMIP_TX_CFG0);
536 val &= ~UTMIP_HS_DISCON_DISABLE;
537 writel(val, base + UTMIP_TX_CFG0);
538}
539
540static void utmi_phy_restore_start(struct tegra_usb_phy *phy,
541 enum tegra_usb_phy_port_speed port_speed)
542{
543 unsigned long val;
544 void __iomem *base = phy->regs;
545
546 val = readl(base + UTMIP_MISC_CFG0);
547 val &= ~UTMIP_DPDM_OBSERVE_SEL(~0);
548 if (port_speed == TEGRA_USB_PHY_PORT_SPEED_LOW)
549 val |= UTMIP_DPDM_OBSERVE_SEL_FS_K;
550 else
551 val |= UTMIP_DPDM_OBSERVE_SEL_FS_J;
552 writel(val, base + UTMIP_MISC_CFG0);
553 udelay(1);
554
555 val = readl(base + UTMIP_MISC_CFG0);
556 val |= UTMIP_DPDM_OBSERVE;
557 writel(val, base + UTMIP_MISC_CFG0);
558 udelay(10);
559}
560
561static void utmi_phy_restore_end(struct tegra_usb_phy *phy)
562{
563 unsigned long val;
564 void __iomem *base = phy->regs;
565
566 val = readl(base + UTMIP_MISC_CFG0);
567 val &= ~UTMIP_DPDM_OBSERVE;
568 writel(val, base + UTMIP_MISC_CFG0);
569 udelay(10);
570}
571
572static int ulpi_phy_power_on(struct tegra_usb_phy *phy)
573{
574 int ret;
575 unsigned long val;
576 void __iomem *base = phy->regs;
577 struct tegra_ulpi_config *config = phy->config;
578
579 gpio_direction_output(config->reset_gpio, 0);
580 msleep(5);
581 gpio_direction_output(config->reset_gpio, 1);
582
583 clk_prepare_enable(phy->clk);
584 msleep(1);
585
586 val = readl(base + USB_SUSP_CTRL);
587 val |= UHSIC_RESET;
588 writel(val, base + USB_SUSP_CTRL);
589
590 val = readl(base + ULPI_TIMING_CTRL_0);
591 val |= ULPI_OUTPUT_PINMUX_BYP | ULPI_CLKOUT_PINMUX_BYP;
592 writel(val, base + ULPI_TIMING_CTRL_0);
593
594 val = readl(base + USB_SUSP_CTRL);
595 val |= ULPI_PHY_ENABLE;
596 writel(val, base + USB_SUSP_CTRL);
597
598 val = 0;
599 writel(val, base + ULPI_TIMING_CTRL_1);
600
601 val |= ULPI_DATA_TRIMMER_SEL(4);
602 val |= ULPI_STPDIRNXT_TRIMMER_SEL(4);
603 val |= ULPI_DIR_TRIMMER_SEL(4);
604 writel(val, base + ULPI_TIMING_CTRL_1);
605 udelay(10);
606
607 val |= ULPI_DATA_TRIMMER_LOAD;
608 val |= ULPI_STPDIRNXT_TRIMMER_LOAD;
609 val |= ULPI_DIR_TRIMMER_LOAD;
610 writel(val, base + ULPI_TIMING_CTRL_1);
611
612 /* Fix VbusInvalid due to floating VBUS */
613 ret = usb_phy_io_write(phy->ulpi, 0x40, 0x08);
614 if (ret) {
615 pr_err("%s: ulpi write failed\n", __func__);
616 return ret;
617 }
618
619 ret = usb_phy_io_write(phy->ulpi, 0x80, 0x0B);
620 if (ret) {
621 pr_err("%s: ulpi write failed\n", __func__);
622 return ret;
623 }
624
625 val = readl(base + USB_PORTSC1);
626 val |= USB_PORTSC1_WKOC | USB_PORTSC1_WKDS | USB_PORTSC1_WKCN;
627 writel(val, base + USB_PORTSC1);
628
629 val = readl(base + USB_SUSP_CTRL);
630 val |= USB_SUSP_CLR;
631 writel(val, base + USB_SUSP_CTRL);
632 udelay(100);
633
634 val = readl(base + USB_SUSP_CTRL);
635 val &= ~USB_SUSP_CLR;
636 writel(val, base + USB_SUSP_CTRL);
637
638 return 0;
639}
640
641static void ulpi_phy_power_off(struct tegra_usb_phy *phy)
642{
643 unsigned long val;
644 void __iomem *base = phy->regs;
645 struct tegra_ulpi_config *config = phy->config;
646
647 /* Clear WKCN/WKDS/WKOC wake-on events that can cause the USB
648 * Controller to immediately bring the ULPI PHY out of low power
649 */
650 val = readl(base + USB_PORTSC1);
651 val &= ~(USB_PORTSC1_WKOC | USB_PORTSC1_WKDS | USB_PORTSC1_WKCN);
652 writel(val, base + USB_PORTSC1);
653
654 gpio_direction_output(config->reset_gpio, 0);
655 clk_disable(phy->clk);
656}
657
658struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance,
659 void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode)
660{
661 struct tegra_usb_phy *phy;
662 struct tegra_ulpi_config *ulpi_config;
663 unsigned long parent_rate;
664 int i;
665 int err;
666
667 phy = kmalloc(sizeof(struct tegra_usb_phy), GFP_KERNEL);
668 if (!phy)
669 return ERR_PTR(-ENOMEM);
670
671 phy->instance = instance;
672 phy->regs = regs;
673 phy->config = config;
674 phy->mode = phy_mode;
675
676 if (!phy->config) {
677 if (phy_is_ulpi(phy)) {
678 pr_err("%s: ulpi phy configuration missing", __func__);
679 err = -EINVAL;
680 goto err0;
681 } else {
682 phy->config = &utmip_default[instance];
683 }
684 }
685
686 phy->pll_u = clk_get_sys(NULL, "pll_u");
687 if (IS_ERR(phy->pll_u)) {
688 pr_err("Can't get pll_u clock\n");
689 err = PTR_ERR(phy->pll_u);
690 goto err0;
691 }
692 clk_prepare_enable(phy->pll_u);
693
694 parent_rate = clk_get_rate(clk_get_parent(phy->pll_u));
695 for (i = 0; i < ARRAY_SIZE(tegra_freq_table); i++) {
696 if (tegra_freq_table[i].freq == parent_rate) {
697 phy->freq = &tegra_freq_table[i];
698 break;
699 }
700 }
701 if (!phy->freq) {
702 pr_err("invalid pll_u parent rate %ld\n", parent_rate);
703 err = -EINVAL;
704 goto err1;
705 }
706
707 if (phy_is_ulpi(phy)) {
708 ulpi_config = config;
709 phy->clk = clk_get_sys(NULL, ulpi_config->clk);
710 if (IS_ERR(phy->clk)) {
711 pr_err("%s: can't get ulpi clock\n", __func__);
712 err = -ENXIO;
713 goto err1;
714 }
715 if (!gpio_is_valid(ulpi_config->reset_gpio))
716 ulpi_config->reset_gpio =
717 of_get_named_gpio(dev->of_node,
718 "nvidia,phy-reset-gpio", 0);
719 if (!gpio_is_valid(ulpi_config->reset_gpio)) {
720 pr_err("%s: invalid reset gpio: %d\n", __func__,
721 ulpi_config->reset_gpio);
722 err = -EINVAL;
723 goto err1;
724 }
725 gpio_request(ulpi_config->reset_gpio, "ulpi_phy_reset_b");
726 gpio_direction_output(ulpi_config->reset_gpio, 0);
727 phy->ulpi = otg_ulpi_create(&ulpi_viewport_access_ops, 0);
728 phy->ulpi->io_priv = regs + ULPI_VIEWPORT;
729 } else {
730 err = utmip_pad_open(phy);
731 if (err < 0)
732 goto err1;
733 }
734
735 return phy;
736
737err1:
738 clk_disable_unprepare(phy->pll_u);
739 clk_put(phy->pll_u);
740err0:
741 kfree(phy);
742 return ERR_PTR(err);
743}
744EXPORT_SYMBOL_GPL(tegra_usb_phy_open);
745
746int tegra_usb_phy_power_on(struct tegra_usb_phy *phy)
747{
748 if (phy_is_ulpi(phy))
749 return ulpi_phy_power_on(phy);
750 else
751 return utmi_phy_power_on(phy);
752}
753EXPORT_SYMBOL_GPL(tegra_usb_phy_power_on);
754
755void tegra_usb_phy_power_off(struct tegra_usb_phy *phy)
756{
757 if (phy_is_ulpi(phy))
758 ulpi_phy_power_off(phy);
759 else
760 utmi_phy_power_off(phy);
761}
762EXPORT_SYMBOL_GPL(tegra_usb_phy_power_off);
763
764void tegra_usb_phy_preresume(struct tegra_usb_phy *phy)
765{
766 if (!phy_is_ulpi(phy))
767 utmi_phy_preresume(phy);
768}
769EXPORT_SYMBOL_GPL(tegra_usb_phy_preresume);
770
771void tegra_usb_phy_postresume(struct tegra_usb_phy *phy)
772{
773 if (!phy_is_ulpi(phy))
774 utmi_phy_postresume(phy);
775}
776EXPORT_SYMBOL_GPL(tegra_usb_phy_postresume);
777
778void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy,
779 enum tegra_usb_phy_port_speed port_speed)
780{
781 if (!phy_is_ulpi(phy))
782 utmi_phy_restore_start(phy, port_speed);
783}
784EXPORT_SYMBOL_GPL(tegra_ehci_phy_restore_start);
785
786void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy)
787{
788 if (!phy_is_ulpi(phy))
789 utmi_phy_restore_end(phy);
790}
791EXPORT_SYMBOL_GPL(tegra_ehci_phy_restore_end);
792
793void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy)
794{
795 if (!phy_is_ulpi(phy))
796 utmi_phy_clk_disable(phy);
797}
798EXPORT_SYMBOL_GPL(tegra_usb_phy_clk_disable);
799
800void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy)
801{
802 if (!phy_is_ulpi(phy))
803 utmi_phy_clk_enable(phy);
804}
805EXPORT_SYMBOL_GPL(tegra_usb_phy_clk_enable);
806
807void tegra_usb_phy_close(struct tegra_usb_phy *phy)
808{
809 if (phy_is_ulpi(phy))
810 clk_put(phy->clk);
811 else
812 utmip_pad_close(phy);
813 clk_disable_unprepare(phy->pll_u);
814 clk_put(phy->pll_u);
815 kfree(phy);
816}
817EXPORT_SYMBOL_GPL(tegra_usb_phy_close);
diff --git a/arch/arm/mach-u300/Kconfig b/arch/arm/mach-u300/Kconfig
index 54d8f34fdee..1f597647d43 100644
--- a/arch/arm/mach-u300/Kconfig
+++ b/arch/arm/mach-u300/Kconfig
@@ -1,55 +1,16 @@
1if ARCH_U300 1if ARCH_U300
2 2
3menu "ST-Ericsson AB U300/U330/U335/U365 Platform" 3menu "ST-Ericsson AB U300/U335 Platform"
4 4
5comment "ST-Ericsson Mobile Platform Products" 5comment "ST-Ericsson Mobile Platform Products"
6 6
7config MACH_U300 7config MACH_U300
8 bool "U300" 8 bool "U300"
9 select PINCTRL 9 select PINCTRL
10 select PINCTRL_U300
11 select PINCTRL_COH901 10 select PINCTRL_COH901
11 select PINCTRL_U300
12 12
13comment "ST-Ericsson U300/U330/U335/U365 Feature Selections" 13comment "ST-Ericsson U300/U335 Feature Selections"
14
15choice
16 prompt "U300/U330/U335/U365 system type"
17 default MACH_U300_BS2X
18 ---help---
19 You need to select the target system, i.e. the
20 U300/U330/U335/U365 board that you want to compile your kernel
21 for.
22
23config MACH_U300_BS2X
24 bool "S26/S26/B25/B26 Test Products"
25 depends on MACH_U300
26 help
27 Select this if you're developing on the
28 S26/S25 test products. (Also works on
29 B26/B25 big boards.)
30
31config MACH_U300_BS330
32 bool "S330/B330 Test Products"
33 depends on MACH_U300
34 help
35 Select this if you're developing on the
36 S330/B330 test products.
37
38config MACH_U300_BS335
39 bool "S335/B335 Test Products"
40 depends on MACH_U300
41 help
42 Select this if you're developing on the
43 S335/B335 test products.
44
45config MACH_U300_BS365
46 bool "S365/B365 Test Products"
47 depends on MACH_U300
48 help
49 Select this if you're developing on the
50 S365/B365 test products.
51
52endchoice
53 14
54config U300_DEBUG 15config U300_DEBUG
55 bool "Debug support for U300" 16 bool "Debug support for U300"
diff --git a/arch/arm/mach-u300/Makefile b/arch/arm/mach-u300/Makefile
index 7e47d37aeb0..5a86c58da39 100644
--- a/arch/arm/mach-u300/Makefile
+++ b/arch/arm/mach-u300/Makefile
@@ -7,7 +7,6 @@ obj-m :=
7obj-n := 7obj-n :=
8obj- := 8obj- :=
9 9
10obj-$(CONFIG_ARCH_U300) += u300.o
11obj-$(CONFIG_SPI_PL022) += spi.o 10obj-$(CONFIG_SPI_PL022) += spi.o
12obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o 11obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o
13obj-$(CONFIG_I2C_STU300) += i2c.o 12obj-$(CONFIG_I2C_STU300) += i2c.o
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index 03acf1883ec..b8efac4daed 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -3,7 +3,7 @@
3 * arch/arm/mach-u300/core.c 3 * arch/arm/mach-u300/core.c
4 * 4 *
5 * 5 *
6 * Copyright (C) 2007-2010 ST-Ericsson SA 6 * Copyright (C) 2007-2012 ST-Ericsson SA
7 * License terms: GNU General Public License (GPL) version 2 7 * License terms: GNU General Public License (GPL) version 2
8 * Core platform support, IRQ handling and device definitions. 8 * Core platform support, IRQ handling and device definitions.
9 * Author: Linus Walleij <linus.walleij@stericsson.com> 9 * Author: Linus Walleij <linus.walleij@stericsson.com>
@@ -31,23 +31,26 @@
31#include <linux/pinctrl/pinconf-generic.h> 31#include <linux/pinctrl/pinconf-generic.h>
32#include <linux/dma-mapping.h> 32#include <linux/dma-mapping.h>
33#include <linux/platform_data/clk-u300.h> 33#include <linux/platform_data/clk-u300.h>
34#include <linux/platform_data/pinctrl-coh901.h>
34 35
35#include <asm/types.h> 36#include <asm/types.h>
36#include <asm/setup.h> 37#include <asm/setup.h>
37#include <asm/memory.h> 38#include <asm/memory.h>
38#include <asm/hardware/vic.h> 39#include <asm/hardware/vic.h>
39#include <asm/mach/map.h> 40#include <asm/mach/map.h>
40#include <asm/mach/irq.h> 41#include <asm/mach-types.h>
42#include <asm/mach/arch.h>
41 43
42#include <mach/coh901318.h> 44#include <mach/coh901318.h>
43#include <mach/hardware.h> 45#include <mach/hardware.h>
44#include <mach/syscon.h> 46#include <mach/syscon.h>
45#include <mach/dma_channels.h> 47#include <mach/irqs.h>
46#include <mach/gpio-u300.h>
47 48
49#include "timer.h"
48#include "spi.h" 50#include "spi.h"
49#include "i2c.h" 51#include "i2c.h"
50#include "u300-gpio.h" 52#include "u300-gpio.h"
53#include "dma_channels.h"
51 54
52/* 55/*
53 * Static I/O mappings that are needed for booting the U300 platforms. The 56 * Static I/O mappings that are needed for booting the U300 platforms. The
@@ -76,7 +79,7 @@ static struct map_desc u300_io_desc[] __initdata = {
76 }, 79 },
77}; 80};
78 81
79void __init u300_map_io(void) 82static void __init u300_map_io(void)
80{ 83{
81 iotable_init(u300_io_desc, ARRAY_SIZE(u300_io_desc)); 84 iotable_init(u300_io_desc, ARRAY_SIZE(u300_io_desc));
82 /* We enable a real big DMA buffer if need be. */ 85 /* We enable a real big DMA buffer if need be. */
@@ -101,7 +104,6 @@ static AMBA_APB_DEVICE(uart0, "uart0", 0, U300_UART0_BASE,
101 { IRQ_U300_UART0 }, &uart0_plat_data); 104 { IRQ_U300_UART0 }, &uart0_plat_data);
102 105
103/* The U335 have an additional UART1 on the APP CPU */ 106/* The U335 have an additional UART1 on the APP CPU */
104#ifdef CONFIG_MACH_U300_BS335
105static struct amba_pl011_data uart1_plat_data = { 107static struct amba_pl011_data uart1_plat_data = {
106#ifdef CONFIG_COH901318 108#ifdef CONFIG_COH901318
107 .dma_filter = coh901318_filter_id, 109 .dma_filter = coh901318_filter_id,
@@ -113,7 +115,6 @@ static struct amba_pl011_data uart1_plat_data = {
113/* Fast device at 0x7000 offset */ 115/* Fast device at 0x7000 offset */
114static AMBA_APB_DEVICE(uart1, "uart1", 0, U300_UART1_BASE, 116static AMBA_APB_DEVICE(uart1, "uart1", 0, U300_UART1_BASE,
115 { IRQ_U300_UART1 }, &uart1_plat_data); 117 { IRQ_U300_UART1 }, &uart1_plat_data);
116#endif
117 118
118/* AHB device at 0x4000 offset */ 119/* AHB device at 0x4000 offset */
119static AMBA_APB_DEVICE(pl172, "pl172", 0, U300_EMIF_CFG_BASE, { }, NULL); 120static AMBA_APB_DEVICE(pl172, "pl172", 0, U300_EMIF_CFG_BASE, { }, NULL);
@@ -152,9 +153,7 @@ static AMBA_APB_DEVICE(mmcsd, "mmci", 0, U300_MMCSD_BASE,
152 */ 153 */
153static struct amba_device *amba_devs[] __initdata = { 154static struct amba_device *amba_devs[] __initdata = {
154 &uart0_device, 155 &uart0_device,
155#ifdef CONFIG_MACH_U300_BS335
156 &uart1_device, 156 &uart1_device,
157#endif
158 &pl022_device, 157 &pl022_device,
159 &pl172_device, 158 &pl172_device,
160 &mmcsd_device, 159 &mmcsd_device,
@@ -188,7 +187,6 @@ static struct resource gpio_resources[] = {
188 .end = IRQ_U300_GPIO_PORT2, 187 .end = IRQ_U300_GPIO_PORT2,
189 .flags = IORESOURCE_IRQ, 188 .flags = IORESOURCE_IRQ,
190 }, 189 },
191#if defined(CONFIG_MACH_U300_BS365) || defined(CONFIG_MACH_U300_BS335)
192 { 190 {
193 .name = "gpio3", 191 .name = "gpio3",
194 .start = IRQ_U300_GPIO_PORT3, 192 .start = IRQ_U300_GPIO_PORT3,
@@ -201,8 +199,6 @@ static struct resource gpio_resources[] = {
201 .end = IRQ_U300_GPIO_PORT4, 199 .end = IRQ_U300_GPIO_PORT4,
202 .flags = IORESOURCE_IRQ, 200 .flags = IORESOURCE_IRQ,
203 }, 201 },
204#endif
205#ifdef CONFIG_MACH_U300_BS335
206 { 202 {
207 .name = "gpio5", 203 .name = "gpio5",
208 .start = IRQ_U300_GPIO_PORT5, 204 .start = IRQ_U300_GPIO_PORT5,
@@ -215,7 +211,6 @@ static struct resource gpio_resources[] = {
215 .end = IRQ_U300_GPIO_PORT6, 211 .end = IRQ_U300_GPIO_PORT6,
216 .flags = IORESOURCE_IRQ, 212 .flags = IORESOURCE_IRQ,
217 }, 213 },
218#endif /* CONFIG_MACH_U300_BS335 */
219}; 214};
220 215
221static struct resource keypad_resources[] = { 216static struct resource keypad_resources[] = {
@@ -323,7 +318,6 @@ static struct resource dma_resource[] = {
323 } 318 }
324}; 319};
325 320
326#ifdef CONFIG_MACH_U300_BS335
327/* points out all dma slave channels. 321/* points out all dma slave channels.
328 * Syntax is [A1, B1, A2, B2, .... ,-1,-1] 322 * Syntax is [A1, B1, A2, B2, .... ,-1,-1]
329 * Select all channels from A to B, end of list is marked with -1,-1 323 * Select all channels from A to B, end of list is marked with -1,-1
@@ -336,14 +330,6 @@ static int dma_slave_channels[] = {
336static int dma_memcpy_channels[] = { 330static int dma_memcpy_channels[] = {
337 U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_8, -1, -1}; 331 U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_8, -1, -1};
338 332
339#else /* CONFIG_MACH_U300_BS335 */
340
341static int dma_slave_channels[] = {U300_DMA_MSL_TX_0, U300_DMA_SPI_RX, -1, -1};
342static int dma_memcpy_channels[] = {
343 U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_10, -1, -1};
344
345#endif
346
347/** register dma for memory access 333/** register dma for memory access
348 * 334 *
349 * active 1 means dma intends to access memory 335 * active 1 means dma intends to access memory
@@ -1395,7 +1381,6 @@ const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
1395 .param.ctrl_lli = flags_memcpy_lli, 1381 .param.ctrl_lli = flags_memcpy_lli,
1396 .param.ctrl_lli_last = flags_memcpy_lli_last, 1382 .param.ctrl_lli_last = flags_memcpy_lli_last,
1397 }, 1383 },
1398#ifdef CONFIG_MACH_U300_BS335
1399 { 1384 {
1400 .number = U300_DMA_UART1_TX, 1385 .number = U300_DMA_UART1_TX,
1401 .name = "UART1 TX", 1386 .name = "UART1 TX",
@@ -1406,28 +1391,6 @@ const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
1406 .name = "UART1 RX", 1391 .name = "UART1 RX",
1407 .priority_high = 0, 1392 .priority_high = 0,
1408 } 1393 }
1409#else
1410 {
1411 .number = U300_DMA_GENERAL_PURPOSE_9,
1412 .name = "GENERAL 09",
1413 .priority_high = 0,
1414
1415 .param.config = flags_memcpy_config,
1416 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1417 .param.ctrl_lli = flags_memcpy_lli,
1418 .param.ctrl_lli_last = flags_memcpy_lli_last,
1419 },
1420 {
1421 .number = U300_DMA_GENERAL_PURPOSE_10,
1422 .name = "GENERAL 10",
1423 .priority_high = 0,
1424
1425 .param.config = flags_memcpy_config,
1426 .param.ctrl_lli_chained = flags_memcpy_lli_chained,
1427 .param.ctrl_lli = flags_memcpy_lli,
1428 .param.ctrl_lli_last = flags_memcpy_lli_last,
1429 }
1430#endif
1431}; 1394};
1432 1395
1433 1396
@@ -1480,18 +1443,7 @@ static struct platform_device pinctrl_device = {
1480 * GPIO block, with different number of ports. 1443 * GPIO block, with different number of ports.
1481 */ 1444 */
1482static struct u300_gpio_platform u300_gpio_plat = { 1445static struct u300_gpio_platform u300_gpio_plat = {
1483#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
1484 .variant = U300_GPIO_COH901335,
1485 .ports = 3,
1486#endif
1487#ifdef CONFIG_MACH_U300_BS335
1488 .variant = U300_GPIO_COH901571_3_BS335,
1489 .ports = 7, 1446 .ports = 7,
1490#endif
1491#ifdef CONFIG_MACH_U300_BS365
1492 .variant = U300_GPIO_COH901571_3_BS365,
1493 .ports = 5,
1494#endif
1495 .gpio_base = 0, 1447 .gpio_base = 0,
1496 .gpio_irq_base = IRQ_U300_GPIO_BASE, 1448 .gpio_irq_base = IRQ_U300_GPIO_BASE,
1497 .pinctrl_device = &pinctrl_device, 1449 .pinctrl_device = &pinctrl_device,
@@ -1605,9 +1557,6 @@ static struct u300_mux_hog u300_mux_hogs[] = {
1605 .dev = &uart0_device.dev, 1557 .dev = &uart0_device.dev,
1606 }, 1558 },
1607 { 1559 {
1608 .dev = &pl022_device.dev,
1609 },
1610 {
1611 .dev = &mmcsd_device.dev, 1560 .dev = &mmcsd_device.dev,
1612 }, 1561 },
1613}; 1562};
@@ -1651,7 +1600,7 @@ static struct platform_device *platform_devs[] __initdata = {
1651 * together so some interrupts are connected to the first one and some 1600 * together so some interrupts are connected to the first one and some
1652 * to the second one. 1601 * to the second one.
1653 */ 1602 */
1654void __init u300_init_irq(void) 1603static void __init u300_init_irq(void)
1655{ 1604{
1656 u32 mask[2] = {0, 0}; 1605 u32 mask[2] = {0, 0};
1657 struct clk *clk; 1606 struct clk *clk;
@@ -1756,29 +1705,11 @@ static void __init u300_init_check_chip(void)
1756 printk(KERN_INFO "Initializing U300 system on %s baseband chip " \ 1705 printk(KERN_INFO "Initializing U300 system on %s baseband chip " \
1757 "(chip ID 0x%04x)\n", chipname, val); 1706 "(chip ID 0x%04x)\n", chipname, val);
1758 1707
1759#ifdef CONFIG_MACH_U300_BS330
1760 if ((val & 0xFF00U) != 0xd800) {
1761 printk(KERN_ERR "Platform configured for BS330 " \
1762 "with DB3200 but %s detected, expect problems!",
1763 chipname);
1764 }
1765#endif
1766#ifdef CONFIG_MACH_U300_BS335
1767 if ((val & 0xFF00U) != 0xf000 && (val & 0xFF00U) != 0xf100) { 1708 if ((val & 0xFF00U) != 0xf000 && (val & 0xFF00U) != 0xf100) {
1768 printk(KERN_ERR "Platform configured for BS335 " \ 1709 printk(KERN_ERR "Platform configured for BS335 " \
1769 " with DB3350 but %s detected, expect problems!", 1710 " with DB3350 but %s detected, expect problems!",
1770 chipname); 1711 chipname);
1771 } 1712 }
1772#endif
1773#ifdef CONFIG_MACH_U300_BS365
1774 if ((val & 0xFF00U) != 0xe800) {
1775 printk(KERN_ERR "Platform configured for BS365 " \
1776 "with DB3210 but %s detected, expect problems!",
1777 chipname);
1778 }
1779#endif
1780
1781
1782} 1713}
1783 1714
1784/* 1715/*
@@ -1811,7 +1742,7 @@ static void __init u300_assign_physmem(void)
1811 } 1742 }
1812} 1743}
1813 1744
1814void __init u300_init_devices(void) 1745static void __init u300_init_machine(void)
1815{ 1746{
1816 int i; 1747 int i;
1817 u16 val; 1748 u16 val;
@@ -1852,7 +1783,7 @@ void __init u300_init_devices(void)
1852/* Forward declare this function from the watchdog */ 1783/* Forward declare this function from the watchdog */
1853void coh901327_watchdog_reset(void); 1784void coh901327_watchdog_reset(void);
1854 1785
1855void u300_restart(char mode, const char *cmd) 1786static void u300_restart(char mode, const char *cmd)
1856{ 1787{
1857 switch (mode) { 1788 switch (mode) {
1858 case 's': 1789 case 's':
@@ -1868,3 +1799,15 @@ void u300_restart(char mode, const char *cmd)
1868 /* Wait for system do die/reset. */ 1799 /* Wait for system do die/reset. */
1869 while (1); 1800 while (1);
1870} 1801}
1802
1803MACHINE_START(U300, "Ericsson AB U335 S335/B335 Prototype Board")
1804 /* Maintainer: Linus Walleij <linus.walleij@stericsson.com> */
1805 .atag_offset = 0x100,
1806 .map_io = u300_map_io,
1807 .nr_irqs = NR_IRQS_U300,
1808 .init_irq = u300_init_irq,
1809 .handle_irq = vic_handle_irq,
1810 .timer = &u300_timer,
1811 .init_machine = u300_init_machine,
1812 .restart = u300_restart,
1813MACHINE_END
diff --git a/arch/arm/mach-u300/include/mach/dma_channels.h b/arch/arm/mach-u300/dma_channels.h
index b239149ba0d..4e8a88fbca4 100644
--- a/arch/arm/mach-u300/include/mach/dma_channels.h
+++ b/arch/arm/mach-u300/dma_channels.h
@@ -3,7 +3,7 @@
3 * arch/arm/mach-u300/include/mach/dma_channels.h 3 * arch/arm/mach-u300/include/mach/dma_channels.h
4 * 4 *
5 * 5 *
6 * Copyright (C) 2007-2009 ST-Ericsson 6 * Copyright (C) 2007-2012 ST-Ericsson
7 * License terms: GNU General Public License (GPL) version 2 7 * License terms: GNU General Public License (GPL) version 2
8 * Map file for the U300 dma driver. 8 * Map file for the U300 dma driver.
9 * Author: Per Friden <per.friden@stericsson.com> 9 * Author: Per Friden <per.friden@stericsson.com>
@@ -50,19 +50,10 @@
50#define U300_DMA_GENERAL_PURPOSE_6 35 50#define U300_DMA_GENERAL_PURPOSE_6 35
51#define U300_DMA_GENERAL_PURPOSE_7 36 51#define U300_DMA_GENERAL_PURPOSE_7 36
52#define U300_DMA_GENERAL_PURPOSE_8 37 52#define U300_DMA_GENERAL_PURPOSE_8 37
53#ifdef CONFIG_MACH_U300_BS335
54#define U300_DMA_UART1_TX 38 53#define U300_DMA_UART1_TX 38
55#define U300_DMA_UART1_RX 39 54#define U300_DMA_UART1_RX 39
56#else
57#define U300_DMA_GENERAL_PURPOSE_9 38
58#define U300_DMA_GENERAL_PURPOSE_10 39
59#endif
60 55
61#ifdef CONFIG_MACH_U300_BS335
62#define U300_DMA_DEVICE_CHANNELS 32 56#define U300_DMA_DEVICE_CHANNELS 32
63#else
64#define U300_DMA_DEVICE_CHANNELS 30
65#endif
66#define U300_DMA_CHANNELS 40 57#define U300_DMA_CHANNELS 40
67 58
68 59
diff --git a/arch/arm/mach-u300/i2c.c b/arch/arm/mach-u300/i2c.c
index cb04bd6ab3e..96800aa1316 100644
--- a/arch/arm/mach-u300/i2c.c
+++ b/arch/arm/mach-u300/i2c.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-u300/i2c.c 2 * arch/arm/mach-u300/i2c.c
3 * 3 *
4 * Copyright (C) 2009 ST-Ericsson AB 4 * Copyright (C) 2009-2012 ST-Ericsson AB
5 * License terms: GNU General Public License (GPL) version 2 5 * License terms: GNU General Public License (GPL) version 2
6 * 6 *
7 * Register board i2c devices 7 * Register board i2c devices
@@ -9,7 +9,7 @@
9 */ 9 */
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/i2c.h> 11#include <linux/i2c.h>
12#include <linux/mfd/abx500.h> 12#include <linux/mfd/ab3100.h>
13#include <linux/regulator/machine.h> 13#include <linux/regulator/machine.h>
14#include <linux/amba/bus.h> 14#include <linux/amba/bus.h>
15#include <mach/irqs.h> 15#include <mach/irqs.h>
@@ -261,7 +261,6 @@ static struct i2c_board_info __initdata bus0_i2c_board_info[] = {
261}; 261};
262 262
263static struct i2c_board_info __initdata bus1_i2c_board_info[] = { 263static struct i2c_board_info __initdata bus1_i2c_board_info[] = {
264#ifdef CONFIG_MACH_U300_BS335
265 { 264 {
266 .type = "fwcam", 265 .type = "fwcam",
267 .addr = 0x10, 266 .addr = 0x10,
@@ -270,9 +269,6 @@ static struct i2c_board_info __initdata bus1_i2c_board_info[] = {
270 .type = "fwcam", 269 .type = "fwcam",
271 .addr = 0x5d, 270 .addr = 0x5d,
272 }, 271 },
273#else
274 { },
275#endif
276}; 272};
277 273
278void __init u300_i2c_register_board_devices(void) 274void __init u300_i2c_register_board_devices(void)
diff --git a/arch/arm/mach-u300/include/mach/clkdev.h b/arch/arm/mach-u300/include/mach/clkdev.h
deleted file mode 100644
index 92e3cc872c6..00000000000
--- a/arch/arm/mach-u300/include/mach/clkdev.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __MACH_CLKDEV_H
2#define __MACH_CLKDEV_H
3
4int __clk_get(struct clk *clk);
5void __clk_put(struct clk *clk);
6
7#endif
diff --git a/arch/arm/mach-u300/include/mach/gpio-u300.h b/arch/arm/mach-u300/include/mach/gpio-u300.h
deleted file mode 100644
index e81400c1753..00000000000
--- a/arch/arm/mach-u300/include/mach/gpio-u300.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * Copyright (C) 2007-2011 ST-Ericsson AB
3 * License terms: GNU General Public License (GPL) version 2
4 * GPIO block resgister definitions and inline macros for
5 * U300 GPIO COH 901 335 or COH 901 571/3
6 * Author: Linus Walleij <linus.walleij@stericsson.com>
7 */
8
9#ifndef __MACH_U300_GPIO_U300_H
10#define __MACH_U300_GPIO_U300_H
11
12/**
13 * enum u300_gpio_variant - the type of U300 GPIO employed
14 */
15enum u300_gpio_variant {
16 U300_GPIO_COH901335,
17 U300_GPIO_COH901571_3_BS335,
18 U300_GPIO_COH901571_3_BS365,
19};
20
21/**
22 * struct u300_gpio_platform - U300 GPIO platform data
23 * @variant: IP block variant
24 * @ports: number of GPIO block ports
25 * @gpio_base: first GPIO number for this block (use a free range)
26 * @gpio_irq_base: first GPIO IRQ number for this block (use a free range)
27 * @pinctrl_device: pin control device to spawn as child
28 */
29struct u300_gpio_platform {
30 enum u300_gpio_variant variant;
31 u8 ports;
32 int gpio_base;
33 int gpio_irq_base;
34 struct platform_device *pinctrl_device;
35};
36
37#endif /* __MACH_U300_GPIO_U300_H */
diff --git a/arch/arm/mach-u300/include/mach/gpio.h b/arch/arm/mach-u300/include/mach/gpio.h
deleted file mode 100644
index 40a8c178f10..00000000000
--- a/arch/arm/mach-u300/include/mach/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/mach-u300/include/mach/irqs.h b/arch/arm/mach-u300/include/mach/irqs.h
index ec09c1e07b1..e27425a63fa 100644
--- a/arch/arm/mach-u300/include/mach/irqs.h
+++ b/arch/arm/mach-u300/include/mach/irqs.h
@@ -3,7 +3,7 @@
3 * arch/arm/mach-u300/include/mach/irqs.h 3 * arch/arm/mach-u300/include/mach/irqs.h
4 * 4 *
5 * 5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB 6 * Copyright (C) 2006-2012 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2 7 * License terms: GNU General Public License (GPL) version 2
8 * IRQ channel definitions for the U300 platforms. 8 * IRQ channel definitions for the U300 platforms.
9 * Author: Linus Walleij <linus.walleij@stericsson.com> 9 * Author: Linus Walleij <linus.walleij@stericsson.com>
@@ -31,10 +31,6 @@
31#define IRQ_U300_XGAM_GAMCON 14 31#define IRQ_U300_XGAM_GAMCON 14
32#define IRQ_U300_XGAM_CDI 15 32#define IRQ_U300_XGAM_CDI 15
33#define IRQ_U300_XGAM_CDICON 16 33#define IRQ_U300_XGAM_CDICON 16
34#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
35/* MMIACC not used on the DB3210 or DB3350 chips */
36#define IRQ_U300_XGAM_MMIACC 17
37#endif
38#define IRQ_U300_XGAM_PDI 18 34#define IRQ_U300_XGAM_PDI 18
39#define IRQ_U300_XGAM_PDICON 19 35#define IRQ_U300_XGAM_PDICON 19
40#define IRQ_U300_XGAM_GAMEACC 20 36#define IRQ_U300_XGAM_GAMEACC 20
@@ -55,8 +51,6 @@
55#define IRQ_U300_GPIO_PORT1 34 51#define IRQ_U300_GPIO_PORT1 34
56#define IRQ_U300_GPIO_PORT2 35 52#define IRQ_U300_GPIO_PORT2 35
57 53
58#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) || \
59 defined(CONFIG_MACH_U300_BS335)
60/* These are for DB3150, DB3200 and DB3350 */ 54/* These are for DB3150, DB3200 and DB3350 */
61#define IRQ_U300_WDOG 36 55#define IRQ_U300_WDOG 36
62#define IRQ_U300_EVHIST 37 56#define IRQ_U300_EVHIST 37
@@ -68,15 +62,8 @@
68#define IRQ_U300_RTC 43 62#define IRQ_U300_RTC 43
69#define IRQ_U300_NFIF 44 63#define IRQ_U300_NFIF 44
70#define IRQ_U300_NFIF2 45 64#define IRQ_U300_NFIF2 45
71#endif
72
73/* DB3150 and DB3200 have only 45 IRQs */
74#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
75#define U300_VIC_IRQS_END 46
76#endif
77 65
78/* The DB3350-specific interrupt lines */ 66/* The DB3350-specific interrupt lines */
79#ifdef CONFIG_MACH_U300_BS335
80#define IRQ_U300_ISP_F0 46 67#define IRQ_U300_ISP_F0 46
81#define IRQ_U300_ISP_F1 47 68#define IRQ_U300_ISP_F1 47
82#define IRQ_U300_ISP_F2 48 69#define IRQ_U300_ISP_F2 48
@@ -89,25 +76,6 @@
89#define IRQ_U300_GPIO_PORT5 55 76#define IRQ_U300_GPIO_PORT5 55
90#define IRQ_U300_GPIO_PORT6 56 77#define IRQ_U300_GPIO_PORT6 56
91#define U300_VIC_IRQS_END 57 78#define U300_VIC_IRQS_END 57
92#endif
93
94/* The DB3210-specific interrupt lines */
95#ifdef CONFIG_MACH_U300_BS365
96#define IRQ_U300_GPIO_PORT3 36
97#define IRQ_U300_GPIO_PORT4 37
98#define IRQ_U300_WDOG 38
99#define IRQ_U300_EVHIST 39
100#define IRQ_U300_MSPRO 40
101#define IRQ_U300_MMCSD_MCIINTR0 41
102#define IRQ_U300_MMCSD_MCIINTR1 42
103#define IRQ_U300_I2C0 43
104#define IRQ_U300_I2C1 44
105#define IRQ_U300_RTC 45
106#define IRQ_U300_NFIF 46
107#define IRQ_U300_NFIF2 47
108#define IRQ_U300_SYSCON_PLL_LOCK 48
109#define U300_VIC_IRQS_END 49
110#endif
111 79
112/* Maximum 8*7 GPIO lines */ 80/* Maximum 8*7 GPIO lines */
113#ifdef CONFIG_PINCTRL_COH901 81#ifdef CONFIG_PINCTRL_COH901
@@ -117,6 +85,6 @@
117#define IRQ_U300_GPIO_END (U300_VIC_IRQS_END) 85#define IRQ_U300_GPIO_END (U300_VIC_IRQS_END)
118#endif 86#endif
119 87
120#define NR_IRQS (IRQ_U300_GPIO_END - IRQ_U300_INTCON0_START) 88#define NR_IRQS_U300 (IRQ_U300_GPIO_END - IRQ_U300_INTCON0_START)
121 89
122#endif 90#endif
diff --git a/arch/arm/mach-u300/include/mach/platform.h b/arch/arm/mach-u300/include/mach/platform.h
deleted file mode 100644
index 096333f32fc..00000000000
--- a/arch/arm/mach-u300/include/mach/platform.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 *
3 * arch/arm/mach-u300/include/mach/platform.h
4 *
5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Basic platform init and mapping functions.
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */
11
12#ifndef __ASSEMBLY__
13
14void u300_map_io(void);
15void u300_init_irq(void);
16void u300_init_devices(void);
17void u300_restart(char, const char *);
18extern struct sys_timer u300_timer;
19
20#endif
diff --git a/arch/arm/mach-u300/include/mach/syscon.h b/arch/arm/mach-u300/include/mach/syscon.h
index 6e84f07a7c6..10bdd0be977 100644
--- a/arch/arm/mach-u300/include/mach/syscon.h
+++ b/arch/arm/mach-u300/include/mach/syscon.h
@@ -3,7 +3,7 @@
3 * arch/arm/mach-u300/include/mach/syscon.h 3 * arch/arm/mach-u300/include/mach/syscon.h
4 * 4 *
5 * 5 *
6 * Copyright (C) 2008 ST-Ericsson AB 6 * Copyright (C) 2008-2012 ST-Ericsson AB
7 * 7 *
8 * Author: Rickard Andersson <rickard.andersson@stericsson.com> 8 * Author: Rickard Andersson <rickard.andersson@stericsson.com>
9 */ 9 */
@@ -36,9 +36,7 @@
36#define U300_SYSCON_CSR_PLL13_LOCK_IND (0x0001) 36#define U300_SYSCON_CSR_PLL13_LOCK_IND (0x0001)
37/* Reset lines for SLOW devices 16bit (R/W) */ 37/* Reset lines for SLOW devices 16bit (R/W) */
38#define U300_SYSCON_RSR (0x0014) 38#define U300_SYSCON_RSR (0x0014)
39#ifdef CONFIG_MACH_U300_BS335
40#define U300_SYSCON_RSR_PPM_RESET_EN (0x0200) 39#define U300_SYSCON_RSR_PPM_RESET_EN (0x0200)
41#endif
42#define U300_SYSCON_RSR_ACC_TMR_RESET_EN (0x0100) 40#define U300_SYSCON_RSR_ACC_TMR_RESET_EN (0x0100)
43#define U300_SYSCON_RSR_APP_TMR_RESET_EN (0x0080) 41#define U300_SYSCON_RSR_APP_TMR_RESET_EN (0x0080)
44#define U300_SYSCON_RSR_RTC_RESET_EN (0x0040) 42#define U300_SYSCON_RSR_RTC_RESET_EN (0x0040)
@@ -50,9 +48,7 @@
50#define U300_SYSCON_RSR_SLOW_BRIDGE_RESET_EN (0x0001) 48#define U300_SYSCON_RSR_SLOW_BRIDGE_RESET_EN (0x0001)
51/* Reset lines for FAST devices 16bit (R/W) */ 49/* Reset lines for FAST devices 16bit (R/W) */
52#define U300_SYSCON_RFR (0x0018) 50#define U300_SYSCON_RFR (0x0018)
53#ifdef CONFIG_MACH_U300_BS335
54#define U300_SYSCON_RFR_UART1_RESET_ENABLE (0x0080) 51#define U300_SYSCON_RFR_UART1_RESET_ENABLE (0x0080)
55#endif
56#define U300_SYSCON_RFR_SPI_RESET_ENABLE (0x0040) 52#define U300_SYSCON_RFR_SPI_RESET_ENABLE (0x0040)
57#define U300_SYSCON_RFR_MMC_RESET_ENABLE (0x0020) 53#define U300_SYSCON_RFR_MMC_RESET_ENABLE (0x0020)
58#define U300_SYSCON_RFR_PCM_I2S1_RESET_ENABLE (0x0010) 54#define U300_SYSCON_RFR_PCM_I2S1_RESET_ENABLE (0x0010)
@@ -62,10 +58,8 @@
62#define U300_SYSCON_RFR_FAST_BRIDGE_RESET_ENABLE (0x0001) 58#define U300_SYSCON_RFR_FAST_BRIDGE_RESET_ENABLE (0x0001)
63/* Reset lines for the rest of the peripherals 16bit (R/W) */ 59/* Reset lines for the rest of the peripherals 16bit (R/W) */
64#define U300_SYSCON_RRR (0x001c) 60#define U300_SYSCON_RRR (0x001c)
65#ifdef CONFIG_MACH_U300_BS335
66#define U300_SYSCON_RRR_CDS_RESET_EN (0x4000) 61#define U300_SYSCON_RRR_CDS_RESET_EN (0x4000)
67#define U300_SYSCON_RRR_ISP_RESET_EN (0x2000) 62#define U300_SYSCON_RRR_ISP_RESET_EN (0x2000)
68#endif
69#define U300_SYSCON_RRR_INTCON_RESET_EN (0x1000) 63#define U300_SYSCON_RRR_INTCON_RESET_EN (0x1000)
70#define U300_SYSCON_RRR_MSPRO_RESET_EN (0x0800) 64#define U300_SYSCON_RRR_MSPRO_RESET_EN (0x0800)
71#define U300_SYSCON_RRR_XGAM_RESET_EN (0x0100) 65#define U300_SYSCON_RRR_XGAM_RESET_EN (0x0100)
@@ -79,9 +73,7 @@
79#define U300_SYSCON_RRR_AAIF_RESET_EN (0x0001) 73#define U300_SYSCON_RRR_AAIF_RESET_EN (0x0001)
80/* Clock enable for SLOW peripherals 16bit (R/W) */ 74/* Clock enable for SLOW peripherals 16bit (R/W) */
81#define U300_SYSCON_CESR (0x0020) 75#define U300_SYSCON_CESR (0x0020)
82#ifdef CONFIG_MACH_U300_BS335
83#define U300_SYSCON_CESR_PPM_CLK_EN (0x0200) 76#define U300_SYSCON_CESR_PPM_CLK_EN (0x0200)
84#endif
85#define U300_SYSCON_CESR_ACC_TMR_CLK_EN (0x0100) 77#define U300_SYSCON_CESR_ACC_TMR_CLK_EN (0x0100)
86#define U300_SYSCON_CESR_APP_TMR_CLK_EN (0x0080) 78#define U300_SYSCON_CESR_APP_TMR_CLK_EN (0x0080)
87#define U300_SYSCON_CESR_KEYPAD_CLK_EN (0x0040) 79#define U300_SYSCON_CESR_KEYPAD_CLK_EN (0x0040)
@@ -92,24 +84,20 @@
92#define U300_SYSCON_CESR_SLOW_BRIDGE_CLK_EN (0x0001) 84#define U300_SYSCON_CESR_SLOW_BRIDGE_CLK_EN (0x0001)
93/* Clock enable for FAST peripherals 16bit (R/W) */ 85/* Clock enable for FAST peripherals 16bit (R/W) */
94#define U300_SYSCON_CEFR (0x0024) 86#define U300_SYSCON_CEFR (0x0024)
95#ifdef CONFIG_MACH_U300_BS335
96#define U300_SYSCON_CEFR_UART1_CLK_EN (0x0200) 87#define U300_SYSCON_CEFR_UART1_CLK_EN (0x0200)
97#endif
98#define U300_SYSCON_CEFR_I2S1_CORE_CLK_EN (0x0100) 88#define U300_SYSCON_CEFR_I2S1_CORE_CLK_EN (0x0100)
99#define U300_SYSCON_CEFR_I2S0_CORE_CLK_EN (0x0080) 89#define U300_SYSCON_CEFR_I2S0_CORE_CLK_EN (0x0080)
100#define U300_SYSCON_CEFR_SPI_CLK_EN (0x0040) 90#define U300_SYSCON_CEFR_SPI_CLK_EN (0x0040)
101#define U300_SYSCON_CEFR_MMC_CLK_EN (0x0020) 91#define U300_SYSCON_CEFR_MMC_CLK_EN (0x0020)
102#define U300_SYSCON_CEFR_I2S1_CLK_EN (0x0010) 92#define U300_SYSCON_CEFR_I2S1_CLK_EN (0x0010)
103#define U300_SYSCON_CEFR_I2S0_CLK_EN (0x0008) 93#define U300_SYSCON_CEFR_I2S0_CLK_EN (0x0008)
104#define U300_SYSCON_CEFR_I2C1_CLK_EN (0x0004) 94#define U300_SYSCON_CEFR_I2C1_CLK_EN (0x0004)
105#define U300_SYSCON_CEFR_I2C0_CLK_EN (0x0002) 95#define U300_SYSCON_CEFR_I2C0_CLK_EN (0x0002)
106#define U300_SYSCON_CEFR_FAST_BRIDGE_CLK_EN (0x0001) 96#define U300_SYSCON_CEFR_FAST_BRIDGE_CLK_EN (0x0001)
107/* Clock enable for the rest of the peripherals 16bit (R/W) */ 97/* Clock enable for the rest of the peripherals 16bit (R/W) */
108#define U300_SYSCON_CERR (0x0028) 98#define U300_SYSCON_CERR (0x0028)
109#ifdef CONFIG_MACH_U300_BS335
110#define U300_SYSCON_CERR_CDS_CLK_EN (0x2000) 99#define U300_SYSCON_CERR_CDS_CLK_EN (0x2000)
111#define U300_SYSCON_CERR_ISP_CLK_EN (0x1000) 100#define U300_SYSCON_CERR_ISP_CLK_EN (0x1000)
112#endif
113#define U300_SYSCON_CERR_MSPRO_CLK_EN (0x0800) 101#define U300_SYSCON_CERR_MSPRO_CLK_EN (0x0800)
114#define U300_SYSCON_CERR_AHB_SUBSYS_BRIDGE_CLK_EN (0x0400) 102#define U300_SYSCON_CERR_AHB_SUBSYS_BRIDGE_CLK_EN (0x0400)
115#define U300_SYSCON_CERR_SEMI_CLK_EN (0x0200) 103#define U300_SYSCON_CERR_SEMI_CLK_EN (0x0200)
@@ -124,9 +112,7 @@
124#define U300_SYSCON_CERR_AAIF_CLK_EN (0x0001) 112#define U300_SYSCON_CERR_AAIF_CLK_EN (0x0001)
125/* Single block clock enable 16bit (-/W) */ 113/* Single block clock enable 16bit (-/W) */
126#define U300_SYSCON_SBCER (0x002c) 114#define U300_SYSCON_SBCER (0x002c)
127#ifdef CONFIG_MACH_U300_BS335
128#define U300_SYSCON_SBCER_PPM_CLK_EN (0x0009) 115#define U300_SYSCON_SBCER_PPM_CLK_EN (0x0009)
129#endif
130#define U300_SYSCON_SBCER_ACC_TMR_CLK_EN (0x0008) 116#define U300_SYSCON_SBCER_ACC_TMR_CLK_EN (0x0008)
131#define U300_SYSCON_SBCER_APP_TMR_CLK_EN (0x0007) 117#define U300_SYSCON_SBCER_APP_TMR_CLK_EN (0x0007)
132#define U300_SYSCON_SBCER_KEYPAD_CLK_EN (0x0006) 118#define U300_SYSCON_SBCER_KEYPAD_CLK_EN (0x0006)
@@ -135,9 +121,7 @@
135#define U300_SYSCON_SBCER_BTR_CLK_EN (0x0002) 121#define U300_SYSCON_SBCER_BTR_CLK_EN (0x0002)
136#define U300_SYSCON_SBCER_UART_CLK_EN (0x0001) 122#define U300_SYSCON_SBCER_UART_CLK_EN (0x0001)
137#define U300_SYSCON_SBCER_SLOW_BRIDGE_CLK_EN (0x0000) 123#define U300_SYSCON_SBCER_SLOW_BRIDGE_CLK_EN (0x0000)
138#ifdef CONFIG_MACH_U300_BS335
139#define U300_SYSCON_SBCER_UART1_CLK_EN (0x0019) 124#define U300_SYSCON_SBCER_UART1_CLK_EN (0x0019)
140#endif
141#define U300_SYSCON_SBCER_I2S1_CORE_CLK_EN (0x0018) 125#define U300_SYSCON_SBCER_I2S1_CORE_CLK_EN (0x0018)
142#define U300_SYSCON_SBCER_I2S0_CORE_CLK_EN (0x0017) 126#define U300_SYSCON_SBCER_I2S0_CORE_CLK_EN (0x0017)
143#define U300_SYSCON_SBCER_SPI_CLK_EN (0x0016) 127#define U300_SYSCON_SBCER_SPI_CLK_EN (0x0016)
@@ -147,10 +131,8 @@
147#define U300_SYSCON_SBCER_I2C1_CLK_EN (0x0012) 131#define U300_SYSCON_SBCER_I2C1_CLK_EN (0x0012)
148#define U300_SYSCON_SBCER_I2C0_CLK_EN (0x0011) 132#define U300_SYSCON_SBCER_I2C0_CLK_EN (0x0011)
149#define U300_SYSCON_SBCER_FAST_BRIDGE_CLK_EN (0x0010) 133#define U300_SYSCON_SBCER_FAST_BRIDGE_CLK_EN (0x0010)
150#ifdef CONFIG_MACH_U300_BS335
151#define U300_SYSCON_SBCER_CDS_CLK_EN (0x002D) 134#define U300_SYSCON_SBCER_CDS_CLK_EN (0x002D)
152#define U300_SYSCON_SBCER_ISP_CLK_EN (0x002C) 135#define U300_SYSCON_SBCER_ISP_CLK_EN (0x002C)
153#endif
154#define U300_SYSCON_SBCER_MSPRO_CLK_EN (0x002B) 136#define U300_SYSCON_SBCER_MSPRO_CLK_EN (0x002B)
155#define U300_SYSCON_SBCER_AHB_SUBSYS_BRIDGE_CLK_EN (0x002A) 137#define U300_SYSCON_SBCER_AHB_SUBSYS_BRIDGE_CLK_EN (0x002A)
156#define U300_SYSCON_SBCER_SEMI_CLK_EN (0x0029) 138#define U300_SYSCON_SBCER_SEMI_CLK_EN (0x0029)
@@ -168,9 +150,7 @@
168/* Same values as above for SBCER */ 150/* Same values as above for SBCER */
169/* Clock force SLOW peripherals 16bit (R/W) */ 151/* Clock force SLOW peripherals 16bit (R/W) */
170#define U300_SYSCON_CFSR (0x003c) 152#define U300_SYSCON_CFSR (0x003c)
171#ifdef CONFIG_MACH_U300_BS335
172#define U300_SYSCON_CFSR_PPM_CLK_FORCE_EN (0x0200) 153#define U300_SYSCON_CFSR_PPM_CLK_FORCE_EN (0x0200)
173#endif
174#define U300_SYSCON_CFSR_ACC_TMR_CLK_FORCE_EN (0x0100) 154#define U300_SYSCON_CFSR_ACC_TMR_CLK_FORCE_EN (0x0100)
175#define U300_SYSCON_CFSR_APP_TMR_CLK_FORCE_EN (0x0080) 155#define U300_SYSCON_CFSR_APP_TMR_CLK_FORCE_EN (0x0080)
176#define U300_SYSCON_CFSR_KEYPAD_CLK_FORCE_EN (0x0020) 156#define U300_SYSCON_CFSR_KEYPAD_CLK_FORCE_EN (0x0020)
@@ -184,10 +164,8 @@
184/* Values not defined. Define if you want to use them. */ 164/* Values not defined. Define if you want to use them. */
185/* Clock force the rest of the peripherals 16bit (R/W) */ 165/* Clock force the rest of the peripherals 16bit (R/W) */
186#define U300_SYSCON_CFRR (0x44) 166#define U300_SYSCON_CFRR (0x44)
187#ifdef CONFIG_MACH_U300_BS335
188#define U300_SYSCON_CFRR_CDS_CLK_FORCE_EN (0x2000) 167#define U300_SYSCON_CFRR_CDS_CLK_FORCE_EN (0x2000)
189#define U300_SYSCON_CFRR_ISP_CLK_FORCE_EN (0x1000) 168#define U300_SYSCON_CFRR_ISP_CLK_FORCE_EN (0x1000)
190#endif
191#define U300_SYSCON_CFRR_MSPRO_CLK_FORCE_EN (0x0800) 169#define U300_SYSCON_CFRR_MSPRO_CLK_FORCE_EN (0x0800)
192#define U300_SYSCON_CFRR_AHB_SUBSYS_BRIDGE_CLK_FORCE_EN (0x0400) 170#define U300_SYSCON_CFRR_AHB_SUBSYS_BRIDGE_CLK_FORCE_EN (0x0400)
193#define U300_SYSCON_CFRR_SEMI_CLK_FORCE_EN (0x0200) 171#define U300_SYSCON_CFRR_SEMI_CLK_FORCE_EN (0x0200)
diff --git a/arch/arm/mach-u300/include/mach/u300-regs.h b/arch/arm/mach-u300/include/mach/u300-regs.h
index 65f87c52389..1e49d901f2c 100644
--- a/arch/arm/mach-u300/include/mach/u300-regs.h
+++ b/arch/arm/mach-u300/include/mach/u300-regs.h
@@ -28,7 +28,6 @@
28#define PLAT_NAND_CLE (1 << 16) 28#define PLAT_NAND_CLE (1 << 16)
29#define PLAT_NAND_ALE (1 << 17) 29#define PLAT_NAND_ALE (1 << 17)
30 30
31
32/* AHB Peripherals */ 31/* AHB Peripherals */
33#define U300_AHB_PER_PHYS_BASE 0xa0000000 32#define U300_AHB_PER_PHYS_BASE 0xa0000000
34#define U300_AHB_PER_VIRT_BASE 0xff010000 33#define U300_AHB_PER_VIRT_BASE 0xff010000
@@ -46,11 +45,7 @@
46#define U300_BOOTROM_VIRT_BASE 0xffff0000 45#define U300_BOOTROM_VIRT_BASE 0xffff0000
47 46
48/* SEMI config base */ 47/* SEMI config base */
49#ifdef CONFIG_MACH_U300_BS335
50#define U300_SEMI_CONFIG_BASE 0x2FFE0000 48#define U300_SEMI_CONFIG_BASE 0x2FFE0000
51#else
52#define U300_SEMI_CONFIG_BASE 0x30000000
53#endif
54 49
55/* 50/*
56 * AHB peripherals 51 * AHB peripherals
@@ -99,10 +94,8 @@
99/* SPI controller */ 94/* SPI controller */
100#define U300_SPI_BASE (U300_FAST_PER_PHYS_BASE+0x6000) 95#define U300_SPI_BASE (U300_FAST_PER_PHYS_BASE+0x6000)
101 96
102#ifdef CONFIG_MACH_U300_BS335
103/* Fast UART1 on U335 only */ 97/* Fast UART1 on U335 only */
104#define U300_UART1_BASE (U300_SLOW_PER_PHYS_BASE+0x7000) 98#define U300_UART1_BASE (U300_SLOW_PER_PHYS_BASE+0x7000)
105#endif
106 99
107/* 100/*
108 * SLOW peripherals 101 * SLOW peripherals
@@ -151,10 +144,8 @@
151 * REST peripherals 144 * REST peripherals
152 */ 145 */
153 146
154/* ISP (image signal processor) is only available in U335 */ 147/* ISP (image signal processor) */
155#ifdef CONFIG_MACH_U300_BS335
156#define U300_ISP_BASE (0xA0008000) 148#define U300_ISP_BASE (0xA0008000)
157#endif
158 149
159/* DMA Controller base */ 150/* DMA Controller base */
160#define U300_DMAC_BASE (0xC0020000) 151#define U300_DMAC_BASE (0xC0020000)
@@ -166,17 +157,9 @@
166#define U300_APEX_BASE (0xc0030000) 157#define U300_APEX_BASE (0xc0030000)
167 158
168/* Video Encoder Base */ 159/* Video Encoder Base */
169#ifdef CONFIG_MACH_U300_BS335
170#define U300_VIDEOENC_BASE (0xc0080000) 160#define U300_VIDEOENC_BASE (0xc0080000)
171#else
172#define U300_VIDEOENC_BASE (0xc0040000)
173#endif
174 161
175/* XGAM Base */ 162/* XGAM Base */
176#define U300_XGAM_BASE (0xd0000000) 163#define U300_XGAM_BASE (0xd0000000)
177 164
178/*
179 * Virtual accessor macros for static devices
180 */
181
182#endif 165#endif
diff --git a/arch/arm/mach-u300/spi.c b/arch/arm/mach-u300/spi.c
index a1affacfa59..02e6659286d 100644
--- a/arch/arm/mach-u300/spi.c
+++ b/arch/arm/mach-u300/spi.c
@@ -12,7 +12,7 @@
12#include <linux/amba/pl022.h> 12#include <linux/amba/pl022.h>
13#include <linux/err.h> 13#include <linux/err.h>
14#include <mach/coh901318.h> 14#include <mach/coh901318.h>
15#include <mach/dma_channels.h> 15#include "dma_channels.h"
16 16
17/* 17/*
18 * The following is for the actual devices on the SSP/SPI bus 18 * 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 56ac06d38ec..1da10e20e99 100644
--- a/arch/arm/mach-u300/timer.c
+++ b/arch/arm/mach-u300/timer.c
@@ -17,14 +17,17 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/irq.h>
20 21
21#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <mach/irqs.h>
22 24
23/* Generic stuff */ 25/* Generic stuff */
24#include <asm/sched_clock.h> 26#include <asm/sched_clock.h>
25#include <asm/mach/map.h> 27#include <asm/mach/map.h>
26#include <asm/mach/time.h> 28#include <asm/mach/time.h>
27#include <asm/mach/irq.h> 29
30#include "timer.h"
28 31
29/* 32/*
30 * APP side special timer registers 33 * APP side special timer registers
diff --git a/arch/arm/mach-u300/timer.h b/arch/arm/mach-u300/timer.h
new file mode 100644
index 00000000000..b5e9791762e
--- /dev/null
+++ b/arch/arm/mach-u300/timer.h
@@ -0,0 +1 @@
extern struct sys_timer u300_timer;
diff --git a/arch/arm/mach-u300/u300-gpio.h b/arch/arm/mach-u300/u300-gpio.h
index 847dc25300c..83f50772e16 100644
--- a/arch/arm/mach-u300/u300-gpio.h
+++ b/arch/arm/mach-u300/u300-gpio.h
@@ -1,50 +1,11 @@
1/* 1/*
2 * Individual pin assignments for the B26/S26. Notice that the 2 * Individual pin assignments for the B335/S335.
3 * actual usage of these pins depends on the PAD MUX settings, that
4 * is why the same number can potentially appear several times.
5 * In the reference design each pin is only used for one purpose.
6 * These were determined by inspecting the B26/S26 schematic:
7 * 2/1911-ROA 128 1603
8 */
9#ifdef CONFIG_MACH_U300_BS2X
10#define U300_GPIO_PIN_UART_RX 0
11#define U300_GPIO_PIN_UART_TX 1
12#define U300_GPIO_PIN_GPIO02 2 /* Unrouted */
13#define U300_GPIO_PIN_GPIO03 3 /* Unrouted */
14#define U300_GPIO_PIN_CAM_SLEEP 4
15#define U300_GPIO_PIN_CAM_REG_EN 5
16#define U300_GPIO_PIN_GPIO06 6 /* Unrouted */
17#define U300_GPIO_PIN_GPIO07 7 /* Unrouted */
18
19#define U300_GPIO_PIN_GPIO08 8 /* Service point SP2321 */
20#define U300_GPIO_PIN_GPIO09 9 /* Service point SP2322 */
21#define U300_GPIO_PIN_PHFSENSE 10 /* Headphone jack sensing */
22#define U300_GPIO_PIN_MMC_CLKRET 11 /* Clock return from MMC/SD card */
23#define U300_GPIO_PIN_MMC_CD 12 /* MMC Card insertion detection */
24#define U300_GPIO_PIN_FLIPSENSE 13 /* Mechanical flip sensing */
25#define U300_GPIO_PIN_GPIO14 14 /* DSP JTAG Port RTCK */
26#define U300_GPIO_PIN_GPIO15 15 /* Unrouted */
27
28#define U300_GPIO_PIN_GPIO16 16 /* Unrouted */
29#define U300_GPIO_PIN_GPIO17 17 /* Unrouted */
30#define U300_GPIO_PIN_GPIO18 18 /* Unrouted */
31#define U300_GPIO_PIN_GPIO19 19 /* Unrouted */
32#define U300_GPIO_PIN_GPIO20 20 /* Unrouted */
33#define U300_GPIO_PIN_GPIO21 21 /* Unrouted */
34#define U300_GPIO_PIN_GPIO22 22 /* Unrouted */
35#define U300_GPIO_PIN_GPIO23 23 /* Unrouted */
36#endif
37
38/*
39 * Individual pin assignments for the B330/S330 and B365/S365.
40 * Notice that the actual usage of these pins depends on the 3 * Notice that the actual usage of these pins depends on the
41 * PAD MUX settings, that is why the same number can potentially 4 * PAD MUX settings, that is why the same number can potentially
42 * appear several times. In the reference design each pin is only 5 * appear several times. In the reference design each pin is only
43 * used for one purpose. These were determined by inspecting the 6 * used for one purpose. These were determined by inspecting the
44 * S365 schematic. 7 * S365 schematic.
45 */ 8 */
46#if defined(CONFIG_MACH_U300_BS330) || defined(CONFIG_MACH_U300_BS365) || \
47 defined(CONFIG_MACH_U300_BS335)
48#define U300_GPIO_PIN_UART_RX 0 9#define U300_GPIO_PIN_UART_RX 0
49#define U300_GPIO_PIN_UART_TX 1 10#define U300_GPIO_PIN_UART_TX 1
50#define U300_GPIO_PIN_UART_CTS 2 11#define U300_GPIO_PIN_UART_CTS 2
@@ -90,8 +51,6 @@
90#define U300_GPIO_PIN_GPIO38 38 /* Unrouted */ 51#define U300_GPIO_PIN_GPIO38 38 /* Unrouted */
91#define U300_GPIO_PIN_GPIO39 39 /* Unrouted */ 52#define U300_GPIO_PIN_GPIO39 39 /* Unrouted */
92 53
93#ifdef CONFIG_MACH_U300_BS335
94
95#define U300_GPIO_PIN_GPIO40 40 /* Unrouted */ 54#define U300_GPIO_PIN_GPIO40 40 /* Unrouted */
96#define U300_GPIO_PIN_GPIO41 41 /* Unrouted */ 55#define U300_GPIO_PIN_GPIO41 41 /* Unrouted */
97#define U300_GPIO_PIN_GPIO42 42 /* Unrouted */ 56#define U300_GPIO_PIN_GPIO42 42 /* Unrouted */
@@ -109,6 +68,3 @@
109#define U300_GPIO_PIN_GPIO53 53 /* Unrouted */ 68#define U300_GPIO_PIN_GPIO53 53 /* Unrouted */
110#define U300_GPIO_PIN_GPIO54 54 /* Unrouted */ 69#define U300_GPIO_PIN_GPIO54 54 /* Unrouted */
111#define U300_GPIO_PIN_GPIO55 55 /* Unrouted */ 70#define U300_GPIO_PIN_GPIO55 55 /* Unrouted */
112#endif
113
114#endif
diff --git a/arch/arm/mach-u300/u300.c b/arch/arm/mach-u300/u300.c
deleted file mode 100644
index f30c69d91d9..00000000000
--- a/arch/arm/mach-u300/u300.c
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 *
3 * arch/arm/mach-u300/u300.c
4 *
5 *
6 * Copyright (C) 2006-2009 ST-Ericsson AB
7 * License terms: GNU General Public License (GPL) version 2
8 * Platform machine definition.
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 */
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/mm.h>
14#include <linux/sched.h>
15#include <linux/interrupt.h>
16#include <linux/ioport.h>
17#include <linux/memblock.h>
18#include <linux/platform_device.h>
19#include <linux/io.h>
20#include <mach/hardware.h>
21#include <mach/platform.h>
22#include <asm/hardware/vic.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25#include <asm/memory.h>
26
27static void __init u300_init_machine(void)
28{
29 u300_init_devices();
30}
31
32#ifdef CONFIG_MACH_U300_BS2X
33#define MACH_U300_STRING "Ericsson AB U300 S25/S26/B25/B26 Prototype Board"
34#endif
35
36#ifdef CONFIG_MACH_U300_BS330
37#define MACH_U300_STRING "Ericsson AB U330 S330/B330 Prototype Board"
38#endif
39
40#ifdef CONFIG_MACH_U300_BS335
41#define MACH_U300_STRING "Ericsson AB U335 S335/B335 Prototype Board"
42#endif
43
44#ifdef CONFIG_MACH_U300_BS365
45#define MACH_U300_STRING "Ericsson AB U365 S365/B365 Prototype Board"
46#endif
47
48MACHINE_START(U300, MACH_U300_STRING)
49 /* Maintainer: Linus Walleij <linus.walleij@stericsson.com> */
50 .atag_offset = 0x100,
51 .map_io = u300_map_io,
52 .init_irq = u300_init_irq,
53 .handle_irq = vic_handle_irq,
54 .timer = &u300_timer,
55 .init_machine = u300_init_machine,
56 .restart = u300_restart,
57MACHINE_END
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index 53d3d46dec1..e8c3f0d70ca 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -3,31 +3,33 @@ if ARCH_U8500
3config UX500_SOC_COMMON 3config UX500_SOC_COMMON
4 bool 4 bool
5 default y 5 default y
6 select ARM_GIC
7 select HAS_MTU
8 select PL310_ERRATA_753970
9 select ARM_ERRATA_754322 6 select ARM_ERRATA_754322
10 select ARM_ERRATA_764369 7 select ARM_ERRATA_764369 if SMP
8 select ARM_GIC
11 select CACHE_L2X0 9 select CACHE_L2X0
10 select COMMON_CLK
11 select HAS_MTU
12 select PINCTRL 12 select PINCTRL
13 select PINCTRL_NOMADIK 13 select PINCTRL_NOMADIK
14 select PL310_ERRATA_753970 if CACHE_PL310
14 15
15config UX500_SOC_DB8500 16config UX500_SOC_DB8500
16 bool 17 bool
18 select CPU_FREQ_TABLE if CPU_FREQ
17 select MFD_DB8500_PRCMU 19 select MFD_DB8500_PRCMU
20 select PINCTRL_DB8500
18 select REGULATOR 21 select REGULATOR
19 select REGULATOR_DB8500_PRCMU 22 select REGULATOR_DB8500_PRCMU
20 select CPU_FREQ_TABLE if CPU_FREQ
21 select PINCTRL_DB8500
22 23
23menu "Ux500 target platform (boards)" 24menu "Ux500 target platform (boards)"
24 25
25config MACH_MOP500 26config MACH_MOP500
26 bool "U8500 Development platform, MOP500 versions" 27 bool "U8500 Development platform, MOP500 versions"
27 select UX500_SOC_DB8500
28 select I2C 28 select I2C
29 select I2C_NOMADIK 29 select I2C_NOMADIK
30 select REGULATOR_FIXED_VOLTAGE
30 select SOC_BUS 31 select SOC_BUS
32 select UX500_SOC_DB8500
31 help 33 help
32 Include support for the MOP500 development platform. 34 Include support for the MOP500 development platform.
33 35
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index 026086ff9e6..f24710dfc39 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel, U8500 machine. 2# Makefile for the linux kernel, U8500 machine.
3# 3#
4 4
5obj-y := clock.o cpu.o devices.o devices-common.o \ 5obj-y := cpu.o devices.o devices-common.o \
6 id.o usb.o timer.o 6 id.o usb.o timer.o
7obj-$(CONFIG_CPU_IDLE) += cpuidle.o 7obj-$(CONFIG_CPU_IDLE) += cpuidle.o
8obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o 8obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
@@ -12,6 +12,6 @@ obj-$(CONFIG_MACH_MOP500) += board-mop500.o board-mop500-sdi.o \
12 board-mop500-uib.o board-mop500-stuib.o \ 12 board-mop500-uib.o board-mop500-stuib.o \
13 board-mop500-u8500uib.o \ 13 board-mop500-u8500uib.o \
14 board-mop500-pins.o \ 14 board-mop500-pins.o \
15 board-mop500-msp.o 15 board-mop500-audio.o
16obj-$(CONFIG_SMP) += platsmp.o headsmp.o 16obj-$(CONFIG_SMP) += platsmp.o headsmp.o
17obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 17obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
diff --git a/arch/arm/mach-ux500/Makefile.boot b/arch/arm/mach-ux500/Makefile.boot
index dd5cd00e255..760a0efe758 100644
--- a/arch/arm/mach-ux500/Makefile.boot
+++ b/arch/arm/mach-ux500/Makefile.boot
@@ -1,5 +1,3 @@
1 zreladdr-y += 0x00008000 1 zreladdr-y += 0x00008000
2params_phys-y := 0x00000100 2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000 3initrd_phys-y := 0x00800000
4
5dtb-$(CONFIG_MACH_SNOWBALL) += snowball.dtb
diff --git a/arch/arm/mach-ux500/board-mop500-msp.c b/arch/arm/mach-ux500/board-mop500-audio.c
index df15646036a..070629a9562 100644
--- a/arch/arm/mach-ux500/board-mop500-msp.c
+++ b/arch/arm/mach-ux500/board-mop500-audio.c
@@ -7,7 +7,6 @@
7#include <linux/platform_device.h> 7#include <linux/platform_device.h>
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/gpio.h> 9#include <linux/gpio.h>
10#include <linux/pinctrl/consumer.h>
11 10
12#include <plat/gpio-nomadik.h> 11#include <plat/gpio-nomadik.h>
13#include <plat/pincfg.h> 12#include <plat/pincfg.h>
@@ -23,53 +22,6 @@
23#include "devices-db8500.h" 22#include "devices-db8500.h"
24#include "pins-db8500.h" 23#include "pins-db8500.h"
25 24
26/* MSP1/3 Tx/Rx usage protection */
27static DEFINE_SPINLOCK(msp_rxtx_lock);
28
29/* Reference Count */
30static int msp_rxtx_ref;
31
32/* Pin modes */
33struct pinctrl *msp1_p;
34struct pinctrl_state *msp1_def;
35struct pinctrl_state *msp1_sleep;
36
37int msp13_i2s_init(void)
38{
39 int retval = 0;
40 unsigned long flags;
41
42 spin_lock_irqsave(&msp_rxtx_lock, flags);
43 if (msp_rxtx_ref == 0 && !(IS_ERR(msp1_p) || IS_ERR(msp1_def))) {
44 retval = pinctrl_select_state(msp1_p, msp1_def);
45 if (retval)
46 pr_err("could not set MSP1 defstate\n");
47 }
48 if (!retval)
49 msp_rxtx_ref++;
50 spin_unlock_irqrestore(&msp_rxtx_lock, flags);
51
52 return retval;
53}
54
55int msp13_i2s_exit(void)
56{
57 int retval = 0;
58 unsigned long flags;
59
60 spin_lock_irqsave(&msp_rxtx_lock, flags);
61 WARN_ON(!msp_rxtx_ref);
62 msp_rxtx_ref--;
63 if (msp_rxtx_ref == 0 && !(IS_ERR(msp1_p) || IS_ERR(msp1_sleep))) {
64 retval = pinctrl_select_state(msp1_p, msp1_sleep);
65 if (retval)
66 pr_err("could not set MSP1 sleepstate\n");
67 }
68 spin_unlock_irqrestore(&msp_rxtx_lock, flags);
69
70 return retval;
71}
72
73static struct stedma40_chan_cfg msp0_dma_rx = { 25static struct stedma40_chan_cfg msp0_dma_rx = {
74 .high_priority = true, 26 .high_priority = true,
75 .dir = STEDMA40_PERIPH_TO_MEM, 27 .dir = STEDMA40_PERIPH_TO_MEM,
@@ -96,7 +48,7 @@ static struct stedma40_chan_cfg msp0_dma_tx = {
96 /* data_width is set during configuration */ 48 /* data_width is set during configuration */
97}; 49};
98 50
99static struct msp_i2s_platform_data msp0_platform_data = { 51struct msp_i2s_platform_data msp0_platform_data = {
100 .id = MSP_I2S_0, 52 .id = MSP_I2S_0,
101 .msp_i2s_dma_rx = &msp0_dma_rx, 53 .msp_i2s_dma_rx = &msp0_dma_rx,
102 .msp_i2s_dma_tx = &msp0_dma_tx, 54 .msp_i2s_dma_tx = &msp0_dma_tx,
@@ -128,12 +80,10 @@ static struct stedma40_chan_cfg msp1_dma_tx = {
128 /* data_width is set during configuration */ 80 /* data_width is set during configuration */
129}; 81};
130 82
131static struct msp_i2s_platform_data msp1_platform_data = { 83struct msp_i2s_platform_data msp1_platform_data = {
132 .id = MSP_I2S_1, 84 .id = MSP_I2S_1,
133 .msp_i2s_dma_rx = NULL, 85 .msp_i2s_dma_rx = NULL,
134 .msp_i2s_dma_tx = &msp1_dma_tx, 86 .msp_i2s_dma_tx = &msp1_dma_tx,
135 .msp_i2s_init = msp13_i2s_init,
136 .msp_i2s_exit = msp13_i2s_exit,
137}; 87};
138 88
139static struct stedma40_chan_cfg msp2_dma_rx = { 89static struct stedma40_chan_cfg msp2_dma_rx = {
@@ -193,11 +143,11 @@ static struct platform_device *db8500_add_msp_i2s(struct device *parent,
193 143
194/* Platform device for ASoC MOP500 machine */ 144/* Platform device for ASoC MOP500 machine */
195static struct platform_device snd_soc_mop500 = { 145static struct platform_device snd_soc_mop500 = {
196 .name = "snd-soc-mop500", 146 .name = "snd-soc-mop500",
197 .id = 0, 147 .id = 0,
198 .dev = { 148 .dev = {
199 .platform_data = NULL, 149 .platform_data = NULL,
200 }, 150 },
201}; 151};
202 152
203/* Platform device for Ux500-PCM */ 153/* Platform device for Ux500-PCM */
@@ -209,59 +159,37 @@ static struct platform_device ux500_pcm = {
209 }, 159 },
210}; 160};
211 161
212static struct msp_i2s_platform_data msp2_platform_data = { 162struct msp_i2s_platform_data msp2_platform_data = {
213 .id = MSP_I2S_2, 163 .id = MSP_I2S_2,
214 .msp_i2s_dma_rx = &msp2_dma_rx, 164 .msp_i2s_dma_rx = &msp2_dma_rx,
215 .msp_i2s_dma_tx = &msp2_dma_tx, 165 .msp_i2s_dma_tx = &msp2_dma_tx,
216}; 166};
217 167
218static struct msp_i2s_platform_data msp3_platform_data = { 168struct msp_i2s_platform_data msp3_platform_data = {
219 .id = MSP_I2S_3, 169 .id = MSP_I2S_3,
220 .msp_i2s_dma_rx = &msp1_dma_rx, 170 .msp_i2s_dma_rx = &msp1_dma_rx,
221 .msp_i2s_dma_tx = NULL, 171 .msp_i2s_dma_tx = NULL,
222 .msp_i2s_init = msp13_i2s_init,
223 .msp_i2s_exit = msp13_i2s_exit,
224}; 172};
225 173
226int mop500_msp_init(struct device *parent) 174void mop500_audio_init(struct device *parent)
227{ 175{
228 struct platform_device *msp1;
229
230 pr_info("%s: Register platform-device 'snd-soc-mop500'.\n", __func__); 176 pr_info("%s: Register platform-device 'snd-soc-mop500'.\n", __func__);
231 platform_device_register(&snd_soc_mop500); 177 platform_device_register(&snd_soc_mop500);
232 178
233 pr_info("Initialize MSP I2S-devices.\n"); 179 pr_info("Initialize MSP I2S-devices.\n");
234 db8500_add_msp_i2s(parent, 0, U8500_MSP0_BASE, IRQ_DB8500_MSP0, 180 db8500_add_msp_i2s(parent, 0, U8500_MSP0_BASE, IRQ_DB8500_MSP0,
235 &msp0_platform_data); 181 &msp0_platform_data);
236 msp1 = db8500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1, 182 db8500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1,
237 &msp1_platform_data); 183 &msp1_platform_data);
238 db8500_add_msp_i2s(parent, 2, U8500_MSP2_BASE, IRQ_DB8500_MSP2, 184 db8500_add_msp_i2s(parent, 2, U8500_MSP2_BASE, IRQ_DB8500_MSP2,
239 &msp2_platform_data); 185 &msp2_platform_data);
240 db8500_add_msp_i2s(parent, 3, U8500_MSP3_BASE, IRQ_DB8500_MSP1, 186 db8500_add_msp_i2s(parent, 3, U8500_MSP3_BASE, IRQ_DB8500_MSP1,
241 &msp3_platform_data); 187 &msp3_platform_data);
188}
242 189
243 /* Get the pinctrl handle for MSP1 */ 190/* Due for removal once the MSP driver has been fully DT:ed. */
244 if (msp1) { 191void mop500_of_audio_init(struct device *parent)
245 msp1_p = pinctrl_get(&msp1->dev); 192{
246 if (IS_ERR(msp1_p))
247 dev_err(&msp1->dev, "could not get MSP1 pinctrl\n");
248 else {
249 msp1_def = pinctrl_lookup_state(msp1_p,
250 PINCTRL_STATE_DEFAULT);
251 if (IS_ERR(msp1_def)) {
252 dev_err(&msp1->dev,
253 "could not get MSP1 defstate\n");
254 }
255 msp1_sleep = pinctrl_lookup_state(msp1_p,
256 PINCTRL_STATE_SLEEP);
257 if (IS_ERR(msp1_sleep))
258 dev_err(&msp1->dev,
259 "could not get MSP1 idlestate\n");
260 }
261 }
262
263 pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__); 193 pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__);
264 platform_device_register(&ux500_pcm); 194 platform_device_register(&ux500_pcm);
265
266 return 0;
267} 195}
diff --git a/arch/arm/mach-ux500/board-mop500-msp.h b/arch/arm/mach-ux500/board-mop500-msp.h
deleted file mode 100644
index 6fcfb5e2cc9..00000000000
--- a/arch/arm/mach-ux500/board-mop500-msp.h
+++ /dev/null
@@ -1,14 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2012
3 *
4 * Author: Ola Lilja <ola.o.lilja@stericsson.com>,
5 * for ST-Ericsson.
6 *
7 * License terms:
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 published
11 * by the Free Software Foundation.
12 */
13
14void mop500_msp_init(struct device *parent);
diff --git a/arch/arm/mach-ux500/board-mop500-pins.c b/arch/arm/mach-ux500/board-mop500-pins.c
index 32fd9920446..a267c6d30e3 100644
--- a/arch/arm/mach-ux500/board-mop500-pins.c
+++ b/arch/arm/mach-ux500/board-mop500-pins.c
@@ -30,16 +30,15 @@ static enum custom_pin_cfg_t pinsfor;
30#define BIAS(a,b) static unsigned long a[] = { b } 30#define BIAS(a,b) static unsigned long a[] = { b }
31 31
32BIAS(pd, PIN_PULL_DOWN); 32BIAS(pd, PIN_PULL_DOWN);
33BIAS(slpm_gpio_nopull, PIN_SLPM_GPIO|PIN_SLPM_INPUT_NOPULL);
34BIAS(in_nopull, PIN_INPUT_NOPULL); 33BIAS(in_nopull, PIN_INPUT_NOPULL);
35BIAS(in_nopull_sleep_nowkup, PIN_INPUT_NOPULL|PIN_SLPM_WAKEUP_DISABLE); 34BIAS(in_nopull_slpm_nowkup, PIN_INPUT_NOPULL|PIN_SLPM_WAKEUP_DISABLE);
36BIAS(in_pu, PIN_INPUT_PULLUP); 35BIAS(in_pu, PIN_INPUT_PULLUP);
37BIAS(in_pd, PIN_INPUT_PULLDOWN); 36BIAS(in_pd, PIN_INPUT_PULLDOWN);
38BIAS(in_pd_slpm_in_pu, PIN_INPUT_PULLDOWN|PIN_SLPM_INPUT_PULLUP); 37BIAS(in_pd_slpm_in_pu, PIN_INPUT_PULLDOWN|PIN_SLPM_INPUT_PULLUP);
39BIAS(in_pu_slpm_out_lo, PIN_INPUT_PULLUP|PIN_SLPM_OUTPUT_LOW); 38BIAS(in_pu_slpm_out_lo, PIN_INPUT_PULLUP|PIN_SLPM_OUTPUT_LOW);
40BIAS(out_hi, PIN_OUTPUT_HIGH); 39BIAS(out_hi, PIN_OUTPUT_HIGH);
41BIAS(out_lo, PIN_OUTPUT_LOW); 40BIAS(out_lo, PIN_OUTPUT_LOW);
42BIAS(out_lo_sleep_nowkup, PIN_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE); 41BIAS(out_lo_slpm_nowkup, PIN_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE);
43/* These also force them into GPIO mode */ 42/* These also force them into GPIO mode */
44BIAS(gpio_in_pu, PIN_INPUT_PULLUP|PIN_GPIOMODE_ENABLED); 43BIAS(gpio_in_pu, PIN_INPUT_PULLUP|PIN_GPIOMODE_ENABLED);
45BIAS(gpio_in_pd, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED); 44BIAS(gpio_in_pd, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED);
@@ -48,23 +47,32 @@ BIAS(gpio_in_pd_slpm_gpio_nopull, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED|PIN_SL
48BIAS(gpio_out_hi, PIN_OUTPUT_HIGH|PIN_GPIOMODE_ENABLED); 47BIAS(gpio_out_hi, PIN_OUTPUT_HIGH|PIN_GPIOMODE_ENABLED);
49BIAS(gpio_out_lo, PIN_OUTPUT_LOW|PIN_GPIOMODE_ENABLED); 48BIAS(gpio_out_lo, PIN_OUTPUT_LOW|PIN_GPIOMODE_ENABLED);
50/* Sleep modes */ 49/* Sleep modes */
51BIAS(sleep_in_wkup_pdis, PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); 50BIAS(slpm_in_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
52BIAS(sleep_in_nopull_wkup, PIN_INPUT_NOPULL|PIN_SLPM_WAKEUP_ENABLE); 51BIAS(slpm_in_nopull_wkup, PIN_SLEEPMODE_ENABLED|PIN_SLPM_DIR_INPUT|PIN_SLPM_PULL_NONE|PIN_SLPM_WAKEUP_ENABLE);
53BIAS(sleep_out_hi_wkup_pdis, PIN_SLPM_OUTPUT_HIGH|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); 52BIAS(slpm_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
54BIAS(sleep_out_lo_wkup, PIN_OUTPUT_LOW|PIN_SLPM_WAKEUP_ENABLE); 53BIAS(slpm_out_hi_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_OUTPUT_HIGH|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
55BIAS(sleep_out_wkup_pdis, PIN_SLPM_DIR_OUTPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); 54BIAS(slpm_out_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
55BIAS(slpm_out_lo_wkup, PIN_SLEEPMODE_ENABLED|PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_ENABLE);
56BIAS(slpm_out_lo_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
57BIAS(slpm_in_nopull_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_INPUT_NOPULL|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED);
56 58
57/* We use these to define hog settings that are always done on boot */ 59/* We use these to define hog settings that are always done on boot */
58#define DB8500_MUX_HOG(group,func) \ 60#define DB8500_MUX_HOG(group,func) \
59 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-db8500", group, func) 61 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-db8500", group, func)
60#define DB8500_PIN_HOG(pin,conf) \ 62#define DB8500_PIN_HOG(pin,conf) \
61 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-db8500", pin, conf) 63 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-db8500", pin, conf)
64#define DB8500_PIN_SLEEP(pin, conf, dev) \
65 PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \
66 pin, conf)
62 67
63/* These are default states associated with device and changed runtime */ 68/* These are default states associated with device and changed runtime */
64#define DB8500_MUX(group,func,dev) \ 69#define DB8500_MUX(group,func,dev) \
65 PIN_MAP_MUX_GROUP_DEFAULT(dev, "pinctrl-db8500", group, func) 70 PIN_MAP_MUX_GROUP_DEFAULT(dev, "pinctrl-db8500", group, func)
66#define DB8500_PIN(pin,conf,dev) \ 71#define DB8500_PIN(pin,conf,dev) \
67 PIN_MAP_CONFIGS_PIN_DEFAULT(dev, "pinctrl-db8500", pin, conf) 72 PIN_MAP_CONFIGS_PIN_DEFAULT(dev, "pinctrl-db8500", pin, conf)
73#define DB8500_PIN_SLEEP(pin, conf, dev) \
74 PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \
75 pin, conf)
68 76
69#define DB8500_PIN_SLEEP(pin,conf,dev) \ 77#define DB8500_PIN_SLEEP(pin,conf,dev) \
70 PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \ 78 PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \
@@ -134,40 +142,47 @@ static struct pinctrl_map __initdata mop500_family_pinmap[] = {
134 DB8500_PIN("GPIO2_AH4", in_pu, "uart0"), /* RXD */ 142 DB8500_PIN("GPIO2_AH4", in_pu, "uart0"), /* RXD */
135 DB8500_PIN("GPIO3_AH3", out_hi, "uart0"), /* TXD */ 143 DB8500_PIN("GPIO3_AH3", out_hi, "uart0"), /* TXD */
136 /* UART0 sleep state */ 144 /* UART0 sleep state */
137 DB8500_PIN_SLEEP("GPIO0_AJ5", sleep_in_wkup_pdis, "uart0"), 145 DB8500_PIN_SLEEP("GPIO0_AJ5", slpm_in_wkup_pdis, "uart0"),
138 DB8500_PIN_SLEEP("GPIO1_AJ3", sleep_out_hi_wkup_pdis, "uart0"), 146 DB8500_PIN_SLEEP("GPIO1_AJ3", slpm_out_hi_wkup_pdis, "uart0"),
139 DB8500_PIN_SLEEP("GPIO2_AH4", sleep_in_wkup_pdis, "uart0"), 147 DB8500_PIN_SLEEP("GPIO2_AH4", slpm_in_wkup_pdis, "uart0"),
140 DB8500_PIN_SLEEP("GPIO3_AH3", sleep_out_wkup_pdis, "uart0"), 148 DB8500_PIN_SLEEP("GPIO3_AH3", slpm_out_wkup_pdis, "uart0"),
141 /* MSP1 for ALSA codec */ 149 /* MSP1 for ALSA codec */
142 DB8500_MUX("msp1txrx_a_1", "msp1", "ux500-msp-i2s.1"), 150 DB8500_MUX("msp1txrx_a_1", "msp1", "ux500-msp-i2s.1"),
143 DB8500_MUX("msp1_a_1", "msp1", "ux500-msp-i2s.1"), 151 DB8500_MUX("msp1_a_1", "msp1", "ux500-msp-i2s.1"),
144 DB8500_PIN("GPIO33_AF2", out_lo_sleep_nowkup, "ux500-msp-i2s.1"), 152 DB8500_PIN("GPIO33_AF2", out_lo_slpm_nowkup, "ux500-msp-i2s.1"),
145 DB8500_PIN("GPIO34_AE1", in_nopull_sleep_nowkup, "ux500-msp-i2s.1"), 153 DB8500_PIN("GPIO34_AE1", in_nopull_slpm_nowkup, "ux500-msp-i2s.1"),
146 DB8500_PIN("GPIO35_AE2", in_nopull_sleep_nowkup, "ux500-msp-i2s.1"), 154 DB8500_PIN("GPIO35_AE2", in_nopull_slpm_nowkup, "ux500-msp-i2s.1"),
147 DB8500_PIN("GPIO36_AG2", in_nopull_sleep_nowkup, "ux500-msp-i2s.1"), 155 DB8500_PIN("GPIO36_AG2", in_nopull_slpm_nowkup, "ux500-msp-i2s.1"),
148 /* MSP1 sleep state */ 156 /* MSP1 sleep state */
149 DB8500_PIN_SLEEP("GPIO33_AF2", sleep_out_lo_wkup, "ux500-msp-i2s.1"), 157 DB8500_PIN_SLEEP("GPIO33_AF2", slpm_out_lo_wkup, "ux500-msp-i2s.1"),
150 DB8500_PIN_SLEEP("GPIO34_AE1", sleep_in_nopull_wkup, "ux500-msp-i2s.1"), 158 DB8500_PIN_SLEEP("GPIO34_AE1", slpm_in_nopull_wkup, "ux500-msp-i2s.1"),
151 DB8500_PIN_SLEEP("GPIO35_AE2", sleep_in_nopull_wkup, "ux500-msp-i2s.1"), 159 DB8500_PIN_SLEEP("GPIO35_AE2", slpm_in_nopull_wkup, "ux500-msp-i2s.1"),
152 DB8500_PIN_SLEEP("GPIO36_AG2", sleep_in_nopull_wkup, "ux500-msp-i2s.1"), 160 DB8500_PIN_SLEEP("GPIO36_AG2", slpm_in_nopull_wkup, "ux500-msp-i2s.1"),
153 /* Mux in LCD data lines 8 thru 11 and LCDA CLK for MCDE TVOUT */ 161 /* Mux in LCD data lines 8 thru 11 and LCDA CLK for MCDE TVOUT */
154 DB8500_MUX("lcd_d8_d11_a_1", "lcd", "mcde-tvout"), 162 DB8500_MUX("lcd_d8_d11_a_1", "lcd", "mcde-tvout"),
155 DB8500_MUX("lcdaclk_b_1", "lcda", "mcde-tvout"), 163 DB8500_MUX("lcdaclk_b_1", "lcda", "mcde-tvout"),
156 /* Mux in LCD VSI1 and pull it up for MCDE HDMI output */ 164 /* Mux in LCD VSI1 and pull it up for MCDE HDMI output */
157 DB8500_MUX("lcdvsi1_a_1", "lcd", "av8100-hdmi"), 165 DB8500_MUX("lcdvsi1_a_1", "lcd", "av8100-hdmi"),
158 /* Mux in I2C blocks, put pins into GPIO in sleepmode no pull-up */ 166 /* Mux in i2c0 block, default state */
159 DB8500_MUX("i2c0_a_1", "i2c0", "nmk-i2c.0"), 167 DB8500_MUX("i2c0_a_1", "i2c0", "nmk-i2c.0"),
160 DB8500_PIN("GPIO147_C15", slpm_gpio_nopull, "nmk-i2c.0"), 168 /* i2c0 sleep state */
161 DB8500_PIN("GPIO148_B16", slpm_gpio_nopull, "nmk-i2c.0"), 169 DB8500_PIN_SLEEP("GPIO147_C15", slpm_in_nopull_wkup_pdis, "nmk-i2c.0"), /* SDA */
170 DB8500_PIN_SLEEP("GPIO148_B16", slpm_in_nopull_wkup_pdis, "nmk-i2c.0"), /* SCL */
171 /* Mux in i2c1 block, default state */
162 DB8500_MUX("i2c1_b_2", "i2c1", "nmk-i2c.1"), 172 DB8500_MUX("i2c1_b_2", "i2c1", "nmk-i2c.1"),
163 DB8500_PIN("GPIO16_AD3", slpm_gpio_nopull, "nmk-i2c.1"), 173 /* i2c1 sleep state */
164 DB8500_PIN("GPIO17_AD4", slpm_gpio_nopull, "nmk-i2c.1"), 174 DB8500_PIN_SLEEP("GPIO16_AD3", slpm_in_nopull_wkup_pdis, "nmk-i2c.1"), /* SDA */
175 DB8500_PIN_SLEEP("GPIO17_AD4", slpm_in_nopull_wkup_pdis, "nmk-i2c.1"), /* SCL */
176 /* Mux in i2c2 block, default state */
165 DB8500_MUX("i2c2_b_2", "i2c2", "nmk-i2c.2"), 177 DB8500_MUX("i2c2_b_2", "i2c2", "nmk-i2c.2"),
166 DB8500_PIN("GPIO10_AF5", slpm_gpio_nopull, "nmk-i2c.2"), 178 /* i2c2 sleep state */
167 DB8500_PIN("GPIO11_AG4", slpm_gpio_nopull, "nmk-i2c.2"), 179 DB8500_PIN_SLEEP("GPIO10_AF5", slpm_in_nopull_wkup_pdis, "nmk-i2c.2"), /* SDA */
180 DB8500_PIN_SLEEP("GPIO11_AG4", slpm_in_nopull_wkup_pdis, "nmk-i2c.2"), /* SCL */
181 /* Mux in i2c3 block, default state */
168 DB8500_MUX("i2c3_c_2", "i2c3", "nmk-i2c.3"), 182 DB8500_MUX("i2c3_c_2", "i2c3", "nmk-i2c.3"),
169 DB8500_PIN("GPIO229_AG7", slpm_gpio_nopull, "nmk-i2c.3"), 183 /* i2c3 sleep state */
170 DB8500_PIN("GPIO230_AF7", slpm_gpio_nopull, "nmk-i2c.3"), 184 DB8500_PIN_SLEEP("GPIO229_AG7", slpm_in_nopull_wkup_pdis, "nmk-i2c.3"), /* SDA */
185 DB8500_PIN_SLEEP("GPIO230_AF7", slpm_in_nopull_wkup_pdis, "nmk-i2c.3"), /* SCL */
171 /* Mux in SDI0 (here called MC0) used for removable MMC/SD/SDIO cards */ 186 /* Mux in SDI0 (here called MC0) used for removable MMC/SD/SDIO cards */
172 DB8500_MUX("mc0_a_1", "mc0", "sdi0"), 187 DB8500_MUX("mc0_a_1", "mc0", "sdi0"),
173 DB8500_PIN("GPIO18_AC2", out_hi, "sdi0"), /* CMDDIR */ 188 DB8500_PIN("GPIO18_AC2", out_hi, "sdi0"), /* CMDDIR */
@@ -219,11 +234,15 @@ static struct pinctrl_map __initdata mop500_family_pinmap[] = {
219 DB8500_MUX("usb_a_1", "usb", "musb-ux500.0"), 234 DB8500_MUX("usb_a_1", "usb", "musb-ux500.0"),
220 DB8500_PIN("GPIO257_AE29", out_hi, "musb-ux500.0"), /* STP */ 235 DB8500_PIN("GPIO257_AE29", out_hi, "musb-ux500.0"), /* STP */
221 /* Mux in SPI2 pins on the "other C1" altfunction */ 236 /* Mux in SPI2 pins on the "other C1" altfunction */
222 DB8500_MUX("spi2_oc1_1", "spi2", "spi2"), 237 DB8500_MUX("spi2_oc1_2", "spi2", "spi2"),
223 DB8500_PIN("GPIO216_AG12", gpio_out_hi, "spi2"), /* FRM */ 238 DB8500_PIN("GPIO216_AG12", gpio_out_hi, "spi2"), /* FRM */
224 DB8500_PIN("GPIO218_AH11", in_pd, "spi2"), /* RXD */ 239 DB8500_PIN("GPIO218_AH11", in_pd, "spi2"), /* RXD */
225 DB8500_PIN("GPIO215_AH13", out_lo, "spi2"), /* TXD */ 240 DB8500_PIN("GPIO215_AH13", out_lo, "spi2"), /* TXD */
226 DB8500_PIN("GPIO217_AH12", out_lo, "spi2"), /* CLK */ 241 DB8500_PIN("GPIO217_AH12", out_lo, "spi2"), /* CLK */
242 /* SPI2 sleep state */
243 DB8500_PIN_SLEEP("GPIO218_AH11", slpm_in_wkup_pdis, "spi2"), /* RXD */
244 DB8500_PIN_SLEEP("GPIO215_AH13", slpm_out_lo_wkup_pdis, "spi2"), /* TXD */
245 DB8500_PIN_SLEEP("GPIO217_AH12", slpm_wkup_pdis, "spi2"), /* CLK */
227}; 246};
228 247
229/* 248/*
@@ -410,7 +429,7 @@ static struct pinctrl_map __initdata u9500_pinmap[] = {
410 DB8500_PIN_HOG("GPIO144_B13", gpio_in_pu), 429 DB8500_PIN_HOG("GPIO144_B13", gpio_in_pu),
411 /* HSI */ 430 /* HSI */
412 DB8500_MUX_HOG("hsir_a_1", "hsi"), 431 DB8500_MUX_HOG("hsir_a_1", "hsi"),
413 DB8500_MUX_HOG("hsit_a_1", "hsi"), 432 DB8500_MUX_HOG("hsit_a_2", "hsi"),
414 DB8500_PIN_HOG("GPIO219_AG10", in_pd), /* RX FLA0 */ 433 DB8500_PIN_HOG("GPIO219_AG10", in_pd), /* RX FLA0 */
415 DB8500_PIN_HOG("GPIO220_AH10", in_pd), /* RX DAT0 */ 434 DB8500_PIN_HOG("GPIO220_AH10", in_pd), /* RX DAT0 */
416 DB8500_PIN_HOG("GPIO221_AJ11", out_lo), /* RX RDY0 */ 435 DB8500_PIN_HOG("GPIO221_AJ11", out_lo), /* RX RDY0 */
@@ -418,7 +437,7 @@ static struct pinctrl_map __initdata u9500_pinmap[] = {
418 DB8500_PIN_HOG("GPIO223_AH9", out_lo), /* TX DAT0 */ 437 DB8500_PIN_HOG("GPIO223_AH9", out_lo), /* TX DAT0 */
419 DB8500_PIN_HOG("GPIO224_AG9", in_pd), /* TX RDY0 */ 438 DB8500_PIN_HOG("GPIO224_AG9", in_pd), /* TX RDY0 */
420 DB8500_PIN_HOG("GPIO225_AG8", in_pd), /* CAWAKE0 */ 439 DB8500_PIN_HOG("GPIO225_AG8", in_pd), /* CAWAKE0 */
421 DB8500_PIN_HOG("GPIO226_AF8", out_hi), /* ACWAKE0 */ 440 DB8500_PIN_HOG("GPIO226_AF8", gpio_out_hi), /* ACWAKE0 */
422}; 441};
423 442
424static struct pinctrl_map __initdata u8500_pinmap[] = { 443static struct pinctrl_map __initdata u8500_pinmap[] = {
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
index 52426a42578..2a17bc506cf 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.c
+++ b/arch/arm/mach-ux500/board-mop500-regulators.c
@@ -13,6 +13,21 @@
13#include <linux/regulator/ab8500.h> 13#include <linux/regulator/ab8500.h>
14#include "board-mop500-regulators.h" 14#include "board-mop500-regulators.h"
15 15
16static struct regulator_consumer_supply gpio_en_3v3_consumers[] = {
17 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
18};
19
20struct regulator_init_data gpio_en_3v3_regulator = {
21 .constraints = {
22 .name = "EN-3V3",
23 .min_uV = 3300000,
24 .max_uV = 3300000,
25 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
26 },
27 .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers),
28 .consumer_supplies = gpio_en_3v3_consumers,
29};
30
16/* 31/*
17 * TPS61052 regulator 32 * TPS61052 regulator
18 */ 33 */
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
index 94992158d96..78a0642a220 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.h
+++ b/arch/arm/mach-ux500/board-mop500-regulators.h
@@ -18,5 +18,6 @@ extern struct ab8500_regulator_reg_init
18ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS]; 18ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS];
19extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS]; 19extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];
20extern struct regulator_init_data tps61052_regulator; 20extern struct regulator_init_data tps61052_regulator;
21extern struct regulator_init_data gpio_en_3v3_regulator;
21 22
22#endif 23#endif
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 18ff781cfbe..9c8e4a9e83e 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -152,7 +152,7 @@ static struct stedma40_chan_cfg sdi1_dma_cfg_tx = {
152}; 152};
153#endif 153#endif
154 154
155static struct mmci_platform_data mop500_sdi1_data = { 155struct mmci_platform_data mop500_sdi1_data = {
156 .ocr_mask = MMC_VDD_29_30, 156 .ocr_mask = MMC_VDD_29_30,
157 .f_max = 50000000, 157 .f_max = 50000000,
158 .capabilities = MMC_CAP_4_BIT_DATA, 158 .capabilities = MMC_CAP_4_BIT_DATA,
@@ -189,7 +189,7 @@ static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = {
189}; 189};
190#endif 190#endif
191 191
192static struct mmci_platform_data mop500_sdi2_data = { 192struct mmci_platform_data mop500_sdi2_data = {
193 .ocr_mask = MMC_VDD_165_195, 193 .ocr_mask = MMC_VDD_165_195,
194 .f_max = 50000000, 194 .f_max = 50000000,
195 .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA | 195 .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index a534d8880de..416d436111f 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -23,6 +23,7 @@
23#include <linux/spi/spi.h> 23#include <linux/spi/spi.h>
24#include <linux/mfd/abx500/ab8500.h> 24#include <linux/mfd/abx500/ab8500.h>
25#include <linux/regulator/ab8500.h> 25#include <linux/regulator/ab8500.h>
26#include <linux/regulator/fixed.h>
26#include <linux/mfd/tc3589x.h> 27#include <linux/mfd/tc3589x.h>
27#include <linux/mfd/tps6105x.h> 28#include <linux/mfd/tps6105x.h>
28#include <linux/mfd/abx500/ab8500-gpio.h> 29#include <linux/mfd/abx500/ab8500-gpio.h>
@@ -48,13 +49,12 @@
48#include <mach/setup.h> 49#include <mach/setup.h>
49#include <mach/devices.h> 50#include <mach/devices.h>
50#include <mach/irqs.h> 51#include <mach/irqs.h>
51#include <mach/crypto-ux500.h> 52#include <linux/platform_data/crypto-ux500.h>
52 53
53#include "ste-dma40-db8500.h" 54#include "ste-dma40-db8500.h"
54#include "devices-db8500.h" 55#include "devices-db8500.h"
55#include "board-mop500.h" 56#include "board-mop500.h"
56#include "board-mop500-regulators.h" 57#include "board-mop500-regulators.h"
57#include "board-mop500-msp.h"
58 58
59static struct gpio_led snowball_led_array[] = { 59static struct gpio_led snowball_led_array[] = {
60 { 60 {
@@ -76,6 +76,23 @@ static struct platform_device snowball_led_dev = {
76 }, 76 },
77}; 77};
78 78
79static struct fixed_voltage_config snowball_gpio_en_3v3_data = {
80 .supply_name = "EN-3V3",
81 .gpio = SNOWBALL_EN_3V3_ETH_GPIO,
82 .microvolts = 3300000,
83 .enable_high = 1,
84 .init_data = &gpio_en_3v3_regulator,
85 .startup_delay = 5000, /* 1200us */
86};
87
88static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
89 .name = "reg-fixed-voltage",
90 .id = 1,
91 .dev = {
92 .platform_data = &snowball_gpio_en_3v3_data,
93 },
94};
95
79static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { 96static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
80 .gpio_base = MOP500_AB8500_PIN_GPIO(1), 97 .gpio_base = MOP500_AB8500_PIN_GPIO(1),
81 .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE, 98 .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
@@ -524,33 +541,12 @@ static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
524}; 541};
525#endif 542#endif
526 543
527#define PRCC_K_SOFTRST_SET 0x18
528#define PRCC_K_SOFTRST_CLEAR 0x1C
529static void ux500_uart0_reset(void)
530{
531 void __iomem *prcc_rst_set, *prcc_rst_clr;
532
533 prcc_rst_set = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE +
534 PRCC_K_SOFTRST_SET);
535 prcc_rst_clr = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE +
536 PRCC_K_SOFTRST_CLEAR);
537
538 /* Activate soft reset PRCC_K_SOFTRST_CLEAR */
539 writel((readl(prcc_rst_clr) | 0x1), prcc_rst_clr);
540 udelay(1);
541
542 /* Release soft reset PRCC_K_SOFTRST_SET */
543 writel((readl(prcc_rst_set) | 0x1), prcc_rst_set);
544 udelay(1);
545}
546
547static struct amba_pl011_data uart0_plat = { 544static struct amba_pl011_data uart0_plat = {
548#ifdef CONFIG_STE_DMA40 545#ifdef CONFIG_STE_DMA40
549 .dma_filter = stedma40_filter, 546 .dma_filter = stedma40_filter,
550 .dma_rx_param = &uart0_dma_cfg_rx, 547 .dma_rx_param = &uart0_dma_cfg_rx,
551 .dma_tx_param = &uart0_dma_cfg_tx, 548 .dma_tx_param = &uart0_dma_cfg_tx,
552#endif 549#endif
553 .reset = ux500_uart0_reset,
554}; 550};
555 551
556static struct amba_pl011_data uart1_plat = { 552static struct amba_pl011_data uart1_plat = {
@@ -586,6 +582,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
586 &snowball_led_dev, 582 &snowball_led_dev,
587 &snowball_key_dev, 583 &snowball_key_dev,
588 &snowball_sbnet_dev, 584 &snowball_sbnet_dev,
585 &snowball_gpio_en_3v3_regulator_dev,
589}; 586};
590 587
591static void __init mop500_init_machine(void) 588static void __init mop500_init_machine(void)
@@ -608,7 +605,7 @@ static void __init mop500_init_machine(void)
608 mop500_i2c_init(parent); 605 mop500_i2c_init(parent);
609 mop500_sdi_init(parent); 606 mop500_sdi_init(parent);
610 mop500_spi_init(parent); 607 mop500_spi_init(parent);
611 mop500_msp_init(parent); 608 mop500_audio_init(parent);
612 mop500_uart_init(parent); 609 mop500_uart_init(parent);
613 610
614 u8500_cryp1_hash1_init(parent); 611 u8500_cryp1_hash1_init(parent);
@@ -642,7 +639,7 @@ static void __init snowball_init_machine(void)
642 mop500_i2c_init(parent); 639 mop500_i2c_init(parent);
643 snowball_sdi_init(parent); 640 snowball_sdi_init(parent);
644 mop500_spi_init(parent); 641 mop500_spi_init(parent);
645 mop500_msp_init(parent); 642 mop500_audio_init(parent);
646 mop500_uart_init(parent); 643 mop500_uart_init(parent);
647 644
648 /* This board has full regulator constraints */ 645 /* This board has full regulator constraints */
@@ -674,7 +671,7 @@ static void __init hrefv60_init_machine(void)
674 mop500_i2c_init(parent); 671 mop500_i2c_init(parent);
675 hrefv60_sdi_init(parent); 672 hrefv60_sdi_init(parent);
676 mop500_spi_init(parent); 673 mop500_spi_init(parent);
677 mop500_msp_init(parent); 674 mop500_audio_init(parent);
678 mop500_uart_init(parent); 675 mop500_uart_init(parent);
679 676
680 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); 677 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
@@ -694,6 +691,7 @@ static void __init hrefv60_init_machine(void)
694MACHINE_START(U8500, "ST-Ericsson MOP500 platform") 691MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
695 /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */ 692 /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
696 .atag_offset = 0x100, 693 .atag_offset = 0x100,
694 .smp = smp_ops(ux500_smp_ops),
697 .map_io = u8500_map_io, 695 .map_io = u8500_map_io,
698 .init_irq = ux500_init_irq, 696 .init_irq = ux500_init_irq,
699 /* we re-use nomadik timer here */ 697 /* we re-use nomadik timer here */
@@ -705,6 +703,7 @@ MACHINE_END
705 703
706MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") 704MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
707 .atag_offset = 0x100, 705 .atag_offset = 0x100,
706 .smp = smp_ops(ux500_smp_ops),
708 .map_io = u8500_map_io, 707 .map_io = u8500_map_io,
709 .init_irq = ux500_init_irq, 708 .init_irq = ux500_init_irq,
710 .timer = &ux500_timer, 709 .timer = &ux500_timer,
@@ -715,6 +714,7 @@ MACHINE_END
715 714
716MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") 715MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
717 .atag_offset = 0x100, 716 .atag_offset = 0x100,
717 .smp = smp_ops(ux500_smp_ops),
718 .map_io = u8500_map_io, 718 .map_io = u8500_map_io,
719 .init_irq = ux500_init_irq, 719 .init_irq = ux500_init_irq,
720 /* we re-use nomadik timer here */ 720 /* we re-use nomadik timer here */
@@ -726,12 +726,9 @@ MACHINE_END
726 726
727#ifdef CONFIG_MACH_UX500_DT 727#ifdef CONFIG_MACH_UX500_DT
728 728
729static struct platform_device *snowball_of_platform_devs[] __initdata = {
730 &snowball_led_dev,
731 &snowball_key_dev,
732};
733
734struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { 729struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
730 /* Requires call-back bindings. */
731 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata),
735 /* Requires DMA and call-back bindings. */ 732 /* Requires DMA and call-back bindings. */
736 OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat), 733 OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat),
737 OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat), 734 OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat),
@@ -739,6 +736,8 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
739 /* Requires DMA bindings. */ 736 /* Requires DMA bindings. */
740 OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat), 737 OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat),
741 OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data), 738 OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data),
739 OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data),
740 OF_DEV_AUXDATA("arm,pl18x", 0x80005000, "sdi2", &mop500_sdi2_data),
742 OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data), 741 OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data),
743 /* Requires clock name bindings. */ 742 /* Requires clock name bindings. */
744 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL), 743 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
@@ -757,6 +756,15 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
757 OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL), 756 OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL),
758 /* Requires device name bindings. */ 757 /* Requires device name bindings. */
759 OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL), 758 OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL),
759 /* Requires clock name and DMA bindings. */
760 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000,
761 "ux500-msp-i2s.0", &msp0_platform_data),
762 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80124000,
763 "ux500-msp-i2s.1", &msp1_platform_data),
764 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80117000,
765 "ux500-msp-i2s.2", &msp2_platform_data),
766 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80125000,
767 "ux500-msp-i2s.3", &msp3_platform_data),
760 {}, 768 {},
761}; 769};
762 770
@@ -797,7 +805,7 @@ static void __init u8500_init_machine(void)
797 ARRAY_SIZE(mop500_platform_devs)); 805 ARRAY_SIZE(mop500_platform_devs));
798 806
799 mop500_sdi_init(parent); 807 mop500_sdi_init(parent);
800 mop500_msp_init(parent); 808 mop500_audio_init(parent);
801 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); 809 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
802 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); 810 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
803 i2c_register_board_info(2, mop500_i2c2_devices, 811 i2c_register_board_info(2, mop500_i2c2_devices,
@@ -806,7 +814,7 @@ static void __init u8500_init_machine(void)
806 mop500_uib_init(); 814 mop500_uib_init();
807 815
808 } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { 816 } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
809 mop500_msp_init(parent); 817 mop500_of_audio_init(parent);
810 } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) { 818 } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
811 /* 819 /*
812 * The HREFv60 board removed a GPIO expander and routed 820 * The HREFv60 board removed a GPIO expander and routed
@@ -817,16 +825,6 @@ static void __init u8500_init_machine(void)
817 platform_add_devices(mop500_platform_devs, 825 platform_add_devices(mop500_platform_devs,
818 ARRAY_SIZE(mop500_platform_devs)); 826 ARRAY_SIZE(mop500_platform_devs));
819 827
820 hrefv60_sdi_init(parent);
821 mop500_msp_init(parent);
822
823 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
824 i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
825
826 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
827 i2c_register_board_info(2, mop500_i2c2_devices,
828 ARRAY_SIZE(mop500_i2c2_devices));
829
830 mop500_uib_init(); 828 mop500_uib_init();
831 } 829 }
832 830
@@ -844,6 +842,7 @@ static const char * u8500_dt_board_compat[] = {
844 842
845 843
846DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)") 844DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)")
845 .smp = smp_ops(ux500_smp_ops),
847 .map_io = u8500_map_io, 846 .map_io = u8500_map_io,
848 .init_irq = ux500_init_irq, 847 .init_irq = ux500_init_irq,
849 /* we re-use nomadik timer here */ 848 /* we re-use nomadik timer here */
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index b5bfc1a78b1..aca39a68712 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -9,6 +9,7 @@
9 9
10/* For NOMADIK_NR_GPIO */ 10/* For NOMADIK_NR_GPIO */
11#include <mach/irqs.h> 11#include <mach/irqs.h>
12#include <mach/msp.h>
12#include <linux/amba/mmci.h> 13#include <linux/amba/mmci.h>
13 14
14/* Snowball specific GPIO assignments, this board has no GPIO expander */ 15/* Snowball specific GPIO assignments, this board has no GPIO expander */
@@ -80,7 +81,14 @@
80struct device; 81struct device;
81struct i2c_board_info; 82struct i2c_board_info;
82extern struct mmci_platform_data mop500_sdi0_data; 83extern struct mmci_platform_data mop500_sdi0_data;
84extern struct mmci_platform_data mop500_sdi1_data;
85extern struct mmci_platform_data mop500_sdi2_data;
83extern struct mmci_platform_data mop500_sdi4_data; 86extern struct mmci_platform_data mop500_sdi4_data;
87extern struct msp_i2s_platform_data msp0_platform_data;
88extern struct msp_i2s_platform_data msp1_platform_data;
89extern struct msp_i2s_platform_data msp2_platform_data;
90extern struct msp_i2s_platform_data msp3_platform_data;
91extern struct arm_pmu_platdata db8500_pmu_platdata;
84 92
85extern void mop500_sdi_init(struct device *parent); 93extern void mop500_sdi_init(struct device *parent);
86extern void snowball_sdi_init(struct device *parent); 94extern void snowball_sdi_init(struct device *parent);
@@ -91,6 +99,9 @@ void __init mop500_stuib_init(void);
91void __init mop500_pinmaps_init(void); 99void __init mop500_pinmaps_init(void);
92void __init snowball_pinmaps_init(void); 100void __init snowball_pinmaps_init(void);
93void __init hrefv60_pinmaps_init(void); 101void __init hrefv60_pinmaps_init(void);
102void mop500_audio_init(struct device *parent);
103/* Due for removal once the MSP driver has been fully DT:ed. */
104void mop500_of_audio_init(struct device *parent);
94 105
95int __init mop500_uib_init(void); 106int __init mop500_uib_init(void);
96void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info, 107void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c
index dc12394295d..75d5b512a3d 100644
--- a/arch/arm/mach-ux500/cache-l2x0.c
+++ b/arch/arm/mach-ux500/cache-l2x0.c
@@ -38,7 +38,7 @@ static int __init ux500_l2x0_init(void)
38{ 38{
39 u32 aux_val = 0x3e000000; 39 u32 aux_val = 0x3e000000;
40 40
41 if (cpu_is_u8500_family()) 41 if (cpu_is_u8500_family() || cpu_is_ux540_family())
42 l2x0_base = __io_address(U8500_L2CC_BASE); 42 l2x0_base = __io_address(U8500_L2CC_BASE);
43 else 43 else
44 ux500_unknown_soc(); 44 ux500_unknown_soc();
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c
deleted file mode 100644
index 8d73b066a18..00000000000
--- a/arch/arm/mach-ux500/clock.c
+++ /dev/null
@@ -1,715 +0,0 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
3 * Copyright (C) 2009 STMicroelectronics
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#include <linux/module.h>
10#include <linux/kernel.h>
11#include <linux/list.h>
12#include <linux/errno.h>
13#include <linux/err.h>
14#include <linux/clk.h>
15#include <linux/io.h>
16#include <linux/clkdev.h>
17#include <linux/cpufreq.h>
18
19#include <plat/mtu.h>
20#include <mach/hardware.h>
21#include "clock.h"
22
23#ifdef CONFIG_DEBUG_FS
24#include <linux/debugfs.h>
25#include <linux/uaccess.h> /* for copy_from_user */
26static LIST_HEAD(clk_list);
27#endif
28
29#define PRCC_PCKEN 0x00
30#define PRCC_PCKDIS 0x04
31#define PRCC_KCKEN 0x08
32#define PRCC_KCKDIS 0x0C
33
34#define PRCM_YYCLKEN0_MGT_SET 0x510
35#define PRCM_YYCLKEN1_MGT_SET 0x514
36#define PRCM_YYCLKEN0_MGT_CLR 0x518
37#define PRCM_YYCLKEN1_MGT_CLR 0x51C
38#define PRCM_YYCLKEN0_MGT_VAL 0x520
39#define PRCM_YYCLKEN1_MGT_VAL 0x524
40
41#define PRCM_SVAMMDSPCLK_MGT 0x008
42#define PRCM_SIAMMDSPCLK_MGT 0x00C
43#define PRCM_SGACLK_MGT 0x014
44#define PRCM_UARTCLK_MGT 0x018
45#define PRCM_MSP02CLK_MGT 0x01C
46#define PRCM_MSP1CLK_MGT 0x288
47#define PRCM_I2CCLK_MGT 0x020
48#define PRCM_SDMMCCLK_MGT 0x024
49#define PRCM_SLIMCLK_MGT 0x028
50#define PRCM_PER1CLK_MGT 0x02C
51#define PRCM_PER2CLK_MGT 0x030
52#define PRCM_PER3CLK_MGT 0x034
53#define PRCM_PER5CLK_MGT 0x038
54#define PRCM_PER6CLK_MGT 0x03C
55#define PRCM_PER7CLK_MGT 0x040
56#define PRCM_LCDCLK_MGT 0x044
57#define PRCM_BMLCLK_MGT 0x04C
58#define PRCM_HSITXCLK_MGT 0x050
59#define PRCM_HSIRXCLK_MGT 0x054
60#define PRCM_HDMICLK_MGT 0x058
61#define PRCM_APEATCLK_MGT 0x05C
62#define PRCM_APETRACECLK_MGT 0x060
63#define PRCM_MCDECLK_MGT 0x064
64#define PRCM_IPI2CCLK_MGT 0x068
65#define PRCM_DSIALTCLK_MGT 0x06C
66#define PRCM_DMACLK_MGT 0x074
67#define PRCM_B2R2CLK_MGT 0x078
68#define PRCM_TVCLK_MGT 0x07C
69#define PRCM_TCR 0x1C8
70#define PRCM_TCR_STOPPED (1 << 16)
71#define PRCM_TCR_DOZE_MODE (1 << 17)
72#define PRCM_UNIPROCLK_MGT 0x278
73#define PRCM_SSPCLK_MGT 0x280
74#define PRCM_RNGCLK_MGT 0x284
75#define PRCM_UICCCLK_MGT 0x27C
76
77#define PRCM_MGT_ENABLE (1 << 8)
78
79static DEFINE_SPINLOCK(clocks_lock);
80
81static void __clk_enable(struct clk *clk)
82{
83 if (clk->enabled++ == 0) {
84 if (clk->parent_cluster)
85 __clk_enable(clk->parent_cluster);
86
87 if (clk->parent_periph)
88 __clk_enable(clk->parent_periph);
89
90 if (clk->ops && clk->ops->enable)
91 clk->ops->enable(clk);
92 }
93}
94
95int clk_enable(struct clk *clk)
96{
97 unsigned long flags;
98
99 spin_lock_irqsave(&clocks_lock, flags);
100 __clk_enable(clk);
101 spin_unlock_irqrestore(&clocks_lock, flags);
102
103 return 0;
104}
105EXPORT_SYMBOL(clk_enable);
106
107static void __clk_disable(struct clk *clk)
108{
109 if (--clk->enabled == 0) {
110 if (clk->ops && clk->ops->disable)
111 clk->ops->disable(clk);
112
113 if (clk->parent_periph)
114 __clk_disable(clk->parent_periph);
115
116 if (clk->parent_cluster)
117 __clk_disable(clk->parent_cluster);
118 }
119}
120
121void clk_disable(struct clk *clk)
122{
123 unsigned long flags;
124
125 WARN_ON(!clk->enabled);
126
127 spin_lock_irqsave(&clocks_lock, flags);
128 __clk_disable(clk);
129 spin_unlock_irqrestore(&clocks_lock, flags);
130}
131EXPORT_SYMBOL(clk_disable);
132
133/*
134 * The MTU has a separate, rather complex muxing setup
135 * with alternative parents (peripheral cluster or
136 * ULP or fixed 32768 Hz) depending on settings
137 */
138static unsigned long clk_mtu_get_rate(struct clk *clk)
139{
140 void __iomem *addr;
141 u32 tcr;
142 int mtu = (int) clk->data;
143 /*
144 * One of these is selected eventually
145 * TODO: Replace the constant with a reference
146 * to the ULP source once this is modeled.
147 */
148 unsigned long clk32k = 32768;
149 unsigned long mturate;
150 unsigned long retclk;
151
152 if (cpu_is_u8500_family())
153 addr = __io_address(U8500_PRCMU_BASE);
154 else
155 ux500_unknown_soc();
156
157 /*
158 * On a startup, always conifgure the TCR to the doze mode;
159 * bootloaders do it for us. Do this in the kernel too.
160 */
161 writel(PRCM_TCR_DOZE_MODE, addr + PRCM_TCR);
162
163 tcr = readl(addr + PRCM_TCR);
164
165 /* Get the rate from the parent as a default */
166 if (clk->parent_periph)
167 mturate = clk_get_rate(clk->parent_periph);
168 else if (clk->parent_cluster)
169 mturate = clk_get_rate(clk->parent_cluster);
170 else
171 /* We need to be connected SOMEWHERE */
172 BUG();
173
174 /* Return the clock selected for this MTU */
175 if (tcr & (1 << mtu))
176 retclk = clk32k;
177 else
178 retclk = mturate;
179
180 pr_info("MTU%d clock rate: %lu Hz\n", mtu, retclk);
181 return retclk;
182}
183
184unsigned long clk_get_rate(struct clk *clk)
185{
186 unsigned long rate;
187
188 /*
189 * If there is a custom getrate callback for this clock,
190 * it will take precedence.
191 */
192 if (clk->get_rate)
193 return clk->get_rate(clk);
194
195 if (clk->ops && clk->ops->get_rate)
196 return clk->ops->get_rate(clk);
197
198 rate = clk->rate;
199 if (!rate) {
200 if (clk->parent_periph)
201 rate = clk_get_rate(clk->parent_periph);
202 else if (clk->parent_cluster)
203 rate = clk_get_rate(clk->parent_cluster);
204 }
205
206 return rate;
207}
208EXPORT_SYMBOL(clk_get_rate);
209
210long clk_round_rate(struct clk *clk, unsigned long rate)
211{
212 /*TODO*/
213 return rate;
214}
215EXPORT_SYMBOL(clk_round_rate);
216
217int clk_set_rate(struct clk *clk, unsigned long rate)
218{
219 clk->rate = rate;
220 return 0;
221}
222EXPORT_SYMBOL(clk_set_rate);
223
224int clk_set_parent(struct clk *clk, struct clk *parent)
225{
226 /*TODO*/
227 return -ENOSYS;
228}
229EXPORT_SYMBOL(clk_set_parent);
230
231static void clk_prcmu_enable(struct clk *clk)
232{
233 void __iomem *cg_set_reg = __io_address(U8500_PRCMU_BASE)
234 + PRCM_YYCLKEN0_MGT_SET + clk->prcmu_cg_off;
235
236 writel(1 << clk->prcmu_cg_bit, cg_set_reg);
237}
238
239static void clk_prcmu_disable(struct clk *clk)
240{
241 void __iomem *cg_clr_reg = __io_address(U8500_PRCMU_BASE)
242 + PRCM_YYCLKEN0_MGT_CLR + clk->prcmu_cg_off;
243
244 writel(1 << clk->prcmu_cg_bit, cg_clr_reg);
245}
246
247static struct clkops clk_prcmu_ops = {
248 .enable = clk_prcmu_enable,
249 .disable = clk_prcmu_disable,
250};
251
252static unsigned int clkrst_base[] = {
253 [1] = U8500_CLKRST1_BASE,
254 [2] = U8500_CLKRST2_BASE,
255 [3] = U8500_CLKRST3_BASE,
256 [5] = U8500_CLKRST5_BASE,
257 [6] = U8500_CLKRST6_BASE,
258};
259
260static void clk_prcc_enable(struct clk *clk)
261{
262 void __iomem *addr = __io_address(clkrst_base[clk->cluster]);
263
264 if (clk->prcc_kernel != -1)
265 writel(1 << clk->prcc_kernel, addr + PRCC_KCKEN);
266
267 if (clk->prcc_bus != -1)
268 writel(1 << clk->prcc_bus, addr + PRCC_PCKEN);
269}
270
271static void clk_prcc_disable(struct clk *clk)
272{
273 void __iomem *addr = __io_address(clkrst_base[clk->cluster]);
274
275 if (clk->prcc_bus != -1)
276 writel(1 << clk->prcc_bus, addr + PRCC_PCKDIS);
277
278 if (clk->prcc_kernel != -1)
279 writel(1 << clk->prcc_kernel, addr + PRCC_KCKDIS);
280}
281
282static struct clkops clk_prcc_ops = {
283 .enable = clk_prcc_enable,
284 .disable = clk_prcc_disable,
285};
286
287static struct clk clk_32khz = {
288 .name = "clk_32khz",
289 .rate = 32000,
290};
291
292/*
293 * PRCMU level clock gating
294 */
295
296/* Bank 0 */
297static DEFINE_PRCMU_CLK(svaclk, 0x0, 2, SVAMMDSPCLK);
298static DEFINE_PRCMU_CLK(siaclk, 0x0, 3, SIAMMDSPCLK);
299static DEFINE_PRCMU_CLK(sgaclk, 0x0, 4, SGACLK);
300static DEFINE_PRCMU_CLK_RATE(uartclk, 0x0, 5, UARTCLK, 38400000);
301static DEFINE_PRCMU_CLK(msp02clk, 0x0, 6, MSP02CLK);
302static DEFINE_PRCMU_CLK(msp1clk, 0x0, 7, MSP1CLK); /* v1 */
303static DEFINE_PRCMU_CLK_RATE(i2cclk, 0x0, 8, I2CCLK, 48000000);
304static DEFINE_PRCMU_CLK_RATE(sdmmcclk, 0x0, 9, SDMMCCLK, 100000000);
305static DEFINE_PRCMU_CLK(slimclk, 0x0, 10, SLIMCLK);
306static DEFINE_PRCMU_CLK(per1clk, 0x0, 11, PER1CLK);
307static DEFINE_PRCMU_CLK(per2clk, 0x0, 12, PER2CLK);
308static DEFINE_PRCMU_CLK(per3clk, 0x0, 13, PER3CLK);
309static DEFINE_PRCMU_CLK(per5clk, 0x0, 14, PER5CLK);
310static DEFINE_PRCMU_CLK_RATE(per6clk, 0x0, 15, PER6CLK, 133330000);
311static DEFINE_PRCMU_CLK(lcdclk, 0x0, 17, LCDCLK);
312static DEFINE_PRCMU_CLK(bmlclk, 0x0, 18, BMLCLK);
313static DEFINE_PRCMU_CLK(hsitxclk, 0x0, 19, HSITXCLK);
314static DEFINE_PRCMU_CLK(hsirxclk, 0x0, 20, HSIRXCLK);
315static DEFINE_PRCMU_CLK(hdmiclk, 0x0, 21, HDMICLK);
316static DEFINE_PRCMU_CLK(apeatclk, 0x0, 22, APEATCLK);
317static DEFINE_PRCMU_CLK(apetraceclk, 0x0, 23, APETRACECLK);
318static DEFINE_PRCMU_CLK(mcdeclk, 0x0, 24, MCDECLK);
319static DEFINE_PRCMU_CLK(ipi2clk, 0x0, 25, IPI2CCLK);
320static DEFINE_PRCMU_CLK(dsialtclk, 0x0, 26, DSIALTCLK); /* v1 */
321static DEFINE_PRCMU_CLK(dmaclk, 0x0, 27, DMACLK);
322static DEFINE_PRCMU_CLK(b2r2clk, 0x0, 28, B2R2CLK);
323static DEFINE_PRCMU_CLK(tvclk, 0x0, 29, TVCLK);
324static DEFINE_PRCMU_CLK(uniproclk, 0x0, 30, UNIPROCLK); /* v1 */
325static DEFINE_PRCMU_CLK_RATE(sspclk, 0x0, 31, SSPCLK, 48000000); /* v1 */
326
327/* Bank 1 */
328static DEFINE_PRCMU_CLK(rngclk, 0x4, 0, RNGCLK); /* v1 */
329static DEFINE_PRCMU_CLK(uiccclk, 0x4, 1, UICCCLK); /* v1 */
330
331/*
332 * PRCC level clock gating
333 * Format: per#, clk, PCKEN bit, KCKEN bit, parent
334 */
335
336/* Peripheral Cluster #1 */
337static DEFINE_PRCC_CLK(1, msp3, 11, 10, &clk_msp1clk);
338static DEFINE_PRCC_CLK(1, i2c4, 10, 9, &clk_i2cclk);
339static DEFINE_PRCC_CLK(1, gpio0, 9, -1, NULL);
340static DEFINE_PRCC_CLK(1, slimbus0, 8, 8, &clk_slimclk);
341static DEFINE_PRCC_CLK(1, spi3, 7, -1, NULL);
342static DEFINE_PRCC_CLK(1, i2c2, 6, 6, &clk_i2cclk);
343static DEFINE_PRCC_CLK(1, sdi0, 5, 5, &clk_sdmmcclk);
344static DEFINE_PRCC_CLK(1, msp1, 4, 4, &clk_msp1clk);
345static DEFINE_PRCC_CLK(1, msp0, 3, 3, &clk_msp02clk);
346static DEFINE_PRCC_CLK(1, i2c1, 2, 2, &clk_i2cclk);
347static DEFINE_PRCC_CLK(1, uart1, 1, 1, &clk_uartclk);
348static DEFINE_PRCC_CLK(1, uart0, 0, 0, &clk_uartclk);
349
350/* Peripheral Cluster #2 */
351static DEFINE_PRCC_CLK(2, gpio1, 11, -1, NULL);
352static DEFINE_PRCC_CLK(2, ssitx, 10, 7, NULL);
353static DEFINE_PRCC_CLK(2, ssirx, 9, 6, NULL);
354static DEFINE_PRCC_CLK(2, spi0, 8, -1, NULL);
355static DEFINE_PRCC_CLK(2, sdi3, 7, 5, &clk_sdmmcclk);
356static DEFINE_PRCC_CLK(2, sdi1, 6, 4, &clk_sdmmcclk);
357static DEFINE_PRCC_CLK(2, msp2, 5, 3, &clk_msp02clk);
358static DEFINE_PRCC_CLK(2, sdi4, 4, 2, &clk_sdmmcclk);
359static DEFINE_PRCC_CLK(2, pwl, 3, 1, NULL);
360static DEFINE_PRCC_CLK(2, spi1, 2, -1, NULL);
361static DEFINE_PRCC_CLK(2, spi2, 1, -1, NULL);
362static DEFINE_PRCC_CLK(2, i2c3, 0, 0, &clk_i2cclk);
363
364/* Peripheral Cluster #3 */
365static DEFINE_PRCC_CLK(3, gpio2, 8, -1, NULL);
366static DEFINE_PRCC_CLK(3, sdi5, 7, 7, &clk_sdmmcclk);
367static DEFINE_PRCC_CLK(3, uart2, 6, 6, &clk_uartclk);
368static DEFINE_PRCC_CLK(3, ske, 5, 5, &clk_32khz);
369static DEFINE_PRCC_CLK(3, sdi2, 4, 4, &clk_sdmmcclk);
370static DEFINE_PRCC_CLK(3, i2c0, 3, 3, &clk_i2cclk);
371static DEFINE_PRCC_CLK(3, ssp1, 2, 2, &clk_sspclk);
372static DEFINE_PRCC_CLK(3, ssp0, 1, 1, &clk_sspclk);
373static DEFINE_PRCC_CLK(3, fsmc, 0, -1, NULL);
374
375/* Peripheral Cluster #4 is in the always on domain */
376
377/* Peripheral Cluster #5 */
378static DEFINE_PRCC_CLK(5, gpio3, 1, -1, NULL);
379static DEFINE_PRCC_CLK(5, usb, 0, 0, NULL);
380
381/* Peripheral Cluster #6 */
382
383/* MTU ID in data */
384static DEFINE_PRCC_CLK_CUSTOM(6, mtu1, 9, -1, NULL, clk_mtu_get_rate, 1);
385static DEFINE_PRCC_CLK_CUSTOM(6, mtu0, 8, -1, NULL, clk_mtu_get_rate, 0);
386static DEFINE_PRCC_CLK(6, cfgreg, 7, 7, NULL);
387static DEFINE_PRCC_CLK(6, hash1, 6, -1, NULL);
388static DEFINE_PRCC_CLK(6, unipro, 5, 1, &clk_uniproclk);
389static DEFINE_PRCC_CLK(6, pka, 4, -1, NULL);
390static DEFINE_PRCC_CLK(6, hash0, 3, -1, NULL);
391static DEFINE_PRCC_CLK(6, cryp0, 2, -1, NULL);
392static DEFINE_PRCC_CLK(6, cryp1, 1, -1, NULL);
393static DEFINE_PRCC_CLK(6, rng, 0, 0, &clk_rngclk);
394
395static struct clk clk_dummy_apb_pclk = {
396 .name = "apb_pclk",
397};
398
399static struct clk_lookup u8500_clks[] = {
400 CLK(dummy_apb_pclk, NULL, "apb_pclk"),
401
402 /* Peripheral Cluster #1 */
403 CLK(gpio0, "gpio.0", NULL),
404 CLK(gpio0, "gpio.1", NULL),
405 CLK(slimbus0, "slimbus0", NULL),
406 CLK(i2c2, "nmk-i2c.2", NULL),
407 CLK(sdi0, "sdi0", NULL),
408 CLK(msp0, "ux500-msp-i2s.0", NULL),
409 CLK(i2c1, "nmk-i2c.1", NULL),
410 CLK(uart1, "uart1", NULL),
411 CLK(uart0, "uart0", NULL),
412
413 /* Peripheral Cluster #3 */
414 CLK(gpio2, "gpio.2", NULL),
415 CLK(gpio2, "gpio.3", NULL),
416 CLK(gpio2, "gpio.4", NULL),
417 CLK(gpio2, "gpio.5", NULL),
418 CLK(sdi5, "sdi5", NULL),
419 CLK(uart2, "uart2", NULL),
420 CLK(ske, "ske", NULL),
421 CLK(ske, "nmk-ske-keypad", NULL),
422 CLK(sdi2, "sdi2", NULL),
423 CLK(i2c0, "nmk-i2c.0", NULL),
424 CLK(fsmc, "fsmc", NULL),
425
426 /* Peripheral Cluster #5 */
427 CLK(gpio3, "gpio.8", NULL),
428
429 /* Peripheral Cluster #6 */
430 CLK(hash1, "hash1", NULL),
431 CLK(pka, "pka", NULL),
432 CLK(hash0, "hash0", NULL),
433 CLK(cryp0, "cryp0", NULL),
434 CLK(cryp1, "cryp1", NULL),
435
436 /* PRCMU level clock gating */
437
438 /* Bank 0 */
439 CLK(svaclk, "sva", NULL),
440 CLK(siaclk, "sia", NULL),
441 CLK(sgaclk, "sga", NULL),
442 CLK(slimclk, "slim", NULL),
443 CLK(lcdclk, "lcd", NULL),
444 CLK(bmlclk, "bml", NULL),
445 CLK(hsitxclk, "stm-hsi.0", NULL),
446 CLK(hsirxclk, "stm-hsi.1", NULL),
447 CLK(hdmiclk, "hdmi", NULL),
448 CLK(apeatclk, "apeat", NULL),
449 CLK(apetraceclk, "apetrace", NULL),
450 CLK(mcdeclk, "mcde", NULL),
451 CLK(ipi2clk, "ipi2", NULL),
452 CLK(dmaclk, "dma40.0", NULL),
453 CLK(b2r2clk, "b2r2", NULL),
454 CLK(tvclk, "tv", NULL),
455
456 /* Peripheral Cluster #1 */
457 CLK(i2c4, "nmk-i2c.4", NULL),
458 CLK(spi3, "spi3", NULL),
459 CLK(msp1, "ux500-msp-i2s.1", NULL),
460 CLK(msp3, "ux500-msp-i2s.3", NULL),
461
462 /* Peripheral Cluster #2 */
463 CLK(gpio1, "gpio.6", NULL),
464 CLK(gpio1, "gpio.7", NULL),
465 CLK(ssitx, "ssitx", NULL),
466 CLK(ssirx, "ssirx", NULL),
467 CLK(spi0, "spi0", NULL),
468 CLK(sdi3, "sdi3", NULL),
469 CLK(sdi1, "sdi1", NULL),
470 CLK(msp2, "ux500-msp-i2s.2", NULL),
471 CLK(sdi4, "sdi4", NULL),
472 CLK(pwl, "pwl", NULL),
473 CLK(spi1, "spi1", NULL),
474 CLK(spi2, "spi2", NULL),
475 CLK(i2c3, "nmk-i2c.3", NULL),
476
477 /* Peripheral Cluster #3 */
478 CLK(ssp1, "ssp1", NULL),
479 CLK(ssp0, "ssp0", NULL),
480
481 /* Peripheral Cluster #5 */
482 CLK(usb, "musb-ux500.0", "usb"),
483
484 /* Peripheral Cluster #6 */
485 CLK(mtu1, "mtu1", NULL),
486 CLK(mtu0, "mtu0", NULL),
487 CLK(cfgreg, "cfgreg", NULL),
488 CLK(hash1, "hash1", NULL),
489 CLK(unipro, "unipro", NULL),
490 CLK(rng, "rng", NULL),
491
492 /* PRCMU level clock gating */
493
494 /* Bank 0 */
495 CLK(uniproclk, "uniproclk", NULL),
496 CLK(dsialtclk, "dsialt", NULL),
497
498 /* Bank 1 */
499 CLK(rngclk, "rng", NULL),
500 CLK(uiccclk, "uicc", NULL),
501};
502
503#ifdef CONFIG_DEBUG_FS
504/*
505 * debugfs support to trace clock tree hierarchy and attributes with
506 * powerdebug
507 */
508static struct dentry *clk_debugfs_root;
509
510void __init clk_debugfs_add_table(struct clk_lookup *cl, size_t num)
511{
512 while (num--) {
513 /* Check that the clock has not been already registered */
514 if (!(cl->clk->list.prev != cl->clk->list.next))
515 list_add_tail(&cl->clk->list, &clk_list);
516
517 cl++;
518 }
519}
520
521static ssize_t usecount_dbg_read(struct file *file, char __user *buf,
522 size_t size, loff_t *off)
523{
524 struct clk *clk = file->f_dentry->d_inode->i_private;
525 char cusecount[128];
526 unsigned int len;
527
528 len = sprintf(cusecount, "%u\n", clk->enabled);
529 return simple_read_from_buffer(buf, size, off, cusecount, len);
530}
531
532static ssize_t rate_dbg_read(struct file *file, char __user *buf,
533 size_t size, loff_t *off)
534{
535 struct clk *clk = file->f_dentry->d_inode->i_private;
536 char crate[128];
537 unsigned int rate;
538 unsigned int len;
539
540 rate = clk_get_rate(clk);
541 len = sprintf(crate, "%u\n", rate);
542 return simple_read_from_buffer(buf, size, off, crate, len);
543}
544
545static const struct file_operations usecount_fops = {
546 .read = usecount_dbg_read,
547};
548
549static const struct file_operations set_rate_fops = {
550 .read = rate_dbg_read,
551};
552
553static struct dentry *clk_debugfs_register_dir(struct clk *c,
554 struct dentry *p_dentry)
555{
556 struct dentry *d, *clk_d;
557 const char *p = c->name;
558
559 if (!p)
560 p = "BUG";
561
562 clk_d = debugfs_create_dir(p, p_dentry);
563 if (!clk_d)
564 return NULL;
565
566 d = debugfs_create_file("usecount", S_IRUGO,
567 clk_d, c, &usecount_fops);
568 if (!d)
569 goto err_out;
570 d = debugfs_create_file("rate", S_IRUGO,
571 clk_d, c, &set_rate_fops);
572 if (!d)
573 goto err_out;
574 /*
575 * TODO : not currently available in ux500
576 * d = debugfs_create_x32("flags", S_IRUGO, clk_d, (u32 *)&c->flags);
577 * if (!d)
578 * goto err_out;
579 */
580
581 return clk_d;
582
583err_out:
584 debugfs_remove_recursive(clk_d);
585 return NULL;
586}
587
588static int clk_debugfs_register_one(struct clk *c)
589{
590 struct clk *pa = c->parent_periph;
591 struct clk *bpa = c->parent_cluster;
592
593 if (!(bpa && !pa)) {
594 c->dent = clk_debugfs_register_dir(c,
595 pa ? pa->dent : clk_debugfs_root);
596 if (!c->dent)
597 return -ENOMEM;
598 }
599
600 if (bpa) {
601 c->dent_bus = clk_debugfs_register_dir(c,
602 bpa->dent_bus ? bpa->dent_bus : bpa->dent);
603 if ((!c->dent_bus) && (c->dent)) {
604 debugfs_remove_recursive(c->dent);
605 c->dent = NULL;
606 return -ENOMEM;
607 }
608 }
609 return 0;
610}
611
612static int clk_debugfs_register(struct clk *c)
613{
614 int err;
615 struct clk *pa = c->parent_periph;
616 struct clk *bpa = c->parent_cluster;
617
618 if (pa && (!pa->dent && !pa->dent_bus)) {
619 err = clk_debugfs_register(pa);
620 if (err)
621 return err;
622 }
623
624 if (bpa && (!bpa->dent && !bpa->dent_bus)) {
625 err = clk_debugfs_register(bpa);
626 if (err)
627 return err;
628 }
629
630 if ((!c->dent) && (!c->dent_bus)) {
631 err = clk_debugfs_register_one(c);
632 if (err)
633 return err;
634 }
635 return 0;
636}
637
638int __init clk_debugfs_init(void)
639{
640 struct clk *c;
641 struct dentry *d;
642 int err;
643
644 d = debugfs_create_dir("clock", NULL);
645 if (!d)
646 return -ENOMEM;
647 clk_debugfs_root = d;
648
649 list_for_each_entry(c, &clk_list, list) {
650 err = clk_debugfs_register(c);
651 if (err)
652 goto err_out;
653 }
654 return 0;
655err_out:
656 debugfs_remove_recursive(clk_debugfs_root);
657 return err;
658}
659
660#endif /* defined(CONFIG_DEBUG_FS) */
661
662unsigned long clk_smp_twd_rate = 500000000;
663
664unsigned long clk_smp_twd_get_rate(struct clk *clk)
665{
666 return clk_smp_twd_rate;
667}
668
669static struct clk clk_smp_twd = {
670 .get_rate = clk_smp_twd_get_rate,
671 .name = "smp_twd",
672};
673
674static struct clk_lookup clk_smp_twd_lookup = {
675 .dev_id = "smp_twd",
676 .clk = &clk_smp_twd,
677};
678
679#ifdef CONFIG_CPU_FREQ
680
681static int clk_twd_cpufreq_transition(struct notifier_block *nb,
682 unsigned long state, void *data)
683{
684 struct cpufreq_freqs *f = data;
685
686 if (state == CPUFREQ_PRECHANGE) {
687 /* Save frequency in simple Hz */
688 clk_smp_twd_rate = (f->new * 1000) / 2;
689 }
690
691 return NOTIFY_OK;
692}
693
694static struct notifier_block clk_twd_cpufreq_nb = {
695 .notifier_call = clk_twd_cpufreq_transition,
696};
697
698int clk_init_smp_twd_cpufreq(void)
699{
700 return cpufreq_register_notifier(&clk_twd_cpufreq_nb,
701 CPUFREQ_TRANSITION_NOTIFIER);
702}
703
704#endif
705
706int __init clk_init(void)
707{
708 clkdev_add_table(u8500_clks, ARRAY_SIZE(u8500_clks));
709 clkdev_add(&clk_smp_twd_lookup);
710
711#ifdef CONFIG_DEBUG_FS
712 clk_debugfs_add_table(u8500_clks, ARRAY_SIZE(u8500_clks));
713#endif
714 return 0;
715}
diff --git a/arch/arm/mach-ux500/clock.h b/arch/arm/mach-ux500/clock.h
deleted file mode 100644
index 65d27a13f46..00000000000
--- a/arch/arm/mach-ux500/clock.h
+++ /dev/null
@@ -1,164 +0,0 @@
1/*
2 * Copyright (C) 2010 ST-Ericsson
3 * Copyright (C) 2009 STMicroelectronics
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/**
11 * struct clkops - ux500 clock operations
12 * @enable: function to enable the clock
13 * @disable: function to disable the clock
14 * @get_rate: function to get the current clock rate
15 *
16 * This structure contains function pointers to functions that will be used to
17 * control the clock. All of these functions are optional. If get_rate is
18 * NULL, the rate in the struct clk will be used.
19 */
20struct clkops {
21 void (*enable) (struct clk *);
22 void (*disable) (struct clk *);
23 unsigned long (*get_rate) (struct clk *);
24 int (*set_parent)(struct clk *, struct clk *);
25};
26
27/**
28 * struct clk - ux500 clock structure
29 * @ops: pointer to clkops struct used to control this clock
30 * @name: name, for debugging
31 * @enabled: refcount. positive if enabled, zero if disabled
32 * @get_rate: custom callback for getting the clock rate
33 * @data: custom per-clock data for example for the get_rate
34 * callback
35 * @rate: fixed rate for clocks which don't implement
36 * ops->getrate
37 * @prcmu_cg_off: address offset of the combined enable/disable register
38 * (used on u8500v1)
39 * @prcmu_cg_bit: bit in the combined enable/disable register (used on
40 * u8500v1)
41 * @prcmu_cg_mgt: address of the enable/disable register (used on
42 * u8500ed)
43 * @cluster: peripheral cluster number
44 * @prcc_bus: bit for the bus clock in the peripheral's CLKRST
45 * @prcc_kernel: bit for the kernel clock in the peripheral's CLKRST.
46 * -1 if no kernel clock exists.
47 * @parent_cluster: pointer to parent's cluster clk struct
48 * @parent_periph: pointer to parent's peripheral clk struct
49 *
50 * Peripherals are organised into clusters, and each cluster has an associated
51 * bus clock. Some peripherals also have a parent peripheral clock.
52 *
53 * In order to enable a clock for a peripheral, we need to enable:
54 * (1) the parent cluster (bus) clock at the PRCMU level
55 * (2) the parent peripheral clock (if any) at the PRCMU level
56 * (3) the peripheral's bus & kernel clock at the PRCC level
57 *
58 * (1) and (2) are handled by defining clk structs (DEFINE_PRCMU_CLK) for each
59 * of the cluster and peripheral clocks, and hooking these as the parents of
60 * the individual peripheral clocks.
61 *
62 * (3) is handled by specifying the bits in the PRCC control registers required
63 * to enable these clocks and modifying them in the ->enable and
64 * ->disable callbacks of the peripheral clocks (DEFINE_PRCC_CLK).
65 *
66 * This structure describes both the PRCMU-level clocks and PRCC-level clocks.
67 * The prcmu_* fields are only used for the PRCMU clocks, and the cluster,
68 * prcc, and parent pointers are only used for the PRCC-level clocks.
69 */
70struct clk {
71 const struct clkops *ops;
72 const char *name;
73 unsigned int enabled;
74 unsigned long (*get_rate)(struct clk *);
75 void *data;
76
77 unsigned long rate;
78 struct list_head list;
79
80 /* These three are only for PRCMU clks */
81
82 unsigned int prcmu_cg_off;
83 unsigned int prcmu_cg_bit;
84 unsigned int prcmu_cg_mgt;
85
86 /* The rest are only for PRCC clks */
87
88 int cluster;
89 unsigned int prcc_bus;
90 unsigned int prcc_kernel;
91
92 struct clk *parent_cluster;
93 struct clk *parent_periph;
94#if defined(CONFIG_DEBUG_FS)
95 struct dentry *dent; /* For visible tree hierarchy */
96 struct dentry *dent_bus; /* For visible tree hierarchy */
97#endif
98};
99
100#define DEFINE_PRCMU_CLK(_name, _cg_off, _cg_bit, _reg) \
101struct clk clk_##_name = { \
102 .name = #_name, \
103 .ops = &clk_prcmu_ops, \
104 .prcmu_cg_off = _cg_off, \
105 .prcmu_cg_bit = _cg_bit, \
106 .prcmu_cg_mgt = PRCM_##_reg##_MGT \
107 }
108
109#define DEFINE_PRCMU_CLK_RATE(_name, _cg_off, _cg_bit, _reg, _rate) \
110struct clk clk_##_name = { \
111 .name = #_name, \
112 .ops = &clk_prcmu_ops, \
113 .prcmu_cg_off = _cg_off, \
114 .prcmu_cg_bit = _cg_bit, \
115 .rate = _rate, \
116 .prcmu_cg_mgt = PRCM_##_reg##_MGT \
117 }
118
119#define DEFINE_PRCC_CLK(_pclust, _name, _bus_en, _kernel_en, _kernclk) \
120struct clk clk_##_name = { \
121 .name = #_name, \
122 .ops = &clk_prcc_ops, \
123 .cluster = _pclust, \
124 .prcc_bus = _bus_en, \
125 .prcc_kernel = _kernel_en, \
126 .parent_cluster = &clk_per##_pclust##clk, \
127 .parent_periph = _kernclk \
128 }
129
130#define DEFINE_PRCC_CLK_CUSTOM(_pclust, _name, _bus_en, _kernel_en, _kernclk, _callback, _data) \
131struct clk clk_##_name = { \
132 .name = #_name, \
133 .ops = &clk_prcc_ops, \
134 .cluster = _pclust, \
135 .prcc_bus = _bus_en, \
136 .prcc_kernel = _kernel_en, \
137 .parent_cluster = &clk_per##_pclust##clk, \
138 .parent_periph = _kernclk, \
139 .get_rate = _callback, \
140 .data = (void *) _data \
141 }
142
143
144#define CLK(_clk, _devname, _conname) \
145 { \
146 .clk = &clk_##_clk, \
147 .dev_id = _devname, \
148 .con_id = _conname, \
149 }
150
151int __init clk_db8500_ed_fixup(void);
152int __init clk_init(void);
153
154#ifdef CONFIG_DEBUG_FS
155int clk_debugfs_init(void);
156#else
157static inline int clk_debugfs_init(void) { return 0; }
158#endif
159
160#ifdef CONFIG_CPU_FREQ
161int clk_init_smp_twd_cpufreq(void);
162#else
163static inline int clk_init_smp_twd_cpufreq(void) { return 0; }
164#endif
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index db3c52d56ca..bcdfe6b1d45 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -18,13 +18,13 @@
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/mfd/abx500/ab8500.h> 19#include <linux/mfd/abx500/ab8500.h>
20 20
21#include <asm/mach/map.h>
22#include <asm/pmu.h> 21#include <asm/pmu.h>
22#include <asm/mach/map.h>
23#include <plat/gpio-nomadik.h> 23#include <plat/gpio-nomadik.h>
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <mach/setup.h> 25#include <mach/setup.h>
26#include <mach/devices.h> 26#include <mach/devices.h>
27#include <mach/usb.h> 27#include <linux/platform_data/usb-musb-ux500.h>
28#include <mach/db8500-regs.h> 28#include <mach/db8500-regs.h>
29 29
30#include "devices-db8500.h" 30#include "devices-db8500.h"
@@ -80,7 +80,7 @@ void __init u8500_map_io(void)
80 80
81 iotable_init(u8500_common_io_desc, ARRAY_SIZE(u8500_common_io_desc)); 81 iotable_init(u8500_common_io_desc, ARRAY_SIZE(u8500_common_io_desc));
82 82
83 if (cpu_is_u9540()) 83 if (cpu_is_ux540_family())
84 iotable_init(u9540_io_desc, ARRAY_SIZE(u9540_io_desc)); 84 iotable_init(u9540_io_desc, ARRAY_SIZE(u9540_io_desc));
85 else 85 else
86 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); 86 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc));
@@ -122,7 +122,7 @@ struct arm_pmu_platdata db8500_pmu_platdata = {
122 122
123static struct platform_device db8500_pmu_device = { 123static struct platform_device db8500_pmu_device = {
124 .name = "arm-pmu", 124 .name = "arm-pmu",
125 .id = ARM_PMU_DEVICE_CPU, 125 .id = -1,
126 .num_resources = ARRAY_SIZE(db8500_pmu_resources), 126 .num_resources = ARRAY_SIZE(db8500_pmu_resources),
127 .resource = db8500_pmu_resources, 127 .resource = db8500_pmu_resources,
128 .dev.platform_data = &db8500_pmu_platdata, 128 .dev.platform_data = &db8500_pmu_platdata,
@@ -138,10 +138,6 @@ static struct platform_device *platform_devs[] __initdata = {
138 &db8500_prcmu_device, 138 &db8500_prcmu_device,
139}; 139};
140 140
141static struct platform_device *of_platform_devs[] __initdata = {
142 &u8500_dma40_device,
143};
144
145static resource_size_t __initdata db8500_gpio_base[] = { 141static resource_size_t __initdata db8500_gpio_base[] = {
146 U8500_GPIOBANK0_BASE, 142 U8500_GPIOBANK0_BASE,
147 U8500_GPIOBANK1_BASE, 143 U8500_GPIOBANK1_BASE,
@@ -235,7 +231,6 @@ struct device * __init u8500_init_devices(struct ab8500_platform_data *ab8500)
235struct device * __init u8500_of_init_devices(void) 231struct device * __init u8500_of_init_devices(void)
236{ 232{
237 struct device *parent; 233 struct device *parent;
238 int i;
239 234
240 parent = db8500_soc_device_init(); 235 parent = db8500_soc_device_init();
241 236
@@ -244,8 +239,7 @@ struct device * __init u8500_of_init_devices(void)
244 platform_device_register_data(parent, 239 platform_device_register_data(parent,
245 "cpufreq-u8500", -1, NULL, 0); 240 "cpufreq-u8500", -1, NULL, 0);
246 241
247 for (i = 0; i < ARRAY_SIZE(of_platform_devs); i++) 242 u8500_dma40_device.dev.parent = parent;
248 of_platform_devs[i]->dev.parent = parent;
249 243
250 /* 244 /*
251 * Devices to be DT:ed: 245 * Devices to be DT:ed:
@@ -253,7 +247,7 @@ struct device * __init u8500_of_init_devices(void)
253 * db8500_pmu_device = done 247 * db8500_pmu_device = done
254 * db8500_prcmu_device = done 248 * db8500_prcmu_device = done
255 */ 249 */
256 platform_add_devices(of_platform_devs, ARRAY_SIZE(of_platform_devs)); 250 platform_device_register(&u8500_dma40_device);
257 251
258 return parent; 252 return parent;
259} 253}
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index e2360e7c770..2236cbd03cd 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -8,7 +8,6 @@
8 8
9#include <linux/platform_device.h> 9#include <linux/platform_device.h>
10#include <linux/io.h> 10#include <linux/io.h>
11#include <linux/clk.h>
12#include <linux/mfd/db8500-prcmu.h> 11#include <linux/mfd/db8500-prcmu.h>
13#include <linux/clksrc-dbx500-prcmu.h> 12#include <linux/clksrc-dbx500-prcmu.h>
14#include <linux/sys_soc.h> 13#include <linux/sys_soc.h>
@@ -17,6 +16,7 @@
17#include <linux/stat.h> 16#include <linux/stat.h>
18#include <linux/of.h> 17#include <linux/of.h>
19#include <linux/of_irq.h> 18#include <linux/of_irq.h>
19#include <linux/platform_data/clk-ux500.h>
20 20
21#include <asm/hardware/gic.h> 21#include <asm/hardware/gic.h>
22#include <asm/mach/map.h> 22#include <asm/mach/map.h>
@@ -25,8 +25,6 @@
25#include <mach/setup.h> 25#include <mach/setup.h>
26#include <mach/devices.h> 26#include <mach/devices.h>
27 27
28#include "clock.h"
29
30void __iomem *_PRCMU_BASE; 28void __iomem *_PRCMU_BASE;
31 29
32/* 30/*
@@ -51,7 +49,9 @@ void __init ux500_init_irq(void)
51 void __iomem *dist_base; 49 void __iomem *dist_base;
52 void __iomem *cpu_base; 50 void __iomem *cpu_base;
53 51
54 if (cpu_is_u8500_family()) { 52 gic_arch_extn.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND;
53
54 if (cpu_is_u8500_family() || cpu_is_ux540_family()) {
55 dist_base = __io_address(U8500_GIC_DIST_BASE); 55 dist_base = __io_address(U8500_GIC_DIST_BASE);
56 cpu_base = __io_address(U8500_GIC_CPU_BASE); 56 cpu_base = __io_address(U8500_GIC_CPU_BASE);
57 } else 57 } else
@@ -70,13 +70,17 @@ void __init ux500_init_irq(void)
70 */ 70 */
71 if (cpu_is_u8500_family()) 71 if (cpu_is_u8500_family())
72 db8500_prcmu_early_init(); 72 db8500_prcmu_early_init();
73 clk_init(); 73
74 if (cpu_is_u8500_family())
75 u8500_clk_init();
76 else if (cpu_is_u9540())
77 u9540_clk_init();
78 else if (cpu_is_u8540())
79 u8540_clk_init();
74} 80}
75 81
76void __init ux500_init_late(void) 82void __init ux500_init_late(void)
77{ 83{
78 clk_debugfs_init();
79 clk_init_smp_twd_cpufreq();
80} 84}
81 85
82static const char * __init ux500_get_machine(void) 86static const char * __init ux500_get_machine(void)
diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h
index ecdd8386cff..7fbf0ba336e 100644
--- a/arch/arm/mach-ux500/devices-common.h
+++ b/arch/arm/mach-ux500/devices-common.h
@@ -13,7 +13,7 @@
13#include <linux/sys_soc.h> 13#include <linux/sys_soc.h>
14#include <linux/amba/bus.h> 14#include <linux/amba/bus.h>
15#include <linux/platform_data/i2c-nomadik.h> 15#include <linux/platform_data/i2c-nomadik.h>
16#include <mach/crypto-ux500.h> 16#include <linux/platform_data/crypto-ux500.h>
17 17
18struct spi_master_cntlr; 18struct spi_master_cntlr;
19 19
diff --git a/arch/arm/mach-ux500/hotplug.c b/arch/arm/mach-ux500/hotplug.c
index c76f0f456f0..2f6af259015 100644
--- a/arch/arm/mach-ux500/hotplug.c
+++ b/arch/arm/mach-ux500/hotplug.c
@@ -15,13 +15,18 @@
15#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
16#include <asm/smp_plat.h> 16#include <asm/smp_plat.h>
17 17
18extern volatile int pen_release; 18#include <mach/setup.h>
19 19
20static inline void platform_do_lowpower(unsigned int cpu) 20/*
21 * platform-specific code to shutdown a CPU
22 *
23 * Called with IRQs disabled
24 */
25void __ref ux500_cpu_die(unsigned int cpu)
21{ 26{
22 flush_cache_all(); 27 flush_cache_all();
23 28
24 /* we put the platform to just WFI */ 29 /* directly enter low power state, skipping secure registers */
25 for (;;) { 30 for (;;) {
26 __asm__ __volatile__("dsb\n\t" "wfi\n\t" 31 __asm__ __volatile__("dsb\n\t" "wfi\n\t"
27 : : : "memory"); 32 : : : "memory");
@@ -33,28 +38,3 @@ static inline void platform_do_lowpower(unsigned int cpu)
33 } 38 }
34 } 39 }
35} 40}
36
37int platform_cpu_kill(unsigned int cpu)
38{
39 return 1;
40}
41
42/*
43 * platform-specific code to shutdown a CPU
44 *
45 * Called with IRQs disabled
46 */
47void platform_cpu_die(unsigned int cpu)
48{
49 /* directly enter low power state, skipping secure registers */
50 platform_do_lowpower(cpu);
51}
52
53int platform_cpu_disable(unsigned int cpu)
54{
55 /*
56 * we don't allow CPU 0 to be shutdown (it is still too special
57 * e.g. clock tick interrupts)
58 */
59 return cpu == 0 ? -EPERM : 0;
60}
diff --git a/arch/arm/mach-ux500/include/mach/crypto-ux500.h b/arch/arm/mach-ux500/include/mach/crypto-ux500.h
deleted file mode 100644
index 5b2d0817e26..00000000000
--- a/arch/arm/mach-ux500/include/mach/crypto-ux500.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * Author: Joakim Bech <joakim.xx.bech@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7#ifndef _CRYPTO_UX500_H
8#define _CRYPTO_UX500_H
9#include <linux/dmaengine.h>
10#include <plat/ste_dma40.h>
11
12struct hash_platform_data {
13 void *mem_to_engine;
14 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
15};
16
17struct cryp_platform_data {
18 struct stedma40_chan_cfg mem_to_engine;
19 struct stedma40_chan_cfg engine_to_mem;
20};
21
22#endif
diff --git a/arch/arm/mach-ux500/include/mach/gpio.h b/arch/arm/mach-ux500/include/mach/gpio.h
deleted file mode 100644
index c01ef66537f..00000000000
--- a/arch/arm/mach-ux500/include/mach/gpio.h
+++ /dev/null
@@ -1,5 +0,0 @@
1#ifndef __ASM_ARCH_GPIO_H
2#define __ASM_ARCH_GPIO_H
3
4
5#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-ux500/include/mach/id.h b/arch/arm/mach-ux500/include/mach/id.h
index c6e2db9e9e5..9c42642ab16 100644
--- a/arch/arm/mach-ux500/include/mach/id.h
+++ b/arch/arm/mach-ux500/include/mach/id.h
@@ -41,43 +41,29 @@ static inline bool __attribute_const__ cpu_is_u8500(void)
41 return dbx500_partnumber() == 0x8500; 41 return dbx500_partnumber() == 0x8500;
42} 42}
43 43
44static inline bool __attribute_const__ cpu_is_u9540(void) 44static inline bool __attribute_const__ cpu_is_u8520(void)
45{ 45{
46 return dbx500_partnumber() == 0x9540; 46 return dbx500_partnumber() == 0x8520;
47} 47}
48 48
49static inline bool cpu_is_u8500_family(void) 49static inline bool cpu_is_u8500_family(void)
50{ 50{
51 return cpu_is_u8500() || cpu_is_u9540(); 51 return cpu_is_u8500() || cpu_is_u8520();
52}
53
54static inline bool __attribute_const__ cpu_is_u5500(void)
55{
56 return dbx500_partnumber() == 0x5500;
57}
58
59/*
60 * 5500 revisions
61 */
62
63static inline bool __attribute_const__ cpu_is_u5500v1(void)
64{
65 return cpu_is_u5500() && (dbx500_revision() & 0xf0) == 0xA0;
66} 52}
67 53
68static inline bool __attribute_const__ cpu_is_u5500v2(void) 54static inline bool __attribute_const__ cpu_is_u9540(void)
69{ 55{
70 return (dbx500_id.revision & 0xf0) == 0xB0; 56 return dbx500_partnumber() == 0x9540;
71} 57}
72 58
73static inline bool __attribute_const__ cpu_is_u5500v20(void) 59static inline bool __attribute_const__ cpu_is_u8540(void)
74{ 60{
75 return cpu_is_u5500() && ((dbx500_revision() & 0xf0) == 0xB0); 61 return dbx500_partnumber() == 0x8540;
76} 62}
77 63
78static inline bool __attribute_const__ cpu_is_u5500v21(void) 64static inline bool cpu_is_ux540_family(void)
79{ 65{
80 return cpu_is_u5500() && (dbx500_revision() == 0xB1); 66 return cpu_is_u9540() || cpu_is_u8540();
81} 67}
82 68
83/* 69/*
@@ -119,14 +105,14 @@ static inline bool cpu_is_u8500v21(void)
119 return cpu_is_u8500() && (dbx500_revision() == 0xB1); 105 return cpu_is_u8500() && (dbx500_revision() == 0xB1);
120} 106}
121 107
108static inline bool cpu_is_u8500v22(void)
109{
110 return cpu_is_u8500() && (dbx500_revision() == 0xB2);
111}
112
122static inline bool cpu_is_u8500v20_or_later(void) 113static inline bool cpu_is_u8500v20_or_later(void)
123{ 114{
124 /* 115 return (cpu_is_u8500() && !cpu_is_u8500v10() && !cpu_is_u8500v11());
125 * U9540 has so much in common with U8500 that is is considered a
126 * U8500 variant.
127 */
128 return cpu_is_u9540() ||
129 (cpu_is_u8500() && !cpu_is_u8500v10() && !cpu_is_u8500v11());
130} 116}
131 117
132static inline bool ux500_is_svp(void) 118static inline bool ux500_is_svp(void)
diff --git a/arch/arm/mach-ux500/include/mach/msp.h b/arch/arm/mach-ux500/include/mach/msp.h
index 798be19129e..3cc7142eee0 100644
--- a/arch/arm/mach-ux500/include/mach/msp.h
+++ b/arch/arm/mach-ux500/include/mach/msp.h
@@ -22,8 +22,6 @@ struct msp_i2s_platform_data {
22 enum msp_i2s_id id; 22 enum msp_i2s_id id;
23 struct stedma40_chan_cfg *msp_i2s_dma_rx; 23 struct stedma40_chan_cfg *msp_i2s_dma_rx;
24 struct stedma40_chan_cfg *msp_i2s_dma_tx; 24 struct stedma40_chan_cfg *msp_i2s_dma_tx;
25 int (*msp_i2s_init) (void);
26 int (*msp_i2s_exit) (void);
27}; 25};
28 26
29#endif 27#endif
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
index 7914e5eaa9c..6be4c4d2ab8 100644
--- a/arch/arm/mach-ux500/include/mach/setup.h
+++ b/arch/arm/mach-ux500/include/mach/setup.h
@@ -45,4 +45,7 @@ extern struct sys_timer ux500_timer;
45 .type = MT_MEMORY, \ 45 .type = MT_MEMORY, \
46} 46}
47 47
48extern struct smp_operations ux500_smp_ops;
49extern void ux500_cpu_die(unsigned int cpu);
50
48#endif /* __ASM_ARCH_SETUP_H */ 51#endif /* __ASM_ARCH_SETUP_H */
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
index 34775baadae..d60ecd1753f 100644
--- a/arch/arm/mach-ux500/include/mach/uncompress.h
+++ b/arch/arm/mach-ux500/include/mach/uncompress.h
@@ -24,7 +24,7 @@
24#include <linux/amba/serial.h> 24#include <linux/amba/serial.h>
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26 26
27u32 ux500_uart_base; 27void __iomem *ux500_uart_base;
28 28
29static void putc(const char c) 29static void putc(const char c)
30{ 30{
@@ -51,7 +51,7 @@ static void flush(void)
51static inline void arch_decomp_setup(void) 51static inline void arch_decomp_setup(void)
52{ 52{
53 /* Use machine_is_foo() macro if you need to switch base someday */ 53 /* Use machine_is_foo() macro if you need to switch base someday */
54 ux500_uart_base = 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 */ 57#define arch_decomp_wdog() /* nothing to do here */
diff --git a/arch/arm/mach-ux500/include/mach/usb.h b/arch/arm/mach-ux500/include/mach/usb.h
deleted file mode 100644
index 4c1cc50a595..00000000000
--- a/arch/arm/mach-ux500/include/mach/usb.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * Author: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7#ifndef __ASM_ARCH_USB_H
8#define __ASM_ARCH_USB_H
9
10#include <linux/dmaengine.h>
11
12#define UX500_MUSB_DMA_NUM_RX_CHANNELS 8
13#define UX500_MUSB_DMA_NUM_TX_CHANNELS 8
14
15struct ux500_musb_board_data {
16 void **dma_rx_param_array;
17 void **dma_tx_param_array;
18 u32 num_rx_channels;
19 u32 num_tx_channels;
20 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
21};
22
23void ux500_add_usb(struct device *parent, resource_size_t base,
24 int irq, int *dma_rx_cfg, int *dma_tx_cfg);
25#endif
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index da1d5ad5bd4..3db7782f3af 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -28,12 +28,6 @@
28extern void u8500_secondary_startup(void); 28extern void u8500_secondary_startup(void);
29 29
30/* 30/*
31 * control for which core is the next to come out of the secondary
32 * boot "holding pen"
33 */
34volatile int pen_release = -1;
35
36/*
37 * Write pen_release in a way that is guaranteed to be visible to all 31 * Write pen_release in a way that is guaranteed to be visible to all
38 * observers, irrespective of whether they're taking part in coherency 32 * observers, irrespective of whether they're taking part in coherency
39 * or not. This is necessary for the hotplug code to work reliably. 33 * or not. This is necessary for the hotplug code to work reliably.
@@ -48,7 +42,7 @@ static void write_pen_release(int val)
48 42
49static void __iomem *scu_base_addr(void) 43static void __iomem *scu_base_addr(void)
50{ 44{
51 if (cpu_is_u8500_family()) 45 if (cpu_is_u8500_family() || cpu_is_ux540_family())
52 return __io_address(U8500_SCU_BASE); 46 return __io_address(U8500_SCU_BASE);
53 else 47 else
54 ux500_unknown_soc(); 48 ux500_unknown_soc();
@@ -58,7 +52,7 @@ static void __iomem *scu_base_addr(void)
58 52
59static DEFINE_SPINLOCK(boot_lock); 53static DEFINE_SPINLOCK(boot_lock);
60 54
61void __cpuinit platform_secondary_init(unsigned int cpu) 55static void __cpuinit ux500_secondary_init(unsigned int cpu)
62{ 56{
63 /* 57 /*
64 * if any interrupts are already enabled for the primary 58 * if any interrupts are already enabled for the primary
@@ -80,7 +74,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
80 spin_unlock(&boot_lock); 74 spin_unlock(&boot_lock);
81} 75}
82 76
83int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 77static int __cpuinit ux500_boot_secondary(unsigned int cpu, struct task_struct *idle)
84{ 78{
85 unsigned long timeout; 79 unsigned long timeout;
86 80
@@ -118,7 +112,7 @@ static void __init wakeup_secondary(void)
118{ 112{
119 void __iomem *backupram; 113 void __iomem *backupram;
120 114
121 if (cpu_is_u8500_family()) 115 if (cpu_is_u8500_family() || cpu_is_ux540_family())
122 backupram = __io_address(U8500_BACKUPRAM0_BASE); 116 backupram = __io_address(U8500_BACKUPRAM0_BASE);
123 else 117 else
124 ux500_unknown_soc(); 118 ux500_unknown_soc();
@@ -145,7 +139,7 @@ static void __init wakeup_secondary(void)
145 * Initialise the CPU possible map early - this describes the CPUs 139 * Initialise the CPU possible map early - this describes the CPUs
146 * which may be present or become present in the system. 140 * which may be present or become present in the system.
147 */ 141 */
148void __init smp_init_cpus(void) 142static void __init ux500_smp_init_cpus(void)
149{ 143{
150 void __iomem *scu_base = scu_base_addr(); 144 void __iomem *scu_base = scu_base_addr();
151 unsigned int i, ncores; 145 unsigned int i, ncores;
@@ -165,9 +159,19 @@ void __init smp_init_cpus(void)
165 set_smp_cross_call(gic_raise_softirq); 159 set_smp_cross_call(gic_raise_softirq);
166} 160}
167 161
168void __init platform_smp_prepare_cpus(unsigned int max_cpus) 162static void __init ux500_smp_prepare_cpus(unsigned int max_cpus)
169{ 163{
170 164
171 scu_enable(scu_base_addr()); 165 scu_enable(scu_base_addr());
172 wakeup_secondary(); 166 wakeup_secondary();
173} 167}
168
169struct smp_operations ux500_smp_ops __initdata = {
170 .smp_init_cpus = ux500_smp_init_cpus,
171 .smp_prepare_cpus = ux500_smp_prepare_cpus,
172 .smp_secondary_init = ux500_secondary_init,
173 .smp_boot_secondary = ux500_boot_secondary,
174#ifdef CONFIG_HOTPLUG_CPU
175 .cpu_die = ux500_cpu_die,
176#endif
177};
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c
index 66e7f00884a..6f39731951b 100644
--- a/arch/arm/mach-ux500/timer.c
+++ b/arch/arm/mach-ux500/timer.c
@@ -54,7 +54,7 @@ static void __init ux500_timer_init(void)
54 void __iomem *tmp_base; 54 void __iomem *tmp_base;
55 struct device_node *np; 55 struct device_node *np;
56 56
57 if (cpu_is_u8500_family()) { 57 if (cpu_is_u8500_family() || cpu_is_ux540_family()) {
58 mtu_timer_base = __io_address(U8500_MTU0_BASE); 58 mtu_timer_base = __io_address(U8500_MTU0_BASE);
59 prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE); 59 prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE);
60 } else { 60 } else {
diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c
index a74af389bc6..145482e7441 100644
--- a/arch/arm/mach-ux500/usb.c
+++ b/arch/arm/mach-ux500/usb.c
@@ -10,7 +10,7 @@
10 10
11#include <plat/ste_dma40.h> 11#include <plat/ste_dma40.h>
12#include <mach/hardware.h> 12#include <mach/hardware.h>
13#include <mach/usb.h> 13#include <linux/platform_data/usb-musb-ux500.h>
14 14
15#define MUSB_DMA40_RX_CH { \ 15#define MUSB_DMA40_RX_CH { \
16 .mode = STEDMA40_MODE_LOGICAL, \ 16 .mode = STEDMA40_MODE_LOGICAL, \
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
index c1f38f6625b..63d8e9f81b9 100644
--- a/arch/arm/mach-versatile/Kconfig
+++ b/arch/arm/mach-versatile/Kconfig
@@ -3,9 +3,9 @@ menu "Versatile platform type"
3 3
4config ARCH_VERSATILE_PB 4config ARCH_VERSATILE_PB
5 bool "Support Versatile Platform Baseboard for ARM926EJ-S" 5 bool "Support Versatile Platform Baseboard for ARM926EJ-S"
6 default y
6 select CPU_ARM926T 7 select CPU_ARM926T
7 select MIGHT_HAVE_PCI 8 select MIGHT_HAVE_PCI
8 default y
9 help 9 help
10 Include support for the ARM(R) Versatile Platform Baseboard 10 Include support for the ARM(R) Versatile Platform Baseboard
11 for the ARM926EJ-S. 11 for the ARM926EJ-S.
@@ -19,8 +19,8 @@ config MACH_VERSATILE_AB
19 19
20config MACH_VERSATILE_DT 20config MACH_VERSATILE_DT
21 bool "Support Versatile platform from device tree" 21 bool "Support Versatile platform from device tree"
22 select USE_OF
23 select CPU_ARM926T 22 select CPU_ARM926T
23 select USE_OF
24 help 24 help
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
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index cd8ea3588f9..5b5c1eeb5b5 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -37,7 +37,6 @@
37#include <linux/mtd/physmap.h> 37#include <linux/mtd/physmap.h>
38 38
39#include <asm/irq.h> 39#include <asm/irq.h>
40#include <asm/leds.h>
41#include <asm/hardware/arm_timer.h> 40#include <asm/hardware/arm_timer.h>
42#include <asm/hardware/icst.h> 41#include <asm/hardware/icst.h>
43#include <asm/hardware/vic.h> 42#include <asm/hardware/vic.h>
@@ -169,11 +168,6 @@ static struct map_desc versatile_io_desc[] __initdata = {
169 .pfn = __phys_to_pfn(VERSATILE_PCI_CFG_BASE), 168 .pfn = __phys_to_pfn(VERSATILE_PCI_CFG_BASE),
170 .length = VERSATILE_PCI_CFG_BASE_SIZE, 169 .length = VERSATILE_PCI_CFG_BASE_SIZE,
171 .type = MT_DEVICE 170 .type = MT_DEVICE
172 }, {
173 .virtual = (unsigned long)VERSATILE_PCI_VIRT_MEM_BASE0,
174 .pfn = __phys_to_pfn(VERSATILE_PCI_MEM_BASE0),
175 .length = IO_SPACE_LIMIT,
176 .type = MT_DEVICE
177 }, 171 },
178#endif 172#endif
179}; 173};
@@ -763,10 +757,6 @@ void __init versatile_init(void)
763 struct amba_device *d = amba_devs[i]; 757 struct amba_device *d = amba_devs[i];
764 amba_device_register(d, &iomem_resource); 758 amba_device_register(d, &iomem_resource);
765 } 759 }
766
767#ifdef CONFIG_LEDS
768 leds_event = versatile_leds_event;
769#endif
770} 760}
771 761
772/* 762/*
diff --git a/arch/arm/mach-versatile/include/mach/gpio.h b/arch/arm/mach-versatile/include/mach/gpio.h
deleted file mode 100644
index 40a8c178f10..00000000000
--- a/arch/arm/mach-versatile/include/mach/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/mach-versatile/include/mach/hardware.h b/arch/arm/mach-versatile/include/mach/hardware.h
index 408e58da46c..3e5d425e2a9 100644
--- a/arch/arm/mach-versatile/include/mach/hardware.h
+++ b/arch/arm/mach-versatile/include/mach/hardware.h
@@ -29,7 +29,6 @@
29 */ 29 */
30#define VERSATILE_PCI_VIRT_BASE (void __iomem *)0xe8000000ul 30#define VERSATILE_PCI_VIRT_BASE (void __iomem *)0xe8000000ul
31#define VERSATILE_PCI_CFG_VIRT_BASE (void __iomem *)0xe9000000ul 31#define VERSATILE_PCI_CFG_VIRT_BASE (void __iomem *)0xe9000000ul
32#define VERSATILE_PCI_VIRT_MEM_BASE0 (void __iomem *)PCIO_BASE
33 32
34/* macro to get at MMIO space when running virtually */ 33/* macro to get at MMIO space when running virtually */
35#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) 34#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
diff --git a/arch/arm/mach-versatile/include/mach/io.h b/arch/arm/mach-versatile/include/mach/io.h
deleted file mode 100644
index 0406513be7d..00000000000
--- a/arch/arm/mach-versatile/include/mach/io.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * arch/arm/mach-versatile/include/mach/io.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22
23#define PCIO_BASE 0xeb000000ul
24
25#define __io(a) ((a) + PCIO_BASE)
26
27#endif
diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c
index e95bf84cc83..2f84f4094f1 100644
--- a/arch/arm/mach-versatile/pci.c
+++ b/arch/arm/mach-versatile/pci.c
@@ -169,13 +169,6 @@ static struct pci_ops pci_versatile_ops = {
169 .write = versatile_write_config, 169 .write = versatile_write_config,
170}; 170};
171 171
172static struct resource io_port = {
173 .name = "PCI",
174 .start = 0,
175 .end = IO_SPACE_LIMIT,
176 .flags = IORESOURCE_IO,
177};
178
179static struct resource io_mem = { 172static struct resource io_mem = {
180 .name = "PCI I/O space", 173 .name = "PCI I/O space",
181 .start = VERSATILE_PCI_MEM_BASE0, 174 .start = VERSATILE_PCI_MEM_BASE0,
@@ -207,12 +200,6 @@ static int __init pci_versatile_setup_resources(struct pci_sys_data *sys)
207 "memory region (%d)\n", ret); 200 "memory region (%d)\n", ret);
208 goto out; 201 goto out;
209 } 202 }
210 ret = request_resource(&ioport_resource, &io_port);
211 if (ret) {
212 printk(KERN_ERR "PCI: unable to allocate I/O "
213 "port region (%d)\n", ret);
214 goto out;
215 }
216 ret = request_resource(&iomem_resource, &non_mem); 203 ret = request_resource(&iomem_resource, &non_mem);
217 if (ret) { 204 if (ret) {
218 printk(KERN_ERR "PCI: unable to allocate non-prefetchable " 205 printk(KERN_ERR "PCI: unable to allocate non-prefetchable "
@@ -227,11 +214,9 @@ static int __init pci_versatile_setup_resources(struct pci_sys_data *sys)
227 } 214 }
228 215
229 /* 216 /*
230 * the IO resource for this bus
231 * the mem resource for this bus 217 * the mem resource for this bus
232 * the prefetch mem resource for this bus 218 * the prefetch mem resource for this bus
233 */ 219 */
234 pci_add_resource_offset(&sys->resources, &io_port, sys->io_offset);
235 pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset); 220 pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset);
236 pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset); 221 pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset);
237 222
@@ -260,9 +245,11 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)
260 goto out; 245 goto out;
261 } 246 }
262 247
248 ret = pci_ioremap_io(0, VERSATILE_PCI_MEM_BASE0);
249 if (ret)
250 goto out;
251
263 if (nr == 0) { 252 if (nr == 0) {
264 sys->mem_offset = 0;
265 sys->io_offset = 0;
266 ret = pci_versatile_setup_resources(sys); 253 ret = pci_versatile_setup_resources(sys);
267 if (ret < 0) { 254 if (ret < 0) {
268 printk("pci_versatile_setup: resources... oops?\n"); 255 printk("pci_versatile_setup: resources... oops?\n");
@@ -319,7 +306,6 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)
319 306
320void __init pci_versatile_preinit(void) 307void __init pci_versatile_preinit(void)
321{ 308{
322 pcibios_min_io = 0x44000000;
323 pcibios_min_mem = 0x50000000; 309 pcibios_min_mem = 0x50000000;
324 310
325 __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28, PCI_IMAP0); 311 __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28, PCI_IMAP0);
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index fc3730f0165..c9529606620 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -1,38 +1,23 @@
1menu "Versatile Express platform type" 1config ARCH_VEXPRESS
2 depends on ARCH_VEXPRESS 2 bool "ARM Ltd. Versatile Express family" if ARCH_MULTI_V7
3 3 select ARCH_WANT_OPTIONAL_GPIOLIB
4config ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA 4 select ARM_AMBA
5 bool "Enable A5 and A9 only errata work-arounds"
6 default y
7 select ARM_ERRATA_720789
8 select ARM_ERRATA_751472
9 select PL310_ERRATA_753970 if CACHE_PL310
10 help
11 Provides common dependencies for Versatile Express platforms
12 based on Cortex-A5 and Cortex-A9 processors. In order to
13 build a working kernel, you must also enable relevant core
14 tile support or Flattened Device Tree based support options.
15
16config ARCH_VEXPRESS_CA9X4
17 bool "Versatile Express Cortex-A9x4 tile"
18 select ARM_GIC
19 select CPU_V7
20 select HAVE_SMP
21 select MIGHT_HAVE_CACHE_L2X0
22
23config ARCH_VEXPRESS_DT
24 bool "Device Tree support for Versatile Express platforms"
25 select ARM_GIC 5 select ARM_GIC
26 select ARM_PATCH_PHYS_VIRT 6 select ARM_TIMER_SP804
27 select AUTO_ZRELADDR 7 select CLKDEV_LOOKUP
8 select COMMON_CLK
28 select CPU_V7 9 select CPU_V7
10 select GENERIC_CLOCKEVENTS
11 select HAVE_CLK
12 select HAVE_PATA_PLATFORM
29 select HAVE_SMP 13 select HAVE_SMP
14 select ICST
30 select MIGHT_HAVE_CACHE_L2X0 15 select MIGHT_HAVE_CACHE_L2X0
31 select USE_OF 16 select NO_IOPORT
17 select PLAT_VERSATILE
18 select PLAT_VERSATILE_CLCD
19 select REGULATOR_FIXED_VOLTAGE if REGULATOR
32 help 20 help
33 New Versatile Express platforms require Flattened Device Tree to
34 be passed to the kernel.
35
36 This option enables support for systems using Cortex processor based 21 This option enables support for systems using Cortex processor based
37 ARM core and logic (FPGA) tiles on the Versatile Express motherboard, 22 ARM core and logic (FPGA) tiles on the Versatile Express motherboard,
38 for example: 23 for example:
@@ -48,7 +33,22 @@ config ARCH_VEXPRESS_DT
48 platforms. The traditional (ATAGs) boot method is not usable on 33 platforms. The traditional (ATAGs) boot method is not usable on
49 these boards with this option. 34 these boards with this option.
50 35
51 If your bootloader supports Flattened Device Tree based booting, 36menu "Versatile Express platform type"
52 say Y here. 37 depends on ARCH_VEXPRESS
38
39config ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA
40 bool "Enable A5 and A9 only errata work-arounds"
41 default y
42 select ARM_ERRATA_720789
43 select ARM_ERRATA_751472
44 select PL310_ERRATA_753970 if CACHE_PL310
45 help
46 Provides common dependencies for Versatile Express platforms
47 based on Cortex-A5 and Cortex-A9 processors. In order to
48 build a working kernel, you must also enable relevant core
49 tile support or Flattened Device Tree based support options.
50
51config ARCH_VEXPRESS_CA9X4
52 bool "Versatile Express Cortex-A9x4 tile"
53 53
54endmenu 54endmenu
diff --git a/arch/arm/mach-vexpress/Makefile b/arch/arm/mach-vexpress/Makefile
index 90551b9780a..42703e8b4d3 100644
--- a/arch/arm/mach-vexpress/Makefile
+++ b/arch/arm/mach-vexpress/Makefile
@@ -1,6 +1,8 @@
1# 1#
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
5 -I$(srctree)/arch/arm/plat-versatile/include
4 6
5obj-y := v2m.o 7obj-y := v2m.o
6obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o 8obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o
diff --git a/arch/arm/mach-vexpress/Makefile.boot b/arch/arm/mach-vexpress/Makefile.boot
deleted file mode 100644
index 38dbaac6334..00000000000
--- a/arch/arm/mach-vexpress/Makefile.boot
+++ /dev/null
@@ -1,11 +0,0 @@
1# Those numbers are used only by the non-DT V2P-CA9 platform
2# The DT-enabled ones require CONFIG_AUTO_ZRELADDR=y
3 zreladdr-y += 0x60008000
4params_phys-y := 0x60000100
5initrd_phys-y := 0x60800000
6
7dtb-$(CONFIG_ARCH_VEXPRESS_DT) += vexpress-v2p-ca5s.dtb \
8 vexpress-v2p-ca9.dtb \
9 vexpress-v2p-ca15-tc1.dtb \
10 vexpress-v2p-ca15_a7.dtb \
11 xenvm-4.2.dtb
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
index a3a4980770b..f134cd4a85f 100644
--- a/arch/arm/mach-vexpress/core.h
+++ b/arch/arm/mach-vexpress/core.h
@@ -5,3 +5,7 @@
5#define V2T_PERIPH 0xf8200000 5#define V2T_PERIPH 0xf8200000
6 6
7void vexpress_dt_smp_map_io(void); 7void vexpress_dt_smp_map_io(void);
8
9extern struct smp_operations vexpress_smp_ops;
10
11extern void vexpress_cpu_die(unsigned int cpu);
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index 61c492403b0..4f471fa3e3c 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -13,7 +13,6 @@
13#include <asm/hardware/arm_timer.h> 13#include <asm/hardware/arm_timer.h>
14#include <asm/hardware/cache-l2x0.h> 14#include <asm/hardware/cache-l2x0.h>
15#include <asm/hardware/gic.h> 15#include <asm/hardware/gic.h>
16#include <asm/pmu.h>
17#include <asm/smp_scu.h> 16#include <asm/smp_scu.h>
18#include <asm/smp_twd.h> 17#include <asm/smp_twd.h>
19 18
@@ -27,6 +26,7 @@
27#include "core.h" 26#include "core.h"
28 27
29#include <mach/motherboard.h> 28#include <mach/motherboard.h>
29#include <mach/irqs.h>
30 30
31#include <plat/clcd.h> 31#include <plat/clcd.h>
32 32
@@ -144,7 +144,7 @@ static struct resource pmu_resources[] = {
144 144
145static struct platform_device pmu_device = { 145static struct platform_device pmu_device = {
146 .name = "arm-pmu", 146 .name = "arm-pmu",
147 .id = ARM_PMU_DEVICE_CPU, 147 .id = -1,
148 .num_resources = ARRAY_SIZE(pmu_resources), 148 .num_resources = ARRAY_SIZE(pmu_resources),
149 .resource = pmu_resources, 149 .resource = pmu_resources,
150}; 150};
diff --git a/arch/arm/mach-vexpress/hotplug.c b/arch/arm/mach-vexpress/hotplug.c
index c504a72b94d..a141b98d84f 100644
--- a/arch/arm/mach-vexpress/hotplug.c
+++ b/arch/arm/mach-vexpress/hotplug.c
@@ -16,8 +16,6 @@
16#include <asm/smp_plat.h> 16#include <asm/smp_plat.h>
17#include <asm/cp15.h> 17#include <asm/cp15.h>
18 18
19extern volatile int pen_release;
20
21static inline void cpu_enter_lowpower(void) 19static inline void cpu_enter_lowpower(void)
22{ 20{
23 unsigned int v; 21 unsigned int v;
@@ -84,17 +82,12 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
84 } 82 }
85} 83}
86 84
87int platform_cpu_kill(unsigned int cpu)
88{
89 return 1;
90}
91
92/* 85/*
93 * platform-specific code to shutdown a CPU 86 * platform-specific code to shutdown a CPU
94 * 87 *
95 * Called with IRQs disabled 88 * Called with IRQs disabled
96 */ 89 */
97void platform_cpu_die(unsigned int cpu) 90void __ref vexpress_cpu_die(unsigned int cpu)
98{ 91{
99 int spurious = 0; 92 int spurious = 0;
100 93
@@ -113,12 +106,3 @@ void platform_cpu_die(unsigned int cpu)
113 if (spurious) 106 if (spurious)
114 pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); 107 pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
115} 108}
116
117int platform_cpu_disable(unsigned int cpu)
118{
119 /*
120 * we don't allow CPU 0 to be shutdown (it is still too special
121 * e.g. clock tick interrupts)
122 */
123 return cpu == 0 ? -EPERM : 0;
124}
diff --git a/arch/arm/mach-vexpress/include/mach/gpio.h b/arch/arm/mach-vexpress/include/mach/gpio.h
deleted file mode 100644
index 40a8c178f10..00000000000
--- a/arch/arm/mach-vexpress/include/mach/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/mach-vexpress/include/mach/irqs.h b/arch/arm/mach-vexpress/include/mach/irqs.h
index 4b10ee7657a..f8f7f782eb5 100644
--- a/arch/arm/mach-vexpress/include/mach/irqs.h
+++ b/arch/arm/mach-vexpress/include/mach/irqs.h
@@ -1,4 +1,6 @@
1#define IRQ_LOCALTIMER 29 1#define IRQ_LOCALTIMER 29
2#define IRQ_LOCALWDOG 30 2#define IRQ_LOCALWDOG 30
3 3
4#ifndef CONFIG_SPARSE_IRQ
4#define NR_IRQS 256 5#define NR_IRQS 256
6#endif
diff --git a/arch/arm/mach-vexpress/include/mach/timex.h b/arch/arm/mach-vexpress/include/mach/timex.h
deleted file mode 100644
index 00029bacd43..00000000000
--- a/arch/arm/mach-vexpress/include/mach/timex.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * arch/arm/mach-vexpress/include/mach/timex.h
3 *
4 * RealView architecture timex specifications
5 *
6 * Copyright (C) 2003 ARM Limited
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#define CLOCK_TICK_RATE (50000000 / 16)
diff --git a/arch/arm/mach-vexpress/include/mach/uncompress.h b/arch/arm/mach-vexpress/include/mach/uncompress.h
deleted file mode 100644
index 1e472eb0bbd..00000000000
--- a/arch/arm/mach-vexpress/include/mach/uncompress.h
+++ /dev/null
@@ -1,86 +0,0 @@
1/*
2 * arch/arm/mach-vexpress/include/mach/uncompress.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00))
21#define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c))
22#define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30))
23#define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18))
24
25#define UART_BASE 0x10009000
26#define UART_BASE_RS1 0x1c090000
27
28static unsigned long get_uart_base(void)
29{
30#if defined(CONFIG_DEBUG_VEXPRESS_UART0_DETECT)
31 unsigned long mpcore_periph;
32
33 /*
34 * Make an educated guess regarding the memory map:
35 * - the original A9 core tile, which has MPCore peripherals
36 * located at 0x1e000000, should use UART at 0x10009000
37 * - all other (RS1 complaint) tiles use UART mapped
38 * at 0x1c090000
39 */
40 asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (mpcore_periph));
41
42 if (mpcore_periph == 0x1e000000)
43 return UART_BASE;
44 else
45 return UART_BASE_RS1;
46#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_CA9)
47 return UART_BASE;
48#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_RS1)
49 return UART_BASE_RS1;
50#else
51 return 0;
52#endif
53}
54
55/*
56 * This does not append a newline
57 */
58static inline void putc(int c)
59{
60 unsigned long base = get_uart_base();
61
62 if (!base)
63 return;
64
65 while (AMBA_UART_FR(base) & (1 << 5))
66 barrier();
67
68 AMBA_UART_DR(base) = c;
69}
70
71static inline void flush(void)
72{
73 unsigned long base = get_uart_base();
74
75 if (!base)
76 return;
77
78 while (AMBA_UART_FR(base) & (1 << 3))
79 barrier();
80}
81
82/*
83 * nothing to do
84 */
85#define arch_decomp_setup()
86#define arch_decomp_wdog()
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c
index 14ba1128ae8..7db27c8c05c 100644
--- a/arch/arm/mach-vexpress/platsmp.c
+++ b/arch/arm/mach-vexpress/platsmp.c
@@ -20,9 +20,9 @@
20 20
21#include <mach/motherboard.h> 21#include <mach/motherboard.h>
22 22
23#include "core.h" 23#include <plat/platsmp.h>
24 24
25extern void versatile_secondary_startup(void); 25#include "core.h"
26 26
27#if defined(CONFIG_OF) 27#if defined(CONFIG_OF)
28 28
@@ -167,7 +167,7 @@ void __init vexpress_dt_smp_prepare_cpus(unsigned int max_cpus)
167 * Initialise the CPU possible map early - this describes the CPUs 167 * Initialise the CPU possible map early - this describes the CPUs
168 * which may be present or become present in the system. 168 * which may be present or become present in the system.
169 */ 169 */
170void __init smp_init_cpus(void) 170static void __init vexpress_smp_init_cpus(void)
171{ 171{
172 if (ct_desc) 172 if (ct_desc)
173 ct_desc->init_cpu_map(); 173 ct_desc->init_cpu_map();
@@ -176,7 +176,7 @@ void __init smp_init_cpus(void)
176 176
177} 177}
178 178
179void __init platform_smp_prepare_cpus(unsigned int max_cpus) 179static void __init vexpress_smp_prepare_cpus(unsigned int max_cpus)
180{ 180{
181 /* 181 /*
182 * Initialise the present map, which describes the set of CPUs 182 * Initialise the present map, which describes the set of CPUs
@@ -195,3 +195,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
195 */ 195 */
196 v2m_flags_set(virt_to_phys(versatile_secondary_startup)); 196 v2m_flags_set(virt_to_phys(versatile_secondary_startup));
197} 197}
198
199struct smp_operations __initdata vexpress_smp_ops = {
200 .smp_init_cpus = vexpress_smp_init_cpus,
201 .smp_prepare_cpus = vexpress_smp_prepare_cpus,
202 .smp_secondary_init = versatile_secondary_init,
203 .smp_boot_secondary = versatile_boot_secondary,
204#ifdef CONFIG_HOTPLUG_CPU
205 .cpu_die = vexpress_cpu_die,
206#endif
207};
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 0a79b085cea..560e0df728f 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -5,6 +5,7 @@
5#include <linux/amba/bus.h> 5#include <linux/amba/bus.h>
6#include <linux/amba/mmci.h> 6#include <linux/amba/mmci.h>
7#include <linux/io.h> 7#include <linux/io.h>
8#include <linux/smp.h>
8#include <linux/init.h> 9#include <linux/init.h>
9#include <linux/of_address.h> 10#include <linux/of_address.h>
10#include <linux/of_fdt.h> 11#include <linux/of_fdt.h>
@@ -38,6 +39,7 @@
38#include <mach/motherboard.h> 39#include <mach/motherboard.h>
39 40
40#include <plat/sched_clock.h> 41#include <plat/sched_clock.h>
42#include <plat/platsmp.h>
41 43
42#include "core.h" 44#include "core.h"
43 45
@@ -530,6 +532,7 @@ static void __init v2m_init(void)
530 532
531MACHINE_START(VEXPRESS, "ARM-Versatile Express") 533MACHINE_START(VEXPRESS, "ARM-Versatile Express")
532 .atag_offset = 0x100, 534 .atag_offset = 0x100,
535 .smp = smp_ops(vexpress_smp_ops),
533 .map_io = v2m_map_io, 536 .map_io = v2m_map_io,
534 .init_early = v2m_init_early, 537 .init_early = v2m_init_early,
535 .init_irq = v2m_init_irq, 538 .init_irq = v2m_init_irq,
@@ -539,8 +542,6 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express")
539 .restart = v2m_restart, 542 .restart = v2m_restart,
540MACHINE_END 543MACHINE_END
541 544
542#if defined(CONFIG_ARCH_VEXPRESS_DT)
543
544static struct map_desc v2m_rs1_io_desc __initdata = { 545static struct map_desc v2m_rs1_io_desc __initdata = {
545 .virtual = V2M_PERIPH, 546 .virtual = V2M_PERIPH,
546 .pfn = __phys_to_pfn(0x1c000000), 547 .pfn = __phys_to_pfn(0x1c000000),
@@ -664,6 +665,7 @@ const static char *v2m_dt_match[] __initconst = {
664 665
665DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express") 666DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express")
666 .dt_compat = v2m_dt_match, 667 .dt_compat = v2m_dt_match,
668 .smp = smp_ops(vexpress_smp_ops),
667 .map_io = v2m_dt_map_io, 669 .map_io = v2m_dt_map_io,
668 .init_early = v2m_dt_init_early, 670 .init_early = v2m_dt_init_early,
669 .init_irq = v2m_dt_init_irq, 671 .init_irq = v2m_dt_init_irq,
@@ -672,5 +674,3 @@ DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express")
672 .handle_irq = gic_handle_irq, 674 .handle_irq = gic_handle_irq,
673 .restart = v2m_restart, 675 .restart = v2m_restart,
674MACHINE_END 676MACHINE_END
675
676#endif
diff --git a/arch/arm/mach-vt8500/Kconfig b/arch/arm/mach-vt8500/Kconfig
deleted file mode 100644
index 2c20a341c11..00000000000
--- a/arch/arm/mach-vt8500/Kconfig
+++ /dev/null
@@ -1,73 +0,0 @@
1if ARCH_VT8500
2
3config VTWM_VERSION_VT8500
4 bool
5
6config VTWM_VERSION_WM8505
7 bool
8
9config MACH_BV07
10 bool "Benign BV07-8500 Mini Netbook"
11 depends on ARCH_VT8500
12 select VTWM_VERSION_VT8500
13 help
14 Add support for the inexpensive 7-inch netbooks sold by many
15 Chinese distributors under various names. Note that there are
16 many hardware implementations in identical exterior, make sure
17 that yours is indeed based on a VIA VT8500 chip.
18
19config MACH_WM8505_7IN_NETBOOK
20 bool "WM8505 7-inch generic netbook"
21 depends on ARCH_VT8500
22 select VTWM_VERSION_WM8505
23 help
24 Add support for the inexpensive 7-inch netbooks sold by many
25 Chinese distributors under various names. Note that there are
26 many hardware implementations in identical exterior, make sure
27 that yours is indeed based on a WonderMedia WM8505 chip.
28
29comment "LCD panel size"
30
31config WMT_PANEL_800X480
32 bool "7-inch with 800x480 resolution"
33 depends on (FB_VT8500 || FB_WM8505)
34 default y
35 help
36 These are found in most of the netbooks in generic cases, as
37 well as in Eken M001 tablets and possibly elsewhere.
38
39 To select this panel at runtime, say y here and append
40 'panel=800x480' to your kernel command line. Otherwise, the
41 largest one available will be used.
42
43config WMT_PANEL_800X600
44 bool "8-inch with 800x600 resolution"
45 depends on (FB_VT8500 || FB_WM8505)
46 help
47 These are found in Eken M003 tablets and possibly elsewhere.
48
49 To select this panel at runtime, say y here and append
50 'panel=800x600' to your kernel command line. Otherwise, the
51 largest one available will be used.
52
53config WMT_PANEL_1024X576
54 bool "10-inch with 1024x576 resolution"
55 depends on (FB_VT8500 || FB_WM8505)
56 help
57 These are found in CherryPal netbooks and possibly elsewhere.
58
59 To select this panel at runtime, say y here and append
60 'panel=1024x576' to your kernel command line. Otherwise, the
61 largest one available will be used.
62
63config WMT_PANEL_1024X600
64 bool "10-inch with 1024x600 resolution"
65 depends on (FB_VT8500 || FB_WM8505)
66 help
67 These are found in Eken M006 tablets and possibly elsewhere.
68
69 To select this panel at runtime, say y here and append
70 'panel=1024x600' to your kernel command line. Otherwise, the
71 largest one available will be used.
72
73endif
diff --git a/arch/arm/mach-vt8500/Makefile b/arch/arm/mach-vt8500/Makefile
index 7ce51767c99..e035251cda4 100644
--- a/arch/arm/mach-vt8500/Makefile
+++ b/arch/arm/mach-vt8500/Makefile
@@ -1,7 +1 @@
1obj-y += devices.o gpio.o irq.o timer.o restart.o obj-$(CONFIG_ARCH_VT8500) += irq.o timer.o vt8500.o
2
3obj-$(CONFIG_VTWM_VERSION_VT8500) += devices-vt8500.o
4obj-$(CONFIG_VTWM_VERSION_WM8505) += devices-wm8505.o
5
6obj-$(CONFIG_MACH_BV07) += bv07.o
7obj-$(CONFIG_MACH_WM8505_7IN_NETBOOK) += wm8505_7in.o
diff --git a/arch/arm/mach-vt8500/bv07.c b/arch/arm/mach-vt8500/bv07.c
deleted file mode 100644
index f9fbeb2d10e..00000000000
--- a/arch/arm/mach-vt8500/bv07.c
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * arch/arm/mach-vt8500/bv07.c
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/io.h>
22#include <linux/pm.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <mach/restart.h>
27
28#include "devices.h"
29
30static void __iomem *pmc_hiber;
31
32static struct platform_device *devices[] __initdata = {
33 &vt8500_device_uart0,
34 &vt8500_device_lcdc,
35 &vt8500_device_ehci,
36 &vt8500_device_ge_rops,
37 &vt8500_device_pwm,
38 &vt8500_device_pwmbl,
39 &vt8500_device_rtc,
40};
41
42static void vt8500_power_off(void)
43{
44 local_irq_disable();
45 writew(5, pmc_hiber);
46 asm("mcr%? p15, 0, %0, c7, c0, 4" : : "r" (0));
47}
48
49void __init bv07_init(void)
50{
51#ifdef CONFIG_FB_VT8500
52 void __iomem *gpio_mux_reg = ioremap(wmt_gpio_base + 0x200, 4);
53 if (gpio_mux_reg) {
54 writel(readl(gpio_mux_reg) | 1, gpio_mux_reg);
55 iounmap(gpio_mux_reg);
56 } else {
57 printk(KERN_ERR "Could not remap the GPIO mux register, display may not work properly!\n");
58 }
59#endif
60 pmc_hiber = ioremap(wmt_pmc_base + 0x12, 2);
61 if (pmc_hiber)
62 pm_power_off = &vt8500_power_off;
63 else
64 printk(KERN_ERR "PMC Hibernation register could not be remapped, not enabling power off!\n");
65
66 wmt_setup_restart();
67 vt8500_set_resources();
68 platform_add_devices(devices, ARRAY_SIZE(devices));
69 vt8500_gpio_init();
70}
71
72MACHINE_START(BV07, "Benign BV07 Mini Netbook")
73 .atag_offset = 0x100,
74 .restart = wmt_restart,
75 .reserve = vt8500_reserve_mem,
76 .map_io = vt8500_map_io,
77 .init_irq = vt8500_init_irq,
78 .timer = &vt8500_timer,
79 .init_machine = bv07_init,
80MACHINE_END
diff --git a/arch/arm/mach-tegra/include/mach/gpio-tegra.h b/arch/arm/mach-vt8500/common.h
index a978b3cc3a8..2b2419646e9 100644
--- a/arch/arm/mach-tegra/include/mach/gpio-tegra.h
+++ b/arch/arm/mach-vt8500/common.h
@@ -1,10 +1,6 @@
1/* 1/* linux/arch/arm/mach-vt8500/dt_common.h
2 * arch/arm/mach-tegra/include/mach/gpio.h
3 * 2 *
4 * Copyright (C) 2010 Google, Inc. 3 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
5 *
6 * Author:
7 * Erik Gilling <konkers@google.com>
8 * 4 *
9 * This software is licensed under the terms of the GNU General Public 5 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and 6 * License version 2, as published by the Free Software Foundation, and
@@ -17,12 +13,16 @@
17 * 13 *
18 */ 14 */
19 15
20#ifndef __MACH_TEGRA_GPIO_TEGRA_H 16#ifndef __ARCH_ARM_MACH_VT8500_DT_COMMON_H
21#define __MACH_TEGRA_GPIO_TEGRA_H 17#define __ARCH_ARM_MACH_VT8500_DT_COMMON_H
18
19#include <linux/of.h>
22 20
23#include <linux/types.h> 21void __init vt8500_timer_init(void);
24#include <mach/irqs.h> 22int __init vt8500_irq_init(struct device_node *node,
23 struct device_node *parent);
25 24
26#define TEGRA_NR_GPIOS INT_GPIO_NR 25/* defined in drivers/clk/clk-vt8500.c */
26void __init vtwm_clk_init(void __iomem *pmc_base);
27 27
28#endif 28#endif
diff --git a/arch/arm/mach-vt8500/devices-vt8500.c b/arch/arm/mach-vt8500/devices-vt8500.c
deleted file mode 100644
index 19519aeecf3..00000000000
--- a/arch/arm/mach-vt8500/devices-vt8500.c
+++ /dev/null
@@ -1,91 +0,0 @@
1/* linux/arch/arm/mach-vt8500/devices-vt8500.c
2 *
3 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#include <linux/platform_device.h>
17
18#include <mach/vt8500_regs.h>
19#include <mach/vt8500_irqs.h>
20#include <mach/i8042.h>
21#include "devices.h"
22
23void __init vt8500_set_resources(void)
24{
25 struct resource tmp[3];
26
27 tmp[0] = wmt_mmio_res(VT8500_LCDC_BASE, SZ_1K);
28 tmp[1] = wmt_irq_res(IRQ_LCDC);
29 wmt_res_add(&vt8500_device_lcdc, tmp, 2);
30
31 tmp[0] = wmt_mmio_res(VT8500_UART0_BASE, 0x1040);
32 tmp[1] = wmt_irq_res(IRQ_UART0);
33 wmt_res_add(&vt8500_device_uart0, tmp, 2);
34
35 tmp[0] = wmt_mmio_res(VT8500_UART1_BASE, 0x1040);
36 tmp[1] = wmt_irq_res(IRQ_UART1);
37 wmt_res_add(&vt8500_device_uart1, tmp, 2);
38
39 tmp[0] = wmt_mmio_res(VT8500_UART2_BASE, 0x1040);
40 tmp[1] = wmt_irq_res(IRQ_UART2);
41 wmt_res_add(&vt8500_device_uart2, tmp, 2);
42
43 tmp[0] = wmt_mmio_res(VT8500_UART3_BASE, 0x1040);
44 tmp[1] = wmt_irq_res(IRQ_UART3);
45 wmt_res_add(&vt8500_device_uart3, tmp, 2);
46
47 tmp[0] = wmt_mmio_res(VT8500_EHCI_BASE, SZ_512);
48 tmp[1] = wmt_irq_res(IRQ_EHCI);
49 wmt_res_add(&vt8500_device_ehci, tmp, 2);
50
51 tmp[0] = wmt_mmio_res(VT8500_GEGEA_BASE, SZ_256);
52 wmt_res_add(&vt8500_device_ge_rops, tmp, 1);
53
54 tmp[0] = wmt_mmio_res(VT8500_PWM_BASE, 0x44);
55 wmt_res_add(&vt8500_device_pwm, tmp, 1);
56
57 tmp[0] = wmt_mmio_res(VT8500_RTC_BASE, 0x2c);
58 tmp[1] = wmt_irq_res(IRQ_RTC);
59 tmp[2] = wmt_irq_res(IRQ_RTCSM);
60 wmt_res_add(&vt8500_device_rtc, tmp, 3);
61}
62
63static void __init vt8500_set_externs(void)
64{
65 /* Non-resource-aware stuff */
66 wmt_ic_base = VT8500_IC_BASE;
67 wmt_gpio_base = VT8500_GPIO_BASE;
68 wmt_pmc_base = VT8500_PMC_BASE;
69 wmt_i8042_base = VT8500_PS2_BASE;
70
71 wmt_nr_irqs = VT8500_NR_IRQS;
72 wmt_timer_irq = IRQ_PMCOS0;
73 wmt_gpio_ext_irq[0] = IRQ_EXT0;
74 wmt_gpio_ext_irq[1] = IRQ_EXT1;
75 wmt_gpio_ext_irq[2] = IRQ_EXT2;
76 wmt_gpio_ext_irq[3] = IRQ_EXT3;
77 wmt_gpio_ext_irq[4] = IRQ_EXT4;
78 wmt_gpio_ext_irq[5] = IRQ_EXT5;
79 wmt_gpio_ext_irq[6] = IRQ_EXT6;
80 wmt_gpio_ext_irq[7] = IRQ_EXT7;
81 wmt_i8042_kbd_irq = IRQ_PS2KBD;
82 wmt_i8042_aux_irq = IRQ_PS2MOUSE;
83}
84
85void __init vt8500_map_io(void)
86{
87 iotable_init(wmt_io_desc, ARRAY_SIZE(wmt_io_desc));
88
89 /* Should be done before interrupts and timers are initialized */
90 vt8500_set_externs();
91}
diff --git a/arch/arm/mach-vt8500/devices-wm8505.c b/arch/arm/mach-vt8500/devices-wm8505.c
deleted file mode 100644
index db4594e029f..00000000000
--- a/arch/arm/mach-vt8500/devices-wm8505.c
+++ /dev/null
@@ -1,99 +0,0 @@
1/* linux/arch/arm/mach-vt8500/devices-wm8505.c
2 *
3 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#include <linux/platform_device.h>
17
18#include <mach/wm8505_regs.h>
19#include <mach/wm8505_irqs.h>
20#include <mach/i8042.h>
21#include "devices.h"
22
23void __init wm8505_set_resources(void)
24{
25 struct resource tmp[3];
26
27 tmp[0] = wmt_mmio_res(WM8505_GOVR_BASE, SZ_512);
28 wmt_res_add(&vt8500_device_wm8505_fb, tmp, 1);
29
30 tmp[0] = wmt_mmio_res(WM8505_UART0_BASE, 0x1040);
31 tmp[1] = wmt_irq_res(IRQ_UART0);
32 wmt_res_add(&vt8500_device_uart0, tmp, 2);
33
34 tmp[0] = wmt_mmio_res(WM8505_UART1_BASE, 0x1040);
35 tmp[1] = wmt_irq_res(IRQ_UART1);
36 wmt_res_add(&vt8500_device_uart1, tmp, 2);
37
38 tmp[0] = wmt_mmio_res(WM8505_UART2_BASE, 0x1040);
39 tmp[1] = wmt_irq_res(IRQ_UART2);
40 wmt_res_add(&vt8500_device_uart2, tmp, 2);
41
42 tmp[0] = wmt_mmio_res(WM8505_UART3_BASE, 0x1040);
43 tmp[1] = wmt_irq_res(IRQ_UART3);
44 wmt_res_add(&vt8500_device_uart3, tmp, 2);
45
46 tmp[0] = wmt_mmio_res(WM8505_UART4_BASE, 0x1040);
47 tmp[1] = wmt_irq_res(IRQ_UART4);
48 wmt_res_add(&vt8500_device_uart4, tmp, 2);
49
50 tmp[0] = wmt_mmio_res(WM8505_UART5_BASE, 0x1040);
51 tmp[1] = wmt_irq_res(IRQ_UART5);
52 wmt_res_add(&vt8500_device_uart5, tmp, 2);
53
54 tmp[0] = wmt_mmio_res(WM8505_EHCI_BASE, SZ_512);
55 tmp[1] = wmt_irq_res(IRQ_EHCI);
56 wmt_res_add(&vt8500_device_ehci, tmp, 2);
57
58 tmp[0] = wmt_mmio_res(WM8505_GEGEA_BASE, SZ_256);
59 wmt_res_add(&vt8500_device_ge_rops, tmp, 1);
60
61 tmp[0] = wmt_mmio_res(WM8505_PWM_BASE, 0x44);
62 wmt_res_add(&vt8500_device_pwm, tmp, 1);
63
64 tmp[0] = wmt_mmio_res(WM8505_RTC_BASE, 0x2c);
65 tmp[1] = wmt_irq_res(IRQ_RTC);
66 tmp[2] = wmt_irq_res(IRQ_RTCSM);
67 wmt_res_add(&vt8500_device_rtc, tmp, 3);
68}
69
70static void __init wm8505_set_externs(void)
71{
72 /* Non-resource-aware stuff */
73 wmt_ic_base = WM8505_IC_BASE;
74 wmt_sic_base = WM8505_SIC_BASE;
75 wmt_gpio_base = WM8505_GPIO_BASE;
76 wmt_pmc_base = WM8505_PMC_BASE;
77 wmt_i8042_base = WM8505_PS2_BASE;
78
79 wmt_nr_irqs = WM8505_NR_IRQS;
80 wmt_timer_irq = IRQ_PMCOS0;
81 wmt_gpio_ext_irq[0] = IRQ_EXT0;
82 wmt_gpio_ext_irq[1] = IRQ_EXT1;
83 wmt_gpio_ext_irq[2] = IRQ_EXT2;
84 wmt_gpio_ext_irq[3] = IRQ_EXT3;
85 wmt_gpio_ext_irq[4] = IRQ_EXT4;
86 wmt_gpio_ext_irq[5] = IRQ_EXT5;
87 wmt_gpio_ext_irq[6] = IRQ_EXT6;
88 wmt_gpio_ext_irq[7] = IRQ_EXT7;
89 wmt_i8042_kbd_irq = IRQ_PS2KBD;
90 wmt_i8042_aux_irq = IRQ_PS2MOUSE;
91}
92
93void __init wm8505_map_io(void)
94{
95 iotable_init(wmt_io_desc, ARRAY_SIZE(wmt_io_desc));
96
97 /* Should be done before interrupts and timers are initialized */
98 wm8505_set_externs();
99}
diff --git a/arch/arm/mach-vt8500/devices.c b/arch/arm/mach-vt8500/devices.c
deleted file mode 100644
index 1fcdc36b358..00000000000
--- a/arch/arm/mach-vt8500/devices.c
+++ /dev/null
@@ -1,270 +0,0 @@
1/* linux/arch/arm/mach-vt8500/devices.c
2 *
3 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#include <linux/kernel.h>
17#include <linux/io.h>
18#include <linux/device.h>
19#include <linux/dma-mapping.h>
20#include <linux/platform_device.h>
21#include <linux/pwm_backlight.h>
22#include <linux/memblock.h>
23
24#include <asm/mach/arch.h>
25
26#include <mach/vt8500fb.h>
27#include <mach/i8042.h>
28#include "devices.h"
29
30/* These can't use resources currently */
31unsigned long wmt_ic_base __initdata;
32unsigned long wmt_sic_base __initdata;
33unsigned long wmt_gpio_base __initdata;
34unsigned long wmt_pmc_base __initdata;
35unsigned long wmt_i8042_base __initdata;
36
37int wmt_nr_irqs __initdata;
38int wmt_timer_irq __initdata;
39int wmt_gpio_ext_irq[8] __initdata;
40
41/* Should remain accessible after init.
42 * i8042 driver desperately calls for attention...
43 */
44int wmt_i8042_kbd_irq;
45int wmt_i8042_aux_irq;
46
47static u64 fb_dma_mask = DMA_BIT_MASK(32);
48
49struct platform_device vt8500_device_lcdc = {
50 .name = "vt8500-lcd",
51 .id = 0,
52 .dev = {
53 .dma_mask = &fb_dma_mask,
54 .coherent_dma_mask = DMA_BIT_MASK(32),
55 },
56};
57
58struct platform_device vt8500_device_wm8505_fb = {
59 .name = "wm8505-fb",
60 .id = 0,
61};
62
63/* Smallest to largest */
64static struct vt8500fb_platform_data panels[] = {
65#ifdef CONFIG_WMT_PANEL_800X480
66{
67 .xres_virtual = 800,
68 .yres_virtual = 480 * 2,
69 .mode = {
70 .name = "800x480",
71 .xres = 800,
72 .yres = 480,
73 .left_margin = 88,
74 .right_margin = 40,
75 .upper_margin = 32,
76 .lower_margin = 11,
77 .hsync_len = 0,
78 .vsync_len = 1,
79 .vmode = FB_VMODE_NONINTERLACED,
80 },
81},
82#endif
83#ifdef CONFIG_WMT_PANEL_800X600
84{
85 .xres_virtual = 800,
86 .yres_virtual = 600 * 2,
87 .mode = {
88 .name = "800x600",
89 .xres = 800,
90 .yres = 600,
91 .left_margin = 88,
92 .right_margin = 40,
93 .upper_margin = 32,
94 .lower_margin = 11,
95 .hsync_len = 0,
96 .vsync_len = 1,
97 .vmode = FB_VMODE_NONINTERLACED,
98 },
99},
100#endif
101#ifdef CONFIG_WMT_PANEL_1024X576
102{
103 .xres_virtual = 1024,
104 .yres_virtual = 576 * 2,
105 .mode = {
106 .name = "1024x576",
107 .xres = 1024,
108 .yres = 576,
109 .left_margin = 40,
110 .right_margin = 24,
111 .upper_margin = 32,
112 .lower_margin = 11,
113 .hsync_len = 96,
114 .vsync_len = 2,
115 .vmode = FB_VMODE_NONINTERLACED,
116 },
117},
118#endif
119#ifdef CONFIG_WMT_PANEL_1024X600
120{
121 .xres_virtual = 1024,
122 .yres_virtual = 600 * 2,
123 .mode = {
124 .name = "1024x600",
125 .xres = 1024,
126 .yres = 600,
127 .left_margin = 66,
128 .right_margin = 2,
129 .upper_margin = 19,
130 .lower_margin = 1,
131 .hsync_len = 23,
132 .vsync_len = 8,
133 .vmode = FB_VMODE_NONINTERLACED,
134 },
135},
136#endif
137};
138
139static int current_panel_idx __initdata = ARRAY_SIZE(panels) - 1;
140
141static int __init panel_setup(char *str)
142{
143 int i;
144
145 for (i = 0; i < ARRAY_SIZE(panels); i++) {
146 if (strcmp(panels[i].mode.name, str) == 0) {
147 current_panel_idx = i;
148 break;
149 }
150 }
151 return 0;
152}
153
154early_param("panel", panel_setup);
155
156static inline void preallocate_fb(struct vt8500fb_platform_data *p,
157 unsigned long align) {
158 p->video_mem_len = (p->xres_virtual * p->yres_virtual * 4) >>
159 (p->bpp > 16 ? 0 : (p->bpp > 8 ? 1 :
160 (8 / p->bpp) + 1));
161 p->video_mem_phys = (unsigned long)memblock_alloc(p->video_mem_len,
162 align);
163 p->video_mem_virt = phys_to_virt(p->video_mem_phys);
164}
165
166struct platform_device vt8500_device_uart0 = {
167 .name = "vt8500_serial",
168 .id = 0,
169};
170
171struct platform_device vt8500_device_uart1 = {
172 .name = "vt8500_serial",
173 .id = 1,
174};
175
176struct platform_device vt8500_device_uart2 = {
177 .name = "vt8500_serial",
178 .id = 2,
179};
180
181struct platform_device vt8500_device_uart3 = {
182 .name = "vt8500_serial",
183 .id = 3,
184};
185
186struct platform_device vt8500_device_uart4 = {
187 .name = "vt8500_serial",
188 .id = 4,
189};
190
191struct platform_device vt8500_device_uart5 = {
192 .name = "vt8500_serial",
193 .id = 5,
194};
195
196static u64 ehci_dma_mask = DMA_BIT_MASK(32);
197
198struct platform_device vt8500_device_ehci = {
199 .name = "vt8500-ehci",
200 .id = 0,
201 .dev = {
202 .dma_mask = &ehci_dma_mask,
203 .coherent_dma_mask = DMA_BIT_MASK(32),
204 },
205};
206
207struct platform_device vt8500_device_ge_rops = {
208 .name = "wmt_ge_rops",
209 .id = -1,
210};
211
212struct platform_device vt8500_device_pwm = {
213 .name = "vt8500-pwm",
214 .id = 0,
215};
216
217static struct platform_pwm_backlight_data vt8500_pwmbl_data = {
218 .pwm_id = 0,
219 .max_brightness = 128,
220 .dft_brightness = 70,
221 .pwm_period_ns = 250000, /* revisit when clocks are implemented */
222};
223
224struct platform_device vt8500_device_pwmbl = {
225 .name = "pwm-backlight",
226 .id = 0,
227 .dev = {
228 .platform_data = &vt8500_pwmbl_data,
229 },
230};
231
232struct platform_device vt8500_device_rtc = {
233 .name = "vt8500-rtc",
234 .id = 0,
235};
236
237struct map_desc wmt_io_desc[] __initdata = {
238 /* SoC MMIO registers */
239 [0] = {
240 .virtual = 0xf8000000,
241 .pfn = __phys_to_pfn(0xd8000000),
242 .length = 0x00390000, /* max of all chip variants */
243 .type = MT_DEVICE
244 },
245 /* PCI I/O space, numbers tied to those in <mach/io.h> */
246 [1] = {
247 .virtual = 0xf0000000,
248 .pfn = __phys_to_pfn(0xc0000000),
249 .length = SZ_64K,
250 .type = MT_DEVICE
251 },
252};
253
254void __init vt8500_reserve_mem(void)
255{
256#ifdef CONFIG_FB_VT8500
257 panels[current_panel_idx].bpp = 16; /* Always use RGB565 */
258 preallocate_fb(&panels[current_panel_idx], SZ_4M);
259 vt8500_device_lcdc.dev.platform_data = &panels[current_panel_idx];
260#endif
261}
262
263void __init wm8505_reserve_mem(void)
264{
265#if defined CONFIG_FB_WM8505
266 panels[current_panel_idx].bpp = 32; /* Always use RGB888 */
267 preallocate_fb(&panels[current_panel_idx], 32);
268 vt8500_device_wm8505_fb.dev.platform_data = &panels[current_panel_idx];
269#endif
270}
diff --git a/arch/arm/mach-vt8500/devices.h b/arch/arm/mach-vt8500/devices.h
deleted file mode 100644
index 188d4e17f35..00000000000
--- a/arch/arm/mach-vt8500/devices.h
+++ /dev/null
@@ -1,88 +0,0 @@
1/* linux/arch/arm/mach-vt8500/devices.h
2 *
3 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#ifndef __ARCH_ARM_MACH_VT8500_DEVICES_H
17#define __ARCH_ARM_MACH_VT8500_DEVICES_H
18
19#include <linux/platform_device.h>
20#include <asm/mach/map.h>
21
22void __init vt8500_init_irq(void);
23void __init wm8505_init_irq(void);
24void __init vt8500_map_io(void);
25void __init wm8505_map_io(void);
26void __init vt8500_reserve_mem(void);
27void __init wm8505_reserve_mem(void);
28void __init vt8500_gpio_init(void);
29void __init vt8500_set_resources(void);
30void __init wm8505_set_resources(void);
31
32extern unsigned long wmt_ic_base __initdata;
33extern unsigned long wmt_sic_base __initdata;
34extern unsigned long wmt_gpio_base __initdata;
35extern unsigned long wmt_pmc_base __initdata;
36
37extern int wmt_nr_irqs __initdata;
38extern int wmt_timer_irq __initdata;
39extern int wmt_gpio_ext_irq[8] __initdata;
40
41extern struct map_desc wmt_io_desc[2] __initdata;
42
43static inline struct resource wmt_mmio_res(u32 start, u32 size)
44{
45 struct resource tmp = {
46 .flags = IORESOURCE_MEM,
47 .start = start,
48 .end = start + size - 1,
49 };
50
51 return tmp;
52}
53
54static inline struct resource wmt_irq_res(int irq)
55{
56 struct resource tmp = {
57 .flags = IORESOURCE_IRQ,
58 .start = irq,
59 .end = irq,
60 };
61
62 return tmp;
63}
64
65static inline void wmt_res_add(struct platform_device *pdev,
66 const struct resource *res, unsigned int num)
67{
68 if (unlikely(platform_device_add_resources(pdev, res, num)))
69 pr_err("Failed to assign resources\n");
70}
71
72extern struct sys_timer vt8500_timer;
73
74extern struct platform_device vt8500_device_uart0;
75extern struct platform_device vt8500_device_uart1;
76extern struct platform_device vt8500_device_uart2;
77extern struct platform_device vt8500_device_uart3;
78extern struct platform_device vt8500_device_uart4;
79extern struct platform_device vt8500_device_uart5;
80
81extern struct platform_device vt8500_device_lcdc;
82extern struct platform_device vt8500_device_wm8505_fb;
83extern struct platform_device vt8500_device_ehci;
84extern struct platform_device vt8500_device_ge_rops;
85extern struct platform_device vt8500_device_pwm;
86extern struct platform_device vt8500_device_pwmbl;
87extern struct platform_device vt8500_device_rtc;
88#endif
diff --git a/arch/arm/mach-vt8500/gpio.c b/arch/arm/mach-vt8500/gpio.c
deleted file mode 100644
index 2bcc0ec783d..00000000000
--- a/arch/arm/mach-vt8500/gpio.c
+++ /dev/null
@@ -1,240 +0,0 @@
1/* linux/arch/arm/mach-vt8500/gpio.c
2 *
3 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#include <linux/gpio.h>
17#include <linux/init.h>
18#include <linux/irq.h>
19#include <linux/io.h>
20
21#include "devices.h"
22
23#define to_vt8500(__chip) container_of(__chip, struct vt8500_gpio_chip, chip)
24
25#define ENABLE_REGS 0x0
26#define DIRECTION_REGS 0x20
27#define OUTVALUE_REGS 0x40
28#define INVALUE_REGS 0x60
29
30#define EXT_REGOFF 0x1c
31
32static void __iomem *regbase;
33
34struct vt8500_gpio_chip {
35 struct gpio_chip chip;
36 unsigned int shift;
37 unsigned int regoff;
38};
39
40static int gpio_to_irq_map[8];
41
42static int vt8500_muxed_gpio_request(struct gpio_chip *chip,
43 unsigned offset)
44{
45 struct vt8500_gpio_chip *vt8500_chip = to_vt8500(chip);
46 unsigned val = readl(regbase + ENABLE_REGS + vt8500_chip->regoff);
47
48 val |= (1 << vt8500_chip->shift << offset);
49 writel(val, regbase + ENABLE_REGS + vt8500_chip->regoff);
50
51 return 0;
52}
53
54static void vt8500_muxed_gpio_free(struct gpio_chip *chip,
55 unsigned offset)
56{
57 struct vt8500_gpio_chip *vt8500_chip = to_vt8500(chip);
58 unsigned val = readl(regbase + ENABLE_REGS + vt8500_chip->regoff);
59
60 val &= ~(1 << vt8500_chip->shift << offset);
61 writel(val, regbase + ENABLE_REGS + vt8500_chip->regoff);
62}
63
64static int vt8500_muxed_gpio_direction_input(struct gpio_chip *chip,
65 unsigned offset)
66{
67 struct vt8500_gpio_chip *vt8500_chip = to_vt8500(chip);
68 unsigned val = readl(regbase + DIRECTION_REGS + vt8500_chip->regoff);
69
70 val &= ~(1 << vt8500_chip->shift << offset);
71 writel(val, regbase + DIRECTION_REGS + vt8500_chip->regoff);
72
73 return 0;
74}
75
76static int vt8500_muxed_gpio_direction_output(struct gpio_chip *chip,
77 unsigned offset, int value)
78{
79 struct vt8500_gpio_chip *vt8500_chip = to_vt8500(chip);
80 unsigned val = readl(regbase + DIRECTION_REGS + vt8500_chip->regoff);
81
82 val |= (1 << vt8500_chip->shift << offset);
83 writel(val, regbase + DIRECTION_REGS + vt8500_chip->regoff);
84
85 if (value) {
86 val = readl(regbase + OUTVALUE_REGS + vt8500_chip->regoff);
87 val |= (1 << vt8500_chip->shift << offset);
88 writel(val, regbase + OUTVALUE_REGS + vt8500_chip->regoff);
89 }
90 return 0;
91}
92
93static int vt8500_muxed_gpio_get_value(struct gpio_chip *chip,
94 unsigned offset)
95{
96 struct vt8500_gpio_chip *vt8500_chip = to_vt8500(chip);
97
98 return (readl(regbase + INVALUE_REGS + vt8500_chip->regoff)
99 >> vt8500_chip->shift >> offset) & 1;
100}
101
102static void vt8500_muxed_gpio_set_value(struct gpio_chip *chip,
103 unsigned offset, int value)
104{
105 struct vt8500_gpio_chip *vt8500_chip = to_vt8500(chip);
106 unsigned val = readl(regbase + INVALUE_REGS + vt8500_chip->regoff);
107
108 if (value)
109 val |= (1 << vt8500_chip->shift << offset);
110 else
111 val &= ~(1 << vt8500_chip->shift << offset);
112
113 writel(val, regbase + INVALUE_REGS + vt8500_chip->regoff);
114}
115
116#define VT8500_GPIO_BANK(__name, __shift, __off, __base, __num) \
117{ \
118 .chip = { \
119 .label = __name, \
120 .request = vt8500_muxed_gpio_request, \
121 .free = vt8500_muxed_gpio_free, \
122 .direction_input = vt8500_muxed_gpio_direction_input, \
123 .direction_output = vt8500_muxed_gpio_direction_output, \
124 .get = vt8500_muxed_gpio_get_value, \
125 .set = vt8500_muxed_gpio_set_value, \
126 .can_sleep = 0, \
127 .base = __base, \
128 .ngpio = __num, \
129 }, \
130 .shift = __shift, \
131 .regoff = __off, \
132}
133
134static struct vt8500_gpio_chip vt8500_muxed_gpios[] = {
135 VT8500_GPIO_BANK("uart0", 0, 0x0, 8, 4),
136 VT8500_GPIO_BANK("uart1", 4, 0x0, 12, 4),
137 VT8500_GPIO_BANK("spi0", 8, 0x0, 16, 4),
138 VT8500_GPIO_BANK("spi1", 12, 0x0, 20, 4),
139 VT8500_GPIO_BANK("spi2", 16, 0x0, 24, 4),
140 VT8500_GPIO_BANK("pwmout", 24, 0x0, 28, 2),
141
142 VT8500_GPIO_BANK("sdmmc", 0, 0x4, 30, 11),
143 VT8500_GPIO_BANK("ms", 16, 0x4, 41, 7),
144 VT8500_GPIO_BANK("i2c0", 24, 0x4, 48, 2),
145 VT8500_GPIO_BANK("i2c1", 26, 0x4, 50, 2),
146
147 VT8500_GPIO_BANK("mii", 0, 0x8, 52, 20),
148 VT8500_GPIO_BANK("see", 20, 0x8, 72, 4),
149 VT8500_GPIO_BANK("ide", 24, 0x8, 76, 7),
150
151 VT8500_GPIO_BANK("ccir", 0, 0xc, 83, 19),
152
153 VT8500_GPIO_BANK("ts", 8, 0x10, 102, 11),
154
155 VT8500_GPIO_BANK("lcd", 0, 0x14, 113, 23),
156};
157
158static int vt8500_gpio_direction_input(struct gpio_chip *chip,
159 unsigned offset)
160{
161 unsigned val = readl(regbase + DIRECTION_REGS + EXT_REGOFF);
162
163 val &= ~(1 << offset);
164 writel(val, regbase + DIRECTION_REGS + EXT_REGOFF);
165 return 0;
166}
167
168static int vt8500_gpio_direction_output(struct gpio_chip *chip,
169 unsigned offset, int value)
170{
171 unsigned val = readl(regbase + DIRECTION_REGS + EXT_REGOFF);
172
173 val |= (1 << offset);
174 writel(val, regbase + DIRECTION_REGS + EXT_REGOFF);
175
176 if (value) {
177 val = readl(regbase + OUTVALUE_REGS + EXT_REGOFF);
178 val |= (1 << offset);
179 writel(val, regbase + OUTVALUE_REGS + EXT_REGOFF);
180 }
181 return 0;
182}
183
184static int vt8500_gpio_get_value(struct gpio_chip *chip,
185 unsigned offset)
186{
187 return (readl(regbase + INVALUE_REGS + EXT_REGOFF) >> offset) & 1;
188}
189
190static void vt8500_gpio_set_value(struct gpio_chip *chip,
191 unsigned offset, int value)
192{
193 unsigned val = readl(regbase + OUTVALUE_REGS + EXT_REGOFF);
194
195 if (value)
196 val |= (1 << offset);
197 else
198 val &= ~(1 << offset);
199
200 writel(val, regbase + OUTVALUE_REGS + EXT_REGOFF);
201}
202
203static int vt8500_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
204{
205 if (offset > 7)
206 return -EINVAL;
207
208 return gpio_to_irq_map[offset];
209}
210
211static struct gpio_chip vt8500_external_gpios = {
212 .label = "extgpio",
213 .direction_input = vt8500_gpio_direction_input,
214 .direction_output = vt8500_gpio_direction_output,
215 .get = vt8500_gpio_get_value,
216 .set = vt8500_gpio_set_value,
217 .to_irq = vt8500_gpio_to_irq,
218 .can_sleep = 0,
219 .base = 0,
220 .ngpio = 8,
221};
222
223void __init vt8500_gpio_init(void)
224{
225 int i;
226
227 for (i = 0; i < 8; i++)
228 gpio_to_irq_map[i] = wmt_gpio_ext_irq[i];
229
230 regbase = ioremap(wmt_gpio_base, SZ_64K);
231 if (!regbase) {
232 printk(KERN_ERR "Failed to map MMIO registers for GPIO\n");
233 return;
234 }
235
236 gpiochip_add(&vt8500_external_gpios);
237
238 for (i = 0; i < ARRAY_SIZE(vt8500_muxed_gpios); i++)
239 gpiochip_add(&vt8500_muxed_gpios[i].chip);
240}
diff --git a/arch/arm/mach-vt8500/include/mach/gpio.h b/arch/arm/mach-vt8500/include/mach/gpio.h
deleted file mode 100644
index 40a8c178f10..00000000000
--- a/arch/arm/mach-vt8500/include/mach/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/mach-vt8500/include/mach/restart.h b/arch/arm/mach-vt8500/include/mach/restart.h
index 89f9b787d2a..738979518ac 100644
--- a/arch/arm/mach-vt8500/include/mach/restart.h
+++ b/arch/arm/mach-vt8500/include/mach/restart.h
@@ -13,5 +13,5 @@
13 * 13 *
14 */ 14 */
15 15
16void wmt_setup_restart(void); 16void vt8500_setup_restart(void);
17void wmt_restart(char mode, const char *cmd); 17void vt8500_restart(char mode, const char *cmd);
diff --git a/arch/arm/mach-vt8500/include/mach/uncompress.h b/arch/arm/mach-vt8500/include/mach/uncompress.h
index bb9e2d23fee..e6e81fdaf10 100644
--- a/arch/arm/mach-vt8500/include/mach/uncompress.h
+++ b/arch/arm/mach-vt8500/include/mach/uncompress.h
@@ -15,15 +15,15 @@
15 * 15 *
16 */ 16 */
17 17
18#define UART0_PHYS 0xd8200000 18#define UART0_PHYS 0xd8200000
19#include <asm/io.h> 19#define UART0_ADDR(x) *(volatile unsigned char *)(UART0_PHYS + x)
20 20
21static void putc(const char c) 21static void putc(const char c)
22{ 22{
23 while (readb(UART0_PHYS + 0x1c) & 0x2) 23 while (UART0_ADDR(0x1c) & 0x2)
24 /* Tx busy, wait and poll */; 24 /* Tx busy, wait and poll */;
25 25
26 writeb(c, UART0_PHYS); 26 UART0_ADDR(0) = c;
27} 27}
28 28
29static void flush(void) 29static void flush(void)
diff --git a/arch/arm/mach-vt8500/include/mach/vt8500_irqs.h b/arch/arm/mach-vt8500/include/mach/vt8500_irqs.h
deleted file mode 100644
index ecfee912471..00000000000
--- a/arch/arm/mach-vt8500/include/mach/vt8500_irqs.h
+++ /dev/null
@@ -1,88 +0,0 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/vt8500_irqs.h
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21/* VT8500 Interrupt Sources */
22
23#define IRQ_JPEGENC 0 /* JPEG Encoder */
24#define IRQ_JPEGDEC 1 /* JPEG Decoder */
25 /* Reserved */
26#define IRQ_PATA 3 /* PATA Controller */
27 /* Reserved */
28#define IRQ_DMA 5 /* DMA Controller */
29#define IRQ_EXT0 6 /* External Interrupt 0 */
30#define IRQ_EXT1 7 /* External Interrupt 1 */
31#define IRQ_GE 8 /* Graphic Engine */
32#define IRQ_GOV 9 /* Graphic Overlay Engine */
33#define IRQ_ETHER 10 /* Ethernet MAC */
34#define IRQ_MPEGTS 11 /* Transport Stream Interface */
35#define IRQ_LCDC 12 /* LCD Controller */
36#define IRQ_EXT2 13 /* External Interrupt 2 */
37#define IRQ_EXT3 14 /* External Interrupt 3 */
38#define IRQ_EXT4 15 /* External Interrupt 4 */
39#define IRQ_CIPHER 16 /* Cipher */
40#define IRQ_VPP 17 /* Video Post-Processor */
41#define IRQ_I2C1 18 /* I2C 1 */
42#define IRQ_I2C0 19 /* I2C 0 */
43#define IRQ_SDMMC 20 /* SD/MMC Controller */
44#define IRQ_SDMMC_DMA 21 /* SD/MMC Controller DMA */
45#define IRQ_PMC_WU 22 /* Power Management Controller Wakeup */
46 /* Reserved */
47#define IRQ_SPI0 24 /* SPI 0 */
48#define IRQ_SPI1 25 /* SPI 1 */
49#define IRQ_SPI2 26 /* SPI 2 */
50#define IRQ_LCDDF 27 /* LCD Data Formatter */
51#define IRQ_NAND 28 /* NAND Flash Controller */
52#define IRQ_NAND_DMA 29 /* NAND Flash Controller DMA */
53#define IRQ_MS 30 /* MemoryStick Controller */
54#define IRQ_MS_DMA 31 /* MemoryStick Controller DMA */
55#define IRQ_UART0 32 /* UART 0 */
56#define IRQ_UART1 33 /* UART 1 */
57#define IRQ_I2S 34 /* I2S */
58#define IRQ_PCM 35 /* PCM */
59#define IRQ_PMCOS0 36 /* PMC OS Timer 0 */
60#define IRQ_PMCOS1 37 /* PMC OS Timer 1 */
61#define IRQ_PMCOS2 38 /* PMC OS Timer 2 */
62#define IRQ_PMCOS3 39 /* PMC OS Timer 3 */
63#define IRQ_VPU 40 /* Video Processing Unit */
64#define IRQ_VID 41 /* Video Digital Input Interface */
65#define IRQ_AC97 42 /* AC97 Interface */
66#define IRQ_EHCI 43 /* USB */
67#define IRQ_NOR 44 /* NOR Flash Controller */
68#define IRQ_PS2MOUSE 45 /* PS/2 Mouse */
69#define IRQ_PS2KBD 46 /* PS/2 Keyboard */
70#define IRQ_UART2 47 /* UART 2 */
71#define IRQ_RTC 48 /* RTC Interrupt */
72#define IRQ_RTCSM 49 /* RTC Second/Minute Update Interrupt */
73#define IRQ_UART3 50 /* UART 3 */
74#define IRQ_ADC 51 /* ADC */
75#define IRQ_EXT5 52 /* External Interrupt 5 */
76#define IRQ_EXT6 53 /* External Interrupt 6 */
77#define IRQ_EXT7 54 /* External Interrupt 7 */
78#define IRQ_CIR 55 /* CIR */
79#define IRQ_DMA0 56 /* DMA Channel 0 */
80#define IRQ_DMA1 57 /* DMA Channel 1 */
81#define IRQ_DMA2 58 /* DMA Channel 2 */
82#define IRQ_DMA3 59 /* DMA Channel 3 */
83#define IRQ_DMA4 60 /* DMA Channel 4 */
84#define IRQ_DMA5 61 /* DMA Channel 5 */
85#define IRQ_DMA6 62 /* DMA Channel 6 */
86#define IRQ_DMA7 63 /* DMA Channel 7 */
87
88#define VT8500_NR_IRQS 64
diff --git a/arch/arm/mach-vt8500/include/mach/vt8500_regs.h b/arch/arm/mach-vt8500/include/mach/vt8500_regs.h
deleted file mode 100644
index 29c63ecb238..00000000000
--- a/arch/arm/mach-vt8500/include/mach/vt8500_regs.h
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/vt8500_regs.h
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARM_ARCH_VT8500_REGS_H
21#define __ASM_ARM_ARCH_VT8500_REGS_H
22
23/* VT8500 Registers Map */
24
25#define VT8500_REGS_START_PHYS 0xd8000000 /* Start of MMIO registers */
26#define VT8500_REGS_START_VIRT 0xf8000000 /* Virtual mapping start */
27
28#define VT8500_DDR_BASE 0xd8000000 /* 1k DDR/DDR2 Memory
29 Controller */
30#define VT8500_DMA_BASE 0xd8001000 /* 1k DMA Controller */
31#define VT8500_SFLASH_BASE 0xd8002000 /* 1k Serial Flash Memory
32 Controller */
33#define VT8500_ETHER_BASE 0xd8004000 /* 1k Ethernet MAC 0 */
34#define VT8500_CIPHER_BASE 0xd8006000 /* 4k Cipher */
35#define VT8500_USB_BASE 0xd8007800 /* 2k USB OTG */
36# define VT8500_EHCI_BASE 0xd8007900 /* EHCI */
37# define VT8500_UHCI_BASE 0xd8007b01 /* UHCI */
38#define VT8500_PATA_BASE 0xd8008000 /* 512 PATA */
39#define VT8500_PS2_BASE 0xd8008800 /* 1k PS/2 */
40#define VT8500_NAND_BASE 0xd8009000 /* 1k NAND Controller */
41#define VT8500_NOR_BASE 0xd8009400 /* 1k NOR Controller */
42#define VT8500_SDMMC_BASE 0xd800a000 /* 1k SD/MMC Controller */
43#define VT8500_MS_BASE 0xd800b000 /* 1k MS/MSPRO Controller */
44#define VT8500_LCDC_BASE 0xd800e400 /* 1k LCD Controller */
45#define VT8500_VPU_BASE 0xd8050000 /* 256 VPU */
46#define VT8500_GOV_BASE 0xd8050300 /* 256 GOV */
47#define VT8500_GEGEA_BASE 0xd8050400 /* 768 GE/GE Alpha Mixing */
48#define VT8500_LCDF_BASE 0xd8050900 /* 256 LCD Formatter */
49#define VT8500_VID_BASE 0xd8050a00 /* 256 VID */
50#define VT8500_VPP_BASE 0xd8050b00 /* 256 VPP */
51#define VT8500_TSBK_BASE 0xd80f4000 /* 4k TSBK */
52#define VT8500_JPEGDEC_BASE 0xd80fe000 /* 4k JPEG Decoder */
53#define VT8500_JPEGENC_BASE 0xd80ff000 /* 4k JPEG Encoder */
54#define VT8500_RTC_BASE 0xd8100000 /* 64k RTC */
55#define VT8500_GPIO_BASE 0xd8110000 /* 64k GPIO Configuration */
56#define VT8500_SCC_BASE 0xd8120000 /* 64k System Configuration*/
57#define VT8500_PMC_BASE 0xd8130000 /* 64k PMC Configuration */
58#define VT8500_IC_BASE 0xd8140000 /* 64k Interrupt Controller*/
59#define VT8500_UART0_BASE 0xd8200000 /* 64k UART 0 */
60#define VT8500_UART2_BASE 0xd8210000 /* 64k UART 2 */
61#define VT8500_PWM_BASE 0xd8220000 /* 64k PWM Configuration */
62#define VT8500_SPI0_BASE 0xd8240000 /* 64k SPI 0 */
63#define VT8500_SPI1_BASE 0xd8250000 /* 64k SPI 1 */
64#define VT8500_CIR_BASE 0xd8270000 /* 64k CIR */
65#define VT8500_I2C0_BASE 0xd8280000 /* 64k I2C 0 */
66#define VT8500_AC97_BASE 0xd8290000 /* 64k AC97 */
67#define VT8500_SPI2_BASE 0xd82a0000 /* 64k SPI 2 */
68#define VT8500_UART1_BASE 0xd82b0000 /* 64k UART 1 */
69#define VT8500_UART3_BASE 0xd82c0000 /* 64k UART 3 */
70#define VT8500_PCM_BASE 0xd82d0000 /* 64k PCM */
71#define VT8500_I2C1_BASE 0xd8320000 /* 64k I2C 1 */
72#define VT8500_I2S_BASE 0xd8330000 /* 64k I2S */
73#define VT8500_ADC_BASE 0xd8340000 /* 64k ADC */
74
75#define VT8500_REGS_END_PHYS 0xd834ffff /* End of MMIO registers */
76#define VT8500_REGS_LENGTH (VT8500_REGS_END_PHYS \
77 - VT8500_REGS_START_PHYS + 1)
78
79#endif
diff --git a/arch/arm/mach-vt8500/include/mach/vt8500fb.h b/arch/arm/mach-vt8500/include/mach/vt8500fb.h
deleted file mode 100644
index 7f399c370fe..00000000000
--- a/arch/arm/mach-vt8500/include/mach/vt8500fb.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * VT8500/WM8505 Frame Buffer platform data definitions
3 *
4 * Copyright (C) 2010 Ed Spiridonov <edo.rus@gmail.com>
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef _VT8500FB_H
17#define _VT8500FB_H
18
19#include <linux/fb.h>
20
21struct vt8500fb_platform_data {
22 struct fb_videomode mode;
23 u32 xres_virtual;
24 u32 yres_virtual;
25 u32 bpp;
26 unsigned long video_mem_phys;
27 void *video_mem_virt;
28 unsigned long video_mem_len;
29};
30
31#endif /* _VT8500FB_H */
diff --git a/arch/arm/mach-vt8500/include/mach/wm8505_irqs.h b/arch/arm/mach-vt8500/include/mach/wm8505_irqs.h
deleted file mode 100644
index 6128627ac75..00000000000
--- a/arch/arm/mach-vt8500/include/mach/wm8505_irqs.h
+++ /dev/null
@@ -1,115 +0,0 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/wm8505_irqs.h
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21/* WM8505 Interrupt Sources */
22
23#define IRQ_UHCI 0 /* UHC FS (UHCI?) */
24#define IRQ_EHCI 1 /* UHC HS */
25#define IRQ_UDCDMA 2 /* UDC DMA */
26 /* Reserved */
27#define IRQ_PS2MOUSE 4 /* PS/2 Mouse */
28#define IRQ_UDC 5 /* UDC */
29#define IRQ_EXT0 6 /* External Interrupt 0 */
30#define IRQ_EXT1 7 /* External Interrupt 1 */
31#define IRQ_KEYPAD 8 /* Keypad */
32#define IRQ_DMA 9 /* DMA Controller */
33#define IRQ_ETHER 10 /* Ethernet MAC */
34 /* Reserved */
35 /* Reserved */
36#define IRQ_EXT2 13 /* External Interrupt 2 */
37#define IRQ_EXT3 14 /* External Interrupt 3 */
38#define IRQ_EXT4 15 /* External Interrupt 4 */
39#define IRQ_APB 16 /* APB Bridge */
40#define IRQ_DMA0 17 /* DMA Channel 0 */
41#define IRQ_I2C1 18 /* I2C 1 */
42#define IRQ_I2C0 19 /* I2C 0 */
43#define IRQ_SDMMC 20 /* SD/MMC Controller */
44#define IRQ_SDMMC_DMA 21 /* SD/MMC Controller DMA */
45#define IRQ_PMC_WU 22 /* Power Management Controller Wakeup */
46#define IRQ_PS2KBD 23 /* PS/2 Keyboard */
47#define IRQ_SPI0 24 /* SPI 0 */
48#define IRQ_SPI1 25 /* SPI 1 */
49#define IRQ_SPI2 26 /* SPI 2 */
50#define IRQ_DMA1 27 /* DMA Channel 1 */
51#define IRQ_NAND 28 /* NAND Flash Controller */
52#define IRQ_NAND_DMA 29 /* NAND Flash Controller DMA */
53#define IRQ_UART5 30 /* UART 5 */
54#define IRQ_UART4 31 /* UART 4 */
55#define IRQ_UART0 32 /* UART 0 */
56#define IRQ_UART1 33 /* UART 1 */
57#define IRQ_DMA2 34 /* DMA Channel 2 */
58#define IRQ_I2S 35 /* I2S */
59#define IRQ_PMCOS0 36 /* PMC OS Timer 0 */
60#define IRQ_PMCOS1 37 /* PMC OS Timer 1 */
61#define IRQ_PMCOS2 38 /* PMC OS Timer 2 */
62#define IRQ_PMCOS3 39 /* PMC OS Timer 3 */
63#define IRQ_DMA3 40 /* DMA Channel 3 */
64#define IRQ_DMA4 41 /* DMA Channel 4 */
65#define IRQ_AC97 42 /* AC97 Interface */
66 /* Reserved */
67#define IRQ_NOR 44 /* NOR Flash Controller */
68#define IRQ_DMA5 45 /* DMA Channel 5 */
69#define IRQ_DMA6 46 /* DMA Channel 6 */
70#define IRQ_UART2 47 /* UART 2 */
71#define IRQ_RTC 48 /* RTC Interrupt */
72#define IRQ_RTCSM 49 /* RTC Second/Minute Update Interrupt */
73#define IRQ_UART3 50 /* UART 3 */
74#define IRQ_DMA7 51 /* DMA Channel 7 */
75#define IRQ_EXT5 52 /* External Interrupt 5 */
76#define IRQ_EXT6 53 /* External Interrupt 6 */
77#define IRQ_EXT7 54 /* External Interrupt 7 */
78#define IRQ_CIR 55 /* CIR */
79#define IRQ_SIC0 56 /* SIC IRQ0 */
80#define IRQ_SIC1 57 /* SIC IRQ1 */
81#define IRQ_SIC2 58 /* SIC IRQ2 */
82#define IRQ_SIC3 59 /* SIC IRQ3 */
83#define IRQ_SIC4 60 /* SIC IRQ4 */
84#define IRQ_SIC5 61 /* SIC IRQ5 */
85#define IRQ_SIC6 62 /* SIC IRQ6 */
86#define IRQ_SIC7 63 /* SIC IRQ7 */
87 /* Reserved */
88#define IRQ_JPEGDEC 65 /* JPEG Decoder */
89#define IRQ_SAE 66 /* SAE (?) */
90 /* Reserved */
91#define IRQ_VPU 79 /* Video Processing Unit */
92#define IRQ_VPP 80 /* Video Post-Processor */
93#define IRQ_VID 81 /* Video Digital Input Interface */
94#define IRQ_SPU 82 /* SPU (?) */
95#define IRQ_PIP 83 /* PIP Error */
96#define IRQ_GE 84 /* Graphic Engine */
97#define IRQ_GOV 85 /* Graphic Overlay Engine */
98#define IRQ_DVO 86 /* Digital Video Output */
99 /* Reserved */
100#define IRQ_DMA8 92 /* DMA Channel 8 */
101#define IRQ_DMA9 93 /* DMA Channel 9 */
102#define IRQ_DMA10 94 /* DMA Channel 10 */
103#define IRQ_DMA11 95 /* DMA Channel 11 */
104#define IRQ_DMA12 96 /* DMA Channel 12 */
105#define IRQ_DMA13 97 /* DMA Channel 13 */
106#define IRQ_DMA14 98 /* DMA Channel 14 */
107#define IRQ_DMA15 99 /* DMA Channel 15 */
108 /* Reserved */
109#define IRQ_GOVW 111 /* GOVW (?) */
110#define IRQ_GOVRSDSCD 112 /* GOVR SDSCD (?) */
111#define IRQ_GOVRSDMIF 113 /* GOVR SDMIF (?) */
112#define IRQ_GOVRHDSCD 114 /* GOVR HDSCD (?) */
113#define IRQ_GOVRHDMIF 115 /* GOVR HDMIF (?) */
114
115#define WM8505_NR_IRQS 116
diff --git a/arch/arm/mach-vt8500/include/mach/wm8505_regs.h b/arch/arm/mach-vt8500/include/mach/wm8505_regs.h
deleted file mode 100644
index df1550941ef..00000000000
--- a/arch/arm/mach-vt8500/include/mach/wm8505_regs.h
+++ /dev/null
@@ -1,78 +0,0 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/wm8505_regs.h
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARM_ARCH_WM8505_REGS_H
21#define __ASM_ARM_ARCH_WM8505_REGS_H
22
23/* WM8505 Registers Map */
24
25#define WM8505_REGS_START_PHYS 0xd8000000 /* Start of MMIO registers */
26#define WM8505_REGS_START_VIRT 0xf8000000 /* Virtual mapping start */
27
28#define WM8505_DDR_BASE 0xd8000400 /* 1k DDR/DDR2 Memory
29 Controller */
30#define WM8505_DMA_BASE 0xd8001800 /* 1k DMA Controller */
31#define WM8505_VDMA_BASE 0xd8001c00 /* 1k VDMA */
32#define WM8505_SFLASH_BASE 0xd8002000 /* 1k Serial Flash Memory
33 Controller */
34#define WM8505_ETHER_BASE 0xd8004000 /* 1k Ethernet MAC 0 */
35#define WM8505_CIPHER_BASE 0xd8006000 /* 4k Cipher */
36#define WM8505_USB_BASE 0xd8007000 /* 2k USB 2.0 Host */
37# define WM8505_EHCI_BASE 0xd8007100 /* EHCI */
38# define WM8505_UHCI_BASE 0xd8007301 /* UHCI */
39#define WM8505_PS2_BASE 0xd8008800 /* 1k PS/2 */
40#define WM8505_NAND_BASE 0xd8009000 /* 1k NAND Controller */
41#define WM8505_NOR_BASE 0xd8009400 /* 1k NOR Controller */
42#define WM8505_SDMMC_BASE 0xd800a000 /* 1k SD/MMC Controller */
43#define WM8505_VPU_BASE 0xd8050000 /* 256 VPU */
44#define WM8505_GOV_BASE 0xd8050300 /* 256 GOV */
45#define WM8505_GEGEA_BASE 0xd8050400 /* 768 GE/GE Alpha Mixing */
46#define WM8505_GOVR_BASE 0xd8050800 /* 512 GOVR (frambuffer) */
47#define WM8505_VID_BASE 0xd8050a00 /* 256 VID */
48#define WM8505_SCL_BASE 0xd8050d00 /* 256 SCL */
49#define WM8505_VPP_BASE 0xd8050f00 /* 256 VPP */
50#define WM8505_JPEGDEC_BASE 0xd80fe000 /* 4k JPEG Decoder */
51#define WM8505_RTC_BASE 0xd8100000 /* 64k RTC */
52#define WM8505_GPIO_BASE 0xd8110000 /* 64k GPIO Configuration */
53#define WM8505_SCC_BASE 0xd8120000 /* 64k System Configuration*/
54#define WM8505_PMC_BASE 0xd8130000 /* 64k PMC Configuration */
55#define WM8505_IC_BASE 0xd8140000 /* 64k Interrupt Controller*/
56#define WM8505_SIC_BASE 0xd8150000 /* 64k Secondary IC */
57#define WM8505_UART0_BASE 0xd8200000 /* 64k UART 0 */
58#define WM8505_UART2_BASE 0xd8210000 /* 64k UART 2 */
59#define WM8505_PWM_BASE 0xd8220000 /* 64k PWM Configuration */
60#define WM8505_SPI0_BASE 0xd8240000 /* 64k SPI 0 */
61#define WM8505_SPI1_BASE 0xd8250000 /* 64k SPI 1 */
62#define WM8505_KEYPAD_BASE 0xd8260000 /* 64k Keypad control */
63#define WM8505_CIR_BASE 0xd8270000 /* 64k CIR */
64#define WM8505_I2C0_BASE 0xd8280000 /* 64k I2C 0 */
65#define WM8505_AC97_BASE 0xd8290000 /* 64k AC97 */
66#define WM8505_SPI2_BASE 0xd82a0000 /* 64k SPI 2 */
67#define WM8505_UART1_BASE 0xd82b0000 /* 64k UART 1 */
68#define WM8505_UART3_BASE 0xd82c0000 /* 64k UART 3 */
69#define WM8505_I2C1_BASE 0xd8320000 /* 64k I2C 1 */
70#define WM8505_I2S_BASE 0xd8330000 /* 64k I2S */
71#define WM8505_UART4_BASE 0xd8370000 /* 64k UART 4 */
72#define WM8505_UART5_BASE 0xd8380000 /* 64k UART 5 */
73
74#define WM8505_REGS_END_PHYS 0xd838ffff /* End of MMIO registers */
75#define WM8505_REGS_LENGTH (WM8505_REGS_END_PHYS \
76 - WM8505_REGS_START_PHYS + 1)
77
78#endif
diff --git a/arch/arm/mach-vt8500/irq.c b/arch/arm/mach-vt8500/irq.c
index 642de0408f2..f8f9ab9bc56 100644
--- a/arch/arm/mach-vt8500/irq.c
+++ b/arch/arm/mach-vt8500/irq.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * arch/arm/mach-vt8500/irq.c 2 * arch/arm/mach-vt8500/irq.c
3 * 3 *
4 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com> 5 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -18,81 +19,102 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 20 */
20 21
22/*
23 * This file is copied and modified from the original irq.c provided by
24 * Alexey Charkov. Minor changes have been made for Device Tree Support.
25 */
26
27#include <linux/slab.h>
21#include <linux/io.h> 28#include <linux/io.h>
22#include <linux/irq.h> 29#include <linux/irq.h>
30#include <linux/irqdomain.h>
23#include <linux/interrupt.h> 31#include <linux/interrupt.h>
32#include <linux/bitops.h>
33
34#include <linux/of.h>
35#include <linux/of_irq.h>
36#include <linux/of_address.h>
24 37
25#include <asm/irq.h> 38#include <asm/irq.h>
26 39
27#include "devices.h"
28 40
29#define VT8500_IC_DCTR 0x40 /* Destination control 41#define VT8500_ICPC_IRQ 0x20
30 register, 64*u8 */ 42#define VT8500_ICPC_FIQ 0x24
31#define VT8500_INT_ENABLE (1 << 3) 43#define VT8500_ICDC 0x40 /* Destination Control 64*u32 */
32#define VT8500_TRIGGER_HIGH (0 << 4) 44#define VT8500_ICIS 0x80 /* Interrupt status, 16*u32 */
33#define VT8500_TRIGGER_RISING (1 << 4) 45
34#define VT8500_TRIGGER_FALLING (2 << 4) 46/* ICPC */
47#define ICPC_MASK 0x3F
48#define ICPC_ROTATE BIT(6)
49
50/* IC_DCTR */
51#define ICDC_IRQ 0x00
52#define ICDC_FIQ 0x01
53#define ICDC_DSS0 0x02
54#define ICDC_DSS1 0x03
55#define ICDC_DSS2 0x04
56#define ICDC_DSS3 0x05
57#define ICDC_DSS4 0x06
58#define ICDC_DSS5 0x07
59
60#define VT8500_INT_DISABLE 0
61#define VT8500_INT_ENABLE BIT(3)
62
63#define VT8500_TRIGGER_HIGH 0
64#define VT8500_TRIGGER_RISING BIT(5)
65#define VT8500_TRIGGER_FALLING BIT(6)
35#define VT8500_EDGE ( VT8500_TRIGGER_RISING \ 66#define VT8500_EDGE ( VT8500_TRIGGER_RISING \
36 | VT8500_TRIGGER_FALLING) 67 | VT8500_TRIGGER_FALLING)
37#define VT8500_IC_STATUS 0x80 /* Interrupt status, 2*u32 */
38 68
39static void __iomem *ic_regbase; 69static int irq_cnt;
40static void __iomem *sic_regbase; 70
71struct vt8500_irq_priv {
72 void __iomem *base;
73};
41 74
42static void vt8500_irq_mask(struct irq_data *d) 75static void vt8500_irq_mask(struct irq_data *d)
43{ 76{
44 void __iomem *base = ic_regbase; 77 struct vt8500_irq_priv *priv =
45 unsigned irq = d->irq; 78 (struct vt8500_irq_priv *)(d->domain->host_data);
79 void __iomem *base = priv->base;
46 u8 edge; 80 u8 edge;
47 81
48 if (irq >= 64) { 82 edge = readb(base + VT8500_ICDC + d->hwirq) & VT8500_EDGE;
49 base = sic_regbase;
50 irq -= 64;
51 }
52 edge = readb(base + VT8500_IC_DCTR + irq) & VT8500_EDGE;
53 if (edge) { 83 if (edge) {
54 void __iomem *stat_reg = base + VT8500_IC_STATUS 84 void __iomem *stat_reg = base + VT8500_ICIS
55 + (irq < 32 ? 0 : 4); 85 + (d->hwirq < 32 ? 0 : 4);
56 unsigned status = readl(stat_reg); 86 unsigned status = readl(stat_reg);
57 87
58 status |= (1 << (irq & 0x1f)); 88 status |= (1 << (d->hwirq & 0x1f));
59 writel(status, stat_reg); 89 writel(status, stat_reg);
60 } else { 90 } else {
61 u8 dctr = readb(base + VT8500_IC_DCTR + irq); 91 u8 dctr = readb(base + VT8500_ICDC + d->hwirq);
62 92
63 dctr &= ~VT8500_INT_ENABLE; 93 dctr &= ~VT8500_INT_ENABLE;
64 writeb(dctr, base + VT8500_IC_DCTR + irq); 94 writeb(dctr, base + VT8500_ICDC + d->hwirq);
65 } 95 }
66} 96}
67 97
68static void vt8500_irq_unmask(struct irq_data *d) 98static void vt8500_irq_unmask(struct irq_data *d)
69{ 99{
70 void __iomem *base = ic_regbase; 100 struct vt8500_irq_priv *priv =
71 unsigned irq = d->irq; 101 (struct vt8500_irq_priv *)(d->domain->host_data);
102 void __iomem *base = priv->base;
72 u8 dctr; 103 u8 dctr;
73 104
74 if (irq >= 64) { 105 dctr = readb(base + VT8500_ICDC + d->hwirq);
75 base = sic_regbase;
76 irq -= 64;
77 }
78 dctr = readb(base + VT8500_IC_DCTR + irq);
79 dctr |= VT8500_INT_ENABLE; 106 dctr |= VT8500_INT_ENABLE;
80 writeb(dctr, base + VT8500_IC_DCTR + irq); 107 writeb(dctr, base + VT8500_ICDC + d->hwirq);
81} 108}
82 109
83static int vt8500_irq_set_type(struct irq_data *d, unsigned int flow_type) 110static int vt8500_irq_set_type(struct irq_data *d, unsigned int flow_type)
84{ 111{
85 void __iomem *base = ic_regbase; 112 struct vt8500_irq_priv *priv =
86 unsigned irq = d->irq; 113 (struct vt8500_irq_priv *)(d->domain->host_data);
87 unsigned orig_irq = irq; 114 void __iomem *base = priv->base;
88 u8 dctr; 115 u8 dctr;
89 116
90 if (irq >= 64) { 117 dctr = readb(base + VT8500_ICDC + d->hwirq);
91 base = sic_regbase;
92 irq -= 64;
93 }
94
95 dctr = readb(base + VT8500_IC_DCTR + irq);
96 dctr &= ~VT8500_EDGE; 118 dctr &= ~VT8500_EDGE;
97 119
98 switch (flow_type) { 120 switch (flow_type) {
@@ -100,18 +122,18 @@ static int vt8500_irq_set_type(struct irq_data *d, unsigned int flow_type)
100 return -EINVAL; 122 return -EINVAL;
101 case IRQF_TRIGGER_HIGH: 123 case IRQF_TRIGGER_HIGH:
102 dctr |= VT8500_TRIGGER_HIGH; 124 dctr |= VT8500_TRIGGER_HIGH;
103 __irq_set_handler_locked(orig_irq, handle_level_irq); 125 __irq_set_handler_locked(d->irq, handle_level_irq);
104 break; 126 break;
105 case IRQF_TRIGGER_FALLING: 127 case IRQF_TRIGGER_FALLING:
106 dctr |= VT8500_TRIGGER_FALLING; 128 dctr |= VT8500_TRIGGER_FALLING;
107 __irq_set_handler_locked(orig_irq, handle_edge_irq); 129 __irq_set_handler_locked(d->irq, handle_edge_irq);
108 break; 130 break;
109 case IRQF_TRIGGER_RISING: 131 case IRQF_TRIGGER_RISING:
110 dctr |= VT8500_TRIGGER_RISING; 132 dctr |= VT8500_TRIGGER_RISING;
111 __irq_set_handler_locked(orig_irq, handle_edge_irq); 133 __irq_set_handler_locked(d->irq, handle_edge_irq);
112 break; 134 break;
113 } 135 }
114 writeb(dctr, base + VT8500_IC_DCTR + irq); 136 writeb(dctr, base + VT8500_ICDC + d->hwirq);
115 137
116 return 0; 138 return 0;
117} 139}
@@ -124,57 +146,76 @@ static struct irq_chip vt8500_irq_chip = {
124 .irq_set_type = vt8500_irq_set_type, 146 .irq_set_type = vt8500_irq_set_type,
125}; 147};
126 148
127void __init vt8500_init_irq(void) 149static void __init vt8500_init_irq_hw(void __iomem *base)
128{ 150{
129 unsigned int i; 151 unsigned int i;
130 152
131 ic_regbase = ioremap(wmt_ic_base, SZ_64K); 153 /* Enable rotating priority for IRQ */
154 writel(ICPC_ROTATE, base + VT8500_ICPC_IRQ);
155 writel(0x00, base + VT8500_ICPC_FIQ);
132 156
133 if (ic_regbase) { 157 for (i = 0; i < 64; i++) {
134 /* Enable rotating priority for IRQ */ 158 /* Disable all interrupts and route them to IRQ */
135 writel((1 << 6), ic_regbase + 0x20); 159 writeb(VT8500_INT_DISABLE | ICDC_IRQ,
136 writel(0, ic_regbase + 0x24); 160 base + VT8500_ICDC + i);
161 }
162}
137 163
138 for (i = 0; i < wmt_nr_irqs; i++) { 164static int vt8500_irq_map(struct irq_domain *h, unsigned int virq,
139 /* Disable all interrupts and route them to IRQ */ 165 irq_hw_number_t hw)
140 writeb(0x00, ic_regbase + VT8500_IC_DCTR + i); 166{
167 irq_set_chip_and_handler(virq, &vt8500_irq_chip, handle_level_irq);
168 set_irq_flags(virq, IRQF_VALID);
141 169
142 irq_set_chip_and_handler(i, &vt8500_irq_chip, 170 return 0;
143 handle_level_irq);
144 set_irq_flags(i, IRQF_VALID);
145 }
146 } else {
147 printk(KERN_ERR "Unable to remap the Interrupt Controller registers, not enabling IRQs!\n");
148 }
149} 171}
150 172
151void __init wm8505_init_irq(void) 173static struct irq_domain_ops vt8500_irq_domain_ops = {
174 .map = vt8500_irq_map,
175 .xlate = irq_domain_xlate_onecell,
176};
177
178int __init vt8500_irq_init(struct device_node *node, struct device_node *parent)
152{ 179{
153 unsigned int i; 180 struct irq_domain *vt8500_irq_domain;
181 struct vt8500_irq_priv *priv;
182 int irq, i;
183 struct device_node *np = node;
184
185 priv = kzalloc(sizeof(struct vt8500_irq_priv), GFP_KERNEL);
186 priv->base = of_iomap(np, 0);
187
188 vt8500_irq_domain = irq_domain_add_legacy(node, 64, irq_cnt, 0,
189 &vt8500_irq_domain_ops, priv);
190 if (!vt8500_irq_domain)
191 pr_err("%s: Unable to add wmt irq domain!\n", __func__);
192
193 irq_set_default_host(vt8500_irq_domain);
194
195 vt8500_init_irq_hw(priv->base);
154 196
155 ic_regbase = ioremap(wmt_ic_base, SZ_64K); 197 pr_info("Added IRQ Controller @ %x [virq_base = %d]\n",
156 sic_regbase = ioremap(wmt_sic_base, SZ_64K); 198 (u32)(priv->base), irq_cnt);
157 199
158 if (ic_regbase && sic_regbase) { 200 /* check if this is a slaved controller */
159 /* Enable rotating priority for IRQ */ 201 if (of_irq_count(np) != 0) {
160 writel((1 << 6), ic_regbase + 0x20); 202 /* check that we have the correct number of interrupts */
161 writel(0, ic_regbase + 0x24); 203 if (of_irq_count(np) != 8) {
162 writel((1 << 6), sic_regbase + 0x20); 204 pr_err("%s: Incorrect IRQ map for slave controller\n",
163 writel(0, sic_regbase + 0x24); 205 __func__);
164 206 return -EINVAL;
165 for (i = 0; i < wmt_nr_irqs; i++) {
166 /* Disable all interrupts and route them to IRQ */
167 if (i < 64)
168 writeb(0x00, ic_regbase + VT8500_IC_DCTR + i);
169 else
170 writeb(0x00, sic_regbase + VT8500_IC_DCTR
171 + i - 64);
172
173 irq_set_chip_and_handler(i, &vt8500_irq_chip,
174 handle_level_irq);
175 set_irq_flags(i, IRQF_VALID);
176 } 207 }
177 } else { 208
178 printk(KERN_ERR "Unable to remap the Interrupt Controller registers, not enabling IRQs!\n"); 209 for (i = 0; i < 8; i++) {
210 irq = irq_of_parse_and_map(np, i);
211 enable_irq(irq);
212 }
213
214 pr_info("vt8500-irq: Enabled slave->parent interrupts\n");
179 } 215 }
216
217 irq_cnt += 64;
218
219 return 0;
180} 220}
221
diff --git a/arch/arm/mach-vt8500/restart.c b/arch/arm/mach-vt8500/restart.c
deleted file mode 100644
index 497e89a5e13..00000000000
--- a/arch/arm/mach-vt8500/restart.c
+++ /dev/null
@@ -1,54 +0,0 @@
1/* linux/arch/arm/mach-vt8500/restart.c
2 *
3 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15#include <asm/io.h>
16#include <linux/of.h>
17#include <linux/of_address.h>
18
19#define LEGACY_PMC_BASE 0xD8130000
20#define WMT_PRIZM_PMSR_REG 0x60
21
22static void __iomem *pmc_base;
23
24void wmt_setup_restart(void)
25{
26 struct device_node *np;
27
28 /*
29 * Check if Power Mgmt Controller node is present in device tree. If no
30 * device tree node, use the legacy PMSR value (valid for all current
31 * SoCs).
32 */
33 np = of_find_compatible_node(NULL, NULL, "wmt,prizm-pmc");
34 if (np) {
35 pmc_base = of_iomap(np, 0);
36
37 if (!pmc_base)
38 pr_err("%s:of_iomap(pmc) failed\n", __func__);
39
40 of_node_put(np);
41 } else {
42 pmc_base = ioremap(LEGACY_PMC_BASE, 0x1000);
43 if (!pmc_base) {
44 pr_err("%s:ioremap(rstc) failed\n", __func__);
45 return;
46 }
47 }
48}
49
50void wmt_restart(char mode, const char *cmd)
51{
52 if (pmc_base)
53 writel(1, pmc_base + WMT_PRIZM_PMSR_REG);
54}
diff --git a/arch/arm/mach-vt8500/timer.c b/arch/arm/mach-vt8500/timer.c
index d5376c592ab..050e1833f2d 100644
--- a/arch/arm/mach-vt8500/timer.c
+++ b/arch/arm/mach-vt8500/timer.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * arch/arm/mach-vt8500/timer.c 2 * arch/arm/mach-vt8500/timer_dt.c
3 * 3 *
4 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com> 5 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -18,18 +19,25 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 20 */
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
21#include <linux/io.h> 27#include <linux/io.h>
22#include <linux/irq.h> 28#include <linux/irq.h>
23#include <linux/interrupt.h> 29#include <linux/interrupt.h>
24#include <linux/clocksource.h> 30#include <linux/clocksource.h>
25#include <linux/clockchips.h> 31#include <linux/clockchips.h>
26#include <linux/delay.h> 32#include <linux/delay.h>
27
28#include <asm/mach/time.h> 33#include <asm/mach/time.h>
29 34
30#include "devices.h" 35#include <linux/of.h>
36#include <linux/of_address.h>
37#include <linux/of_irq.h>
31 38
32#define VT8500_TIMER_OFFSET 0x0100 39#define VT8500_TIMER_OFFSET 0x0100
40#define VT8500_TIMER_HZ 3000000
33#define TIMER_MATCH_VAL 0x0000 41#define TIMER_MATCH_VAL 0x0000
34#define TIMER_COUNT_VAL 0x0010 42#define TIMER_COUNT_VAL 0x0010
35#define TIMER_STATUS_VAL 0x0014 43#define TIMER_STATUS_VAL 0x0014
@@ -39,7 +47,6 @@
39#define TIMER_COUNT_R_ACTIVE (1 << 5) /* not ready for read */ 47#define TIMER_COUNT_R_ACTIVE (1 << 5) /* not ready for read */
40#define TIMER_COUNT_W_ACTIVE (1 << 4) /* not ready for write */ 48#define TIMER_COUNT_W_ACTIVE (1 << 4) /* not ready for write */
41#define TIMER_MATCH_W_ACTIVE (1 << 0) /* not ready for write */ 49#define TIMER_MATCH_W_ACTIVE (1 << 0) /* not ready for write */
42#define VT8500_TIMER_HZ 3000000
43 50
44#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t) 51#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
45 52
@@ -55,7 +62,7 @@ static cycle_t vt8500_timer_read(struct clocksource *cs)
55 return readl(regbase + TIMER_COUNT_VAL); 62 return readl(regbase + TIMER_COUNT_VAL);
56} 63}
57 64
58struct clocksource clocksource = { 65static struct clocksource clocksource = {
59 .name = "vt8500_timer", 66 .name = "vt8500_timer",
60 .rating = 200, 67 .rating = 200,
61 .read = vt8500_timer_read, 68 .read = vt8500_timer_read,
@@ -98,7 +105,7 @@ static void vt8500_timer_set_mode(enum clock_event_mode mode,
98 } 105 }
99} 106}
100 107
101struct clock_event_device clockevent = { 108static struct clock_event_device clockevent = {
102 .name = "vt8500_timer", 109 .name = "vt8500_timer",
103 .features = CLOCK_EVT_FEAT_ONESHOT, 110 .features = CLOCK_EVT_FEAT_ONESHOT,
104 .rating = 200, 111 .rating = 200,
@@ -115,26 +122,51 @@ static irqreturn_t vt8500_timer_interrupt(int irq, void *dev_id)
115 return IRQ_HANDLED; 122 return IRQ_HANDLED;
116} 123}
117 124
118struct irqaction irq = { 125static struct irqaction irq = {
119 .name = "vt8500_timer", 126 .name = "vt8500_timer",
120 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 127 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
121 .handler = vt8500_timer_interrupt, 128 .handler = vt8500_timer_interrupt,
122 .dev_id = &clockevent, 129 .dev_id = &clockevent,
123}; 130};
124 131
125static void __init vt8500_timer_init(void) 132static struct of_device_id vt8500_timer_ids[] = {
133 { .compatible = "via,vt8500-timer" },
134 { }
135};
136
137void __init vt8500_timer_init(void)
126{ 138{
127 regbase = ioremap(wmt_pmc_base + VT8500_TIMER_OFFSET, 0x28); 139 struct device_node *np;
128 if (!regbase) 140 int timer_irq;
129 printk(KERN_ERR "vt8500_timer_init: failed to map MMIO registers\n"); 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 }
130 162
131 writel(1, regbase + TIMER_CTRL_VAL); 163 writel(1, regbase + TIMER_CTRL_VAL);
132 writel(0xf, regbase + TIMER_STATUS_VAL); 164 writel(0xf, regbase + TIMER_STATUS_VAL);
133 writel(~0, regbase + TIMER_MATCH_VAL); 165 writel(~0, regbase + TIMER_MATCH_VAL);
134 166
135 if (clocksource_register_hz(&clocksource, VT8500_TIMER_HZ)) 167 if (clocksource_register_hz(&clocksource, VT8500_TIMER_HZ))
136 printk(KERN_ERR "vt8500_timer_init: clocksource_register failed for %s\n", 168 pr_err("%s: vt8500_timer_init: clocksource_register failed for %s\n",
137 clocksource.name); 169 __func__, clocksource.name);
138 170
139 clockevents_calc_mult_shift(&clockevent, VT8500_TIMER_HZ, 4); 171 clockevents_calc_mult_shift(&clockevent, VT8500_TIMER_HZ, 4);
140 172
@@ -144,12 +176,9 @@ static void __init vt8500_timer_init(void)
144 clockevent.min_delta_ns = clockevent_delta2ns(4, &clockevent); 176 clockevent.min_delta_ns = clockevent_delta2ns(4, &clockevent);
145 clockevent.cpumask = cpumask_of(0); 177 clockevent.cpumask = cpumask_of(0);
146 178
147 if (setup_irq(wmt_timer_irq, &irq)) 179 if (setup_irq(timer_irq, &irq))
148 printk(KERN_ERR "vt8500_timer_init: setup_irq failed for %s\n", 180 pr_err("%s: setup_irq failed for %s\n", __func__,
149 clockevent.name); 181 clockevent.name);
150 clockevents_register_device(&clockevent); 182 clockevents_register_device(&clockevent);
151} 183}
152 184
153struct sys_timer vt8500_timer = {
154 .init = vt8500_timer_init
155};
diff --git a/arch/arm/mach-vt8500/vt8500.c b/arch/arm/mach-vt8500/vt8500.c
new file mode 100644
index 00000000000..8d3871f110a
--- /dev/null
+++ b/arch/arm/mach-vt8500/vt8500.c
@@ -0,0 +1,198 @@
1/*
2 * arch/arm/mach-vt8500/vt8500.c
3 *
4 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/io.h>
22#include <linux/pm.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <asm/mach/time.h>
27#include <asm/mach/map.h>
28
29#include <linux/of.h>
30#include <linux/of_address.h>
31#include <linux/of_irq.h>
32#include <linux/of_platform.h>
33
34#include <mach/restart.h>
35
36#include "common.h"
37
38#define LEGACY_GPIO_BASE 0xD8110000
39#define LEGACY_PMC_BASE 0xD8130000
40
41/* Registers in GPIO Controller */
42#define VT8500_GPIO_MUX_REG 0x200
43
44/* Registers in Power Management Controller */
45#define VT8500_HCR_REG 0x12
46#define VT8500_PMSR_REG 0x60
47
48static void __iomem *pmc_base;
49
50void vt8500_restart(char mode, const char *cmd)
51{
52 if (pmc_base)
53 writel(1, pmc_base + VT8500_PMSR_REG);
54}
55
56static struct map_desc vt8500_io_desc[] __initdata = {
57 /* SoC MMIO registers */
58 [0] = {
59 .virtual = 0xf8000000,
60 .pfn = __phys_to_pfn(0xd8000000),
61 .length = 0x00390000, /* max of all chip variants */
62 .type = MT_DEVICE
63 },
64};
65
66void __init vt8500_map_io(void)
67{
68 iotable_init(vt8500_io_desc, ARRAY_SIZE(vt8500_io_desc));
69}
70
71static void vt8500_power_off(void)
72{
73 local_irq_disable();
74 writew(5, pmc_base + VT8500_HCR_REG);
75 asm("mcr%? p15, 0, %0, c7, c0, 4" : : "r" (0));
76}
77
78void __init vt8500_init(void)
79{
80 struct device_node *np;
81#if defined(CONFIG_FB_VT8500) || defined(CONFIG_FB_WM8505)
82 struct device_node *fb;
83 void __iomem *gpio_base;
84#endif
85
86#ifdef CONFIG_FB_VT8500
87 fb = of_find_compatible_node(NULL, NULL, "via,vt8500-fb");
88 if (fb) {
89 np = of_find_compatible_node(NULL, NULL, "via,vt8500-gpio");
90 if (np) {
91 gpio_base = of_iomap(np, 0);
92
93 if (!gpio_base)
94 pr_err("%s: of_iomap(gpio_mux) failed\n",
95 __func__);
96
97 of_node_put(np);
98 } else {
99 gpio_base = ioremap(LEGACY_GPIO_BASE, 0x1000);
100 if (!gpio_base)
101 pr_err("%s: ioremap(legacy_gpio_mux) failed\n",
102 __func__);
103 }
104 if (gpio_base) {
105 writel(readl(gpio_base + VT8500_GPIO_MUX_REG) | 1,
106 gpio_base + VT8500_GPIO_MUX_REG);
107 iounmap(gpio_base);
108 } else
109 pr_err("%s: Could not remap GPIO mux\n", __func__);
110
111 of_node_put(fb);
112 }
113#endif
114
115#ifdef CONFIG_FB_WM8505
116 fb = of_find_compatible_node(NULL, NULL, "wm,wm8505-fb");
117 if (fb) {
118 np = of_find_compatible_node(NULL, NULL, "wm,wm8505-gpio");
119 if (!np)
120 np = of_find_compatible_node(NULL, NULL,
121 "wm,wm8650-gpio");
122 if (np) {
123 gpio_base = of_iomap(np, 0);
124
125 if (!gpio_base)
126 pr_err("%s: of_iomap(gpio_mux) failed\n",
127 __func__);
128
129 of_node_put(np);
130 } else {
131 gpio_base = ioremap(LEGACY_GPIO_BASE, 0x1000);
132 if (!gpio_base)
133 pr_err("%s: ioremap(legacy_gpio_mux) failed\n",
134 __func__);
135 }
136 if (gpio_base) {
137 writel(readl(gpio_base + VT8500_GPIO_MUX_REG) |
138 0x80000000, gpio_base + VT8500_GPIO_MUX_REG);
139 iounmap(gpio_base);
140 } else
141 pr_err("%s: Could not remap GPIO mux\n", __func__);
142
143 of_node_put(fb);
144 }
145#endif
146
147 np = of_find_compatible_node(NULL, NULL, "via,vt8500-pmc");
148 if (np) {
149 pmc_base = of_iomap(np, 0);
150
151 if (!pmc_base)
152 pr_err("%s:of_iomap(pmc) failed\n", __func__);
153
154 of_node_put(np);
155 } else {
156 pmc_base = ioremap(LEGACY_PMC_BASE, 0x1000);
157 if (!pmc_base)
158 pr_err("%s:ioremap(power_off) failed\n", __func__);
159 }
160 if (pmc_base)
161 pm_power_off = &vt8500_power_off;
162 else
163 pr_err("%s: PMC Hibernation register could not be remapped, not enabling power off!\n", __func__);
164
165 vtwm_clk_init(pmc_base);
166
167 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
168}
169
170static const struct of_device_id vt8500_irq_match[] __initconst = {
171 { .compatible = "via,vt8500-intc", .data = vt8500_irq_init, },
172 { /* sentinel */ },
173};
174
175static void __init vt8500_init_irq(void)
176{
177 of_irq_init(vt8500_irq_match);
178};
179
180static struct sys_timer vt8500_timer = {
181 .init = vt8500_timer_init,
182};
183
184static const char * const vt8500_dt_compat[] = {
185 "via,vt8500",
186 "wm,wm8650",
187 "wm,wm8505",
188};
189
190DT_MACHINE_START(WMT_DT, "VIA/Wondermedia SoC (Device Tree Support)")
191 .dt_compat = vt8500_dt_compat,
192 .map_io = vt8500_map_io,
193 .init_irq = vt8500_init_irq,
194 .timer = &vt8500_timer,
195 .init_machine = vt8500_init,
196 .restart = vt8500_restart,
197MACHINE_END
198
diff --git a/arch/arm/mach-vt8500/wm8505_7in.c b/arch/arm/mach-vt8500/wm8505_7in.c
deleted file mode 100644
index db19886caf7..00000000000
--- a/arch/arm/mach-vt8500/wm8505_7in.c
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * arch/arm/mach-vt8500/wm8505_7in.c
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/io.h>
22#include <linux/pm.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <mach/restart.h>
27
28#include "devices.h"
29
30static void __iomem *pmc_hiber;
31
32static struct platform_device *devices[] __initdata = {
33 &vt8500_device_uart0,
34 &vt8500_device_ehci,
35 &vt8500_device_wm8505_fb,
36 &vt8500_device_ge_rops,
37 &vt8500_device_pwm,
38 &vt8500_device_pwmbl,
39 &vt8500_device_rtc,
40};
41
42static void vt8500_power_off(void)
43{
44 local_irq_disable();
45 writew(5, pmc_hiber);
46 asm("mcr%? p15, 0, %0, c7, c0, 4" : : "r" (0));
47}
48
49void __init wm8505_7in_init(void)
50{
51#ifdef CONFIG_FB_WM8505
52 void __iomem *gpio_mux_reg = ioremap(wmt_gpio_base + 0x200, 4);
53 if (gpio_mux_reg) {
54 writel(readl(gpio_mux_reg) | 0x80000000, gpio_mux_reg);
55 iounmap(gpio_mux_reg);
56 } else {
57 printk(KERN_ERR "Could not remap the GPIO mux register, display may not work properly!\n");
58 }
59#endif
60 pmc_hiber = ioremap(wmt_pmc_base + 0x12, 2);
61 if (pmc_hiber)
62 pm_power_off = &vt8500_power_off;
63 else
64 printk(KERN_ERR "PMC Hibernation register could not be remapped, not enabling power off!\n");
65 wmt_setup_restart();
66 wm8505_set_resources();
67 platform_add_devices(devices, ARRAY_SIZE(devices));
68 vt8500_gpio_init();
69}
70
71MACHINE_START(WM8505_7IN_NETBOOK, "WM8505 7-inch generic netbook")
72 .atag_offset = 0x100,
73 .restart = wmt_restart,
74 .reserve = wm8505_reserve_mem,
75 .map_io = wm8505_map_io,
76 .init_irq = wm8505_init_irq,
77 .timer = &vt8500_timer,
78 .init_machine = wm8505_7in_init,
79MACHINE_END
diff --git a/arch/arm/mach-w90x900/dev.c b/arch/arm/mach-w90x900/dev.c
index 48f5b9fdfb7..7abdb9645c5 100644
--- a/arch/arm/mach-w90x900/dev.c
+++ b/arch/arm/mach-w90x900/dev.c
@@ -34,11 +34,11 @@
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35 35
36#include <mach/regs-serial.h> 36#include <mach/regs-serial.h>
37#include <mach/nuc900_spi.h> 37#include <linux/platform_data/spi-nuc900.h>
38#include <mach/map.h> 38#include <mach/map.h>
39#include <mach/fb.h> 39#include <linux/platform_data/video-nuc900fb.h>
40#include <mach/regs-ldm.h> 40#include <mach/regs-ldm.h>
41#include <mach/w90p910_keypad.h> 41#include <linux/platform_data/keypad-w90p910.h>
42 42
43#include "cpu.h" 43#include "cpu.h"
44 44
diff --git a/arch/arm/mach-w90x900/include/mach/fb.h b/arch/arm/mach-w90x900/include/mach/fb.h
deleted file mode 100644
index cec5ece765e..00000000000
--- a/arch/arm/mach-w90x900/include/mach/fb.h
+++ /dev/null
@@ -1,83 +0,0 @@
1/* linux/include/asm/arch-nuc900/fb.h
2 *
3 * Copyright (c) 2008 Nuvoton technology corporation
4 * 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 * Changelog:
12 *
13 * 2008/08/26 vincen.zswan modify this file for LCD.
14 */
15
16#ifndef __ASM_ARM_FB_H
17#define __ASM_ARM_FB_H
18
19
20
21/* LCD Controller Hardware Desc */
22struct nuc900fb_hw {
23 unsigned int lcd_dccs;
24 unsigned int lcd_device_ctrl;
25 unsigned int lcd_mpulcd_cmd;
26 unsigned int lcd_int_cs;
27 unsigned int lcd_crtc_size;
28 unsigned int lcd_crtc_dend;
29 unsigned int lcd_crtc_hr;
30 unsigned int lcd_crtc_hsync;
31 unsigned int lcd_crtc_vr;
32 unsigned int lcd_va_baddr0;
33 unsigned int lcd_va_baddr1;
34 unsigned int lcd_va_fbctrl;
35 unsigned int lcd_va_scale;
36 unsigned int lcd_va_test;
37 unsigned int lcd_va_win;
38 unsigned int lcd_va_stuff;
39};
40
41/* LCD Display Description */
42struct nuc900fb_display {
43 /* LCD Image type */
44 unsigned type;
45
46 /* LCD Screen Size */
47 unsigned short width;
48 unsigned short height;
49
50 /* LCD Screen Info */
51 unsigned short xres;
52 unsigned short yres;
53 unsigned short bpp;
54
55 unsigned long pixclock;
56 unsigned short left_margin;
57 unsigned short right_margin;
58 unsigned short hsync_len;
59 unsigned short upper_margin;
60 unsigned short lower_margin;
61 unsigned short vsync_len;
62
63 /* hardware special register value */
64 unsigned int dccs;
65 unsigned int devctl;
66 unsigned int fbctrl;
67 unsigned int scale;
68};
69
70struct nuc900fb_mach_info {
71 struct nuc900fb_display *displays;
72 unsigned num_displays;
73 unsigned default_display;
74 /* GPIO Setting Info */
75 unsigned gpio_dir;
76 unsigned gpio_dir_mask;
77 unsigned gpio_data;
78 unsigned gpio_data_mask;
79};
80
81extern void __init nuc900_fb_set_platdata(struct nuc900fb_mach_info *);
82
83#endif /* __ASM_ARM_FB_H */
diff --git a/arch/arm/mach-w90x900/include/mach/i2c.h b/arch/arm/mach-w90x900/include/mach/i2c.h
deleted file mode 100644
index 9ffb12d06e9..00000000000
--- a/arch/arm/mach-w90x900/include/mach/i2c.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef __ASM_ARCH_NUC900_I2C_H
2#define __ASM_ARCH_NUC900_I2C_H
3
4struct nuc900_platform_i2c {
5 int bus_num;
6 unsigned long bus_freq;
7};
8
9#endif /* __ASM_ARCH_NUC900_I2C_H */
diff --git a/arch/arm/mach-w90x900/include/mach/nuc900_spi.h b/arch/arm/mach-w90x900/include/mach/nuc900_spi.h
deleted file mode 100644
index 2c4e0c12850..00000000000
--- a/arch/arm/mach-w90x900/include/mach/nuc900_spi.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * arch/arm/mach-w90x900/include/mach/nuc900_spi.h
3 *
4 * Copyright (c) 2009 Nuvoton technology corporation.
5 *
6 * Wan ZongShun <mcuos.com@gmail.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;version 2 of the License.
11 *
12 */
13
14#ifndef __ASM_ARCH_SPI_H
15#define __ASM_ARCH_SPI_H
16
17extern void mfp_set_groupg(struct device *dev, const char *subname);
18
19struct nuc900_spi_info {
20 unsigned int num_cs;
21 unsigned int lsb;
22 unsigned int txneg;
23 unsigned int rxneg;
24 unsigned int divider;
25 unsigned int sleep;
26 unsigned int txnum;
27 unsigned int txbitlen;
28 int bus_num;
29};
30
31struct nuc900_spi_chip {
32 unsigned char bits_per_word;
33};
34
35#endif /* __ASM_ARCH_SPI_H */
diff --git a/arch/arm/mach-w90x900/include/mach/w90p910_keypad.h b/arch/arm/mach-w90x900/include/mach/w90p910_keypad.h
deleted file mode 100644
index 556778e8dda..00000000000
--- a/arch/arm/mach-w90x900/include/mach/w90p910_keypad.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef __ASM_ARCH_W90P910_KEYPAD_H
2#define __ASM_ARCH_W90P910_KEYPAD_H
3
4#include <linux/input/matrix_keypad.h>
5
6extern void mfp_set_groupi(struct device *dev);
7
8struct w90p910_keypad_platform_data {
9 const struct matrix_keymap_data *keymap_data;
10
11 unsigned int prescale;
12 unsigned int debounce;
13};
14
15#endif /* __ASM_ARCH_W90P910_KEYPAD_H */
diff --git a/arch/arm/mach-w90x900/mach-nuc950evb.c b/arch/arm/mach-w90x900/mach-nuc950evb.c
index 067d8f9166d..500fe5932ce 100644
--- a/arch/arm/mach-w90x900/mach-nuc950evb.c
+++ b/arch/arm/mach-w90x900/mach-nuc950evb.c
@@ -20,7 +20,7 @@
20#include <asm/mach/map.h> 20#include <asm/mach/map.h>
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22#include <mach/map.h> 22#include <mach/map.h>
23#include <mach/fb.h> 23#include <linux/platform_data/video-nuc900fb.h>
24 24
25#include "nuc950.h" 25#include "nuc950.h"
26 26
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 101b9681c08..94186b6c685 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -10,8 +10,8 @@ config CPU_ARM7TDMI
10 depends on !MMU 10 depends on !MMU
11 select CPU_32v4T 11 select CPU_32v4T
12 select CPU_ABRT_LV4T 12 select CPU_ABRT_LV4T
13 select CPU_PABRT_LEGACY
14 select CPU_CACHE_V4 13 select CPU_CACHE_V4
14 select CPU_PABRT_LEGACY
15 help 15 help
16 A 32-bit RISC microprocessor based on the ARM7 processor core 16 A 32-bit RISC microprocessor based on the ARM7 processor core
17 which has no memory control unit and cache. 17 which has no memory control unit and cache.
@@ -24,11 +24,11 @@ config CPU_ARM720T
24 bool "Support ARM720T processor" if ARCH_INTEGRATOR 24 bool "Support ARM720T processor" if ARCH_INTEGRATOR
25 select CPU_32v4T 25 select CPU_32v4T
26 select CPU_ABRT_LV4T 26 select CPU_ABRT_LV4T
27 select CPU_PABRT_LEGACY
28 select CPU_CACHE_V4 27 select CPU_CACHE_V4
29 select CPU_CACHE_VIVT 28 select CPU_CACHE_VIVT
30 select CPU_CP15_MMU
31 select CPU_COPY_V4WT if MMU 29 select CPU_COPY_V4WT if MMU
30 select CPU_CP15_MMU
31 select CPU_PABRT_LEGACY
32 select CPU_TLB_V4WT if MMU 32 select CPU_TLB_V4WT if MMU
33 help 33 help
34 A 32-bit RISC processor with 8kByte Cache, Write Buffer and 34 A 32-bit RISC processor with 8kByte Cache, Write Buffer and
@@ -43,9 +43,9 @@ config CPU_ARM740T
43 depends on !MMU 43 depends on !MMU
44 select CPU_32v4T 44 select CPU_32v4T
45 select CPU_ABRT_LV4T 45 select CPU_ABRT_LV4T
46 select CPU_PABRT_LEGACY
47 select CPU_CACHE_V3 # although the core is v4t 46 select CPU_CACHE_V3 # although the core is v4t
48 select CPU_CP15_MPU 47 select CPU_CP15_MPU
48 select CPU_PABRT_LEGACY
49 help 49 help
50 A 32-bit RISC processor with 8KB cache or 4KB variants, 50 A 32-bit RISC processor with 8KB cache or 4KB variants,
51 write buffer and MPU(Protection Unit) built around 51 write buffer and MPU(Protection Unit) built around
@@ -60,8 +60,8 @@ config CPU_ARM9TDMI
60 depends on !MMU 60 depends on !MMU
61 select CPU_32v4T 61 select CPU_32v4T
62 select CPU_ABRT_NOMMU 62 select CPU_ABRT_NOMMU
63 select CPU_PABRT_LEGACY
64 select CPU_CACHE_V4 63 select CPU_CACHE_V4
64 select CPU_PABRT_LEGACY
65 help 65 help
66 A 32-bit RISC microprocessor based on the ARM9 processor core 66 A 32-bit RISC microprocessor based on the ARM9 processor core
67 which has no memory control unit and cache. 67 which has no memory control unit and cache.
@@ -74,11 +74,11 @@ config CPU_ARM920T
74 bool "Support ARM920T processor" if ARCH_INTEGRATOR 74 bool "Support ARM920T processor" if ARCH_INTEGRATOR
75 select CPU_32v4T 75 select CPU_32v4T
76 select CPU_ABRT_EV4T 76 select CPU_ABRT_EV4T
77 select CPU_PABRT_LEGACY
78 select CPU_CACHE_V4WT 77 select CPU_CACHE_V4WT
79 select CPU_CACHE_VIVT 78 select CPU_CACHE_VIVT
80 select CPU_CP15_MMU
81 select CPU_COPY_V4WB if MMU 79 select CPU_COPY_V4WB if MMU
80 select CPU_CP15_MMU
81 select CPU_PABRT_LEGACY
82 select CPU_TLB_V4WBI if MMU 82 select CPU_TLB_V4WBI if MMU
83 help 83 help
84 The ARM920T is licensed to be produced by numerous vendors, 84 The ARM920T is licensed to be produced by numerous vendors,
@@ -92,11 +92,11 @@ config CPU_ARM922T
92 bool "Support ARM922T processor" if ARCH_INTEGRATOR 92 bool "Support ARM922T processor" if ARCH_INTEGRATOR
93 select CPU_32v4T 93 select CPU_32v4T
94 select CPU_ABRT_EV4T 94 select CPU_ABRT_EV4T
95 select CPU_PABRT_LEGACY
96 select CPU_CACHE_V4WT 95 select CPU_CACHE_V4WT
97 select CPU_CACHE_VIVT 96 select CPU_CACHE_VIVT
98 select CPU_CP15_MMU
99 select CPU_COPY_V4WB if MMU 97 select CPU_COPY_V4WB if MMU
98 select CPU_CP15_MMU
99 select CPU_PABRT_LEGACY
100 select CPU_TLB_V4WBI if MMU 100 select CPU_TLB_V4WBI if MMU
101 help 101 help
102 The ARM922T is a version of the ARM920T, but with smaller 102 The ARM922T is a version of the ARM920T, but with smaller
@@ -111,11 +111,11 @@ config CPU_ARM925T
111 bool "Support ARM925T processor" if ARCH_OMAP1 111 bool "Support ARM925T processor" if ARCH_OMAP1
112 select CPU_32v4T 112 select CPU_32v4T
113 select CPU_ABRT_EV4T 113 select CPU_ABRT_EV4T
114 select CPU_PABRT_LEGACY
115 select CPU_CACHE_V4WT 114 select CPU_CACHE_V4WT
116 select CPU_CACHE_VIVT 115 select CPU_CACHE_VIVT
117 select CPU_CP15_MMU
118 select CPU_COPY_V4WB if MMU 116 select CPU_COPY_V4WB if MMU
117 select CPU_CP15_MMU
118 select CPU_PABRT_LEGACY
119 select CPU_TLB_V4WBI if MMU 119 select CPU_TLB_V4WBI if MMU
120 help 120 help
121 The ARM925T is a mix between the ARM920T and ARM926T, but with 121 The ARM925T is a mix between the ARM920T and ARM926T, but with
@@ -130,10 +130,10 @@ config CPU_ARM926T
130 bool "Support ARM926T processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB 130 bool "Support ARM926T processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB
131 select CPU_32v5 131 select CPU_32v5
132 select CPU_ABRT_EV5TJ 132 select CPU_ABRT_EV5TJ
133 select CPU_PABRT_LEGACY
134 select CPU_CACHE_VIVT 133 select CPU_CACHE_VIVT
135 select CPU_CP15_MMU
136 select CPU_COPY_V4WB if MMU 134 select CPU_COPY_V4WB if MMU
135 select CPU_CP15_MMU
136 select CPU_PABRT_LEGACY
137 select CPU_TLB_V4WBI if MMU 137 select CPU_TLB_V4WBI if MMU
138 help 138 help
139 This is a variant of the ARM920. It has slightly different 139 This is a variant of the ARM920. It has slightly different
@@ -148,11 +148,11 @@ config CPU_FA526
148 bool 148 bool
149 select CPU_32v4 149 select CPU_32v4
150 select CPU_ABRT_EV4 150 select CPU_ABRT_EV4
151 select CPU_PABRT_LEGACY
152 select CPU_CACHE_VIVT
153 select CPU_CP15_MMU
154 select CPU_CACHE_FA 151 select CPU_CACHE_FA
152 select CPU_CACHE_VIVT
155 select CPU_COPY_FA if MMU 153 select CPU_COPY_FA if MMU
154 select CPU_CP15_MMU
155 select CPU_PABRT_LEGACY
156 select CPU_TLB_FA if MMU 156 select CPU_TLB_FA if MMU
157 help 157 help
158 The FA526 is a version of the ARMv4 compatible processor with 158 The FA526 is a version of the ARMv4 compatible processor with
@@ -167,9 +167,9 @@ config CPU_ARM940T
167 depends on !MMU 167 depends on !MMU
168 select CPU_32v4T 168 select CPU_32v4T
169 select CPU_ABRT_NOMMU 169 select CPU_ABRT_NOMMU
170 select CPU_PABRT_LEGACY
171 select CPU_CACHE_VIVT 170 select CPU_CACHE_VIVT
172 select CPU_CP15_MPU 171 select CPU_CP15_MPU
172 select CPU_PABRT_LEGACY
173 help 173 help
174 ARM940T is a member of the ARM9TDMI family of general- 174 ARM940T is a member of the ARM9TDMI family of general-
175 purpose microprocessors with MPU and separate 4KB 175 purpose microprocessors with MPU and separate 4KB
@@ -185,9 +185,9 @@ config CPU_ARM946E
185 depends on !MMU 185 depends on !MMU
186 select CPU_32v5 186 select CPU_32v5
187 select CPU_ABRT_NOMMU 187 select CPU_ABRT_NOMMU
188 select CPU_PABRT_LEGACY
189 select CPU_CACHE_VIVT 188 select CPU_CACHE_VIVT
190 select CPU_CP15_MPU 189 select CPU_CP15_MPU
190 select CPU_PABRT_LEGACY
191 help 191 help
192 ARM946E-S is a member of the ARM9E-S family of high- 192 ARM946E-S is a member of the ARM9E-S family of high-
193 performance, 32-bit system-on-chip processor solutions. 193 performance, 32-bit system-on-chip processor solutions.
@@ -201,11 +201,11 @@ config CPU_ARM1020
201 bool "Support ARM1020T (rev 0) processor" if ARCH_INTEGRATOR 201 bool "Support ARM1020T (rev 0) processor" if ARCH_INTEGRATOR
202 select CPU_32v5 202 select CPU_32v5
203 select CPU_ABRT_EV4T 203 select CPU_ABRT_EV4T
204 select CPU_PABRT_LEGACY
205 select CPU_CACHE_V4WT 204 select CPU_CACHE_V4WT
206 select CPU_CACHE_VIVT 205 select CPU_CACHE_VIVT
207 select CPU_CP15_MMU
208 select CPU_COPY_V4WB if MMU 206 select CPU_COPY_V4WB if MMU
207 select CPU_CP15_MMU
208 select CPU_PABRT_LEGACY
209 select CPU_TLB_V4WBI if MMU 209 select CPU_TLB_V4WBI if MMU
210 help 210 help
211 The ARM1020 is the 32K cached version of the ARM10 processor, 211 The ARM1020 is the 32K cached version of the ARM10 processor,
@@ -217,25 +217,25 @@ config CPU_ARM1020
217# ARM1020E - needs validating 217# ARM1020E - needs validating
218config CPU_ARM1020E 218config CPU_ARM1020E
219 bool "Support ARM1020E processor" if ARCH_INTEGRATOR 219 bool "Support ARM1020E processor" if ARCH_INTEGRATOR
220 depends on n
220 select CPU_32v5 221 select CPU_32v5
221 select CPU_ABRT_EV4T 222 select CPU_ABRT_EV4T
222 select CPU_PABRT_LEGACY
223 select CPU_CACHE_V4WT 223 select CPU_CACHE_V4WT
224 select CPU_CACHE_VIVT 224 select CPU_CACHE_VIVT
225 select CPU_CP15_MMU
226 select CPU_COPY_V4WB if MMU 225 select CPU_COPY_V4WB if MMU
226 select CPU_CP15_MMU
227 select CPU_PABRT_LEGACY
227 select CPU_TLB_V4WBI if MMU 228 select CPU_TLB_V4WBI if MMU
228 depends on n
229 229
230# ARM1022E 230# ARM1022E
231config CPU_ARM1022 231config CPU_ARM1022
232 bool "Support ARM1022E processor" if ARCH_INTEGRATOR 232 bool "Support ARM1022E processor" if ARCH_INTEGRATOR
233 select CPU_32v5 233 select CPU_32v5
234 select CPU_ABRT_EV4T 234 select CPU_ABRT_EV4T
235 select CPU_PABRT_LEGACY
236 select CPU_CACHE_VIVT 235 select CPU_CACHE_VIVT
237 select CPU_CP15_MMU
238 select CPU_COPY_V4WB if MMU # can probably do better 236 select CPU_COPY_V4WB if MMU # can probably do better
237 select CPU_CP15_MMU
238 select CPU_PABRT_LEGACY
239 select CPU_TLB_V4WBI if MMU 239 select CPU_TLB_V4WBI if MMU
240 help 240 help
241 The ARM1022E is an implementation of the ARMv5TE architecture 241 The ARM1022E is an implementation of the ARMv5TE architecture
@@ -250,10 +250,10 @@ config CPU_ARM1026
250 bool "Support ARM1026EJ-S processor" if ARCH_INTEGRATOR 250 bool "Support ARM1026EJ-S processor" if ARCH_INTEGRATOR
251 select CPU_32v5 251 select CPU_32v5
252 select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10 252 select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10
253 select CPU_PABRT_LEGACY
254 select CPU_CACHE_VIVT 253 select CPU_CACHE_VIVT
255 select CPU_CP15_MMU
256 select CPU_COPY_V4WB if MMU # can probably do better 254 select CPU_COPY_V4WB if MMU # can probably do better
255 select CPU_CP15_MMU
256 select CPU_PABRT_LEGACY
257 select CPU_TLB_V4WBI if MMU 257 select CPU_TLB_V4WBI if MMU
258 help 258 help
259 The ARM1026EJ-S is an implementation of the ARMv5TEJ architecture 259 The ARM1026EJ-S is an implementation of the ARMv5TEJ architecture
@@ -268,11 +268,11 @@ config CPU_SA110
268 select CPU_32v3 if ARCH_RPC 268 select CPU_32v3 if ARCH_RPC
269 select CPU_32v4 if !ARCH_RPC 269 select CPU_32v4 if !ARCH_RPC
270 select CPU_ABRT_EV4 270 select CPU_ABRT_EV4
271 select CPU_PABRT_LEGACY
272 select CPU_CACHE_V4WB 271 select CPU_CACHE_V4WB
273 select CPU_CACHE_VIVT 272 select CPU_CACHE_VIVT
274 select CPU_CP15_MMU
275 select CPU_COPY_V4WB if MMU 273 select CPU_COPY_V4WB if MMU
274 select CPU_CP15_MMU
275 select CPU_PABRT_LEGACY
276 select CPU_TLB_V4WB if MMU 276 select CPU_TLB_V4WB if MMU
277 help 277 help
278 The Intel StrongARM(R) SA-110 is a 32-bit microprocessor and 278 The Intel StrongARM(R) SA-110 is a 32-bit microprocessor and
@@ -288,10 +288,10 @@ config CPU_SA1100
288 bool 288 bool
289 select CPU_32v4 289 select CPU_32v4
290 select CPU_ABRT_EV4 290 select CPU_ABRT_EV4
291 select CPU_PABRT_LEGACY
292 select CPU_CACHE_V4WB 291 select CPU_CACHE_V4WB
293 select CPU_CACHE_VIVT 292 select CPU_CACHE_VIVT
294 select CPU_CP15_MMU 293 select CPU_CP15_MMU
294 select CPU_PABRT_LEGACY
295 select CPU_TLB_V4WB if MMU 295 select CPU_TLB_V4WB if MMU
296 296
297# XScale 297# XScale
@@ -299,9 +299,9 @@ config CPU_XSCALE
299 bool 299 bool
300 select CPU_32v5 300 select CPU_32v5
301 select CPU_ABRT_EV5T 301 select CPU_ABRT_EV5T
302 select CPU_PABRT_LEGACY
303 select CPU_CACHE_VIVT 302 select CPU_CACHE_VIVT
304 select CPU_CP15_MMU 303 select CPU_CP15_MMU
304 select CPU_PABRT_LEGACY
305 select CPU_TLB_V4WBI if MMU 305 select CPU_TLB_V4WBI if MMU
306 306
307# XScale Core Version 3 307# XScale Core Version 3
@@ -309,9 +309,9 @@ config CPU_XSC3
309 bool 309 bool
310 select CPU_32v5 310 select CPU_32v5
311 select CPU_ABRT_EV5T 311 select CPU_ABRT_EV5T
312 select CPU_PABRT_LEGACY
313 select CPU_CACHE_VIVT 312 select CPU_CACHE_VIVT
314 select CPU_CP15_MMU 313 select CPU_CP15_MMU
314 select CPU_PABRT_LEGACY
315 select CPU_TLB_V4WBI if MMU 315 select CPU_TLB_V4WBI if MMU
316 select IO_36 316 select IO_36
317 317
@@ -320,21 +320,21 @@ config CPU_MOHAWK
320 bool 320 bool
321 select CPU_32v5 321 select CPU_32v5
322 select CPU_ABRT_EV5T 322 select CPU_ABRT_EV5T
323 select CPU_PABRT_LEGACY
324 select CPU_CACHE_VIVT 323 select CPU_CACHE_VIVT
324 select CPU_COPY_V4WB if MMU
325 select CPU_CP15_MMU 325 select CPU_CP15_MMU
326 select CPU_PABRT_LEGACY
326 select CPU_TLB_V4WBI if MMU 327 select CPU_TLB_V4WBI if MMU
327 select CPU_COPY_V4WB if MMU
328 328
329# Feroceon 329# Feroceon
330config CPU_FEROCEON 330config CPU_FEROCEON
331 bool 331 bool
332 select CPU_32v5 332 select CPU_32v5
333 select CPU_ABRT_EV5T 333 select CPU_ABRT_EV5T
334 select CPU_PABRT_LEGACY
335 select CPU_CACHE_VIVT 334 select CPU_CACHE_VIVT
336 select CPU_CP15_MMU
337 select CPU_COPY_FEROCEON if MMU 335 select CPU_COPY_FEROCEON if MMU
336 select CPU_CP15_MMU
337 select CPU_PABRT_LEGACY
338 select CPU_TLB_FEROCEON if MMU 338 select CPU_TLB_FEROCEON if MMU
339 339
340config CPU_FEROCEON_OLD_ID 340config CPU_FEROCEON_OLD_ID
@@ -349,20 +349,20 @@ config CPU_FEROCEON_OLD_ID
349# Marvell PJ4 349# Marvell PJ4
350config CPU_PJ4 350config CPU_PJ4
351 bool 351 bool
352 select CPU_V7
353 select ARM_THUMBEE 352 select ARM_THUMBEE
353 select CPU_V7
354 354
355# ARMv6 355# ARMv6
356config CPU_V6 356config CPU_V6
357 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX 357 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
358 select CPU_32v6 358 select CPU_32v6
359 select CPU_ABRT_EV6 359 select CPU_ABRT_EV6
360 select CPU_PABRT_V6
361 select CPU_CACHE_V6 360 select CPU_CACHE_V6
362 select CPU_CACHE_VIPT 361 select CPU_CACHE_VIPT
362 select CPU_COPY_V6 if MMU
363 select CPU_CP15_MMU 363 select CPU_CP15_MMU
364 select CPU_HAS_ASID if MMU 364 select CPU_HAS_ASID if MMU
365 select CPU_COPY_V6 if MMU 365 select CPU_PABRT_V6
366 select CPU_TLB_V6 if MMU 366 select CPU_TLB_V6 if MMU
367 367
368# ARMv6k 368# ARMv6k
@@ -371,12 +371,12 @@ config CPU_V6K
371 select CPU_32v6 371 select CPU_32v6
372 select CPU_32v6K 372 select CPU_32v6K
373 select CPU_ABRT_EV6 373 select CPU_ABRT_EV6
374 select CPU_PABRT_V6
375 select CPU_CACHE_V6 374 select CPU_CACHE_V6
376 select CPU_CACHE_VIPT 375 select CPU_CACHE_VIPT
376 select CPU_COPY_V6 if MMU
377 select CPU_CP15_MMU 377 select CPU_CP15_MMU
378 select CPU_HAS_ASID if MMU 378 select CPU_HAS_ASID if MMU
379 select CPU_COPY_V6 if MMU 379 select CPU_PABRT_V6
380 select CPU_TLB_V6 if MMU 380 select CPU_TLB_V6 if MMU
381 381
382# ARMv7 382# ARMv7
@@ -385,44 +385,44 @@ config CPU_V7
385 select CPU_32v6K 385 select CPU_32v6K
386 select CPU_32v7 386 select CPU_32v7
387 select CPU_ABRT_EV7 387 select CPU_ABRT_EV7
388 select CPU_PABRT_V7
389 select CPU_CACHE_V7 388 select CPU_CACHE_V7
390 select CPU_CACHE_VIPT 389 select CPU_CACHE_VIPT
390 select CPU_COPY_V6 if MMU
391 select CPU_CP15_MMU 391 select CPU_CP15_MMU
392 select CPU_HAS_ASID if MMU 392 select CPU_HAS_ASID if MMU
393 select CPU_COPY_V6 if MMU 393 select CPU_PABRT_V7
394 select CPU_TLB_V7 if MMU 394 select CPU_TLB_V7 if MMU
395 395
396# Figure out what processor architecture version we should be using. 396# Figure out what processor architecture version we should be using.
397# This defines the compiler instruction set which depends on the machine type. 397# This defines the compiler instruction set which depends on the machine type.
398config CPU_32v3 398config CPU_32v3
399 bool 399 bool
400 select TLS_REG_EMUL if SMP || !MMU
401 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
402 select CPU_USE_DOMAINS if MMU 400 select CPU_USE_DOMAINS if MMU
401 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
402 select TLS_REG_EMUL if SMP || !MMU
403 403
404config CPU_32v4 404config CPU_32v4
405 bool 405 bool
406 select TLS_REG_EMUL if SMP || !MMU
407 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
408 select CPU_USE_DOMAINS if MMU 406 select CPU_USE_DOMAINS if MMU
407 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
408 select TLS_REG_EMUL if SMP || !MMU
409 409
410config CPU_32v4T 410config CPU_32v4T
411 bool 411 bool
412 select TLS_REG_EMUL if SMP || !MMU
413 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
414 select CPU_USE_DOMAINS if MMU 412 select CPU_USE_DOMAINS if MMU
413 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
414 select TLS_REG_EMUL if SMP || !MMU
415 415
416config CPU_32v5 416config CPU_32v5
417 bool 417 bool
418 select TLS_REG_EMUL if SMP || !MMU
419 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
420 select CPU_USE_DOMAINS if MMU 418 select CPU_USE_DOMAINS if MMU
419 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
420 select TLS_REG_EMUL if SMP || !MMU
421 421
422config CPU_32v6 422config CPU_32v6
423 bool 423 bool
424 select TLS_REG_EMUL if !CPU_32v6K && !MMU
425 select CPU_USE_DOMAINS if CPU_V6 && MMU 424 select CPU_USE_DOMAINS if CPU_V6 && MMU
425 select TLS_REG_EMUL if !CPU_32v6K && !MMU
426 426
427config CPU_32v6K 427config CPU_32v6K
428 bool 428 bool
@@ -624,11 +624,28 @@ config ARM_THUMBEE
624 Say Y here if you have a CPU with the ThumbEE extension and code to 624 Say Y here if you have a CPU with the ThumbEE extension and code to
625 make use of it. Say N for code that can run on CPUs without ThumbEE. 625 make use of it. Say N for code that can run on CPUs without ThumbEE.
626 626
627config ARM_VIRT_EXT
628 bool "Native support for the ARM Virtualization Extensions"
629 depends on MMU && CPU_V7
630 help
631 Enable the kernel to make use of the ARM Virtualization
632 Extensions to install hypervisors without run-time firmware
633 assistance.
634
635 A compliant bootloader is required in order to make maximum
636 use of this feature. Refer to Documentation/arm/Booting for
637 details.
638
639 It is safe to enable this option even if the kernel may not be
640 booted in HYP mode, may not have support for the
641 virtualization extensions, or may be booted with a
642 non-compliant bootloader.
643
627config SWP_EMULATE 644config SWP_EMULATE
628 bool "Emulate SWP/SWPB instructions" 645 bool "Emulate SWP/SWPB instructions"
629 depends on !CPU_USE_DOMAINS && CPU_V7 646 depends on !CPU_USE_DOMAINS && CPU_V7
630 select HAVE_PROC_CPU if PROC_FS
631 default y if SMP 647 default y if SMP
648 select HAVE_PROC_CPU if PROC_FS
632 help 649 help
633 ARMv6 architecture deprecates use of the SWP/SWPB instructions. 650 ARMv6 architecture deprecates use of the SWP/SWPB instructions.
634 ARMv7 multiprocessing extensions introduce the ability to disable 651 ARMv7 multiprocessing extensions introduce the ability to disable
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index 9107231aacc..b9f60ebe3bc 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -699,7 +699,6 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs,
699 unsigned long instr = *pinstr; 699 unsigned long instr = *pinstr;
700 u16 tinst1 = (instr >> 16) & 0xffff; 700 u16 tinst1 = (instr >> 16) & 0xffff;
701 u16 tinst2 = instr & 0xffff; 701 u16 tinst2 = instr & 0xffff;
702 poffset->un = 0;
703 702
704 switch (tinst1 & 0xffe0) { 703 switch (tinst1 & 0xffe0) {
705 /* A6.3.5 Load/Store multiple */ 704 /* A6.3.5 Load/Store multiple */
@@ -854,9 +853,10 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
854 break; 853 break;
855 854
856 case 0x08000000: /* ldm or stm, or thumb-2 32bit instruction */ 855 case 0x08000000: /* ldm or stm, or thumb-2 32bit instruction */
857 if (thumb2_32b) 856 if (thumb2_32b) {
857 offset.un = 0;
858 handler = do_alignment_t32_to_handler(&instr, regs, &offset); 858 handler = do_alignment_t32_to_handler(&instr, regs, &offset);
859 else 859 } else
860 handler = do_alignment_ldmstm; 860 handler = do_alignment_ldmstm;
861 break; 861 break;
862 862
diff --git a/arch/arm/mm/cache-fa.S b/arch/arm/mm/cache-fa.S
index 07201637109..e505befe51b 100644
--- a/arch/arm/mm/cache-fa.S
+++ b/arch/arm/mm/cache-fa.S
@@ -240,6 +240,9 @@ ENTRY(fa_dma_unmap_area)
240 mov pc, lr 240 mov pc, lr
241ENDPROC(fa_dma_unmap_area) 241ENDPROC(fa_dma_unmap_area)
242 242
243 .globl fa_flush_kern_cache_louis
244 .equ fa_flush_kern_cache_louis, fa_flush_kern_cache_all
245
243 __INITDATA 246 __INITDATA
244 247
245 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 248 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 2a8e380501e..8a97e6443c6 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -368,14 +368,18 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
368 /* l2x0 controller is disabled */ 368 /* l2x0 controller is disabled */
369 writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL); 369 writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL);
370 370
371 l2x0_saved_regs.aux_ctrl = aux;
372
373 l2x0_inv_all(); 371 l2x0_inv_all();
374 372
375 /* enable L2X0 */ 373 /* enable L2X0 */
376 writel_relaxed(1, l2x0_base + L2X0_CTRL); 374 writel_relaxed(1, l2x0_base + L2X0_CTRL);
377 } 375 }
378 376
377 /* Re-read it in case some bits are reserved. */
378 aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
379
380 /* Save the value for resuming. */
381 l2x0_saved_regs.aux_ctrl = aux;
382
379 outer_cache.inv_range = l2x0_inv_range; 383 outer_cache.inv_range = l2x0_inv_range;
380 outer_cache.clean_range = l2x0_clean_range; 384 outer_cache.clean_range = l2x0_clean_range;
381 outer_cache.flush_range = l2x0_flush_range; 385 outer_cache.flush_range = l2x0_flush_range;
@@ -554,7 +558,7 @@ static const struct of_device_id l2x0_ids[] __initconst = {
554int __init l2x0_of_init(u32 aux_val, u32 aux_mask) 558int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
555{ 559{
556 struct device_node *np; 560 struct device_node *np;
557 struct l2x0_of_data *data; 561 const struct l2x0_of_data *data;
558 struct resource res; 562 struct resource res;
559 563
560 np = of_find_matching_node(NULL, l2x0_ids); 564 np = of_find_matching_node(NULL, l2x0_ids);
diff --git a/arch/arm/mm/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c
index 23a7643e9a8..1be0f4e5e6e 100644
--- a/arch/arm/mm/cache-tauros2.c
+++ b/arch/arm/mm/cache-tauros2.c
@@ -15,8 +15,11 @@
15 */ 15 */
16 16
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/of.h>
19#include <linux/of_address.h>
18#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
19#include <asm/cp15.h> 21#include <asm/cp15.h>
22#include <asm/cputype.h>
20#include <asm/hardware/cache-tauros2.h> 23#include <asm/hardware/cache-tauros2.h>
21 24
22 25
@@ -144,25 +147,8 @@ static inline void __init write_extra_features(u32 u)
144 __asm__("mcr p15, 1, %0, c15, c1, 0" : : "r" (u)); 147 __asm__("mcr p15, 1, %0, c15, c1, 0" : : "r" (u));
145} 148}
146 149
147static void __init disable_l2_prefetch(void)
148{
149 u32 u;
150
151 /*
152 * Read the CPU Extra Features register and verify that the
153 * Disable L2 Prefetch bit is set.
154 */
155 u = read_extra_features();
156 if (!(u & 0x01000000)) {
157 printk(KERN_INFO "Tauros2: Disabling L2 prefetch.\n");
158 write_extra_features(u | 0x01000000);
159 }
160}
161
162static inline int __init cpuid_scheme(void) 150static inline int __init cpuid_scheme(void)
163{ 151{
164 extern int processor_id;
165
166 return !!((processor_id & 0x000f0000) == 0x000f0000); 152 return !!((processor_id & 0x000f0000) == 0x000f0000);
167} 153}
168 154
@@ -189,12 +175,36 @@ static inline void __init write_actlr(u32 actlr)
189 __asm__("mcr p15, 0, %0, c1, c0, 1\n" : : "r" (actlr)); 175 __asm__("mcr p15, 0, %0, c1, c0, 1\n" : : "r" (actlr));
190} 176}
191 177
192void __init tauros2_init(void) 178static void enable_extra_feature(unsigned int features)
179{
180 u32 u;
181
182 u = read_extra_features();
183
184 if (features & CACHE_TAUROS2_PREFETCH_ON)
185 u &= ~0x01000000;
186 else
187 u |= 0x01000000;
188 printk(KERN_INFO "Tauros2: %s L2 prefetch.\n",
189 (features & CACHE_TAUROS2_PREFETCH_ON)
190 ? "Enabling" : "Disabling");
191
192 if (features & CACHE_TAUROS2_LINEFILL_BURST8)
193 u |= 0x00100000;
194 else
195 u &= ~0x00100000;
196 printk(KERN_INFO "Tauros2: %s line fill burt8.\n",
197 (features & CACHE_TAUROS2_LINEFILL_BURST8)
198 ? "Enabling" : "Disabling");
199
200 write_extra_features(u);
201}
202
203static void __init tauros2_internal_init(unsigned int features)
193{ 204{
194 extern int processor_id; 205 char *mode = NULL;
195 char *mode;
196 206
197 disable_l2_prefetch(); 207 enable_extra_feature(features);
198 208
199#ifdef CONFIG_CPU_32v5 209#ifdef CONFIG_CPU_32v5
200 if ((processor_id & 0xff0f0000) == 0x56050000) { 210 if ((processor_id & 0xff0f0000) == 0x56050000) {
@@ -286,3 +296,34 @@ void __init tauros2_init(void)
286 printk(KERN_INFO "Tauros2: L2 cache support initialised " 296 printk(KERN_INFO "Tauros2: L2 cache support initialised "
287 "in %s mode.\n", mode); 297 "in %s mode.\n", mode);
288} 298}
299
300#ifdef CONFIG_OF
301static const struct of_device_id tauros2_ids[] __initconst = {
302 { .compatible = "marvell,tauros2-cache"},
303 {}
304};
305#endif
306
307void __init tauros2_init(unsigned int features)
308{
309#ifdef CONFIG_OF
310 struct device_node *node;
311 int ret;
312 unsigned int f;
313
314 node = of_find_matching_node(NULL, tauros2_ids);
315 if (!node) {
316 pr_info("Not found marvell,tauros2-cache, disable it\n");
317 return;
318 }
319
320 ret = of_property_read_u32(node, "marvell,tauros2-cache-features", &f);
321 if (ret) {
322 pr_info("Not found marvell,tauros-cache-features property, "
323 "disable extra features\n");
324 features = 0;
325 } else
326 features = f;
327#endif
328 tauros2_internal_init(features);
329}
diff --git a/arch/arm/mm/cache-v3.S b/arch/arm/mm/cache-v3.S
index 52e35f32eef..8a3fadece8d 100644
--- a/arch/arm/mm/cache-v3.S
+++ b/arch/arm/mm/cache-v3.S
@@ -128,6 +128,9 @@ ENTRY(v3_dma_map_area)
128ENDPROC(v3_dma_unmap_area) 128ENDPROC(v3_dma_unmap_area)
129ENDPROC(v3_dma_map_area) 129ENDPROC(v3_dma_map_area)
130 130
131 .globl v3_flush_kern_cache_louis
132 .equ v3_flush_kern_cache_louis, v3_flush_kern_cache_all
133
131 __INITDATA 134 __INITDATA
132 135
133 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 136 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
diff --git a/arch/arm/mm/cache-v4.S b/arch/arm/mm/cache-v4.S
index 022135d2b7e..43e5d77be67 100644
--- a/arch/arm/mm/cache-v4.S
+++ b/arch/arm/mm/cache-v4.S
@@ -140,6 +140,9 @@ ENTRY(v4_dma_map_area)
140ENDPROC(v4_dma_unmap_area) 140ENDPROC(v4_dma_unmap_area)
141ENDPROC(v4_dma_map_area) 141ENDPROC(v4_dma_map_area)
142 142
143 .globl v4_flush_kern_cache_louis
144 .equ v4_flush_kern_cache_louis, v4_flush_kern_cache_all
145
143 __INITDATA 146 __INITDATA
144 147
145 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 148 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
diff --git a/arch/arm/mm/cache-v4wb.S b/arch/arm/mm/cache-v4wb.S
index 8f1eeae340c..cd494532140 100644
--- a/arch/arm/mm/cache-v4wb.S
+++ b/arch/arm/mm/cache-v4wb.S
@@ -251,6 +251,9 @@ ENTRY(v4wb_dma_unmap_area)
251 mov pc, lr 251 mov pc, lr
252ENDPROC(v4wb_dma_unmap_area) 252ENDPROC(v4wb_dma_unmap_area)
253 253
254 .globl v4wb_flush_kern_cache_louis
255 .equ v4wb_flush_kern_cache_louis, v4wb_flush_kern_cache_all
256
254 __INITDATA 257 __INITDATA
255 258
256 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 259 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
diff --git a/arch/arm/mm/cache-v4wt.S b/arch/arm/mm/cache-v4wt.S
index b34a5f908a8..11e5e5838bc 100644
--- a/arch/arm/mm/cache-v4wt.S
+++ b/arch/arm/mm/cache-v4wt.S
@@ -196,6 +196,9 @@ ENTRY(v4wt_dma_map_area)
196ENDPROC(v4wt_dma_unmap_area) 196ENDPROC(v4wt_dma_unmap_area)
197ENDPROC(v4wt_dma_map_area) 197ENDPROC(v4wt_dma_map_area)
198 198
199 .globl v4wt_flush_kern_cache_louis
200 .equ v4wt_flush_kern_cache_louis, v4wt_flush_kern_cache_all
201
199 __INITDATA 202 __INITDATA
200 203
201 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 204 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S
index 4b10760c56d..d8fd4d4bd3d 100644
--- a/arch/arm/mm/cache-v6.S
+++ b/arch/arm/mm/cache-v6.S
@@ -326,6 +326,9 @@ ENTRY(v6_dma_unmap_area)
326 mov pc, lr 326 mov pc, lr
327ENDPROC(v6_dma_unmap_area) 327ENDPROC(v6_dma_unmap_area)
328 328
329 .globl v6_flush_kern_cache_louis
330 .equ v6_flush_kern_cache_louis, v6_flush_kern_cache_all
331
329 __INITDATA 332 __INITDATA
330 333
331 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 334 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
index 39e3fb3db80..cd956647c21 100644
--- a/arch/arm/mm/cache-v7.S
+++ b/arch/arm/mm/cache-v7.S
@@ -33,6 +33,24 @@ ENTRY(v7_flush_icache_all)
33 mov pc, lr 33 mov pc, lr
34ENDPROC(v7_flush_icache_all) 34ENDPROC(v7_flush_icache_all)
35 35
36 /*
37 * v7_flush_dcache_louis()
38 *
39 * Flush the D-cache up to the Level of Unification Inner Shareable
40 *
41 * Corrupted registers: r0-r7, r9-r11 (r6 only in Thumb mode)
42 */
43
44ENTRY(v7_flush_dcache_louis)
45 dmb @ ensure ordering with previous memory accesses
46 mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr
47 ands r3, r0, #0xe00000 @ extract LoUIS from clidr
48 mov r3, r3, lsr #20 @ r3 = LoUIS * 2
49 moveq pc, lr @ return if level == 0
50 mov r10, #0 @ r10 (starting level) = 0
51 b flush_levels @ start flushing cache levels
52ENDPROC(v7_flush_dcache_louis)
53
36/* 54/*
37 * v7_flush_dcache_all() 55 * v7_flush_dcache_all()
38 * 56 *
@@ -49,7 +67,7 @@ ENTRY(v7_flush_dcache_all)
49 mov r3, r3, lsr #23 @ left align loc bit field 67 mov r3, r3, lsr #23 @ left align loc bit field
50 beq finished @ if loc is 0, then no need to clean 68 beq finished @ if loc is 0, then no need to clean
51 mov r10, #0 @ start clean at cache level 0 69 mov r10, #0 @ start clean at cache level 0
52loop1: 70flush_levels:
53 add r2, r10, r10, lsr #1 @ work out 3x current cache level 71 add r2, r10, r10, lsr #1 @ work out 3x current cache level
54 mov r1, r0, lsr r2 @ extract cache type bits from clidr 72 mov r1, r0, lsr r2 @ extract cache type bits from clidr
55 and r1, r1, #7 @ mask of the bits for current cache only 73 and r1, r1, #7 @ mask of the bits for current cache only
@@ -71,9 +89,9 @@ loop1:
71 clz r5, r4 @ find bit position of way size increment 89 clz r5, r4 @ find bit position of way size increment
72 ldr r7, =0x7fff 90 ldr r7, =0x7fff
73 ands r7, r7, r1, lsr #13 @ extract max number of the index size 91 ands r7, r7, r1, lsr #13 @ extract max number of the index size
74loop2: 92loop1:
75 mov r9, r4 @ create working copy of max way size 93 mov r9, r4 @ create working copy of max way size
76loop3: 94loop2:
77 ARM( orr r11, r10, r9, lsl r5 ) @ factor way and cache number into r11 95 ARM( orr r11, r10, r9, lsl r5 ) @ factor way and cache number into r11
78 THUMB( lsl r6, r9, r5 ) 96 THUMB( lsl r6, r9, r5 )
79 THUMB( orr r11, r10, r6 ) @ factor way and cache number into r11 97 THUMB( orr r11, r10, r6 ) @ factor way and cache number into r11
@@ -82,13 +100,13 @@ loop3:
82 THUMB( orr r11, r11, r6 ) @ factor index number into r11 100 THUMB( orr r11, r11, r6 ) @ factor index number into r11
83 mcr p15, 0, r11, c7, c14, 2 @ clean & invalidate by set/way 101 mcr p15, 0, r11, c7, c14, 2 @ clean & invalidate by set/way
84 subs r9, r9, #1 @ decrement the way 102 subs r9, r9, #1 @ decrement the way
85 bge loop3
86 subs r7, r7, #1 @ decrement the index
87 bge loop2 103 bge loop2
104 subs r7, r7, #1 @ decrement the index
105 bge loop1
88skip: 106skip:
89 add r10, r10, #2 @ increment cache number 107 add r10, r10, #2 @ increment cache number
90 cmp r3, r10 108 cmp r3, r10
91 bgt loop1 109 bgt flush_levels
92finished: 110finished:
93 mov r10, #0 @ swith back to cache level 0 111 mov r10, #0 @ swith back to cache level 0
94 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr 112 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr
@@ -120,6 +138,24 @@ ENTRY(v7_flush_kern_cache_all)
120 mov pc, lr 138 mov pc, lr
121ENDPROC(v7_flush_kern_cache_all) 139ENDPROC(v7_flush_kern_cache_all)
122 140
141 /*
142 * v7_flush_kern_cache_louis(void)
143 *
144 * Flush the data cache up to Level of Unification Inner Shareable.
145 * Invalidate the I-cache to the point of unification.
146 */
147ENTRY(v7_flush_kern_cache_louis)
148 ARM( stmfd sp!, {r4-r5, r7, r9-r11, lr} )
149 THUMB( stmfd sp!, {r4-r7, r9-r11, lr} )
150 bl v7_flush_dcache_louis
151 mov r0, #0
152 ALT_SMP(mcr p15, 0, r0, c7, c1, 0) @ invalidate I-cache inner shareable
153 ALT_UP(mcr p15, 0, r0, c7, c5, 0) @ I+BTB cache invalidate
154 ARM( ldmfd sp!, {r4-r5, r7, r9-r11, lr} )
155 THUMB( ldmfd sp!, {r4-r7, r9-r11, lr} )
156 mov pc, lr
157ENDPROC(v7_flush_kern_cache_louis)
158
123/* 159/*
124 * v7_flush_cache_all() 160 * v7_flush_cache_all()
125 * 161 *
@@ -211,6 +247,9 @@ ENTRY(v7_coherent_user_range)
211 * isn't mapped, fail with -EFAULT. 247 * isn't mapped, fail with -EFAULT.
212 */ 248 */
2139001: 2499001:
250#ifdef CONFIG_ARM_ERRATA_775420
251 dsb
252#endif
214 mov r0, #-EFAULT 253 mov r0, #-EFAULT
215 mov pc, lr 254 mov pc, lr
216 UNWIND(.fnend ) 255 UNWIND(.fnend )
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
index 119bc52ab93..4e07eec1270 100644
--- a/arch/arm/mm/context.c
+++ b/arch/arm/mm/context.c
@@ -63,10 +63,11 @@ static int contextidr_notifier(struct notifier_block *unused, unsigned long cmd,
63 pid = task_pid_nr(thread->task) << ASID_BITS; 63 pid = task_pid_nr(thread->task) << ASID_BITS;
64 asm volatile( 64 asm volatile(
65 " mrc p15, 0, %0, c13, c0, 1\n" 65 " mrc p15, 0, %0, c13, c0, 1\n"
66 " bfi %1, %0, #0, %2\n" 66 " and %0, %0, %2\n"
67 " mcr p15, 0, %1, c13, c0, 1\n" 67 " orr %0, %0, %1\n"
68 " mcr p15, 0, %0, c13, c0, 1\n"
68 : "=r" (contextidr), "+r" (pid) 69 : "=r" (contextidr), "+r" (pid)
69 : "I" (ASID_BITS)); 70 : "I" (~ASID_MASK));
70 isb(); 71 isb();
71 72
72 return NOTIFY_OK; 73 return NOTIFY_OK;
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 051204fc461..477a2d23ddf 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -73,11 +73,18 @@ static dma_addr_t arm_dma_map_page(struct device *dev, struct page *page,
73 unsigned long offset, size_t size, enum dma_data_direction dir, 73 unsigned long offset, size_t size, enum dma_data_direction dir,
74 struct dma_attrs *attrs) 74 struct dma_attrs *attrs)
75{ 75{
76 if (!arch_is_coherent() && !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)) 76 if (!dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
77 __dma_page_cpu_to_dev(page, offset, size, dir); 77 __dma_page_cpu_to_dev(page, offset, size, dir);
78 return pfn_to_dma(dev, page_to_pfn(page)) + offset; 78 return pfn_to_dma(dev, page_to_pfn(page)) + offset;
79} 79}
80 80
81static dma_addr_t arm_coherent_dma_map_page(struct device *dev, struct page *page,
82 unsigned long offset, size_t size, enum dma_data_direction dir,
83 struct dma_attrs *attrs)
84{
85 return pfn_to_dma(dev, page_to_pfn(page)) + offset;
86}
87
81/** 88/**
82 * arm_dma_unmap_page - unmap a buffer previously mapped through dma_map_page() 89 * arm_dma_unmap_page - unmap a buffer previously mapped through dma_map_page()
83 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices 90 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
@@ -96,7 +103,7 @@ static void arm_dma_unmap_page(struct device *dev, dma_addr_t handle,
96 size_t size, enum dma_data_direction dir, 103 size_t size, enum dma_data_direction dir,
97 struct dma_attrs *attrs) 104 struct dma_attrs *attrs)
98{ 105{
99 if (!arch_is_coherent() && !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)) 106 if (!dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
100 __dma_page_dev_to_cpu(pfn_to_page(dma_to_pfn(dev, handle)), 107 __dma_page_dev_to_cpu(pfn_to_page(dma_to_pfn(dev, handle)),
101 handle & ~PAGE_MASK, size, dir); 108 handle & ~PAGE_MASK, size, dir);
102} 109}
@@ -106,8 +113,7 @@ static void arm_dma_sync_single_for_cpu(struct device *dev,
106{ 113{
107 unsigned int offset = handle & (PAGE_SIZE - 1); 114 unsigned int offset = handle & (PAGE_SIZE - 1);
108 struct page *page = pfn_to_page(dma_to_pfn(dev, handle-offset)); 115 struct page *page = pfn_to_page(dma_to_pfn(dev, handle-offset));
109 if (!arch_is_coherent()) 116 __dma_page_dev_to_cpu(page, offset, size, dir);
110 __dma_page_dev_to_cpu(page, offset, size, dir);
111} 117}
112 118
113static void arm_dma_sync_single_for_device(struct device *dev, 119static void arm_dma_sync_single_for_device(struct device *dev,
@@ -115,8 +121,7 @@ static void arm_dma_sync_single_for_device(struct device *dev,
115{ 121{
116 unsigned int offset = handle & (PAGE_SIZE - 1); 122 unsigned int offset = handle & (PAGE_SIZE - 1);
117 struct page *page = pfn_to_page(dma_to_pfn(dev, handle-offset)); 123 struct page *page = pfn_to_page(dma_to_pfn(dev, handle-offset));
118 if (!arch_is_coherent()) 124 __dma_page_cpu_to_dev(page, offset, size, dir);
119 __dma_page_cpu_to_dev(page, offset, size, dir);
120} 125}
121 126
122static int arm_dma_set_mask(struct device *dev, u64 dma_mask); 127static int arm_dma_set_mask(struct device *dev, u64 dma_mask);
@@ -138,6 +143,22 @@ struct dma_map_ops arm_dma_ops = {
138}; 143};
139EXPORT_SYMBOL(arm_dma_ops); 144EXPORT_SYMBOL(arm_dma_ops);
140 145
146static void *arm_coherent_dma_alloc(struct device *dev, size_t size,
147 dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs);
148static void arm_coherent_dma_free(struct device *dev, size_t size, void *cpu_addr,
149 dma_addr_t handle, struct dma_attrs *attrs);
150
151struct dma_map_ops arm_coherent_dma_ops = {
152 .alloc = arm_coherent_dma_alloc,
153 .free = arm_coherent_dma_free,
154 .mmap = arm_dma_mmap,
155 .get_sgtable = arm_dma_get_sgtable,
156 .map_page = arm_coherent_dma_map_page,
157 .map_sg = arm_dma_map_sg,
158 .set_dma_mask = arm_dma_set_mask,
159};
160EXPORT_SYMBOL(arm_coherent_dma_ops);
161
141static u64 get_coherent_dma_mask(struct device *dev) 162static u64 get_coherent_dma_mask(struct device *dev)
142{ 163{
143 u64 mask = (u64)arm_dma_limit; 164 u64 mask = (u64)arm_dma_limit;
@@ -346,6 +367,8 @@ static int __init atomic_pool_init(void)
346 (unsigned)pool->size / 1024); 367 (unsigned)pool->size / 1024);
347 return 0; 368 return 0;
348 } 369 }
370
371 kfree(pages);
349no_pages: 372no_pages:
350 kfree(bitmap); 373 kfree(bitmap);
351no_bitmap: 374no_bitmap:
@@ -489,7 +512,7 @@ static bool __in_atomic_pool(void *start, size_t size)
489 void *pool_start = pool->vaddr; 512 void *pool_start = pool->vaddr;
490 void *pool_end = pool->vaddr + pool->size; 513 void *pool_end = pool->vaddr + pool->size;
491 514
492 if (start < pool_start || start > pool_end) 515 if (start < pool_start || start >= pool_end)
493 return false; 516 return false;
494 517
495 if (end <= pool_end) 518 if (end <= pool_end)
@@ -584,7 +607,7 @@ static void *__alloc_simple_buffer(struct device *dev, size_t size, gfp_t gfp,
584 607
585 608
586static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, 609static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
587 gfp_t gfp, pgprot_t prot, const void *caller) 610 gfp_t gfp, pgprot_t prot, bool is_coherent, const void *caller)
588{ 611{
589 u64 mask = get_coherent_dma_mask(dev); 612 u64 mask = get_coherent_dma_mask(dev);
590 struct page *page; 613 struct page *page;
@@ -617,7 +640,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
617 *handle = DMA_ERROR_CODE; 640 *handle = DMA_ERROR_CODE;
618 size = PAGE_ALIGN(size); 641 size = PAGE_ALIGN(size);
619 642
620 if (arch_is_coherent() || nommu()) 643 if (is_coherent || nommu())
621 addr = __alloc_simple_buffer(dev, size, gfp, &page); 644 addr = __alloc_simple_buffer(dev, size, gfp, &page);
622 else if (gfp & GFP_ATOMIC) 645 else if (gfp & GFP_ATOMIC)
623 addr = __alloc_from_pool(size, &page); 646 addr = __alloc_from_pool(size, &page);
@@ -645,7 +668,20 @@ void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
645 if (dma_alloc_from_coherent(dev, size, handle, &memory)) 668 if (dma_alloc_from_coherent(dev, size, handle, &memory))
646 return memory; 669 return memory;
647 670
648 return __dma_alloc(dev, size, handle, gfp, prot, 671 return __dma_alloc(dev, size, handle, gfp, prot, false,
672 __builtin_return_address(0));
673}
674
675static void *arm_coherent_dma_alloc(struct device *dev, size_t size,
676 dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs)
677{
678 pgprot_t prot = __get_dma_pgprot(attrs, pgprot_kernel);
679 void *memory;
680
681 if (dma_alloc_from_coherent(dev, size, handle, &memory))
682 return memory;
683
684 return __dma_alloc(dev, size, handle, gfp, prot, true,
649 __builtin_return_address(0)); 685 __builtin_return_address(0));
650} 686}
651 687
@@ -682,8 +718,9 @@ int arm_dma_mmap(struct device *dev, struct vm_area_struct *vma,
682/* 718/*
683 * Free a buffer as defined by the above mapping. 719 * Free a buffer as defined by the above mapping.
684 */ 720 */
685void arm_dma_free(struct device *dev, size_t size, void *cpu_addr, 721static void __arm_dma_free(struct device *dev, size_t size, void *cpu_addr,
686 dma_addr_t handle, struct dma_attrs *attrs) 722 dma_addr_t handle, struct dma_attrs *attrs,
723 bool is_coherent)
687{ 724{
688 struct page *page = pfn_to_page(dma_to_pfn(dev, handle)); 725 struct page *page = pfn_to_page(dma_to_pfn(dev, handle));
689 726
@@ -692,7 +729,7 @@ void arm_dma_free(struct device *dev, size_t size, void *cpu_addr,
692 729
693 size = PAGE_ALIGN(size); 730 size = PAGE_ALIGN(size);
694 731
695 if (arch_is_coherent() || nommu()) { 732 if (is_coherent || nommu()) {
696 __dma_free_buffer(page, size); 733 __dma_free_buffer(page, size);
697 } else if (__free_from_pool(cpu_addr, size)) { 734 } else if (__free_from_pool(cpu_addr, size)) {
698 return; 735 return;
@@ -708,6 +745,18 @@ void arm_dma_free(struct device *dev, size_t size, void *cpu_addr,
708 } 745 }
709} 746}
710 747
748void arm_dma_free(struct device *dev, size_t size, void *cpu_addr,
749 dma_addr_t handle, struct dma_attrs *attrs)
750{
751 __arm_dma_free(dev, size, cpu_addr, handle, attrs, false);
752}
753
754static void arm_coherent_dma_free(struct device *dev, size_t size, void *cpu_addr,
755 dma_addr_t handle, struct dma_attrs *attrs)
756{
757 __arm_dma_free(dev, size, cpu_addr, handle, attrs, true);
758}
759
711int arm_dma_get_sgtable(struct device *dev, struct sg_table *sgt, 760int arm_dma_get_sgtable(struct device *dev, struct sg_table *sgt,
712 void *cpu_addr, dma_addr_t handle, size_t size, 761 void *cpu_addr, dma_addr_t handle, size_t size,
713 struct dma_attrs *attrs) 762 struct dma_attrs *attrs)
@@ -1010,11 +1059,12 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size, gfp_t
1010 if (!pages[i]) 1059 if (!pages[i])
1011 goto error; 1060 goto error;
1012 1061
1013 if (order) 1062 if (order) {
1014 split_page(pages[i], order); 1063 split_page(pages[i], order);
1015 j = 1 << order; 1064 j = 1 << order;
1016 while (--j) 1065 while (--j)
1017 pages[i + j] = pages[i] + j; 1066 pages[i + j] = pages[i] + j;
1067 }
1018 1068
1019 __dma_clear_buffer(pages[i], PAGE_SIZE << order); 1069 __dma_clear_buffer(pages[i], PAGE_SIZE << order);
1020 i += 1 << order; 1070 i += 1 << order;
@@ -1301,7 +1351,8 @@ static int arm_iommu_get_sgtable(struct device *dev, struct sg_table *sgt,
1301 */ 1351 */
1302static int __map_sg_chunk(struct device *dev, struct scatterlist *sg, 1352static int __map_sg_chunk(struct device *dev, struct scatterlist *sg,
1303 size_t size, dma_addr_t *handle, 1353 size_t size, dma_addr_t *handle,
1304 enum dma_data_direction dir, struct dma_attrs *attrs) 1354 enum dma_data_direction dir, struct dma_attrs *attrs,
1355 bool is_coherent)
1305{ 1356{
1306 struct dma_iommu_mapping *mapping = dev->archdata.mapping; 1357 struct dma_iommu_mapping *mapping = dev->archdata.mapping;
1307 dma_addr_t iova, iova_base; 1358 dma_addr_t iova, iova_base;
@@ -1320,8 +1371,8 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg,
1320 phys_addr_t phys = page_to_phys(sg_page(s)); 1371 phys_addr_t phys = page_to_phys(sg_page(s));
1321 unsigned int len = PAGE_ALIGN(s->offset + s->length); 1372 unsigned int len = PAGE_ALIGN(s->offset + s->length);
1322 1373
1323 if (!arch_is_coherent() && 1374 if (!is_coherent &&
1324 !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)) 1375 !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
1325 __dma_page_cpu_to_dev(sg_page(s), s->offset, s->length, dir); 1376 __dma_page_cpu_to_dev(sg_page(s), s->offset, s->length, dir);
1326 1377
1327 ret = iommu_map(mapping->domain, iova, phys, len, 0); 1378 ret = iommu_map(mapping->domain, iova, phys, len, 0);
@@ -1339,20 +1390,9 @@ fail:
1339 return ret; 1390 return ret;
1340} 1391}
1341 1392
1342/** 1393static int __iommu_map_sg(struct device *dev, struct scatterlist *sg, int nents,
1343 * arm_iommu_map_sg - map a set of SG buffers for streaming mode DMA 1394 enum dma_data_direction dir, struct dma_attrs *attrs,
1344 * @dev: valid struct device pointer 1395 bool is_coherent)
1345 * @sg: list of buffers
1346 * @nents: number of buffers to map
1347 * @dir: DMA transfer direction
1348 *
1349 * Map a set of buffers described by scatterlist in streaming mode for DMA.
1350 * The scatter gather list elements are merged together (if possible) and
1351 * tagged with the appropriate dma address and length. They are obtained via
1352 * sg_dma_{address,length}.
1353 */
1354int arm_iommu_map_sg(struct device *dev, struct scatterlist *sg, int nents,
1355 enum dma_data_direction dir, struct dma_attrs *attrs)
1356{ 1396{
1357 struct scatterlist *s = sg, *dma = sg, *start = sg; 1397 struct scatterlist *s = sg, *dma = sg, *start = sg;
1358 int i, count = 0; 1398 int i, count = 0;
@@ -1368,7 +1408,7 @@ int arm_iommu_map_sg(struct device *dev, struct scatterlist *sg, int nents,
1368 1408
1369 if (s->offset || (size & ~PAGE_MASK) || size + s->length > max) { 1409 if (s->offset || (size & ~PAGE_MASK) || size + s->length > max) {
1370 if (__map_sg_chunk(dev, start, size, &dma->dma_address, 1410 if (__map_sg_chunk(dev, start, size, &dma->dma_address,
1371 dir, attrs) < 0) 1411 dir, attrs, is_coherent) < 0)
1372 goto bad_mapping; 1412 goto bad_mapping;
1373 1413
1374 dma->dma_address += offset; 1414 dma->dma_address += offset;
@@ -1381,7 +1421,8 @@ int arm_iommu_map_sg(struct device *dev, struct scatterlist *sg, int nents,
1381 } 1421 }
1382 size += s->length; 1422 size += s->length;
1383 } 1423 }
1384 if (__map_sg_chunk(dev, start, size, &dma->dma_address, dir, attrs) < 0) 1424 if (__map_sg_chunk(dev, start, size, &dma->dma_address, dir, attrs,
1425 is_coherent) < 0)
1385 goto bad_mapping; 1426 goto bad_mapping;
1386 1427
1387 dma->dma_address += offset; 1428 dma->dma_address += offset;
@@ -1396,17 +1437,44 @@ bad_mapping:
1396} 1437}
1397 1438
1398/** 1439/**
1399 * arm_iommu_unmap_sg - unmap a set of SG buffers mapped by dma_map_sg 1440 * arm_coherent_iommu_map_sg - map a set of SG buffers for streaming mode DMA
1400 * @dev: valid struct device pointer 1441 * @dev: valid struct device pointer
1401 * @sg: list of buffers 1442 * @sg: list of buffers
1402 * @nents: number of buffers to unmap (same as was passed to dma_map_sg) 1443 * @nents: number of buffers to map
1403 * @dir: DMA transfer direction (same as was passed to dma_map_sg) 1444 * @dir: DMA transfer direction
1404 * 1445 *
1405 * Unmap a set of streaming mode DMA translations. Again, CPU access 1446 * Map a set of i/o coherent buffers described by scatterlist in streaming
1406 * rules concerning calls here are the same as for dma_unmap_single(). 1447 * mode for DMA. The scatter gather list elements are merged together (if
1448 * possible) and tagged with the appropriate dma address and length. They are
1449 * obtained via sg_dma_{address,length}.
1407 */ 1450 */
1408void arm_iommu_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, 1451int arm_coherent_iommu_map_sg(struct device *dev, struct scatterlist *sg,
1409 enum dma_data_direction dir, struct dma_attrs *attrs) 1452 int nents, enum dma_data_direction dir, struct dma_attrs *attrs)
1453{
1454 return __iommu_map_sg(dev, sg, nents, dir, attrs, true);
1455}
1456
1457/**
1458 * arm_iommu_map_sg - map a set of SG buffers for streaming mode DMA
1459 * @dev: valid struct device pointer
1460 * @sg: list of buffers
1461 * @nents: number of buffers to map
1462 * @dir: DMA transfer direction
1463 *
1464 * Map a set of buffers described by scatterlist in streaming mode for DMA.
1465 * The scatter gather list elements are merged together (if possible) and
1466 * tagged with the appropriate dma address and length. They are obtained via
1467 * sg_dma_{address,length}.
1468 */
1469int arm_iommu_map_sg(struct device *dev, struct scatterlist *sg,
1470 int nents, enum dma_data_direction dir, struct dma_attrs *attrs)
1471{
1472 return __iommu_map_sg(dev, sg, nents, dir, attrs, false);
1473}
1474
1475static void __iommu_unmap_sg(struct device *dev, struct scatterlist *sg,
1476 int nents, enum dma_data_direction dir, struct dma_attrs *attrs,
1477 bool is_coherent)
1410{ 1478{
1411 struct scatterlist *s; 1479 struct scatterlist *s;
1412 int i; 1480 int i;
@@ -1415,7 +1483,7 @@ void arm_iommu_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
1415 if (sg_dma_len(s)) 1483 if (sg_dma_len(s))
1416 __iommu_remove_mapping(dev, sg_dma_address(s), 1484 __iommu_remove_mapping(dev, sg_dma_address(s),
1417 sg_dma_len(s)); 1485 sg_dma_len(s));
1418 if (!arch_is_coherent() && 1486 if (!is_coherent &&
1419 !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)) 1487 !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
1420 __dma_page_dev_to_cpu(sg_page(s), s->offset, 1488 __dma_page_dev_to_cpu(sg_page(s), s->offset,
1421 s->length, dir); 1489 s->length, dir);
@@ -1423,6 +1491,38 @@ void arm_iommu_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
1423} 1491}
1424 1492
1425/** 1493/**
1494 * arm_coherent_iommu_unmap_sg - unmap a set of SG buffers mapped by dma_map_sg
1495 * @dev: valid struct device pointer
1496 * @sg: list of buffers
1497 * @nents: number of buffers to unmap (same as was passed to dma_map_sg)
1498 * @dir: DMA transfer direction (same as was passed to dma_map_sg)
1499 *
1500 * Unmap a set of streaming mode DMA translations. Again, CPU access
1501 * rules concerning calls here are the same as for dma_unmap_single().
1502 */
1503void arm_coherent_iommu_unmap_sg(struct device *dev, struct scatterlist *sg,
1504 int nents, enum dma_data_direction dir, struct dma_attrs *attrs)
1505{
1506 __iommu_unmap_sg(dev, sg, nents, dir, attrs, true);
1507}
1508
1509/**
1510 * arm_iommu_unmap_sg - unmap a set of SG buffers mapped by dma_map_sg
1511 * @dev: valid struct device pointer
1512 * @sg: list of buffers
1513 * @nents: number of buffers to unmap (same as was passed to dma_map_sg)
1514 * @dir: DMA transfer direction (same as was passed to dma_map_sg)
1515 *
1516 * Unmap a set of streaming mode DMA translations. Again, CPU access
1517 * rules concerning calls here are the same as for dma_unmap_single().
1518 */
1519void arm_iommu_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
1520 enum dma_data_direction dir, struct dma_attrs *attrs)
1521{
1522 __iommu_unmap_sg(dev, sg, nents, dir, attrs, false);
1523}
1524
1525/**
1426 * arm_iommu_sync_sg_for_cpu 1526 * arm_iommu_sync_sg_for_cpu
1427 * @dev: valid struct device pointer 1527 * @dev: valid struct device pointer
1428 * @sg: list of buffers 1528 * @sg: list of buffers
@@ -1436,8 +1536,7 @@ void arm_iommu_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
1436 int i; 1536 int i;
1437 1537
1438 for_each_sg(sg, s, nents, i) 1538 for_each_sg(sg, s, nents, i)
1439 if (!arch_is_coherent()) 1539 __dma_page_dev_to_cpu(sg_page(s), s->offset, s->length, dir);
1440 __dma_page_dev_to_cpu(sg_page(s), s->offset, s->length, dir);
1441 1540
1442} 1541}
1443 1542
@@ -1455,22 +1554,21 @@ void arm_iommu_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
1455 int i; 1554 int i;
1456 1555
1457 for_each_sg(sg, s, nents, i) 1556 for_each_sg(sg, s, nents, i)
1458 if (!arch_is_coherent()) 1557 __dma_page_cpu_to_dev(sg_page(s), s->offset, s->length, dir);
1459 __dma_page_cpu_to_dev(sg_page(s), s->offset, s->length, dir);
1460} 1558}
1461 1559
1462 1560
1463/** 1561/**
1464 * arm_iommu_map_page 1562 * arm_coherent_iommu_map_page
1465 * @dev: valid struct device pointer 1563 * @dev: valid struct device pointer
1466 * @page: page that buffer resides in 1564 * @page: page that buffer resides in
1467 * @offset: offset into page for start of buffer 1565 * @offset: offset into page for start of buffer
1468 * @size: size of buffer to map 1566 * @size: size of buffer to map
1469 * @dir: DMA transfer direction 1567 * @dir: DMA transfer direction
1470 * 1568 *
1471 * IOMMU aware version of arm_dma_map_page() 1569 * Coherent IOMMU aware version of arm_dma_map_page()
1472 */ 1570 */
1473static dma_addr_t arm_iommu_map_page(struct device *dev, struct page *page, 1571static dma_addr_t arm_coherent_iommu_map_page(struct device *dev, struct page *page,
1474 unsigned long offset, size_t size, enum dma_data_direction dir, 1572 unsigned long offset, size_t size, enum dma_data_direction dir,
1475 struct dma_attrs *attrs) 1573 struct dma_attrs *attrs)
1476{ 1574{
@@ -1478,9 +1576,6 @@ static dma_addr_t arm_iommu_map_page(struct device *dev, struct page *page,
1478 dma_addr_t dma_addr; 1576 dma_addr_t dma_addr;
1479 int ret, len = PAGE_ALIGN(size + offset); 1577 int ret, len = PAGE_ALIGN(size + offset);
1480 1578
1481 if (!arch_is_coherent() && !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
1482 __dma_page_cpu_to_dev(page, offset, size, dir);
1483
1484 dma_addr = __alloc_iova(mapping, len); 1579 dma_addr = __alloc_iova(mapping, len);
1485 if (dma_addr == DMA_ERROR_CODE) 1580 if (dma_addr == DMA_ERROR_CODE)
1486 return dma_addr; 1581 return dma_addr;
@@ -1496,6 +1591,51 @@ fail:
1496} 1591}
1497 1592
1498/** 1593/**
1594 * arm_iommu_map_page
1595 * @dev: valid struct device pointer
1596 * @page: page that buffer resides in
1597 * @offset: offset into page for start of buffer
1598 * @size: size of buffer to map
1599 * @dir: DMA transfer direction
1600 *
1601 * IOMMU aware version of arm_dma_map_page()
1602 */
1603static dma_addr_t arm_iommu_map_page(struct device *dev, struct page *page,
1604 unsigned long offset, size_t size, enum dma_data_direction dir,
1605 struct dma_attrs *attrs)
1606{
1607 if (!dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
1608 __dma_page_cpu_to_dev(page, offset, size, dir);
1609
1610 return arm_coherent_iommu_map_page(dev, page, offset, size, dir, attrs);
1611}
1612
1613/**
1614 * arm_coherent_iommu_unmap_page
1615 * @dev: valid struct device pointer
1616 * @handle: DMA address of buffer
1617 * @size: size of buffer (same as passed to dma_map_page)
1618 * @dir: DMA transfer direction (same as passed to dma_map_page)
1619 *
1620 * Coherent IOMMU aware version of arm_dma_unmap_page()
1621 */
1622static void arm_coherent_iommu_unmap_page(struct device *dev, dma_addr_t handle,
1623 size_t size, enum dma_data_direction dir,
1624 struct dma_attrs *attrs)
1625{
1626 struct dma_iommu_mapping *mapping = dev->archdata.mapping;
1627 dma_addr_t iova = handle & PAGE_MASK;
1628 int offset = handle & ~PAGE_MASK;
1629 int len = PAGE_ALIGN(size + offset);
1630
1631 if (!iova)
1632 return;
1633
1634 iommu_unmap(mapping->domain, iova, len);
1635 __free_iova(mapping, iova, len);
1636}
1637
1638/**
1499 * arm_iommu_unmap_page 1639 * arm_iommu_unmap_page
1500 * @dev: valid struct device pointer 1640 * @dev: valid struct device pointer
1501 * @handle: DMA address of buffer 1641 * @handle: DMA address of buffer
@@ -1517,7 +1657,7 @@ static void arm_iommu_unmap_page(struct device *dev, dma_addr_t handle,
1517 if (!iova) 1657 if (!iova)
1518 return; 1658 return;
1519 1659
1520 if (!arch_is_coherent() && !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)) 1660 if (!dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
1521 __dma_page_dev_to_cpu(page, offset, size, dir); 1661 __dma_page_dev_to_cpu(page, offset, size, dir);
1522 1662
1523 iommu_unmap(mapping->domain, iova, len); 1663 iommu_unmap(mapping->domain, iova, len);
@@ -1535,8 +1675,7 @@ static void arm_iommu_sync_single_for_cpu(struct device *dev,
1535 if (!iova) 1675 if (!iova)
1536 return; 1676 return;
1537 1677
1538 if (!arch_is_coherent()) 1678 __dma_page_dev_to_cpu(page, offset, size, dir);
1539 __dma_page_dev_to_cpu(page, offset, size, dir);
1540} 1679}
1541 1680
1542static void arm_iommu_sync_single_for_device(struct device *dev, 1681static void arm_iommu_sync_single_for_device(struct device *dev,
@@ -1570,6 +1709,19 @@ struct dma_map_ops iommu_ops = {
1570 .sync_sg_for_device = arm_iommu_sync_sg_for_device, 1709 .sync_sg_for_device = arm_iommu_sync_sg_for_device,
1571}; 1710};
1572 1711
1712struct dma_map_ops iommu_coherent_ops = {
1713 .alloc = arm_iommu_alloc_attrs,
1714 .free = arm_iommu_free_attrs,
1715 .mmap = arm_iommu_mmap_attrs,
1716 .get_sgtable = arm_iommu_get_sgtable,
1717
1718 .map_page = arm_coherent_iommu_map_page,
1719 .unmap_page = arm_coherent_iommu_unmap_page,
1720
1721 .map_sg = arm_coherent_iommu_map_sg,
1722 .unmap_sg = arm_coherent_iommu_unmap_sg,
1723};
1724
1573/** 1725/**
1574 * arm_iommu_create_mapping 1726 * arm_iommu_create_mapping
1575 * @bus: pointer to the bus holding the client device (for IOMMU calls) 1727 * @bus: pointer to the bus holding the client device (for IOMMU calls)
@@ -1663,7 +1815,7 @@ int arm_iommu_attach_device(struct device *dev,
1663 dev->archdata.mapping = mapping; 1815 dev->archdata.mapping = mapping;
1664 set_dma_ops(dev, &iommu_ops); 1816 set_dma_ops(dev, &iommu_ops);
1665 1817
1666 pr_info("Attached IOMMU controller to %s device.\n", dev_name(dev)); 1818 pr_debug("Attached IOMMU controller to %s device.\n", dev_name(dev));
1667 return 0; 1819 return 0;
1668} 1820}
1669 1821
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index 7599e2625c7..2a5907b5c8d 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -134,7 +134,6 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma,
134{ 134{
135 struct mm_struct *mm = vma->vm_mm; 135 struct mm_struct *mm = vma->vm_mm;
136 struct vm_area_struct *mpnt; 136 struct vm_area_struct *mpnt;
137 struct prio_tree_iter iter;
138 unsigned long offset; 137 unsigned long offset;
139 pgoff_t pgoff; 138 pgoff_t pgoff;
140 int aliases = 0; 139 int aliases = 0;
@@ -147,7 +146,7 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma,
147 * cache coherency. 146 * cache coherency.
148 */ 147 */
149 flush_dcache_mmap_lock(mapping); 148 flush_dcache_mmap_lock(mapping);
150 vma_prio_tree_foreach(mpnt, &iter, &mapping->i_mmap, pgoff, pgoff) { 149 vma_interval_tree_foreach(mpnt, &mapping->i_mmap, pgoff, pgoff) {
151 /* 150 /*
152 * If this VMA is not in our MM, we can ignore it. 151 * If this VMA is not in our MM, we can ignore it.
153 * Note that we intentionally mask out the VMA 152 * Note that we intentionally mask out the VMA
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index c3bd8345022..5dbf13f954f 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -336,6 +336,7 @@ retry:
336 /* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk 336 /* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk
337 * of starvation. */ 337 * of starvation. */
338 flags &= ~FAULT_FLAG_ALLOW_RETRY; 338 flags &= ~FAULT_FLAG_ALLOW_RETRY;
339 flags |= FAULT_FLAG_TRIED;
339 goto retry; 340 goto retry;
340 } 341 }
341 } 342 }
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 40ca11ed6e5..1c8f7f56417 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -196,7 +196,6 @@ static void __flush_dcache_aliases(struct address_space *mapping, struct page *p
196{ 196{
197 struct mm_struct *mm = current->active_mm; 197 struct mm_struct *mm = current->active_mm;
198 struct vm_area_struct *mpnt; 198 struct vm_area_struct *mpnt;
199 struct prio_tree_iter iter;
200 pgoff_t pgoff; 199 pgoff_t pgoff;
201 200
202 /* 201 /*
@@ -208,7 +207,7 @@ static void __flush_dcache_aliases(struct address_space *mapping, struct page *p
208 pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); 207 pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
209 208
210 flush_dcache_mmap_lock(mapping); 209 flush_dcache_mmap_lock(mapping);
211 vma_prio_tree_foreach(mpnt, &iter, &mapping->i_mmap, pgoff, pgoff) { 210 vma_interval_tree_foreach(mpnt, &mapping->i_mmap, pgoff, pgoff) {
212 unsigned long offset; 211 unsigned long offset;
213 212
214 /* 213 /*
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 9aec41fa80a..ad722f1208a 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -324,7 +324,7 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
324 324
325 BUG_ON(!arm_memblock_steal_permitted); 325 BUG_ON(!arm_memblock_steal_permitted);
326 326
327 phys = memblock_alloc(size, align); 327 phys = memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ANYWHERE);
328 memblock_free(phys, size); 328 memblock_free(phys, size);
329 memblock_remove(phys, size); 329 memblock_remove(phys, size);
330 330
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 566750fa57d..5dcc2fd46c4 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -36,6 +36,7 @@
36#include <asm/system_info.h> 36#include <asm/system_info.h>
37 37
38#include <asm/mach/map.h> 38#include <asm/mach/map.h>
39#include <asm/mach/pci.h>
39#include "mm.h" 40#include "mm.h"
40 41
41int ioremap_page(unsigned long virt, unsigned long phys, 42int ioremap_page(unsigned long virt, unsigned long phys,
@@ -247,6 +248,7 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
247 if (!area) 248 if (!area)
248 return NULL; 249 return NULL;
249 addr = (unsigned long)area->addr; 250 addr = (unsigned long)area->addr;
251 area->phys_addr = __pfn_to_phys(pfn);
250 252
251#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE) 253#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
252 if (DOMAIN_IO == 0 && 254 if (DOMAIN_IO == 0 &&
@@ -383,3 +385,16 @@ void __arm_iounmap(volatile void __iomem *io_addr)
383 arch_iounmap(io_addr); 385 arch_iounmap(io_addr);
384} 386}
385EXPORT_SYMBOL(__arm_iounmap); 387EXPORT_SYMBOL(__arm_iounmap);
388
389#ifdef CONFIG_PCI
390int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr)
391{
392 BUG_ON(offset + SZ_64K > IO_SPACE_LIMIT);
393
394 return ioremap_page_range(PCI_IO_VIRT_BASE + offset,
395 PCI_IO_VIRT_BASE + offset + SZ_64K,
396 phys_addr,
397 __pgprot(get_mem_type(MT_DEVICE)->prot_pte));
398}
399EXPORT_SYMBOL_GPL(pci_ioremap_io);
400#endif
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index 6776160618e..a8ee92da354 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -55,6 +55,9 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page
55/* permanent static mappings from iotable_init() */ 55/* permanent static mappings from iotable_init() */
56#define VM_ARM_STATIC_MAPPING 0x40000000 56#define VM_ARM_STATIC_MAPPING 0x40000000
57 57
58/* empty mapping */
59#define VM_ARM_EMPTY_MAPPING 0x20000000
60
58/* mapping type (attributes) for permanent static mappings */ 61/* mapping type (attributes) for permanent static mappings */
59#define VM_ARM_MTYPE(mt) ((mt) << 20) 62#define VM_ARM_MTYPE(mt) ((mt) << 20)
60#define VM_ARM_MTYPE_MASK (0x1f << 20) 63#define VM_ARM_MTYPE_MASK (0x1f << 20)
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 4c2d0451e84..941dfb9e9a7 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -31,6 +31,7 @@
31 31
32#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34#include <asm/mach/pci.h>
34 35
35#include "mm.h" 36#include "mm.h"
36 37
@@ -216,7 +217,7 @@ static struct mem_type mem_types[] = {
216 .prot_l1 = PMD_TYPE_TABLE, 217 .prot_l1 = PMD_TYPE_TABLE,
217 .prot_sect = PROT_SECT_DEVICE | PMD_SECT_WB, 218 .prot_sect = PROT_SECT_DEVICE | PMD_SECT_WB,
218 .domain = DOMAIN_IO, 219 .domain = DOMAIN_IO,
219 }, 220 },
220 [MT_DEVICE_WC] = { /* ioremap_wc */ 221 [MT_DEVICE_WC] = { /* ioremap_wc */
221 .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_WC, 222 .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_WC,
222 .prot_l1 = PMD_TYPE_TABLE, 223 .prot_l1 = PMD_TYPE_TABLE,
@@ -422,17 +423,6 @@ static void __init build_mem_type_table(void)
422 vecs_pgprot = kern_pgprot = user_pgprot = cp->pte; 423 vecs_pgprot = kern_pgprot = user_pgprot = cp->pte;
423 424
424 /* 425 /*
425 * Enable CPU-specific coherency if supported.
426 * (Only available on XSC3 at the moment.)
427 */
428 if (arch_is_coherent() && cpu_is_xsc3()) {
429 mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S;
430 mem_types[MT_MEMORY].prot_pte |= L_PTE_SHARED;
431 mem_types[MT_MEMORY_DMA_READY].prot_pte |= L_PTE_SHARED;
432 mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S;
433 mem_types[MT_MEMORY_NONCACHED].prot_pte |= L_PTE_SHARED;
434 }
435 /*
436 * ARMv6 and above have extended page tables. 426 * ARMv6 and above have extended page tables.
437 */ 427 */
438 if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) { 428 if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) {
@@ -777,14 +767,27 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
777 create_mapping(md); 767 create_mapping(md);
778 vm->addr = (void *)(md->virtual & PAGE_MASK); 768 vm->addr = (void *)(md->virtual & PAGE_MASK);
779 vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK)); 769 vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
780 vm->phys_addr = __pfn_to_phys(md->pfn); 770 vm->phys_addr = __pfn_to_phys(md->pfn);
781 vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING; 771 vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
782 vm->flags |= VM_ARM_MTYPE(md->type); 772 vm->flags |= VM_ARM_MTYPE(md->type);
783 vm->caller = iotable_init; 773 vm->caller = iotable_init;
784 vm_area_add_early(vm++); 774 vm_area_add_early(vm++);
785 } 775 }
786} 776}
787 777
778void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
779 void *caller)
780{
781 struct vm_struct *vm;
782
783 vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm));
784 vm->addr = (void *)addr;
785 vm->size = size;
786 vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING;
787 vm->caller = caller;
788 vm_area_add_early(vm);
789}
790
788#ifndef CONFIG_ARM_LPAE 791#ifndef CONFIG_ARM_LPAE
789 792
790/* 793/*
@@ -802,14 +805,7 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
802 805
803static void __init pmd_empty_section_gap(unsigned long addr) 806static void __init pmd_empty_section_gap(unsigned long addr)
804{ 807{
805 struct vm_struct *vm; 808 vm_reserve_area_early(addr, SECTION_SIZE, pmd_empty_section_gap);
806
807 vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm));
808 vm->addr = (void *)addr;
809 vm->size = SECTION_SIZE;
810 vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
811 vm->caller = pmd_empty_section_gap;
812 vm_area_add_early(vm);
813} 809}
814 810
815static void __init fill_pmd_gaps(void) 811static void __init fill_pmd_gaps(void)
@@ -820,7 +816,7 @@ static void __init fill_pmd_gaps(void)
820 816
821 /* we're still single threaded hence no lock needed here */ 817 /* we're still single threaded hence no lock needed here */
822 for (vm = vmlist; vm; vm = vm->next) { 818 for (vm = vmlist; vm; vm = vm->next) {
823 if (!(vm->flags & VM_ARM_STATIC_MAPPING)) 819 if (!(vm->flags & (VM_ARM_STATIC_MAPPING | VM_ARM_EMPTY_MAPPING)))
824 continue; 820 continue;
825 addr = (unsigned long)vm->addr; 821 addr = (unsigned long)vm->addr;
826 if (addr < next) 822 if (addr < next)
@@ -858,6 +854,28 @@ static void __init fill_pmd_gaps(void)
858#define fill_pmd_gaps() do { } while (0) 854#define fill_pmd_gaps() do { } while (0)
859#endif 855#endif
860 856
857#if defined(CONFIG_PCI) && !defined(CONFIG_NEED_MACH_IO_H)
858static void __init pci_reserve_io(void)
859{
860 struct vm_struct *vm;
861 unsigned long addr;
862
863 /* we're still single threaded hence no lock needed here */
864 for (vm = vmlist; vm; vm = vm->next) {
865 if (!(vm->flags & VM_ARM_STATIC_MAPPING))
866 continue;
867 addr = (unsigned long)vm->addr;
868 addr &= ~(SZ_2M - 1);
869 if (addr == PCI_IO_VIRT_BASE)
870 return;
871
872 }
873 vm_reserve_area_early(PCI_IO_VIRT_BASE, SZ_2M, pci_reserve_io);
874}
875#else
876#define pci_reserve_io() do { } while (0)
877#endif
878
861static void * __initdata vmalloc_min = 879static void * __initdata vmalloc_min =
862 (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET); 880 (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET);
863 881
@@ -961,8 +979,8 @@ void __init sanity_check_meminfo(void)
961 * Check whether this memory bank would partially overlap 979 * Check whether this memory bank would partially overlap
962 * the vmalloc area. 980 * the vmalloc area.
963 */ 981 */
964 if (__va(bank->start + bank->size) > vmalloc_min || 982 if (__va(bank->start + bank->size - 1) >= vmalloc_min ||
965 __va(bank->start + bank->size) < __va(bank->start)) { 983 __va(bank->start + bank->size - 1) <= __va(bank->start)) {
966 unsigned long newsize = vmalloc_min - __va(bank->start); 984 unsigned long newsize = vmalloc_min - __va(bank->start);
967 printk(KERN_NOTICE "Truncating RAM at %.8llx-%.8llx " 985 printk(KERN_NOTICE "Truncating RAM at %.8llx-%.8llx "
968 "to -%.8llx (vmalloc region overlap).\n", 986 "to -%.8llx (vmalloc region overlap).\n",
@@ -1141,6 +1159,9 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
1141 mdesc->map_io(); 1159 mdesc->map_io();
1142 fill_pmd_gaps(); 1160 fill_pmd_gaps();
1143 1161
1162 /* Reserve fixed i/o space in VMALLOC region */
1163 pci_reserve_io();
1164
1144 /* 1165 /*
1145 * Finally flush the caches and tlb to ensure that we're in a 1166 * Finally flush the caches and tlb to ensure that we're in a
1146 * consistent state wrt the writebuffer. This also ensures that 1167 * consistent state wrt the writebuffer. This also ensures that
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
index 0650bb87c1e..2bb61e703d6 100644
--- a/arch/arm/mm/proc-arm1020.S
+++ b/arch/arm/mm/proc-arm1020.S
@@ -368,6 +368,9 @@ ENTRY(arm1020_dma_unmap_area)
368 mov pc, lr 368 mov pc, lr
369ENDPROC(arm1020_dma_unmap_area) 369ENDPROC(arm1020_dma_unmap_area)
370 370
371 .globl arm1020_flush_kern_cache_louis
372 .equ arm1020_flush_kern_cache_louis, arm1020_flush_kern_cache_all
373
371 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 374 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
372 define_cache_functions arm1020 375 define_cache_functions arm1020
373 376
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
index 4188478325a..8f96aa40f51 100644
--- a/arch/arm/mm/proc-arm1020e.S
+++ b/arch/arm/mm/proc-arm1020e.S
@@ -354,6 +354,9 @@ ENTRY(arm1020e_dma_unmap_area)
354 mov pc, lr 354 mov pc, lr
355ENDPROC(arm1020e_dma_unmap_area) 355ENDPROC(arm1020e_dma_unmap_area)
356 356
357 .globl arm1020e_flush_kern_cache_louis
358 .equ arm1020e_flush_kern_cache_louis, arm1020e_flush_kern_cache_all
359
357 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 360 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
358 define_cache_functions arm1020e 361 define_cache_functions arm1020e
359 362
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S
index 33c68824bff..8ebe4a469a2 100644
--- a/arch/arm/mm/proc-arm1022.S
+++ b/arch/arm/mm/proc-arm1022.S
@@ -343,6 +343,9 @@ ENTRY(arm1022_dma_unmap_area)
343 mov pc, lr 343 mov pc, lr
344ENDPROC(arm1022_dma_unmap_area) 344ENDPROC(arm1022_dma_unmap_area)
345 345
346 .globl arm1022_flush_kern_cache_louis
347 .equ arm1022_flush_kern_cache_louis, arm1022_flush_kern_cache_all
348
346 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 349 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
347 define_cache_functions arm1022 350 define_cache_functions arm1022
348 351
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S
index fbc1d5fc24d..093fc7e520c 100644
--- a/arch/arm/mm/proc-arm1026.S
+++ b/arch/arm/mm/proc-arm1026.S
@@ -337,6 +337,9 @@ ENTRY(arm1026_dma_unmap_area)
337 mov pc, lr 337 mov pc, lr
338ENDPROC(arm1026_dma_unmap_area) 338ENDPROC(arm1026_dma_unmap_area)
339 339
340 .globl arm1026_flush_kern_cache_louis
341 .equ arm1026_flush_kern_cache_louis, arm1026_flush_kern_cache_all
342
340 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 343 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
341 define_cache_functions arm1026 344 define_cache_functions arm1026
342 345
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
index 1a8c138eb89..2c3b9421ab5 100644
--- a/arch/arm/mm/proc-arm920.S
+++ b/arch/arm/mm/proc-arm920.S
@@ -319,6 +319,9 @@ ENTRY(arm920_dma_unmap_area)
319 mov pc, lr 319 mov pc, lr
320ENDPROC(arm920_dma_unmap_area) 320ENDPROC(arm920_dma_unmap_area)
321 321
322 .globl arm920_flush_kern_cache_louis
323 .equ arm920_flush_kern_cache_louis, arm920_flush_kern_cache_all
324
322 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 325 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
323 define_cache_functions arm920 326 define_cache_functions arm920
324#endif 327#endif
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S
index 4c44d7e1c3c..4464c49d744 100644
--- a/arch/arm/mm/proc-arm922.S
+++ b/arch/arm/mm/proc-arm922.S
@@ -321,6 +321,9 @@ ENTRY(arm922_dma_unmap_area)
321 mov pc, lr 321 mov pc, lr
322ENDPROC(arm922_dma_unmap_area) 322ENDPROC(arm922_dma_unmap_area)
323 323
324 .globl arm922_flush_kern_cache_louis
325 .equ arm922_flush_kern_cache_louis, arm922_flush_kern_cache_all
326
324 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 327 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
325 define_cache_functions arm922 328 define_cache_functions arm922
326#endif 329#endif
diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S
index ec5b1180994..281eb9b9c1d 100644
--- a/arch/arm/mm/proc-arm925.S
+++ b/arch/arm/mm/proc-arm925.S
@@ -376,6 +376,9 @@ ENTRY(arm925_dma_unmap_area)
376 mov pc, lr 376 mov pc, lr
377ENDPROC(arm925_dma_unmap_area) 377ENDPROC(arm925_dma_unmap_area)
378 378
379 .globl arm925_flush_kern_cache_louis
380 .equ arm925_flush_kern_cache_louis, arm925_flush_kern_cache_all
381
379 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 382 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
380 define_cache_functions arm925 383 define_cache_functions arm925
381 384
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
index c31e62c606c..f1803f7e297 100644
--- a/arch/arm/mm/proc-arm926.S
+++ b/arch/arm/mm/proc-arm926.S
@@ -339,6 +339,9 @@ ENTRY(arm926_dma_unmap_area)
339 mov pc, lr 339 mov pc, lr
340ENDPROC(arm926_dma_unmap_area) 340ENDPROC(arm926_dma_unmap_area)
341 341
342 .globl arm926_flush_kern_cache_louis
343 .equ arm926_flush_kern_cache_louis, arm926_flush_kern_cache_all
344
342 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 345 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
343 define_cache_functions arm926 346 define_cache_functions arm926
344 347
diff --git a/arch/arm/mm/proc-arm940.S b/arch/arm/mm/proc-arm940.S
index a613a7dd714..8da189d4a40 100644
--- a/arch/arm/mm/proc-arm940.S
+++ b/arch/arm/mm/proc-arm940.S
@@ -267,6 +267,9 @@ ENTRY(arm940_dma_unmap_area)
267 mov pc, lr 267 mov pc, lr
268ENDPROC(arm940_dma_unmap_area) 268ENDPROC(arm940_dma_unmap_area)
269 269
270 .globl arm940_flush_kern_cache_louis
271 .equ arm940_flush_kern_cache_louis, arm940_flush_kern_cache_all
272
270 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 273 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
271 define_cache_functions arm940 274 define_cache_functions arm940
272 275
diff --git a/arch/arm/mm/proc-arm946.S b/arch/arm/mm/proc-arm946.S
index 9f4f2999fdd..f666cf34075 100644
--- a/arch/arm/mm/proc-arm946.S
+++ b/arch/arm/mm/proc-arm946.S
@@ -310,6 +310,9 @@ ENTRY(arm946_dma_unmap_area)
310 mov pc, lr 310 mov pc, lr
311ENDPROC(arm946_dma_unmap_area) 311ENDPROC(arm946_dma_unmap_area)
312 312
313 .globl arm946_flush_kern_cache_louis
314 .equ arm946_flush_kern_cache_louis, arm946_flush_kern_cache_all
315
313 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 316 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
314 define_cache_functions arm946 317 define_cache_functions arm946
315 318
diff --git a/arch/arm/mm/proc-feroceon.S b/arch/arm/mm/proc-feroceon.S
index 23a8e4c7f2b..4106b09e0c2 100644
--- a/arch/arm/mm/proc-feroceon.S
+++ b/arch/arm/mm/proc-feroceon.S
@@ -415,6 +415,9 @@ ENTRY(feroceon_dma_unmap_area)
415 mov pc, lr 415 mov pc, lr
416ENDPROC(feroceon_dma_unmap_area) 416ENDPROC(feroceon_dma_unmap_area)
417 417
418 .globl feroceon_flush_kern_cache_louis
419 .equ feroceon_flush_kern_cache_louis, feroceon_flush_kern_cache_all
420
418 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 421 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
419 define_cache_functions feroceon 422 define_cache_functions feroceon
420 423
@@ -431,6 +434,7 @@ ENDPROC(feroceon_dma_unmap_area)
431 range_alias flush_icache_all 434 range_alias flush_icache_all
432 range_alias flush_user_cache_all 435 range_alias flush_user_cache_all
433 range_alias flush_kern_cache_all 436 range_alias flush_kern_cache_all
437 range_alias flush_kern_cache_louis
434 range_alias flush_user_cache_range 438 range_alias flush_user_cache_range
435 range_alias coherent_kern_range 439 range_alias coherent_kern_range
436 range_alias coherent_user_range 440 range_alias coherent_user_range
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
index 2d8ff3ad86d..b29a2265af0 100644
--- a/arch/arm/mm/proc-macros.S
+++ b/arch/arm/mm/proc-macros.S
@@ -299,6 +299,7 @@ ENTRY(\name\()_processor_functions)
299ENTRY(\name\()_cache_fns) 299ENTRY(\name\()_cache_fns)
300 .long \name\()_flush_icache_all 300 .long \name\()_flush_icache_all
301 .long \name\()_flush_kern_cache_all 301 .long \name\()_flush_kern_cache_all
302 .long \name\()_flush_kern_cache_louis
302 .long \name\()_flush_user_cache_all 303 .long \name\()_flush_user_cache_all
303 .long \name\()_flush_user_cache_range 304 .long \name\()_flush_user_cache_range
304 .long \name\()_coherent_kern_range 305 .long \name\()_coherent_kern_range
diff --git a/arch/arm/mm/proc-mohawk.S b/arch/arm/mm/proc-mohawk.S
index fbb2124a547..82f9cdc751d 100644
--- a/arch/arm/mm/proc-mohawk.S
+++ b/arch/arm/mm/proc-mohawk.S
@@ -303,6 +303,9 @@ ENTRY(mohawk_dma_unmap_area)
303 mov pc, lr 303 mov pc, lr
304ENDPROC(mohawk_dma_unmap_area) 304ENDPROC(mohawk_dma_unmap_area)
305 305
306 .globl mohawk_flush_kern_cache_louis
307 .equ mohawk_flush_kern_cache_louis, mohawk_flush_kern_cache_all
308
306 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 309 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
307 define_cache_functions mohawk 310 define_cache_functions mohawk
308 311
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index c2e2b66f72b..846d279f317 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -172,7 +172,7 @@ __v7_ca15mp_setup:
172__v7_setup: 172__v7_setup:
173 adr r12, __v7_setup_stack @ the local stack 173 adr r12, __v7_setup_stack @ the local stack
174 stmia r12, {r0-r5, r7, r9, r11, lr} 174 stmia r12, {r0-r5, r7, r9, r11, lr}
175 bl v7_flush_dcache_all 175 bl v7_flush_dcache_louis
176 ldmia r12, {r0-r5, r7, r9, r11, lr} 176 ldmia r12, {r0-r5, r7, r9, r11, lr}
177 177
178 mrc p15, 0, r0, c0, c0, 0 @ read main ID register 178 mrc p15, 0, r0, c0, c0, 0 @ read main ID register
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S
index b0d57869da2..eb93d6487f3 100644
--- a/arch/arm/mm/proc-xsc3.S
+++ b/arch/arm/mm/proc-xsc3.S
@@ -337,6 +337,9 @@ ENTRY(xsc3_dma_unmap_area)
337 mov pc, lr 337 mov pc, lr
338ENDPROC(xsc3_dma_unmap_area) 338ENDPROC(xsc3_dma_unmap_area)
339 339
340 .globl xsc3_flush_kern_cache_louis
341 .equ xsc3_flush_kern_cache_louis, xsc3_flush_kern_cache_all
342
340 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 343 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
341 define_cache_functions xsc3 344 define_cache_functions xsc3
342 345
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 4ffebaa595e..25510361aa1 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -410,6 +410,9 @@ ENTRY(xscale_dma_unmap_area)
410 mov pc, lr 410 mov pc, lr
411ENDPROC(xscale_dma_unmap_area) 411ENDPROC(xscale_dma_unmap_area)
412 412
413 .globl xscale_flush_kern_cache_louis
414 .equ xscale_flush_kern_cache_louis, xscale_flush_kern_cache_all
415
413 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S) 416 @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
414 define_cache_functions xscale 417 define_cache_functions xscale
415 418
@@ -439,6 +442,7 @@ ENDPROC(xscale_dma_unmap_area)
439 a0_alias flush_icache_all 442 a0_alias flush_icache_all
440 a0_alias flush_user_cache_all 443 a0_alias flush_user_cache_all
441 a0_alias flush_kern_cache_all 444 a0_alias flush_kern_cache_all
445 a0_alias flush_kern_cache_louis
442 a0_alias flush_user_cache_range 446 a0_alias flush_user_cache_range
443 a0_alias coherent_kern_range 447 a0_alias coherent_kern_range
444 a0_alias coherent_user_range 448 a0_alias coherent_user_range
diff --git a/arch/arm/plat-iop/pci.c b/arch/arm/plat-iop/pci.c
index 8daae9b230e..362474b5c40 100644
--- a/arch/arm/plat-iop/pci.c
+++ b/arch/arm/plat-iop/pci.c
@@ -192,30 +192,24 @@ int iop3xx_pci_setup(int nr, struct pci_sys_data *sys)
192 if (nr != 0) 192 if (nr != 0)
193 return 0; 193 return 0;
194 194
195 res = kzalloc(2 * sizeof(struct resource), GFP_KERNEL); 195 res = kzalloc(sizeof(struct resource), GFP_KERNEL);
196 if (!res) 196 if (!res)
197 panic("PCI: unable to alloc resources"); 197 panic("PCI: unable to alloc resources");
198 198
199 res[0].start = IOP3XX_PCI_LOWER_IO_PA; 199 res->start = IOP3XX_PCI_LOWER_MEM_PA;
200 res[0].end = IOP3XX_PCI_LOWER_IO_PA + IOP3XX_PCI_IO_WINDOW_SIZE - 1; 200 res->end = IOP3XX_PCI_LOWER_MEM_PA + IOP3XX_PCI_MEM_WINDOW_SIZE - 1;
201 res[0].name = "IOP3XX PCI I/O Space"; 201 res->name = "IOP3XX PCI Memory Space";
202 res[0].flags = IORESOURCE_IO; 202 res->flags = IORESOURCE_MEM;
203 request_resource(&ioport_resource, &res[0]); 203 request_resource(&iomem_resource, res);
204
205 res[1].start = IOP3XX_PCI_LOWER_MEM_PA;
206 res[1].end = IOP3XX_PCI_LOWER_MEM_PA + IOP3XX_PCI_MEM_WINDOW_SIZE - 1;
207 res[1].name = "IOP3XX PCI Memory Space";
208 res[1].flags = IORESOURCE_MEM;
209 request_resource(&iomem_resource, &res[1]);
210 204
211 /* 205 /*
212 * Use whatever translation is already setup. 206 * Use whatever translation is already setup.
213 */ 207 */
214 sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - *IOP3XX_OMWTVR0; 208 sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - *IOP3XX_OMWTVR0;
215 sys->io_offset = IOP3XX_PCI_LOWER_IO_PA - *IOP3XX_OIOWTVR;
216 209
217 pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset); 210 pci_add_resource_offset(&sys->resources, res, sys->mem_offset);
218 pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); 211
212 pci_ioremap_io(0, IOP3XX_PCI_LOWER_IO_PA);
219 213
220 return 1; 214 return 1;
221} 215}
@@ -367,7 +361,6 @@ void __init iop3xx_pci_preinit_cond(void)
367 361
368void __init iop3xx_pci_preinit(void) 362void __init iop3xx_pci_preinit(void)
369{ 363{
370 pcibios_min_io = 0;
371 pcibios_min_mem = 0; 364 pcibios_min_mem = 0;
372 365
373 iop3xx_atu_disable(); 366 iop3xx_atu_disable();
diff --git a/arch/arm/plat-iop/pmu.c b/arch/arm/plat-iop/pmu.c
index a2024b8685a..ad9f9744a82 100644
--- a/arch/arm/plat-iop/pmu.c
+++ b/arch/arm/plat-iop/pmu.c
@@ -9,7 +9,6 @@
9 */ 9 */
10 10
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <asm/pmu.h>
13#include <mach/irqs.h> 12#include <mach/irqs.h>
14 13
15static struct resource pmu_resource = { 14static struct resource pmu_resource = {
@@ -26,7 +25,7 @@ static struct resource pmu_resource = {
26 25
27static struct platform_device pmu_device = { 26static struct platform_device pmu_device = {
28 .name = "arm-pmu", 27 .name = "arm-pmu",
29 .id = ARM_PMU_DEVICE_CPU, 28 .id = -1,
30 .resource = &pmu_resource, 29 .resource = &pmu_resource,
31 .num_resources = 1, 30 .num_resources = 1,
32}; 31};
diff --git a/arch/arm/plat-iop/setup.c b/arch/arm/plat-iop/setup.c
index bade586fed0..5b217f460f1 100644
--- a/arch/arm/plat-iop/setup.c
+++ b/arch/arm/plat-iop/setup.c
@@ -25,11 +25,6 @@ static struct map_desc iop3xx_std_desc[] __initdata = {
25 .pfn = __phys_to_pfn(IOP3XX_PERIPHERAL_PHYS_BASE), 25 .pfn = __phys_to_pfn(IOP3XX_PERIPHERAL_PHYS_BASE),
26 .length = IOP3XX_PERIPHERAL_SIZE, 26 .length = IOP3XX_PERIPHERAL_SIZE,
27 .type = MT_UNCACHED, 27 .type = MT_UNCACHED,
28 }, { /* PCI IO space */
29 .virtual = IOP3XX_PCI_LOWER_IO_VA,
30 .pfn = __phys_to_pfn(IOP3XX_PCI_LOWER_IO_PA),
31 .length = IOP3XX_PCI_IO_WINDOW_SIZE,
32 .type = MT_DEVICE,
33 }, 28 },
34}; 29};
35 30
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index baf9064c084..88e1e2e7a20 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -10,16 +10,16 @@ choice
10 10
11config ARCH_IMX_V4_V5 11config ARCH_IMX_V4_V5
12 bool "i.MX1, i.MX21, i.MX25, i.MX27" 12 bool "i.MX1, i.MX21, i.MX25, i.MX27"
13 select AUTO_ZRELADDR if !ZBOOT_ROM
14 select ARM_PATCH_PHYS_VIRT 13 select ARM_PATCH_PHYS_VIRT
14 select AUTO_ZRELADDR if !ZBOOT_ROM
15 help 15 help
16 This enables support for systems based on the Freescale i.MX ARMv4 16 This enables support for systems based on the Freescale i.MX ARMv4
17 and ARMv5 SoCs 17 and ARMv5 SoCs
18 18
19config ARCH_IMX_V6_V7 19config ARCH_IMX_V6_V7
20 bool "i.MX3, i.MX5, i.MX6" 20 bool "i.MX3, i.MX5, i.MX6"
21 select AUTO_ZRELADDR if !ZBOOT_ROM
22 select ARM_PATCH_PHYS_VIRT 21 select ARM_PATCH_PHYS_VIRT
22 select AUTO_ZRELADDR if !ZBOOT_ROM
23 select MIGHT_HAVE_CACHE_L2X0 23 select MIGHT_HAVE_CACHE_L2X0
24 help 24 help
25 This enables support for systems based on the Freescale i.MX3, i.MX5 25 This enables support for systems based on the Freescale i.MX3, i.MX5
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index 6ac72003115..149237e2485 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := clock.o time.o devices.o cpu.o system.o irq-common.o 6obj-y := time.o devices.o cpu.o system.o irq-common.o
7 7
8obj-$(CONFIG_MXC_TZIC) += tzic.o 8obj-$(CONFIG_MXC_TZIC) += tzic.o
9obj-$(CONFIG_MXC_AVIC) += avic.o 9obj-$(CONFIG_MXC_AVIC) += avic.o
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c
deleted file mode 100644
index 5079787273d..00000000000
--- a/arch/arm/plat-mxc/clock.c
+++ /dev/null
@@ -1,257 +0,0 @@
1/*
2 * Based on arch/arm/plat-omap/clock.c
3 *
4 * Copyright (C) 2004 - 2005 Nokia corporation
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 * Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com>
7 * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
8 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
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 Street, Fifth Floor, Boston,
22 * MA 02110-1301, USA.
23 */
24
25/* #define DEBUG */
26
27#include <linux/clk.h>
28#include <linux/err.h>
29#include <linux/errno.h>
30#include <linux/init.h>
31#include <linux/io.h>
32#include <linux/kernel.h>
33#include <linux/list.h>
34#include <linux/module.h>
35#include <linux/mutex.h>
36#include <linux/platform_device.h>
37#include <linux/proc_fs.h>
38#include <linux/semaphore.h>
39#include <linux/string.h>
40
41#include <mach/clock.h>
42#include <mach/hardware.h>
43
44#ifndef CONFIG_COMMON_CLK
45static LIST_HEAD(clocks);
46static DEFINE_MUTEX(clocks_mutex);
47
48/*-------------------------------------------------------------------------
49 * Standard clock functions defined in include/linux/clk.h
50 *-------------------------------------------------------------------------*/
51
52static void __clk_disable(struct clk *clk)
53{
54 if (clk == NULL || IS_ERR(clk))
55 return;
56 WARN_ON(!clk->usecount);
57
58 if (!(--clk->usecount)) {
59 if (clk->disable)
60 clk->disable(clk);
61 __clk_disable(clk->parent);
62 __clk_disable(clk->secondary);
63 }
64}
65
66static int __clk_enable(struct clk *clk)
67{
68 if (clk == NULL || IS_ERR(clk))
69 return -EINVAL;
70
71 if (clk->usecount++ == 0) {
72 __clk_enable(clk->parent);
73 __clk_enable(clk->secondary);
74
75 if (clk->enable)
76 clk->enable(clk);
77 }
78 return 0;
79}
80
81/* This function increments the reference count on the clock and enables the
82 * clock if not already enabled. The parent clock tree is recursively enabled
83 */
84int clk_enable(struct clk *clk)
85{
86 int ret = 0;
87
88 if (clk == NULL || IS_ERR(clk))
89 return -EINVAL;
90
91 mutex_lock(&clocks_mutex);
92 ret = __clk_enable(clk);
93 mutex_unlock(&clocks_mutex);
94
95 return ret;
96}
97EXPORT_SYMBOL(clk_enable);
98
99/* This function decrements the reference count on the clock and disables
100 * the clock when reference count is 0. The parent clock tree is
101 * recursively disabled
102 */
103void clk_disable(struct clk *clk)
104{
105 if (clk == NULL || IS_ERR(clk))
106 return;
107
108 mutex_lock(&clocks_mutex);
109 __clk_disable(clk);
110 mutex_unlock(&clocks_mutex);
111}
112EXPORT_SYMBOL(clk_disable);
113
114/* Retrieve the *current* clock rate. If the clock itself
115 * does not provide a special calculation routine, ask
116 * its parent and so on, until one is able to return
117 * a valid clock rate
118 */
119unsigned long clk_get_rate(struct clk *clk)
120{
121 if (clk == NULL || IS_ERR(clk))
122 return 0UL;
123
124 if (clk->get_rate)
125 return clk->get_rate(clk);
126
127 return clk_get_rate(clk->parent);
128}
129EXPORT_SYMBOL(clk_get_rate);
130
131/* Round the requested clock rate to the nearest supported
132 * rate that is less than or equal to the requested rate.
133 * This is dependent on the clock's current parent.
134 */
135long clk_round_rate(struct clk *clk, unsigned long rate)
136{
137 if (clk == NULL || IS_ERR(clk) || !clk->round_rate)
138 return 0;
139
140 return clk->round_rate(clk, rate);
141}
142EXPORT_SYMBOL(clk_round_rate);
143
144/* Set the clock to the requested clock rate. The rate must
145 * match a supported rate exactly based on what clk_round_rate returns
146 */
147int clk_set_rate(struct clk *clk, unsigned long rate)
148{
149 int ret = -EINVAL;
150
151 if (clk == NULL || IS_ERR(clk) || clk->set_rate == NULL || rate == 0)
152 return ret;
153
154 mutex_lock(&clocks_mutex);
155 ret = clk->set_rate(clk, rate);
156 mutex_unlock(&clocks_mutex);
157
158 return ret;
159}
160EXPORT_SYMBOL(clk_set_rate);
161
162/* Set the clock's parent to another clock source */
163int clk_set_parent(struct clk *clk, struct clk *parent)
164{
165 int ret = -EINVAL;
166 struct clk *old;
167
168 if (clk == NULL || IS_ERR(clk) || parent == NULL ||
169 IS_ERR(parent) || clk->set_parent == NULL)
170 return ret;
171
172 if (clk->usecount)
173 clk_enable(parent);
174
175 mutex_lock(&clocks_mutex);
176 ret = clk->set_parent(clk, parent);
177 if (ret == 0) {
178 old = clk->parent;
179 clk->parent = parent;
180 } else {
181 old = parent;
182 }
183 mutex_unlock(&clocks_mutex);
184
185 if (clk->usecount)
186 clk_disable(old);
187
188 return ret;
189}
190EXPORT_SYMBOL(clk_set_parent);
191
192/* Retrieve the clock's parent clock source */
193struct clk *clk_get_parent(struct clk *clk)
194{
195 struct clk *ret = NULL;
196
197 if (clk == NULL || IS_ERR(clk))
198 return ret;
199
200 return clk->parent;
201}
202EXPORT_SYMBOL(clk_get_parent);
203
204#else
205
206/*
207 * Lock to protect the clock module (ccm) registers. Used
208 * on all i.MXs
209 */
210DEFINE_SPINLOCK(imx_ccm_lock);
211
212#endif /* CONFIG_COMMON_CLK */
213
214/*
215 * Get the resulting clock rate from a PLL register value and the input
216 * frequency. PLLs with this register layout can at least be found on
217 * MX1, MX21, MX27 and MX31
218 *
219 * mfi + mfn / (mfd + 1)
220 * f = 2 * f_ref * --------------------
221 * pd + 1
222 */
223unsigned long mxc_decode_pll(unsigned int reg_val, u32 freq)
224{
225 long long ll;
226 int mfn_abs;
227 unsigned int mfi, mfn, mfd, pd;
228
229 mfi = (reg_val >> 10) & 0xf;
230 mfn = reg_val & 0x3ff;
231 mfd = (reg_val >> 16) & 0x3ff;
232 pd = (reg_val >> 26) & 0xf;
233
234 mfi = mfi <= 5 ? 5 : mfi;
235
236 mfn_abs = mfn;
237
238 /* On all i.MXs except i.MX1 and i.MX21 mfn is a 10bit
239 * 2's complements number
240 */
241 if (!cpu_is_mx1() && !cpu_is_mx21() && mfn >= 0x200)
242 mfn_abs = 0x400 - mfn;
243
244 freq *= 2;
245 freq /= pd + 1;
246
247 ll = (unsigned long long)freq * mfn_abs;
248
249 do_div(ll, mfd + 1);
250
251 if (!cpu_is_mx1() && !cpu_is_mx21() && mfn >= 0x200)
252 ll = -ll;
253
254 ll = (freq * mfi) + ll;
255
256 return ll;
257}
diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c
index 73db34bf588..b5b6f808313 100644
--- a/arch/arm/plat-mxc/cpufreq.c
+++ b/arch/arm/plat-mxc/cpufreq.c
@@ -23,7 +23,6 @@
23#include <linux/err.h> 23#include <linux/err.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <mach/clock.h>
27 26
28#define CLK32_FREQ 32768 27#define CLK32_FREQ 32768
29#define NANOSECOND (1000 * 1000 * 1000) 28#define NANOSECOND (1000 * 1000 * 1000)
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
index cb3e3eef55c..a35d9841f49 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -3,8 +3,8 @@ config IMX_HAVE_PLATFORM_FEC
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_IMX50 || SOC_IMX51 || SOC_IMX53
4 4
5config IMX_HAVE_PLATFORM_FLEXCAN 5config IMX_HAVE_PLATFORM_FLEXCAN
6 select HAVE_CAN_FLEXCAN if CAN
7 bool 6 bool
7 select HAVE_CAN_FLEXCAN if CAN
8 8
9config IMX_HAVE_PLATFORM_FSL_USB2_UDC 9config IMX_HAVE_PLATFORM_FSL_USB2_UDC
10 bool 10 bool
@@ -15,7 +15,11 @@ config IMX_HAVE_PLATFORM_GPIO_KEYS
15 15
16config IMX_HAVE_PLATFORM_IMX21_HCD 16config IMX_HAVE_PLATFORM_IMX21_HCD
17 bool 17 bool
18 18
19config IMX_HAVE_PLATFORM_IMX27_CODA
20 bool
21 default y if SOC_IMX27
22
19config IMX_HAVE_PLATFORM_IMX2_WDT 23config IMX_HAVE_PLATFORM_IMX2_WDT
20 bool 24 bool
21 25
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
index c11ac8472be..76f3195475d 100644
--- a/arch/arm/plat-mxc/devices/Makefile
+++ b/arch/arm/plat-mxc/devices/Makefile
@@ -4,6 +4,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_FSL_USB2_UDC) += platform-fsl-usb2-udc.o
4obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o 4obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o
5obj-y += platform-gpio-mxc.o 5obj-y += platform-gpio-mxc.o
6obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX21_HCD) += platform-imx21-hcd.o 6obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX21_HCD) += platform-imx21-hcd.o
7obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX27_CODA) += platform-imx27-coda.o
7obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o 8obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o
8obj-$(CONFIG_IMX_HAVE_PLATFORM_IMXDI_RTC) += platform-imxdi_rtc.o 9obj-$(CONFIG_IMX_HAVE_PLATFORM_IMXDI_RTC) += platform-imxdi_rtc.o
9obj-y += platform-imx-dma.o 10obj-y += platform-imx-dma.o
diff --git a/arch/arm/plat-mxc/devices/platform-imx-uart.c b/arch/arm/plat-mxc/devices/platform-imx-uart.c
index 2020d84956c..d390f00bd29 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-uart.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-uart.c
@@ -87,7 +87,7 @@ const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst = {
87#ifdef CONFIG_SOC_IMX35 87#ifdef CONFIG_SOC_IMX35
88const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst = { 88const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst = {
89#define imx35_imx_uart_data_entry(_id, _hwid) \ 89#define imx35_imx_uart_data_entry(_id, _hwid) \
90 imx_imx_uart_1irq_data_entry(MX31, _id, _hwid, SZ_16K) 90 imx_imx_uart_1irq_data_entry(MX35, _id, _hwid, SZ_16K)
91 imx35_imx_uart_data_entry(0, 1), 91 imx35_imx_uart_data_entry(0, 1),
92 imx35_imx_uart_data_entry(1, 2), 92 imx35_imx_uart_data_entry(1, 2),
93 imx35_imx_uart_data_entry(2, 3), 93 imx35_imx_uart_data_entry(2, 3),
diff --git a/arch/arm/plat-mxc/devices/platform-imx27-coda.c b/arch/arm/plat-mxc/devices/platform-imx27-coda.c
new file mode 100644
index 00000000000..8b12aacdf39
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imx27-coda.c
@@ -0,0 +1,37 @@
1/*
2 * Copyright (C) 2012 Vista Silicon
3 * Javier Martin <javier.martin@vista-silicon.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12
13#ifdef CONFIG_SOC_IMX27
14const struct imx_imx27_coda_data imx27_coda_data __initconst = {
15 .iobase = MX27_VPU_BASE_ADDR,
16 .iosize = SZ_512,
17 .irq = MX27_INT_VPU,
18};
19#endif
20
21struct platform_device *__init imx_add_imx27_coda(
22 const struct imx_imx27_coda_data *data)
23{
24 struct resource res[] = {
25 {
26 .start = data->iobase,
27 .end = data->iobase + data->iosize - 1,
28 .flags = IORESOURCE_MEM,
29 }, {
30 .start = data->irq,
31 .end = data->irq,
32 .flags = IORESOURCE_IRQ,
33 },
34 };
35 return imx_add_platform_device_dmamask("coda-imx27", 0, res, 2, NULL,
36 0, DMA_BIT_MASK(32));
37}
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_nand.c b/arch/arm/plat-mxc/devices/platform-mxc_nand.c
index 1568f39fba8..95b75cc7051 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_nand.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc_nand.c
@@ -63,10 +63,6 @@ struct platform_device *__init imx_add_mxc_nand(
63 /* AXI has to come first, that's how the mxc_nand driver expect it */ 63 /* AXI has to come first, that's how the mxc_nand driver expect it */
64 struct resource res[] = { 64 struct resource res[] = {
65 { 65 {
66 .start = data->axibase,
67 .end = data->axibase + SZ_16K - 1,
68 .flags = IORESOURCE_MEM,
69 }, {
70 .start = data->iobase, 66 .start = data->iobase,
71 .end = data->iobase + data->iosize - 1, 67 .end = data->iobase + data->iosize - 1,
72 .flags = IORESOURCE_MEM, 68 .flags = IORESOURCE_MEM,
@@ -74,10 +70,13 @@ struct platform_device *__init imx_add_mxc_nand(
74 .start = data->irq, 70 .start = data->irq,
75 .end = data->irq, 71 .end = data->irq,
76 .flags = IORESOURCE_IRQ, 72 .flags = IORESOURCE_IRQ,
73 }, {
74 .start = data->axibase,
75 .end = data->axibase + SZ_16K - 1,
76 .flags = IORESOURCE_MEM,
77 }, 77 },
78 }; 78 };
79 return imx_add_platform_device("mxc_nand", data->id, 79 return imx_add_platform_device("mxc_nand", data->id,
80 res + !data->axibase, 80 res, ARRAY_SIZE(res) - !data->axibase,
81 ARRAY_SIZE(res) - !data->axibase,
82 pdata, sizeof(*pdata)); 81 pdata, sizeof(*pdata));
83} 82}
diff --git a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
index 5955f5da82e..3793e475cd9 100644
--- a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
+++ b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
@@ -8,7 +8,7 @@
8 8
9#include <mach/hardware.h> 9#include <mach/hardware.h>
10#include <mach/devices-common.h> 10#include <mach/devices-common.h>
11#include <mach/esdhc.h> 11#include <linux/platform_data/mmc-esdhc-imx.h>
12 12
13#define imx_sdhci_esdhc_imx_data_entry_single(soc, _devid, _id, hwid) \ 13#define imx_sdhci_esdhc_imx_data_entry_single(soc, _devid, _id, hwid) \
14 { \ 14 { \
diff --git a/arch/arm/plat-mxc/include/mach/clock.h b/arch/arm/plat-mxc/include/mach/clock.h
deleted file mode 100644
index bd940c795cb..00000000000
--- a/arch/arm/plat-mxc/include/mach/clock.h
+++ /dev/null
@@ -1,70 +0,0 @@
1/*
2 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
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., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301, USA.
18 */
19
20#ifndef __ASM_ARCH_MXC_CLOCK_H__
21#define __ASM_ARCH_MXC_CLOCK_H__
22
23#ifndef __ASSEMBLY__
24#include <linux/list.h>
25
26#ifndef CONFIG_COMMON_CLK
27struct module;
28
29struct clk {
30 int id;
31 /* Source clock this clk depends on */
32 struct clk *parent;
33 /* Secondary clock to enable/disable with this clock */
34 struct clk *secondary;
35 /* Reference count of clock enable/disable */
36 __s8 usecount;
37 /* Register bit position for clock's enable/disable control. */
38 u8 enable_shift;
39 /* Register address for clock's enable/disable control. */
40 void __iomem *enable_reg;
41 u32 flags;
42 /* get the current clock rate (always a fresh value) */
43 unsigned long (*get_rate) (struct clk *);
44 /* Function ptr to set the clock to a new rate. The rate must match a
45 supported rate returned from round_rate. Leave blank if clock is not
46 programmable */
47 int (*set_rate) (struct clk *, unsigned long);
48 /* Function ptr to round the requested clock rate to the nearest
49 supported rate that is less than or equal to the requested rate. */
50 unsigned long (*round_rate) (struct clk *, unsigned long);
51 /* Function ptr to enable the clock. Leave blank if clock can not
52 be gated. */
53 int (*enable) (struct clk *);
54 /* Function ptr to disable the clock. Leave blank if clock can not
55 be gated. */
56 void (*disable) (struct clk *);
57 /* Function ptr to set the parent clock of the clock. */
58 int (*set_parent) (struct clk *, struct clk *);
59};
60
61int clk_register(struct clk *clk);
62void clk_unregister(struct clk *clk);
63#endif /* CONFIG_COMMON_CLK */
64
65extern spinlock_t imx_ccm_lock;
66
67unsigned long mxc_decode_pll(unsigned int pll, u32 f_ref);
68
69#endif /* __ASSEMBLY__ */
70#endif /* __ASM_ARCH_MXC_CLOCK_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h
index 7128e971041..ead901814c0 100644
--- a/arch/arm/plat-mxc/include/mach/common.h
+++ b/arch/arm/plat-mxc/include/mach/common.h
@@ -52,7 +52,6 @@ extern void imx31_soc_init(void);
52extern void imx35_soc_init(void); 52extern void imx35_soc_init(void);
53extern void imx50_soc_init(void); 53extern void imx50_soc_init(void);
54extern void imx51_soc_init(void); 54extern void imx51_soc_init(void);
55extern void imx53_soc_init(void);
56extern void imx51_init_late(void); 55extern void imx51_init_late(void);
57extern void imx53_init_late(void); 56extern void imx53_init_late(void);
58extern void epit_timer_init(void __iomem *base, int irq); 57extern void epit_timer_init(void __iomem *base, int irq);
@@ -137,14 +136,11 @@ extern void imx_src_prepare_restart(void);
137extern void imx_gpc_init(void); 136extern void imx_gpc_init(void);
138extern void imx_gpc_pre_suspend(void); 137extern void imx_gpc_pre_suspend(void);
139extern void imx_gpc_post_resume(void); 138extern void imx_gpc_post_resume(void);
140extern void imx51_babbage_common_init(void);
141extern void imx53_ard_common_init(void);
142extern void imx53_evk_common_init(void);
143extern void imx53_qsb_common_init(void);
144extern void imx53_smd_common_init(void);
145extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); 139extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
146extern void imx6q_clock_map_io(void); 140extern void imx6q_clock_map_io(void);
147 141
142extern void imx_cpu_die(unsigned int cpu);
143
148#ifdef CONFIG_PM 144#ifdef CONFIG_PM
149extern void imx6q_pm_init(void); 145extern void imx6q_pm_init(void);
150extern void imx51_pm_init(void); 146extern void imx51_pm_init(void);
@@ -161,4 +157,6 @@ extern int mx51_neon_fixup(void);
161static inline int mx51_neon_fixup(void) { return 0; } 157static inline int mx51_neon_fixup(void) { return 0; }
162#endif 158#endif
163 159
160extern struct smp_operations imx_smp_ops;
161
164#endif 162#endif
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index a7f5bb1084d..eaf79d220c9 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -9,7 +9,7 @@
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/platform_device.h> 10#include <linux/platform_device.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <mach/sdma.h> 12#include <linux/platform_data/dma-imx-sdma.h>
13 13
14extern struct device mxc_aips_bus; 14extern struct device mxc_aips_bus;
15extern struct device mxc_ahb_bus; 15extern struct device mxc_ahb_bus;
@@ -74,7 +74,7 @@ struct platform_device *__init imx_add_fsl_usb2_udc(
74struct platform_device *__init imx_add_gpio_keys( 74struct platform_device *__init imx_add_gpio_keys(
75 const struct gpio_keys_platform_data *pdata); 75 const struct gpio_keys_platform_data *pdata);
76 76
77#include <mach/mx21-usbhost.h> 77#include <linux/platform_data/usb-mx2.h>
78struct imx_imx21_hcd_data { 78struct imx_imx21_hcd_data {
79 resource_size_t iobase; 79 resource_size_t iobase;
80 resource_size_t irq; 80 resource_size_t irq;
@@ -83,6 +83,14 @@ struct platform_device *__init imx_add_imx21_hcd(
83 const struct imx_imx21_hcd_data *data, 83 const struct imx_imx21_hcd_data *data,
84 const struct mx21_usbh_platform_data *pdata); 84 const struct mx21_usbh_platform_data *pdata);
85 85
86struct imx_imx27_coda_data {
87 resource_size_t iobase;
88 resource_size_t iosize;
89 resource_size_t irq;
90};
91struct platform_device *__init imx_add_imx27_coda(
92 const struct imx_imx27_coda_data *data);
93
86struct imx_imx2_wdt_data { 94struct imx_imx2_wdt_data {
87 int id; 95 int id;
88 resource_size_t iobase; 96 resource_size_t iobase;
@@ -98,7 +106,7 @@ struct imx_imxdi_rtc_data {
98struct platform_device *__init imx_add_imxdi_rtc( 106struct platform_device *__init imx_add_imxdi_rtc(
99 const struct imx_imxdi_rtc_data *data); 107 const struct imx_imxdi_rtc_data *data);
100 108
101#include <mach/imxfb.h> 109#include <linux/platform_data/video-imxfb.h>
102struct imx_imx_fb_data { 110struct imx_imx_fb_data {
103 resource_size_t iobase; 111 resource_size_t iobase;
104 resource_size_t iosize; 112 resource_size_t iosize;
@@ -108,7 +116,7 @@ struct platform_device *__init imx_add_imx_fb(
108 const struct imx_imx_fb_data *data, 116 const struct imx_imx_fb_data *data,
109 const struct imx_fb_platform_data *pdata); 117 const struct imx_fb_platform_data *pdata);
110 118
111#include <mach/i2c.h> 119#include <linux/platform_data/i2c-imx.h>
112struct imx_imx_i2c_data { 120struct imx_imx_i2c_data {
113 int id; 121 int id;
114 resource_size_t iobase; 122 resource_size_t iobase;
@@ -129,7 +137,7 @@ struct platform_device *__init imx_add_imx_keypad(
129 const struct imx_imx_keypad_data *data, 137 const struct imx_imx_keypad_data *data,
130 const struct matrix_keymap_data *pdata); 138 const struct matrix_keymap_data *pdata);
131 139
132#include <mach/ssi.h> 140#include <linux/platform_data/asoc-imx-ssi.h>
133struct imx_imx_ssi_data { 141struct imx_imx_ssi_data {
134 int id; 142 int id;
135 resource_size_t iobase; 143 resource_size_t iobase;
@@ -144,7 +152,7 @@ struct platform_device *__init imx_add_imx_ssi(
144 const struct imx_imx_ssi_data *data, 152 const struct imx_imx_ssi_data *data,
145 const struct imx_ssi_platform_data *pdata); 153 const struct imx_ssi_platform_data *pdata);
146 154
147#include <mach/imx-uart.h> 155#include <linux/platform_data/serial-imx.h>
148struct imx_imx_uart_3irq_data { 156struct imx_imx_uart_3irq_data {
149 int id; 157 int id;
150 resource_size_t iobase; 158 resource_size_t iobase;
@@ -167,7 +175,7 @@ struct platform_device *__init imx_add_imx_uart_1irq(
167 const struct imx_imx_uart_1irq_data *data, 175 const struct imx_imx_uart_1irq_data *data,
168 const struct imxuart_platform_data *pdata); 176 const struct imxuart_platform_data *pdata);
169 177
170#include <mach/usb.h> 178#include <linux/platform_data/usb-imx_udc.h>
171struct imx_imx_udc_data { 179struct imx_imx_udc_data {
172 resource_size_t iobase; 180 resource_size_t iobase;
173 resource_size_t iosize; 181 resource_size_t iosize;
@@ -183,8 +191,8 @@ struct platform_device *__init imx_add_imx_udc(
183 const struct imx_imx_udc_data *data, 191 const struct imx_imx_udc_data *data,
184 const struct imxusb_platform_data *pdata); 192 const struct imxusb_platform_data *pdata);
185 193
186#include <mach/mx3fb.h> 194#include <linux/platform_data/video-mx3fb.h>
187#include <mach/mx3_camera.h> 195#include <linux/platform_data/camera-mx3.h>
188struct imx_ipu_core_data { 196struct imx_ipu_core_data {
189 resource_size_t iobase; 197 resource_size_t iobase;
190 resource_size_t synirq; 198 resource_size_t synirq;
@@ -199,7 +207,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
199 const struct imx_ipu_core_data *data, 207 const struct imx_ipu_core_data *data,
200 struct mx3fb_platform_data *pdata); 208 struct mx3fb_platform_data *pdata);
201 209
202#include <mach/mx1_camera.h> 210#include <linux/platform_data/camera-mx1.h>
203struct imx_mx1_camera_data { 211struct imx_mx1_camera_data {
204 resource_size_t iobase; 212 resource_size_t iobase;
205 resource_size_t iosize; 213 resource_size_t iosize;
@@ -209,7 +217,7 @@ struct platform_device *__init imx_add_mx1_camera(
209 const struct imx_mx1_camera_data *data, 217 const struct imx_mx1_camera_data *data,
210 const struct mx1_camera_pdata *pdata); 218 const struct mx1_camera_pdata *pdata);
211 219
212#include <mach/mx2_cam.h> 220#include <linux/platform_data/camera-mx2.h>
213struct imx_mx2_camera_data { 221struct imx_mx2_camera_data {
214 resource_size_t iobasecsi; 222 resource_size_t iobasecsi;
215 resource_size_t iosizecsi; 223 resource_size_t iosizecsi;
@@ -224,7 +232,7 @@ struct platform_device *__init imx_add_mx2_camera(
224struct platform_device *__init imx_add_mx2_emmaprp( 232struct platform_device *__init imx_add_mx2_emmaprp(
225 const struct imx_mx2_camera_data *data); 233 const struct imx_mx2_camera_data *data);
226 234
227#include <mach/mxc_ehci.h> 235#include <linux/platform_data/usb-ehci-mxc.h>
228struct imx_mxc_ehci_data { 236struct imx_mxc_ehci_data {
229 int id; 237 int id;
230 resource_size_t iobase; 238 resource_size_t iobase;
@@ -234,7 +242,7 @@ struct platform_device *__init imx_add_mxc_ehci(
234 const struct imx_mxc_ehci_data *data, 242 const struct imx_mxc_ehci_data *data,
235 const struct mxc_usbh_platform_data *pdata); 243 const struct mxc_usbh_platform_data *pdata);
236 244
237#include <mach/mmc.h> 245#include <linux/platform_data/mmc-mxcmmc.h>
238struct imx_mxc_mmc_data { 246struct imx_mxc_mmc_data {
239 int id; 247 int id;
240 resource_size_t iobase; 248 resource_size_t iobase;
@@ -246,7 +254,7 @@ struct platform_device *__init imx_add_mxc_mmc(
246 const struct imx_mxc_mmc_data *data, 254 const struct imx_mxc_mmc_data *data,
247 const struct imxmmc_platform_data *pdata); 255 const struct imxmmc_platform_data *pdata);
248 256
249#include <mach/mxc_nand.h> 257#include <linux/platform_data/mtd-mxc_nand.h>
250struct imx_mxc_nand_data { 258struct imx_mxc_nand_data {
251 /* 259 /*
252 * id is traditionally 0, but -1 is more appropriate. We use -1 for new 260 * id is traditionally 0, but -1 is more appropriate. We use -1 for new
@@ -295,7 +303,7 @@ struct imx_mxc_w1_data {
295struct platform_device *__init imx_add_mxc_w1( 303struct platform_device *__init imx_add_mxc_w1(
296 const struct imx_mxc_w1_data *data); 304 const struct imx_mxc_w1_data *data);
297 305
298#include <mach/esdhc.h> 306#include <linux/platform_data/mmc-esdhc-imx.h>
299struct imx_sdhci_esdhc_imx_data { 307struct imx_sdhci_esdhc_imx_data {
300 const char *devid; 308 const char *devid;
301 int id; 309 int id;
@@ -306,7 +314,7 @@ struct platform_device *__init imx_add_sdhci_esdhc_imx(
306 const struct imx_sdhci_esdhc_imx_data *data, 314 const struct imx_sdhci_esdhc_imx_data *data,
307 const struct esdhc_platform_data *pdata); 315 const struct esdhc_platform_data *pdata);
308 316
309#include <mach/spi.h> 317#include <linux/platform_data/spi-imx.h>
310struct imx_spi_imx_data { 318struct imx_spi_imx_data {
311 const char *devid; 319 const char *devid;
312 int id; 320 int id;
diff --git a/arch/arm/plat-mxc/include/mach/dma.h b/arch/arm/plat-mxc/include/mach/dma.h
deleted file mode 100644
index 1b9080385b4..00000000000
--- a/arch/arm/plat-mxc/include/mach/dma.h
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __ASM_ARCH_MXC_DMA_H__
10#define __ASM_ARCH_MXC_DMA_H__
11
12#include <linux/scatterlist.h>
13#include <linux/device.h>
14#include <linux/dmaengine.h>
15
16/*
17 * This enumerates peripheral types. Used for SDMA.
18 */
19enum sdma_peripheral_type {
20 IMX_DMATYPE_SSI, /* MCU domain SSI */
21 IMX_DMATYPE_SSI_SP, /* Shared SSI */
22 IMX_DMATYPE_MMC, /* MMC */
23 IMX_DMATYPE_SDHC, /* SDHC */
24 IMX_DMATYPE_UART, /* MCU domain UART */
25 IMX_DMATYPE_UART_SP, /* Shared UART */
26 IMX_DMATYPE_FIRI, /* FIRI */
27 IMX_DMATYPE_CSPI, /* MCU domain CSPI */
28 IMX_DMATYPE_CSPI_SP, /* Shared CSPI */
29 IMX_DMATYPE_SIM, /* SIM */
30 IMX_DMATYPE_ATA, /* ATA */
31 IMX_DMATYPE_CCM, /* CCM */
32 IMX_DMATYPE_EXT, /* External peripheral */
33 IMX_DMATYPE_MSHC, /* Memory Stick Host Controller */
34 IMX_DMATYPE_MSHC_SP, /* Shared Memory Stick Host Controller */
35 IMX_DMATYPE_DSP, /* DSP */
36 IMX_DMATYPE_MEMORY, /* Memory */
37 IMX_DMATYPE_FIFO_MEMORY,/* FIFO type Memory */
38 IMX_DMATYPE_SPDIF, /* SPDIF */
39 IMX_DMATYPE_IPU_MEMORY, /* IPU Memory */
40 IMX_DMATYPE_ASRC, /* ASRC */
41 IMX_DMATYPE_ESAI, /* ESAI */
42};
43
44enum imx_dma_prio {
45 DMA_PRIO_HIGH = 0,
46 DMA_PRIO_MEDIUM = 1,
47 DMA_PRIO_LOW = 2
48};
49
50struct imx_dma_data {
51 int dma_request; /* DMA request line */
52 enum sdma_peripheral_type peripheral_type;
53 int priority;
54};
55
56static inline int imx_dma_is_ipu(struct dma_chan *chan)
57{
58 return !strcmp(dev_name(chan->device->dev), "ipu-core");
59}
60
61static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
62{
63 return strstr(dev_name(chan->device->dev), "sdma") ||
64 !strcmp(dev_name(chan->device->dev), "imx-dma");
65}
66
67#endif
diff --git a/arch/arm/plat-mxc/include/mach/esdhc.h b/arch/arm/plat-mxc/include/mach/esdhc.h
deleted file mode 100644
index aaf97481f41..00000000000
--- a/arch/arm/plat-mxc/include/mach/esdhc.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Copyright 2010 Wolfram Sang <w.sang@pengutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; version 2
7 * of the License.
8 */
9
10#ifndef __ASM_ARCH_IMX_ESDHC_H
11#define __ASM_ARCH_IMX_ESDHC_H
12
13enum wp_types {
14 ESDHC_WP_NONE, /* no WP, neither controller nor gpio */
15 ESDHC_WP_CONTROLLER, /* mmc controller internal WP */
16 ESDHC_WP_GPIO, /* external gpio pin for WP */
17};
18
19enum cd_types {
20 ESDHC_CD_NONE, /* no CD, neither controller nor gpio */
21 ESDHC_CD_CONTROLLER, /* mmc controller internal CD */
22 ESDHC_CD_GPIO, /* external gpio pin for CD */
23 ESDHC_CD_PERMANENT, /* no CD, card permanently wired to host */
24};
25
26/**
27 * struct esdhc_platform_data - platform data for esdhc on i.MX
28 *
29 * ESDHC_WP(CD)_CONTROLLER type is not available on i.MX25/35.
30 *
31 * @wp_gpio: gpio for write_protect
32 * @cd_gpio: gpio for card_detect interrupt
33 * @wp_type: type of write_protect method (see wp_types enum above)
34 * @cd_type: type of card_detect method (see cd_types enum above)
35 */
36
37struct esdhc_platform_data {
38 unsigned int wp_gpio;
39 unsigned int cd_gpio;
40 enum wp_types wp_type;
41 enum cd_types cd_type;
42};
43#endif /* __ASM_ARCH_IMX_ESDHC_H */
diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
deleted file mode 100644
index 40a8c178f10..00000000000
--- a/arch/arm/plat-mxc/include/mach/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/plat-mxc/include/mach/i2c.h b/arch/arm/plat-mxc/include/mach/i2c.h
deleted file mode 100644
index 8289d915e61..00000000000
--- a/arch/arm/plat-mxc/include/mach/i2c.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * i2c.h - i.MX I2C driver header file
3 *
4 * Copyright (c) 2008, Darius Augulis <augulis.darius@gmail.com>
5 *
6 * This file is released under the GPLv2
7 */
8
9#ifndef __ASM_ARCH_I2C_H_
10#define __ASM_ARCH_I2C_H_
11
12/**
13 * struct imxi2c_platform_data - structure of platform data for MXC I2C driver
14 * @bitrate: Bus speed measured in Hz
15 *
16 **/
17struct imxi2c_platform_data {
18 u32 bitrate;
19};
20
21#endif /* __ASM_ARCH_I2C_H_ */
diff --git a/arch/arm/plat-mxc/include/mach/imx-uart.h b/arch/arm/plat-mxc/include/mach/imx-uart.h
deleted file mode 100644
index 4adec9b154d..00000000000
--- a/arch/arm/plat-mxc/include/mach/imx-uart.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16 * MA 02110-1301, USA.
17 */
18
19#ifndef ASMARM_ARCH_UART_H
20#define ASMARM_ARCH_UART_H
21
22#define IMXUART_HAVE_RTSCTS (1<<0)
23#define IMXUART_IRDA (1<<1)
24
25struct imxuart_platform_data {
26 int (*init)(struct platform_device *pdev);
27 void (*exit)(struct platform_device *pdev);
28 unsigned int flags;
29 void (*irda_enable)(int enable);
30 unsigned int irda_inv_rx:1;
31 unsigned int irda_inv_tx:1;
32 unsigned short transceiver_delay;
33};
34
35#endif
diff --git a/arch/arm/plat-mxc/include/mach/imxfb.h b/arch/arm/plat-mxc/include/mach/imxfb.h
deleted file mode 100644
index 9de8f062ad5..00000000000
--- a/arch/arm/plat-mxc/include/mach/imxfb.h
+++ /dev/null
@@ -1,84 +0,0 @@
1/*
2 * This structure describes the machine which we are running on.
3 */
4#ifndef __MACH_IMXFB_H__
5#define __MACH_IMXFB_H__
6
7#include <linux/fb.h>
8
9#define PCR_TFT (1 << 31)
10#define PCR_COLOR (1 << 30)
11#define PCR_PBSIZ_1 (0 << 28)
12#define PCR_PBSIZ_2 (1 << 28)
13#define PCR_PBSIZ_4 (2 << 28)
14#define PCR_PBSIZ_8 (3 << 28)
15#define PCR_BPIX_1 (0 << 25)
16#define PCR_BPIX_2 (1 << 25)
17#define PCR_BPIX_4 (2 << 25)
18#define PCR_BPIX_8 (3 << 25)
19#define PCR_BPIX_12 (4 << 25)
20#define PCR_BPIX_16 (5 << 25)
21#define PCR_BPIX_18 (6 << 25)
22#define PCR_PIXPOL (1 << 24)
23#define PCR_FLMPOL (1 << 23)
24#define PCR_LPPOL (1 << 22)
25#define PCR_CLKPOL (1 << 21)
26#define PCR_OEPOL (1 << 20)
27#define PCR_SCLKIDLE (1 << 19)
28#define PCR_END_SEL (1 << 18)
29#define PCR_END_BYTE_SWAP (1 << 17)
30#define PCR_REV_VS (1 << 16)
31#define PCR_ACD_SEL (1 << 15)
32#define PCR_ACD(x) (((x) & 0x7f) << 8)
33#define PCR_SCLK_SEL (1 << 7)
34#define PCR_SHARP (1 << 6)
35#define PCR_PCD(x) ((x) & 0x3f)
36
37#define PWMR_CLS(x) (((x) & 0x1ff) << 16)
38#define PWMR_LDMSK (1 << 15)
39#define PWMR_SCR1 (1 << 10)
40#define PWMR_SCR0 (1 << 9)
41#define PWMR_CC_EN (1 << 8)
42#define PWMR_PW(x) ((x) & 0xff)
43
44#define LSCR1_PS_RISE_DELAY(x) (((x) & 0x7f) << 26)
45#define LSCR1_CLS_RISE_DELAY(x) (((x) & 0x3f) << 16)
46#define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8)
47#define LSCR1_GRAY2(x) (((x) & 0xf) << 4)
48#define LSCR1_GRAY1(x) (((x) & 0xf))
49
50#define DMACR_BURST (1 << 31)
51#define DMACR_HM(x) (((x) & 0xf) << 16)
52#define DMACR_TM(x) ((x) & 0xf)
53
54struct imx_fb_videomode {
55 struct fb_videomode mode;
56 u32 pcr;
57 unsigned char bpp;
58};
59
60struct imx_fb_platform_data {
61 struct imx_fb_videomode *mode;
62 int num_modes;
63
64 u_int cmap_greyscale:1,
65 cmap_inverse:1,
66 cmap_static:1,
67 unused:29;
68
69 u_int pwmr;
70 u_int lscr1;
71 u_int dmacr;
72
73 u_char * fixed_screen_cpu;
74 dma_addr_t fixed_screen_dma;
75
76 int (*init)(struct platform_device *);
77 void (*exit)(struct platform_device *);
78
79 void (*lcd_power)(int);
80 void (*backlight_power)(int);
81};
82
83void set_imx_fb_info(struct imx_fb_platform_data *);
84#endif /* ifndef __MACH_IMXFB_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index d8b65b51f2a..f79f78a1c0e 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -512,12 +512,16 @@ enum iomux_pins {
512#define MX31_PIN_CSPI3_SPI_RDY__CTS3 IOMUX_MODE(MX31_PIN_CSPI3_SPI_RDY, IOMUX_CONFIG_ALT1) 512#define MX31_PIN_CSPI3_SPI_RDY__CTS3 IOMUX_MODE(MX31_PIN_CSPI3_SPI_RDY, IOMUX_CONFIG_ALT1)
513#define MX31_PIN_CTS1__CTS1 IOMUX_MODE(MX31_PIN_CTS1, IOMUX_CONFIG_FUNC) 513#define MX31_PIN_CTS1__CTS1 IOMUX_MODE(MX31_PIN_CTS1, IOMUX_CONFIG_FUNC)
514#define MX31_PIN_RTS1__RTS1 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_FUNC) 514#define MX31_PIN_RTS1__RTS1 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_FUNC)
515#define MX31_PIN_RTS1__SFS IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_ALT2)
515#define MX31_PIN_TXD1__TXD1 IOMUX_MODE(MX31_PIN_TXD1, IOMUX_CONFIG_FUNC) 516#define MX31_PIN_TXD1__TXD1 IOMUX_MODE(MX31_PIN_TXD1, IOMUX_CONFIG_FUNC)
517#define MX31_PIN_TXD1__SCK IOMUX_MODE(MX31_PIN_TXD1, IOMUX_CONFIG_ALT2)
516#define MX31_PIN_RXD1__RXD1 IOMUX_MODE(MX31_PIN_RXD1, IOMUX_CONFIG_FUNC) 518#define MX31_PIN_RXD1__RXD1 IOMUX_MODE(MX31_PIN_RXD1, IOMUX_CONFIG_FUNC)
519#define MX31_PIN_RXD1__STXDA IOMUX_MODE(MX31_PIN_RXD1, IOMUX_CONFIG_ALT2)
517#define MX31_PIN_DCD_DCE1__DCD_DCE1 IOMUX_MODE(MX31_PIN_DCD_DCE1, IOMUX_CONFIG_FUNC) 520#define MX31_PIN_DCD_DCE1__DCD_DCE1 IOMUX_MODE(MX31_PIN_DCD_DCE1, IOMUX_CONFIG_FUNC)
518#define MX31_PIN_RI_DCE1__RI_DCE1 IOMUX_MODE(MX31_PIN_RI_DCE1, IOMUX_CONFIG_FUNC) 521#define MX31_PIN_RI_DCE1__RI_DCE1 IOMUX_MODE(MX31_PIN_RI_DCE1, IOMUX_CONFIG_FUNC)
519#define MX31_PIN_DSR_DCE1__DSR_DCE1 IOMUX_MODE(MX31_PIN_DSR_DCE1, IOMUX_CONFIG_FUNC) 522#define MX31_PIN_DSR_DCE1__DSR_DCE1 IOMUX_MODE(MX31_PIN_DSR_DCE1, IOMUX_CONFIG_FUNC)
520#define MX31_PIN_DTR_DCE1__DTR_DCE1 IOMUX_MODE(MX31_PIN_DTR_DCE1, IOMUX_CONFIG_FUNC) 523#define MX31_PIN_DTR_DCE1__DTR_DCE1 IOMUX_MODE(MX31_PIN_DTR_DCE1, IOMUX_CONFIG_FUNC)
524#define MX31_PIN_DTR_DCE1__SRXDA IOMUX_MODE(MX31_PIN_DTR_DCE1, IOMUX_CONFIG_ALT2)
521#define MX31_PIN_CTS2__CTS2 IOMUX_MODE(MX31_PIN_CTS2, IOMUX_CONFIG_FUNC) 525#define MX31_PIN_CTS2__CTS2 IOMUX_MODE(MX31_PIN_CTS2, IOMUX_CONFIG_FUNC)
522#define MX31_PIN_RTS2__RTS2 IOMUX_MODE(MX31_PIN_RTS2, IOMUX_CONFIG_FUNC) 526#define MX31_PIN_RTS2__RTS2 IOMUX_MODE(MX31_PIN_RTS2, IOMUX_CONFIG_FUNC)
523#define MX31_PIN_TXD2__TXD2 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_FUNC) 527#define MX31_PIN_TXD2__TXD2 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_FUNC)
@@ -721,6 +725,7 @@ enum iomux_pins {
721#define MX31_PIN_KEY_ROW2_KEY_ROW2 IOMUX_MODE(MX31_PIN_KEY_ROW2, IOMUX_CONFIG_FUNC) 725#define MX31_PIN_KEY_ROW2_KEY_ROW2 IOMUX_MODE(MX31_PIN_KEY_ROW2, IOMUX_CONFIG_FUNC)
722#define MX31_PIN_KEY_ROW3_KEY_ROW3 IOMUX_MODE(MX31_PIN_KEY_ROW3, IOMUX_CONFIG_FUNC) 726#define MX31_PIN_KEY_ROW3_KEY_ROW3 IOMUX_MODE(MX31_PIN_KEY_ROW3, IOMUX_CONFIG_FUNC)
723#define MX31_PIN_KEY_ROW4_KEY_ROW4 IOMUX_MODE(MX31_PIN_KEY_ROW4, IOMUX_CONFIG_FUNC) 727#define MX31_PIN_KEY_ROW4_KEY_ROW4 IOMUX_MODE(MX31_PIN_KEY_ROW4, IOMUX_CONFIG_FUNC)
728#define MX31_PIN_KEY_ROW4_GPIO IOMUX_MODE(MX31_PIN_KEY_ROW4, IOMUX_CONFIG_GPIO)
724#define MX31_PIN_KEY_ROW5_KEY_ROW5 IOMUX_MODE(MX31_PIN_KEY_ROW5, IOMUX_CONFIG_FUNC) 729#define MX31_PIN_KEY_ROW5_KEY_ROW5 IOMUX_MODE(MX31_PIN_KEY_ROW5, IOMUX_CONFIG_FUNC)
725#define MX31_PIN_KEY_ROW6_KEY_ROW6 IOMUX_MODE(MX31_PIN_KEY_ROW6, IOMUX_CONFIG_FUNC) 730#define MX31_PIN_KEY_ROW6_KEY_ROW6 IOMUX_MODE(MX31_PIN_KEY_ROW6, IOMUX_CONFIG_FUNC)
726#define MX31_PIN_KEY_ROW7_KEY_ROW7 IOMUX_MODE(MX31_PIN_KEY_ROW7, IOMUX_CONFIG_FUNC) 731#define MX31_PIN_KEY_ROW7_KEY_ROW7 IOMUX_MODE(MX31_PIN_KEY_ROW7, IOMUX_CONFIG_FUNC)
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx53.h b/arch/arm/plat-mxc/include/mach/iomux-mx53.h
deleted file mode 100644
index 9761e003bde..00000000000
--- a/arch/arm/plat-mxc/include/mach/iomux-mx53.h
+++ /dev/null
@@ -1,1219 +0,0 @@
1/*
2 * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License 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_MX53_H__
20#define __MACH_IOMUX_MX53_H__
21
22#include <mach/iomux-v3.h>
23
24/* These 2 defines are for pins that may not have a mux register, but could
25 * have a pad setting register, and vice-versa. */
26#define __NA_ 0x00
27
28#define MX53_UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
29 PAD_CTL_DSE_HIGH | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
30#define MX53_SDHC_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \
31 PAD_CTL_PUS_47K_UP | PAD_CTL_DSE_HIGH | \
32 PAD_CTL_SRE_FAST)
33
34
35#define MX53_PAD_GPIO_19__KPP_COL_5 IOMUX_PAD(0x348, 0x020, 0, 0x840, 0, NO_PAD_CTRL)
36#define MX53_PAD_GPIO_19__GPIO4_5 IOMUX_PAD(0x348, 0x020, 1, __NA_, 0, NO_PAD_CTRL)
37#define MX53_PAD_GPIO_19__CCM_CLKO IOMUX_PAD(0x348, 0x020, 2, __NA_, 0, NO_PAD_CTRL)
38#define MX53_PAD_GPIO_19__SPDIF_OUT1 IOMUX_PAD(0x348, 0x020, 3, __NA_, 0, NO_PAD_CTRL)
39#define MX53_PAD_GPIO_19__RTC_CE_RTC_EXT_TRIG2 IOMUX_PAD(0x348, 0x020, 4, __NA_, 0, NO_PAD_CTRL)
40#define MX53_PAD_GPIO_19__ECSPI1_RDY IOMUX_PAD(0x348, 0x020, 5, __NA_, 0, NO_PAD_CTRL)
41#define MX53_PAD_GPIO_19__FEC_TDATA_3 IOMUX_PAD(0x348, 0x020, 6, __NA_, 0, NO_PAD_CTRL)
42#define MX53_PAD_GPIO_19__SRC_INT_BOOT IOMUX_PAD(0x348, 0x020, 7, __NA_, 0, NO_PAD_CTRL)
43#define MX53_PAD_KEY_COL0__KPP_COL_0 IOMUX_PAD(0x34C, 0x024, 0, __NA_, 0, NO_PAD_CTRL)
44#define MX53_PAD_KEY_COL0__GPIO4_6 IOMUX_PAD(0x34C, 0x024, 1, __NA_, 0, NO_PAD_CTRL)
45#define MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC IOMUX_PAD(0x34C, 0x024, 2, 0x758, 0, NO_PAD_CTRL)
46#define MX53_PAD_KEY_COL0__UART4_TXD_MUX IOMUX_PAD(0x34C, 0x024, 4, __NA_, 0, MX53_UART_PAD_CTRL)
47#define MX53_PAD_KEY_COL0__ECSPI1_SCLK IOMUX_PAD(0x34C, 0x024, 5, 0x79C, 0, NO_PAD_CTRL)
48#define MX53_PAD_KEY_COL0__FEC_RDATA_3 IOMUX_PAD(0x34C, 0x024, 6, __NA_, 0, NO_PAD_CTRL)
49#define MX53_PAD_KEY_COL0__SRC_ANY_PU_RST IOMUX_PAD(0x34C, 0x024, 7, __NA_, 0, NO_PAD_CTRL)
50#define MX53_PAD_KEY_ROW0__KPP_ROW_0 IOMUX_PAD(0x350, 0x028, 0, __NA_, 0, NO_PAD_CTRL)
51#define MX53_PAD_KEY_ROW0__GPIO4_7 IOMUX_PAD(0x350, 0x028, 1, __NA_, 0, NO_PAD_CTRL)
52#define MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD IOMUX_PAD(0x350, 0x028, 2, 0x74C, 0, NO_PAD_CTRL)
53#define MX53_PAD_KEY_ROW0__UART4_RXD_MUX IOMUX_PAD(0x350, 0x028, 4, 0x890, 1, MX53_UART_PAD_CTRL)
54#define MX53_PAD_KEY_ROW0__ECSPI1_MOSI IOMUX_PAD(0x350, 0x028, 5, 0x7A4, 0, NO_PAD_CTRL)
55#define MX53_PAD_KEY_ROW0__FEC_TX_ER IOMUX_PAD(0x350, 0x028, 6, __NA_, 0, NO_PAD_CTRL)
56#define MX53_PAD_KEY_COL1__KPP_COL_1 IOMUX_PAD(0x354, 0x02C, 0, __NA_, 0, NO_PAD_CTRL)
57#define MX53_PAD_KEY_COL1__GPIO4_8 IOMUX_PAD(0x354, 0x02C, 1, __NA_, 0, NO_PAD_CTRL)
58#define MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS IOMUX_PAD(0x354, 0x02C, 2, 0x75C, 0, NO_PAD_CTRL)
59#define MX53_PAD_KEY_COL1__UART5_TXD_MUX IOMUX_PAD(0x354, 0x02C, 4, __NA_, 0, MX53_UART_PAD_CTRL)
60#define MX53_PAD_KEY_COL1__ECSPI1_MISO IOMUX_PAD(0x354, 0x02C, 5, 0x7A0, 0, NO_PAD_CTRL)
61#define MX53_PAD_KEY_COL1__FEC_RX_CLK IOMUX_PAD(0x354, 0x02C, 6, 0x808, 0, NO_PAD_CTRL)
62#define MX53_PAD_KEY_COL1__USBPHY1_TXREADY IOMUX_PAD(0x354, 0x02C, 7, __NA_, 0, NO_PAD_CTRL)
63#define MX53_PAD_KEY_ROW1__KPP_ROW_1 IOMUX_PAD(0x358, 0x030, 0, __NA_, 0, NO_PAD_CTRL)
64#define MX53_PAD_KEY_ROW1__GPIO4_9 IOMUX_PAD(0x358, 0x030, 1, __NA_, 0, NO_PAD_CTRL)
65#define MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD IOMUX_PAD(0x358, 0x030, 2, 0x748, 0, NO_PAD_CTRL)
66#define MX53_PAD_KEY_ROW1__UART5_RXD_MUX IOMUX_PAD(0x358, 0x030, 4, 0x898, 1, MX53_UART_PAD_CTRL)
67#define MX53_PAD_KEY_ROW1__ECSPI1_SS0 IOMUX_PAD(0x358, 0x030, 5, 0x7A8, 0, NO_PAD_CTRL)
68#define MX53_PAD_KEY_ROW1__FEC_COL IOMUX_PAD(0x358, 0x030, 6, 0x800, 0, NO_PAD_CTRL)
69#define MX53_PAD_KEY_ROW1__USBPHY1_RXVALID IOMUX_PAD(0x358, 0x030, 7, __NA_, 0, NO_PAD_CTRL)
70#define MX53_PAD_KEY_COL2__KPP_COL_2 IOMUX_PAD(0x35C, 0x034, 0, __NA_, 0, NO_PAD_CTRL)
71#define MX53_PAD_KEY_COL2__GPIO4_10 IOMUX_PAD(0x35C, 0x034, 1, __NA_, 0, NO_PAD_CTRL)
72#define MX53_PAD_KEY_COL2__CAN1_TXCAN IOMUX_PAD(0x35C, 0x034, 2, __NA_, 0, NO_PAD_CTRL)
73#define MX53_PAD_KEY_COL2__FEC_MDIO IOMUX_PAD(0x35C, 0x034, 4, 0x804, 0, NO_PAD_CTRL)
74#define MX53_PAD_KEY_COL2__ECSPI1_SS1 IOMUX_PAD(0x35C, 0x034, 5, 0x7AC, 0, NO_PAD_CTRL)
75#define MX53_PAD_KEY_COL2__FEC_RDATA_2 IOMUX_PAD(0x35C, 0x034, 6, __NA_, 0, NO_PAD_CTRL)
76#define MX53_PAD_KEY_COL2__USBPHY1_RXACTIVE IOMUX_PAD(0x35C, 0x034, 7, __NA_, 0, NO_PAD_CTRL)
77#define MX53_PAD_KEY_ROW2__KPP_ROW_2 IOMUX_PAD(0x360, 0x038, 0, __NA_, 0, NO_PAD_CTRL)
78#define MX53_PAD_KEY_ROW2__GPIO4_11 IOMUX_PAD(0x360, 0x038, 1, __NA_, 0, NO_PAD_CTRL)
79#define MX53_PAD_KEY_ROW2__CAN1_RXCAN IOMUX_PAD(0x360, 0x038, 2, 0x760, 0, NO_PAD_CTRL)
80#define MX53_PAD_KEY_ROW2__FEC_MDC IOMUX_PAD(0x360, 0x038, 4, __NA_, 0, NO_PAD_CTRL)
81#define MX53_PAD_KEY_ROW2__ECSPI1_SS2 IOMUX_PAD(0x360, 0x038, 5, 0x7B0, 0, NO_PAD_CTRL)
82#define MX53_PAD_KEY_ROW2__FEC_TDATA_2 IOMUX_PAD(0x360, 0x038, 6, __NA_, 0, NO_PAD_CTRL)
83#define MX53_PAD_KEY_ROW2__USBPHY1_RXERROR IOMUX_PAD(0x360, 0x038, 7, __NA_, 0, NO_PAD_CTRL)
84#define MX53_PAD_KEY_COL3__KPP_COL_3 IOMUX_PAD(0x364, 0x03C, 0, __NA_, 0, NO_PAD_CTRL)
85#define MX53_PAD_KEY_COL3__GPIO4_12 IOMUX_PAD(0x364, 0x03C, 1, __NA_, 0, NO_PAD_CTRL)
86#define MX53_PAD_KEY_COL3__USBOH3_H2_DP IOMUX_PAD(0x364, 0x03C, 2, __NA_, 0, NO_PAD_CTRL)
87#define MX53_PAD_KEY_COL3__SPDIF_IN1 IOMUX_PAD(0x364, 0x03C, 3, 0x870, 0, NO_PAD_CTRL)
88#define MX53_PAD_KEY_COL3__I2C2_SCL IOMUX_PAD(0x364, 0x03C, 4 | IOMUX_CONFIG_SION, 0x81C, 0, NO_PAD_CTRL)
89#define MX53_PAD_KEY_COL3__ECSPI1_SS3 IOMUX_PAD(0x364, 0x03C, 5, 0x7B4, 0, NO_PAD_CTRL)
90#define MX53_PAD_KEY_COL3__FEC_CRS IOMUX_PAD(0x364, 0x03C, 6, __NA_, 0, NO_PAD_CTRL)
91#define MX53_PAD_KEY_COL3__USBPHY1_SIECLOCK IOMUX_PAD(0x364, 0x03C, 7, __NA_, 0, NO_PAD_CTRL)
92#define MX53_PAD_KEY_ROW3__KPP_ROW_3 IOMUX_PAD(0x368, 0x040, 0, __NA_, 0, NO_PAD_CTRL)
93#define MX53_PAD_KEY_ROW3__GPIO4_13 IOMUX_PAD(0x368, 0x040, 1, __NA_, 0, NO_PAD_CTRL)
94#define MX53_PAD_KEY_ROW3__USBOH3_H2_DM IOMUX_PAD(0x368, 0x040, 2, __NA_, 0, NO_PAD_CTRL)
95#define MX53_PAD_KEY_ROW3__CCM_ASRC_EXT_CLK IOMUX_PAD(0x368, 0x040, 3, 0x768, 0, NO_PAD_CTRL)
96#define MX53_PAD_KEY_ROW3__I2C2_SDA IOMUX_PAD(0x368, 0x040, 4 | IOMUX_CONFIG_SION, 0x820, 0, NO_PAD_CTRL)
97#define MX53_PAD_KEY_ROW3__OSC32K_32K_OUT IOMUX_PAD(0x368, 0x040, 5, __NA_, 0, NO_PAD_CTRL)
98#define MX53_PAD_KEY_ROW3__CCM_PLL4_BYP IOMUX_PAD(0x368, 0x040, 6, 0x77C, 0, NO_PAD_CTRL)
99#define MX53_PAD_KEY_ROW3__USBPHY1_LINESTATE_0 IOMUX_PAD(0x368, 0x040, 7, __NA_, 0, NO_PAD_CTRL)
100#define MX53_PAD_KEY_COL4__KPP_COL_4 IOMUX_PAD(0x36C, 0x044, 0, __NA_, 0, NO_PAD_CTRL)
101#define MX53_PAD_KEY_COL4__GPIO4_14 IOMUX_PAD(0x36C, 0x044, 1, __NA_, 0, NO_PAD_CTRL)
102#define MX53_PAD_KEY_COL4__CAN2_TXCAN IOMUX_PAD(0x36C, 0x044, 2, __NA_, 0, NO_PAD_CTRL)
103#define MX53_PAD_KEY_COL4__IPU_SISG_4 IOMUX_PAD(0x36C, 0x044, 3, __NA_, 0, NO_PAD_CTRL)
104#define MX53_PAD_KEY_COL4__UART5_RTS IOMUX_PAD(0x36C, 0x044, 4, 0x894, 0, MX53_UART_PAD_CTRL)
105#define MX53_PAD_KEY_COL4__USBOH3_USBOTG_OC IOMUX_PAD(0x36C, 0x044, 5, 0x89C, 0, NO_PAD_CTRL)
106#define MX53_PAD_KEY_COL4__USBPHY1_LINESTATE_1 IOMUX_PAD(0x36C, 0x044, 7, __NA_, 0, NO_PAD_CTRL)
107#define MX53_PAD_KEY_ROW4__KPP_ROW_4 IOMUX_PAD(0x370, 0x048, 0, __NA_, 0, NO_PAD_CTRL)
108#define MX53_PAD_KEY_ROW4__GPIO4_15 IOMUX_PAD(0x370, 0x048, 1, __NA_, 0, NO_PAD_CTRL)
109#define MX53_PAD_KEY_ROW4__CAN2_RXCAN IOMUX_PAD(0x370, 0x048, 2, 0x764, 0, NO_PAD_CTRL)
110#define MX53_PAD_KEY_ROW4__IPU_SISG_5 IOMUX_PAD(0x370, 0x048, 3, __NA_, 0, NO_PAD_CTRL)
111#define MX53_PAD_KEY_ROW4__UART5_CTS IOMUX_PAD(0x370, 0x048, 4, __NA_, 0, MX53_UART_PAD_CTRL)
112#define MX53_PAD_KEY_ROW4__USBOH3_USBOTG_PWR IOMUX_PAD(0x370, 0x048, 5, __NA_, 0, NO_PAD_CTRL)
113#define MX53_PAD_KEY_ROW4__USBPHY1_VBUSVALID IOMUX_PAD(0x370, 0x048, 7, __NA_, 0, NO_PAD_CTRL)
114#define MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK IOMUX_PAD(0x378, 0x04C, 0, __NA_, 0, NO_PAD_CTRL)
115#define MX53_PAD_DI0_DISP_CLK__GPIO4_16 IOMUX_PAD(0x378, 0x04C, 1, __NA_, 0, NO_PAD_CTRL)
116#define MX53_PAD_DI0_DISP_CLK__USBOH3_USBH2_DIR IOMUX_PAD(0x378, 0x04C, 2, __NA_, 0, NO_PAD_CTRL)
117#define MX53_PAD_DI0_DISP_CLK__SDMA_DEBUG_CORE_STATE_0 IOMUX_PAD(0x378, 0x04C, 5, __NA_, 0, NO_PAD_CTRL)
118#define MX53_PAD_DI0_DISP_CLK__EMI_EMI_DEBUG_0 IOMUX_PAD(0x378, 0x04C, 6, __NA_, 0, NO_PAD_CTRL)
119#define MX53_PAD_DI0_DISP_CLK__USBPHY1_AVALID IOMUX_PAD(0x378, 0x04C, 7, __NA_, 0, NO_PAD_CTRL)
120#define MX53_PAD_DI0_PIN15__IPU_DI0_PIN15 IOMUX_PAD(0x37C, 0x050, 0, __NA_, 0, NO_PAD_CTRL)
121#define MX53_PAD_DI0_PIN15__GPIO4_17 IOMUX_PAD(0x37C, 0x050, 1, __NA_, 0, NO_PAD_CTRL)
122#define MX53_PAD_DI0_PIN15__AUDMUX_AUD6_TXC IOMUX_PAD(0x37C, 0x050, 2, __NA_, 0, NO_PAD_CTRL)
123#define MX53_PAD_DI0_PIN15__SDMA_DEBUG_CORE_STATE_1 IOMUX_PAD(0x37C, 0x050, 5, __NA_, 0, NO_PAD_CTRL)
124#define MX53_PAD_DI0_PIN15__EMI_EMI_DEBUG_1 IOMUX_PAD(0x37C, 0x050, 6, __NA_, 0, NO_PAD_CTRL)
125#define MX53_PAD_DI0_PIN15__USBPHY1_BVALID IOMUX_PAD(0x37C, 0x050, 7, __NA_, 0, NO_PAD_CTRL)
126#define MX53_PAD_DI0_PIN2__IPU_DI0_PIN2 IOMUX_PAD(0x380, 0x054, 0, __NA_, 0, NO_PAD_CTRL)
127#define MX53_PAD_DI0_PIN2__GPIO4_18 IOMUX_PAD(0x380, 0x054, 1, __NA_, 0, NO_PAD_CTRL)
128#define MX53_PAD_DI0_PIN2__AUDMUX_AUD6_TXD IOMUX_PAD(0x380, 0x054, 2, __NA_, 0, NO_PAD_CTRL)
129#define MX53_PAD_DI0_PIN2__SDMA_DEBUG_CORE_STATE_2 IOMUX_PAD(0x380, 0x054, 5, __NA_, 0, NO_PAD_CTRL)
130#define MX53_PAD_DI0_PIN2__EMI_EMI_DEBUG_2 IOMUX_PAD(0x380, 0x054, 6, __NA_, 0, NO_PAD_CTRL)
131#define MX53_PAD_DI0_PIN2__USBPHY1_ENDSESSION IOMUX_PAD(0x380, 0x054, 7, __NA_, 0, NO_PAD_CTRL)
132#define MX53_PAD_DI0_PIN3__IPU_DI0_PIN3 IOMUX_PAD(0x384, 0x058, 0, __NA_, 0, NO_PAD_CTRL)
133#define MX53_PAD_DI0_PIN3__GPIO4_19 IOMUX_PAD(0x384, 0x058, 1, __NA_, 0, NO_PAD_CTRL)
134#define MX53_PAD_DI0_PIN3__AUDMUX_AUD6_TXFS IOMUX_PAD(0x384, 0x058, 2, __NA_, 0, NO_PAD_CTRL)
135#define MX53_PAD_DI0_PIN3__SDMA_DEBUG_CORE_STATE_3 IOMUX_PAD(0x384, 0x058, 5, __NA_, 0, NO_PAD_CTRL)
136#define MX53_PAD_DI0_PIN3__EMI_EMI_DEBUG_3 IOMUX_PAD(0x384, 0x058, 6, __NA_, 0, NO_PAD_CTRL)
137#define MX53_PAD_DI0_PIN3__USBPHY1_IDDIG IOMUX_PAD(0x384, 0x058, 7, __NA_, 0, NO_PAD_CTRL)
138#define MX53_PAD_DI0_PIN4__IPU_DI0_PIN4 IOMUX_PAD(0x388, 0x05C, 0, __NA_, 0, NO_PAD_CTRL)
139#define MX53_PAD_DI0_PIN4__GPIO4_20 IOMUX_PAD(0x388, 0x05C, 1, __NA_, 0, NO_PAD_CTRL)
140#define MX53_PAD_DI0_PIN4__AUDMUX_AUD6_RXD IOMUX_PAD(0x388, 0x05C, 2, __NA_, 0, NO_PAD_CTRL)
141#define MX53_PAD_DI0_PIN4__ESDHC1_WP IOMUX_PAD(0x388, 0x05C, 3, 0x7FC, 0, NO_PAD_CTRL)
142#define MX53_PAD_DI0_PIN4__SDMA_DEBUG_YIELD IOMUX_PAD(0x388, 0x05C, 5, __NA_, 0, NO_PAD_CTRL)
143#define MX53_PAD_DI0_PIN4__EMI_EMI_DEBUG_4 IOMUX_PAD(0x388, 0x05C, 6, __NA_, 0, NO_PAD_CTRL)
144#define MX53_PAD_DI0_PIN4__USBPHY1_HOSTDISCONNECT IOMUX_PAD(0x388, 0x05C, 7, __NA_, 0, NO_PAD_CTRL)
145#define MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0 IOMUX_PAD(0x38C, 0x060, 0, __NA_, 0, NO_PAD_CTRL)
146#define MX53_PAD_DISP0_DAT0__GPIO4_21 IOMUX_PAD(0x38C, 0x060, 1, __NA_, 0, NO_PAD_CTRL)
147#define MX53_PAD_DISP0_DAT0__CSPI_SCLK IOMUX_PAD(0x38C, 0x060, 2, 0x780, 0, NO_PAD_CTRL)
148#define MX53_PAD_DISP0_DAT0__USBOH3_USBH2_DATA_0 IOMUX_PAD(0x38C, 0x060, 3, __NA_, 0, NO_PAD_CTRL)
149#define MX53_PAD_DISP0_DAT0__SDMA_DEBUG_CORE_RUN IOMUX_PAD(0x38C, 0x060, 5, __NA_, 0, NO_PAD_CTRL)
150#define MX53_PAD_DISP0_DAT0__EMI_EMI_DEBUG_5 IOMUX_PAD(0x38C, 0x060, 6, __NA_, 0, NO_PAD_CTRL)
151#define MX53_PAD_DISP0_DAT0__USBPHY2_TXREADY IOMUX_PAD(0x38C, 0x060, 7, __NA_, 0, NO_PAD_CTRL)
152#define MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1 IOMUX_PAD(0x390, 0x064, 0, __NA_, 0, NO_PAD_CTRL)
153#define MX53_PAD_DISP0_DAT1__GPIO4_22 IOMUX_PAD(0x390, 0x064, 1, __NA_, 0, NO_PAD_CTRL)
154#define MX53_PAD_DISP0_DAT1__CSPI_MOSI IOMUX_PAD(0x390, 0x064, 2, 0x788, 0, NO_PAD_CTRL)
155#define MX53_PAD_DISP0_DAT1__USBOH3_USBH2_DATA_1 IOMUX_PAD(0x390, 0x064, 3, __NA_, 0, NO_PAD_CTRL)
156#define MX53_PAD_DISP0_DAT1__SDMA_DEBUG_EVENT_CHANNEL_SEL \
157 IOMUX_PAD(0x390, 0x064, 5, __NA_, 0, NO_PAD_CTRL)
158#define MX53_PAD_DISP0_DAT1__EMI_EMI_DEBUG_6 IOMUX_PAD(0x390, 0x064, 6, __NA_, 0, NO_PAD_CTRL)
159#define MX53_PAD_DISP0_DAT1__USBPHY2_RXVALID IOMUX_PAD(0x390, 0x064, 7, __NA_, 0, NO_PAD_CTRL)
160#define MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2 IOMUX_PAD(0x394, 0x068, 0, __NA_, 0, NO_PAD_CTRL)
161#define MX53_PAD_DISP0_DAT2__GPIO4_23 IOMUX_PAD(0x394, 0x068, 1, __NA_, 0, NO_PAD_CTRL)
162#define MX53_PAD_DISP0_DAT2__CSPI_MISO IOMUX_PAD(0x394, 0x068, 2, 0x784, 0, NO_PAD_CTRL)
163#define MX53_PAD_DISP0_DAT2__USBOH3_USBH2_DATA_2 IOMUX_PAD(0x394, 0x068, 3, __NA_, 0, NO_PAD_CTRL)
164#define MX53_PAD_DISP0_DAT2__SDMA_DEBUG_MODE IOMUX_PAD(0x394, 0x068, 5, __NA_, 0, NO_PAD_CTRL)
165#define MX53_PAD_DISP0_DAT2__EMI_EMI_DEBUG_7 IOMUX_PAD(0x394, 0x068, 6, __NA_, 0, NO_PAD_CTRL)
166#define MX53_PAD_DISP0_DAT2__USBPHY2_RXACTIVE IOMUX_PAD(0x394, 0x068, 7, __NA_, 0, NO_PAD_CTRL)
167#define MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3 IOMUX_PAD(0x398, 0x06C, 0, __NA_, 0, NO_PAD_CTRL)
168#define MX53_PAD_DISP0_DAT3__GPIO4_24 IOMUX_PAD(0x398, 0x06C, 1, __NA_, 0, NO_PAD_CTRL)
169#define MX53_PAD_DISP0_DAT3__CSPI_SS0 IOMUX_PAD(0x398, 0x06C, 2, 0x78C, 0, NO_PAD_CTRL)
170#define MX53_PAD_DISP0_DAT3__USBOH3_USBH2_DATA_3 IOMUX_PAD(0x398, 0x06C, 3, __NA_, 0, NO_PAD_CTRL)
171#define MX53_PAD_DISP0_DAT3__SDMA_DEBUG_BUS_ERROR IOMUX_PAD(0x398, 0x06C, 5, __NA_, 0, NO_PAD_CTRL)
172#define MX53_PAD_DISP0_DAT3__EMI_EMI_DEBUG_8 IOMUX_PAD(0x398, 0x06C, 6, __NA_, 0, NO_PAD_CTRL)
173#define MX53_PAD_DISP0_DAT3__USBPHY2_RXERROR IOMUX_PAD(0x398, 0x06C, 7, __NA_, 0, NO_PAD_CTRL)
174#define MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4 IOMUX_PAD(0x39C, 0x070, 0, __NA_, 0, NO_PAD_CTRL)
175#define MX53_PAD_DISP0_DAT4__GPIO4_25 IOMUX_PAD(0x39C, 0x070, 1, __NA_, 0, NO_PAD_CTRL)
176#define MX53_PAD_DISP0_DAT4__CSPI_SS1 IOMUX_PAD(0x39C, 0x070, 2, 0x790, 0, NO_PAD_CTRL)
177#define MX53_PAD_DISP0_DAT4__USBOH3_USBH2_DATA_4 IOMUX_PAD(0x39C, 0x070, 3, __NA_, 0, NO_PAD_CTRL)
178#define MX53_PAD_DISP0_DAT4__SDMA_DEBUG_BUS_RWB IOMUX_PAD(0x39C, 0x070, 5, __NA_, 0, NO_PAD_CTRL)
179#define MX53_PAD_DISP0_DAT4__EMI_EMI_DEBUG_9 IOMUX_PAD(0x39C, 0x070, 6, __NA_, 0, NO_PAD_CTRL)
180#define MX53_PAD_DISP0_DAT4__USBPHY2_SIECLOCK IOMUX_PAD(0x39C, 0x070, 7, __NA_, 0, NO_PAD_CTRL)
181#define MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5 IOMUX_PAD(0x3A0, 0x074, 0, __NA_, 0, NO_PAD_CTRL)
182#define MX53_PAD_DISP0_DAT5__GPIO4_26 IOMUX_PAD(0x3A0, 0x074, 1, __NA_, 0, NO_PAD_CTRL)
183#define MX53_PAD_DISP0_DAT5__CSPI_SS2 IOMUX_PAD(0x3A0, 0x074, 2, 0x794, 0, NO_PAD_CTRL)
184#define MX53_PAD_DISP0_DAT5__USBOH3_USBH2_DATA_5 IOMUX_PAD(0x3A0, 0x074, 3, __NA_, 0, NO_PAD_CTRL)
185#define MX53_PAD_DISP0_DAT5__SDMA_DEBUG_MATCHED_DMBUS IOMUX_PAD(0x3A0, 0x074, 5, __NA_, 0, NO_PAD_CTRL)
186#define MX53_PAD_DISP0_DAT5__EMI_EMI_DEBUG_10 IOMUX_PAD(0x3A0, 0x074, 6, __NA_, 0, NO_PAD_CTRL)
187#define MX53_PAD_DISP0_DAT5__USBPHY2_LINESTATE_0 IOMUX_PAD(0x3A0, 0x074, 7, __NA_, 0, NO_PAD_CTRL)
188#define MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6 IOMUX_PAD(0x3A4, 0x078, 0, __NA_, 0, NO_PAD_CTRL)
189#define MX53_PAD_DISP0_DAT6__GPIO4_27 IOMUX_PAD(0x3A4, 0x078, 1, __NA_, 0, NO_PAD_CTRL)
190#define MX53_PAD_DISP0_DAT6__CSPI_SS3 IOMUX_PAD(0x3A4, 0x078, 2, 0x798, 0, NO_PAD_CTRL)
191#define MX53_PAD_DISP0_DAT6__USBOH3_USBH2_DATA_6 IOMUX_PAD(0x3A4, 0x078, 3, __NA_, 0, NO_PAD_CTRL)
192#define MX53_PAD_DISP0_DAT6__SDMA_DEBUG_RTBUFFER_WRITE IOMUX_PAD(0x3A4, 0x078, 5, __NA_, 0, NO_PAD_CTRL)
193#define MX53_PAD_DISP0_DAT6__EMI_EMI_DEBUG_11 IOMUX_PAD(0x3A4, 0x078, 6, __NA_, 0, NO_PAD_CTRL)
194#define MX53_PAD_DISP0_DAT6__USBPHY2_LINESTATE_1 IOMUX_PAD(0x3A4, 0x078, 7, __NA_, 0, NO_PAD_CTRL)
195#define MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7 IOMUX_PAD(0x3A8, 0x07C, 0, __NA_, 0, NO_PAD_CTRL)
196#define MX53_PAD_DISP0_DAT7__GPIO4_28 IOMUX_PAD(0x3A8, 0x07C, 1, __NA_, 0, NO_PAD_CTRL)
197#define MX53_PAD_DISP0_DAT7__CSPI_RDY IOMUX_PAD(0x3A8, 0x07C, 2, __NA_, 0, NO_PAD_CTRL)
198#define MX53_PAD_DISP0_DAT7__USBOH3_USBH2_DATA_7 IOMUX_PAD(0x3A8, 0x07C, 3, __NA_, 0, NO_PAD_CTRL)
199#define MX53_PAD_DISP0_DAT7__SDMA_DEBUG_EVENT_CHANNEL_0 IOMUX_PAD(0x3A8, 0x07C, 5, __NA_, 0, NO_PAD_CTRL)
200#define MX53_PAD_DISP0_DAT7__EMI_EMI_DEBUG_12 IOMUX_PAD(0x3A8, 0x07C, 6, __NA_, 0, NO_PAD_CTRL)
201#define MX53_PAD_DISP0_DAT7__USBPHY2_VBUSVALID IOMUX_PAD(0x3A8, 0x07C, 7, __NA_, 0, NO_PAD_CTRL)
202#define MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8 IOMUX_PAD(0x3AC, 0x080, 0, __NA_, 0, NO_PAD_CTRL)
203#define MX53_PAD_DISP0_DAT8__GPIO4_29 IOMUX_PAD(0x3AC, 0x080, 1, __NA_, 0, NO_PAD_CTRL)
204#define MX53_PAD_DISP0_DAT8__PWM1_PWMO IOMUX_PAD(0x3AC, 0x080, 2, __NA_, 0, NO_PAD_CTRL)
205#define MX53_PAD_DISP0_DAT8__WDOG1_WDOG_B IOMUX_PAD(0x3AC, 0x080, 3, __NA_, 0, NO_PAD_CTRL)
206#define MX53_PAD_DISP0_DAT8__SDMA_DEBUG_EVENT_CHANNEL_1 IOMUX_PAD(0x3AC, 0x080, 5, __NA_, 0, NO_PAD_CTRL)
207#define MX53_PAD_DISP0_DAT8__EMI_EMI_DEBUG_13 IOMUX_PAD(0x3AC, 0x080, 6, __NA_, 0, NO_PAD_CTRL)
208#define MX53_PAD_DISP0_DAT8__USBPHY2_AVALID IOMUX_PAD(0x3AC, 0x080, 7, __NA_, 0, NO_PAD_CTRL)
209#define MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9 IOMUX_PAD(0x3B0, 0x084, 0, __NA_, 0, NO_PAD_CTRL)
210#define MX53_PAD_DISP0_DAT9__GPIO4_30 IOMUX_PAD(0x3B0, 0x084, 1, __NA_, 0, NO_PAD_CTRL)
211#define MX53_PAD_DISP0_DAT9__PWM2_PWMO IOMUX_PAD(0x3B0, 0x084, 2, __NA_, 0, NO_PAD_CTRL)
212#define MX53_PAD_DISP0_DAT9__WDOG2_WDOG_B IOMUX_PAD(0x3B0, 0x084, 3, __NA_, 0, NO_PAD_CTRL)
213#define MX53_PAD_DISP0_DAT9__SDMA_DEBUG_EVENT_CHANNEL_2 IOMUX_PAD(0x3B0, 0x084, 5, __NA_, 0, NO_PAD_CTRL)
214#define MX53_PAD_DISP0_DAT9__EMI_EMI_DEBUG_14 IOMUX_PAD(0x3B0, 0x084, 6, __NA_, 0, NO_PAD_CTRL)
215#define MX53_PAD_DISP0_DAT9__USBPHY2_VSTATUS_0 IOMUX_PAD(0x3B0, 0x084, 7, __NA_, 0, NO_PAD_CTRL)
216#define MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10 IOMUX_PAD(0x3B4, 0x088, 0, __NA_, 0, NO_PAD_CTRL)
217#define MX53_PAD_DISP0_DAT10__GPIO4_31 IOMUX_PAD(0x3B4, 0x088, 1, __NA_, 0, NO_PAD_CTRL)
218#define MX53_PAD_DISP0_DAT10__USBOH3_USBH2_STP IOMUX_PAD(0x3B4, 0x088, 2, __NA_, 0, NO_PAD_CTRL)
219#define MX53_PAD_DISP0_DAT10__SDMA_DEBUG_EVENT_CHANNEL_3 \
220 IOMUX_PAD(0x3B4, 0x088, 5, __NA_, 0, NO_PAD_CTRL)
221#define MX53_PAD_DISP0_DAT10__EMI_EMI_DEBUG_15 IOMUX_PAD(0x3B4, 0x088, 6, __NA_, 0, NO_PAD_CTRL)
222#define MX53_PAD_DISP0_DAT10__USBPHY2_VSTATUS_1 IOMUX_PAD(0x3B4, 0x088, 7, __NA_, 0, NO_PAD_CTRL)
223#define MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11 IOMUX_PAD(0x3B8, 0x08C, 0, __NA_, 0, NO_PAD_CTRL)
224#define MX53_PAD_DISP0_DAT11__GPIO5_5 IOMUX_PAD(0x3B8, 0x08C, 1, __NA_, 0, NO_PAD_CTRL)
225#define MX53_PAD_DISP0_DAT11__USBOH3_USBH2_NXT IOMUX_PAD(0x3B8, 0x08C, 2, __NA_, 0, NO_PAD_CTRL)
226#define MX53_PAD_DISP0_DAT11__SDMA_DEBUG_EVENT_CHANNEL_4 \
227 IOMUX_PAD(0x3B8, 0x08C, 5, __NA_, 0, NO_PAD_CTRL)
228#define MX53_PAD_DISP0_DAT11__EMI_EMI_DEBUG_16 IOMUX_PAD(0x3B8, 0x08C, 6, __NA_, 0, NO_PAD_CTRL)
229#define MX53_PAD_DISP0_DAT11__USBPHY2_VSTATUS_2 IOMUX_PAD(0x3B8, 0x08C, 7, __NA_, 0, NO_PAD_CTRL)
230#define MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12 IOMUX_PAD(0x3BC, 0x090, 0, __NA_, 0, NO_PAD_CTRL)
231#define MX53_PAD_DISP0_DAT12__GPIO5_6 IOMUX_PAD(0x3BC, 0x090, 1, __NA_, 0, NO_PAD_CTRL)
232#define MX53_PAD_DISP0_DAT12__USBOH3_USBH2_CLK IOMUX_PAD(0x3BC, 0x090, 2, __NA_, 0, NO_PAD_CTRL)
233#define MX53_PAD_DISP0_DAT12__SDMA_DEBUG_EVENT_CHANNEL_5 \
234 IOMUX_PAD(0x3BC, 0x090, 5, __NA_, 0, NO_PAD_CTRL)
235#define MX53_PAD_DISP0_DAT12__EMI_EMI_DEBUG_17 IOMUX_PAD(0x3BC, 0x090, 6, __NA_, 0, NO_PAD_CTRL)
236#define MX53_PAD_DISP0_DAT12__USBPHY2_VSTATUS_3 IOMUX_PAD(0x3BC, 0x090, 7, __NA_, 0, NO_PAD_CTRL)
237#define MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13 IOMUX_PAD(0x3C0, 0x094, 0, __NA_, 0, NO_PAD_CTRL)
238#define MX53_PAD_DISP0_DAT13__GPIO5_7 IOMUX_PAD(0x3C0, 0x094, 1, __NA_, 0, NO_PAD_CTRL)
239#define MX53_PAD_DISP0_DAT13__AUDMUX_AUD5_RXFS IOMUX_PAD(0x3C0, 0x094, 3, 0x754, 0, NO_PAD_CTRL)
240#define MX53_PAD_DISP0_DAT13__SDMA_DEBUG_EVT_CHN_LINES_0 \
241 IOMUX_PAD(0x3C0, 0x094, 5, __NA_, 0, NO_PAD_CTRL)
242#define MX53_PAD_DISP0_DAT13__EMI_EMI_DEBUG_18 IOMUX_PAD(0x3C0, 0x094, 6, __NA_, 0, NO_PAD_CTRL)
243#define MX53_PAD_DISP0_DAT13__USBPHY2_VSTATUS_4 IOMUX_PAD(0x3C0, 0x094, 7, __NA_, 0, NO_PAD_CTRL)
244#define MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14 IOMUX_PAD(0x3C4, 0x098, 0, __NA_, 0, NO_PAD_CTRL)
245#define MX53_PAD_DISP0_DAT14__GPIO5_8 IOMUX_PAD(0x3C4, 0x098, 1, __NA_, 0, NO_PAD_CTRL)
246#define MX53_PAD_DISP0_DAT14__AUDMUX_AUD5_RXC IOMUX_PAD(0x3C4, 0x098, 3, 0x750, 0, NO_PAD_CTRL)
247#define MX53_PAD_DISP0_DAT14__SDMA_DEBUG_EVT_CHN_LINES_1 \
248 IOMUX_PAD(0x3C4, 0x098, 5, __NA_, 0, NO_PAD_CTRL)
249#define MX53_PAD_DISP0_DAT14__EMI_EMI_DEBUG_19 IOMUX_PAD(0x3C4, 0x098, 6, __NA_, 0, NO_PAD_CTRL)
250#define MX53_PAD_DISP0_DAT14__USBPHY2_VSTATUS_5 IOMUX_PAD(0x3C4, 0x098, 7, __NA_, 0, NO_PAD_CTRL)
251#define MX53_PAD_DISP0_DAT15__IPU_DISP0_DAT_15 IOMUX_PAD(0x3C8, 0x09C, 0, __NA_, 0, NO_PAD_CTRL)
252#define MX53_PAD_DISP0_DAT15__GPIO5_9 IOMUX_PAD(0x3C8, 0x09C, 1, __NA_, 0, NO_PAD_CTRL)
253#define MX53_PAD_DISP0_DAT15__ECSPI1_SS1 IOMUX_PAD(0x3C8, 0x09C, 2, 0x7AC, 1, NO_PAD_CTRL)
254#define MX53_PAD_DISP0_DAT15__ECSPI2_SS1 IOMUX_PAD(0x3C8, 0x09C, 3, 0x7C8, 0, NO_PAD_CTRL)
255#define MX53_PAD_DISP0_DAT15__SDMA_DEBUG_EVT_CHN_LINES_2 \
256 IOMUX_PAD(0x3C8, 0x09C, 5, __NA_, 0, NO_PAD_CTRL)
257#define MX53_PAD_DISP0_DAT15__EMI_EMI_DEBUG_20 IOMUX_PAD(0x3C8, 0x09C, 6, __NA_, 0, NO_PAD_CTRL)
258#define MX53_PAD_DISP0_DAT15__USBPHY2_VSTATUS_6 IOMUX_PAD(0x3C8, 0x09C, 7, __NA_, 0, NO_PAD_CTRL)
259#define MX53_PAD_DISP0_DAT16__IPU_DISP0_DAT_16 IOMUX_PAD(0x3CC, 0x0A0, 0, __NA_, 0, NO_PAD_CTRL)
260#define MX53_PAD_DISP0_DAT16__GPIO5_10 IOMUX_PAD(0x3CC, 0x0A0, 1, __NA_, 0, NO_PAD_CTRL)
261#define MX53_PAD_DISP0_DAT16__ECSPI2_MOSI IOMUX_PAD(0x3CC, 0x0A0, 2, 0x7C0, 0, NO_PAD_CTRL)
262#define MX53_PAD_DISP0_DAT16__AUDMUX_AUD5_TXC IOMUX_PAD(0x3CC, 0x0A0, 3, 0x758, 1, NO_PAD_CTRL)
263#define MX53_PAD_DISP0_DAT16__SDMA_EXT_EVENT_0 IOMUX_PAD(0x3CC, 0x0A0, 4, 0x868, 0, NO_PAD_CTRL)
264#define MX53_PAD_DISP0_DAT16__SDMA_DEBUG_EVT_CHN_LINES_3 \
265 IOMUX_PAD(0x3CC, 0x0A0, 5, __NA_, 0, NO_PAD_CTRL)
266#define MX53_PAD_DISP0_DAT16__EMI_EMI_DEBUG_21 IOMUX_PAD(0x3CC, 0x0A0, 6, __NA_, 0, NO_PAD_CTRL)
267#define MX53_PAD_DISP0_DAT16__USBPHY2_VSTATUS_7 IOMUX_PAD(0x3CC, 0x0A0, 7, __NA_, 0, NO_PAD_CTRL)
268#define MX53_PAD_DISP0_DAT17__IPU_DISP0_DAT_17 IOMUX_PAD(0x3D0, 0x0A4, 0, __NA_, 0, NO_PAD_CTRL)
269#define MX53_PAD_DISP0_DAT17__GPIO5_11 IOMUX_PAD(0x3D0, 0x0A4, 1, __NA_, 0, NO_PAD_CTRL)
270#define MX53_PAD_DISP0_DAT17__ECSPI2_MISO IOMUX_PAD(0x3D0, 0x0A4, 2, 0x7BC, 0, NO_PAD_CTRL)
271#define MX53_PAD_DISP0_DAT17__AUDMUX_AUD5_TXD IOMUX_PAD(0x3D0, 0x0A4, 3, 0x74C, 1, NO_PAD_CTRL)
272#define MX53_PAD_DISP0_DAT17__SDMA_EXT_EVENT_1 IOMUX_PAD(0x3D0, 0x0A4, 4, 0x86C, 0, NO_PAD_CTRL)
273#define MX53_PAD_DISP0_DAT17__SDMA_DEBUG_EVT_CHN_LINES_4 \
274 IOMUX_PAD(0x3D0, 0x0A4, 5, __NA_, 0, NO_PAD_CTRL)
275#define MX53_PAD_DISP0_DAT17__EMI_EMI_DEBUG_22 IOMUX_PAD(0x3D0, 0x0A4, 6, __NA_, 0, NO_PAD_CTRL)
276#define MX53_PAD_DISP0_DAT18__IPU_DISP0_DAT_18 IOMUX_PAD(0x3D4, 0x0A8, 0, __NA_, 0, NO_PAD_CTRL)
277#define MX53_PAD_DISP0_DAT18__GPIO5_12 IOMUX_PAD(0x3D4, 0x0A8, 1, __NA_, 0, NO_PAD_CTRL)
278#define MX53_PAD_DISP0_DAT18__ECSPI2_SS0 IOMUX_PAD(0x3D4, 0x0A8, 2, 0x7C4, 0, NO_PAD_CTRL)
279#define MX53_PAD_DISP0_DAT18__AUDMUX_AUD5_TXFS IOMUX_PAD(0x3D4, 0x0A8, 3, 0x75C, 1, NO_PAD_CTRL)
280#define MX53_PAD_DISP0_DAT18__AUDMUX_AUD4_RXFS IOMUX_PAD(0x3D4, 0x0A8, 4, 0x73C, 0, NO_PAD_CTRL)
281#define MX53_PAD_DISP0_DAT18__SDMA_DEBUG_EVT_CHN_LINES_5 \
282 IOMUX_PAD(0x3D4, 0x0A8, 5, __NA_, 0, NO_PAD_CTRL)
283#define MX53_PAD_DISP0_DAT18__EMI_EMI_DEBUG_23 IOMUX_PAD(0x3D4, 0x0A8, 6, __NA_, 0, NO_PAD_CTRL)
284#define MX53_PAD_DISP0_DAT18__EMI_WEIM_CS_2 IOMUX_PAD(0x3D4, 0x0A8, 7, __NA_, 0, NO_PAD_CTRL)
285#define MX53_PAD_DISP0_DAT19__IPU_DISP0_DAT_19 IOMUX_PAD(0x3D8, 0x0AC, 0, __NA_, 0, NO_PAD_CTRL)
286#define MX53_PAD_DISP0_DAT19__GPIO5_13 IOMUX_PAD(0x3D8, 0x0AC, 1, __NA_, 0, NO_PAD_CTRL)
287#define MX53_PAD_DISP0_DAT19__ECSPI2_SCLK IOMUX_PAD(0x3D8, 0x0AC, 2, 0x7B8, 0, NO_PAD_CTRL)
288#define MX53_PAD_DISP0_DAT19__AUDMUX_AUD5_RXD IOMUX_PAD(0x3D8, 0x0AC, 3, 0x748, 1, NO_PAD_CTRL)
289#define MX53_PAD_DISP0_DAT19__AUDMUX_AUD4_RXC IOMUX_PAD(0x3D8, 0x0AC, 4, 0x738, 0, NO_PAD_CTRL)
290#define MX53_PAD_DISP0_DAT19__SDMA_DEBUG_EVT_CHN_LINES_6 \
291 IOMUX_PAD(0x3D8, 0x0AC, 5, __NA_, 0, NO_PAD_CTRL)
292#define MX53_PAD_DISP0_DAT19__EMI_EMI_DEBUG_24 IOMUX_PAD(0x3D8, 0x0AC, 6, __NA_, 0, NO_PAD_CTRL)
293#define MX53_PAD_DISP0_DAT19__EMI_WEIM_CS_3 IOMUX_PAD(0x3D8, 0x0AC, 7, __NA_, 0, NO_PAD_CTRL)
294#define MX53_PAD_DISP0_DAT20__IPU_DISP0_DAT_20 IOMUX_PAD(0x3DC, 0x0B0, 0, __NA_, 0, NO_PAD_CTRL)
295#define MX53_PAD_DISP0_DAT20__GPIO5_14 IOMUX_PAD(0x3DC, 0x0B0, 1, __NA_, 0, NO_PAD_CTRL)
296#define MX53_PAD_DISP0_DAT20__ECSPI1_SCLK IOMUX_PAD(0x3DC, 0x0B0, 2, 0x79C, 1, NO_PAD_CTRL)
297#define MX53_PAD_DISP0_DAT20__AUDMUX_AUD4_TXC IOMUX_PAD(0x3DC, 0x0B0, 3, 0x740, 0, NO_PAD_CTRL)
298#define MX53_PAD_DISP0_DAT20__SDMA_DEBUG_EVT_CHN_LINES_7 \
299 IOMUX_PAD(0x3DC, 0x0B0, 5, __NA_, 0, NO_PAD_CTRL)
300#define MX53_PAD_DISP0_DAT20__EMI_EMI_DEBUG_25 IOMUX_PAD(0x3DC, 0x0B0, 6, __NA_, 0, NO_PAD_CTRL)
301#define MX53_PAD_DISP0_DAT20__SATA_PHY_TDI IOMUX_PAD(0x3DC, 0x0B0, 7, __NA_, 0, NO_PAD_CTRL)
302#define MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21 IOMUX_PAD(0x3E0, 0x0B4, 0, __NA_, 0, NO_PAD_CTRL)
303#define MX53_PAD_DISP0_DAT21__GPIO5_15 IOMUX_PAD(0x3E0, 0x0B4, 1, __NA_, 0, NO_PAD_CTRL)
304#define MX53_PAD_DISP0_DAT21__ECSPI1_MOSI IOMUX_PAD(0x3E0, 0x0B4, 2, 0x7A4, 1, NO_PAD_CTRL)
305#define MX53_PAD_DISP0_DAT21__AUDMUX_AUD4_TXD IOMUX_PAD(0x3E0, 0x0B4, 3, 0x734, 0, NO_PAD_CTRL)
306#define MX53_PAD_DISP0_DAT21__SDMA_DEBUG_BUS_DEVICE_0 IOMUX_PAD(0x3E0, 0x0B4, 5, __NA_, 0, NO_PAD_CTRL)
307#define MX53_PAD_DISP0_DAT21__EMI_EMI_DEBUG_26 IOMUX_PAD(0x3E0, 0x0B4, 6, __NA_, 0, NO_PAD_CTRL)
308#define MX53_PAD_DISP0_DAT21__SATA_PHY_TDO IOMUX_PAD(0x3E0, 0x0B4, 7, __NA_, 0, NO_PAD_CTRL)
309#define MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22 IOMUX_PAD(0x3E4, 0x0B8, 0, __NA_, 0, NO_PAD_CTRL)
310#define MX53_PAD_DISP0_DAT22__GPIO5_16 IOMUX_PAD(0x3E4, 0x0B8, 1, __NA_, 0, NO_PAD_CTRL)
311#define MX53_PAD_DISP0_DAT22__ECSPI1_MISO IOMUX_PAD(0x3E4, 0x0B8, 2, 0x7A0, 1, NO_PAD_CTRL)
312#define MX53_PAD_DISP0_DAT22__AUDMUX_AUD4_TXFS IOMUX_PAD(0x3E4, 0x0B8, 3, 0x744, 0, NO_PAD_CTRL)
313#define MX53_PAD_DISP0_DAT22__SDMA_DEBUG_BUS_DEVICE_1 IOMUX_PAD(0x3E4, 0x0B8, 5, __NA_, 0, NO_PAD_CTRL)
314#define MX53_PAD_DISP0_DAT22__EMI_EMI_DEBUG_27 IOMUX_PAD(0x3E4, 0x0B8, 6, __NA_, 0, NO_PAD_CTRL)
315#define MX53_PAD_DISP0_DAT22__SATA_PHY_TCK IOMUX_PAD(0x3E4, 0x0B8, 7, __NA_, 0, NO_PAD_CTRL)
316#define MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23 IOMUX_PAD(0x3E8, 0x0BC, 0, __NA_, 0, NO_PAD_CTRL)
317#define MX53_PAD_DISP0_DAT23__GPIO5_17 IOMUX_PAD(0x3E8, 0x0BC, 1, __NA_, 0, NO_PAD_CTRL)
318#define MX53_PAD_DISP0_DAT23__ECSPI1_SS0 IOMUX_PAD(0x3E8, 0x0BC, 2, 0x7A8, 1, NO_PAD_CTRL)
319#define MX53_PAD_DISP0_DAT23__AUDMUX_AUD4_RXD IOMUX_PAD(0x3E8, 0x0BC, 3, 0x730, 0, NO_PAD_CTRL)
320#define MX53_PAD_DISP0_DAT23__SDMA_DEBUG_BUS_DEVICE_2 IOMUX_PAD(0x3E8, 0x0BC, 5, __NA_, 0, NO_PAD_CTRL)
321#define MX53_PAD_DISP0_DAT23__EMI_EMI_DEBUG_28 IOMUX_PAD(0x3E8, 0x0BC, 6, __NA_, 0, NO_PAD_CTRL)
322#define MX53_PAD_DISP0_DAT23__SATA_PHY_TMS IOMUX_PAD(0x3E8, 0x0BC, 7, __NA_, 0, NO_PAD_CTRL)
323#define MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK IOMUX_PAD(0x3EC, 0x0C0, 0, __NA_, 0, NO_PAD_CTRL)
324#define MX53_PAD_CSI0_PIXCLK__GPIO5_18 IOMUX_PAD(0x3EC, 0x0C0, 1, __NA_, 0, NO_PAD_CTRL)
325#define MX53_PAD_CSI0_PIXCLK__SDMA_DEBUG_PC_0 IOMUX_PAD(0x3EC, 0x0C0, 5, __NA_, 0, NO_PAD_CTRL)
326#define MX53_PAD_CSI0_PIXCLK__EMI_EMI_DEBUG_29 IOMUX_PAD(0x3EC, 0x0C0, 6, __NA_, 0, NO_PAD_CTRL)
327#define MX53_PAD_CSI0_MCLK__IPU_CSI0_HSYNC IOMUX_PAD(0x3F0, 0x0C4, 0, __NA_, 0, NO_PAD_CTRL)
328#define MX53_PAD_CSI0_MCLK__GPIO5_19 IOMUX_PAD(0x3F0, 0x0C4, 1, __NA_, 0, NO_PAD_CTRL)
329#define MX53_PAD_CSI0_MCLK__CCM_CSI0_MCLK IOMUX_PAD(0x3F0, 0x0C4, 2, __NA_, 0, NO_PAD_CTRL)
330#define MX53_PAD_CSI0_MCLK__SDMA_DEBUG_PC_1 IOMUX_PAD(0x3F0, 0x0C4, 5, __NA_, 0, NO_PAD_CTRL)
331#define MX53_PAD_CSI0_MCLK__EMI_EMI_DEBUG_30 IOMUX_PAD(0x3F0, 0x0C4, 6, __NA_, 0, NO_PAD_CTRL)
332#define MX53_PAD_CSI0_MCLK__TPIU_TRCTL IOMUX_PAD(0x3F0, 0x0C4, 7, __NA_, 0, NO_PAD_CTRL)
333#define MX53_PAD_CSI0_DATA_EN__IPU_CSI0_DATA_EN IOMUX_PAD(0x3F4, 0x0C8, 0, __NA_, 0, NO_PAD_CTRL)
334#define MX53_PAD_CSI0_DATA_EN__GPIO5_20 IOMUX_PAD(0x3F4, 0x0C8, 1, __NA_, 0, NO_PAD_CTRL)
335#define MX53_PAD_CSI0_DATA_EN__SDMA_DEBUG_PC_2 IOMUX_PAD(0x3F4, 0x0C8, 5, __NA_, 0, NO_PAD_CTRL)
336#define MX53_PAD_CSI0_DATA_EN__EMI_EMI_DEBUG_31 IOMUX_PAD(0x3F4, 0x0C8, 6, __NA_, 0, NO_PAD_CTRL)
337#define MX53_PAD_CSI0_DATA_EN__TPIU_TRCLK IOMUX_PAD(0x3F4, 0x0C8, 7, __NA_, 0, NO_PAD_CTRL)
338#define MX53_PAD_CSI0_VSYNC__IPU_CSI0_VSYNC IOMUX_PAD(0x3F8, 0x0CC, 0, __NA_, 0, NO_PAD_CTRL)
339#define MX53_PAD_CSI0_VSYNC__GPIO5_21 IOMUX_PAD(0x3F8, 0x0CC, 1, __NA_, 0, NO_PAD_CTRL)
340#define MX53_PAD_CSI0_VSYNC__SDMA_DEBUG_PC_3 IOMUX_PAD(0x3F8, 0x0CC, 5, __NA_, 0, NO_PAD_CTRL)
341#define MX53_PAD_CSI0_VSYNC__EMI_EMI_DEBUG_32 IOMUX_PAD(0x3F8, 0x0CC, 6, __NA_, 0, NO_PAD_CTRL)
342#define MX53_PAD_CSI0_VSYNC__TPIU_TRACE_0 IOMUX_PAD(0x3F8, 0x0CC, 7, __NA_, 0, NO_PAD_CTRL)
343#define MX53_PAD_CSI0_DAT4__IPU_CSI0_D_4 IOMUX_PAD(0x3FC, 0x0D0, 0, __NA_, 0, NO_PAD_CTRL)
344#define MX53_PAD_CSI0_DAT4__GPIO5_22 IOMUX_PAD(0x3FC, 0x0D0, 1, __NA_, 0, NO_PAD_CTRL)
345#define MX53_PAD_CSI0_DAT4__KPP_COL_5 IOMUX_PAD(0x3FC, 0x0D0, 2, 0x840, 1, NO_PAD_CTRL)
346#define MX53_PAD_CSI0_DAT4__ECSPI1_SCLK IOMUX_PAD(0x3FC, 0x0D0, 3, 0x79C, 2, NO_PAD_CTRL)
347#define MX53_PAD_CSI0_DAT4__USBOH3_USBH3_STP IOMUX_PAD(0x3FC, 0x0D0, 4, __NA_, 0, NO_PAD_CTRL)
348#define MX53_PAD_CSI0_DAT4__AUDMUX_AUD3_TXC IOMUX_PAD(0x3FC, 0x0D0, 5, __NA_, 0, NO_PAD_CTRL)
349#define MX53_PAD_CSI0_DAT4__EMI_EMI_DEBUG_33 IOMUX_PAD(0x3FC, 0x0D0, 6, __NA_, 0, NO_PAD_CTRL)
350#define MX53_PAD_CSI0_DAT4__TPIU_TRACE_1 IOMUX_PAD(0x3FC, 0x0D0, 7, __NA_, 0, NO_PAD_CTRL)
351#define MX53_PAD_CSI0_DAT5__IPU_CSI0_D_5 IOMUX_PAD(0x400, 0x0D4, 0, __NA_, 0, NO_PAD_CTRL)
352#define MX53_PAD_CSI0_DAT5__GPIO5_23 IOMUX_PAD(0x400, 0x0D4, 1, __NA_, 0, NO_PAD_CTRL)
353#define MX53_PAD_CSI0_DAT5__KPP_ROW_5 IOMUX_PAD(0x400, 0x0D4, 2, 0x84C, 0, NO_PAD_CTRL)
354#define MX53_PAD_CSI0_DAT5__ECSPI1_MOSI IOMUX_PAD(0x400, 0x0D4, 3, 0x7A4, 2, NO_PAD_CTRL)
355#define MX53_PAD_CSI0_DAT5__USBOH3_USBH3_NXT IOMUX_PAD(0x400, 0x0D4, 4, __NA_, 0, NO_PAD_CTRL)
356#define MX53_PAD_CSI0_DAT5__AUDMUX_AUD3_TXD IOMUX_PAD(0x400, 0x0D4, 5, __NA_, 0, NO_PAD_CTRL)
357#define MX53_PAD_CSI0_DAT5__EMI_EMI_DEBUG_34 IOMUX_PAD(0x400, 0x0D4, 6, __NA_, 0, NO_PAD_CTRL)
358#define MX53_PAD_CSI0_DAT5__TPIU_TRACE_2 IOMUX_PAD(0x400, 0x0D4, 7, __NA_, 0, NO_PAD_CTRL)
359#define MX53_PAD_CSI0_DAT6__IPU_CSI0_D_6 IOMUX_PAD(0x404, 0x0D8, 0, __NA_, 0, NO_PAD_CTRL)
360#define MX53_PAD_CSI0_DAT6__GPIO5_24 IOMUX_PAD(0x404, 0x0D8, 1, __NA_, 0, NO_PAD_CTRL)
361#define MX53_PAD_CSI0_DAT6__KPP_COL_6 IOMUX_PAD(0x404, 0x0D8, 2, 0x844, 0, NO_PAD_CTRL)
362#define MX53_PAD_CSI0_DAT6__ECSPI1_MISO IOMUX_PAD(0x404, 0x0D8, 3, 0x7A0, 2, NO_PAD_CTRL)
363#define MX53_PAD_CSI0_DAT6__USBOH3_USBH3_CLK IOMUX_PAD(0x404, 0x0D8, 4, __NA_, 0, NO_PAD_CTRL)
364#define MX53_PAD_CSI0_DAT6__AUDMUX_AUD3_TXFS IOMUX_PAD(0x404, 0x0D8, 5, __NA_, 0, NO_PAD_CTRL)
365#define MX53_PAD_CSI0_DAT6__EMI_EMI_DEBUG_35 IOMUX_PAD(0x404, 0x0D8, 6, __NA_, 0, NO_PAD_CTRL)
366#define MX53_PAD_CSI0_DAT6__TPIU_TRACE_3 IOMUX_PAD(0x404, 0x0D8, 7, __NA_, 0, NO_PAD_CTRL)
367#define MX53_PAD_CSI0_DAT7__IPU_CSI0_D_7 IOMUX_PAD(0x408, 0x0DC, 0, __NA_, 0, NO_PAD_CTRL)
368#define MX53_PAD_CSI0_DAT7__GPIO5_25 IOMUX_PAD(0x408, 0x0DC, 1, __NA_, 0, NO_PAD_CTRL)
369#define MX53_PAD_CSI0_DAT7__KPP_ROW_6 IOMUX_PAD(0x408, 0x0DC, 2, 0x850, 0, NO_PAD_CTRL)
370#define MX53_PAD_CSI0_DAT7__ECSPI1_SS0 IOMUX_PAD(0x408, 0x0DC, 3, 0x7A8, 2, NO_PAD_CTRL)
371#define MX53_PAD_CSI0_DAT7__USBOH3_USBH3_DIR IOMUX_PAD(0x408, 0x0DC, 4, __NA_, 0, NO_PAD_CTRL)
372#define MX53_PAD_CSI0_DAT7__AUDMUX_AUD3_RXD IOMUX_PAD(0x408, 0x0DC, 5, __NA_, 0, NO_PAD_CTRL)
373#define MX53_PAD_CSI0_DAT7__EMI_EMI_DEBUG_36 IOMUX_PAD(0x408, 0x0DC, 6, __NA_, 0, NO_PAD_CTRL)
374#define MX53_PAD_CSI0_DAT7__TPIU_TRACE_4 IOMUX_PAD(0x408, 0x0DC, 7, __NA_, 0, NO_PAD_CTRL)
375#define MX53_PAD_CSI0_DAT8__IPU_CSI0_D_8 IOMUX_PAD(0x40C, 0x0E0, 0, __NA_, 0, NO_PAD_CTRL)
376#define MX53_PAD_CSI0_DAT8__GPIO5_26 IOMUX_PAD(0x40C, 0x0E0, 1, __NA_, 0, NO_PAD_CTRL)
377#define MX53_PAD_CSI0_DAT8__KPP_COL_7 IOMUX_PAD(0x40C, 0x0E0, 2, 0x848, 0, NO_PAD_CTRL)
378#define MX53_PAD_CSI0_DAT8__ECSPI2_SCLK IOMUX_PAD(0x40C, 0x0E0, 3, 0x7B8, 1, NO_PAD_CTRL)
379#define MX53_PAD_CSI0_DAT8__USBOH3_USBH3_OC IOMUX_PAD(0x40C, 0x0E0, 4, __NA_, 0, NO_PAD_CTRL)
380#define MX53_PAD_CSI0_DAT8__I2C1_SDA IOMUX_PAD(0x40C, 0x0E0, 5 | IOMUX_CONFIG_SION, 0x818, 0, NO_PAD_CTRL)
381#define MX53_PAD_CSI0_DAT8__EMI_EMI_DEBUG_37 IOMUX_PAD(0x40C, 0x0E0, 6, __NA_, 0, NO_PAD_CTRL)
382#define MX53_PAD_CSI0_DAT8__TPIU_TRACE_5 IOMUX_PAD(0x40C, 0x0E0, 7, __NA_, 0, NO_PAD_CTRL)
383#define MX53_PAD_CSI0_DAT9__IPU_CSI0_D_9 IOMUX_PAD(0x410, 0x0E4, 0, __NA_, 0, NO_PAD_CTRL)
384#define MX53_PAD_CSI0_DAT9__GPIO5_27 IOMUX_PAD(0x410, 0x0E4, 1, __NA_, 0, NO_PAD_CTRL)
385#define MX53_PAD_CSI0_DAT9__KPP_ROW_7 IOMUX_PAD(0x410, 0x0E4, 2, 0x854, 0, NO_PAD_CTRL)
386#define MX53_PAD_CSI0_DAT9__ECSPI2_MOSI IOMUX_PAD(0x410, 0x0E4, 3, 0x7C0, 1, NO_PAD_CTRL)
387#define MX53_PAD_CSI0_DAT9__USBOH3_USBH3_PWR IOMUX_PAD(0x410, 0x0E4, 4, __NA_, 0, NO_PAD_CTRL)
388#define MX53_PAD_CSI0_DAT9__I2C1_SCL IOMUX_PAD(0x410, 0x0E4, 5 | IOMUX_CONFIG_SION, 0x814, 0, NO_PAD_CTRL)
389#define MX53_PAD_CSI0_DAT9__EMI_EMI_DEBUG_38 IOMUX_PAD(0x410, 0x0E4, 6, __NA_, 0, NO_PAD_CTRL)
390#define MX53_PAD_CSI0_DAT9__TPIU_TRACE_6 IOMUX_PAD(0x410, 0x0E4, 7, __NA_, 0, NO_PAD_CTRL)
391#define MX53_PAD_CSI0_DAT10__IPU_CSI0_D_10 IOMUX_PAD(0x414, 0x0E8, 0, __NA_, 0, NO_PAD_CTRL)
392#define MX53_PAD_CSI0_DAT10__GPIO5_28 IOMUX_PAD(0x414, 0x0E8, 1, __NA_, 0, NO_PAD_CTRL)
393#define MX53_PAD_CSI0_DAT10__UART1_TXD_MUX IOMUX_PAD(0x414, 0x0E8, 2, __NA_, 0, MX53_UART_PAD_CTRL)
394#define MX53_PAD_CSI0_DAT10__ECSPI2_MISO IOMUX_PAD(0x414, 0x0E8, 3, 0x7BC, 1, NO_PAD_CTRL)
395#define MX53_PAD_CSI0_DAT10__AUDMUX_AUD3_RXC IOMUX_PAD(0x414, 0x0E8, 4, __NA_, 0, NO_PAD_CTRL)
396#define MX53_PAD_CSI0_DAT10__SDMA_DEBUG_PC_4 IOMUX_PAD(0x414, 0x0E8, 5, __NA_, 0, NO_PAD_CTRL)
397#define MX53_PAD_CSI0_DAT10__EMI_EMI_DEBUG_39 IOMUX_PAD(0x414, 0x0E8, 6, __NA_, 0, NO_PAD_CTRL)
398#define MX53_PAD_CSI0_DAT10__TPIU_TRACE_7 IOMUX_PAD(0x414, 0x0E8, 7, __NA_, 0, NO_PAD_CTRL)
399#define MX53_PAD_CSI0_DAT11__IPU_CSI0_D_11 IOMUX_PAD(0x418, 0x0EC, 0, __NA_, 0, NO_PAD_CTRL)
400#define MX53_PAD_CSI0_DAT11__GPIO5_29 IOMUX_PAD(0x418, 0x0EC, 1, __NA_, 0, NO_PAD_CTRL)
401#define MX53_PAD_CSI0_DAT11__UART1_RXD_MUX IOMUX_PAD(0x418, 0x0EC, 2, 0x878, 1, MX53_UART_PAD_CTRL)
402#define MX53_PAD_CSI0_DAT11__ECSPI2_SS0 IOMUX_PAD(0x418, 0x0EC, 3, 0x7C4, 1, NO_PAD_CTRL)
403#define MX53_PAD_CSI0_DAT11__AUDMUX_AUD3_RXFS IOMUX_PAD(0x418, 0x0EC, 4, __NA_, 0, NO_PAD_CTRL)
404#define MX53_PAD_CSI0_DAT11__SDMA_DEBUG_PC_5 IOMUX_PAD(0x418, 0x0EC, 5, __NA_, 0, NO_PAD_CTRL)
405#define MX53_PAD_CSI0_DAT11__EMI_EMI_DEBUG_40 IOMUX_PAD(0x418, 0x0EC, 6, __NA_, 0, NO_PAD_CTRL)
406#define MX53_PAD_CSI0_DAT11__TPIU_TRACE_8 IOMUX_PAD(0x418, 0x0EC, 7, __NA_, 0, NO_PAD_CTRL)
407#define MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12 IOMUX_PAD(0x41C, 0x0F0, 0, __NA_, 0, NO_PAD_CTRL)
408#define MX53_PAD_CSI0_DAT12__GPIO5_30 IOMUX_PAD(0x41C, 0x0F0, 1, __NA_, 0, NO_PAD_CTRL)
409#define MX53_PAD_CSI0_DAT12__UART4_TXD_MUX IOMUX_PAD(0x41C, 0x0F0, 2, __NA_, 0, MX53_UART_PAD_CTRL)
410#define MX53_PAD_CSI0_DAT12__USBOH3_USBH3_DATA_0 IOMUX_PAD(0x41C, 0x0F0, 4, __NA_, 0, NO_PAD_CTRL)
411#define MX53_PAD_CSI0_DAT12__SDMA_DEBUG_PC_6 IOMUX_PAD(0x41C, 0x0F0, 5, __NA_, 0, NO_PAD_CTRL)
412#define MX53_PAD_CSI0_DAT12__EMI_EMI_DEBUG_41 IOMUX_PAD(0x41C, 0x0F0, 6, __NA_, 0, NO_PAD_CTRL)
413#define MX53_PAD_CSI0_DAT12__TPIU_TRACE_9 IOMUX_PAD(0x41C, 0x0F0, 7, __NA_, 0, NO_PAD_CTRL)
414#define MX53_PAD_CSI0_DAT13__IPU_CSI0_D_13 IOMUX_PAD(0x420, 0x0F4, 0, __NA_, 0, NO_PAD_CTRL)
415#define MX53_PAD_CSI0_DAT13__GPIO5_31 IOMUX_PAD(0x420, 0x0F4, 1, __NA_, 0, NO_PAD_CTRL)
416#define MX53_PAD_CSI0_DAT13__UART4_RXD_MUX IOMUX_PAD(0x420, 0x0F4, 2, 0x890, 3, MX53_UART_PAD_CTRL)
417#define MX53_PAD_CSI0_DAT13__USBOH3_USBH3_DATA_1 IOMUX_PAD(0x420, 0x0F4, 4, __NA_, 0, NO_PAD_CTRL)
418#define MX53_PAD_CSI0_DAT13__SDMA_DEBUG_PC_7 IOMUX_PAD(0x420, 0x0F4, 5, __NA_, 0, NO_PAD_CTRL)
419#define MX53_PAD_CSI0_DAT13__EMI_EMI_DEBUG_42 IOMUX_PAD(0x420, 0x0F4, 6, __NA_, 0, NO_PAD_CTRL)
420#define MX53_PAD_CSI0_DAT13__TPIU_TRACE_10 IOMUX_PAD(0x420, 0x0F4, 7, __NA_, 0, NO_PAD_CTRL)
421#define MX53_PAD_CSI0_DAT14__IPU_CSI0_D_14 IOMUX_PAD(0x424, 0x0F8, 0, __NA_, 0, NO_PAD_CTRL)
422#define MX53_PAD_CSI0_DAT14__GPIO6_0 IOMUX_PAD(0x424, 0x0F8, 1, __NA_, 0, NO_PAD_CTRL)
423#define MX53_PAD_CSI0_DAT14__UART5_TXD_MUX IOMUX_PAD(0x424, 0x0F8, 2, __NA_, 0, MX53_UART_PAD_CTRL)
424#define MX53_PAD_CSI0_DAT14__USBOH3_USBH3_DATA_2 IOMUX_PAD(0x424, 0x0F8, 4, __NA_, 0, NO_PAD_CTRL)
425#define MX53_PAD_CSI0_DAT14__SDMA_DEBUG_PC_8 IOMUX_PAD(0x424, 0x0F8, 5, __NA_, 0, NO_PAD_CTRL)
426#define MX53_PAD_CSI0_DAT14__EMI_EMI_DEBUG_43 IOMUX_PAD(0x424, 0x0F8, 6, __NA_, 0, NO_PAD_CTRL)
427#define MX53_PAD_CSI0_DAT14__TPIU_TRACE_11 IOMUX_PAD(0x424, 0x0F8, 7, __NA_, 0, NO_PAD_CTRL)
428#define MX53_PAD_CSI0_DAT15__IPU_CSI0_D_15 IOMUX_PAD(0x428, 0x0FC, 0, __NA_, 0, NO_PAD_CTRL)
429#define MX53_PAD_CSI0_DAT15__GPIO6_1 IOMUX_PAD(0x428, 0x0FC, 1, __NA_, 0, NO_PAD_CTRL)
430#define MX53_PAD_CSI0_DAT15__UART5_RXD_MUX IOMUX_PAD(0x428, 0x0FC, 2, 0x898, 3, MX53_UART_PAD_CTRL)
431#define MX53_PAD_CSI0_DAT15__USBOH3_USBH3_DATA_3 IOMUX_PAD(0x428, 0x0FC, 4, __NA_, 0, NO_PAD_CTRL)
432#define MX53_PAD_CSI0_DAT15__SDMA_DEBUG_PC_9 IOMUX_PAD(0x428, 0x0FC, 5, __NA_, 0, NO_PAD_CTRL)
433#define MX53_PAD_CSI0_DAT15__EMI_EMI_DEBUG_44 IOMUX_PAD(0x428, 0x0FC, 6, __NA_, 0, NO_PAD_CTRL)
434#define MX53_PAD_CSI0_DAT15__TPIU_TRACE_12 IOMUX_PAD(0x428, 0x0FC, 7, __NA_, 0, NO_PAD_CTRL)
435#define MX53_PAD_CSI0_DAT16__IPU_CSI0_D_16 IOMUX_PAD(0x42C, 0x100, 0, __NA_, 0, NO_PAD_CTRL)
436#define MX53_PAD_CSI0_DAT16__GPIO6_2 IOMUX_PAD(0x42C, 0x100, 1, __NA_, 0, NO_PAD_CTRL)
437#define MX53_PAD_CSI0_DAT16__UART4_RTS IOMUX_PAD(0x42C, 0x100, 2, 0x88C, 0, MX53_UART_PAD_CTRL)
438#define MX53_PAD_CSI0_DAT16__USBOH3_USBH3_DATA_4 IOMUX_PAD(0x42C, 0x100, 4, __NA_, 0, NO_PAD_CTRL)
439#define MX53_PAD_CSI0_DAT16__SDMA_DEBUG_PC_10 IOMUX_PAD(0x42C, 0x100, 5, __NA_, 0, NO_PAD_CTRL)
440#define MX53_PAD_CSI0_DAT16__EMI_EMI_DEBUG_45 IOMUX_PAD(0x42C, 0x100, 6, __NA_, 0, NO_PAD_CTRL)
441#define MX53_PAD_CSI0_DAT16__TPIU_TRACE_13 IOMUX_PAD(0x42C, 0x100, 7, __NA_, 0, NO_PAD_CTRL)
442#define MX53_PAD_CSI0_DAT17__IPU_CSI0_D_17 IOMUX_PAD(0x430, 0x104, 0, __NA_, 0, NO_PAD_CTRL)
443#define MX53_PAD_CSI0_DAT17__GPIO6_3 IOMUX_PAD(0x430, 0x104, 1, __NA_, 0, NO_PAD_CTRL)
444#define MX53_PAD_CSI0_DAT17__UART4_CTS IOMUX_PAD(0x430, 0x104, 2, __NA_, 0, MX53_UART_PAD_CTRL)
445#define MX53_PAD_CSI0_DAT17__USBOH3_USBH3_DATA_5 IOMUX_PAD(0x430, 0x104, 4, __NA_, 0, NO_PAD_CTRL)
446#define MX53_PAD_CSI0_DAT17__SDMA_DEBUG_PC_11 IOMUX_PAD(0x430, 0x104, 5, __NA_, 0, NO_PAD_CTRL)
447#define MX53_PAD_CSI0_DAT17__EMI_EMI_DEBUG_46 IOMUX_PAD(0x430, 0x104, 6, __NA_, 0, NO_PAD_CTRL)
448#define MX53_PAD_CSI0_DAT17__TPIU_TRACE_14 IOMUX_PAD(0x430, 0x104, 7, __NA_, 0, NO_PAD_CTRL)
449#define MX53_PAD_CSI0_DAT18__IPU_CSI0_D_18 IOMUX_PAD(0x434, 0x108, 0, __NA_, 0, NO_PAD_CTRL)
450#define MX53_PAD_CSI0_DAT18__GPIO6_4 IOMUX_PAD(0x434, 0x108, 1, __NA_, 0, NO_PAD_CTRL)
451#define MX53_PAD_CSI0_DAT18__UART5_RTS IOMUX_PAD(0x434, 0x108, 2, 0x894, 2, MX53_UART_PAD_CTRL)
452#define MX53_PAD_CSI0_DAT18__USBOH3_USBH3_DATA_6 IOMUX_PAD(0x434, 0x108, 4, __NA_, 0, NO_PAD_CTRL)
453#define MX53_PAD_CSI0_DAT18__SDMA_DEBUG_PC_12 IOMUX_PAD(0x434, 0x108, 5, __NA_, 0, NO_PAD_CTRL)
454#define MX53_PAD_CSI0_DAT18__EMI_EMI_DEBUG_47 IOMUX_PAD(0x434, 0x108, 6, __NA_, 0, NO_PAD_CTRL)
455#define MX53_PAD_CSI0_DAT18__TPIU_TRACE_15 IOMUX_PAD(0x434, 0x108, 7, __NA_, 0, NO_PAD_CTRL)
456#define MX53_PAD_CSI0_DAT19__IPU_CSI0_D_19 IOMUX_PAD(0x438, 0x10C, 0, __NA_, 0, NO_PAD_CTRL)
457#define MX53_PAD_CSI0_DAT19__GPIO6_5 IOMUX_PAD(0x438, 0x10C, 1, __NA_, 0, NO_PAD_CTRL)
458#define MX53_PAD_CSI0_DAT19__UART5_CTS IOMUX_PAD(0x438, 0x10C, 2, __NA_, 0, MX53_UART_PAD_CTRL)
459#define MX53_PAD_CSI0_DAT19__USBOH3_USBH3_DATA_7 IOMUX_PAD(0x438, 0x10C, 4, __NA_, 0, NO_PAD_CTRL)
460#define MX53_PAD_CSI0_DAT19__SDMA_DEBUG_PC_13 IOMUX_PAD(0x438, 0x10C, 5, __NA_, 0, NO_PAD_CTRL)
461#define MX53_PAD_CSI0_DAT19__EMI_EMI_DEBUG_48 IOMUX_PAD(0x438, 0x10C, 6, __NA_, 0, NO_PAD_CTRL)
462#define MX53_PAD_CSI0_DAT19__USBPHY2_BISTOK IOMUX_PAD(0x438, 0x10C, 7, __NA_, 0, NO_PAD_CTRL)
463#define MX53_PAD_EIM_A25__EMI_WEIM_A_25 IOMUX_PAD(0x458, 0x110, 0, __NA_, 0, NO_PAD_CTRL)
464#define MX53_PAD_EIM_A25__GPIO5_2 IOMUX_PAD(0x458, 0x110, 1, __NA_, 0, NO_PAD_CTRL)
465#define MX53_PAD_EIM_A25__ECSPI2_RDY IOMUX_PAD(0x458, 0x110, 2, __NA_, 0, NO_PAD_CTRL)
466#define MX53_PAD_EIM_A25__IPU_DI1_PIN12 IOMUX_PAD(0x458, 0x110, 3, __NA_, 0, NO_PAD_CTRL)
467#define MX53_PAD_EIM_A25__CSPI_SS1 IOMUX_PAD(0x458, 0x110, 4, 0x790, 1, NO_PAD_CTRL)
468#define MX53_PAD_EIM_A25__IPU_DI0_D1_CS IOMUX_PAD(0x458, 0x110, 6, __NA_, 0, NO_PAD_CTRL)
469#define MX53_PAD_EIM_A25__USBPHY1_BISTOK IOMUX_PAD(0x458, 0x110, 7, __NA_, 0, NO_PAD_CTRL)
470#define MX53_PAD_EIM_EB2__EMI_WEIM_EB_2 IOMUX_PAD(0x45C, 0x114, 0, __NA_, 0, NO_PAD_CTRL)
471#define MX53_PAD_EIM_EB2__GPIO2_30 IOMUX_PAD(0x45C, 0x114, 1, __NA_, 0, NO_PAD_CTRL)
472#define MX53_PAD_EIM_EB2__CCM_DI1_EXT_CLK IOMUX_PAD(0x45C, 0x114, 2, 0x76C, 0, NO_PAD_CTRL)
473#define MX53_PAD_EIM_EB2__IPU_SER_DISP1_CS IOMUX_PAD(0x45C, 0x114, 3, __NA_, 0, NO_PAD_CTRL)
474#define MX53_PAD_EIM_EB2__ECSPI1_SS0 IOMUX_PAD(0x45C, 0x114, 4, 0x7A8, 3, NO_PAD_CTRL)
475#define MX53_PAD_EIM_EB2__I2C2_SCL IOMUX_PAD(0x45C, 0x114, 5 | IOMUX_CONFIG_SION, 0x81C, 1, NO_PAD_CTRL)
476#define MX53_PAD_EIM_D16__EMI_WEIM_D_16 IOMUX_PAD(0x460, 0x118, 0, __NA_, 0, NO_PAD_CTRL)
477#define MX53_PAD_EIM_D16__GPIO3_16 IOMUX_PAD(0x460, 0x118, 1, __NA_, 0, NO_PAD_CTRL)
478#define MX53_PAD_EIM_D16__IPU_DI0_PIN5 IOMUX_PAD(0x460, 0x118, 2, __NA_, 0, NO_PAD_CTRL)
479#define MX53_PAD_EIM_D16__IPU_DISPB1_SER_CLK IOMUX_PAD(0x460, 0x118, 3, __NA_, 0, NO_PAD_CTRL)
480#define MX53_PAD_EIM_D16__ECSPI1_SCLK IOMUX_PAD(0x460, 0x118, 4, 0x79C, 3, NO_PAD_CTRL)
481#define MX53_PAD_EIM_D16__I2C2_SDA IOMUX_PAD(0x460, 0x118, 5 | IOMUX_CONFIG_SION, 0x820, 1, NO_PAD_CTRL)
482#define MX53_PAD_EIM_D17__EMI_WEIM_D_17 IOMUX_PAD(0x464, 0x11C, 0, __NA_, 0, NO_PAD_CTRL)
483#define MX53_PAD_EIM_D17__GPIO3_17 IOMUX_PAD(0x464, 0x11C, 1, __NA_, 0, NO_PAD_CTRL)
484#define MX53_PAD_EIM_D17__IPU_DI0_PIN6 IOMUX_PAD(0x464, 0x11C, 2, __NA_, 0, NO_PAD_CTRL)
485#define MX53_PAD_EIM_D17__IPU_DISPB1_SER_DIN IOMUX_PAD(0x464, 0x11C, 3, 0x830, 0, NO_PAD_CTRL)
486#define MX53_PAD_EIM_D17__ECSPI1_MISO IOMUX_PAD(0x464, 0x11C, 4, 0x7A0, 3, NO_PAD_CTRL)
487#define MX53_PAD_EIM_D17__I2C3_SCL IOMUX_PAD(0x464, 0x11C, 5 | IOMUX_CONFIG_SION, 0x824, 0, NO_PAD_CTRL)
488#define MX53_PAD_EIM_D18__EMI_WEIM_D_18 IOMUX_PAD(0x468, 0x120, 0, __NA_, 0, NO_PAD_CTRL)
489#define MX53_PAD_EIM_D18__GPIO3_18 IOMUX_PAD(0x468, 0x120, 1, __NA_, 0, NO_PAD_CTRL)
490#define MX53_PAD_EIM_D18__IPU_DI0_PIN7 IOMUX_PAD(0x468, 0x120, 2, __NA_, 0, NO_PAD_CTRL)
491#define MX53_PAD_EIM_D18__IPU_DISPB1_SER_DIO IOMUX_PAD(0x468, 0x120, 3, 0x830, 1, NO_PAD_CTRL)
492#define MX53_PAD_EIM_D18__ECSPI1_MOSI IOMUX_PAD(0x468, 0x120, 4, 0x7A4, 3, NO_PAD_CTRL)
493#define MX53_PAD_EIM_D18__I2C3_SDA IOMUX_PAD(0x468, 0x120, 5 | IOMUX_CONFIG_SION, 0x828, 0, NO_PAD_CTRL)
494#define MX53_PAD_EIM_D18__IPU_DI1_D0_CS IOMUX_PAD(0x468, 0x120, 6, __NA_, 0, NO_PAD_CTRL)
495#define MX53_PAD_EIM_D19__EMI_WEIM_D_19 IOMUX_PAD(0x46C, 0x124, 0, __NA_, 0, NO_PAD_CTRL)
496#define MX53_PAD_EIM_D19__GPIO3_19 IOMUX_PAD(0x46C, 0x124, 1, __NA_, 0, NO_PAD_CTRL)
497#define MX53_PAD_EIM_D19__IPU_DI0_PIN8 IOMUX_PAD(0x46C, 0x124, 2, __NA_, 0, NO_PAD_CTRL)
498#define MX53_PAD_EIM_D19__IPU_DISPB1_SER_RS IOMUX_PAD(0x46C, 0x124, 3, __NA_, 0, NO_PAD_CTRL)
499#define MX53_PAD_EIM_D19__ECSPI1_SS1 IOMUX_PAD(0x46C, 0x124, 4, 0x7AC, 2, NO_PAD_CTRL)
500#define MX53_PAD_EIM_D19__EPIT1_EPITO IOMUX_PAD(0x46C, 0x124, 5, __NA_, 0, NO_PAD_CTRL)
501#define MX53_PAD_EIM_D19__UART1_CTS IOMUX_PAD(0x46C, 0x124, 6, __NA_, 0, MX53_UART_PAD_CTRL)
502#define MX53_PAD_EIM_D19__USBOH3_USBH2_OC IOMUX_PAD(0x46C, 0x124, 7, 0x8A4, 0, NO_PAD_CTRL)
503#define MX53_PAD_EIM_D20__EMI_WEIM_D_20 IOMUX_PAD(0x470, 0x128, 0, __NA_, 0, NO_PAD_CTRL)
504#define MX53_PAD_EIM_D20__GPIO3_20 IOMUX_PAD(0x470, 0x128, 1, __NA_, 0, NO_PAD_CTRL)
505#define MX53_PAD_EIM_D20__IPU_DI0_PIN16 IOMUX_PAD(0x470, 0x128, 2, __NA_, 0, NO_PAD_CTRL)
506#define MX53_PAD_EIM_D20__IPU_SER_DISP0_CS IOMUX_PAD(0x470, 0x128, 3, __NA_, 0, NO_PAD_CTRL)
507#define MX53_PAD_EIM_D20__CSPI_SS0 IOMUX_PAD(0x470, 0x128, 4, 0x78C, 1, NO_PAD_CTRL)
508#define MX53_PAD_EIM_D20__EPIT2_EPITO IOMUX_PAD(0x470, 0x128, 5, __NA_, 0, NO_PAD_CTRL)
509#define MX53_PAD_EIM_D20__UART1_RTS IOMUX_PAD(0x470, 0x128, 6, 0x874, 1, MX53_UART_PAD_CTRL)
510#define MX53_PAD_EIM_D20__USBOH3_USBH2_PWR IOMUX_PAD(0x470, 0x128, 7, __NA_, 0, NO_PAD_CTRL)
511#define MX53_PAD_EIM_D21__EMI_WEIM_D_21 IOMUX_PAD(0x474, 0x12C, 0, __NA_, 0, NO_PAD_CTRL)
512#define MX53_PAD_EIM_D21__GPIO3_21 IOMUX_PAD(0x474, 0x12C, 1, __NA_, 0, NO_PAD_CTRL)
513#define MX53_PAD_EIM_D21__IPU_DI0_PIN17 IOMUX_PAD(0x474, 0x12C, 2, __NA_, 0, NO_PAD_CTRL)
514#define MX53_PAD_EIM_D21__IPU_DISPB0_SER_CLK IOMUX_PAD(0x474, 0x12C, 3, __NA_, 0, NO_PAD_CTRL)
515#define MX53_PAD_EIM_D21__CSPI_SCLK IOMUX_PAD(0x474, 0x12C, 4, 0x780, 1, NO_PAD_CTRL)
516#define MX53_PAD_EIM_D21__I2C1_SCL IOMUX_PAD(0x474, 0x12C, 5 | IOMUX_CONFIG_SION, 0x814, 1, NO_PAD_CTRL)
517#define MX53_PAD_EIM_D21__USBOH3_USBOTG_OC IOMUX_PAD(0x474, 0x12C, 6, 0x89C, 1, NO_PAD_CTRL)
518#define MX53_PAD_EIM_D22__EMI_WEIM_D_22 IOMUX_PAD(0x478, 0x130, 0, __NA_, 0, NO_PAD_CTRL)
519#define MX53_PAD_EIM_D22__GPIO3_22 IOMUX_PAD(0x478, 0x130, 1, __NA_, 0, NO_PAD_CTRL)
520#define MX53_PAD_EIM_D22__IPU_DI0_PIN1 IOMUX_PAD(0x478, 0x130, 2, __NA_, 0, NO_PAD_CTRL)
521#define MX53_PAD_EIM_D22__IPU_DISPB0_SER_DIN IOMUX_PAD(0x478, 0x130, 3, 0x82C, 0, NO_PAD_CTRL)
522#define MX53_PAD_EIM_D22__CSPI_MISO IOMUX_PAD(0x478, 0x130, 4, 0x784, 1, NO_PAD_CTRL)
523#define MX53_PAD_EIM_D22__USBOH3_USBOTG_PWR IOMUX_PAD(0x478, 0x130, 6, __NA_, 0, NO_PAD_CTRL)
524#define MX53_PAD_EIM_D23__EMI_WEIM_D_23 IOMUX_PAD(0x47C, 0x134, 0, __NA_, 0, NO_PAD_CTRL)
525#define MX53_PAD_EIM_D23__GPIO3_23 IOMUX_PAD(0x47C, 0x134, 1, __NA_, 0, NO_PAD_CTRL)
526#define MX53_PAD_EIM_D23__UART3_CTS IOMUX_PAD(0x47C, 0x134, 2, __NA_, 0, MX53_UART_PAD_CTRL)
527#define MX53_PAD_EIM_D23__UART1_DCD IOMUX_PAD(0x47C, 0x134, 3, __NA_, 0, NO_PAD_CTRL)
528#define MX53_PAD_EIM_D23__IPU_DI0_D0_CS IOMUX_PAD(0x47C, 0x134, 4, __NA_, 0, NO_PAD_CTRL)
529#define MX53_PAD_EIM_D23__IPU_DI1_PIN2 IOMUX_PAD(0x47C, 0x134, 5, __NA_, 0, NO_PAD_CTRL)
530#define MX53_PAD_EIM_D23__IPU_CSI1_DATA_EN IOMUX_PAD(0x47C, 0x134, 6, 0x834, 0, NO_PAD_CTRL)
531#define MX53_PAD_EIM_D23__IPU_DI1_PIN14 IOMUX_PAD(0x47C, 0x134, 7, __NA_, 0, NO_PAD_CTRL)
532#define MX53_PAD_EIM_EB3__EMI_WEIM_EB_3 IOMUX_PAD(0x480, 0x138, 0, __NA_, 0, NO_PAD_CTRL)
533#define MX53_PAD_EIM_EB3__GPIO2_31 IOMUX_PAD(0x480, 0x138, 1, __NA_, 0, NO_PAD_CTRL)
534#define MX53_PAD_EIM_EB3__UART3_RTS IOMUX_PAD(0x480, 0x138, 2, 0x884, 1, MX53_UART_PAD_CTRL)
535#define MX53_PAD_EIM_EB3__UART1_RI IOMUX_PAD(0x480, 0x138, 3, __NA_, 0, NO_PAD_CTRL)
536#define MX53_PAD_EIM_EB3__IPU_DI1_PIN3 IOMUX_PAD(0x480, 0x138, 5, __NA_, 0, NO_PAD_CTRL)
537#define MX53_PAD_EIM_EB3__IPU_CSI1_HSYNC IOMUX_PAD(0x480, 0x138, 6, 0x838, 0, NO_PAD_CTRL)
538#define MX53_PAD_EIM_EB3__IPU_DI1_PIN16 IOMUX_PAD(0x480, 0x138, 7, __NA_, 0, NO_PAD_CTRL)
539#define MX53_PAD_EIM_D24__EMI_WEIM_D_24 IOMUX_PAD(0x484, 0x13C, 0, __NA_, 0, NO_PAD_CTRL)
540#define MX53_PAD_EIM_D24__GPIO3_24 IOMUX_PAD(0x484, 0x13C, 1, __NA_, 0, NO_PAD_CTRL)
541#define MX53_PAD_EIM_D24__UART3_TXD_MUX IOMUX_PAD(0x484, 0x13C, 2, __NA_, 0, MX53_UART_PAD_CTRL)
542#define MX53_PAD_EIM_D24__ECSPI1_SS2 IOMUX_PAD(0x484, 0x13C, 3, 0x7B0, 1, NO_PAD_CTRL)
543#define MX53_PAD_EIM_D24__CSPI_SS2 IOMUX_PAD(0x484, 0x13C, 4, 0x794, 1, NO_PAD_CTRL)
544#define MX53_PAD_EIM_D24__AUDMUX_AUD5_RXFS IOMUX_PAD(0x484, 0x13C, 5, 0x754, 1, NO_PAD_CTRL)
545#define MX53_PAD_EIM_D24__ECSPI2_SS2 IOMUX_PAD(0x484, 0x13C, 6, __NA_, 0, NO_PAD_CTRL)
546#define MX53_PAD_EIM_D24__UART1_DTR IOMUX_PAD(0x484, 0x13C, 7, __NA_, 0, NO_PAD_CTRL)
547#define MX53_PAD_EIM_D25__EMI_WEIM_D_25 IOMUX_PAD(0x488, 0x140, 0, __NA_, 0, NO_PAD_CTRL)
548#define MX53_PAD_EIM_D25__GPIO3_25 IOMUX_PAD(0x488, 0x140, 1, __NA_, 0, NO_PAD_CTRL)
549#define MX53_PAD_EIM_D25__UART3_RXD_MUX IOMUX_PAD(0x488, 0x140, 2, 0x888, 1, MX53_UART_PAD_CTRL)
550#define MX53_PAD_EIM_D25__ECSPI1_SS3 IOMUX_PAD(0x488, 0x140, 3, 0x7B4, 1, NO_PAD_CTRL)
551#define MX53_PAD_EIM_D25__CSPI_SS3 IOMUX_PAD(0x488, 0x140, 4, 0x798, 1, NO_PAD_CTRL)
552#define MX53_PAD_EIM_D25__AUDMUX_AUD5_RXC IOMUX_PAD(0x488, 0x140, 5, 0x750, 1, NO_PAD_CTRL)
553#define MX53_PAD_EIM_D25__ECSPI2_SS3 IOMUX_PAD(0x488, 0x140, 6, __NA_, 0, NO_PAD_CTRL)
554#define MX53_PAD_EIM_D25__UART1_DSR IOMUX_PAD(0x488, 0x140, 7, __NA_, 0, NO_PAD_CTRL)
555#define MX53_PAD_EIM_D26__EMI_WEIM_D_26 IOMUX_PAD(0x48C, 0x144, 0, __NA_, 0, NO_PAD_CTRL)
556#define MX53_PAD_EIM_D26__GPIO3_26 IOMUX_PAD(0x48C, 0x144, 1, __NA_, 0, NO_PAD_CTRL)
557#define MX53_PAD_EIM_D26__UART2_TXD_MUX IOMUX_PAD(0x48C, 0x144, 2, __NA_, 0, MX53_UART_PAD_CTRL)
558#define MX53_PAD_EIM_D26__FIRI_RXD IOMUX_PAD(0x48C, 0x144, 3, 0x80C, 0, NO_PAD_CTRL)
559#define MX53_PAD_EIM_D26__IPU_CSI0_D_1 IOMUX_PAD(0x48C, 0x144, 4, __NA_, 0, NO_PAD_CTRL)
560#define MX53_PAD_EIM_D26__IPU_DI1_PIN11 IOMUX_PAD(0x48C, 0x144, 5, __NA_, 0, NO_PAD_CTRL)
561#define MX53_PAD_EIM_D26__IPU_SISG_2 IOMUX_PAD(0x48C, 0x144, 6, __NA_, 0, NO_PAD_CTRL)
562#define MX53_PAD_EIM_D26__IPU_DISP1_DAT_22 IOMUX_PAD(0x48C, 0x144, 7, __NA_, 0, NO_PAD_CTRL)
563#define MX53_PAD_EIM_D27__EMI_WEIM_D_27 IOMUX_PAD(0x490, 0x148, 0, __NA_, 0, NO_PAD_CTRL)
564#define MX53_PAD_EIM_D27__GPIO3_27 IOMUX_PAD(0x490, 0x148, 1, __NA_, 0, NO_PAD_CTRL)
565#define MX53_PAD_EIM_D27__UART2_RXD_MUX IOMUX_PAD(0x490, 0x148, 2, 0x880, 1, MX53_UART_PAD_CTRL)
566#define MX53_PAD_EIM_D27__FIRI_TXD IOMUX_PAD(0x490, 0x148, 3, __NA_, 0, NO_PAD_CTRL)
567#define MX53_PAD_EIM_D27__IPU_CSI0_D_0 IOMUX_PAD(0x490, 0x148, 4, __NA_, 0, NO_PAD_CTRL)
568#define MX53_PAD_EIM_D27__IPU_DI1_PIN13 IOMUX_PAD(0x490, 0x148, 5, __NA_, 0, NO_PAD_CTRL)
569#define MX53_PAD_EIM_D27__IPU_SISG_3 IOMUX_PAD(0x490, 0x148, 6, __NA_, 0, NO_PAD_CTRL)
570#define MX53_PAD_EIM_D27__IPU_DISP1_DAT_23 IOMUX_PAD(0x490, 0x148, 7, __NA_, 0, NO_PAD_CTRL)
571#define MX53_PAD_EIM_D28__EMI_WEIM_D_28 IOMUX_PAD(0x494, 0x14C, 0, __NA_, 0, NO_PAD_CTRL)
572#define MX53_PAD_EIM_D28__GPIO3_28 IOMUX_PAD(0x494, 0x14C, 1, __NA_, 0, NO_PAD_CTRL)
573#define MX53_PAD_EIM_D28__UART2_CTS IOMUX_PAD(0x494, 0x14C, 2, __NA_, 0, MX53_UART_PAD_CTRL)
574#define MX53_PAD_EIM_D28__IPU_DISPB0_SER_DIO IOMUX_PAD(0x494, 0x14C, 3, 0x82C, 1, NO_PAD_CTRL)
575#define MX53_PAD_EIM_D28__CSPI_MOSI IOMUX_PAD(0x494, 0x14C, 4, 0x788, 1, NO_PAD_CTRL)
576#define MX53_PAD_EIM_D28__I2C1_SDA IOMUX_PAD(0x494, 0x14C, 5 | IOMUX_CONFIG_SION, 0x818, 1, NO_PAD_CTRL)
577#define MX53_PAD_EIM_D28__IPU_EXT_TRIG IOMUX_PAD(0x494, 0x14C, 6, __NA_, 0, NO_PAD_CTRL)
578#define MX53_PAD_EIM_D28__IPU_DI0_PIN13 IOMUX_PAD(0x494, 0x14C, 7, __NA_, 0, NO_PAD_CTRL)
579#define MX53_PAD_EIM_D29__EMI_WEIM_D_29 IOMUX_PAD(0x498, 0x150, 0, __NA_, 0, NO_PAD_CTRL)
580#define MX53_PAD_EIM_D29__GPIO3_29 IOMUX_PAD(0x498, 0x150, 1, __NA_, 0, NO_PAD_CTRL)
581#define MX53_PAD_EIM_D29__UART2_RTS IOMUX_PAD(0x498, 0x150, 2, 0x87C, 1, MX53_UART_PAD_CTRL)
582#define MX53_PAD_EIM_D29__IPU_DISPB0_SER_RS IOMUX_PAD(0x498, 0x150, 3, __NA_, 0, NO_PAD_CTRL)
583#define MX53_PAD_EIM_D29__CSPI_SS0 IOMUX_PAD(0x498, 0x150, 4, 0x78C, 2, NO_PAD_CTRL)
584#define MX53_PAD_EIM_D29__IPU_DI1_PIN15 IOMUX_PAD(0x498, 0x150, 5, __NA_, 0, NO_PAD_CTRL)
585#define MX53_PAD_EIM_D29__IPU_CSI1_VSYNC IOMUX_PAD(0x498, 0x150, 6, 0x83C, 0, NO_PAD_CTRL)
586#define MX53_PAD_EIM_D29__IPU_DI0_PIN14 IOMUX_PAD(0x498, 0x150, 7, __NA_, 0, NO_PAD_CTRL)
587#define MX53_PAD_EIM_D30__EMI_WEIM_D_30 IOMUX_PAD(0x49C, 0x154, 0, __NA_, 0, NO_PAD_CTRL)
588#define MX53_PAD_EIM_D30__GPIO3_30 IOMUX_PAD(0x49C, 0x154, 1, __NA_, 0, NO_PAD_CTRL)
589#define MX53_PAD_EIM_D30__UART3_CTS IOMUX_PAD(0x49C, 0x154, 2, __NA_, 0, MX53_UART_PAD_CTRL)
590#define MX53_PAD_EIM_D30__IPU_CSI0_D_3 IOMUX_PAD(0x49C, 0x154, 3, __NA_, 0, NO_PAD_CTRL)
591#define MX53_PAD_EIM_D30__IPU_DI0_PIN11 IOMUX_PAD(0x49C, 0x154, 4, __NA_, 0, NO_PAD_CTRL)
592#define MX53_PAD_EIM_D30__IPU_DISP1_DAT_21 IOMUX_PAD(0x49C, 0x154, 5, __NA_, 0, NO_PAD_CTRL)
593#define MX53_PAD_EIM_D30__USBOH3_USBH1_OC IOMUX_PAD(0x49C, 0x154, 6, 0x8A0, 0, NO_PAD_CTRL)
594#define MX53_PAD_EIM_D30__USBOH3_USBH2_OC IOMUX_PAD(0x49C, 0x154, 7, 0x8A4, 1, NO_PAD_CTRL)
595#define MX53_PAD_EIM_D31__EMI_WEIM_D_31 IOMUX_PAD(0x4A0, 0x158, 0, __NA_, 0, NO_PAD_CTRL)
596#define MX53_PAD_EIM_D31__GPIO3_31 IOMUX_PAD(0x4A0, 0x158, 1, __NA_, 0, NO_PAD_CTRL)
597#define MX53_PAD_EIM_D31__UART3_RTS IOMUX_PAD(0x4A0, 0x158, 2, 0x884, 3, MX53_UART_PAD_CTRL)
598#define MX53_PAD_EIM_D31__IPU_CSI0_D_2 IOMUX_PAD(0x4A0, 0x158, 3, __NA_, 0, NO_PAD_CTRL)
599#define MX53_PAD_EIM_D31__IPU_DI0_PIN12 IOMUX_PAD(0x4A0, 0x158, 4, __NA_, 0, NO_PAD_CTRL)
600#define MX53_PAD_EIM_D31__IPU_DISP1_DAT_20 IOMUX_PAD(0x4A0, 0x158, 5, __NA_, 0, NO_PAD_CTRL)
601#define MX53_PAD_EIM_D31__USBOH3_USBH1_PWR IOMUX_PAD(0x4A0, 0x158, 6, __NA_, 0, NO_PAD_CTRL)
602#define MX53_PAD_EIM_D31__USBOH3_USBH2_PWR IOMUX_PAD(0x4A0, 0x158, 7, __NA_, 0, NO_PAD_CTRL)
603#define MX53_PAD_EIM_A24__EMI_WEIM_A_24 IOMUX_PAD(0x4A8, 0x15C, 0, __NA_, 0, NO_PAD_CTRL)
604#define MX53_PAD_EIM_A24__GPIO5_4 IOMUX_PAD(0x4A8, 0x15C, 1, __NA_, 0, NO_PAD_CTRL)
605#define MX53_PAD_EIM_A24__IPU_DISP1_DAT_19 IOMUX_PAD(0x4A8, 0x15C, 2, __NA_, 0, NO_PAD_CTRL)
606#define MX53_PAD_EIM_A24__IPU_CSI1_D_19 IOMUX_PAD(0x4A8, 0x15C, 3, __NA_, 0, NO_PAD_CTRL)
607#define MX53_PAD_EIM_A24__IPU_SISG_2 IOMUX_PAD(0x4A8, 0x15C, 6, __NA_, 0, NO_PAD_CTRL)
608#define MX53_PAD_EIM_A24__USBPHY2_BVALID IOMUX_PAD(0x4A8, 0x15C, 7, __NA_, 0, NO_PAD_CTRL)
609#define MX53_PAD_EIM_A23__EMI_WEIM_A_23 IOMUX_PAD(0x4AC, 0x160, 0, __NA_, 0, NO_PAD_CTRL)
610#define MX53_PAD_EIM_A23__GPIO6_6 IOMUX_PAD(0x4AC, 0x160, 1, __NA_, 0, NO_PAD_CTRL)
611#define MX53_PAD_EIM_A23__IPU_DISP1_DAT_18 IOMUX_PAD(0x4AC, 0x160, 2, __NA_, 0, NO_PAD_CTRL)
612#define MX53_PAD_EIM_A23__IPU_CSI1_D_18 IOMUX_PAD(0x4AC, 0x160, 3, __NA_, 0, NO_PAD_CTRL)
613#define MX53_PAD_EIM_A23__IPU_SISG_3 IOMUX_PAD(0x4AC, 0x160, 6, __NA_, 0, NO_PAD_CTRL)
614#define MX53_PAD_EIM_A23__USBPHY2_ENDSESSION IOMUX_PAD(0x4AC, 0x160, 7, __NA_, 0, NO_PAD_CTRL)
615#define MX53_PAD_EIM_A22__EMI_WEIM_A_22 IOMUX_PAD(0x4B0, 0x164, 0, __NA_, 0, NO_PAD_CTRL)
616#define MX53_PAD_EIM_A22__GPIO2_16 IOMUX_PAD(0x4B0, 0x164, 1, __NA_, 0, NO_PAD_CTRL)
617#define MX53_PAD_EIM_A22__IPU_DISP1_DAT_17 IOMUX_PAD(0x4B0, 0x164, 2, __NA_, 0, NO_PAD_CTRL)
618#define MX53_PAD_EIM_A22__IPU_CSI1_D_17 IOMUX_PAD(0x4B0, 0x164, 3, __NA_, 0, NO_PAD_CTRL)
619#define MX53_PAD_EIM_A22__SRC_BT_CFG1_7 IOMUX_PAD(0x4B0, 0x164, 7, __NA_, 0, NO_PAD_CTRL)
620#define MX53_PAD_EIM_A21__EMI_WEIM_A_21 IOMUX_PAD(0x4B4, 0x168, 0, __NA_, 0, NO_PAD_CTRL)
621#define MX53_PAD_EIM_A21__GPIO2_17 IOMUX_PAD(0x4B4, 0x168, 1, __NA_, 0, NO_PAD_CTRL)
622#define MX53_PAD_EIM_A21__IPU_DISP1_DAT_16 IOMUX_PAD(0x4B4, 0x168, 2, __NA_, 0, NO_PAD_CTRL)
623#define MX53_PAD_EIM_A21__IPU_CSI1_D_16 IOMUX_PAD(0x4B4, 0x168, 3, __NA_, 0, NO_PAD_CTRL)
624#define MX53_PAD_EIM_A21__SRC_BT_CFG1_6 IOMUX_PAD(0x4B4, 0x168, 7, __NA_, 0, NO_PAD_CTRL)
625#define MX53_PAD_EIM_A20__EMI_WEIM_A_20 IOMUX_PAD(0x4B8, 0x16C, 0, __NA_, 0, NO_PAD_CTRL)
626#define MX53_PAD_EIM_A20__GPIO2_18 IOMUX_PAD(0x4B8, 0x16C, 1, __NA_, 0, NO_PAD_CTRL)
627#define MX53_PAD_EIM_A20__IPU_DISP1_DAT_15 IOMUX_PAD(0x4B8, 0x16C, 2, __NA_, 0, NO_PAD_CTRL)
628#define MX53_PAD_EIM_A20__IPU_CSI1_D_15 IOMUX_PAD(0x4B8, 0x16C, 3, __NA_, 0, NO_PAD_CTRL)
629#define MX53_PAD_EIM_A20__SRC_BT_CFG1_5 IOMUX_PAD(0x4B8, 0x16C, 7, __NA_, 0, NO_PAD_CTRL)
630#define MX53_PAD_EIM_A19__EMI_WEIM_A_19 IOMUX_PAD(0x4BC, 0x170, 0, __NA_, 0, NO_PAD_CTRL)
631#define MX53_PAD_EIM_A19__GPIO2_19 IOMUX_PAD(0x4BC, 0x170, 1, __NA_, 0, NO_PAD_CTRL)
632#define MX53_PAD_EIM_A19__IPU_DISP1_DAT_14 IOMUX_PAD(0x4BC, 0x170, 2, __NA_, 0, NO_PAD_CTRL)
633#define MX53_PAD_EIM_A19__IPU_CSI1_D_14 IOMUX_PAD(0x4BC, 0x170, 3, __NA_, 0, NO_PAD_CTRL)
634#define MX53_PAD_EIM_A19__SRC_BT_CFG1_4 IOMUX_PAD(0x4BC, 0x170, 7, __NA_, 0, NO_PAD_CTRL)
635#define MX53_PAD_EIM_A18__EMI_WEIM_A_18 IOMUX_PAD(0x4C0, 0x174, 0, __NA_, 0, NO_PAD_CTRL)
636#define MX53_PAD_EIM_A18__GPIO2_20 IOMUX_PAD(0x4C0, 0x174, 1, __NA_, 0, NO_PAD_CTRL)
637#define MX53_PAD_EIM_A18__IPU_DISP1_DAT_13 IOMUX_PAD(0x4C0, 0x174, 2, __NA_, 0, NO_PAD_CTRL)
638#define MX53_PAD_EIM_A18__IPU_CSI1_D_13 IOMUX_PAD(0x4C0, 0x174, 3, __NA_, 0, NO_PAD_CTRL)
639#define MX53_PAD_EIM_A18__SRC_BT_CFG1_3 IOMUX_PAD(0x4C0, 0x174, 7, __NA_, 0, NO_PAD_CTRL)
640#define MX53_PAD_EIM_A17__EMI_WEIM_A_17 IOMUX_PAD(0x4C4, 0x178, 0, __NA_, 0, NO_PAD_CTRL)
641#define MX53_PAD_EIM_A17__GPIO2_21 IOMUX_PAD(0x4C4, 0x178, 1, __NA_, 0, NO_PAD_CTRL)
642#define MX53_PAD_EIM_A17__IPU_DISP1_DAT_12 IOMUX_PAD(0x4C4, 0x178, 2, __NA_, 0, NO_PAD_CTRL)
643#define MX53_PAD_EIM_A17__IPU_CSI1_D_12 IOMUX_PAD(0x4C4, 0x178, 3, __NA_, 0, NO_PAD_CTRL)
644#define MX53_PAD_EIM_A17__SRC_BT_CFG1_2 IOMUX_PAD(0x4C4, 0x178, 7, __NA_, 0, NO_PAD_CTRL)
645#define MX53_PAD_EIM_A16__EMI_WEIM_A_16 IOMUX_PAD(0x4C8, 0x17C, 0, __NA_, 0, NO_PAD_CTRL)
646#define MX53_PAD_EIM_A16__GPIO2_22 IOMUX_PAD(0x4C8, 0x17C, 1, __NA_, 0, NO_PAD_CTRL)
647#define MX53_PAD_EIM_A16__IPU_DI1_DISP_CLK IOMUX_PAD(0x4C8, 0x17C, 2, __NA_, 0, NO_PAD_CTRL)
648#define MX53_PAD_EIM_A16__IPU_CSI1_PIXCLK IOMUX_PAD(0x4C8, 0x17C, 3, __NA_, 0, NO_PAD_CTRL)
649#define MX53_PAD_EIM_A16__SRC_BT_CFG1_1 IOMUX_PAD(0x4C8, 0x17C, 7, __NA_, 0, NO_PAD_CTRL)
650#define MX53_PAD_EIM_CS0__EMI_WEIM_CS_0 IOMUX_PAD(0x4CC, 0x180, 0, __NA_, 0, NO_PAD_CTRL)
651#define MX53_PAD_EIM_CS0__GPIO2_23 IOMUX_PAD(0x4CC, 0x180, 1, __NA_, 0, NO_PAD_CTRL)
652#define MX53_PAD_EIM_CS0__ECSPI2_SCLK IOMUX_PAD(0x4CC, 0x180, 2, 0x7B8, 2, NO_PAD_CTRL)
653#define MX53_PAD_EIM_CS0__IPU_DI1_PIN5 IOMUX_PAD(0x4CC, 0x180, 3, __NA_, 0, NO_PAD_CTRL)
654#define MX53_PAD_EIM_CS1__EMI_WEIM_CS_1 IOMUX_PAD(0x4D0, 0x184, 0, __NA_, 0, NO_PAD_CTRL)
655#define MX53_PAD_EIM_CS1__GPIO2_24 IOMUX_PAD(0x4D0, 0x184, 1, __NA_, 0, NO_PAD_CTRL)
656#define MX53_PAD_EIM_CS1__ECSPI2_MOSI IOMUX_PAD(0x4D0, 0x184, 2, 0x7C0, 2, NO_PAD_CTRL)
657#define MX53_PAD_EIM_CS1__IPU_DI1_PIN6 IOMUX_PAD(0x4D0, 0x184, 3, __NA_, 0, NO_PAD_CTRL)
658#define MX53_PAD_EIM_OE__EMI_WEIM_OE IOMUX_PAD(0x4D4, 0x188, 0, __NA_, 0, NO_PAD_CTRL)
659#define MX53_PAD_EIM_OE__GPIO2_25 IOMUX_PAD(0x4D4, 0x188, 1, __NA_, 0, NO_PAD_CTRL)
660#define MX53_PAD_EIM_OE__ECSPI2_MISO IOMUX_PAD(0x4D4, 0x188, 2, 0x7BC, 2, NO_PAD_CTRL)
661#define MX53_PAD_EIM_OE__IPU_DI1_PIN7 IOMUX_PAD(0x4D4, 0x188, 3, __NA_, 0, NO_PAD_CTRL)
662#define MX53_PAD_EIM_OE__USBPHY2_IDDIG IOMUX_PAD(0x4D4, 0x188, 7, __NA_, 0, NO_PAD_CTRL)
663#define MX53_PAD_EIM_RW__EMI_WEIM_RW IOMUX_PAD(0x4D8, 0x18C, 0, __NA_, 0, NO_PAD_CTRL)
664#define MX53_PAD_EIM_RW__GPIO2_26 IOMUX_PAD(0x4D8, 0x18C, 1, __NA_, 0, NO_PAD_CTRL)
665#define MX53_PAD_EIM_RW__ECSPI2_SS0 IOMUX_PAD(0x4D8, 0x18C, 2, 0x7C4, 2, NO_PAD_CTRL)
666#define MX53_PAD_EIM_RW__IPU_DI1_PIN8 IOMUX_PAD(0x4D8, 0x18C, 3, __NA_, 0, NO_PAD_CTRL)
667#define MX53_PAD_EIM_RW__USBPHY2_HOSTDISCONNECT IOMUX_PAD(0x4D8, 0x18C, 7, __NA_, 0, NO_PAD_CTRL)
668#define MX53_PAD_EIM_LBA__EMI_WEIM_LBA IOMUX_PAD(0x4DC, 0x190, 0, __NA_, 0, NO_PAD_CTRL)
669#define MX53_PAD_EIM_LBA__GPIO2_27 IOMUX_PAD(0x4DC, 0x190, 1, __NA_, 0, NO_PAD_CTRL)
670#define MX53_PAD_EIM_LBA__ECSPI2_SS1 IOMUX_PAD(0x4DC, 0x190, 2, 0x7C8, 1, NO_PAD_CTRL)
671#define MX53_PAD_EIM_LBA__IPU_DI1_PIN17 IOMUX_PAD(0x4DC, 0x190, 3, __NA_, 0, NO_PAD_CTRL)
672#define MX53_PAD_EIM_LBA__SRC_BT_CFG1_0 IOMUX_PAD(0x4DC, 0x190, 7, __NA_, 0, NO_PAD_CTRL)
673#define MX53_PAD_EIM_EB0__EMI_WEIM_EB_0 IOMUX_PAD(0x4E4, 0x194, 0, __NA_, 0, NO_PAD_CTRL)
674#define MX53_PAD_EIM_EB0__GPIO2_28 IOMUX_PAD(0x4E4, 0x194, 1, __NA_, 0, NO_PAD_CTRL)
675#define MX53_PAD_EIM_EB0__IPU_DISP1_DAT_11 IOMUX_PAD(0x4E4, 0x194, 3, __NA_, 0, NO_PAD_CTRL)
676#define MX53_PAD_EIM_EB0__IPU_CSI1_D_11 IOMUX_PAD(0x4E4, 0x194, 4, __NA_, 0, NO_PAD_CTRL)
677#define MX53_PAD_EIM_EB0__GPC_PMIC_RDY IOMUX_PAD(0x4E4, 0x194, 5, 0x810, 0, NO_PAD_CTRL)
678#define MX53_PAD_EIM_EB0__SRC_BT_CFG2_7 IOMUX_PAD(0x4E4, 0x194, 7, __NA_, 0, NO_PAD_CTRL)
679#define MX53_PAD_EIM_EB1__EMI_WEIM_EB_1 IOMUX_PAD(0x4E8, 0x198, 0, __NA_, 0, NO_PAD_CTRL)
680#define MX53_PAD_EIM_EB1__GPIO2_29 IOMUX_PAD(0x4E8, 0x198, 1, __NA_, 0, NO_PAD_CTRL)
681#define MX53_PAD_EIM_EB1__IPU_DISP1_DAT_10 IOMUX_PAD(0x4E8, 0x198, 3, __NA_, 0, NO_PAD_CTRL)
682#define MX53_PAD_EIM_EB1__IPU_CSI1_D_10 IOMUX_PAD(0x4E8, 0x198, 4, __NA_, 0, NO_PAD_CTRL)
683#define MX53_PAD_EIM_EB1__SRC_BT_CFG2_6 IOMUX_PAD(0x4E8, 0x198, 7, __NA_, 0, NO_PAD_CTRL)
684#define MX53_PAD_EIM_DA0__EMI_NAND_WEIM_DA_0 IOMUX_PAD(0x4EC, 0x19C, 0, __NA_, 0, NO_PAD_CTRL)
685#define MX53_PAD_EIM_DA0__GPIO3_0 IOMUX_PAD(0x4EC, 0x19C, 1, __NA_, 0, NO_PAD_CTRL)
686#define MX53_PAD_EIM_DA0__IPU_DISP1_DAT_9 IOMUX_PAD(0x4EC, 0x19C, 3, __NA_, 0, NO_PAD_CTRL)
687#define MX53_PAD_EIM_DA0__IPU_CSI1_D_9 IOMUX_PAD(0x4EC, 0x19C, 4, __NA_, 0, NO_PAD_CTRL)
688#define MX53_PAD_EIM_DA0__SRC_BT_CFG2_5 IOMUX_PAD(0x4EC, 0x19C, 7, __NA_, 0, NO_PAD_CTRL)
689#define MX53_PAD_EIM_DA1__EMI_NAND_WEIM_DA_1 IOMUX_PAD(0x4F0, 0x1A0, 0, __NA_, 0, NO_PAD_CTRL)
690#define MX53_PAD_EIM_DA1__GPIO3_1 IOMUX_PAD(0x4F0, 0x1A0, 1, __NA_, 0, NO_PAD_CTRL)
691#define MX53_PAD_EIM_DA1__IPU_DISP1_DAT_8 IOMUX_PAD(0x4F0, 0x1A0, 3, __NA_, 0, NO_PAD_CTRL)
692#define MX53_PAD_EIM_DA1__IPU_CSI1_D_8 IOMUX_PAD(0x4F0, 0x1A0, 4, __NA_, 0, NO_PAD_CTRL)
693#define MX53_PAD_EIM_DA1__SRC_BT_CFG2_4 IOMUX_PAD(0x4F0, 0x1A0, 7, __NA_, 0, NO_PAD_CTRL)
694#define MX53_PAD_EIM_DA2__EMI_NAND_WEIM_DA_2 IOMUX_PAD(0x4F4, 0x1A4, 0, __NA_, 0, NO_PAD_CTRL)
695#define MX53_PAD_EIM_DA2__GPIO3_2 IOMUX_PAD(0x4F4, 0x1A4, 1, __NA_, 0, NO_PAD_CTRL)
696#define MX53_PAD_EIM_DA2__IPU_DISP1_DAT_7 IOMUX_PAD(0x4F4, 0x1A4, 3, __NA_, 0, NO_PAD_CTRL)
697#define MX53_PAD_EIM_DA2__IPU_CSI1_D_7 IOMUX_PAD(0x4F4, 0x1A4, 4, __NA_, 0, NO_PAD_CTRL)
698#define MX53_PAD_EIM_DA2__SRC_BT_CFG2_3 IOMUX_PAD(0x4F4, 0x1A4, 7, __NA_, 0, NO_PAD_CTRL)
699#define MX53_PAD_EIM_DA3__EMI_NAND_WEIM_DA_3 IOMUX_PAD(0x4F8, 0x1A8, 0, __NA_, 0, NO_PAD_CTRL)
700#define MX53_PAD_EIM_DA3__GPIO3_3 IOMUX_PAD(0x4F8, 0x1A8, 1, __NA_, 0, NO_PAD_CTRL)
701#define MX53_PAD_EIM_DA3__IPU_DISP1_DAT_6 IOMUX_PAD(0x4F8, 0x1A8, 3, __NA_, 0, NO_PAD_CTRL)
702#define MX53_PAD_EIM_DA3__IPU_CSI1_D_6 IOMUX_PAD(0x4F8, 0x1A8, 4, __NA_, 0, NO_PAD_CTRL)
703#define MX53_PAD_EIM_DA3__SRC_BT_CFG2_2 IOMUX_PAD(0x4F8, 0x1A8, 7, __NA_, 0, NO_PAD_CTRL)
704#define MX53_PAD_EIM_DA4__EMI_NAND_WEIM_DA_4 IOMUX_PAD(0x4FC, 0x1AC, 0, __NA_, 0, NO_PAD_CTRL)
705#define MX53_PAD_EIM_DA4__GPIO3_4 IOMUX_PAD(0x4FC, 0x1AC, 1, __NA_, 0, NO_PAD_CTRL)
706#define MX53_PAD_EIM_DA4__IPU_DISP1_DAT_5 IOMUX_PAD(0x4FC, 0x1AC, 3, __NA_, 0, NO_PAD_CTRL)
707#define MX53_PAD_EIM_DA4__IPU_CSI1_D_5 IOMUX_PAD(0x4FC, 0x1AC, 4, __NA_, 0, NO_PAD_CTRL)
708#define MX53_PAD_EIM_DA4__SRC_BT_CFG3_7 IOMUX_PAD(0x4FC, 0x1AC, 7, __NA_, 0, NO_PAD_CTRL)
709#define MX53_PAD_EIM_DA5__EMI_NAND_WEIM_DA_5 IOMUX_PAD(0x500, 0x1B0, 0, __NA_, 0, NO_PAD_CTRL)
710#define MX53_PAD_EIM_DA5__GPIO3_5 IOMUX_PAD(0x500, 0x1B0, 1, __NA_, 0, NO_PAD_CTRL)
711#define MX53_PAD_EIM_DA5__IPU_DISP1_DAT_4 IOMUX_PAD(0x500, 0x1B0, 3, __NA_, 0, NO_PAD_CTRL)
712#define MX53_PAD_EIM_DA5__IPU_CSI1_D_4 IOMUX_PAD(0x500, 0x1B0, 4, __NA_, 0, NO_PAD_CTRL)
713#define MX53_PAD_EIM_DA5__SRC_BT_CFG3_6 IOMUX_PAD(0x500, 0x1B0, 7 | IOMUX_CONFIG_SION, __NA_, 0, NO_PAD_CTRL)
714#define MX53_PAD_EIM_DA6__EMI_NAND_WEIM_DA_6 IOMUX_PAD(0x504, 0x1B4, 0, __NA_, 0, NO_PAD_CTRL)
715#define MX53_PAD_EIM_DA6__GPIO3_6 IOMUX_PAD(0x504, 0x1B4, 1, __NA_, 0, NO_PAD_CTRL)
716#define MX53_PAD_EIM_DA6__IPU_DISP1_DAT_3 IOMUX_PAD(0x504, 0x1B4, 3, __NA_, 0, NO_PAD_CTRL)
717#define MX53_PAD_EIM_DA6__IPU_CSI1_D_3 IOMUX_PAD(0x504, 0x1B4, 4, __NA_, 0, NO_PAD_CTRL)
718#define MX53_PAD_EIM_DA6__SRC_BT_CFG3_5 IOMUX_PAD(0x504, 0x1B4, 7, __NA_, 0, NO_PAD_CTRL)
719#define MX53_PAD_EIM_DA7__EMI_NAND_WEIM_DA_7 IOMUX_PAD(0x508, 0x1B8, 0, __NA_, 0, NO_PAD_CTRL)
720#define MX53_PAD_EIM_DA7__GPIO3_7 IOMUX_PAD(0x508, 0x1B8, 1, __NA_, 0, NO_PAD_CTRL)
721#define MX53_PAD_EIM_DA7__IPU_DISP1_DAT_2 IOMUX_PAD(0x508, 0x1B8, 3, __NA_, 0, NO_PAD_CTRL)
722#define MX53_PAD_EIM_DA7__IPU_CSI1_D_2 IOMUX_PAD(0x508, 0x1B8, 4, __NA_, 0, NO_PAD_CTRL)
723#define MX53_PAD_EIM_DA7__SRC_BT_CFG3_4 IOMUX_PAD(0x508, 0x1B8, 7, __NA_, 0, NO_PAD_CTRL)
724#define MX53_PAD_EIM_DA8__EMI_NAND_WEIM_DA_8 IOMUX_PAD(0x50C, 0x1BC, 0, __NA_, 0, NO_PAD_CTRL)
725#define MX53_PAD_EIM_DA8__GPIO3_8 IOMUX_PAD(0x50C, 0x1BC, 1, __NA_, 0, NO_PAD_CTRL)
726#define MX53_PAD_EIM_DA8__IPU_DISP1_DAT_1 IOMUX_PAD(0x50C, 0x1BC, 3, __NA_, 0, NO_PAD_CTRL)
727#define MX53_PAD_EIM_DA8__IPU_CSI1_D_1 IOMUX_PAD(0x50C, 0x1BC, 4, __NA_, 0, NO_PAD_CTRL)
728#define MX53_PAD_EIM_DA8__SRC_BT_CFG3_3 IOMUX_PAD(0x50C, 0x1BC, 7, __NA_, 0, NO_PAD_CTRL)
729#define MX53_PAD_EIM_DA9__EMI_NAND_WEIM_DA_9 IOMUX_PAD(0x510, 0x1C0, 0, __NA_, 0, NO_PAD_CTRL)
730#define MX53_PAD_EIM_DA9__GPIO3_9 IOMUX_PAD(0x510, 0x1C0, 1, __NA_, 0, NO_PAD_CTRL)
731#define MX53_PAD_EIM_DA9__IPU_DISP1_DAT_0 IOMUX_PAD(0x510, 0x1C0, 3, __NA_, 0, NO_PAD_CTRL)
732#define MX53_PAD_EIM_DA9__IPU_CSI1_D_0 IOMUX_PAD(0x510, 0x1C0, 4, __NA_, 0, NO_PAD_CTRL)
733#define MX53_PAD_EIM_DA9__SRC_BT_CFG3_2 IOMUX_PAD(0x510, 0x1C0, 7, __NA_, 0, NO_PAD_CTRL)
734#define MX53_PAD_EIM_DA10__EMI_NAND_WEIM_DA_10 IOMUX_PAD(0x514, 0x1C4, 0, __NA_, 0, NO_PAD_CTRL)
735#define MX53_PAD_EIM_DA10__GPIO3_10 IOMUX_PAD(0x514, 0x1C4, 1, __NA_, 0, NO_PAD_CTRL)
736#define MX53_PAD_EIM_DA10__IPU_DI1_PIN15 IOMUX_PAD(0x514, 0x1C4, 3, __NA_, 0, NO_PAD_CTRL)
737#define MX53_PAD_EIM_DA10__IPU_CSI1_DATA_EN IOMUX_PAD(0x514, 0x1C4, 4, 0x834, 1, NO_PAD_CTRL)
738#define MX53_PAD_EIM_DA10__SRC_BT_CFG3_1 IOMUX_PAD(0x514, 0x1C4, 7, __NA_, 0, NO_PAD_CTRL)
739#define MX53_PAD_EIM_DA11__EMI_NAND_WEIM_DA_11 IOMUX_PAD(0x518, 0x1C8, 0, __NA_, 0, NO_PAD_CTRL)
740#define MX53_PAD_EIM_DA11__GPIO3_11 IOMUX_PAD(0x518, 0x1C8, 1, __NA_, 0, NO_PAD_CTRL)
741#define MX53_PAD_EIM_DA11__IPU_DI1_PIN2 IOMUX_PAD(0x518, 0x1C8, 3, __NA_, 0, NO_PAD_CTRL)
742#define MX53_PAD_EIM_DA11__IPU_CSI1_HSYNC IOMUX_PAD(0x518, 0x1C8, 4, 0x838, 1, NO_PAD_CTRL)
743#define MX53_PAD_EIM_DA12__EMI_NAND_WEIM_DA_12 IOMUX_PAD(0x51C, 0x1CC, 0, __NA_, 0, NO_PAD_CTRL)
744#define MX53_PAD_EIM_DA12__GPIO3_12 IOMUX_PAD(0x51C, 0x1CC, 1, __NA_, 0, NO_PAD_CTRL)
745#define MX53_PAD_EIM_DA12__IPU_DI1_PIN3 IOMUX_PAD(0x51C, 0x1CC, 3, __NA_, 0, NO_PAD_CTRL)
746#define MX53_PAD_EIM_DA12__IPU_CSI1_VSYNC IOMUX_PAD(0x51C, 0x1CC, 4, 0x83C, 1, NO_PAD_CTRL)
747#define MX53_PAD_EIM_DA13__EMI_NAND_WEIM_DA_13 IOMUX_PAD(0x520, 0x1D0, 0, __NA_, 0, NO_PAD_CTRL)
748#define MX53_PAD_EIM_DA13__GPIO3_13 IOMUX_PAD(0x520, 0x1D0, 1, __NA_, 0, NO_PAD_CTRL)
749#define MX53_PAD_EIM_DA13__IPU_DI1_D0_CS IOMUX_PAD(0x520, 0x1D0, 3, __NA_, 0, NO_PAD_CTRL)
750#define MX53_PAD_EIM_DA13__CCM_DI1_EXT_CLK IOMUX_PAD(0x520, 0x1D0, 4, 0x76C, 1, NO_PAD_CTRL)
751#define MX53_PAD_EIM_DA14__EMI_NAND_WEIM_DA_14 IOMUX_PAD(0x524, 0x1D4, 0, __NA_, 0, NO_PAD_CTRL)
752#define MX53_PAD_EIM_DA14__GPIO3_14 IOMUX_PAD(0x524, 0x1D4, 1, __NA_, 0, NO_PAD_CTRL)
753#define MX53_PAD_EIM_DA14__IPU_DI1_D1_CS IOMUX_PAD(0x524, 0x1D4, 3, __NA_, 0, NO_PAD_CTRL)
754#define MX53_PAD_EIM_DA14__CCM_DI0_EXT_CLK IOMUX_PAD(0x524, 0x1D4, 4, __NA_, 0, NO_PAD_CTRL)
755#define MX53_PAD_EIM_DA15__EMI_NAND_WEIM_DA_15 IOMUX_PAD(0x528, 0x1D8, 0, __NA_, 0, NO_PAD_CTRL)
756#define MX53_PAD_EIM_DA15__GPIO3_15 IOMUX_PAD(0x528, 0x1D8, 1, __NA_, 0, NO_PAD_CTRL)
757#define MX53_PAD_EIM_DA15__IPU_DI1_PIN1 IOMUX_PAD(0x528, 0x1D8, 3, __NA_, 0, NO_PAD_CTRL)
758#define MX53_PAD_EIM_DA15__IPU_DI1_PIN4 IOMUX_PAD(0x528, 0x1D8, 4, __NA_, 0, NO_PAD_CTRL)
759#define MX53_PAD_NANDF_WE_B__EMI_NANDF_WE_B IOMUX_PAD(0x52C, 0x1DC, 0, __NA_, 0, NO_PAD_CTRL)
760#define MX53_PAD_NANDF_WE_B__GPIO6_12 IOMUX_PAD(0x52C, 0x1DC, 1, __NA_, 0, NO_PAD_CTRL)
761#define MX53_PAD_NANDF_RE_B__EMI_NANDF_RE_B IOMUX_PAD(0x530, 0x1E0, 0, __NA_, 0, NO_PAD_CTRL)
762#define MX53_PAD_NANDF_RE_B__GPIO6_13 IOMUX_PAD(0x530, 0x1E0, 1, __NA_, 0, NO_PAD_CTRL)
763#define MX53_PAD_EIM_WAIT__EMI_WEIM_WAIT IOMUX_PAD(0x534, 0x1E4, 0, __NA_, 0, NO_PAD_CTRL)
764#define MX53_PAD_EIM_WAIT__GPIO5_0 IOMUX_PAD(0x534, 0x1E4, 1, __NA_, 0, NO_PAD_CTRL)
765#define MX53_PAD_EIM_WAIT__EMI_WEIM_DTACK_B IOMUX_PAD(0x534, 0x1E4, 2, __NA_, 0, NO_PAD_CTRL)
766#define MX53_PAD_LVDS1_TX3_P__GPIO6_22 IOMUX_PAD(__NA_, 0x1EC, 0, __NA_, 0, NO_PAD_CTRL)
767#define MX53_PAD_LVDS1_TX3_P__LDB_LVDS1_TX3 IOMUX_PAD(__NA_, 0x1EC, 1, __NA_, 0, NO_PAD_CTRL)
768#define MX53_PAD_LVDS1_TX2_P__GPIO6_24 IOMUX_PAD(__NA_, 0x1F0, 0, __NA_, 0, NO_PAD_CTRL)
769#define MX53_PAD_LVDS1_TX2_P__LDB_LVDS1_TX2 IOMUX_PAD(__NA_, 0x1F0, 1, __NA_, 0, NO_PAD_CTRL)
770#define MX53_PAD_LVDS1_CLK_P__GPIO6_26 IOMUX_PAD(__NA_, 0x1F4, 0, __NA_, 0, NO_PAD_CTRL)
771#define MX53_PAD_LVDS1_CLK_P__LDB_LVDS1_CLK IOMUX_PAD(__NA_, 0x1F4, 1, __NA_, 0, NO_PAD_CTRL)
772#define MX53_PAD_LVDS1_TX1_P__GPIO6_28 IOMUX_PAD(__NA_, 0x1F8, 0, __NA_, 0, NO_PAD_CTRL)
773#define MX53_PAD_LVDS1_TX1_P__LDB_LVDS1_TX1 IOMUX_PAD(__NA_, 0x1F8, 1, __NA_, 0, NO_PAD_CTRL)
774#define MX53_PAD_LVDS1_TX0_P__GPIO6_30 IOMUX_PAD(__NA_, 0x1FC, 0, __NA_, 0, NO_PAD_CTRL)
775#define MX53_PAD_LVDS1_TX0_P__LDB_LVDS1_TX0 IOMUX_PAD(__NA_, 0x1FC, 1, __NA_, 0, NO_PAD_CTRL)
776#define MX53_PAD_LVDS0_TX3_P__GPIO7_22 IOMUX_PAD(__NA_, 0x200, 0, __NA_, 0, NO_PAD_CTRL)
777#define MX53_PAD_LVDS0_TX3_P__LDB_LVDS0_TX3 IOMUX_PAD(__NA_, 0x200, 1, __NA_, 0, NO_PAD_CTRL)
778#define MX53_PAD_LVDS0_CLK_P__GPIO7_24 IOMUX_PAD(__NA_, 0x204, 0, __NA_, 0, NO_PAD_CTRL)
779#define MX53_PAD_LVDS0_CLK_P__LDB_LVDS0_CLK IOMUX_PAD(__NA_, 0x204, 1, __NA_, 0, NO_PAD_CTRL)
780#define MX53_PAD_LVDS0_TX2_P__GPIO7_26 IOMUX_PAD(__NA_, 0x208, 0, __NA_, 0, NO_PAD_CTRL)
781#define MX53_PAD_LVDS0_TX2_P__LDB_LVDS0_TX2 IOMUX_PAD(__NA_, 0x208, 1, __NA_, 0, NO_PAD_CTRL)
782#define MX53_PAD_LVDS0_TX1_P__GPIO7_28 IOMUX_PAD(__NA_, 0x20C, 0, __NA_, 0, NO_PAD_CTRL)
783#define MX53_PAD_LVDS0_TX1_P__LDB_LVDS0_TX1 IOMUX_PAD(__NA_, 0x20C, 1, __NA_, 0, NO_PAD_CTRL)
784#define MX53_PAD_LVDS0_TX0_P__GPIO7_30 IOMUX_PAD(__NA_, 0x210, 0, __NA_, 0, NO_PAD_CTRL)
785#define MX53_PAD_LVDS0_TX0_P__LDB_LVDS0_TX0 IOMUX_PAD(__NA_, 0x210, 1, __NA_, 0, NO_PAD_CTRL)
786#define MX53_PAD_GPIO_10__GPIO4_0 IOMUX_PAD(0x540, 0x214, 0, __NA_, 0, NO_PAD_CTRL)
787#define MX53_PAD_GPIO_10__OSC32k_32K_OUT IOMUX_PAD(0x540, 0x214, 1, __NA_, 0, NO_PAD_CTRL)
788#define MX53_PAD_GPIO_11__GPIO4_1 IOMUX_PAD(0x544, 0x218, 0, __NA_, 0, NO_PAD_CTRL)
789#define MX53_PAD_GPIO_12__GPIO4_2 IOMUX_PAD(0x548, 0x21C, 0, __NA_, 0, NO_PAD_CTRL)
790#define MX53_PAD_GPIO_13__GPIO4_3 IOMUX_PAD(0x54C, 0x220, 0, __NA_, 0, NO_PAD_CTRL)
791#define MX53_PAD_GPIO_14__GPIO4_4 IOMUX_PAD(0x550, 0x224, 0, __NA_, 0, NO_PAD_CTRL)
792#define MX53_PAD_NANDF_CLE__EMI_NANDF_CLE IOMUX_PAD(0x5A0, 0x228, 0, __NA_, 0, NO_PAD_CTRL)
793#define MX53_PAD_NANDF_CLE__GPIO6_7 IOMUX_PAD(0x5A0, 0x228, 1, __NA_, 0, NO_PAD_CTRL)
794#define MX53_PAD_NANDF_CLE__USBPHY1_VSTATUS_0 IOMUX_PAD(0x5A0, 0x228, 7, __NA_, 0, NO_PAD_CTRL)
795#define MX53_PAD_NANDF_ALE__EMI_NANDF_ALE IOMUX_PAD(0x5A4, 0x22C, 0, __NA_, 0, NO_PAD_CTRL)
796#define MX53_PAD_NANDF_ALE__GPIO6_8 IOMUX_PAD(0x5A4, 0x22C, 1, __NA_, 0, NO_PAD_CTRL)
797#define MX53_PAD_NANDF_ALE__USBPHY1_VSTATUS_1 IOMUX_PAD(0x5A4, 0x22C, 7, __NA_, 0, NO_PAD_CTRL)
798#define MX53_PAD_NANDF_WP_B__EMI_NANDF_WP_B IOMUX_PAD(0x5A8, 0x230, 0, __NA_, 0, NO_PAD_CTRL)
799#define MX53_PAD_NANDF_WP_B__GPIO6_9 IOMUX_PAD(0x5A8, 0x230, 1, __NA_, 0, NO_PAD_CTRL)
800#define MX53_PAD_NANDF_WP_B__USBPHY1_VSTATUS_2 IOMUX_PAD(0x5A8, 0x230, 7, __NA_, 0, NO_PAD_CTRL)
801#define MX53_PAD_NANDF_RB0__EMI_NANDF_RB_0 IOMUX_PAD(0x5AC, 0x234, 0, __NA_, 0, NO_PAD_CTRL)
802#define MX53_PAD_NANDF_RB0__GPIO6_10 IOMUX_PAD(0x5AC, 0x234, 1, __NA_, 0, NO_PAD_CTRL)
803#define MX53_PAD_NANDF_RB0__USBPHY1_VSTATUS_3 IOMUX_PAD(0x5AC, 0x234, 7, __NA_, 0, NO_PAD_CTRL)
804#define MX53_PAD_NANDF_CS0__EMI_NANDF_CS_0 IOMUX_PAD(0x5B0, 0x238, 0, __NA_, 0, NO_PAD_CTRL)
805#define MX53_PAD_NANDF_CS0__GPIO6_11 IOMUX_PAD(0x5B0, 0x238, 1, __NA_, 0, NO_PAD_CTRL)
806#define MX53_PAD_NANDF_CS0__USBPHY1_VSTATUS_4 IOMUX_PAD(0x5B0, 0x238, 7, __NA_, 0, NO_PAD_CTRL)
807#define MX53_PAD_NANDF_CS1__EMI_NANDF_CS_1 IOMUX_PAD(0x5B4, 0x23C, 0, __NA_, 0, NO_PAD_CTRL)
808#define MX53_PAD_NANDF_CS1__GPIO6_14 IOMUX_PAD(0x5B4, 0x23C, 1, __NA_, 0, NO_PAD_CTRL)
809#define MX53_PAD_NANDF_CS1__MLB_MLBCLK IOMUX_PAD(0x5B4, 0x23C, 6, 0x858, 0, NO_PAD_CTRL)
810#define MX53_PAD_NANDF_CS1__USBPHY1_VSTATUS_5 IOMUX_PAD(0x5B4, 0x23C, 7, __NA_, 0, NO_PAD_CTRL)
811#define MX53_PAD_NANDF_CS2__EMI_NANDF_CS_2 IOMUX_PAD(0x5B8, 0x240, 0, __NA_, 0, NO_PAD_CTRL)
812#define MX53_PAD_NANDF_CS2__GPIO6_15 IOMUX_PAD(0x5B8, 0x240, 1, __NA_, 0, NO_PAD_CTRL)
813#define MX53_PAD_NANDF_CS2__IPU_SISG_0 IOMUX_PAD(0x5B8, 0x240, 2, __NA_, 0, NO_PAD_CTRL)
814#define MX53_PAD_NANDF_CS2__ESAI1_TX0 IOMUX_PAD(0x5B8, 0x240, 3, 0x7E4, 0, NO_PAD_CTRL)
815#define MX53_PAD_NANDF_CS2__EMI_WEIM_CRE IOMUX_PAD(0x5B8, 0x240, 4, __NA_, 0, NO_PAD_CTRL)
816#define MX53_PAD_NANDF_CS2__CCM_CSI0_MCLK IOMUX_PAD(0x5B8, 0x240, 5, __NA_, 0, NO_PAD_CTRL)
817#define MX53_PAD_NANDF_CS2__MLB_MLBSIG IOMUX_PAD(0x5B8, 0x240, 6, 0x860, 0, NO_PAD_CTRL)
818#define MX53_PAD_NANDF_CS2__USBPHY1_VSTATUS_6 IOMUX_PAD(0x5B8, 0x240, 7, __NA_, 0, NO_PAD_CTRL)
819#define MX53_PAD_NANDF_CS3__EMI_NANDF_CS_3 IOMUX_PAD(0x5BC, 0x244, 0, __NA_, 0, NO_PAD_CTRL)
820#define MX53_PAD_NANDF_CS3__GPIO6_16 IOMUX_PAD(0x5BC, 0x244, 1, __NA_, 0, NO_PAD_CTRL)
821#define MX53_PAD_NANDF_CS3__IPU_SISG_1 IOMUX_PAD(0x5BC, 0x244, 2, __NA_, 0, NO_PAD_CTRL)
822#define MX53_PAD_NANDF_CS3__ESAI1_TX1 IOMUX_PAD(0x5BC, 0x244, 3, 0x7E8, 0, NO_PAD_CTRL)
823#define MX53_PAD_NANDF_CS3__EMI_WEIM_A_26 IOMUX_PAD(0x5BC, 0x244, 4, __NA_, 0, NO_PAD_CTRL)
824#define MX53_PAD_NANDF_CS3__MLB_MLBDAT IOMUX_PAD(0x5BC, 0x244, 6, 0x85C, 0, NO_PAD_CTRL)
825#define MX53_PAD_NANDF_CS3__USBPHY1_VSTATUS_7 IOMUX_PAD(0x5BC, 0x244, 7, __NA_, 0, NO_PAD_CTRL)
826#define MX53_PAD_FEC_MDIO__FEC_MDIO IOMUX_PAD(0x5C4, 0x248, 0, 0x804, 1, NO_PAD_CTRL)
827#define MX53_PAD_FEC_MDIO__GPIO1_22 IOMUX_PAD(0x5C4, 0x248, 1, __NA_, 0, NO_PAD_CTRL)
828#define MX53_PAD_FEC_MDIO__ESAI1_SCKR IOMUX_PAD(0x5C4, 0x248, 2, 0x7DC, 0, NO_PAD_CTRL)
829#define MX53_PAD_FEC_MDIO__FEC_COL IOMUX_PAD(0x5C4, 0x248, 3, 0x800, 1, NO_PAD_CTRL)
830#define MX53_PAD_FEC_MDIO__RTC_CE_RTC_PS2 IOMUX_PAD(0x5C4, 0x248, 4, __NA_, 0, NO_PAD_CTRL)
831#define MX53_PAD_FEC_MDIO__SDMA_DEBUG_BUS_DEVICE_3 IOMUX_PAD(0x5C4, 0x248, 5, __NA_, 0, NO_PAD_CTRL)
832#define MX53_PAD_FEC_MDIO__EMI_EMI_DEBUG_49 IOMUX_PAD(0x5C4, 0x248, 6, __NA_, 0, NO_PAD_CTRL)
833#define MX53_PAD_FEC_REF_CLK__FEC_TX_CLK IOMUX_PAD(0x5C8, 0x24C, 0, __NA_, 0, NO_PAD_CTRL)
834#define MX53_PAD_FEC_REF_CLK__GPIO1_23 IOMUX_PAD(0x5C8, 0x24C, 1, __NA_, 0, NO_PAD_CTRL)
835#define MX53_PAD_FEC_REF_CLK__ESAI1_FSR IOMUX_PAD(0x5C8, 0x24C, 2, 0x7CC, 0, NO_PAD_CTRL)
836#define MX53_PAD_FEC_REF_CLK__SDMA_DEBUG_BUS_DEVICE_4 IOMUX_PAD(0x5C8, 0x24C, 5, __NA_, 0, NO_PAD_CTRL)
837#define MX53_PAD_FEC_REF_CLK__EMI_EMI_DEBUG_50 IOMUX_PAD(0x5C8, 0x24C, 6, __NA_, 0, NO_PAD_CTRL)
838#define MX53_PAD_FEC_RX_ER__FEC_RX_ER IOMUX_PAD(0x5CC, 0x250, 0, __NA_, 0, NO_PAD_CTRL)
839#define MX53_PAD_FEC_RX_ER__GPIO1_24 IOMUX_PAD(0x5CC, 0x250, 1, __NA_, 0, NO_PAD_CTRL)
840#define MX53_PAD_FEC_RX_ER__ESAI1_HCKR IOMUX_PAD(0x5CC, 0x250, 2, 0x7D4, 0, NO_PAD_CTRL)
841#define MX53_PAD_FEC_RX_ER__FEC_RX_CLK IOMUX_PAD(0x5CC, 0x250, 3, 0x808, 1, NO_PAD_CTRL)
842#define MX53_PAD_FEC_RX_ER__RTC_CE_RTC_PS3 IOMUX_PAD(0x5CC, 0x250, 4, __NA_, 0, NO_PAD_CTRL)
843#define MX53_PAD_FEC_CRS_DV__FEC_RX_DV IOMUX_PAD(0x5D0, 0x254, 0, __NA_, 0, NO_PAD_CTRL)
844#define MX53_PAD_FEC_CRS_DV__GPIO1_25 IOMUX_PAD(0x5D0, 0x254, 1, __NA_, 0, NO_PAD_CTRL)
845#define MX53_PAD_FEC_CRS_DV__ESAI1_SCKT IOMUX_PAD(0x5D0, 0x254, 2, 0x7E0, 0, NO_PAD_CTRL)
846#define MX53_PAD_FEC_RXD1__FEC_RDATA_1 IOMUX_PAD(0x5D4, 0x258, 0, __NA_, 0, NO_PAD_CTRL)
847#define MX53_PAD_FEC_RXD1__GPIO1_26 IOMUX_PAD(0x5D4, 0x258, 1, __NA_, 0, NO_PAD_CTRL)
848#define MX53_PAD_FEC_RXD1__ESAI1_FST IOMUX_PAD(0x5D4, 0x258, 2, 0x7D0, 0, NO_PAD_CTRL)
849#define MX53_PAD_FEC_RXD1__MLB_MLBSIG IOMUX_PAD(0x5D4, 0x258, 3, 0x860, 1, NO_PAD_CTRL)
850#define MX53_PAD_FEC_RXD1__RTC_CE_RTC_PS1 IOMUX_PAD(0x5D4, 0x258, 4, __NA_, 0, NO_PAD_CTRL)
851#define MX53_PAD_FEC_RXD0__FEC_RDATA_0 IOMUX_PAD(0x5D8, 0x25C, 0, __NA_, 0, NO_PAD_CTRL)
852#define MX53_PAD_FEC_RXD0__GPIO1_27 IOMUX_PAD(0x5D8, 0x25C, 1, __NA_, 0, NO_PAD_CTRL)
853#define MX53_PAD_FEC_RXD0__ESAI1_HCKT IOMUX_PAD(0x5D8, 0x25C, 2, 0x7D8, 0, NO_PAD_CTRL)
854#define MX53_PAD_FEC_RXD0__OSC32k_32K_OUT IOMUX_PAD(0x5D8, 0x25C, 3, __NA_, 0, NO_PAD_CTRL)
855#define MX53_PAD_FEC_TX_EN__FEC_TX_EN IOMUX_PAD(0x5DC, 0x260, 0, __NA_, 0, NO_PAD_CTRL)
856#define MX53_PAD_FEC_TX_EN__GPIO1_28 IOMUX_PAD(0x5DC, 0x260, 1, __NA_, 0, NO_PAD_CTRL)
857#define MX53_PAD_FEC_TX_EN__ESAI1_TX3_RX2 IOMUX_PAD(0x5DC, 0x260, 2, 0x7F0, 0, NO_PAD_CTRL)
858#define MX53_PAD_FEC_TXD1__FEC_TDATA_1 IOMUX_PAD(0x5E0, 0x264, 0, __NA_, 0, NO_PAD_CTRL)
859#define MX53_PAD_FEC_TXD1__GPIO1_29 IOMUX_PAD(0x5E0, 0x264, 1, __NA_, 0, NO_PAD_CTRL)
860#define MX53_PAD_FEC_TXD1__ESAI1_TX2_RX3 IOMUX_PAD(0x5E0, 0x264, 2, 0x7EC, 0, NO_PAD_CTRL)
861#define MX53_PAD_FEC_TXD1__MLB_MLBCLK IOMUX_PAD(0x5E0, 0x264, 3, 0x858, 1, NO_PAD_CTRL)
862#define MX53_PAD_FEC_TXD1__RTC_CE_RTC_PRSC_CLK IOMUX_PAD(0x5E0, 0x264, 4, __NA_, 0, NO_PAD_CTRL)
863#define MX53_PAD_FEC_TXD0__FEC_TDATA_0 IOMUX_PAD(0x5E4, 0x268, 0, __NA_, 0, NO_PAD_CTRL)
864#define MX53_PAD_FEC_TXD0__GPIO1_30 IOMUX_PAD(0x5E4, 0x268, 1, __NA_, 0, NO_PAD_CTRL)
865#define MX53_PAD_FEC_TXD0__ESAI1_TX4_RX1 IOMUX_PAD(0x5E4, 0x268, 2, 0x7F4, 0, NO_PAD_CTRL)
866#define MX53_PAD_FEC_TXD0__USBPHY2_DATAOUT_0 IOMUX_PAD(0x5E4, 0x268, 7, __NA_, 0, NO_PAD_CTRL)
867#define MX53_PAD_FEC_MDC__FEC_MDC IOMUX_PAD(0x5E8, 0x26C, 0, __NA_, 0, NO_PAD_CTRL)
868#define MX53_PAD_FEC_MDC__GPIO1_31 IOMUX_PAD(0x5E8, 0x26C, 1, __NA_, 0, NO_PAD_CTRL)
869#define MX53_PAD_FEC_MDC__ESAI1_TX5_RX0 IOMUX_PAD(0x5E8, 0x26C, 2, 0x7F8, 0, NO_PAD_CTRL)
870#define MX53_PAD_FEC_MDC__MLB_MLBDAT IOMUX_PAD(0x5E8, 0x26C, 3, 0x85C, 1, NO_PAD_CTRL)
871#define MX53_PAD_FEC_MDC__RTC_CE_RTC_ALARM1_TRIG IOMUX_PAD(0x5E8, 0x26C, 4, __NA_, 0, NO_PAD_CTRL)
872#define MX53_PAD_FEC_MDC__USBPHY2_DATAOUT_1 IOMUX_PAD(0x5E8, 0x26C, 7, __NA_, 0, NO_PAD_CTRL)
873#define MX53_PAD_PATA_DIOW__PATA_DIOW IOMUX_PAD(0x5F0, 0x270, 0, __NA_, 0, NO_PAD_CTRL)
874#define MX53_PAD_PATA_DIOW__GPIO6_17 IOMUX_PAD(0x5F0, 0x270, 1, __NA_, 0, NO_PAD_CTRL)
875#define MX53_PAD_PATA_DIOW__UART1_TXD_MUX IOMUX_PAD(0x5F0, 0x270, 3, __NA_, 0, MX53_UART_PAD_CTRL)
876#define MX53_PAD_PATA_DIOW__USBPHY2_DATAOUT_2 IOMUX_PAD(0x5F0, 0x270, 7, __NA_, 0, NO_PAD_CTRL)
877#define MX53_PAD_PATA_DMACK__PATA_DMACK IOMUX_PAD(0x5F4, 0x274, 0, __NA_, 0, NO_PAD_CTRL)
878#define MX53_PAD_PATA_DMACK__GPIO6_18 IOMUX_PAD(0x5F4, 0x274, 1, __NA_, 0, NO_PAD_CTRL)
879#define MX53_PAD_PATA_DMACK__UART1_RXD_MUX IOMUX_PAD(0x5F4, 0x274, 3, 0x878, 3, MX53_UART_PAD_CTRL)
880#define MX53_PAD_PATA_DMACK__USBPHY2_DATAOUT_3 IOMUX_PAD(0x5F4, 0x274, 7, __NA_, 0, NO_PAD_CTRL)
881#define MX53_PAD_PATA_DMARQ__PATA_DMARQ IOMUX_PAD(0x5F8, 0x278, 0, __NA_, 0, NO_PAD_CTRL)
882#define MX53_PAD_PATA_DMARQ__GPIO7_0 IOMUX_PAD(0x5F8, 0x278, 1, __NA_, 0, NO_PAD_CTRL)
883#define MX53_PAD_PATA_DMARQ__UART2_TXD_MUX IOMUX_PAD(0x5F8, 0x278, 3, __NA_, 0, MX53_UART_PAD_CTRL)
884#define MX53_PAD_PATA_DMARQ__CCM_CCM_OUT_0 IOMUX_PAD(0x5F8, 0x278, 5, __NA_, 0, NO_PAD_CTRL)
885#define MX53_PAD_PATA_DMARQ__USBPHY2_DATAOUT_4 IOMUX_PAD(0x5F8, 0x278, 7, __NA_, 0, NO_PAD_CTRL)
886#define MX53_PAD_PATA_BUFFER_EN__PATA_BUFFER_EN IOMUX_PAD(0x5FC, 0x27C, 0, __NA_, 0, NO_PAD_CTRL)
887#define MX53_PAD_PATA_BUFFER_EN__GPIO7_1 IOMUX_PAD(0x5FC, 0x27C, 1, __NA_, 0, NO_PAD_CTRL)
888#define MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX IOMUX_PAD(0x5FC, 0x27C, 3, 0x880, 3, MX53_UART_PAD_CTRL)
889#define MX53_PAD_PATA_BUFFER_EN__CCM_CCM_OUT_1 IOMUX_PAD(0x5FC, 0x27C, 5, __NA_, 0, NO_PAD_CTRL)
890#define MX53_PAD_PATA_BUFFER_EN__USBPHY2_DATAOUT_5 IOMUX_PAD(0x5FC, 0x27C, 7, __NA_, 0, NO_PAD_CTRL)
891#define MX53_PAD_PATA_INTRQ__PATA_INTRQ IOMUX_PAD(0x600, 0x280, 0, __NA_, 0, NO_PAD_CTRL)
892#define MX53_PAD_PATA_INTRQ__GPIO7_2 IOMUX_PAD(0x600, 0x280, 1, __NA_, 0, NO_PAD_CTRL)
893#define MX53_PAD_PATA_INTRQ__UART2_CTS IOMUX_PAD(0x600, 0x280, 3, __NA_, 0, MX53_UART_PAD_CTRL)
894#define MX53_PAD_PATA_INTRQ__CAN1_TXCAN IOMUX_PAD(0x600, 0x280, 4, __NA_, 0, NO_PAD_CTRL)
895#define MX53_PAD_PATA_INTRQ__CCM_CCM_OUT_2 IOMUX_PAD(0x600, 0x280, 5, __NA_, 0, NO_PAD_CTRL)
896#define MX53_PAD_PATA_INTRQ__USBPHY2_DATAOUT_6 IOMUX_PAD(0x600, 0x280, 7, __NA_, 0, NO_PAD_CTRL)
897#define MX53_PAD_PATA_DIOR__PATA_DIOR IOMUX_PAD(0x604, 0x284, 0, __NA_, 0, NO_PAD_CTRL)
898#define MX53_PAD_PATA_DIOR__GPIO7_3 IOMUX_PAD(0x604, 0x284, 1, __NA_, 0, NO_PAD_CTRL)
899#define MX53_PAD_PATA_DIOR__UART2_RTS IOMUX_PAD(0x604, 0x284, 3, 0x87C, 3, MX53_UART_PAD_CTRL)
900#define MX53_PAD_PATA_DIOR__CAN1_RXCAN IOMUX_PAD(0x604, 0x284, 4, 0x760, 1, NO_PAD_CTRL)
901#define MX53_PAD_PATA_DIOR__USBPHY2_DATAOUT_7 IOMUX_PAD(0x604, 0x284, 7, __NA_, 0, NO_PAD_CTRL)
902#define MX53_PAD_PATA_RESET_B__PATA_PATA_RESET_B IOMUX_PAD(0x608, 0x288, 0, __NA_, 0, NO_PAD_CTRL)
903#define MX53_PAD_PATA_RESET_B__GPIO7_4 IOMUX_PAD(0x608, 0x288, 1, __NA_, 0, NO_PAD_CTRL)
904#define MX53_PAD_PATA_RESET_B__ESDHC3_CMD IOMUX_PAD(0x608, 0x288, 2, __NA_, 0, MX53_SDHC_PAD_CTRL)
905#define MX53_PAD_PATA_RESET_B__UART1_CTS IOMUX_PAD(0x608, 0x288, 3, __NA_, 0, MX53_UART_PAD_CTRL)
906#define MX53_PAD_PATA_RESET_B__CAN2_TXCAN IOMUX_PAD(0x608, 0x288, 4, __NA_, 0, NO_PAD_CTRL)
907#define MX53_PAD_PATA_RESET_B__USBPHY1_DATAOUT_0 IOMUX_PAD(0x608, 0x288, 7, __NA_, 0, NO_PAD_CTRL)
908#define MX53_PAD_PATA_IORDY__PATA_IORDY IOMUX_PAD(0x60C, 0x28C, 0, __NA_, 0, NO_PAD_CTRL)
909#define MX53_PAD_PATA_IORDY__GPIO7_5 IOMUX_PAD(0x60C, 0x28C, 1, __NA_, 0, NO_PAD_CTRL)
910#define MX53_PAD_PATA_IORDY__ESDHC3_CLK IOMUX_PAD(0x60C, 0x28C, 2, __NA_, 0, MX53_SDHC_PAD_CTRL)
911#define MX53_PAD_PATA_IORDY__UART1_RTS IOMUX_PAD(0x60C, 0x28C, 3, 0x874, 3, MX53_UART_PAD_CTRL)
912#define MX53_PAD_PATA_IORDY__CAN2_RXCAN IOMUX_PAD(0x60C, 0x28C, 4, 0x764, 1, NO_PAD_CTRL)
913#define MX53_PAD_PATA_IORDY__USBPHY1_DATAOUT_1 IOMUX_PAD(0x60C, 0x28C, 7, __NA_, 0, NO_PAD_CTRL)
914#define MX53_PAD_PATA_DA_0__PATA_DA_0 IOMUX_PAD(0x610, 0x290, 0, __NA_, 0, NO_PAD_CTRL)
915#define MX53_PAD_PATA_DA_0__GPIO7_6 IOMUX_PAD(0x610, 0x290, 1, __NA_, 0, NO_PAD_CTRL)
916#define MX53_PAD_PATA_DA_0__ESDHC3_RST IOMUX_PAD(0x610, 0x290, 2, __NA_, 0, NO_PAD_CTRL)
917#define MX53_PAD_PATA_DA_0__OWIRE_LINE IOMUX_PAD(0x610, 0x290, 4, 0x864, 0, NO_PAD_CTRL)
918#define MX53_PAD_PATA_DA_0__USBPHY1_DATAOUT_2 IOMUX_PAD(0x610, 0x290, 7, __NA_, 0, NO_PAD_CTRL)
919#define MX53_PAD_PATA_DA_1__PATA_DA_1 IOMUX_PAD(0x614, 0x294, 0, __NA_, 0, NO_PAD_CTRL)
920#define MX53_PAD_PATA_DA_1__GPIO7_7 IOMUX_PAD(0x614, 0x294, 1, __NA_, 0, NO_PAD_CTRL)
921#define MX53_PAD_PATA_DA_1__ESDHC4_CMD IOMUX_PAD(0x614, 0x294, 2, __NA_, 0, MX53_SDHC_PAD_CTRL)
922#define MX53_PAD_PATA_DA_1__UART3_CTS IOMUX_PAD(0x614, 0x294, 4, __NA_, 0, MX53_UART_PAD_CTRL)
923#define MX53_PAD_PATA_DA_1__USBPHY1_DATAOUT_3 IOMUX_PAD(0x614, 0x294, 7, __NA_, 0, NO_PAD_CTRL)
924#define MX53_PAD_PATA_DA_2__PATA_DA_2 IOMUX_PAD(0x618, 0x298, 0, __NA_, 0, NO_PAD_CTRL)
925#define MX53_PAD_PATA_DA_2__GPIO7_8 IOMUX_PAD(0x618, 0x298, 1, __NA_, 0, NO_PAD_CTRL)
926#define MX53_PAD_PATA_DA_2__ESDHC4_CLK IOMUX_PAD(0x618, 0x298, 2, __NA_, 0, MX53_SDHC_PAD_CTRL)
927#define MX53_PAD_PATA_DA_2__UART3_RTS IOMUX_PAD(0x618, 0x298, 4, 0x884, 5, MX53_UART_PAD_CTRL)
928#define MX53_PAD_PATA_DA_2__USBPHY1_DATAOUT_4 IOMUX_PAD(0x618, 0x298, 7, __NA_, 0, NO_PAD_CTRL)
929#define MX53_PAD_PATA_CS_0__PATA_CS_0 IOMUX_PAD(0x61C, 0x29C, 0, __NA_, 0, NO_PAD_CTRL)
930#define MX53_PAD_PATA_CS_0__GPIO7_9 IOMUX_PAD(0x61C, 0x29C, 1, __NA_, 0, NO_PAD_CTRL)
931#define MX53_PAD_PATA_CS_0__UART3_TXD_MUX IOMUX_PAD(0x61C, 0x29C, 4, __NA_, 0, MX53_UART_PAD_CTRL)
932#define MX53_PAD_PATA_CS_0__USBPHY1_DATAOUT_5 IOMUX_PAD(0x61C, 0x29C, 7, __NA_, 0, NO_PAD_CTRL)
933#define MX53_PAD_PATA_CS_1__PATA_CS_1 IOMUX_PAD(0x620, 0x2A0, 0, __NA_, 0, NO_PAD_CTRL)
934#define MX53_PAD_PATA_CS_1__GPIO7_10 IOMUX_PAD(0x620, 0x2A0, 1, __NA_, 0, NO_PAD_CTRL)
935#define MX53_PAD_PATA_CS_1__UART3_RXD_MUX IOMUX_PAD(0x620, 0x2A0, 4, 0x888, 3, MX53_UART_PAD_CTRL)
936#define MX53_PAD_PATA_CS_1__USBPHY1_DATAOUT_6 IOMUX_PAD(0x620, 0x2A0, 7, __NA_, 0, NO_PAD_CTRL)
937#define MX53_PAD_PATA_DATA0__PATA_DATA_0 IOMUX_PAD(0x628, 0x2A4, 0, __NA_, 0, NO_PAD_CTRL)
938#define MX53_PAD_PATA_DATA0__GPIO2_0 IOMUX_PAD(0x628, 0x2A4, 1, __NA_, 0, NO_PAD_CTRL)
939#define MX53_PAD_PATA_DATA0__EMI_NANDF_D_0 IOMUX_PAD(0x628, 0x2A4, 3, __NA_, 0, NO_PAD_CTRL)
940#define MX53_PAD_PATA_DATA0__ESDHC3_DAT4 IOMUX_PAD(0x628, 0x2A4, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
941#define MX53_PAD_PATA_DATA0__GPU3d_GPU_DEBUG_OUT_0 IOMUX_PAD(0x628, 0x2A4, 5, __NA_, 0, NO_PAD_CTRL)
942#define MX53_PAD_PATA_DATA0__IPU_DIAG_BUS_0 IOMUX_PAD(0x628, 0x2A4, 6, __NA_, 0, NO_PAD_CTRL)
943#define MX53_PAD_PATA_DATA0__USBPHY1_DATAOUT_7 IOMUX_PAD(0x628, 0x2A4, 7, __NA_, 0, NO_PAD_CTRL)
944#define MX53_PAD_PATA_DATA1__PATA_DATA_1 IOMUX_PAD(0x62C, 0x2A8, 0, __NA_, 0, NO_PAD_CTRL)
945#define MX53_PAD_PATA_DATA1__GPIO2_1 IOMUX_PAD(0x62C, 0x2A8, 1, __NA_, 0, NO_PAD_CTRL)
946#define MX53_PAD_PATA_DATA1__EMI_NANDF_D_1 IOMUX_PAD(0x62C, 0x2A8, 3, __NA_, 0, NO_PAD_CTRL)
947#define MX53_PAD_PATA_DATA1__ESDHC3_DAT5 IOMUX_PAD(0x62C, 0x2A8, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
948#define MX53_PAD_PATA_DATA1__GPU3d_GPU_DEBUG_OUT_1 IOMUX_PAD(0x62C, 0x2A8, 5, __NA_, 0, NO_PAD_CTRL)
949#define MX53_PAD_PATA_DATA1__IPU_DIAG_BUS_1 IOMUX_PAD(0x62C, 0x2A8, 6, __NA_, 0, NO_PAD_CTRL)
950#define MX53_PAD_PATA_DATA2__PATA_DATA_2 IOMUX_PAD(0x630, 0x2AC, 0, __NA_, 0, NO_PAD_CTRL)
951#define MX53_PAD_PATA_DATA2__GPIO2_2 IOMUX_PAD(0x630, 0x2AC, 1, __NA_, 0, NO_PAD_CTRL)
952#define MX53_PAD_PATA_DATA2__EMI_NANDF_D_2 IOMUX_PAD(0x630, 0x2AC, 3, __NA_, 0, NO_PAD_CTRL)
953#define MX53_PAD_PATA_DATA2__ESDHC3_DAT6 IOMUX_PAD(0x630, 0x2AC, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
954#define MX53_PAD_PATA_DATA2__GPU3d_GPU_DEBUG_OUT_2 IOMUX_PAD(0x630, 0x2AC, 5, __NA_, 0, NO_PAD_CTRL)
955#define MX53_PAD_PATA_DATA2__IPU_DIAG_BUS_2 IOMUX_PAD(0x630, 0x2AC, 6, __NA_, 0, NO_PAD_CTRL)
956#define MX53_PAD_PATA_DATA3__PATA_DATA_3 IOMUX_PAD(0x634, 0x2B0, 0, __NA_, 0, NO_PAD_CTRL)
957#define MX53_PAD_PATA_DATA3__GPIO2_3 IOMUX_PAD(0x634, 0x2B0, 1, __NA_, 0, NO_PAD_CTRL)
958#define MX53_PAD_PATA_DATA3__EMI_NANDF_D_3 IOMUX_PAD(0x634, 0x2B0, 3, __NA_, 0, NO_PAD_CTRL)
959#define MX53_PAD_PATA_DATA3__ESDHC3_DAT7 IOMUX_PAD(0x634, 0x2B0, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
960#define MX53_PAD_PATA_DATA3__GPU3d_GPU_DEBUG_OUT_3 IOMUX_PAD(0x634, 0x2B0, 5, __NA_, 0, NO_PAD_CTRL)
961#define MX53_PAD_PATA_DATA3__IPU_DIAG_BUS_3 IOMUX_PAD(0x634, 0x2B0, 6, __NA_, 0, NO_PAD_CTRL)
962#define MX53_PAD_PATA_DATA4__PATA_DATA_4 IOMUX_PAD(0x638, 0x2B4, 0, __NA_, 0, NO_PAD_CTRL)
963#define MX53_PAD_PATA_DATA4__GPIO2_4 IOMUX_PAD(0x638, 0x2B4, 1, __NA_, 0, NO_PAD_CTRL)
964#define MX53_PAD_PATA_DATA4__EMI_NANDF_D_4 IOMUX_PAD(0x638, 0x2B4, 3, __NA_, 0, NO_PAD_CTRL)
965#define MX53_PAD_PATA_DATA4__ESDHC4_DAT4 IOMUX_PAD(0x638, 0x2B4, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
966#define MX53_PAD_PATA_DATA4__GPU3d_GPU_DEBUG_OUT_4 IOMUX_PAD(0x638, 0x2B4, 5, __NA_, 0, NO_PAD_CTRL)
967#define MX53_PAD_PATA_DATA4__IPU_DIAG_BUS_4 IOMUX_PAD(0x638, 0x2B4, 6, __NA_, 0, NO_PAD_CTRL)
968#define MX53_PAD_PATA_DATA5__PATA_DATA_5 IOMUX_PAD(0x63C, 0x2B8, 0, __NA_, 0, NO_PAD_CTRL)
969#define MX53_PAD_PATA_DATA5__GPIO2_5 IOMUX_PAD(0x63C, 0x2B8, 1, __NA_, 0, NO_PAD_CTRL)
970#define MX53_PAD_PATA_DATA5__EMI_NANDF_D_5 IOMUX_PAD(0x63C, 0x2B8, 3, __NA_, 0, NO_PAD_CTRL)
971#define MX53_PAD_PATA_DATA5__ESDHC4_DAT5 IOMUX_PAD(0x63C, 0x2B8, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
972#define MX53_PAD_PATA_DATA5__GPU3d_GPU_DEBUG_OUT_5 IOMUX_PAD(0x63C, 0x2B8, 5, __NA_, 0, NO_PAD_CTRL)
973#define MX53_PAD_PATA_DATA5__IPU_DIAG_BUS_5 IOMUX_PAD(0x63C, 0x2B8, 6, __NA_, 0, NO_PAD_CTRL)
974#define MX53_PAD_PATA_DATA6__PATA_DATA_6 IOMUX_PAD(0x640, 0x2BC, 0, __NA_, 0, NO_PAD_CTRL)
975#define MX53_PAD_PATA_DATA6__GPIO2_6 IOMUX_PAD(0x640, 0x2BC, 1, __NA_, 0, NO_PAD_CTRL)
976#define MX53_PAD_PATA_DATA6__EMI_NANDF_D_6 IOMUX_PAD(0x640, 0x2BC, 3, __NA_, 0, NO_PAD_CTRL)
977#define MX53_PAD_PATA_DATA6__ESDHC4_DAT6 IOMUX_PAD(0x640, 0x2BC, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
978#define MX53_PAD_PATA_DATA6__GPU3d_GPU_DEBUG_OUT_6 IOMUX_PAD(0x640, 0x2BC, 5, __NA_, 0, NO_PAD_CTRL)
979#define MX53_PAD_PATA_DATA6__IPU_DIAG_BUS_6 IOMUX_PAD(0x640, 0x2BC, 6, __NA_, 0, NO_PAD_CTRL)
980#define MX53_PAD_PATA_DATA7__PATA_DATA_7 IOMUX_PAD(0x644, 0x2C0, 0, __NA_, 0, NO_PAD_CTRL)
981#define MX53_PAD_PATA_DATA7__GPIO2_7 IOMUX_PAD(0x644, 0x2C0, 1, __NA_, 0, NO_PAD_CTRL)
982#define MX53_PAD_PATA_DATA7__EMI_NANDF_D_7 IOMUX_PAD(0x644, 0x2C0, 3, __NA_, 0, NO_PAD_CTRL)
983#define MX53_PAD_PATA_DATA7__ESDHC4_DAT7 IOMUX_PAD(0x644, 0x2C0, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
984#define MX53_PAD_PATA_DATA7__GPU3d_GPU_DEBUG_OUT_7 IOMUX_PAD(0x644, 0x2C0, 5, __NA_, 0, NO_PAD_CTRL)
985#define MX53_PAD_PATA_DATA7__IPU_DIAG_BUS_7 IOMUX_PAD(0x644, 0x2C0, 6, __NA_, 0, NO_PAD_CTRL)
986#define MX53_PAD_PATA_DATA8__PATA_DATA_8 IOMUX_PAD(0x648, 0x2C4, 0, __NA_, 0, NO_PAD_CTRL)
987#define MX53_PAD_PATA_DATA8__GPIO2_8 IOMUX_PAD(0x648, 0x2C4, 1, __NA_, 0, NO_PAD_CTRL)
988#define MX53_PAD_PATA_DATA8__ESDHC1_DAT4 IOMUX_PAD(0x648, 0x2C4, 2, __NA_, 0, MX53_SDHC_PAD_CTRL)
989#define MX53_PAD_PATA_DATA8__EMI_NANDF_D_8 IOMUX_PAD(0x648, 0x2C4, 3, __NA_, 0, NO_PAD_CTRL)
990#define MX53_PAD_PATA_DATA8__ESDHC3_DAT0 IOMUX_PAD(0x648, 0x2C4, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
991#define MX53_PAD_PATA_DATA8__GPU3d_GPU_DEBUG_OUT_8 IOMUX_PAD(0x648, 0x2C4, 5, __NA_, 0, NO_PAD_CTRL)
992#define MX53_PAD_PATA_DATA8__IPU_DIAG_BUS_8 IOMUX_PAD(0x648, 0x2C4, 6, __NA_, 0, NO_PAD_CTRL)
993#define MX53_PAD_PATA_DATA9__PATA_DATA_9 IOMUX_PAD(0x64C, 0x2C8, 0, __NA_, 0, NO_PAD_CTRL)
994#define MX53_PAD_PATA_DATA9__GPIO2_9 IOMUX_PAD(0x64C, 0x2C8, 1, __NA_, 0, NO_PAD_CTRL)
995#define MX53_PAD_PATA_DATA9__ESDHC1_DAT5 IOMUX_PAD(0x64C, 0x2C8, 2, __NA_, 0, MX53_SDHC_PAD_CTRL)
996#define MX53_PAD_PATA_DATA9__EMI_NANDF_D_9 IOMUX_PAD(0x64C, 0x2C8, 3, __NA_, 0, NO_PAD_CTRL)
997#define MX53_PAD_PATA_DATA9__ESDHC3_DAT1 IOMUX_PAD(0x64C, 0x2C8, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
998#define MX53_PAD_PATA_DATA9__GPU3d_GPU_DEBUG_OUT_9 IOMUX_PAD(0x64C, 0x2C8, 5, __NA_, 0, NO_PAD_CTRL)
999#define MX53_PAD_PATA_DATA9__IPU_DIAG_BUS_9 IOMUX_PAD(0x64C, 0x2C8, 6, __NA_, 0, NO_PAD_CTRL)
1000#define MX53_PAD_PATA_DATA10__PATA_DATA_10 IOMUX_PAD(0x650, 0x2CC, 0, __NA_, 0, NO_PAD_CTRL)
1001#define MX53_PAD_PATA_DATA10__GPIO2_10 IOMUX_PAD(0x650, 0x2CC, 1, __NA_, 0, NO_PAD_CTRL)
1002#define MX53_PAD_PATA_DATA10__ESDHC1_DAT6 IOMUX_PAD(0x650, 0x2CC, 2, __NA_, 0, MX53_SDHC_PAD_CTRL)
1003#define MX53_PAD_PATA_DATA10__EMI_NANDF_D_10 IOMUX_PAD(0x650, 0x2CC, 3, __NA_, 0, NO_PAD_CTRL)
1004#define MX53_PAD_PATA_DATA10__ESDHC3_DAT2 IOMUX_PAD(0x650, 0x2CC, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
1005#define MX53_PAD_PATA_DATA10__GPU3d_GPU_DEBUG_OUT_10 IOMUX_PAD(0x650, 0x2CC, 5, __NA_, 0, NO_PAD_CTRL)
1006#define MX53_PAD_PATA_DATA10__IPU_DIAG_BUS_10 IOMUX_PAD(0x650, 0x2CC, 6, __NA_, 0, NO_PAD_CTRL)
1007#define MX53_PAD_PATA_DATA11__PATA_DATA_11 IOMUX_PAD(0x654, 0x2D0, 0, __NA_, 0, NO_PAD_CTRL)
1008#define MX53_PAD_PATA_DATA11__GPIO2_11 IOMUX_PAD(0x654, 0x2D0, 1, __NA_, 0, NO_PAD_CTRL)
1009#define MX53_PAD_PATA_DATA11__ESDHC1_DAT7 IOMUX_PAD(0x654, 0x2D0, 2, __NA_, 0, MX53_SDHC_PAD_CTRL)
1010#define MX53_PAD_PATA_DATA11__EMI_NANDF_D_11 IOMUX_PAD(0x654, 0x2D0, 3, __NA_, 0, NO_PAD_CTRL)
1011#define MX53_PAD_PATA_DATA11__ESDHC3_DAT3 IOMUX_PAD(0x654, 0x2D0, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
1012#define MX53_PAD_PATA_DATA11__GPU3d_GPU_DEBUG_OUT_11 IOMUX_PAD(0x654, 0x2D0, 5, __NA_, 0, NO_PAD_CTRL)
1013#define MX53_PAD_PATA_DATA11__IPU_DIAG_BUS_11 IOMUX_PAD(0x654, 0x2D0, 6, __NA_, 0, NO_PAD_CTRL)
1014#define MX53_PAD_PATA_DATA12__PATA_DATA_12 IOMUX_PAD(0x658, 0x2D4, 0, __NA_, 0, NO_PAD_CTRL)
1015#define MX53_PAD_PATA_DATA12__GPIO2_12 IOMUX_PAD(0x658, 0x2D4, 1, __NA_, 0, NO_PAD_CTRL)
1016#define MX53_PAD_PATA_DATA12__ESDHC2_DAT4 IOMUX_PAD(0x658, 0x2D4, 2, __NA_, 0, MX53_SDHC_PAD_CTRL)
1017#define MX53_PAD_PATA_DATA12__EMI_NANDF_D_12 IOMUX_PAD(0x658, 0x2D4, 3, __NA_, 0, NO_PAD_CTRL)
1018#define MX53_PAD_PATA_DATA12__ESDHC4_DAT0 IOMUX_PAD(0x658, 0x2D4, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
1019#define MX53_PAD_PATA_DATA12__GPU3d_GPU_DEBUG_OUT_12 IOMUX_PAD(0x658, 0x2D4, 5, __NA_, 0, NO_PAD_CTRL)
1020#define MX53_PAD_PATA_DATA12__IPU_DIAG_BUS_12 IOMUX_PAD(0x658, 0x2D4, 6, __NA_, 0, NO_PAD_CTRL)
1021#define MX53_PAD_PATA_DATA13__PATA_DATA_13 IOMUX_PAD(0x65C, 0x2D8, 0, __NA_, 0, NO_PAD_CTRL)
1022#define MX53_PAD_PATA_DATA13__GPIO2_13 IOMUX_PAD(0x65C, 0x2D8, 1, __NA_, 0, NO_PAD_CTRL)
1023#define MX53_PAD_PATA_DATA13__ESDHC2_DAT5 IOMUX_PAD(0x65C, 0x2D8, 2, __NA_, 0, MX53_SDHC_PAD_CTRL)
1024#define MX53_PAD_PATA_DATA13__EMI_NANDF_D_13 IOMUX_PAD(0x65C, 0x2D8, 3, __NA_, 0, NO_PAD_CTRL)
1025#define MX53_PAD_PATA_DATA13__ESDHC4_DAT1 IOMUX_PAD(0x65C, 0x2D8, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
1026#define MX53_PAD_PATA_DATA13__GPU3d_GPU_DEBUG_OUT_13 IOMUX_PAD(0x65C, 0x2D8, 5, __NA_, 0, NO_PAD_CTRL)
1027#define MX53_PAD_PATA_DATA13__IPU_DIAG_BUS_13 IOMUX_PAD(0x65C, 0x2D8, 6, __NA_, 0, NO_PAD_CTRL)
1028#define MX53_PAD_PATA_DATA14__PATA_DATA_14 IOMUX_PAD(0x660, 0x2DC, 0, __NA_, 0, NO_PAD_CTRL)
1029#define MX53_PAD_PATA_DATA14__GPIO2_14 IOMUX_PAD(0x660, 0x2DC, 1, __NA_, 0, NO_PAD_CTRL)
1030#define MX53_PAD_PATA_DATA14__ESDHC2_DAT6 IOMUX_PAD(0x660, 0x2DC, 2, __NA_, 0, MX53_SDHC_PAD_CTRL)
1031#define MX53_PAD_PATA_DATA14__EMI_NANDF_D_14 IOMUX_PAD(0x660, 0x2DC, 3, __NA_, 0, NO_PAD_CTRL)
1032#define MX53_PAD_PATA_DATA14__ESDHC4_DAT2 IOMUX_PAD(0x660, 0x2DC, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
1033#define MX53_PAD_PATA_DATA14__GPU3d_GPU_DEBUG_OUT_14 IOMUX_PAD(0x660, 0x2DC, 5, __NA_, 0, NO_PAD_CTRL)
1034#define MX53_PAD_PATA_DATA14__IPU_DIAG_BUS_14 IOMUX_PAD(0x660, 0x2DC, 6, __NA_, 0, NO_PAD_CTRL)
1035#define MX53_PAD_PATA_DATA15__PATA_DATA_15 IOMUX_PAD(0x664, 0x2E0, 0, __NA_, 0, NO_PAD_CTRL)
1036#define MX53_PAD_PATA_DATA15__GPIO2_15 IOMUX_PAD(0x664, 0x2E0, 1, __NA_, 0, NO_PAD_CTRL)
1037#define MX53_PAD_PATA_DATA15__ESDHC2_DAT7 IOMUX_PAD(0x664, 0x2E0, 2, __NA_, 0, MX53_SDHC_PAD_CTRL)
1038#define MX53_PAD_PATA_DATA15__EMI_NANDF_D_15 IOMUX_PAD(0x664, 0x2E0, 3, __NA_, 0, NO_PAD_CTRL)
1039#define MX53_PAD_PATA_DATA15__ESDHC4_DAT3 IOMUX_PAD(0x664, 0x2E0, 4, __NA_, 0, MX53_SDHC_PAD_CTRL)
1040#define MX53_PAD_PATA_DATA15__GPU3d_GPU_DEBUG_OUT_15 IOMUX_PAD(0x664, 0x2E0, 5, __NA_, 0, NO_PAD_CTRL)
1041#define MX53_PAD_PATA_DATA15__IPU_DIAG_BUS_15 IOMUX_PAD(0x664, 0x2E0, 6, __NA_, 0, NO_PAD_CTRL)
1042#define MX53_PAD_SD1_DATA0__ESDHC1_DAT0 IOMUX_PAD(0x66C, 0x2E4, 0, __NA_, 0, MX53_SDHC_PAD_CTRL)
1043#define MX53_PAD_SD1_DATA0__GPIO1_16 IOMUX_PAD(0x66C, 0x2E4, 1, __NA_, 0, NO_PAD_CTRL)
1044#define MX53_PAD_SD1_DATA0__GPT_CAPIN1 IOMUX_PAD(0x66C, 0x2E4, 3, __NA_, 0, NO_PAD_CTRL)
1045#define MX53_PAD_SD1_DATA0__CSPI_MISO IOMUX_PAD(0x66C, 0x2E4, 5, 0x784, 2, NO_PAD_CTRL)
1046#define MX53_PAD_SD1_DATA0__CCM_PLL3_BYP IOMUX_PAD(0x66C, 0x2E4, 7, 0x778, 0, NO_PAD_CTRL)
1047#define MX53_PAD_SD1_DATA1__ESDHC1_DAT1 IOMUX_PAD(0x670, 0x2E8, 0, __NA_, 0, MX53_SDHC_PAD_CTRL)
1048#define MX53_PAD_SD1_DATA1__GPIO1_17 IOMUX_PAD(0x670, 0x2E8, 1, __NA_, 0, NO_PAD_CTRL)
1049#define MX53_PAD_SD1_DATA1__GPT_CAPIN2 IOMUX_PAD(0x670, 0x2E8, 3, __NA_, 0, NO_PAD_CTRL)
1050#define MX53_PAD_SD1_DATA1__CSPI_SS0 IOMUX_PAD(0x670, 0x2E8, 5, 0x78C, 3, NO_PAD_CTRL)
1051#define MX53_PAD_SD1_DATA1__CCM_PLL4_BYP IOMUX_PAD(0x670, 0x2E8, 7, 0x77C, 1, NO_PAD_CTRL)
1052#define MX53_PAD_SD1_CMD__ESDHC1_CMD IOMUX_PAD(0x674, 0x2EC, 0 | IOMUX_CONFIG_SION, __NA_, 0, MX53_SDHC_PAD_CTRL)
1053#define MX53_PAD_SD1_CMD__GPIO1_18 IOMUX_PAD(0x674, 0x2EC, 1, __NA_, 0, NO_PAD_CTRL)
1054#define MX53_PAD_SD1_CMD__GPT_CMPOUT1 IOMUX_PAD(0x674, 0x2EC, 3, __NA_, 0, NO_PAD_CTRL)
1055#define MX53_PAD_SD1_CMD__CSPI_MOSI IOMUX_PAD(0x674, 0x2EC, 5, 0x788, 2, NO_PAD_CTRL)
1056#define MX53_PAD_SD1_CMD__CCM_PLL1_BYP IOMUX_PAD(0x674, 0x2EC, 7, 0x770, 0, NO_PAD_CTRL)
1057#define MX53_PAD_SD1_DATA2__ESDHC1_DAT2 IOMUX_PAD(0x678, 0x2F0, 0, __NA_, 0, MX53_SDHC_PAD_CTRL)
1058#define MX53_PAD_SD1_DATA2__GPIO1_19 IOMUX_PAD(0x678, 0x2F0, 1, __NA_, 0, NO_PAD_CTRL)
1059#define MX53_PAD_SD1_DATA2__GPT_CMPOUT2 IOMUX_PAD(0x678, 0x2F0, 2, __NA_, 0, NO_PAD_CTRL)
1060#define MX53_PAD_SD1_DATA2__PWM2_PWMO IOMUX_PAD(0x678, 0x2F0, 3, __NA_, 0, NO_PAD_CTRL)
1061#define MX53_PAD_SD1_DATA2__WDOG1_WDOG_B IOMUX_PAD(0x678, 0x2F0, 4, __NA_, 0, NO_PAD_CTRL)
1062#define MX53_PAD_SD1_DATA2__CSPI_SS1 IOMUX_PAD(0x678, 0x2F0, 5, 0x790, 2, NO_PAD_CTRL)
1063#define MX53_PAD_SD1_DATA2__WDOG1_WDOG_RST_B_DEB IOMUX_PAD(0x678, 0x2F0, 6, __NA_, 0, NO_PAD_CTRL)
1064#define MX53_PAD_SD1_DATA2__CCM_PLL2_BYP IOMUX_PAD(0x678, 0x2F0, 7, 0x774, 0, NO_PAD_CTRL)
1065#define MX53_PAD_SD1_CLK__ESDHC1_CLK IOMUX_PAD(0x67C, 0x2F4, 0, __NA_, 0, MX53_SDHC_PAD_CTRL)
1066#define MX53_PAD_SD1_CLK__GPIO1_20 IOMUX_PAD(0x67C, 0x2F4, 1, __NA_, 0, NO_PAD_CTRL)
1067#define MX53_PAD_SD1_CLK__OSC32k_32K_OUT IOMUX_PAD(0x67C, 0x2F4, 2, __NA_, 0, NO_PAD_CTRL)
1068#define MX53_PAD_SD1_CLK__GPT_CLKIN IOMUX_PAD(0x67C, 0x2F4, 3, __NA_, 0, NO_PAD_CTRL)
1069#define MX53_PAD_SD1_CLK__CSPI_SCLK IOMUX_PAD(0x67C, 0x2F4, 5, 0x780, 2, NO_PAD_CTRL)
1070#define MX53_PAD_SD1_CLK__SATA_PHY_DTB_0 IOMUX_PAD(0x67C, 0x2F4, 7, __NA_, 0, NO_PAD_CTRL)
1071#define MX53_PAD_SD1_DATA3__ESDHC1_DAT3 IOMUX_PAD(0x680, 0x2F8, 0, __NA_, 0, MX53_SDHC_PAD_CTRL)
1072#define MX53_PAD_SD1_DATA3__GPIO1_21 IOMUX_PAD(0x680, 0x2F8, 1, __NA_, 0, NO_PAD_CTRL)
1073#define MX53_PAD_SD1_DATA3__GPT_CMPOUT3 IOMUX_PAD(0x680, 0x2F8, 2, __NA_, 0, NO_PAD_CTRL)
1074#define MX53_PAD_SD1_DATA3__PWM1_PWMO IOMUX_PAD(0x680, 0x2F8, 3, __NA_, 0, NO_PAD_CTRL)
1075#define MX53_PAD_SD1_DATA3__WDOG2_WDOG_B IOMUX_PAD(0x680, 0x2F8, 4, __NA_, 0, NO_PAD_CTRL)
1076#define MX53_PAD_SD1_DATA3__CSPI_SS2 IOMUX_PAD(0x680, 0x2F8, 5, 0x794, 2, NO_PAD_CTRL)
1077#define MX53_PAD_SD1_DATA3__WDOG2_WDOG_RST_B_DEB IOMUX_PAD(0x680, 0x2F8, 6, __NA_, 0, NO_PAD_CTRL)
1078#define MX53_PAD_SD1_DATA3__SATA_PHY_DTB_1 IOMUX_PAD(0x680, 0x2F8, 7, __NA_, 0, NO_PAD_CTRL)
1079#define MX53_PAD_SD2_CLK__ESDHC2_CLK IOMUX_PAD(0x688, 0x2FC, 0, __NA_, 0, MX53_SDHC_PAD_CTRL)
1080#define MX53_PAD_SD2_CLK__GPIO1_10 IOMUX_PAD(0x688, 0x2FC, 1, __NA_, 0, NO_PAD_CTRL)
1081#define MX53_PAD_SD2_CLK__KPP_COL_5 IOMUX_PAD(0x688, 0x2FC, 2, 0x840, 2, NO_PAD_CTRL)
1082#define MX53_PAD_SD2_CLK__AUDMUX_AUD4_RXFS IOMUX_PAD(0x688, 0x2FC, 3, 0x73C, 1, NO_PAD_CTRL)
1083#define MX53_PAD_SD2_CLK__CSPI_SCLK IOMUX_PAD(0x688, 0x2FC, 5, 0x780, 3, NO_PAD_CTRL)
1084#define MX53_PAD_SD2_CLK__SCC_RANDOM_V IOMUX_PAD(0x688, 0x2FC, 7, __NA_, 0, NO_PAD_CTRL)
1085#define MX53_PAD_SD2_CMD__ESDHC2_CMD IOMUX_PAD(0x68C, 0x300, 0, __NA_, 0, MX53_SDHC_PAD_CTRL)
1086#define MX53_PAD_SD2_CMD__GPIO1_11 IOMUX_PAD(0x68C, 0x300, 1, __NA_, 0, NO_PAD_CTRL)
1087#define MX53_PAD_SD2_CMD__KPP_ROW_5 IOMUX_PAD(0x68C, 0x300, 2, 0x84C, 1, NO_PAD_CTRL)
1088#define MX53_PAD_SD2_CMD__AUDMUX_AUD4_RXC IOMUX_PAD(0x68C, 0x300, 3, 0x738, 1, NO_PAD_CTRL)
1089#define MX53_PAD_SD2_CMD__CSPI_MOSI IOMUX_PAD(0x68C, 0x300, 5, 0x788, 3, NO_PAD_CTRL)
1090#define MX53_PAD_SD2_CMD__SCC_RANDOM IOMUX_PAD(0x68C, 0x300, 7, __NA_, 0, NO_PAD_CTRL)
1091#define MX53_PAD_SD2_DATA3__ESDHC2_DAT3 IOMUX_PAD(0x690, 0x304, 0, __NA_, 0, MX53_SDHC_PAD_CTRL)
1092#define MX53_PAD_SD2_DATA3__GPIO1_12 IOMUX_PAD(0x690, 0x304, 1, __NA_, 0, NO_PAD_CTRL)
1093#define MX53_PAD_SD2_DATA3__KPP_COL_6 IOMUX_PAD(0x690, 0x304, 2, 0x844, 1, NO_PAD_CTRL)
1094#define MX53_PAD_SD2_DATA3__AUDMUX_AUD4_TXC IOMUX_PAD(0x690, 0x304, 3, 0x740, 1, NO_PAD_CTRL)
1095#define MX53_PAD_SD2_DATA3__CSPI_SS2 IOMUX_PAD(0x690, 0x304, 5, 0x794, 3, NO_PAD_CTRL)
1096#define MX53_PAD_SD2_DATA3__SJC_DONE IOMUX_PAD(0x690, 0x304, 7, __NA_, 0, NO_PAD_CTRL)
1097#define MX53_PAD_SD2_DATA2__ESDHC2_DAT2 IOMUX_PAD(0x694, 0x308, 0, __NA_, 0, MX53_SDHC_PAD_CTRL)
1098#define MX53_PAD_SD2_DATA2__GPIO1_13 IOMUX_PAD(0x694, 0x308, 1, __NA_, 0, NO_PAD_CTRL)
1099#define MX53_PAD_SD2_DATA2__KPP_ROW_6 IOMUX_PAD(0x694, 0x308, 2, 0x850, 1, NO_PAD_CTRL)
1100#define MX53_PAD_SD2_DATA2__AUDMUX_AUD4_TXD IOMUX_PAD(0x694, 0x308, 3, 0x734, 1, NO_PAD_CTRL)
1101#define MX53_PAD_SD2_DATA2__CSPI_SS1 IOMUX_PAD(0x694, 0x308, 5, 0x790, 3, NO_PAD_CTRL)
1102#define MX53_PAD_SD2_DATA2__SJC_FAIL IOMUX_PAD(0x694, 0x308, 7, __NA_, 0, NO_PAD_CTRL)
1103#define MX53_PAD_SD2_DATA1__ESDHC2_DAT1 IOMUX_PAD(0x698, 0x30C, 0, __NA_, 0, MX53_SDHC_PAD_CTRL)
1104#define MX53_PAD_SD2_DATA1__GPIO1_14 IOMUX_PAD(0x698, 0x30C, 1, __NA_, 0, NO_PAD_CTRL)
1105#define MX53_PAD_SD2_DATA1__KPP_COL_7 IOMUX_PAD(0x698, 0x30C, 2, 0x848, 1, NO_PAD_CTRL)
1106#define MX53_PAD_SD2_DATA1__AUDMUX_AUD4_TXFS IOMUX_PAD(0x698, 0x30C, 3, 0x744, 0, NO_PAD_CTRL)
1107#define MX53_PAD_SD2_DATA1__CSPI_SS0 IOMUX_PAD(0x698, 0x30C, 5, 0x78C, 4, NO_PAD_CTRL)
1108#define MX53_PAD_SD2_DATA1__RTIC_SEC_VIO IOMUX_PAD(0x698, 0x30C, 7, __NA_, 0, NO_PAD_CTRL)
1109#define MX53_PAD_SD2_DATA0__ESDHC2_DAT0 IOMUX_PAD(0x69C, 0x310, 0, __NA_, 0, MX53_SDHC_PAD_CTRL)
1110#define MX53_PAD_SD2_DATA0__GPIO1_15 IOMUX_PAD(0x69C, 0x310, 1, __NA_, 0, NO_PAD_CTRL)
1111#define MX53_PAD_SD2_DATA0__KPP_ROW_7 IOMUX_PAD(0x69C, 0x310, 2, 0x854, 1, NO_PAD_CTRL)
1112#define MX53_PAD_SD2_DATA0__AUDMUX_AUD4_RXD IOMUX_PAD(0x69C, 0x310, 3, 0x730, 1, NO_PAD_CTRL)
1113#define MX53_PAD_SD2_DATA0__CSPI_MISO IOMUX_PAD(0x69C, 0x310, 5, 0x784, 3, NO_PAD_CTRL)
1114#define MX53_PAD_SD2_DATA0__RTIC_DONE_INT IOMUX_PAD(0x69C, 0x310, 7, __NA_, 0, NO_PAD_CTRL)
1115#define MX53_PAD_GPIO_0__CCM_CLKO IOMUX_PAD(0x6A4, 0x314, 0, __NA_, 0, NO_PAD_CTRL)
1116#define MX53_PAD_GPIO_0__GPIO1_0 IOMUX_PAD(0x6A4, 0x314, 1, __NA_, 0, NO_PAD_CTRL)
1117#define MX53_PAD_GPIO_0__KPP_COL_5 IOMUX_PAD(0x6A4, 0x314, 2, 0x840, 3, NO_PAD_CTRL)
1118#define MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK IOMUX_PAD(0x6A4, 0x314, 3, __NA_, 0, NO_PAD_CTRL)
1119#define MX53_PAD_GPIO_0__EPIT1_EPITO IOMUX_PAD(0x6A4, 0x314, 4, __NA_, 0, NO_PAD_CTRL)
1120#define MX53_PAD_GPIO_0__SRTC_ALARM_DEB IOMUX_PAD(0x6A4, 0x314, 5, __NA_, 0, NO_PAD_CTRL)
1121#define MX53_PAD_GPIO_0__USBOH3_USBH1_PWR IOMUX_PAD(0x6A4, 0x314, 6, __NA_, 0, NO_PAD_CTRL)
1122#define MX53_PAD_GPIO_0__CSU_TD IOMUX_PAD(0x6A4, 0x314, 7, __NA_, 0, NO_PAD_CTRL)
1123#define MX53_PAD_GPIO_1__ESAI1_SCKR IOMUX_PAD(0x6A8, 0x318, 0, 0x7DC, 1, NO_PAD_CTRL)
1124#define MX53_PAD_GPIO_1__GPIO1_1 IOMUX_PAD(0x6A8, 0x318, 1, __NA_, 0, NO_PAD_CTRL)
1125#define MX53_PAD_GPIO_1__KPP_ROW_5 IOMUX_PAD(0x6A8, 0x318, 2, 0x84C, 2, NO_PAD_CTRL)
1126#define MX53_PAD_GPIO_1__CCM_SSI_EXT2_CLK IOMUX_PAD(0x6A8, 0x318, 3, __NA_, 0, NO_PAD_CTRL)
1127#define MX53_PAD_GPIO_1__PWM2_PWMO IOMUX_PAD(0x6A8, 0x318, 4, __NA_, 0, NO_PAD_CTRL)
1128#define MX53_PAD_GPIO_1__WDOG2_WDOG_B IOMUX_PAD(0x6A8, 0x318, 5, __NA_, 0, NO_PAD_CTRL)
1129#define MX53_PAD_GPIO_1__ESDHC1_CD IOMUX_PAD(0x6A8, 0x318, 6, __NA_, 0, NO_PAD_CTRL)
1130#define MX53_PAD_GPIO_1__SRC_TESTER_ACK IOMUX_PAD(0x6A8, 0x318, 7, __NA_, 0, NO_PAD_CTRL)
1131#define MX53_PAD_GPIO_9__ESAI1_FSR IOMUX_PAD(0x6AC, 0x31C, 0, 0x7CC, 1, NO_PAD_CTRL)
1132#define MX53_PAD_GPIO_9__GPIO1_9 IOMUX_PAD(0x6AC, 0x31C, 1, __NA_, 0, NO_PAD_CTRL)
1133#define MX53_PAD_GPIO_9__KPP_COL_6 IOMUX_PAD(0x6AC, 0x31C, 2, 0x844, 2, NO_PAD_CTRL)
1134#define MX53_PAD_GPIO_9__CCM_REF_EN_B IOMUX_PAD(0x6AC, 0x31C, 3, __NA_, 0, NO_PAD_CTRL)
1135#define MX53_PAD_GPIO_9__PWM1_PWMO IOMUX_PAD(0x6AC, 0x31C, 4, __NA_, 0, NO_PAD_CTRL)
1136#define MX53_PAD_GPIO_9__WDOG1_WDOG_B IOMUX_PAD(0x6AC, 0x31C, 5, __NA_, 0, NO_PAD_CTRL)
1137#define MX53_PAD_GPIO_9__ESDHC1_WP IOMUX_PAD(0x6AC, 0x31C, 6, 0x7FC, 1, NO_PAD_CTRL)
1138#define MX53_PAD_GPIO_9__SCC_FAIL_STATE IOMUX_PAD(0x6AC, 0x31C, 7, __NA_, 0, NO_PAD_CTRL)
1139#define MX53_PAD_GPIO_3__ESAI1_HCKR IOMUX_PAD(0x6B0, 0x320, 0, 0x7D4, 1, NO_PAD_CTRL)
1140#define MX53_PAD_GPIO_3__GPIO1_3 IOMUX_PAD(0x6B0, 0x320, 1, __NA_, 0, NO_PAD_CTRL)
1141#define MX53_PAD_GPIO_3__I2C3_SCL IOMUX_PAD(0x6B0, 0x320, 2 | IOMUX_CONFIG_SION, 0x824, 1, NO_PAD_CTRL)
1142#define MX53_PAD_GPIO_3__DPLLIP1_TOG_EN IOMUX_PAD(0x6B0, 0x320, 3, __NA_, 0, NO_PAD_CTRL)
1143#define MX53_PAD_GPIO_3__CCM_CLKO2 IOMUX_PAD(0x6B0, 0x320, 4, __NA_, 0, NO_PAD_CTRL)
1144#define MX53_PAD_GPIO_3__OBSERVE_MUX_OBSRV_INT_OUT0 IOMUX_PAD(0x6B0, 0x320, 5, __NA_, 0, NO_PAD_CTRL)
1145#define MX53_PAD_GPIO_3__USBOH3_USBH1_OC IOMUX_PAD(0x6B0, 0x320, 6, 0x8A0, 1, NO_PAD_CTRL)
1146#define MX53_PAD_GPIO_3__MLB_MLBCLK IOMUX_PAD(0x6B0, 0x320, 7, 0x858, 2, NO_PAD_CTRL)
1147#define MX53_PAD_GPIO_6__ESAI1_SCKT IOMUX_PAD(0x6B4, 0x324, 0, 0x7E0, 1, NO_PAD_CTRL)
1148#define MX53_PAD_GPIO_6__GPIO1_6 IOMUX_PAD(0x6B4, 0x324, 1, __NA_, 0, NO_PAD_CTRL)
1149#define MX53_PAD_GPIO_6__I2C3_SDA IOMUX_PAD(0x6B4, 0x324, 2 | IOMUX_CONFIG_SION, 0x828, 1, NO_PAD_CTRL)
1150#define MX53_PAD_GPIO_6__CCM_CCM_OUT_0 IOMUX_PAD(0x6B4, 0x324, 3, __NA_, 0, NO_PAD_CTRL)
1151#define MX53_PAD_GPIO_6__CSU_CSU_INT_DEB IOMUX_PAD(0x6B4, 0x324, 4, __NA_, 0, NO_PAD_CTRL)
1152#define MX53_PAD_GPIO_6__OBSERVE_MUX_OBSRV_INT_OUT1 IOMUX_PAD(0x6B4, 0x324, 5, __NA_, 0, NO_PAD_CTRL)
1153#define MX53_PAD_GPIO_6__ESDHC2_LCTL IOMUX_PAD(0x6B4, 0x324, 6, __NA_, 0, NO_PAD_CTRL)
1154#define MX53_PAD_GPIO_6__MLB_MLBSIG IOMUX_PAD(0x6B4, 0x324, 7, 0x860, 2, NO_PAD_CTRL)
1155#define MX53_PAD_GPIO_2__ESAI1_FST IOMUX_PAD(0x6B8, 0x328, 0, 0x7D0, 1, NO_PAD_CTRL)
1156#define MX53_PAD_GPIO_2__GPIO1_2 IOMUX_PAD(0x6B8, 0x328, 1, __NA_, 0, NO_PAD_CTRL)
1157#define MX53_PAD_GPIO_2__KPP_ROW_6 IOMUX_PAD(0x6B8, 0x328, 2, 0x850, 2, NO_PAD_CTRL)
1158#define MX53_PAD_GPIO_2__CCM_CCM_OUT_1 IOMUX_PAD(0x6B8, 0x328, 3, __NA_, 0, NO_PAD_CTRL)
1159#define MX53_PAD_GPIO_2__CSU_CSU_ALARM_AUT_0 IOMUX_PAD(0x6B8, 0x328, 4, __NA_, 0, NO_PAD_CTRL)
1160#define MX53_PAD_GPIO_2__OBSERVE_MUX_OBSRV_INT_OUT2 IOMUX_PAD(0x6B8, 0x328, 5, __NA_, 0, NO_PAD_CTRL)
1161#define MX53_PAD_GPIO_2__ESDHC2_WP IOMUX_PAD(0x6B8, 0x328, 6, __NA_, 0, NO_PAD_CTRL)
1162#define MX53_PAD_GPIO_2__MLB_MLBDAT IOMUX_PAD(0x6B8, 0x328, 7, 0x85C, 2, NO_PAD_CTRL)
1163#define MX53_PAD_GPIO_4__ESAI1_HCKT IOMUX_PAD(0x6BC, 0x32C, 0, 0x7D8, 1, NO_PAD_CTRL)
1164#define MX53_PAD_GPIO_4__GPIO1_4 IOMUX_PAD(0x6BC, 0x32C, 1, __NA_, 0, NO_PAD_CTRL)
1165#define MX53_PAD_GPIO_4__KPP_COL_7 IOMUX_PAD(0x6BC, 0x32C, 2, 0x848, 2, NO_PAD_CTRL)
1166#define MX53_PAD_GPIO_4__CCM_CCM_OUT_2 IOMUX_PAD(0x6BC, 0x32C, 3, __NA_, 0, NO_PAD_CTRL)
1167#define MX53_PAD_GPIO_4__CSU_CSU_ALARM_AUT_1 IOMUX_PAD(0x6BC, 0x32C, 4, __NA_, 0, NO_PAD_CTRL)
1168#define MX53_PAD_GPIO_4__OBSERVE_MUX_OBSRV_INT_OUT3 IOMUX_PAD(0x6BC, 0x32C, 5, __NA_, 0, NO_PAD_CTRL)
1169#define MX53_PAD_GPIO_4__ESDHC2_CD IOMUX_PAD(0x6BC, 0x32C, 6, __NA_, 0, NO_PAD_CTRL)
1170#define MX53_PAD_GPIO_4__SCC_SEC_STATE IOMUX_PAD(0x6BC, 0x32C, 7, __NA_, 0, NO_PAD_CTRL)
1171#define MX53_PAD_GPIO_5__ESAI1_TX2_RX3 IOMUX_PAD(0x6C0, 0x330, 0, 0x7EC, 1, NO_PAD_CTRL)
1172#define MX53_PAD_GPIO_5__GPIO1_5 IOMUX_PAD(0x6C0, 0x330, 1, __NA_, 0, NO_PAD_CTRL)
1173#define MX53_PAD_GPIO_5__KPP_ROW_7 IOMUX_PAD(0x6C0, 0x330, 2, 0x854, 2, NO_PAD_CTRL)
1174#define MX53_PAD_GPIO_5__CCM_CLKO IOMUX_PAD(0x6C0, 0x330, 3, __NA_, 0, NO_PAD_CTRL)
1175#define MX53_PAD_GPIO_5__CSU_CSU_ALARM_AUT_2 IOMUX_PAD(0x6C0, 0x330, 4, __NA_, 0, NO_PAD_CTRL)
1176#define MX53_PAD_GPIO_5__OBSERVE_MUX_OBSRV_INT_OUT4 IOMUX_PAD(0x6C0, 0x330, 5, __NA_, 0, NO_PAD_CTRL)
1177#define MX53_PAD_GPIO_5__I2C3_SCL IOMUX_PAD(0x6C0, 0x330, 6 | IOMUX_CONFIG_SION, 0x824, 2, NO_PAD_CTRL)
1178#define MX53_PAD_GPIO_5__CCM_PLL1_BYP IOMUX_PAD(0x6C0, 0x330, 7, 0x770, 1, NO_PAD_CTRL)
1179#define MX53_PAD_GPIO_7__ESAI1_TX4_RX1 IOMUX_PAD(0x6C4, 0x334, 0, 0x7F4, 1, NO_PAD_CTRL)
1180#define MX53_PAD_GPIO_7__GPIO1_7 IOMUX_PAD(0x6C4, 0x334, 1, __NA_, 0, NO_PAD_CTRL)
1181#define MX53_PAD_GPIO_7__EPIT1_EPITO IOMUX_PAD(0x6C4, 0x334, 2, __NA_, 0, NO_PAD_CTRL)
1182#define MX53_PAD_GPIO_7__CAN1_TXCAN IOMUX_PAD(0x6C4, 0x334, 3, __NA_, 0, NO_PAD_CTRL)
1183#define MX53_PAD_GPIO_7__UART2_TXD_MUX IOMUX_PAD(0x6C4, 0x334, 4, __NA_, 0, MX53_UART_PAD_CTRL)
1184#define MX53_PAD_GPIO_7__FIRI_RXD IOMUX_PAD(0x6C4, 0x334, 5, 0x80C, 1, NO_PAD_CTRL)
1185#define MX53_PAD_GPIO_7__SPDIF_PLOCK IOMUX_PAD(0x6C4, 0x334, 6, __NA_, 0, NO_PAD_CTRL)
1186#define MX53_PAD_GPIO_7__CCM_PLL2_BYP IOMUX_PAD(0x6C4, 0x334, 7, 0x774, 1, NO_PAD_CTRL)
1187#define MX53_PAD_GPIO_8__ESAI1_TX5_RX0 IOMUX_PAD(0x6C8, 0x338, 0, 0x7F8, 1, NO_PAD_CTRL)
1188#define MX53_PAD_GPIO_8__GPIO1_8 IOMUX_PAD(0x6C8, 0x338, 1, __NA_, 0, NO_PAD_CTRL)
1189#define MX53_PAD_GPIO_8__EPIT2_EPITO IOMUX_PAD(0x6C8, 0x338, 2, __NA_, 0, NO_PAD_CTRL)
1190#define MX53_PAD_GPIO_8__CAN1_RXCAN IOMUX_PAD(0x6C8, 0x338, 3, 0x760, 2, NO_PAD_CTRL)
1191#define MX53_PAD_GPIO_8__UART2_RXD_MUX IOMUX_PAD(0x6C8, 0x338, 4, 0x880, 5, MX53_UART_PAD_CTRL)
1192#define MX53_PAD_GPIO_8__FIRI_TXD IOMUX_PAD(0x6C8, 0x338, 5, __NA_, 0, NO_PAD_CTRL)
1193#define MX53_PAD_GPIO_8__SPDIF_SRCLK IOMUX_PAD(0x6C8, 0x338, 6, __NA_, 0, NO_PAD_CTRL)
1194#define MX53_PAD_GPIO_8__CCM_PLL3_BYP IOMUX_PAD(0x6C8, 0x338, 7, 0x778, 1, NO_PAD_CTRL)
1195#define MX53_PAD_GPIO_16__ESAI1_TX3_RX2 IOMUX_PAD(0x6CC, 0x33C, 0, 0x7F0, 1, NO_PAD_CTRL)
1196#define MX53_PAD_GPIO_16__GPIO7_11 IOMUX_PAD(0x6CC, 0x33C, 1, __NA_, 0, NO_PAD_CTRL)
1197#define MX53_PAD_GPIO_16__TZIC_PWRFAIL_INT IOMUX_PAD(0x6CC, 0x33C, 2, __NA_, 0, NO_PAD_CTRL)
1198#define MX53_PAD_GPIO_16__RTC_CE_RTC_EXT_TRIG1 IOMUX_PAD(0x6CC, 0x33C, 4, __NA_, 0, NO_PAD_CTRL)
1199#define MX53_PAD_GPIO_16__SPDIF_IN1 IOMUX_PAD(0x6CC, 0x33C, 5, 0x870, 1, NO_PAD_CTRL)
1200#define MX53_PAD_GPIO_16__I2C3_SDA IOMUX_PAD(0x6CC, 0x33C, 6 | IOMUX_CONFIG_SION, 0x828, 2, NO_PAD_CTRL)
1201#define MX53_PAD_GPIO_16__SJC_DE_B IOMUX_PAD(0x6CC, 0x33C, 7, __NA_, 0, NO_PAD_CTRL)
1202#define MX53_PAD_GPIO_17__ESAI1_TX0 IOMUX_PAD(0x6D0, 0x340, 0, 0x7E4, 1, NO_PAD_CTRL)
1203#define MX53_PAD_GPIO_17__GPIO7_12 IOMUX_PAD(0x6D0, 0x340, 1, __NA_, 0, NO_PAD_CTRL)
1204#define MX53_PAD_GPIO_17__SDMA_EXT_EVENT_0 IOMUX_PAD(0x6D0, 0x340, 2, 0x868, 1, NO_PAD_CTRL)
1205#define MX53_PAD_GPIO_17__GPC_PMIC_RDY IOMUX_PAD(0x6D0, 0x340, 3, 0x810, 1, NO_PAD_CTRL)
1206#define MX53_PAD_GPIO_17__RTC_CE_RTC_FSV_TRIG IOMUX_PAD(0x6D0, 0x340, 4, __NA_, 0, NO_PAD_CTRL)
1207#define MX53_PAD_GPIO_17__SPDIF_OUT1 IOMUX_PAD(0x6D0, 0x340, 5, __NA_, 0, NO_PAD_CTRL)
1208#define MX53_PAD_GPIO_17__IPU_SNOOP2 IOMUX_PAD(0x6D0, 0x340, 6, __NA_, 0, NO_PAD_CTRL)
1209#define MX53_PAD_GPIO_17__SJC_JTAG_ACT IOMUX_PAD(0x6D0, 0x340, 7, __NA_, 0, NO_PAD_CTRL)
1210#define MX53_PAD_GPIO_18__ESAI1_TX1 IOMUX_PAD(0x6D4, 0x344, 0, 0x7E8, 1, NO_PAD_CTRL)
1211#define MX53_PAD_GPIO_18__GPIO7_13 IOMUX_PAD(0x6D4, 0x344, 1, __NA_, 0, NO_PAD_CTRL)
1212#define MX53_PAD_GPIO_18__SDMA_EXT_EVENT_1 IOMUX_PAD(0x6D4, 0x344, 2, 0x86C, 1, NO_PAD_CTRL)
1213#define MX53_PAD_GPIO_18__OWIRE_LINE IOMUX_PAD(0x6D4, 0x344, 3, 0x864, 1, NO_PAD_CTRL)
1214#define MX53_PAD_GPIO_18__RTC_CE_RTC_ALARM2_TRIG IOMUX_PAD(0x6D4, 0x344, 4, __NA_, 0, NO_PAD_CTRL)
1215#define MX53_PAD_GPIO_18__CCM_ASRC_EXT_CLK IOMUX_PAD(0x6D4, 0x344, 5, 0x768, 1, NO_PAD_CTRL)
1216#define MX53_PAD_GPIO_18__ESDHC1_LCTL IOMUX_PAD(0x6D4, 0x344, 6, __NA_, 0, NO_PAD_CTRL)
1217#define MX53_PAD_GPIO_18__SRC_SYSTEM_RST IOMUX_PAD(0x6D4, 0x344, 7, __NA_, 0, NO_PAD_CTRL)
1218
1219#endif /* __MACH_IOMUX_MX53_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mmc.h b/arch/arm/plat-mxc/include/mach/mmc.h
deleted file mode 100644
index 29115f405af..00000000000
--- a/arch/arm/plat-mxc/include/mach/mmc.h
+++ /dev/null
@@ -1,39 +0,0 @@
1#ifndef ASMARM_ARCH_MMC_H
2#define ASMARM_ARCH_MMC_H
3
4#include <linux/mmc/host.h>
5
6struct device;
7
8/* board specific SDHC data, optional.
9 * If not present, a writable card with 3,3V is assumed.
10 */
11struct imxmmc_platform_data {
12 /* Return values for the get_ro callback should be:
13 * 0 for a read/write card
14 * 1 for a read-only card
15 * -ENOSYS when not supported (equal to NULL callback)
16 * or a negative errno value when something bad happened
17 */
18 int (*get_ro)(struct device *);
19
20 /* board specific hook to (de)initialize the SD slot.
21 * The board code can call 'handler' on a card detection
22 * change giving data as argument.
23 */
24 int (*init)(struct device *dev, irq_handler_t handler, void *data);
25 void (*exit)(struct device *dev, void *data);
26
27 /* available voltages. If not given, assume
28 * MMC_VDD_32_33 | MMC_VDD_33_34
29 */
30 unsigned int ocr_avail;
31
32 /* adjust slot voltage */
33 void (*setpower)(struct device *, unsigned int vdd);
34
35 /* enable card detect using DAT3 */
36 int dat3_card_detect;
37};
38
39#endif
diff --git a/arch/arm/plat-mxc/include/mach/mx1_camera.h b/arch/arm/plat-mxc/include/mach/mx1_camera.h
deleted file mode 100644
index 4fd6c70314b..00000000000
--- a/arch/arm/plat-mxc/include/mach/mx1_camera.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * mx1_camera.h - i.MX1/i.MXL camera driver header file
3 *
4 * Copyright (c) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
5 * Copyright (C) 2009, Darius Augulis <augulis.darius@gmail.com>
6 *
7 * Based on PXA camera.h file:
8 * Copyright (C) 2003, Intel Corporation
9 * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
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 __ASM_ARCH_CAMERA_H_
17#define __ASM_ARCH_CAMERA_H_
18
19#define MX1_CAMERA_DATA_HIGH 1
20#define MX1_CAMERA_PCLK_RISING 2
21#define MX1_CAMERA_VSYNC_HIGH 4
22
23extern unsigned char mx1_camera_sof_fiq_start, mx1_camera_sof_fiq_end;
24
25/**
26 * struct mx1_camera_pdata - i.MX1/i.MXL camera platform data
27 * @mclk_10khz: master clock frequency in 10kHz units
28 * @flags: MX1 camera platform flags
29 */
30struct mx1_camera_pdata {
31 unsigned long mclk_10khz;
32 unsigned long flags;
33};
34
35#endif /* __ASM_ARCH_CAMERA_H_ */
diff --git a/arch/arm/plat-mxc/include/mach/mx21-usbhost.h b/arch/arm/plat-mxc/include/mach/mx21-usbhost.h
deleted file mode 100644
index 22d0b596262..00000000000
--- a/arch/arm/plat-mxc/include/mach/mx21-usbhost.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * Copyright (C) 2009 Martin Fuzzey <mfuzzey@gmail.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
15#ifndef __ASM_ARCH_MX21_USBH
16#define __ASM_ARCH_MX21_USBH
17
18enum mx21_usbh_xcvr {
19 /* Values below as used by hardware (HWMODE register) */
20 MX21_USBXCVR_TXDIF_RXDIF = 0,
21 MX21_USBXCVR_TXDIF_RXSE = 1,
22 MX21_USBXCVR_TXSE_RXDIF = 2,
23 MX21_USBXCVR_TXSE_RXSE = 3,
24};
25
26struct mx21_usbh_platform_data {
27 enum mx21_usbh_xcvr host_xcvr; /* tranceiver mode host 1,2 ports */
28 enum mx21_usbh_xcvr otg_xcvr; /* tranceiver mode otg (as host) port */
29 u16 enable_host1:1,
30 enable_host2:1,
31 enable_otg_host:1, /* enable "OTG" port (as host) */
32 host1_xcverless:1, /* traceiverless host1 port */
33 host1_txenoe:1, /* output enable host1 transmit enable */
34 otg_ext_xcvr:1, /* external tranceiver for OTG port */
35 unused:10;
36};
37
38#endif /* __ASM_ARCH_MX21_USBH */
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h
index 627d94f1b01..ec466400a20 100644
--- a/arch/arm/plat-mxc/include/mach/mx25.h
+++ b/arch/arm/plat-mxc/include/mach/mx25.h
@@ -98,6 +98,7 @@
98#define MX25_INT_UART1 (NR_IRQS_LEGACY + 45) 98#define MX25_INT_UART1 (NR_IRQS_LEGACY + 45)
99#define MX25_INT_GPIO2 (NR_IRQS_LEGACY + 51) 99#define MX25_INT_GPIO2 (NR_IRQS_LEGACY + 51)
100#define MX25_INT_GPIO1 (NR_IRQS_LEGACY + 52) 100#define MX25_INT_GPIO1 (NR_IRQS_LEGACY + 52)
101#define MX25_INT_GPT1 (NR_IRQS_LEGACY + 54)
101#define MX25_INT_FEC (NR_IRQS_LEGACY + 57) 102#define MX25_INT_FEC (NR_IRQS_LEGACY + 57)
102 103
103#define MX25_DMA_REQ_SSI2_RX1 22 104#define MX25_DMA_REQ_SSI2_RX1 22
diff --git a/arch/arm/plat-mxc/include/mach/mx2_cam.h b/arch/arm/plat-mxc/include/mach/mx2_cam.h
deleted file mode 100644
index 3c080a32dbf..00000000000
--- a/arch/arm/plat-mxc/include/mach/mx2_cam.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * mx2-cam.h - i.MX27/i.MX25 camera driver header file
3 *
4 * Copyright (C) 2003, Intel Corporation
5 * Copyright (C) 2008, Sascha Hauer <s.hauer@pengutronix.de>
6 * Copyright (C) 2010, Baruch Siach <baruch@tkos.co.il>
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., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23#ifndef __MACH_MX2_CAM_H_
24#define __MACH_MX2_CAM_H_
25
26#define MX2_CAMERA_SWAP16 (1 << 0)
27#define MX2_CAMERA_EXT_VSYNC (1 << 1)
28#define MX2_CAMERA_CCIR (1 << 2)
29#define MX2_CAMERA_CCIR_INTERLACE (1 << 3)
30#define MX2_CAMERA_HSYNC_HIGH (1 << 4)
31#define MX2_CAMERA_GATED_CLOCK (1 << 5)
32#define MX2_CAMERA_INV_DATA (1 << 6)
33#define MX2_CAMERA_PCLK_SAMPLE_RISING (1 << 7)
34#define MX2_CAMERA_PACK_DIR_MSB (1 << 8)
35
36/**
37 * struct mx2_camera_platform_data - optional platform data for mx2_camera
38 * @flags: any combination of MX2_CAMERA_*
39 * @clk: clock rate of the csi block / 2
40 */
41struct mx2_camera_platform_data {
42 unsigned long flags;
43 unsigned long clk;
44};
45
46#endif /* __MACH_MX2_CAM_H_ */
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h
index dbced61d9fd..ee9b1f9215d 100644
--- a/arch/arm/plat-mxc/include/mach/mx31.h
+++ b/arch/arm/plat-mxc/include/mach/mx31.h
@@ -76,7 +76,7 @@
76#define MX31_RTIC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xec000) 76#define MX31_RTIC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xec000)
77 77
78#define MX31_ROMP_BASE_ADDR 0x60000000 78#define MX31_ROMP_BASE_ADDR 0x60000000
79#define MX31_ROMP_BASE_ADDR_VIRT 0xfc500000 79#define MX31_ROMP_BASE_ADDR_VIRT IOMEM(0xfc500000)
80#define MX31_ROMP_SIZE SZ_1M 80#define MX31_ROMP_SIZE SZ_1M
81 81
82#define MX31_AVIC_BASE_ADDR 0x68000000 82#define MX31_AVIC_BASE_ADDR 0x68000000
@@ -92,11 +92,11 @@
92#define MX31_CS3_BASE_ADDR 0xb2000000 92#define MX31_CS3_BASE_ADDR 0xb2000000
93 93
94#define MX31_CS4_BASE_ADDR 0xb4000000 94#define MX31_CS4_BASE_ADDR 0xb4000000
95#define MX31_CS4_BASE_ADDR_VIRT 0xf6000000 95#define MX31_CS4_BASE_ADDR_VIRT IOMEM(0xf6000000)
96#define MX31_CS4_SIZE SZ_32M 96#define MX31_CS4_SIZE SZ_32M
97 97
98#define MX31_CS5_BASE_ADDR 0xb6000000 98#define MX31_CS5_BASE_ADDR 0xb6000000
99#define MX31_CS5_BASE_ADDR_VIRT 0xf8000000 99#define MX31_CS5_BASE_ADDR_VIRT IOMEM(0xf8000000)
100#define MX31_CS5_SIZE SZ_32M 100#define MX31_CS5_SIZE SZ_32M
101 101
102#define MX31_X_MEMC_BASE_ADDR 0xb8000000 102#define MX31_X_MEMC_BASE_ADDR 0xb8000000
diff --git a/arch/arm/plat-mxc/include/mach/mx3_camera.h b/arch/arm/plat-mxc/include/mach/mx3_camera.h
deleted file mode 100644
index f226ee3777e..00000000000
--- a/arch/arm/plat-mxc/include/mach/mx3_camera.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * mx3_camera.h - i.MX3x camera driver header file
3 *
4 * Copyright (C) 2008, Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef _MX3_CAMERA_H_
18#define _MX3_CAMERA_H_
19
20#include <linux/device.h>
21
22#define MX3_CAMERA_CLK_SRC 1
23#define MX3_CAMERA_EXT_VSYNC 2
24#define MX3_CAMERA_DP 4
25#define MX3_CAMERA_PCP 8
26#define MX3_CAMERA_HSP 0x10
27#define MX3_CAMERA_VSP 0x20
28#define MX3_CAMERA_DATAWIDTH_4 0x40
29#define MX3_CAMERA_DATAWIDTH_8 0x80
30#define MX3_CAMERA_DATAWIDTH_10 0x100
31#define MX3_CAMERA_DATAWIDTH_15 0x200
32
33#define MX3_CAMERA_DATAWIDTH_MASK (MX3_CAMERA_DATAWIDTH_4 | MX3_CAMERA_DATAWIDTH_8 | \
34 MX3_CAMERA_DATAWIDTH_10 | MX3_CAMERA_DATAWIDTH_15)
35
36/**
37 * struct mx3_camera_pdata - i.MX3x camera platform data
38 * @flags: MX3_CAMERA_* flags
39 * @mclk_10khz: master clock frequency in 10kHz units
40 * @dma_dev: IPU DMA device to match against in channel allocation
41 */
42struct mx3_camera_pdata {
43 unsigned long flags;
44 unsigned long mclk_10khz;
45 struct device *dma_dev;
46};
47
48#endif
diff --git a/arch/arm/plat-mxc/include/mach/mx3fb.h b/arch/arm/plat-mxc/include/mach/mx3fb.h
deleted file mode 100644
index fdbe6000154..00000000000
--- a/arch/arm/plat-mxc/include/mach/mx3fb.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * Copyright (C) 2008
3 * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
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 __ASM_ARCH_MX3FB_H__
11#define __ASM_ARCH_MX3FB_H__
12
13#include <linux/device.h>
14#include <linux/fb.h>
15
16/* Proprietary FB_SYNC_ flags */
17#define FB_SYNC_OE_ACT_HIGH 0x80000000
18#define FB_SYNC_CLK_INVERT 0x40000000
19#define FB_SYNC_DATA_INVERT 0x20000000
20#define FB_SYNC_CLK_IDLE_EN 0x10000000
21#define FB_SYNC_SHARP_MODE 0x08000000
22#define FB_SYNC_SWAP_RGB 0x04000000
23#define FB_SYNC_CLK_SEL_EN 0x02000000
24
25/*
26 * Specify the way your display is connected. The IPU can arbitrarily
27 * map the internal colors to the external data lines. We only support
28 * the following mappings at the moment.
29 */
30enum disp_data_mapping {
31 /* blue -> d[0..5], green -> d[6..11], red -> d[12..17] */
32 IPU_DISP_DATA_MAPPING_RGB666,
33 /* blue -> d[0..4], green -> d[5..10], red -> d[11..15] */
34 IPU_DISP_DATA_MAPPING_RGB565,
35 /* blue -> d[0..7], green -> d[8..15], red -> d[16..23] */
36 IPU_DISP_DATA_MAPPING_RGB888,
37};
38
39/**
40 * struct mx3fb_platform_data - mx3fb platform data
41 *
42 * @dma_dev: pointer to the dma-device, used for dma-slave connection
43 * @mode: pointer to a platform-provided per mxc_register_fb() videomode
44 */
45struct mx3fb_platform_data {
46 struct device *dma_dev;
47 const char *name;
48 const struct fb_videomode *mode;
49 int num_modes;
50 enum disp_data_mapping disp_data_fmt;
51};
52
53#endif
diff --git a/arch/arm/plat-mxc/include/mach/mxc_ehci.h b/arch/arm/plat-mxc/include/mach/mxc_ehci.h
deleted file mode 100644
index 7eb9d132967..00000000000
--- a/arch/arm/plat-mxc/include/mach/mxc_ehci.h
+++ /dev/null
@@ -1,59 +0,0 @@
1#ifndef __INCLUDE_ASM_ARCH_MXC_EHCI_H
2#define __INCLUDE_ASM_ARCH_MXC_EHCI_H
3
4/* values for portsc field */
5#define MXC_EHCI_PHY_LOW_POWER_SUSPEND (1 << 23)
6#define MXC_EHCI_FORCE_FS (1 << 24)
7#define MXC_EHCI_UTMI_8BIT (0 << 28)
8#define MXC_EHCI_UTMI_16BIT (1 << 28)
9#define MXC_EHCI_SERIAL (1 << 29)
10#define MXC_EHCI_MODE_UTMI (0 << 30)
11#define MXC_EHCI_MODE_PHILIPS (1 << 30)
12#define MXC_EHCI_MODE_ULPI (2 << 30)
13#define MXC_EHCI_MODE_SERIAL (3 << 30)
14
15/* values for flags field */
16#define MXC_EHCI_INTERFACE_DIFF_UNI (0 << 0)
17#define MXC_EHCI_INTERFACE_DIFF_BI (1 << 0)
18#define MXC_EHCI_INTERFACE_SINGLE_UNI (2 << 0)
19#define MXC_EHCI_INTERFACE_SINGLE_BI (3 << 0)
20#define MXC_EHCI_INTERFACE_MASK (0xf)
21
22#define MXC_EHCI_POWER_PINS_ENABLED (1 << 5)
23#define MXC_EHCI_PWR_PIN_ACTIVE_HIGH (1 << 6)
24#define MXC_EHCI_OC_PIN_ACTIVE_LOW (1 << 7)
25#define MXC_EHCI_TTL_ENABLED (1 << 8)
26
27#define MXC_EHCI_INTERNAL_PHY (1 << 9)
28#define MXC_EHCI_IPPUE_DOWN (1 << 10)
29#define MXC_EHCI_IPPUE_UP (1 << 11)
30#define MXC_EHCI_WAKEUP_ENABLED (1 << 12)
31#define MXC_EHCI_ITC_NO_THRESHOLD (1 << 13)
32
33#define MXC_USBCTRL_OFFSET 0
34#define MXC_USB_PHY_CTR_FUNC_OFFSET 0x8
35#define MXC_USB_PHY_CTR_FUNC2_OFFSET 0xc
36#define MXC_USBH2CTRL_OFFSET 0x14
37
38#define MX5_USBOTHER_REGS_OFFSET 0x800
39
40/* USB_PHY_CTRL_FUNC2*/
41#define MX5_USB_UTMI_PHYCTRL1_PLLDIV_MASK 0x3
42#define MX5_USB_UTMI_PHYCTRL1_PLLDIV_SHIFT 0
43
44struct mxc_usbh_platform_data {
45 int (*init)(struct platform_device *pdev);
46 int (*exit)(struct platform_device *pdev);
47
48 unsigned int portsc;
49 struct usb_phy *otg;
50};
51
52int mx51_initialize_usb_hw(int port, unsigned int flags);
53int mx25_initialize_usb_hw(int port, unsigned int flags);
54int mx31_initialize_usb_hw(int port, unsigned int flags);
55int mx35_initialize_usb_hw(int port, unsigned int flags);
56int mx27_initialize_usb_hw(int port, unsigned int flags);
57
58#endif /* __INCLUDE_ASM_ARCH_MXC_EHCI_H */
59
diff --git a/arch/arm/plat-mxc/include/mach/mxc_nand.h b/arch/arm/plat-mxc/include/mach/mxc_nand.h
deleted file mode 100644
index 6bb96ef1600..00000000000
--- a/arch/arm/plat-mxc/include/mach/mxc_nand.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Sascha Hauer, kernel@pengutronix.de
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
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., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301, USA.
18 */
19
20#ifndef __ASM_ARCH_NAND_H
21#define __ASM_ARCH_NAND_H
22
23#include <linux/mtd/partitions.h>
24
25struct mxc_nand_platform_data {
26 unsigned int width; /* data bus width in bytes */
27 unsigned int hw_ecc:1; /* 0 if suppress hardware ECC */
28 unsigned int flash_bbt:1; /* set to 1 to use a flash based bbt */
29 struct mtd_partition *parts; /* partition table */
30 int nr_parts; /* size of parts */
31};
32#endif /* __ASM_ARCH_NAND_H */
diff --git a/arch/arm/plat-mxc/include/mach/sdma.h b/arch/arm/plat-mxc/include/mach/sdma.h
deleted file mode 100644
index 3a3942823c2..00000000000
--- a/arch/arm/plat-mxc/include/mach/sdma.h
+++ /dev/null
@@ -1,59 +0,0 @@
1#ifndef __MACH_MXC_SDMA_H__
2#define __MACH_MXC_SDMA_H__
3
4/**
5 * struct sdma_script_start_addrs - SDMA script start pointers
6 *
7 * start addresses of the different functions in the physical
8 * address space of the SDMA engine.
9 */
10struct sdma_script_start_addrs {
11 s32 ap_2_ap_addr;
12 s32 ap_2_bp_addr;
13 s32 ap_2_ap_fixed_addr;
14 s32 bp_2_ap_addr;
15 s32 loopback_on_dsp_side_addr;
16 s32 mcu_interrupt_only_addr;
17 s32 firi_2_per_addr;
18 s32 firi_2_mcu_addr;
19 s32 per_2_firi_addr;
20 s32 mcu_2_firi_addr;
21 s32 uart_2_per_addr;
22 s32 uart_2_mcu_addr;
23 s32 per_2_app_addr;
24 s32 mcu_2_app_addr;
25 s32 per_2_per_addr;
26 s32 uartsh_2_per_addr;
27 s32 uartsh_2_mcu_addr;
28 s32 per_2_shp_addr;
29 s32 mcu_2_shp_addr;
30 s32 ata_2_mcu_addr;
31 s32 mcu_2_ata_addr;
32 s32 app_2_per_addr;
33 s32 app_2_mcu_addr;
34 s32 shp_2_per_addr;
35 s32 shp_2_mcu_addr;
36 s32 mshc_2_mcu_addr;
37 s32 mcu_2_mshc_addr;
38 s32 spdif_2_mcu_addr;
39 s32 mcu_2_spdif_addr;
40 s32 asrc_2_mcu_addr;
41 s32 ext_mem_2_ipu_addr;
42 s32 descrambler_addr;
43 s32 dptc_dvfs_addr;
44 s32 utra_addr;
45 s32 ram_code_start_addr;
46};
47
48/**
49 * struct sdma_platform_data - platform specific data for SDMA engine
50 *
51 * @fw_name The firmware name
52 * @script_addrs SDMA scripts addresses in SDMA ROM
53 */
54struct sdma_platform_data {
55 char *fw_name;
56 struct sdma_script_start_addrs *script_addrs;
57};
58
59#endif /* __MACH_MXC_SDMA_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/spi.h b/arch/arm/plat-mxc/include/mach/spi.h
deleted file mode 100644
index 08be445e8eb..00000000000
--- a/arch/arm/plat-mxc/include/mach/spi.h
+++ /dev/null
@@ -1,27 +0,0 @@
1
2#ifndef __MACH_SPI_H_
3#define __MACH_SPI_H_
4
5/*
6 * struct spi_imx_master - device.platform_data for SPI controller devices.
7 * @chipselect: Array of chipselects for this master. Numbers >= 0 mean gpio
8 * pins, numbers < 0 mean internal CSPI chipselects according
9 * to MXC_SPI_CS(). Normally you want to use gpio based chip
10 * selects as the CSPI module tries to be intelligent about
11 * when to assert the chipselect: The CSPI module deasserts the
12 * chipselect once it runs out of input data. The other problem
13 * is that it is not possible to mix between high active and low
14 * active chipselects on one single bus using the internal
15 * chipselects. Unfortunately Freescale decided to put some
16 * chipselects on dedicated pins which are not usable as gpios,
17 * so we have to support the internal chipselects.
18 * @num_chipselect: ARRAY_SIZE(chipselect)
19 */
20struct spi_imx_master {
21 int *chipselect;
22 int num_chipselect;
23};
24
25#define MXC_SPI_CS(no) ((no) - 32)
26
27#endif /* __MACH_SPI_H_*/
diff --git a/arch/arm/plat-mxc/include/mach/ssi.h b/arch/arm/plat-mxc/include/mach/ssi.h
deleted file mode 100644
index 63f3c280423..00000000000
--- a/arch/arm/plat-mxc/include/mach/ssi.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef __MACH_SSI_H
2#define __MACH_SSI_H
3
4struct snd_ac97;
5
6extern unsigned char imx_ssi_fiq_start, imx_ssi_fiq_end;
7extern unsigned long imx_ssi_fiq_base, imx_ssi_fiq_tx_buffer, imx_ssi_fiq_rx_buffer;
8
9struct imx_ssi_platform_data {
10 unsigned int flags;
11#define IMX_SSI_DMA (1 << 0)
12#define IMX_SSI_USE_AC97 (1 << 1)
13#define IMX_SSI_NET (1 << 2)
14#define IMX_SSI_SYN (1 << 3)
15#define IMX_SSI_USE_I2S_SLAVE (1 << 4)
16 void (*ac97_reset) (struct snd_ac97 *ac97);
17 void (*ac97_warm_reset)(struct snd_ac97 *ac97);
18};
19
20#endif /* __MACH_SSI_H */
21
diff --git a/arch/arm/plat-mxc/include/mach/usb.h b/arch/arm/plat-mxc/include/mach/usb.h
deleted file mode 100644
index be273371f34..00000000000
--- a/arch/arm/plat-mxc/include/mach/usb.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * Copyright (C) 2008 Darius Augulis <augulis.darius@gmail.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
15#ifndef __ASM_ARCH_MXC_USB
16#define __ASM_ARCH_MXC_USB
17
18struct imxusb_platform_data {
19 int (*init)(struct device *);
20 void (*exit)(struct device *);
21};
22
23#endif /* __ASM_ARCH_MXC_USB */
diff --git a/arch/arm/plat-mxc/ssi-fiq-ksym.c b/arch/arm/plat-mxc/ssi-fiq-ksym.c
index b5fad454da7..792090f9a03 100644
--- a/arch/arm/plat-mxc/ssi-fiq-ksym.c
+++ b/arch/arm/plat-mxc/ssi-fiq-ksym.c
@@ -10,7 +10,7 @@
10 10
11#include <linux/module.h> 11#include <linux/module.h>
12 12
13#include <mach/ssi.h> 13#include <linux/platform_data/asoc-imx-ssi.h>
14 14
15EXPORT_SYMBOL(imx_ssi_fiq_tx_buffer); 15EXPORT_SYMBOL(imx_ssi_fiq_tx_buffer);
16EXPORT_SYMBOL(imx_ssi_fiq_rx_buffer); 16EXPORT_SYMBOL(imx_ssi_fiq_rx_buffer);
diff --git a/arch/arm/plat-mxc/ssi-fiq.S b/arch/arm/plat-mxc/ssi-fiq.S
index 8397a2dd19f..a8b93c5f29b 100644
--- a/arch/arm/plat-mxc/ssi-fiq.S
+++ b/arch/arm/plat-mxc/ssi-fiq.S
@@ -34,91 +34,98 @@
34 .global imx_ssi_fiq_rx_buffer 34 .global imx_ssi_fiq_rx_buffer
35 .global imx_ssi_fiq_tx_buffer 35 .global imx_ssi_fiq_tx_buffer
36 36
37/*
38 * imx_ssi_fiq_start is _intentionally_ not marked as a function symbol
39 * using ENDPROC(). imx_ssi_fiq_start and imx_ssi_fiq_end are used to
40 * mark the function body so that it can be copied to the FIQ vector in
41 * the vectors page. imx_ssi_fiq_start should only be called as the result
42 * of an FIQ: calling it directly will not work.
43 */
37imx_ssi_fiq_start: 44imx_ssi_fiq_start:
38 ldr r12, imx_ssi_fiq_base 45 ldr r12, .L_imx_ssi_fiq_base
39 46
40 /* TX */ 47 /* TX */
41 ldr r11, imx_ssi_fiq_tx_buffer 48 ldr r13, .L_imx_ssi_fiq_tx_buffer
42 49
43 /* shall we send? */ 50 /* shall we send? */
44 ldr r13, [r12, #SSI_SIER] 51 ldr r11, [r12, #SSI_SIER]
45 tst r13, #SSI_SIER_TFE0_EN 52 tst r11, #SSI_SIER_TFE0_EN
46 beq 1f 53 beq 1f
47 54
48 /* TX FIFO empty? */ 55 /* TX FIFO empty? */
49 ldr r13, [r12, #SSI_SISR] 56 ldr r11, [r12, #SSI_SISR]
50 tst r13, #SSI_SISR_TFE0 57 tst r11, #SSI_SISR_TFE0
51 beq 1f 58 beq 1f
52 59
53 mov r10, #0x10000 60 mov r10, #0x10000
54 sub r10, #1 61 sub r10, #1
55 and r10, r10, r8 /* r10: current buffer offset */ 62 and r10, r10, r8 /* r10: current buffer offset */
56 63
57 add r11, r11, r10 64 add r13, r13, r10
58 65
59 ldrh r13, [r11] 66 ldrh r11, [r13]
60 strh r13, [r12, #SSI_STX0] 67 strh r11, [r12, #SSI_STX0]
61 68
62 ldrh r13, [r11, #2] 69 ldrh r11, [r13, #2]
63 strh r13, [r12, #SSI_STX0] 70 strh r11, [r12, #SSI_STX0]
64 71
65 ldrh r13, [r11, #4] 72 ldrh r11, [r13, #4]
66 strh r13, [r12, #SSI_STX0] 73 strh r11, [r12, #SSI_STX0]
67 74
68 ldrh r13, [r11, #6] 75 ldrh r11, [r13, #6]
69 strh r13, [r12, #SSI_STX0] 76 strh r11, [r12, #SSI_STX0]
70 77
71 add r10, #8 78 add r10, #8
72 lsr r13, r8, #16 /* r13: buffer size */ 79 lsr r11, r8, #16 /* r11: buffer size */
73 cmp r10, r13 80 cmp r10, r11
74 lslgt r8, r13, #16 81 lslgt r8, r11, #16
75 addle r8, #8 82 addle r8, #8
761: 831:
77 /* RX */ 84 /* RX */
78 85
79 /* shall we receive? */ 86 /* shall we receive? */
80 ldr r13, [r12, #SSI_SIER] 87 ldr r11, [r12, #SSI_SIER]
81 tst r13, #SSI_SIER_RFF0_EN 88 tst r11, #SSI_SIER_RFF0_EN
82 beq 1f 89 beq 1f
83 90
84 /* RX FIFO full? */ 91 /* RX FIFO full? */
85 ldr r13, [r12, #SSI_SISR] 92 ldr r11, [r12, #SSI_SISR]
86 tst r13, #SSI_SISR_RFF0 93 tst r11, #SSI_SISR_RFF0
87 beq 1f 94 beq 1f
88 95
89 ldr r11, imx_ssi_fiq_rx_buffer 96 ldr r13, .L_imx_ssi_fiq_rx_buffer
90 97
91 mov r10, #0x10000 98 mov r10, #0x10000
92 sub r10, #1 99 sub r10, #1
93 and r10, r10, r9 /* r10: current buffer offset */ 100 and r10, r10, r9 /* r10: current buffer offset */
94 101
95 add r11, r11, r10 102 add r13, r13, r10
96 103
97 ldr r13, [r12, #SSI_SACNT] 104 ldr r11, [r12, #SSI_SACNT]
98 tst r13, #SSI_SACNT_AC97EN 105 tst r11, #SSI_SACNT_AC97EN
99 106
100 ldr r13, [r12, #SSI_SRX0] 107 ldr r11, [r12, #SSI_SRX0]
101 strh r13, [r11] 108 strh r11, [r13]
102 109
103 ldr r13, [r12, #SSI_SRX0] 110 ldr r11, [r12, #SSI_SRX0]
104 strh r13, [r11, #2] 111 strh r11, [r13, #2]
105 112
106 /* dummy read to skip slot 12 */ 113 /* dummy read to skip slot 12 */
107 ldrne r13, [r12, #SSI_SRX0] 114 ldrne r11, [r12, #SSI_SRX0]
108 115
109 ldr r13, [r12, #SSI_SRX0] 116 ldr r11, [r12, #SSI_SRX0]
110 strh r13, [r11, #4] 117 strh r11, [r13, #4]
111 118
112 ldr r13, [r12, #SSI_SRX0] 119 ldr r11, [r12, #SSI_SRX0]
113 strh r13, [r11, #6] 120 strh r11, [r13, #6]
114 121
115 /* dummy read to skip slot 12 */ 122 /* dummy read to skip slot 12 */
116 ldrne r13, [r12, #SSI_SRX0] 123 ldrne r11, [r12, #SSI_SRX0]
117 124
118 add r10, #8 125 add r10, #8
119 lsr r13, r9, #16 /* r13: buffer size */ 126 lsr r11, r9, #16 /* r11: buffer size */
120 cmp r10, r13 127 cmp r10, r11
121 lslgt r9, r13, #16 128 lslgt r9, r11, #16
122 addle r9, #8 129 addle r9, #8
123 130
1241: 1311:
@@ -126,11 +133,15 @@ imx_ssi_fiq_start:
126 subs pc, lr, #4 133 subs pc, lr, #4
127 134
128 .align 135 .align
136.L_imx_ssi_fiq_base:
129imx_ssi_fiq_base: 137imx_ssi_fiq_base:
130 .word 0x0 138 .word 0x0
139.L_imx_ssi_fiq_rx_buffer:
131imx_ssi_fiq_rx_buffer: 140imx_ssi_fiq_rx_buffer:
132 .word 0x0 141 .word 0x0
142.L_imx_ssi_fiq_tx_buffer:
133imx_ssi_fiq_tx_buffer: 143imx_ssi_fiq_tx_buffer:
134 .word 0x0 144 .word 0x0
145.L_imx_ssi_fiq_end:
135imx_ssi_fiq_end: 146imx_ssi_fiq_end:
136 147
diff --git a/arch/arm/plat-mxc/system.c b/arch/arm/plat-mxc/system.c
index 1996c3e3b8f..3da78cfc5a9 100644
--- a/arch/arm/plat-mxc/system.c
+++ b/arch/arm/plat-mxc/system.c
@@ -21,7 +21,6 @@
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/err.h> 22#include <linux/err.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/module.h>
25 24
26#include <mach/hardware.h> 25#include <mach/hardware.h>
27#include <mach/common.h> 26#include <mach/common.h>
@@ -29,9 +28,6 @@
29#include <asm/proc-fns.h> 28#include <asm/proc-fns.h>
30#include <asm/mach-types.h> 29#include <asm/mach-types.h>
31 30
32void __iomem *(*imx_ioremap)(unsigned long, size_t, unsigned int) = NULL;
33EXPORT_SYMBOL_GPL(imx_ioremap);
34
35static void __iomem *wdog_base; 31static void __iomem *wdog_base;
36 32
37/* 33/*
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig
index 4c48c8b60b5..19f55cae5d7 100644
--- a/arch/arm/plat-nomadik/Kconfig
+++ b/arch/arm/plat-nomadik/Kconfig
@@ -5,8 +5,8 @@
5config PLAT_NOMADIK 5config PLAT_NOMADIK
6 bool 6 bool
7 depends on ARCH_NOMADIK || ARCH_U8500 7 depends on ARCH_NOMADIK || ARCH_U8500
8 select CLKSRC_MMIO
9 default y 8 default y
9 select CLKSRC_MMIO
10 help 10 help
11 Common platform code for Nomadik and other ST-Ericsson 11 Common platform code for Nomadik and other ST-Ericsson
12 platforms. 12 platforms.
diff --git a/arch/arm/plat-nomadik/include/plat/gpio-nomadik.h b/arch/arm/plat-nomadik/include/plat/gpio-nomadik.h
index 826de74bfdd..c08a54d9d88 100644
--- a/arch/arm/plat-nomadik/include/plat/gpio-nomadik.h
+++ b/arch/arm/plat-nomadik/include/plat/gpio-nomadik.h
@@ -45,6 +45,12 @@
45#define NMK_GPIO_ALT_B 2 45#define NMK_GPIO_ALT_B 2
46#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B) 46#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B)
47 47
48#define NMK_GPIO_ALT_CX_SHIFT 2
49#define NMK_GPIO_ALT_C1 ((1<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
50#define NMK_GPIO_ALT_C2 ((2<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
51#define NMK_GPIO_ALT_C3 ((3<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
52#define NMK_GPIO_ALT_C4 ((4<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
53
48/* Pull up/down values */ 54/* Pull up/down values */
49enum nmk_gpio_pull { 55enum nmk_gpio_pull {
50 NMK_GPIO_PULL_NONE, 56 NMK_GPIO_PULL_NONE,
diff --git a/arch/arm/plat-nomadik/include/plat/pincfg.h b/arch/arm/plat-nomadik/include/plat/pincfg.h
index 9c949c7c98a..3b8ec60af35 100644
--- a/arch/arm/plat-nomadik/include/plat/pincfg.h
+++ b/arch/arm/plat-nomadik/include/plat/pincfg.h
@@ -25,6 +25,8 @@
25 * bit 19..20 - SLPM direction 25 * bit 19..20 - SLPM direction
26 * bit 21..22 - SLPM Value (if output) 26 * bit 21..22 - SLPM Value (if output)
27 * bit 23..25 - PDIS value (if input) 27 * bit 23..25 - PDIS value (if input)
28 * bit 26 - Gpio mode
29 * bit 27 - Sleep mode
28 * 30 *
29 * to facilitate the definition, the following macros are provided 31 * to facilitate the definition, the following macros are provided
30 * 32 *
diff --git a/arch/arm/plat-nomadik/include/plat/ske.h b/arch/arm/plat-nomadik/include/plat/ske.h
deleted file mode 100644
index 31382fbc07d..00000000000
--- a/arch/arm/plat-nomadik/include/plat/ske.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License v2
5 * Author: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
6 *
7 * ux500 Scroll key and Keypad Encoder (SKE) header
8 */
9
10#ifndef __SKE_H
11#define __SKE_H
12
13#include <linux/input/matrix_keypad.h>
14
15/* register definitions for SKE peripheral */
16#define SKE_CR 0x00
17#define SKE_VAL0 0x04
18#define SKE_VAL1 0x08
19#define SKE_DBCR 0x0C
20#define SKE_IMSC 0x10
21#define SKE_RIS 0x14
22#define SKE_MIS 0x18
23#define SKE_ICR 0x1C
24
25/*
26 * Keypad module
27 */
28
29/**
30 * struct keypad_platform_data - structure for platform specific data
31 * @init: pointer to keypad init function
32 * @exit: pointer to keypad deinitialisation function
33 * @keymap_data: matrix scan code table for keycodes
34 * @krow: maximum number of rows
35 * @kcol: maximum number of columns
36 * @debounce_ms: platform specific debounce time
37 * @no_autorepeat: flag for auto repetition
38 * @wakeup_enable: allow waking up the system
39 */
40struct ske_keypad_platform_data {
41 int (*init)(void);
42 int (*exit)(void);
43 const struct matrix_keymap_data *keymap_data;
44 u8 krow;
45 u8 kcol;
46 u8 debounce_ms;
47 bool no_autorepeat;
48 bool wakeup_enable;
49};
50#endif /*__SKE_KPD_H*/
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index dd36eba9506..7cd56ed5cd9 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -14,10 +14,10 @@ config ARCH_OMAP1
14 select CLKDEV_LOOKUP 14 select CLKDEV_LOOKUP
15 select CLKSRC_MMIO 15 select CLKSRC_MMIO
16 select GENERIC_IRQ_CHIP 16 select GENERIC_IRQ_CHIP
17 select IRQ_DOMAIN
18 select HAVE_IDE 17 select HAVE_IDE
19 select NEED_MACH_MEMORY_H 18 select IRQ_DOMAIN
20 select NEED_MACH_IO_H if PCCARD 19 select NEED_MACH_IO_H if PCCARD
20 select NEED_MACH_MEMORY_H
21 help 21 help
22 "Systems based on omap7xx, omap15xx or omap16xx" 22 "Systems based on omap7xx, omap15xx or omap16xx"
23 23
@@ -26,8 +26,9 @@ config ARCH_OMAP2PLUS
26 select CLKDEV_LOOKUP 26 select CLKDEV_LOOKUP
27 select GENERIC_IRQ_CHIP 27 select GENERIC_IRQ_CHIP
28 select OMAP_DM_TIMER 28 select OMAP_DM_TIMER
29 select USE_OF
30 select PROC_DEVICETREE if PROC_FS 29 select PROC_DEVICETREE if PROC_FS
30 select SPARSE_IRQ
31 select USE_OF
31 help 32 help
32 "Systems based on OMAP2, OMAP3, OMAP4 or OMAP5" 33 "Systems based on OMAP2, OMAP3, OMAP4 or OMAP5"
33 34
@@ -41,13 +42,14 @@ config OMAP_DEBUG_DEVICES
41 For debug cards on TI reference boards. 42 For debug cards on TI reference boards.
42 43
43config OMAP_DEBUG_LEDS 44config OMAP_DEBUG_LEDS
44 bool 45 def_bool y if NEW_LEDS
45 depends on OMAP_DEBUG_DEVICES 46 depends on OMAP_DEBUG_DEVICES
46 default y if LEDS_CLASS 47 select LEDS_CLASS
47 48
48config POWER_AVS_OMAP 49config POWER_AVS_OMAP
49 bool "AVS(Adaptive Voltage Scaling) support for OMAP IP versions 1&2" 50 bool "AVS(Adaptive Voltage Scaling) support for OMAP IP versions 1&2"
50 depends on POWER_AVS && (ARCH_OMAP3 || ARCH_OMAP4) && PM 51 depends on POWER_AVS && (ARCH_OMAP3 || ARCH_OMAP4) && PM
52 select POWER_SUPPLY
51 help 53 help
52 Say Y to enable AVS(Adaptive Voltage Scaling) 54 Say Y to enable AVS(Adaptive Voltage Scaling)
53 support on OMAP containing the version 1 or 55 support on OMAP containing the version 1 or
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index 961bf859bc0..dacaee009a4 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -3,8 +3,7 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := common.o sram.o clock.o devices.o dma.o mux.o \ 6obj-y := common.o sram.o clock.o dma.o fb.o counter_32k.o
7 fb.o counter_32k.o
8obj-m := 7obj-m :=
9obj-n := 8obj-n :=
10obj- := 9obj- :=
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index 706b7e29397..9d7ac20ef8f 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -312,33 +312,6 @@ void clk_enable_init_clocks(void)
312 } 312 }
313} 313}
314 314
315/**
316 * omap_clk_get_by_name - locate OMAP struct clk by its name
317 * @name: name of the struct clk to locate
318 *
319 * Locate an OMAP struct clk by its name. Assumes that struct clk
320 * names are unique. Returns NULL if not found or a pointer to the
321 * struct clk if found.
322 */
323struct clk *omap_clk_get_by_name(const char *name)
324{
325 struct clk *c;
326 struct clk *ret = NULL;
327
328 mutex_lock(&clocks_mutex);
329
330 list_for_each_entry(c, &clocks, node) {
331 if (!strcmp(c->name, name)) {
332 ret = c;
333 break;
334 }
335 }
336
337 mutex_unlock(&clocks_mutex);
338
339 return ret;
340}
341
342int omap_clk_enable_autoidle_all(void) 315int omap_clk_enable_autoidle_all(void)
343{ 316{
344 struct clk *c; 317 struct clk *c;
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 89a3723b353..111315a6935 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -17,52 +17,12 @@
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18 18
19#include <plat/common.h> 19#include <plat/common.h>
20#include <plat/board.h>
21#include <plat/vram.h> 20#include <plat/vram.h>
22#include <plat/dsp.h> 21#include <linux/platform_data/dsp-omap.h>
23#include <plat/dma.h> 22#include <plat/dma.h>
24 23
25#include <plat/omap-secure.h> 24#include <plat/omap-secure.h>
26 25
27
28#define NO_LENGTH_CHECK 0xffffffff
29
30struct omap_board_config_kernel *omap_board_config __initdata;
31int omap_board_config_size;
32
33static const void *__init get_config(u16 tag, size_t len,
34 int skip, size_t *len_out)
35{
36 struct omap_board_config_kernel *kinfo = NULL;
37 int i;
38
39 /* Try to find the config from the board-specific structures
40 * in the kernel. */
41 for (i = 0; i < omap_board_config_size; i++) {
42 if (omap_board_config[i].tag == tag) {
43 if (skip == 0) {
44 kinfo = &omap_board_config[i];
45 break;
46 } else {
47 skip--;
48 }
49 }
50 }
51 if (kinfo == NULL)
52 return NULL;
53 return kinfo->data;
54}
55
56const void *__init __omap_get_config(u16 tag, size_t len, int nr)
57{
58 return get_config(tag, len, nr, NULL);
59}
60
61const void *__init omap_get_var_config(u16 tag, size_t *len)
62{
63 return get_config(tag, NO_LENGTH_CHECK, 0, len);
64}
65
66void __init omap_reserve(void) 26void __init omap_reserve(void)
67{ 27{
68 omap_vram_reserve_sdram_memblock(); 28 omap_vram_reserve_sdram_memblock();
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
index dbf1e03029a..87ba8dd0d79 100644
--- a/arch/arm/plat-omap/counter_32k.c
+++ b/arch/arm/plat-omap/counter_32k.c
@@ -22,10 +22,7 @@
22#include <asm/mach/time.h> 22#include <asm/mach/time.h>
23#include <asm/sched_clock.h> 23#include <asm/sched_clock.h>
24 24
25#include <plat/hardware.h>
26#include <plat/common.h> 25#include <plat/common.h>
27#include <plat/board.h>
28
29#include <plat/clock.h> 26#include <plat/clock.h>
30 27
31/* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */ 28/* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */
@@ -55,22 +52,29 @@ static u32 notrace omap_32k_read_sched_clock(void)
55 * nsecs and adds to a monotonically increasing timespec. 52 * nsecs and adds to a monotonically increasing timespec.
56 */ 53 */
57static struct timespec persistent_ts; 54static struct timespec persistent_ts;
58static cycles_t cycles, last_cycles; 55static cycles_t cycles;
59static unsigned int persistent_mult, persistent_shift; 56static unsigned int persistent_mult, persistent_shift;
57static DEFINE_SPINLOCK(read_persistent_clock_lock);
58
60static void omap_read_persistent_clock(struct timespec *ts) 59static void omap_read_persistent_clock(struct timespec *ts)
61{ 60{
62 unsigned long long nsecs; 61 unsigned long long nsecs;
63 cycles_t delta; 62 cycles_t last_cycles;
64 struct timespec *tsp = &persistent_ts; 63 unsigned long flags;
64
65 spin_lock_irqsave(&read_persistent_clock_lock, flags);
65 66
66 last_cycles = cycles; 67 last_cycles = cycles;
67 cycles = sync32k_cnt_reg ? __raw_readl(sync32k_cnt_reg) : 0; 68 cycles = sync32k_cnt_reg ? __raw_readl(sync32k_cnt_reg) : 0;
68 delta = cycles - last_cycles;
69 69
70 nsecs = clocksource_cyc2ns(delta, persistent_mult, persistent_shift); 70 nsecs = clocksource_cyc2ns(cycles - last_cycles,
71 persistent_mult, persistent_shift);
72
73 timespec_add_ns(&persistent_ts, nsecs);
74
75 *ts = persistent_ts;
71 76
72 timespec_add_ns(tsp, nsecs); 77 spin_unlock_irqrestore(&read_persistent_clock_lock, flags);
73 *ts = *tsp;
74} 78}
75 79
76/** 80/**
diff --git a/arch/arm/plat-omap/debug-devices.c b/arch/arm/plat-omap/debug-devices.c
index caa1f7b6cc2..c7a4c0902b3 100644
--- a/arch/arm/plat-omap/debug-devices.c
+++ b/arch/arm/plat-omap/debug-devices.c
@@ -17,9 +17,6 @@
17 17
18#include <mach/hardware.h> 18#include <mach/hardware.h>
19 19
20#include <plat/board.h>
21
22
23/* Many OMAP development platforms reuse the same "debug board"; these 20/* Many OMAP development platforms reuse the same "debug board"; these
24 * platforms include H2, H3, H4, and Perseus2. 21 * platforms include H2, H3, H4, and Perseus2.
25 */ 22 */
diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c
index 39407cbe34c..ea29bbe8e5c 100644
--- a/arch/arm/plat-omap/debug-leds.c
+++ b/arch/arm/plat-omap/debug-leds.c
@@ -1,279 +1,119 @@
1/* 1/*
2 * linux/arch/arm/plat-omap/debug-leds.c 2 * linux/arch/arm/plat-omap/debug-leds.c
3 * 3 *
4 * Copyright 2011 by Bryan Wu <bryan.wu@canonical.com>
4 * Copyright 2003 by Texas Instruments Incorporated 5 * Copyright 2003 by Texas Instruments Incorporated
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * 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 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
9 */ 10 */
10#include <linux/gpio.h> 11
12#include <linux/kernel.h>
11#include <linux/init.h> 13#include <linux/init.h>
12#include <linux/platform_device.h> 14#include <linux/platform_device.h>
13#include <linux/leds.h> 15#include <linux/leds.h>
14#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/platform_data/gpio-omap.h>
18#include <linux/slab.h>
15 19
16#include <mach/hardware.h> 20#include <mach/hardware.h>
17#include <asm/leds.h>
18#include <asm/mach-types.h> 21#include <asm/mach-types.h>
19 22
20#include <plat/fpga.h> 23#include <plat/fpga.h>
21 24
22
23/* Many OMAP development platforms reuse the same "debug board"; these 25/* Many OMAP development platforms reuse the same "debug board"; these
24 * platforms include H2, H3, H4, and Perseus2. There are 16 LEDs on the 26 * platforms include H2, H3, H4, and Perseus2. There are 16 LEDs on the
25 * debug board (all green), accessed through FPGA registers. 27 * debug board (all green), accessed through FPGA registers.
26 *
27 * The "surfer" expansion board and H2 sample board also have two-color
28 * green+red LEDs (in parallel), used here for timer and idle indicators
29 * in preference to the ones on the debug board, for a "Disco LED" effect.
30 *
31 * This driver exports either the original ARM LED API, the new generic
32 * one, or both.
33 */
34
35static spinlock_t lock;
36static struct h2p2_dbg_fpga __iomem *fpga;
37static u16 led_state, hw_led_state;
38
39
40#ifdef CONFIG_OMAP_DEBUG_LEDS
41#define new_led_api() 1
42#else
43#define new_led_api() 0
44#endif
45
46
47/*-------------------------------------------------------------------------*/
48
49/* original ARM debug LED API:
50 * - timer and idle leds (some boards use non-FPGA leds here);
51 * - up to 4 generic leds, easily accessed in-kernel (any context)
52 */ 28 */
53 29
54#define GPIO_LED_RED 3 30static struct h2p2_dbg_fpga __iomem *fpga;
55#define GPIO_LED_GREEN OMAP_MPUIO(4)
56
57#define LED_STATE_ENABLED 0x01
58#define LED_STATE_CLAIMED 0x02
59#define LED_TIMER_ON 0x04
60
61#define GPIO_IDLE GPIO_LED_GREEN
62#define GPIO_TIMER GPIO_LED_RED
63
64static void h2p2_dbg_leds_event(led_event_t evt)
65{
66 unsigned long flags;
67
68 spin_lock_irqsave(&lock, flags);
69
70 if (!(led_state & LED_STATE_ENABLED) && evt != led_start)
71 goto done;
72
73 switch (evt) {
74 case led_start:
75 if (fpga)
76 led_state |= LED_STATE_ENABLED;
77 break;
78
79 case led_stop:
80 case led_halted:
81 /* all leds off during suspend or shutdown */
82
83 if (!(machine_is_omap_perseus2() || machine_is_omap_h4())) {
84 gpio_set_value(GPIO_TIMER, 0);
85 gpio_set_value(GPIO_IDLE, 0);
86 }
87
88 __raw_writew(~0, &fpga->leds);
89 led_state &= ~LED_STATE_ENABLED;
90 goto done;
91
92 case led_claim:
93 led_state |= LED_STATE_CLAIMED;
94 hw_led_state = 0;
95 break;
96
97 case led_release:
98 led_state &= ~LED_STATE_CLAIMED;
99 break;
100
101#ifdef CONFIG_LEDS_TIMER
102 case led_timer:
103 led_state ^= LED_TIMER_ON;
104
105 if (machine_is_omap_perseus2() || machine_is_omap_h4())
106 hw_led_state ^= H2P2_DBG_FPGA_P2_LED_TIMER;
107 else {
108 gpio_set_value(GPIO_TIMER,
109 led_state & LED_TIMER_ON);
110 goto done;
111 }
112
113 break;
114#endif
115
116#ifdef CONFIG_LEDS_CPU
117 /* LED lit iff busy */
118 case led_idle_start:
119 if (machine_is_omap_perseus2() || machine_is_omap_h4())
120 hw_led_state &= ~H2P2_DBG_FPGA_P2_LED_IDLE;
121 else {
122 gpio_set_value(GPIO_IDLE, 1);
123 goto done;
124 }
125
126 break;
127 31
128 case led_idle_end: 32static u16 fpga_led_state;
129 if (machine_is_omap_perseus2() || machine_is_omap_h4())
130 hw_led_state |= H2P2_DBG_FPGA_P2_LED_IDLE;
131 else {
132 gpio_set_value(GPIO_IDLE, 0);
133 goto done;
134 }
135
136 break;
137#endif
138
139 case led_green_on:
140 hw_led_state |= H2P2_DBG_FPGA_LED_GREEN;
141 break;
142 case led_green_off:
143 hw_led_state &= ~H2P2_DBG_FPGA_LED_GREEN;
144 break;
145
146 case led_amber_on:
147 hw_led_state |= H2P2_DBG_FPGA_LED_AMBER;
148 break;
149 case led_amber_off:
150 hw_led_state &= ~H2P2_DBG_FPGA_LED_AMBER;
151 break;
152
153 case led_red_on:
154 hw_led_state |= H2P2_DBG_FPGA_LED_RED;
155 break;
156 case led_red_off:
157 hw_led_state &= ~H2P2_DBG_FPGA_LED_RED;
158 break;
159
160 case led_blue_on:
161 hw_led_state |= H2P2_DBG_FPGA_LED_BLUE;
162 break;
163 case led_blue_off:
164 hw_led_state &= ~H2P2_DBG_FPGA_LED_BLUE;
165 break;
166
167 default:
168 break;
169 }
170
171
172 /*
173 * Actually burn the LEDs
174 */
175 if (led_state & LED_STATE_ENABLED)
176 __raw_writew(~hw_led_state, &fpga->leds);
177
178done:
179 spin_unlock_irqrestore(&lock, flags);
180}
181
182/*-------------------------------------------------------------------------*/
183
184/* "new" LED API
185 * - with syfs access and generic triggering
186 * - not readily accessible to in-kernel drivers
187 */
188 33
189struct dbg_led { 34struct dbg_led {
190 struct led_classdev cdev; 35 struct led_classdev cdev;
191 u16 mask; 36 u16 mask;
192}; 37};
193 38
194static struct dbg_led dbg_leds[] = { 39static const struct {
195 /* REVISIT at least H2 uses different timer & cpu leds... */ 40 const char *name;
196#ifndef CONFIG_LEDS_TIMER 41 const char *trigger;
197 { .mask = 1 << 0, .cdev.name = "d4:green", 42} dbg_leds[] = {
198 .cdev.default_trigger = "heartbeat", }, 43 { "dbg:d4", "heartbeat", },
199#endif 44 { "dbg:d5", "cpu0", },
200#ifndef CONFIG_LEDS_CPU 45 { "dbg:d6", "default-on", },
201 { .mask = 1 << 1, .cdev.name = "d5:green", }, /* !idle */ 46 { "dbg:d7", },
202#endif 47 { "dbg:d8", },
203 { .mask = 1 << 2, .cdev.name = "d6:green", }, 48 { "dbg:d9", },
204 { .mask = 1 << 3, .cdev.name = "d7:green", }, 49 { "dbg:d10", },
205 50 { "dbg:d11", },
206 { .mask = 1 << 4, .cdev.name = "d8:green", }, 51 { "dbg:d12", },
207 { .mask = 1 << 5, .cdev.name = "d9:green", }, 52 { "dbg:d13", },
208 { .mask = 1 << 6, .cdev.name = "d10:green", }, 53 { "dbg:d14", },
209 { .mask = 1 << 7, .cdev.name = "d11:green", }, 54 { "dbg:d15", },
210 55 { "dbg:d16", },
211 { .mask = 1 << 8, .cdev.name = "d12:green", }, 56 { "dbg:d17", },
212 { .mask = 1 << 9, .cdev.name = "d13:green", }, 57 { "dbg:d18", },
213 { .mask = 1 << 10, .cdev.name = "d14:green", }, 58 { "dbg:d19", },
214 { .mask = 1 << 11, .cdev.name = "d15:green", },
215
216#ifndef CONFIG_LEDS
217 { .mask = 1 << 12, .cdev.name = "d16:green", },
218 { .mask = 1 << 13, .cdev.name = "d17:green", },
219 { .mask = 1 << 14, .cdev.name = "d18:green", },
220 { .mask = 1 << 15, .cdev.name = "d19:green", },
221#endif
222}; 59};
223 60
224static void 61/*
225fpga_led_set(struct led_classdev *cdev, enum led_brightness value) 62 * The triggers lines up below will only be used if the
63 * LED triggers are compiled in.
64 */
65static void dbg_led_set(struct led_classdev *cdev,
66 enum led_brightness b)
226{ 67{
227 struct dbg_led *led = container_of(cdev, struct dbg_led, cdev); 68 struct dbg_led *led = container_of(cdev, struct dbg_led, cdev);
228 unsigned long flags; 69 u16 reg;
229 70
230 spin_lock_irqsave(&lock, flags); 71 reg = __raw_readw(&fpga->leds);
231 if (value == LED_OFF) 72 if (b != LED_OFF)
232 hw_led_state &= ~led->mask; 73 reg |= led->mask;
233 else 74 else
234 hw_led_state |= led->mask; 75 reg &= ~led->mask;
235 __raw_writew(~hw_led_state, &fpga->leds); 76 __raw_writew(reg, &fpga->leds);
236 spin_unlock_irqrestore(&lock, flags);
237} 77}
238 78
239static void __init newled_init(struct device *dev) 79static enum led_brightness dbg_led_get(struct led_classdev *cdev)
240{ 80{
241 unsigned i; 81 struct dbg_led *led = container_of(cdev, struct dbg_led, cdev);
242 struct dbg_led *led; 82 u16 reg;
243 int status;
244 83
245 for (i = 0, led = dbg_leds; i < ARRAY_SIZE(dbg_leds); i++, led++) { 84 reg = __raw_readw(&fpga->leds);
246 led->cdev.brightness_set = fpga_led_set; 85 return (reg & led->mask) ? LED_FULL : LED_OFF;
247 status = led_classdev_register(dev, &led->cdev);
248 if (status < 0)
249 break;
250 }
251 return;
252} 86}
253 87
254 88static int fpga_probe(struct platform_device *pdev)
255/*-------------------------------------------------------------------------*/
256
257static int /* __init */ fpga_probe(struct platform_device *pdev)
258{ 89{
259 struct resource *iomem; 90 struct resource *iomem;
260 91 int i;
261 spin_lock_init(&lock);
262 92
263 iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 93 iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
264 if (!iomem) 94 if (!iomem)
265 return -ENODEV; 95 return -ENODEV;
266 96
267 fpga = ioremap(iomem->start, H2P2_DBG_FPGA_SIZE); 97 fpga = ioremap(iomem->start, H2P2_DBG_FPGA_SIZE);
268 __raw_writew(~0, &fpga->leds); 98 __raw_writew(0xff, &fpga->leds);
99
100 for (i = 0; i < ARRAY_SIZE(dbg_leds); i++) {
101 struct dbg_led *led;
102
103 led = kzalloc(sizeof(*led), GFP_KERNEL);
104 if (!led)
105 break;
269 106
270#ifdef CONFIG_LEDS 107 led->cdev.name = dbg_leds[i].name;
271 leds_event = h2p2_dbg_leds_event; 108 led->cdev.brightness_set = dbg_led_set;
272 leds_event(led_start); 109 led->cdev.brightness_get = dbg_led_get;
273#endif 110 led->cdev.default_trigger = dbg_leds[i].trigger;
111 led->mask = BIT(i);
274 112
275 if (new_led_api()) { 113 if (led_classdev_register(NULL, &led->cdev) < 0) {
276 newled_init(&pdev->dev); 114 kfree(led);
115 break;
116 }
277 } 117 }
278 118
279 return 0; 119 return 0;
@@ -281,13 +121,15 @@ static int /* __init */ fpga_probe(struct platform_device *pdev)
281 121
282static int fpga_suspend_noirq(struct device *dev) 122static int fpga_suspend_noirq(struct device *dev)
283{ 123{
284 __raw_writew(~0, &fpga->leds); 124 fpga_led_state = __raw_readw(&fpga->leds);
125 __raw_writew(0xff, &fpga->leds);
126
285 return 0; 127 return 0;
286} 128}
287 129
288static int fpga_resume_noirq(struct device *dev) 130static int fpga_resume_noirq(struct device *dev)
289{ 131{
290 __raw_writew(~hw_led_state, &fpga->leds); 132 __raw_writew(~fpga_led_state, &fpga->leds);
291 return 0; 133 return 0;
292} 134}
293 135
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
deleted file mode 100644
index 1cba9273d2c..00000000000
--- a/arch/arm/plat-omap/devices.c
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 * linux/arch/arm/plat-omap/devices.c
3 *
4 * Common platform device setup/initialization for OMAP1 and OMAP2
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#include <linux/gpio.h>
12#include <linux/module.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/io.h>
17#include <linux/slab.h>
18#include <linux/memblock.h>
19
20#include <mach/hardware.h>
21#include <asm/mach-types.h>
22#include <asm/mach/map.h>
23#include <asm/memblock.h>
24
25#include <plat/tc.h>
26#include <plat/board.h>
27#include <plat/mmc.h>
28#include <plat/menelaus.h>
29#include <plat/omap44xx.h>
30
31/*-------------------------------------------------------------------------*/
32
33#if defined(CONFIG_HW_RANDOM_OMAP) || defined(CONFIG_HW_RANDOM_OMAP_MODULE)
34
35#ifdef CONFIG_ARCH_OMAP2
36#define OMAP_RNG_BASE 0x480A0000
37#else
38#define OMAP_RNG_BASE 0xfffe5000
39#endif
40
41static struct resource rng_resources[] = {
42 {
43 .start = OMAP_RNG_BASE,
44 .end = OMAP_RNG_BASE + 0x4f,
45 .flags = IORESOURCE_MEM,
46 },
47};
48
49static struct platform_device omap_rng_device = {
50 .name = "omap_rng",
51 .id = -1,
52 .num_resources = ARRAY_SIZE(rng_resources),
53 .resource = rng_resources,
54};
55
56static void omap_init_rng(void)
57{
58 (void) platform_device_register(&omap_rng_device);
59}
60#else
61static inline void omap_init_rng(void) {}
62#endif
63
64/*
65 * This gets called after board-specific INIT_MACHINE, and initializes most
66 * on-chip peripherals accessible on this board (except for few like USB):
67 *
68 * (a) Does any "standard config" pin muxing needed. Board-specific
69 * code will have muxed GPIO pins and done "nonstandard" setup;
70 * that code could live in the boot loader.
71 * (b) Populating board-specific platform_data with the data drivers
72 * rely on to handle wiring variations.
73 * (c) Creating platform devices as meaningful on this board and
74 * with this kernel configuration.
75 *
76 * Claiming GPIOs, and setting their direction and initial values, is the
77 * responsibility of the device drivers. So is responding to probe().
78 *
79 * Board-specific knowledge like creating devices or pin setup is to be
80 * kept out of drivers as much as possible. In particular, pin setup
81 * may be handled by the boot loader, and drivers should expect it will
82 * normally have been done by the time they're probed.
83 */
84static int __init omap_init_devices(void)
85{
86 /* please keep these calls, and their implementations above,
87 * in alphabetical order so they're easier to sort through.
88 */
89 omap_init_rng();
90 return 0;
91}
92arch_initcall(omap_init_devices);
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 7fe626761e5..c76ed8bff83 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -36,9 +36,8 @@
36#include <linux/slab.h> 36#include <linux/slab.h>
37#include <linux/delay.h> 37#include <linux/delay.h>
38 38
39#include <mach/hardware.h> 39#include <plat/cpu.h>
40#include <plat/dma.h> 40#include <plat/dma.h>
41
42#include <plat/tc.h> 41#include <plat/tc.h>
43 42
44/* 43/*
@@ -969,8 +968,7 @@ void omap_stop_dma(int lch)
969 l = p->dma_read(CCR, lch); 968 l = p->dma_read(CCR, lch);
970 } 969 }
971 if (i >= 100) 970 if (i >= 100)
972 printk(KERN_ERR "DMA drain did not complete on " 971 pr_err("DMA drain did not complete on lch %d\n", lch);
973 "lch %d\n", lch);
974 /* Restore OCP_SYSCONFIG */ 972 /* Restore OCP_SYSCONFIG */
975 p->dma_write(sys_cf, OCP_SYSCONFIG, lch); 973 p->dma_write(sys_cf, OCP_SYSCONFIG, lch);
976 } else { 974 } else {
@@ -1154,8 +1152,7 @@ void omap_dma_link_lch(int lch_head, int lch_queue)
1154 1152
1155 if ((dma_chan[lch_head].dev_id == -1) || 1153 if ((dma_chan[lch_head].dev_id == -1) ||
1156 (dma_chan[lch_queue].dev_id == -1)) { 1154 (dma_chan[lch_queue].dev_id == -1)) {
1157 printk(KERN_ERR "omap_dma: trying to link " 1155 pr_err("omap_dma: trying to link non requested channels\n");
1158 "non requested channels\n");
1159 dump_stack(); 1156 dump_stack();
1160 } 1157 }
1161 1158
@@ -1181,15 +1178,13 @@ void omap_dma_unlink_lch(int lch_head, int lch_queue)
1181 1178
1182 if (dma_chan[lch_head].next_lch != lch_queue || 1179 if (dma_chan[lch_head].next_lch != lch_queue ||
1183 dma_chan[lch_head].next_lch == -1) { 1180 dma_chan[lch_head].next_lch == -1) {
1184 printk(KERN_ERR "omap_dma: trying to unlink " 1181 pr_err("omap_dma: trying to unlink non linked channels\n");
1185 "non linked channels\n");
1186 dump_stack(); 1182 dump_stack();
1187 } 1183 }
1188 1184
1189 if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) || 1185 if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) ||
1190 (dma_chan[lch_queue].flags & OMAP_DMA_ACTIVE)) { 1186 (dma_chan[lch_queue].flags & OMAP_DMA_ACTIVE)) {
1191 printk(KERN_ERR "omap_dma: You need to stop the DMA channels " 1187 pr_err("omap_dma: You need to stop the DMA channels before unlinking\n");
1192 "before unlinking\n");
1193 dump_stack(); 1188 dump_stack();
1194 } 1189 }
1195 1190
@@ -1831,16 +1826,15 @@ static int omap1_dma_handle_ch(int ch)
1831 if ((csr & 0x3f) == 0) 1826 if ((csr & 0x3f) == 0)
1832 return 0; 1827 return 0;
1833 if (unlikely(dma_chan[ch].dev_id == -1)) { 1828 if (unlikely(dma_chan[ch].dev_id == -1)) {
1834 printk(KERN_WARNING "Spurious interrupt from DMA channel " 1829 pr_warn("Spurious interrupt from DMA channel %d (CSR %04x)\n",
1835 "%d (CSR %04x)\n", ch, csr); 1830 ch, csr);
1836 return 0; 1831 return 0;
1837 } 1832 }
1838 if (unlikely(csr & OMAP1_DMA_TOUT_IRQ)) 1833 if (unlikely(csr & OMAP1_DMA_TOUT_IRQ))
1839 printk(KERN_WARNING "DMA timeout with device %d\n", 1834 pr_warn("DMA timeout with device %d\n", dma_chan[ch].dev_id);
1840 dma_chan[ch].dev_id);
1841 if (unlikely(csr & OMAP_DMA_DROP_IRQ)) 1835 if (unlikely(csr & OMAP_DMA_DROP_IRQ))
1842 printk(KERN_WARNING "DMA synchronization event drop occurred " 1836 pr_warn("DMA synchronization event drop occurred with device %d\n",
1843 "with device %d\n", dma_chan[ch].dev_id); 1837 dma_chan[ch].dev_id);
1844 if (likely(csr & OMAP_DMA_BLOCK_IRQ)) 1838 if (likely(csr & OMAP_DMA_BLOCK_IRQ))
1845 dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE; 1839 dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE;
1846 if (likely(dma_chan[ch].callback != NULL)) 1840 if (likely(dma_chan[ch].callback != NULL))
@@ -1880,21 +1874,19 @@ static int omap2_dma_handle_ch(int ch)
1880 1874
1881 if (!status) { 1875 if (!status) {
1882 if (printk_ratelimit()) 1876 if (printk_ratelimit())
1883 printk(KERN_WARNING "Spurious DMA IRQ for lch %d\n", 1877 pr_warn("Spurious DMA IRQ for lch %d\n", ch);
1884 ch);
1885 p->dma_write(1 << ch, IRQSTATUS_L0, ch); 1878 p->dma_write(1 << ch, IRQSTATUS_L0, ch);
1886 return 0; 1879 return 0;
1887 } 1880 }
1888 if (unlikely(dma_chan[ch].dev_id == -1)) { 1881 if (unlikely(dma_chan[ch].dev_id == -1)) {
1889 if (printk_ratelimit()) 1882 if (printk_ratelimit())
1890 printk(KERN_WARNING "IRQ %04x for non-allocated DMA" 1883 pr_warn("IRQ %04x for non-allocated DMA channel %d\n",
1891 "channel %d\n", status, ch); 1884 status, ch);
1892 return 0; 1885 return 0;
1893 } 1886 }
1894 if (unlikely(status & OMAP_DMA_DROP_IRQ)) 1887 if (unlikely(status & OMAP_DMA_DROP_IRQ))
1895 printk(KERN_INFO 1888 pr_info("DMA synchronization event drop occurred with device %d\n",
1896 "DMA synchronization event drop occurred with device " 1889 dma_chan[ch].dev_id);
1897 "%d\n", dma_chan[ch].dev_id);
1898 if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) { 1890 if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) {
1899 printk(KERN_INFO "DMA transaction error with device %d\n", 1891 printk(KERN_INFO "DMA transaction error with device %d\n",
1900 dma_chan[ch].dev_id); 1892 dma_chan[ch].dev_id);
@@ -2014,8 +2006,9 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2014 2006
2015 p = pdev->dev.platform_data; 2007 p = pdev->dev.platform_data;
2016 if (!p) { 2008 if (!p) {
2017 dev_err(&pdev->dev, "%s: System DMA initialized without" 2009 dev_err(&pdev->dev,
2018 "platform data\n", __func__); 2010 "%s: System DMA initialized without platform data\n",
2011 __func__);
2019 return -EINVAL; 2012 return -EINVAL;
2020 } 2013 }
2021 2014
@@ -2090,8 +2083,8 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2090 } 2083 }
2091 ret = setup_irq(dma_irq, &omap24xx_dma_irq); 2084 ret = setup_irq(dma_irq, &omap24xx_dma_irq);
2092 if (ret) { 2085 if (ret) {
2093 dev_err(&pdev->dev, "set_up failed for IRQ %d" 2086 dev_err(&pdev->dev, "set_up failed for IRQ %d for DMA (error %d)\n",
2094 "for DMA (error %d)\n", dma_irq, ret); 2087 dma_irq, ret);
2095 goto exit_dma_lch_fail; 2088 goto exit_dma_lch_fail;
2096 } 2089 }
2097 } 2090 }
@@ -2099,8 +2092,7 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2099 /* reserve dma channels 0 and 1 in high security devices */ 2092 /* reserve dma channels 0 and 1 in high security devices */
2100 if (cpu_is_omap34xx() && 2093 if (cpu_is_omap34xx() &&
2101 (omap_type() != OMAP2_DEVICE_TYPE_GP)) { 2094 (omap_type() != OMAP2_DEVICE_TYPE_GP)) {
2102 printk(KERN_INFO "Reserving DMA channels 0 and 1 for " 2095 pr_info("Reserving DMA channels 0 and 1 for HS ROM code\n");
2103 "HS ROM code\n");
2104 dma_chan[0].dev_id = 0; 2096 dma_chan[0].dev_id = 0;
2105 dma_chan[1].dev_id = 1; 2097 dma_chan[1].dev_id = 1;
2106 } 2098 }
@@ -2108,8 +2100,8 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2108 return 0; 2100 return 0;
2109 2101
2110exit_dma_irq_fail: 2102exit_dma_irq_fail:
2111 dev_err(&pdev->dev, "unable to request IRQ %d" 2103 dev_err(&pdev->dev, "unable to request IRQ %d for DMA (error %d)\n",
2112 "for DMA (error %d)\n", dma_irq, ret); 2104 dma_irq, ret);
2113 for (irq_rel = 0; irq_rel < ch; irq_rel++) { 2105 for (irq_rel = 0; irq_rel < ch; irq_rel++) {
2114 dma_irq = platform_get_irq(pdev, irq_rel); 2106 dma_irq = platform_get_irq(pdev, irq_rel);
2115 free_irq(dma_irq, (void *)(irq_rel + 1)); 2107 free_irq(dma_irq, (void *)(irq_rel + 1));
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index dd6f92c99e5..bcbb9d5dc29 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -33,8 +33,6 @@
33#include <mach/hardware.h> 33#include <mach/hardware.h>
34#include <asm/mach/map.h> 34#include <asm/mach/map.h>
35 35
36#include <plat/board.h>
37
38#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) 36#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
39 37
40static bool omapfb_lcd_configured; 38static bool omapfb_lcd_configured;
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index db071bc71c4..a5683a84c6e 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -26,19 +26,17 @@
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/i2c.h> 28#include <linux/i2c.h>
29#include <linux/i2c-omap.h>
30#include <linux/slab.h> 29#include <linux/slab.h>
31#include <linux/err.h> 30#include <linux/err.h>
32#include <linux/clk.h> 31#include <linux/clk.h>
33 32
34#include <mach/irqs.h> 33#include <mach/irqs.h>
35#include <plat/mux.h>
36#include <plat/i2c.h> 34#include <plat/i2c.h>
37#include <plat/omap-pm.h>
38#include <plat/omap_device.h> 35#include <plat/omap_device.h>
39 36
40#define OMAP_I2C_SIZE 0x3f 37#define OMAP_I2C_SIZE 0x3f
41#define OMAP1_I2C_BASE 0xfffb3800 38#define OMAP1_I2C_BASE 0xfffb3800
39#define OMAP1_INT_I2C (32 + 4)
42 40
43static const char name[] = "omap_i2c"; 41static const char name[] = "omap_i2c";
44 42
@@ -105,7 +103,7 @@ static inline int omap1_i2c_add_bus(int bus_id)
105 res = pdev->resource; 103 res = pdev->resource;
106 res[0].start = OMAP1_I2C_BASE; 104 res[0].start = OMAP1_I2C_BASE;
107 res[0].end = res[0].start + OMAP_I2C_SIZE; 105 res[0].end = res[0].start + OMAP_I2C_SIZE;
108 res[1].start = INT_I2C; 106 res[1].start = OMAP1_INT_I2C;
109 pdata = &i2c_pdata[bus_id - 1]; 107 pdata = &i2c_pdata[bus_id - 1];
110 108
111 /* all OMAP1 have IP version 1 register set */ 109 /* all OMAP1 have IP version 1 register set */
@@ -129,16 +127,6 @@ static inline int omap1_i2c_add_bus(int bus_id)
129 127
130 128
131#ifdef CONFIG_ARCH_OMAP2PLUS 129#ifdef CONFIG_ARCH_OMAP2PLUS
132/*
133 * XXX This function is a temporary compatibility wrapper - only
134 * needed until the I2C driver can be converted to call
135 * omap_pm_set_max_dev_wakeup_lat() and handle a return code.
136 */
137static void omap_pm_set_max_mpu_wakeup_lat_compat(struct device *dev, long t)
138{
139 omap_pm_set_max_mpu_wakeup_lat(dev, t);
140}
141
142static inline int omap2_i2c_add_bus(int bus_id) 130static inline int omap2_i2c_add_bus(int bus_id)
143{ 131{
144 int l; 132 int l;
@@ -170,15 +158,6 @@ static inline int omap2_i2c_add_bus(int bus_id)
170 dev_attr = (struct omap_i2c_dev_attr *)oh->dev_attr; 158 dev_attr = (struct omap_i2c_dev_attr *)oh->dev_attr;
171 pdata->flags = dev_attr->flags; 159 pdata->flags = dev_attr->flags;
172 160
173 /*
174 * When waiting for completion of a i2c transfer, we need to
175 * set a wake up latency constraint for the MPU. This is to
176 * ensure quick enough wakeup from idle, when transfer
177 * completes.
178 * Only omap3 has support for constraints
179 */
180 if (cpu_is_omap34xx())
181 pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat;
182 pdev = omap_device_build(name, bus_id, oh, pdata, 161 pdev = omap_device_build(name, bus_id, oh, pdata,
183 sizeof(struct omap_i2c_bus_platform_data), 162 sizeof(struct omap_i2c_bus_platform_data),
184 NULL, 0, 0); 163 NULL, 0, 0);
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
deleted file mode 100644
index e62f20a5c0a..00000000000
--- a/arch/arm/plat-omap/include/plat/board.h
+++ /dev/null
@@ -1,138 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board.h
3 *
4 * Information structures for board-specific data
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
8 */
9
10#ifndef _OMAP_BOARD_H
11#define _OMAP_BOARD_H
12
13#include <linux/types.h>
14
15#include <plat/gpio-switch.h>
16
17/*
18 * OMAP35x EVM revision
19 * Run time detection of EVM revision is done by reading Ethernet
20 * PHY ID -
21 * GEN_1 = 0x01150000
22 * GEN_2 = 0x92200000
23 */
24enum {
25 OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */
26 OMAP3EVM_BOARD_GEN_2, /* EVM Rev >= Rev E */
27};
28
29/* Different peripheral ids */
30#define OMAP_TAG_CLOCK 0x4f01
31#define OMAP_TAG_GPIO_SWITCH 0x4f06
32#define OMAP_TAG_STI_CONSOLE 0x4f09
33#define OMAP_TAG_CAMERA_SENSOR 0x4f0a
34
35#define OMAP_TAG_BOOT_REASON 0x4f80
36#define OMAP_TAG_FLASH_PART 0x4f81
37#define OMAP_TAG_VERSION_STR 0x4f82
38
39struct omap_clock_config {
40 /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
41 u8 system_clock_type;
42};
43
44struct omap_serial_console_config {
45 u8 console_uart;
46 u32 console_speed;
47};
48
49struct omap_sti_console_config {
50 unsigned enable:1;
51 u8 channel;
52};
53
54struct omap_camera_sensor_config {
55 u16 reset_gpio;
56 int (*power_on)(void * data);
57 int (*power_off)(void * data);
58};
59
60struct omap_lcd_config {
61 char panel_name[16];
62 char ctrl_name[16];
63 s16 nreset_gpio;
64 u8 data_lines;
65};
66
67struct device;
68struct fb_info;
69struct omap_backlight_config {
70 int default_intensity;
71 int (*set_power)(struct device *dev, int state);
72};
73
74struct omap_fbmem_config {
75 u32 start;
76 u32 size;
77};
78
79struct omap_pwm_led_platform_data {
80 const char *name;
81 int intensity_timer;
82 int blink_timer;
83 void (*set_power)(struct omap_pwm_led_platform_data *self, int on_off);
84};
85
86struct omap_uart_config {
87 /* Bit field of UARTs present; bit 0 --> UART1 */
88 unsigned int enabled_uarts;
89};
90
91
92struct omap_flash_part_config {
93 char part_table[0];
94};
95
96struct omap_boot_reason_config {
97 char reason_str[12];
98};
99
100struct omap_version_config {
101 char component[12];
102 char version[12];
103};
104
105struct omap_board_config_entry {
106 u16 tag;
107 u16 len;
108 u8 data[0];
109};
110
111struct omap_board_config_kernel {
112 u16 tag;
113 const void *data;
114};
115
116extern const void *__init __omap_get_config(u16 tag, size_t len, int nr);
117
118#define omap_get_config(tag, type) \
119 ((const type *) __omap_get_config((tag), sizeof(type), 0))
120#define omap_get_nr_config(tag, type, nr) \
121 ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
122
123extern const void *__init omap_get_var_config(u16 tag, size_t *len);
124
125extern struct omap_board_config_kernel *omap_board_config;
126extern int omap_board_config_size;
127
128
129/* for TI reference platforms sharing the same debug card */
130extern int debug_card_init(u32 addr, unsigned gpio);
131
132/* OMAP3EVM revision */
133#if defined(CONFIG_MACH_OMAP3EVM)
134u8 get_omap3_evm_rev(void);
135#else
136#define get_omap3_evm_rev() (-EINVAL)
137#endif
138#endif
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index 656b9862279..e2e2d045e42 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -19,6 +19,11 @@ struct module;
19struct clk; 19struct clk;
20struct clockdomain; 20struct clockdomain;
21 21
22/* Temporary, needed during the common clock framework conversion */
23#define __clk_get_name(clk) (clk->name)
24#define __clk_get_parent(clk) (clk->parent)
25#define __clk_get_rate(clk) (clk->rate)
26
22/** 27/**
23 * struct clkops - some clock function pointers 28 * struct clkops - some clock function pointers
24 * @enable: fn ptr that enables the current clock in hardware 29 * @enable: fn ptr that enables the current clock in hardware
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index bb5d08a70db..67da857783c 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -30,6 +30,8 @@
30#ifndef __ASM_ARCH_OMAP_CPU_H 30#ifndef __ASM_ARCH_OMAP_CPU_H
31#define __ASM_ARCH_OMAP_CPU_H 31#define __ASM_ARCH_OMAP_CPU_H
32 32
33#ifndef __ASSEMBLY__
34
33#include <linux/bitops.h> 35#include <linux/bitops.h>
34#include <plat/multi.h> 36#include <plat/multi.h>
35 37
@@ -493,4 +495,5 @@ OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ)
493OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ) 495OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ)
494OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ) 496OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ)
495 497
498#endif /* __ASSEMBLY__ */
496#endif 499#endif
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
index c5811d4409b..0a87b052f8f 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -31,6 +31,8 @@
31/* Move omap4 specific defines to dma-44xx.h */ 31/* Move omap4 specific defines to dma-44xx.h */
32#include "dma-44xx.h" 32#include "dma-44xx.h"
33 33
34#define INT_DMA_LCD 25
35
34/* DMA channels for omap1 */ 36/* DMA channels for omap1 */
35#define OMAP_DMA_NO_DEVICE 0 37#define OMAP_DMA_NO_DEVICE 0
36#define OMAP_DMA_MCSI1_TX 1 38#define OMAP_DMA_MCSI1_TX 1
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 19e7fa577bd..85868e98c11 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -60,6 +60,7 @@
60#define OMAP_TIMER_ALWON 0x40000000 60#define OMAP_TIMER_ALWON 0x40000000
61#define OMAP_TIMER_HAS_PWM 0x20000000 61#define OMAP_TIMER_HAS_PWM 0x20000000
62#define OMAP_TIMER_NEEDS_RESET 0x10000000 62#define OMAP_TIMER_NEEDS_RESET 0x10000000
63#define OMAP_TIMER_HAS_DSP_IRQ 0x08000000
63 64
64struct omap_timer_capability_dev_attr { 65struct omap_timer_capability_dev_attr {
65 u32 timer_capability; 66 u32 timer_capability;
diff --git a/arch/arm/plat-omap/include/plat/dsp.h b/arch/arm/plat-omap/include/plat/dsp.h
deleted file mode 100644
index 5927709b190..00000000000
--- a/arch/arm/plat-omap/include/plat/dsp.h
+++ /dev/null
@@ -1,34 +0,0 @@
1#ifndef __OMAP_DSP_H__
2#define __OMAP_DSP_H__
3
4#include <linux/types.h>
5
6struct omap_dsp_platform_data {
7 void (*dsp_set_min_opp) (u8 opp_id);
8 u8 (*dsp_get_opp) (void);
9 void (*cpu_set_freq) (unsigned long f);
10 unsigned long (*cpu_get_freq) (void);
11 unsigned long mpu_speed[6];
12
13 /* functions to write and read PRCM registers */
14 void (*dsp_prm_write)(u32, s16 , u16);
15 u32 (*dsp_prm_read)(s16 , u16);
16 u32 (*dsp_prm_rmw_bits)(u32, u32, s16, s16);
17 void (*dsp_cm_write)(u32, s16 , u16);
18 u32 (*dsp_cm_read)(s16 , u16);
19 u32 (*dsp_cm_rmw_bits)(u32, u32, s16, s16);
20
21 void (*set_bootaddr)(u32);
22 void (*set_bootmode)(u8);
23
24 phys_addr_t phys_mempool_base;
25 phys_addr_t phys_mempool_size;
26};
27
28#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE)
29extern void omap_dsp_reserve_sdram_memblock(void);
30#else
31static inline void omap_dsp_reserve_sdram_memblock(void) { }
32#endif
33
34#endif
diff --git a/arch/arm/plat-omap/include/plat/gpio-switch.h b/arch/arm/plat-omap/include/plat/gpio-switch.h
deleted file mode 100644
index 10da0e07c0c..00000000000
--- a/arch/arm/plat-omap/include/plat/gpio-switch.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * GPIO switch definitions
3 *
4 * Copyright (C) 2006 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_OMAP_GPIO_SWITCH_H
12#define __ASM_ARCH_OMAP_GPIO_SWITCH_H
13
14#include <linux/types.h>
15
16/* Cover:
17 * high -> closed
18 * low -> open
19 * Connection:
20 * high -> connected
21 * low -> disconnected
22 * Activity:
23 * high -> active
24 * low -> inactive
25 *
26 */
27#define OMAP_GPIO_SWITCH_TYPE_COVER 0x0000
28#define OMAP_GPIO_SWITCH_TYPE_CONNECTION 0x0001
29#define OMAP_GPIO_SWITCH_TYPE_ACTIVITY 0x0002
30#define OMAP_GPIO_SWITCH_FLAG_INVERTED 0x0001
31#define OMAP_GPIO_SWITCH_FLAG_OUTPUT 0x0002
32
33struct omap_gpio_switch {
34 const char *name;
35 s16 gpio;
36 unsigned flags:4;
37 unsigned type:4;
38
39 /* Time in ms to debounce when transitioning from
40 * inactive state to active state. */
41 u16 debounce_rising;
42 /* Same for transition from active to inactive state. */
43 u16 debounce_falling;
44
45 /* notify board-specific code about state changes */
46 void (* notify)(void *data, int state);
47 void *notify_data;
48};
49
50/* Call at init time only */
51extern void omap_register_gpio_switches(const struct omap_gpio_switch *tbl,
52 int count);
53
54#endif
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
deleted file mode 100644
index 50fb7cc000e..00000000000
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ /dev/null
@@ -1,228 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/gpio.h
3 *
4 * OMAP GPIO handling defines and functions
5 *
6 * Copyright (C) 2003-2005 Nokia Corporation
7 *
8 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26#ifndef __ASM_ARCH_OMAP_GPIO_H
27#define __ASM_ARCH_OMAP_GPIO_H
28
29#include <linux/io.h>
30#include <linux/platform_device.h>
31#include <mach/irqs.h>
32
33#define OMAP1_MPUIO_BASE 0xfffb5000
34
35/*
36 * These are the omap15xx/16xx offsets. The omap7xx offset are
37 * OMAP_MPUIO_ / 2 offsets below.
38 */
39#define OMAP_MPUIO_INPUT_LATCH 0x00
40#define OMAP_MPUIO_OUTPUT 0x04
41#define OMAP_MPUIO_IO_CNTL 0x08
42#define OMAP_MPUIO_KBR_LATCH 0x10
43#define OMAP_MPUIO_KBC 0x14
44#define OMAP_MPUIO_GPIO_EVENT_MODE 0x18
45#define OMAP_MPUIO_GPIO_INT_EDGE 0x1c
46#define OMAP_MPUIO_KBD_INT 0x20
47#define OMAP_MPUIO_GPIO_INT 0x24
48#define OMAP_MPUIO_KBD_MASKIT 0x28
49#define OMAP_MPUIO_GPIO_MASKIT 0x2c
50#define OMAP_MPUIO_GPIO_DEBOUNCING 0x30
51#define OMAP_MPUIO_LATCH 0x34
52
53#define OMAP34XX_NR_GPIOS 6
54
55/*
56 * OMAP1510 GPIO registers
57 */
58#define OMAP1510_GPIO_DATA_INPUT 0x00
59#define OMAP1510_GPIO_DATA_OUTPUT 0x04
60#define OMAP1510_GPIO_DIR_CONTROL 0x08
61#define OMAP1510_GPIO_INT_CONTROL 0x0c
62#define OMAP1510_GPIO_INT_MASK 0x10
63#define OMAP1510_GPIO_INT_STATUS 0x14
64#define OMAP1510_GPIO_PIN_CONTROL 0x18
65
66#define OMAP1510_IH_GPIO_BASE 64
67
68/*
69 * OMAP1610 specific GPIO registers
70 */
71#define OMAP1610_GPIO_REVISION 0x0000
72#define OMAP1610_GPIO_SYSCONFIG 0x0010
73#define OMAP1610_GPIO_SYSSTATUS 0x0014
74#define OMAP1610_GPIO_IRQSTATUS1 0x0018
75#define OMAP1610_GPIO_IRQENABLE1 0x001c
76#define OMAP1610_GPIO_WAKEUPENABLE 0x0028
77#define OMAP1610_GPIO_DATAIN 0x002c
78#define OMAP1610_GPIO_DATAOUT 0x0030
79#define OMAP1610_GPIO_DIRECTION 0x0034
80#define OMAP1610_GPIO_EDGE_CTRL1 0x0038
81#define OMAP1610_GPIO_EDGE_CTRL2 0x003c
82#define OMAP1610_GPIO_CLEAR_IRQENABLE1 0x009c
83#define OMAP1610_GPIO_CLEAR_WAKEUPENA 0x00a8
84#define OMAP1610_GPIO_CLEAR_DATAOUT 0x00b0
85#define OMAP1610_GPIO_SET_IRQENABLE1 0x00dc
86#define OMAP1610_GPIO_SET_WAKEUPENA 0x00e8
87#define OMAP1610_GPIO_SET_DATAOUT 0x00f0
88
89/*
90 * OMAP7XX specific GPIO registers
91 */
92#define OMAP7XX_GPIO_DATA_INPUT 0x00
93#define OMAP7XX_GPIO_DATA_OUTPUT 0x04
94#define OMAP7XX_GPIO_DIR_CONTROL 0x08
95#define OMAP7XX_GPIO_INT_CONTROL 0x0c
96#define OMAP7XX_GPIO_INT_MASK 0x10
97#define OMAP7XX_GPIO_INT_STATUS 0x14
98
99/*
100 * omap2+ specific GPIO registers
101 */
102#define OMAP24XX_GPIO_REVISION 0x0000
103#define OMAP24XX_GPIO_IRQSTATUS1 0x0018
104#define OMAP24XX_GPIO_IRQSTATUS2 0x0028
105#define OMAP24XX_GPIO_IRQENABLE2 0x002c
106#define OMAP24XX_GPIO_IRQENABLE1 0x001c
107#define OMAP24XX_GPIO_WAKE_EN 0x0020
108#define OMAP24XX_GPIO_CTRL 0x0030
109#define OMAP24XX_GPIO_OE 0x0034
110#define OMAP24XX_GPIO_DATAIN 0x0038
111#define OMAP24XX_GPIO_DATAOUT 0x003c
112#define OMAP24XX_GPIO_LEVELDETECT0 0x0040
113#define OMAP24XX_GPIO_LEVELDETECT1 0x0044
114#define OMAP24XX_GPIO_RISINGDETECT 0x0048
115#define OMAP24XX_GPIO_FALLINGDETECT 0x004c
116#define OMAP24XX_GPIO_DEBOUNCE_EN 0x0050
117#define OMAP24XX_GPIO_DEBOUNCE_VAL 0x0054
118#define OMAP24XX_GPIO_CLEARIRQENABLE1 0x0060
119#define OMAP24XX_GPIO_SETIRQENABLE1 0x0064
120#define OMAP24XX_GPIO_CLEARWKUENA 0x0080
121#define OMAP24XX_GPIO_SETWKUENA 0x0084
122#define OMAP24XX_GPIO_CLEARDATAOUT 0x0090
123#define OMAP24XX_GPIO_SETDATAOUT 0x0094
124
125#define OMAP4_GPIO_REVISION 0x0000
126#define OMAP4_GPIO_EOI 0x0020
127#define OMAP4_GPIO_IRQSTATUSRAW0 0x0024
128#define OMAP4_GPIO_IRQSTATUSRAW1 0x0028
129#define OMAP4_GPIO_IRQSTATUS0 0x002c
130#define OMAP4_GPIO_IRQSTATUS1 0x0030
131#define OMAP4_GPIO_IRQSTATUSSET0 0x0034
132#define OMAP4_GPIO_IRQSTATUSSET1 0x0038
133#define OMAP4_GPIO_IRQSTATUSCLR0 0x003c
134#define OMAP4_GPIO_IRQSTATUSCLR1 0x0040
135#define OMAP4_GPIO_IRQWAKEN0 0x0044
136#define OMAP4_GPIO_IRQWAKEN1 0x0048
137#define OMAP4_GPIO_IRQENABLE1 0x011c
138#define OMAP4_GPIO_WAKE_EN 0x0120
139#define OMAP4_GPIO_IRQSTATUS2 0x0128
140#define OMAP4_GPIO_IRQENABLE2 0x012c
141#define OMAP4_GPIO_CTRL 0x0130
142#define OMAP4_GPIO_OE 0x0134
143#define OMAP4_GPIO_DATAIN 0x0138
144#define OMAP4_GPIO_DATAOUT 0x013c
145#define OMAP4_GPIO_LEVELDETECT0 0x0140
146#define OMAP4_GPIO_LEVELDETECT1 0x0144
147#define OMAP4_GPIO_RISINGDETECT 0x0148
148#define OMAP4_GPIO_FALLINGDETECT 0x014c
149#define OMAP4_GPIO_DEBOUNCENABLE 0x0150
150#define OMAP4_GPIO_DEBOUNCINGTIME 0x0154
151#define OMAP4_GPIO_CLEARIRQENABLE1 0x0160
152#define OMAP4_GPIO_SETIRQENABLE1 0x0164
153#define OMAP4_GPIO_CLEARWKUENA 0x0180
154#define OMAP4_GPIO_SETWKUENA 0x0184
155#define OMAP4_GPIO_CLEARDATAOUT 0x0190
156#define OMAP4_GPIO_SETDATAOUT 0x0194
157
158#define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr))
159#define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES)
160
161struct omap_gpio_dev_attr {
162 int bank_width; /* GPIO bank width */
163 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
164};
165
166struct omap_gpio_reg_offs {
167 u16 revision;
168 u16 direction;
169 u16 datain;
170 u16 dataout;
171 u16 set_dataout;
172 u16 clr_dataout;
173 u16 irqstatus;
174 u16 irqstatus2;
175 u16 irqstatus_raw0;
176 u16 irqstatus_raw1;
177 u16 irqenable;
178 u16 irqenable2;
179 u16 set_irqenable;
180 u16 clr_irqenable;
181 u16 debounce;
182 u16 debounce_en;
183 u16 ctrl;
184 u16 wkup_en;
185 u16 leveldetect0;
186 u16 leveldetect1;
187 u16 risingdetect;
188 u16 fallingdetect;
189 u16 irqctrl;
190 u16 edgectrl1;
191 u16 edgectrl2;
192 u16 pinctrl;
193
194 bool irqenable_inv;
195};
196
197struct omap_gpio_platform_data {
198 int bank_type;
199 int bank_width; /* GPIO bank width */
200 int bank_stride; /* Only needed for omap1 MPUIO */
201 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
202 bool loses_context; /* whether the bank would ever lose context */
203 bool is_mpuio; /* whether the bank is of type MPUIO */
204 u32 non_wakeup_gpios;
205
206 struct omap_gpio_reg_offs *regs;
207
208 /* Return context loss count due to PM states changing */
209 int (*get_context_loss_count)(struct device *dev);
210};
211
212extern void omap2_gpio_prepare_for_idle(int off_mode);
213extern void omap2_gpio_resume_after_idle(void);
214extern void omap_set_gpio_debounce(int gpio, int enable);
215extern void omap_set_gpio_debounce_time(int gpio, int enable);
216/*-------------------------------------------------------------------------*/
217
218/*
219 * Wrappers for "new style" GPIO calls, using the new infrastructure
220 * which lets us plug in FPGA, I2C, and other implementations.
221 *
222 * The original OMAP-specific calls should eventually be removed.
223 */
224
225#include <linux/errno.h>
226#include <asm-generic/gpio.h>
227
228#endif
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h
index f37764a3607..2e6e2597178 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -133,6 +133,25 @@ struct gpmc_timings {
133 u16 wr_data_mux_bus; /* WRDATAONADMUXBUS */ 133 u16 wr_data_mux_bus; /* WRDATAONADMUXBUS */
134}; 134};
135 135
136struct gpmc_nand_regs {
137 void __iomem *gpmc_status;
138 void __iomem *gpmc_nand_command;
139 void __iomem *gpmc_nand_address;
140 void __iomem *gpmc_nand_data;
141 void __iomem *gpmc_prefetch_config1;
142 void __iomem *gpmc_prefetch_config2;
143 void __iomem *gpmc_prefetch_control;
144 void __iomem *gpmc_prefetch_status;
145 void __iomem *gpmc_ecc_config;
146 void __iomem *gpmc_ecc_control;
147 void __iomem *gpmc_ecc_size_config;
148 void __iomem *gpmc_ecc1_result;
149 void __iomem *gpmc_bch_result0;
150};
151
152extern void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs);
153extern int gpmc_get_client_irq(unsigned irq_config);
154
136extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns); 155extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
137extern unsigned int gpmc_ps_to_ticks(unsigned int time_ps); 156extern unsigned int gpmc_ps_to_ticks(unsigned int time_ps);
138extern unsigned int gpmc_ticks_to_ns(unsigned int ticks); 157extern unsigned int gpmc_ticks_to_ns(unsigned int ticks);
diff --git a/arch/arm/plat-omap/include/plat/hardware.h b/arch/arm/plat-omap/include/plat/hardware.h
deleted file mode 100644
index ddbde38e1e3..00000000000
--- a/arch/arm/plat-omap/include/plat/hardware.h
+++ /dev/null
@@ -1,293 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/hardware.h
3 *
4 * Hardware definitions for TI OMAP processors and boards
5 *
6 * NOTE: Please put device driver specific defines into a separate header
7 * file for each driver.
8 *
9 * Copyright (C) 2001 RidgeRun, Inc.
10 * Author: RidgeRun, Inc. Greg Lonnon <glonnon@ridgerun.com>
11 *
12 * Reorganized for Linux-2.6 by Tony Lindgren <tony@atomide.com>
13 * and Dirk Behme <dirk.behme@de.bosch.com>
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 *
20 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
21 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
23 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * You should have received a copy of the GNU General Public License along
32 * with this program; if not, write to the Free Software Foundation, Inc.,
33 * 675 Mass Ave, Cambridge, MA 02139, USA.
34 */
35
36#ifndef __ASM_ARCH_OMAP_HARDWARE_H
37#define __ASM_ARCH_OMAP_HARDWARE_H
38
39#include <asm/sizes.h>
40#ifndef __ASSEMBLER__
41#include <asm/types.h>
42#include <plat/cpu.h>
43#endif
44#include <plat/serial.h>
45
46/*
47 * ---------------------------------------------------------------------------
48 * Common definitions for all OMAP processors
49 * NOTE: Put all processor or board specific parts to the special header
50 * files.
51 * ---------------------------------------------------------------------------
52 */
53
54/*
55 * ----------------------------------------------------------------------------
56 * Timers
57 * ----------------------------------------------------------------------------
58 */
59#define OMAP_MPU_TIMER1_BASE (0xfffec500)
60#define OMAP_MPU_TIMER2_BASE (0xfffec600)
61#define OMAP_MPU_TIMER3_BASE (0xfffec700)
62#define MPU_TIMER_FREE (1 << 6)
63#define MPU_TIMER_CLOCK_ENABLE (1 << 5)
64#define MPU_TIMER_AR (1 << 1)
65#define MPU_TIMER_ST (1 << 0)
66
67/*
68 * ----------------------------------------------------------------------------
69 * Clocks
70 * ----------------------------------------------------------------------------
71 */
72#define CLKGEN_REG_BASE (0xfffece00)
73#define ARM_CKCTL (CLKGEN_REG_BASE + 0x0)
74#define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4)
75#define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8)
76#define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC)
77#define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10)
78#define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14)
79#define ARM_SYSST (CLKGEN_REG_BASE + 0x18)
80#define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24)
81
82#define CK_RATEF 1
83#define CK_IDLEF 2
84#define CK_ENABLEF 4
85#define CK_SELECTF 8
86#define SETARM_IDLE_SHIFT
87
88/* DPLL control registers */
89#define DPLL_CTL (0xfffecf00)
90
91/* DSP clock control. Must use __raw_readw() and __raw_writew() with these */
92#define DSP_CONFIG_REG_BASE IOMEM(0xe1008000)
93#define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0)
94#define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4)
95#define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8)
96#define DSP_RSTCT2 (DSP_CONFIG_REG_BASE + 0x14)
97
98/*
99 * ---------------------------------------------------------------------------
100 * UPLD
101 * ---------------------------------------------------------------------------
102 */
103#define ULPD_REG_BASE (0xfffe0800)
104#define ULPD_IT_STATUS (ULPD_REG_BASE + 0x14)
105#define ULPD_SETUP_ANALOG_CELL_3 (ULPD_REG_BASE + 0x24)
106#define ULPD_CLOCK_CTRL (ULPD_REG_BASE + 0x30)
107# define DIS_USB_PVCI_CLK (1 << 5) /* no USB/FAC synch */
108# define USB_MCLK_EN (1 << 4) /* enable W4_USB_CLKO */
109#define ULPD_SOFT_REQ (ULPD_REG_BASE + 0x34)
110# define SOFT_UDC_REQ (1 << 4)
111# define SOFT_USB_CLK_REQ (1 << 3)
112# define SOFT_DPLL_REQ (1 << 0)
113#define ULPD_DPLL_CTRL (ULPD_REG_BASE + 0x3c)
114#define ULPD_STATUS_REQ (ULPD_REG_BASE + 0x40)
115#define ULPD_APLL_CTRL (ULPD_REG_BASE + 0x4c)
116#define ULPD_POWER_CTRL (ULPD_REG_BASE + 0x50)
117#define ULPD_SOFT_DISABLE_REQ_REG (ULPD_REG_BASE + 0x68)
118# define DIS_MMC2_DPLL_REQ (1 << 11)
119# define DIS_MMC1_DPLL_REQ (1 << 10)
120# define DIS_UART3_DPLL_REQ (1 << 9)
121# define DIS_UART2_DPLL_REQ (1 << 8)
122# define DIS_UART1_DPLL_REQ (1 << 7)
123# define DIS_USB_HOST_DPLL_REQ (1 << 6)
124#define ULPD_SDW_CLK_DIV_CTRL_SEL (ULPD_REG_BASE + 0x74)
125#define ULPD_CAM_CLK_CTRL (ULPD_REG_BASE + 0x7c)
126
127/*
128 * ---------------------------------------------------------------------------
129 * Watchdog timer
130 * ---------------------------------------------------------------------------
131 */
132
133/* Watchdog timer within the OMAP3.2 gigacell */
134#define OMAP_MPU_WATCHDOG_BASE (0xfffec800)
135#define OMAP_WDT_TIMER (OMAP_MPU_WATCHDOG_BASE + 0x0)
136#define OMAP_WDT_LOAD_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4)
137#define OMAP_WDT_READ_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4)
138#define OMAP_WDT_TIMER_MODE (OMAP_MPU_WATCHDOG_BASE + 0x8)
139
140/*
141 * ---------------------------------------------------------------------------
142 * Interrupts
143 * ---------------------------------------------------------------------------
144 */
145#ifdef CONFIG_ARCH_OMAP1
146
147/*
148 * XXX: These probably want to be moved to arch/arm/mach-omap/omap1/irq.c
149 * or something similar.. -- PFM.
150 */
151
152#define OMAP_IH1_BASE 0xfffecb00
153#define OMAP_IH2_BASE 0xfffe0000
154
155#define OMAP_IH1_ITR (OMAP_IH1_BASE + 0x00)
156#define OMAP_IH1_MIR (OMAP_IH1_BASE + 0x04)
157#define OMAP_IH1_SIR_IRQ (OMAP_IH1_BASE + 0x10)
158#define OMAP_IH1_SIR_FIQ (OMAP_IH1_BASE + 0x14)
159#define OMAP_IH1_CONTROL (OMAP_IH1_BASE + 0x18)
160#define OMAP_IH1_ILR0 (OMAP_IH1_BASE + 0x1c)
161#define OMAP_IH1_ISR (OMAP_IH1_BASE + 0x9c)
162
163#define OMAP_IH2_ITR (OMAP_IH2_BASE + 0x00)
164#define OMAP_IH2_MIR (OMAP_IH2_BASE + 0x04)
165#define OMAP_IH2_SIR_IRQ (OMAP_IH2_BASE + 0x10)
166#define OMAP_IH2_SIR_FIQ (OMAP_IH2_BASE + 0x14)
167#define OMAP_IH2_CONTROL (OMAP_IH2_BASE + 0x18)
168#define OMAP_IH2_ILR0 (OMAP_IH2_BASE + 0x1c)
169#define OMAP_IH2_ISR (OMAP_IH2_BASE + 0x9c)
170
171#define IRQ_ITR_REG_OFFSET 0x00
172#define IRQ_MIR_REG_OFFSET 0x04
173#define IRQ_SIR_IRQ_REG_OFFSET 0x10
174#define IRQ_SIR_FIQ_REG_OFFSET 0x14
175#define IRQ_CONTROL_REG_OFFSET 0x18
176#define IRQ_ISR_REG_OFFSET 0x9c
177#define IRQ_ILR0_REG_OFFSET 0x1c
178#define IRQ_GMR_REG_OFFSET 0xa0
179
180#endif
181
182/*
183 * ----------------------------------------------------------------------------
184 * System control registers
185 * ----------------------------------------------------------------------------
186 */
187#define MOD_CONF_CTRL_0 0xfffe1080
188#define MOD_CONF_CTRL_1 0xfffe1110
189
190/*
191 * ----------------------------------------------------------------------------
192 * Pin multiplexing registers
193 * ----------------------------------------------------------------------------
194 */
195#define FUNC_MUX_CTRL_0 0xfffe1000
196#define FUNC_MUX_CTRL_1 0xfffe1004
197#define FUNC_MUX_CTRL_2 0xfffe1008
198#define COMP_MODE_CTRL_0 0xfffe100c
199#define FUNC_MUX_CTRL_3 0xfffe1010
200#define FUNC_MUX_CTRL_4 0xfffe1014
201#define FUNC_MUX_CTRL_5 0xfffe1018
202#define FUNC_MUX_CTRL_6 0xfffe101C
203#define FUNC_MUX_CTRL_7 0xfffe1020
204#define FUNC_MUX_CTRL_8 0xfffe1024
205#define FUNC_MUX_CTRL_9 0xfffe1028
206#define FUNC_MUX_CTRL_A 0xfffe102C
207#define FUNC_MUX_CTRL_B 0xfffe1030
208#define FUNC_MUX_CTRL_C 0xfffe1034
209#define FUNC_MUX_CTRL_D 0xfffe1038
210#define PULL_DWN_CTRL_0 0xfffe1040
211#define PULL_DWN_CTRL_1 0xfffe1044
212#define PULL_DWN_CTRL_2 0xfffe1048
213#define PULL_DWN_CTRL_3 0xfffe104c
214#define PULL_DWN_CTRL_4 0xfffe10ac
215
216/* OMAP-1610 specific multiplexing registers */
217#define FUNC_MUX_CTRL_E 0xfffe1090
218#define FUNC_MUX_CTRL_F 0xfffe1094
219#define FUNC_MUX_CTRL_10 0xfffe1098
220#define FUNC_MUX_CTRL_11 0xfffe109c
221#define FUNC_MUX_CTRL_12 0xfffe10a0
222#define PU_PD_SEL_0 0xfffe10b4
223#define PU_PD_SEL_1 0xfffe10b8
224#define PU_PD_SEL_2 0xfffe10bc
225#define PU_PD_SEL_3 0xfffe10c0
226#define PU_PD_SEL_4 0xfffe10c4
227
228/* Timer32K for 1610 and 1710*/
229#define OMAP_TIMER32K_BASE 0xFFFBC400
230
231/*
232 * ---------------------------------------------------------------------------
233 * TIPB bus interface
234 * ---------------------------------------------------------------------------
235 */
236#define TIPB_PUBLIC_CNTL_BASE 0xfffed300
237#define MPU_PUBLIC_TIPB_CNTL (TIPB_PUBLIC_CNTL_BASE + 0x8)
238#define TIPB_PRIVATE_CNTL_BASE 0xfffeca00
239#define MPU_PRIVATE_TIPB_CNTL (TIPB_PRIVATE_CNTL_BASE + 0x8)
240
241/*
242 * ----------------------------------------------------------------------------
243 * MPUI interface
244 * ----------------------------------------------------------------------------
245 */
246#define MPUI_BASE (0xfffec900)
247#define MPUI_CTRL (MPUI_BASE + 0x0)
248#define MPUI_DEBUG_ADDR (MPUI_BASE + 0x4)
249#define MPUI_DEBUG_DATA (MPUI_BASE + 0x8)
250#define MPUI_DEBUG_FLAG (MPUI_BASE + 0xc)
251#define MPUI_STATUS_REG (MPUI_BASE + 0x10)
252#define MPUI_DSP_STATUS (MPUI_BASE + 0x14)
253#define MPUI_DSP_BOOT_CONFIG (MPUI_BASE + 0x18)
254#define MPUI_DSP_API_CONFIG (MPUI_BASE + 0x1c)
255
256/*
257 * ----------------------------------------------------------------------------
258 * LED Pulse Generator
259 * ----------------------------------------------------------------------------
260 */
261#define OMAP_LPG1_BASE 0xfffbd000
262#define OMAP_LPG2_BASE 0xfffbd800
263#define OMAP_LPG1_LCR (OMAP_LPG1_BASE + 0x00)
264#define OMAP_LPG1_PMR (OMAP_LPG1_BASE + 0x04)
265#define OMAP_LPG2_LCR (OMAP_LPG2_BASE + 0x00)
266#define OMAP_LPG2_PMR (OMAP_LPG2_BASE + 0x04)
267
268/*
269 * ----------------------------------------------------------------------------
270 * Pulse-Width Light
271 * ----------------------------------------------------------------------------
272 */
273#define OMAP_PWL_BASE 0xfffb5800
274#define OMAP_PWL_ENABLE (OMAP_PWL_BASE + 0x00)
275#define OMAP_PWL_CLK_ENABLE (OMAP_PWL_BASE + 0x04)
276
277/*
278 * ---------------------------------------------------------------------------
279 * Processor specific defines
280 * ---------------------------------------------------------------------------
281 */
282
283#include <plat/omap7xx.h>
284#include <plat/omap1510.h>
285#include <plat/omap16xx.h>
286#include <plat/omap24xx.h>
287#include <plat/omap34xx.h>
288#include <plat/omap44xx.h>
289#include <plat/ti81xx.h>
290#include <plat/am33xx.h>
291#include <plat/omap54xx.h>
292
293#endif /* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/arch/arm/plat-omap/include/plat/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h
index 88be3e628b3..68b5f0362f3 100644
--- a/arch/arm/plat-omap/include/plat/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -103,6 +103,19 @@ struct iommu_functions {
103 ssize_t (*dump_ctx)(struct omap_iommu *obj, char *buf, ssize_t len); 103 ssize_t (*dump_ctx)(struct omap_iommu *obj, char *buf, ssize_t len);
104}; 104};
105 105
106/**
107 * struct omap_mmu_dev_attr - OMAP mmu device attributes for omap_hwmod
108 * @da_start: device address where the va space starts.
109 * @da_end: device address where the va space ends.
110 * @nr_tlb_entries: number of entries supported by the translation
111 * look-aside buffer (TLB).
112 */
113struct omap_mmu_dev_attr {
114 u32 da_start;
115 u32 da_end;
116 int nr_tlb_entries;
117};
118
106struct iommu_platform_data { 119struct iommu_platform_data {
107 const char *name; 120 const char *name;
108 const char *clk_name; 121 const char *clk_name;
@@ -126,6 +139,7 @@ struct omap_iommu_arch_data {
126 struct omap_iommu *iommu_dev; 139 struct omap_iommu *iommu_dev;
127}; 140};
128 141
142#ifdef CONFIG_IOMMU_API
129/** 143/**
130 * dev_to_omap_iommu() - retrieves an omap iommu object from a user device 144 * dev_to_omap_iommu() - retrieves an omap iommu object from a user device
131 * @dev: iommu client device 145 * @dev: iommu client device
@@ -136,6 +150,7 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct device *dev)
136 150
137 return arch_data->iommu_dev; 151 return arch_data->iommu_dev;
138} 152}
153#endif
139 154
140/* IOMMU errors */ 155/* IOMMU errors */
141#define OMAP_IOMMU_ERR_TLB_MISS (1 << 0) 156#define OMAP_IOMMU_ERR_TLB_MISS (1 << 0)
diff --git a/arch/arm/plat-omap/include/plat/irqs-44xx.h b/arch/arm/plat-omap/include/plat/irqs-44xx.h
deleted file mode 100644
index 518322c8011..00000000000
--- a/arch/arm/plat-omap/include/plat/irqs-44xx.h
+++ /dev/null
@@ -1,144 +0,0 @@
1/*
2 * OMAP4 Interrupt lines definitions
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 *
6 * Santosh Shilimkar (santosh.shilimkar@ti.com)
7 * Benoit Cousson (b-cousson@ti.com)
8 *
9 * This file is automatically generated from the OMAP hardware databases.
10 * We respectfully ask that any modifications to this file be coordinated
11 * with the public linux-omap@vger.kernel.org mailing list and the
12 * authors above to ensure that the autogeneration scripts are kept
13 * up-to-date with the file contents.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18 */
19
20#ifndef __ARCH_ARM_MACH_OMAP2_OMAP44XX_IRQS_H
21#define __ARCH_ARM_MACH_OMAP2_OMAP44XX_IRQS_H
22
23/* OMAP44XX IRQs numbers definitions */
24#define OMAP44XX_IRQ_LOCALTIMER 29
25#define OMAP44XX_IRQ_LOCALWDT 30
26
27#define OMAP44XX_IRQ_GIC_START 32
28
29#define OMAP44XX_IRQ_PL310 (0 + OMAP44XX_IRQ_GIC_START)
30#define OMAP44XX_IRQ_CTI0 (1 + OMAP44XX_IRQ_GIC_START)
31#define OMAP44XX_IRQ_CTI1 (2 + OMAP44XX_IRQ_GIC_START)
32#define OMAP44XX_IRQ_ELM (4 + OMAP44XX_IRQ_GIC_START)
33#define OMAP44XX_IRQ_SYS_1N (7 + OMAP44XX_IRQ_GIC_START)
34#define OMAP44XX_IRQ_SECURITY_EVENTS (8 + OMAP44XX_IRQ_GIC_START)
35#define OMAP44XX_IRQ_L3_DBG (9 + OMAP44XX_IRQ_GIC_START)
36#define OMAP44XX_IRQ_L3_APP (10 + OMAP44XX_IRQ_GIC_START)
37#define OMAP44XX_IRQ_PRCM (11 + OMAP44XX_IRQ_GIC_START)
38#define OMAP44XX_IRQ_SDMA_0 (12 + OMAP44XX_IRQ_GIC_START)
39#define OMAP44XX_IRQ_SDMA_1 (13 + OMAP44XX_IRQ_GIC_START)
40#define OMAP44XX_IRQ_SDMA_2 (14 + OMAP44XX_IRQ_GIC_START)
41#define OMAP44XX_IRQ_SDMA_3 (15 + OMAP44XX_IRQ_GIC_START)
42#define OMAP44XX_IRQ_MCBSP4 (16 + OMAP44XX_IRQ_GIC_START)
43#define OMAP44XX_IRQ_MCBSP1 (17 + OMAP44XX_IRQ_GIC_START)
44#define OMAP44XX_IRQ_SR_MCU (18 + OMAP44XX_IRQ_GIC_START)
45#define OMAP44XX_IRQ_SR_CORE (19 + OMAP44XX_IRQ_GIC_START)
46#define OMAP44XX_IRQ_GPMC (20 + OMAP44XX_IRQ_GIC_START)
47#define OMAP44XX_IRQ_GFX (21 + OMAP44XX_IRQ_GIC_START)
48#define OMAP44XX_IRQ_MCBSP2 (22 + OMAP44XX_IRQ_GIC_START)
49#define OMAP44XX_IRQ_MCBSP3 (23 + OMAP44XX_IRQ_GIC_START)
50#define OMAP44XX_IRQ_ISS_5 (24 + OMAP44XX_IRQ_GIC_START)
51#define OMAP44XX_IRQ_DSS_DISPC (25 + OMAP44XX_IRQ_GIC_START)
52#define OMAP44XX_IRQ_MAIL_U0 (26 + OMAP44XX_IRQ_GIC_START)
53#define OMAP44XX_IRQ_C2C_SSCM_0 (27 + OMAP44XX_IRQ_GIC_START)
54#define OMAP44XX_IRQ_TESLA_MMU (28 + OMAP44XX_IRQ_GIC_START)
55#define OMAP44XX_IRQ_GPIO1 (29 + OMAP44XX_IRQ_GIC_START)
56#define OMAP44XX_IRQ_GPIO2 (30 + OMAP44XX_IRQ_GIC_START)
57#define OMAP44XX_IRQ_GPIO3 (31 + OMAP44XX_IRQ_GIC_START)
58#define OMAP44XX_IRQ_GPIO4 (32 + OMAP44XX_IRQ_GIC_START)
59#define OMAP44XX_IRQ_GPIO5 (33 + OMAP44XX_IRQ_GIC_START)
60#define OMAP44XX_IRQ_GPIO6 (34 + OMAP44XX_IRQ_GIC_START)
61#define OMAP44XX_IRQ_USIM (35 + OMAP44XX_IRQ_GIC_START)
62#define OMAP44XX_IRQ_WDT3 (36 + OMAP44XX_IRQ_GIC_START)
63#define OMAP44XX_IRQ_GPT1 (37 + OMAP44XX_IRQ_GIC_START)
64#define OMAP44XX_IRQ_GPT2 (38 + OMAP44XX_IRQ_GIC_START)
65#define OMAP44XX_IRQ_GPT3 (39 + OMAP44XX_IRQ_GIC_START)
66#define OMAP44XX_IRQ_GPT4 (40 + OMAP44XX_IRQ_GIC_START)
67#define OMAP44XX_IRQ_GPT5 (41 + OMAP44XX_IRQ_GIC_START)
68#define OMAP44XX_IRQ_GPT6 (42 + OMAP44XX_IRQ_GIC_START)
69#define OMAP44XX_IRQ_GPT7 (43 + OMAP44XX_IRQ_GIC_START)
70#define OMAP44XX_IRQ_GPT8 (44 + OMAP44XX_IRQ_GIC_START)
71#define OMAP44XX_IRQ_GPT9 (45 + OMAP44XX_IRQ_GIC_START)
72#define OMAP44XX_IRQ_GPT10 (46 + OMAP44XX_IRQ_GIC_START)
73#define OMAP44XX_IRQ_GPT11 (47 + OMAP44XX_IRQ_GIC_START)
74#define OMAP44XX_IRQ_SPI4 (48 + OMAP44XX_IRQ_GIC_START)
75#define OMAP44XX_IRQ_SHA1_S (49 + OMAP44XX_IRQ_GIC_START)
76#define OMAP44XX_IRQ_FPKA_SINTREQUEST_S (50 + OMAP44XX_IRQ_GIC_START)
77#define OMAP44XX_IRQ_SHA1_P (51 + OMAP44XX_IRQ_GIC_START)
78#define OMAP44XX_IRQ_RNG (52 + OMAP44XX_IRQ_GIC_START)
79#define OMAP44XX_IRQ_DSS_DSI1 (53 + OMAP44XX_IRQ_GIC_START)
80#define OMAP44XX_IRQ_I2C1 (56 + OMAP44XX_IRQ_GIC_START)
81#define OMAP44XX_IRQ_I2C2 (57 + OMAP44XX_IRQ_GIC_START)
82#define OMAP44XX_IRQ_HDQ (58 + OMAP44XX_IRQ_GIC_START)
83#define OMAP44XX_IRQ_MMC5 (59 + OMAP44XX_IRQ_GIC_START)
84#define OMAP44XX_IRQ_I2C3 (61 + OMAP44XX_IRQ_GIC_START)
85#define OMAP44XX_IRQ_I2C4 (62 + OMAP44XX_IRQ_GIC_START)
86#define OMAP44XX_IRQ_AES2_S (63 + OMAP44XX_IRQ_GIC_START)
87#define OMAP44XX_IRQ_AES2_P (64 + OMAP44XX_IRQ_GIC_START)
88#define OMAP44XX_IRQ_SPI1 (65 + OMAP44XX_IRQ_GIC_START)
89#define OMAP44XX_IRQ_SPI2 (66 + OMAP44XX_IRQ_GIC_START)
90#define OMAP44XX_IRQ_HSI_P1 (67 + OMAP44XX_IRQ_GIC_START)
91#define OMAP44XX_IRQ_HSI_P2 (68 + OMAP44XX_IRQ_GIC_START)
92#define OMAP44XX_IRQ_FDIF_3 (69 + OMAP44XX_IRQ_GIC_START)
93#define OMAP44XX_IRQ_UART4 (70 + OMAP44XX_IRQ_GIC_START)
94#define OMAP44XX_IRQ_HSI_DMA (71 + OMAP44XX_IRQ_GIC_START)
95#define OMAP44XX_IRQ_UART1 (72 + OMAP44XX_IRQ_GIC_START)
96#define OMAP44XX_IRQ_UART2 (73 + OMAP44XX_IRQ_GIC_START)
97#define OMAP44XX_IRQ_UART3 (74 + OMAP44XX_IRQ_GIC_START)
98#define OMAP44XX_IRQ_PBIAS (75 + OMAP44XX_IRQ_GIC_START)
99#define OMAP44XX_IRQ_OHCI (76 + OMAP44XX_IRQ_GIC_START)
100#define OMAP44XX_IRQ_EHCI (77 + OMAP44XX_IRQ_GIC_START)
101#define OMAP44XX_IRQ_TLL (78 + OMAP44XX_IRQ_GIC_START)
102#define OMAP44XX_IRQ_AES1_S (79 + OMAP44XX_IRQ_GIC_START)
103#define OMAP44XX_IRQ_WDT2 (80 + OMAP44XX_IRQ_GIC_START)
104#define OMAP44XX_IRQ_DES_S (81 + OMAP44XX_IRQ_GIC_START)
105#define OMAP44XX_IRQ_DES_P (82 + OMAP44XX_IRQ_GIC_START)
106#define OMAP44XX_IRQ_MMC1 (83 + OMAP44XX_IRQ_GIC_START)
107#define OMAP44XX_IRQ_DSS_DSI2 (84 + OMAP44XX_IRQ_GIC_START)
108#define OMAP44XX_IRQ_AES1_P (85 + OMAP44XX_IRQ_GIC_START)
109#define OMAP44XX_IRQ_MMC2 (86 + OMAP44XX_IRQ_GIC_START)
110#define OMAP44XX_IRQ_MPU_ICR (87 + OMAP44XX_IRQ_GIC_START)
111#define OMAP44XX_IRQ_C2C_SSCM_1 (88 + OMAP44XX_IRQ_GIC_START)
112#define OMAP44XX_IRQ_FSUSB (89 + OMAP44XX_IRQ_GIC_START)
113#define OMAP44XX_IRQ_FSUSB_SMI (90 + OMAP44XX_IRQ_GIC_START)
114#define OMAP44XX_IRQ_SPI3 (91 + OMAP44XX_IRQ_GIC_START)
115#define OMAP44XX_IRQ_HS_USB_MC_N (92 + OMAP44XX_IRQ_GIC_START)
116#define OMAP44XX_IRQ_HS_USB_DMA_N (93 + OMAP44XX_IRQ_GIC_START)
117#define OMAP44XX_IRQ_MMC3 (94 + OMAP44XX_IRQ_GIC_START)
118#define OMAP44XX_IRQ_GPT12 (95 + OMAP44XX_IRQ_GIC_START)
119#define OMAP44XX_IRQ_MMC4 (96 + OMAP44XX_IRQ_GIC_START)
120#define OMAP44XX_IRQ_SLIMBUS1 (97 + OMAP44XX_IRQ_GIC_START)
121#define OMAP44XX_IRQ_SLIMBUS2 (98 + OMAP44XX_IRQ_GIC_START)
122#define OMAP44XX_IRQ_ABE (99 + OMAP44XX_IRQ_GIC_START)
123#define OMAP44XX_IRQ_DUCATI_MMU (100 + OMAP44XX_IRQ_GIC_START)
124#define OMAP44XX_IRQ_DSS_HDMI (101 + OMAP44XX_IRQ_GIC_START)
125#define OMAP44XX_IRQ_SR_IVA (102 + OMAP44XX_IRQ_GIC_START)
126#define OMAP44XX_IRQ_IVA_HD_POSYNCITRPEND_1 (103 + OMAP44XX_IRQ_GIC_START)
127#define OMAP44XX_IRQ_IVA_HD_POSYNCITRPEND_0 (104 + OMAP44XX_IRQ_GIC_START)
128#define OMAP44XX_IRQ_IVA_HD_POMBINTRPEND_0 (107 + OMAP44XX_IRQ_GIC_START)
129#define OMAP44XX_IRQ_MCASP1_AR (108 + OMAP44XX_IRQ_GIC_START)
130#define OMAP44XX_IRQ_MCASP1_AX (109 + OMAP44XX_IRQ_GIC_START)
131#define OMAP44XX_IRQ_EMIF4_1 (110 + OMAP44XX_IRQ_GIC_START)
132#define OMAP44XX_IRQ_EMIF4_2 (111 + OMAP44XX_IRQ_GIC_START)
133#define OMAP44XX_IRQ_MCPDM (112 + OMAP44XX_IRQ_GIC_START)
134#define OMAP44XX_IRQ_DMM (113 + OMAP44XX_IRQ_GIC_START)
135#define OMAP44XX_IRQ_DMIC (114 + OMAP44XX_IRQ_GIC_START)
136#define OMAP44XX_IRQ_CDMA_0 (115 + OMAP44XX_IRQ_GIC_START)
137#define OMAP44XX_IRQ_CDMA_1 (116 + OMAP44XX_IRQ_GIC_START)
138#define OMAP44XX_IRQ_CDMA_2 (117 + OMAP44XX_IRQ_GIC_START)
139#define OMAP44XX_IRQ_CDMA_3 (118 + OMAP44XX_IRQ_GIC_START)
140#define OMAP44XX_IRQ_SYS_2N (119 + OMAP44XX_IRQ_GIC_START)
141#define OMAP44XX_IRQ_KBD_CTL (120 + OMAP44XX_IRQ_GIC_START)
142#define OMAP44XX_IRQ_UNIPRO1 (124 + OMAP44XX_IRQ_GIC_START)
143
144#endif
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
deleted file mode 100644
index 37bbbbb981b..00000000000
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ /dev/null
@@ -1,453 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/irqs.h
3 *
4 * Copyright (C) Greg Lonnon 2001
5 * Updated for OMAP-1610 by Tony Lindgren <tony@atomide.com>
6 *
7 * Copyright (C) 2009 Texas Instruments
8 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 * NOTE: The interrupt vectors for the OMAP-1509, OMAP-1510, and OMAP-1610
25 * are different.
26 */
27
28#ifndef __ASM_ARCH_OMAP15XX_IRQS_H
29#define __ASM_ARCH_OMAP15XX_IRQS_H
30
31/* All OMAP4 specific defines are moved to irqs-44xx.h */
32#include "irqs-44xx.h"
33
34/*
35 * IRQ numbers for interrupt handler 1
36 *
37 * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below
38 *
39 */
40#define INT_CAMERA 1
41#define INT_FIQ 3
42#define INT_RTDX 6
43#define INT_DSP_MMU_ABORT 7
44#define INT_HOST 8
45#define INT_ABORT 9
46#define INT_BRIDGE_PRIV 13
47#define INT_GPIO_BANK1 14
48#define INT_UART3 15
49#define INT_TIMER3 16
50#define INT_DMA_CH0_6 19
51#define INT_DMA_CH1_7 20
52#define INT_DMA_CH2_8 21
53#define INT_DMA_CH3 22
54#define INT_DMA_CH4 23
55#define INT_DMA_CH5 24
56#define INT_DMA_LCD 25
57#define INT_TIMER1 26
58#define INT_WD_TIMER 27
59#define INT_BRIDGE_PUB 28
60#define INT_TIMER2 30
61#define INT_LCD_CTRL 31
62
63/*
64 * OMAP-1510 specific IRQ numbers for interrupt handler 1
65 */
66#define INT_1510_IH2_IRQ 0
67#define INT_1510_RES2 2
68#define INT_1510_SPI_TX 4
69#define INT_1510_SPI_RX 5
70#define INT_1510_DSP_MAILBOX1 10
71#define INT_1510_DSP_MAILBOX2 11
72#define INT_1510_RES12 12
73#define INT_1510_LB_MMU 17
74#define INT_1510_RES18 18
75#define INT_1510_LOCAL_BUS 29
76
77/*
78 * OMAP-1610 specific IRQ numbers for interrupt handler 1
79 */
80#define INT_1610_IH2_IRQ INT_1510_IH2_IRQ
81#define INT_1610_IH2_FIQ 2
82#define INT_1610_McBSP2_TX 4
83#define INT_1610_McBSP2_RX 5
84#define INT_1610_DSP_MAILBOX1 10
85#define INT_1610_DSP_MAILBOX2 11
86#define INT_1610_LCD_LINE 12
87#define INT_1610_GPTIMER1 17
88#define INT_1610_GPTIMER2 18
89#define INT_1610_SSR_FIFO_0 29
90
91/*
92 * OMAP-7xx specific IRQ numbers for interrupt handler 1
93 */
94#define INT_7XX_IH2_FIQ 0
95#define INT_7XX_IH2_IRQ 1
96#define INT_7XX_USB_NON_ISO 2
97#define INT_7XX_USB_ISO 3
98#define INT_7XX_ICR 4
99#define INT_7XX_EAC 5
100#define INT_7XX_GPIO_BANK1 6
101#define INT_7XX_GPIO_BANK2 7
102#define INT_7XX_GPIO_BANK3 8
103#define INT_7XX_McBSP2TX 10
104#define INT_7XX_McBSP2RX 11
105#define INT_7XX_McBSP2RX_OVF 12
106#define INT_7XX_LCD_LINE 14
107#define INT_7XX_GSM_PROTECT 15
108#define INT_7XX_TIMER3 16
109#define INT_7XX_GPIO_BANK5 17
110#define INT_7XX_GPIO_BANK6 18
111#define INT_7XX_SPGIO_WR 29
112
113/*
114 * IRQ numbers for interrupt handler 2
115 *
116 * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below
117 */
118#define IH2_BASE 32
119
120#define INT_KEYBOARD (1 + IH2_BASE)
121#define INT_uWireTX (2 + IH2_BASE)
122#define INT_uWireRX (3 + IH2_BASE)
123#define INT_I2C (4 + IH2_BASE)
124#define INT_MPUIO (5 + IH2_BASE)
125#define INT_USB_HHC_1 (6 + IH2_BASE)
126#define INT_McBSP3TX (10 + IH2_BASE)
127#define INT_McBSP3RX (11 + IH2_BASE)
128#define INT_McBSP1TX (12 + IH2_BASE)
129#define INT_McBSP1RX (13 + IH2_BASE)
130#define INT_UART1 (14 + IH2_BASE)
131#define INT_UART2 (15 + IH2_BASE)
132#define INT_BT_MCSI1TX (16 + IH2_BASE)
133#define INT_BT_MCSI1RX (17 + IH2_BASE)
134#define INT_SOSSI_MATCH (19 + IH2_BASE)
135#define INT_USB_W2FC (20 + IH2_BASE)
136#define INT_1WIRE (21 + IH2_BASE)
137#define INT_OS_TIMER (22 + IH2_BASE)
138#define INT_MMC (23 + IH2_BASE)
139#define INT_GAUGE_32K (24 + IH2_BASE)
140#define INT_RTC_TIMER (25 + IH2_BASE)
141#define INT_RTC_ALARM (26 + IH2_BASE)
142#define INT_MEM_STICK (27 + IH2_BASE)
143
144/*
145 * OMAP-1510 specific IRQ numbers for interrupt handler 2
146 */
147#define INT_1510_DSP_MMU (28 + IH2_BASE)
148#define INT_1510_COM_SPI_RO (31 + IH2_BASE)
149
150/*
151 * OMAP-1610 specific IRQ numbers for interrupt handler 2
152 */
153#define INT_1610_FAC (0 + IH2_BASE)
154#define INT_1610_USB_HHC_2 (7 + IH2_BASE)
155#define INT_1610_USB_OTG (8 + IH2_BASE)
156#define INT_1610_SoSSI (9 + IH2_BASE)
157#define INT_1610_SoSSI_MATCH (19 + IH2_BASE)
158#define INT_1610_DSP_MMU (28 + IH2_BASE)
159#define INT_1610_McBSP2RX_OF (31 + IH2_BASE)
160#define INT_1610_STI (32 + IH2_BASE)
161#define INT_1610_STI_WAKEUP (33 + IH2_BASE)
162#define INT_1610_GPTIMER3 (34 + IH2_BASE)
163#define INT_1610_GPTIMER4 (35 + IH2_BASE)
164#define INT_1610_GPTIMER5 (36 + IH2_BASE)
165#define INT_1610_GPTIMER6 (37 + IH2_BASE)
166#define INT_1610_GPTIMER7 (38 + IH2_BASE)
167#define INT_1610_GPTIMER8 (39 + IH2_BASE)
168#define INT_1610_GPIO_BANK2 (40 + IH2_BASE)
169#define INT_1610_GPIO_BANK3 (41 + IH2_BASE)
170#define INT_1610_MMC2 (42 + IH2_BASE)
171#define INT_1610_CF (43 + IH2_BASE)
172#define INT_1610_WAKE_UP_REQ (46 + IH2_BASE)
173#define INT_1610_GPIO_BANK4 (48 + IH2_BASE)
174#define INT_1610_SPI (49 + IH2_BASE)
175#define INT_1610_DMA_CH6 (53 + IH2_BASE)
176#define INT_1610_DMA_CH7 (54 + IH2_BASE)
177#define INT_1610_DMA_CH8 (55 + IH2_BASE)
178#define INT_1610_DMA_CH9 (56 + IH2_BASE)
179#define INT_1610_DMA_CH10 (57 + IH2_BASE)
180#define INT_1610_DMA_CH11 (58 + IH2_BASE)
181#define INT_1610_DMA_CH12 (59 + IH2_BASE)
182#define INT_1610_DMA_CH13 (60 + IH2_BASE)
183#define INT_1610_DMA_CH14 (61 + IH2_BASE)
184#define INT_1610_DMA_CH15 (62 + IH2_BASE)
185#define INT_1610_NAND (63 + IH2_BASE)
186#define INT_1610_SHA1MD5 (91 + IH2_BASE)
187
188/*
189 * OMAP-7xx specific IRQ numbers for interrupt handler 2
190 */
191#define INT_7XX_HW_ERRORS (0 + IH2_BASE)
192#define INT_7XX_NFIQ_PWR_FAIL (1 + IH2_BASE)
193#define INT_7XX_CFCD (2 + IH2_BASE)
194#define INT_7XX_CFIREQ (3 + IH2_BASE)
195#define INT_7XX_I2C (4 + IH2_BASE)
196#define INT_7XX_PCC (5 + IH2_BASE)
197#define INT_7XX_MPU_EXT_NIRQ (6 + IH2_BASE)
198#define INT_7XX_SPI_100K_1 (7 + IH2_BASE)
199#define INT_7XX_SYREN_SPI (8 + IH2_BASE)
200#define INT_7XX_VLYNQ (9 + IH2_BASE)
201#define INT_7XX_GPIO_BANK4 (10 + IH2_BASE)
202#define INT_7XX_McBSP1TX (11 + IH2_BASE)
203#define INT_7XX_McBSP1RX (12 + IH2_BASE)
204#define INT_7XX_McBSP1RX_OF (13 + IH2_BASE)
205#define INT_7XX_UART_MODEM_IRDA_2 (14 + IH2_BASE)
206#define INT_7XX_UART_MODEM_1 (15 + IH2_BASE)
207#define INT_7XX_MCSI (16 + IH2_BASE)
208#define INT_7XX_uWireTX (17 + IH2_BASE)
209#define INT_7XX_uWireRX (18 + IH2_BASE)
210#define INT_7XX_SMC_CD (19 + IH2_BASE)
211#define INT_7XX_SMC_IREQ (20 + IH2_BASE)
212#define INT_7XX_HDQ_1WIRE (21 + IH2_BASE)
213#define INT_7XX_TIMER32K (22 + IH2_BASE)
214#define INT_7XX_MMC_SDIO (23 + IH2_BASE)
215#define INT_7XX_UPLD (24 + IH2_BASE)
216#define INT_7XX_USB_HHC_1 (27 + IH2_BASE)
217#define INT_7XX_USB_HHC_2 (28 + IH2_BASE)
218#define INT_7XX_USB_GENI (29 + IH2_BASE)
219#define INT_7XX_USB_OTG (30 + IH2_BASE)
220#define INT_7XX_CAMERA_IF (31 + IH2_BASE)
221#define INT_7XX_RNG (32 + IH2_BASE)
222#define INT_7XX_DUAL_MODE_TIMER (33 + IH2_BASE)
223#define INT_7XX_DBB_RF_EN (34 + IH2_BASE)
224#define INT_7XX_MPUIO_KEYPAD (35 + IH2_BASE)
225#define INT_7XX_SHA1_MD5 (36 + IH2_BASE)
226#define INT_7XX_SPI_100K_2 (37 + IH2_BASE)
227#define INT_7XX_RNG_IDLE (38 + IH2_BASE)
228#define INT_7XX_MPUIO (39 + IH2_BASE)
229#define INT_7XX_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE)
230#define INT_7XX_LLPC_OE_FALLING (41 + IH2_BASE)
231#define INT_7XX_LLPC_OE_RISING (42 + IH2_BASE)
232#define INT_7XX_LLPC_VSYNC (43 + IH2_BASE)
233#define INT_7XX_WAKE_UP_REQ (46 + IH2_BASE)
234#define INT_7XX_DMA_CH6 (53 + IH2_BASE)
235#define INT_7XX_DMA_CH7 (54 + IH2_BASE)
236#define INT_7XX_DMA_CH8 (55 + IH2_BASE)
237#define INT_7XX_DMA_CH9 (56 + IH2_BASE)
238#define INT_7XX_DMA_CH10 (57 + IH2_BASE)
239#define INT_7XX_DMA_CH11 (58 + IH2_BASE)
240#define INT_7XX_DMA_CH12 (59 + IH2_BASE)
241#define INT_7XX_DMA_CH13 (60 + IH2_BASE)
242#define INT_7XX_DMA_CH14 (61 + IH2_BASE)
243#define INT_7XX_DMA_CH15 (62 + IH2_BASE)
244#define INT_7XX_NAND (63 + IH2_BASE)
245
246#define INT_24XX_SYS_NIRQ 7
247#define INT_24XX_SDMA_IRQ0 12
248#define INT_24XX_SDMA_IRQ1 13
249#define INT_24XX_SDMA_IRQ2 14
250#define INT_24XX_SDMA_IRQ3 15
251#define INT_24XX_CAM_IRQ 24
252#define INT_24XX_DSS_IRQ 25
253#define INT_24XX_MAIL_U0_MPU 26
254#define INT_24XX_DSP_UMA 27
255#define INT_24XX_DSP_MMU 28
256#define INT_24XX_GPIO_BANK1 29
257#define INT_24XX_GPIO_BANK2 30
258#define INT_24XX_GPIO_BANK3 31
259#define INT_24XX_GPIO_BANK4 32
260#define INT_24XX_GPIO_BANK5 33
261#define INT_24XX_MAIL_U3_MPU 34
262#define INT_24XX_GPTIMER1 37
263#define INT_24XX_GPTIMER2 38
264#define INT_24XX_GPTIMER3 39
265#define INT_24XX_GPTIMER4 40
266#define INT_24XX_GPTIMER5 41
267#define INT_24XX_GPTIMER6 42
268#define INT_24XX_GPTIMER7 43
269#define INT_24XX_GPTIMER8 44
270#define INT_24XX_GPTIMER9 45
271#define INT_24XX_GPTIMER10 46
272#define INT_24XX_GPTIMER11 47
273#define INT_24XX_GPTIMER12 48
274#define INT_24XX_SHA1MD5 51
275#define INT_24XX_MCBSP4_IRQ_TX 54
276#define INT_24XX_MCBSP4_IRQ_RX 55
277#define INT_24XX_I2C1_IRQ 56
278#define INT_24XX_I2C2_IRQ 57
279#define INT_24XX_HDQ_IRQ 58
280#define INT_24XX_MCBSP1_IRQ_TX 59
281#define INT_24XX_MCBSP1_IRQ_RX 60
282#define INT_24XX_MCBSP2_IRQ_TX 62
283#define INT_24XX_MCBSP2_IRQ_RX 63
284#define INT_24XX_SPI1_IRQ 65
285#define INT_24XX_SPI2_IRQ 66
286#define INT_24XX_UART1_IRQ 72
287#define INT_24XX_UART2_IRQ 73
288#define INT_24XX_UART3_IRQ 74
289#define INT_24XX_USB_IRQ_GEN 75
290#define INT_24XX_USB_IRQ_NISO 76
291#define INT_24XX_USB_IRQ_ISO 77
292#define INT_24XX_USB_IRQ_HGEN 78
293#define INT_24XX_USB_IRQ_HSOF 79
294#define INT_24XX_USB_IRQ_OTG 80
295#define INT_24XX_MCBSP5_IRQ_TX 81
296#define INT_24XX_MCBSP5_IRQ_RX 82
297#define INT_24XX_MMC_IRQ 83
298#define INT_24XX_MMC2_IRQ 86
299#define INT_24XX_MCBSP3_IRQ_TX 89
300#define INT_24XX_MCBSP3_IRQ_RX 90
301#define INT_24XX_SPI3_IRQ 91
302
303#define INT_243X_MCBSP2_IRQ 16
304#define INT_243X_MCBSP3_IRQ 17
305#define INT_243X_MCBSP4_IRQ 18
306#define INT_243X_MCBSP5_IRQ 19
307#define INT_243X_MCBSP1_IRQ 64
308#define INT_243X_HS_USB_MC 92
309#define INT_243X_HS_USB_DMA 93
310#define INT_243X_CARKIT_IRQ 94
311
312#define INT_34XX_BENCH_MPU_EMUL 3
313#define INT_34XX_ST_MCBSP2_IRQ 4
314#define INT_34XX_ST_MCBSP3_IRQ 5
315#define INT_34XX_SSM_ABORT_IRQ 6
316#define INT_34XX_SYS_NIRQ 7
317#define INT_34XX_D2D_FW_IRQ 8
318#define INT_34XX_L3_DBG_IRQ 9
319#define INT_34XX_L3_APP_IRQ 10
320#define INT_34XX_PRCM_MPU_IRQ 11
321#define INT_34XX_MCBSP1_IRQ 16
322#define INT_34XX_MCBSP2_IRQ 17
323#define INT_34XX_GPMC_IRQ 20
324#define INT_34XX_MCBSP3_IRQ 22
325#define INT_34XX_MCBSP4_IRQ 23
326#define INT_34XX_CAM_IRQ 24
327#define INT_34XX_MCBSP5_IRQ 27
328#define INT_34XX_GPIO_BANK1 29
329#define INT_34XX_GPIO_BANK2 30
330#define INT_34XX_GPIO_BANK3 31
331#define INT_34XX_GPIO_BANK4 32
332#define INT_34XX_GPIO_BANK5 33
333#define INT_34XX_GPIO_BANK6 34
334#define INT_34XX_USIM_IRQ 35
335#define INT_34XX_WDT3_IRQ 36
336#define INT_34XX_SPI4_IRQ 48
337#define INT_34XX_SHA1MD52_IRQ 49
338#define INT_34XX_FPKA_READY_IRQ 50
339#define INT_34XX_SHA1MD51_IRQ 51
340#define INT_34XX_RNG_IRQ 52
341#define INT_34XX_I2C3_IRQ 61
342#define INT_34XX_FPKA_ERROR_IRQ 64
343#define INT_34XX_PBIAS_IRQ 75
344#define INT_34XX_OHCI_IRQ 76
345#define INT_34XX_EHCI_IRQ 77
346#define INT_34XX_TLL_IRQ 78
347#define INT_34XX_PARTHASH_IRQ 79
348#define INT_34XX_MMC3_IRQ 94
349#define INT_34XX_GPT12_IRQ 95
350
351#define INT_36XX_UART4_IRQ 80
352
353#define INT_35XX_HECC0_IRQ 24
354#define INT_35XX_HECC1_IRQ 28
355#define INT_35XX_EMAC_C0_RXTHRESH_IRQ 67
356#define INT_35XX_EMAC_C0_RX_PULSE_IRQ 68
357#define INT_35XX_EMAC_C0_TX_PULSE_IRQ 69
358#define INT_35XX_EMAC_C0_MISC_PULSE_IRQ 70
359#define INT_35XX_USBOTG_IRQ 71
360#define INT_35XX_UART4_IRQ 84
361#define INT_35XX_CCDC_VD0_IRQ 88
362#define INT_35XX_CCDC_VD1_IRQ 92
363#define INT_35XX_CCDC_VD2_IRQ 93
364
365/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and
366 * 16 MPUIO lines */
367#define OMAP_MAX_GPIO_LINES 192
368#define IH_GPIO_BASE (128 + IH2_BASE)
369#define IH_MPUIO_BASE (OMAP_MAX_GPIO_LINES + IH_GPIO_BASE)
370#define OMAP_IRQ_END (IH_MPUIO_BASE + 16)
371
372/* External FPGA handles interrupts on Innovator boards */
373#define OMAP_FPGA_IRQ_BASE (OMAP_IRQ_END)
374#ifdef CONFIG_MACH_OMAP_INNOVATOR
375#define OMAP_FPGA_NR_IRQS 24
376#else
377#define OMAP_FPGA_NR_IRQS 0
378#endif
379#define OMAP_FPGA_IRQ_END (OMAP_FPGA_IRQ_BASE + OMAP_FPGA_NR_IRQS)
380
381/* External TWL4030 can handle interrupts on 2430 and 34xx boards */
382#define TWL4030_IRQ_BASE (OMAP_FPGA_IRQ_END)
383#ifdef CONFIG_TWL4030_CORE
384#define TWL4030_BASE_NR_IRQS 8
385#define TWL4030_PWR_NR_IRQS 8
386#else
387#define TWL4030_BASE_NR_IRQS 0
388#define TWL4030_PWR_NR_IRQS 0
389#endif
390#define TWL4030_IRQ_END (TWL4030_IRQ_BASE + TWL4030_BASE_NR_IRQS)
391#define TWL4030_PWR_IRQ_BASE TWL4030_IRQ_END
392#define TWL4030_PWR_IRQ_END (TWL4030_PWR_IRQ_BASE + TWL4030_PWR_NR_IRQS)
393
394/* External TWL4030 gpio interrupts are optional */
395#define TWL4030_GPIO_IRQ_BASE TWL4030_PWR_IRQ_END
396#ifdef CONFIG_GPIO_TWL4030
397#define TWL4030_GPIO_NR_IRQS 18
398#else
399#define TWL4030_GPIO_NR_IRQS 0
400#endif
401#define TWL4030_GPIO_IRQ_END (TWL4030_GPIO_IRQ_BASE + TWL4030_GPIO_NR_IRQS)
402
403#define TWL6030_IRQ_BASE (OMAP_FPGA_IRQ_END)
404#ifdef CONFIG_TWL4030_CORE
405#define TWL6030_BASE_NR_IRQS 20
406#else
407#define TWL6030_BASE_NR_IRQS 0
408#endif
409#define TWL6030_IRQ_END (TWL6030_IRQ_BASE + TWL6030_BASE_NR_IRQS)
410
411#define TWL6040_CODEC_IRQ_BASE TWL6030_IRQ_END
412#ifdef CONFIG_TWL6040_CODEC
413#define TWL6040_CODEC_NR_IRQS 6
414#else
415#define TWL6040_CODEC_NR_IRQS 0
416#endif
417#define TWL6040_CODEC_IRQ_END (TWL6040_CODEC_IRQ_BASE + TWL6040_CODEC_NR_IRQS)
418
419/* Total number of interrupts depends on the enabled blocks above */
420#if (TWL4030_GPIO_IRQ_END > TWL6040_CODEC_IRQ_END)
421#define TWL_IRQ_END TWL4030_GPIO_IRQ_END
422#else
423#define TWL_IRQ_END TWL6040_CODEC_IRQ_END
424#endif
425
426/* GPMC related */
427#define OMAP_GPMC_IRQ_BASE (TWL_IRQ_END)
428#define OMAP_GPMC_NR_IRQS 8
429#define OMAP_GPMC_IRQ_END (OMAP_GPMC_IRQ_BASE + OMAP_GPMC_NR_IRQS)
430
431/* PRCM IRQ handler */
432#ifdef CONFIG_ARCH_OMAP2PLUS
433#define OMAP_PRCM_IRQ_BASE (OMAP_GPMC_IRQ_END)
434#define OMAP_PRCM_NR_IRQS 64
435#define OMAP_PRCM_IRQ_END (OMAP_PRCM_IRQ_BASE + OMAP_PRCM_NR_IRQS)
436#else
437#define OMAP_PRCM_IRQ_END OMAP_GPMC_IRQ_END
438#endif
439
440#define NR_IRQS OMAP_PRCM_IRQ_END
441
442#define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32))
443
444#define INTCPS_NR_MIR_REGS 3
445#define INTCPS_NR_IRQS 96
446
447#include <mach/hardware.h>
448
449#ifdef CONFIG_FIQ
450#define FIQ_START 1024
451#endif
452
453#endif
diff --git a/arch/arm/plat-omap/include/plat/keypad.h b/arch/arm/plat-omap/include/plat/keypad.h
deleted file mode 100644
index a6b21eddb21..00000000000
--- a/arch/arm/plat-omap/include/plat/keypad.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/keypad.h
3 *
4 * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.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#ifndef ASMARM_ARCH_KEYPAD_H
11#define ASMARM_ARCH_KEYPAD_H
12
13#ifndef CONFIG_ARCH_OMAP1
14#warning Please update the board to use matrix-keypad driver
15#define omap_readw(reg) 0
16#define omap_writew(val, reg) do {} while (0)
17#endif
18#include <linux/input/matrix_keypad.h>
19
20struct omap_kp_platform_data {
21 int rows;
22 int cols;
23 const struct matrix_keymap_data *keymap_data;
24 bool rep;
25 unsigned long delay;
26 bool dbounce;
27 /* specific to OMAP242x*/
28 unsigned int *row_gpios;
29 unsigned int *col_gpios;
30};
31
32/* Group (0..3) -- when multiple keys are pressed, only the
33 * keys pressed in the same group are considered as pressed. This is
34 * in order to workaround certain crappy HW designs that produce ghost
35 * keypresses. Two free bits, not used by neither row/col nor keynum,
36 * must be available for use as group bits. The below GROUP_SHIFT
37 * macro definition is based on some prior knowledge of the
38 * matrix_keypad defined KEY() macro internals.
39 */
40#define GROUP_SHIFT 14
41#define GROUP_0 (0 << GROUP_SHIFT)
42#define GROUP_1 (1 << GROUP_SHIFT)
43#define GROUP_2 (2 << GROUP_SHIFT)
44#define GROUP_3 (3 << GROUP_SHIFT)
45#define GROUP_MASK GROUP_3
46#if KEY_MAX & GROUP_MASK
47#error Group bits in conflict with keynum bits
48#endif
49
50
51#endif
52
diff --git a/arch/arm/plat-omap/include/plat/lcd_mipid.h b/arch/arm/plat-omap/include/plat/lcd_mipid.h
deleted file mode 100644
index 8e52c657228..00000000000
--- a/arch/arm/plat-omap/include/plat/lcd_mipid.h
+++ /dev/null
@@ -1,29 +0,0 @@
1#ifndef __LCD_MIPID_H
2#define __LCD_MIPID_H
3
4enum mipid_test_num {
5 MIPID_TEST_RGB_LINES,
6};
7
8enum mipid_test_result {
9 MIPID_TEST_SUCCESS,
10 MIPID_TEST_INVALID,
11 MIPID_TEST_FAILED,
12};
13
14#ifdef __KERNEL__
15
16struct mipid_platform_data {
17 int nreset_gpio;
18 int data_lines;
19
20 void (*shutdown)(struct mipid_platform_data *pdata);
21 void (*set_bklight_level)(struct mipid_platform_data *pdata,
22 int level);
23 int (*get_bklight_level)(struct mipid_platform_data *pdata);
24 int (*get_bklight_max)(struct mipid_platform_data *pdata);
25};
26
27#endif
28
29#endif
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h
deleted file mode 100644
index 18814127809..00000000000
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/mcbsp.h
3 *
4 * Defines for Multi-Channel Buffered Serial Port
5 *
6 * Copyright (C) 2002 RidgeRun, Inc.
7 * Author: Steve Johnson
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24#ifndef __ASM_ARCH_OMAP_MCBSP_H
25#define __ASM_ARCH_OMAP_MCBSP_H
26
27#include <linux/spinlock.h>
28#include <linux/clk.h>
29
30#define MCBSP_CONFIG_TYPE2 0x2
31#define MCBSP_CONFIG_TYPE3 0x3
32#define MCBSP_CONFIG_TYPE4 0x4
33
34/* Platform specific configuration */
35struct omap_mcbsp_ops {
36 void (*request)(unsigned int);
37 void (*free)(unsigned int);
38};
39
40struct omap_mcbsp_platform_data {
41 struct omap_mcbsp_ops *ops;
42 u16 buffer_size;
43 u8 reg_size;
44 u8 reg_step;
45
46 /* McBSP platform and instance specific features */
47 bool has_wakeup; /* Wakeup capability */
48 bool has_ccr; /* Transceiver has configuration control registers */
49 int (*enable_st_clock)(unsigned int, bool);
50 int (*set_clk_src)(struct device *dev, struct clk *clk, const char *src);
51 int (*mux_signal)(struct device *dev, const char *signal, const char *src);
52};
53
54/**
55 * omap_mcbsp_dev_attr - OMAP McBSP device attributes for omap_hwmod
56 * @sidetone: name of the sidetone device
57 */
58struct omap_mcbsp_dev_attr {
59 const char *sidetone;
60};
61
62#endif
diff --git a/arch/arm/plat-omap/include/plat/mcspi.h b/arch/arm/plat-omap/include/plat/mcspi.h
deleted file mode 100644
index a357eb26bd2..00000000000
--- a/arch/arm/plat-omap/include/plat/mcspi.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef _OMAP2_MCSPI_H
2#define _OMAP2_MCSPI_H
3
4#define OMAP2_MCSPI_REV 0
5#define OMAP3_MCSPI_REV 1
6#define OMAP4_MCSPI_REV 2
7
8#define OMAP4_MCSPI_REG_OFFSET 0x100
9
10struct omap2_mcspi_platform_config {
11 unsigned short num_cs;
12 unsigned int regs_offset;
13};
14
15struct omap2_mcspi_dev_attr {
16 unsigned short num_chipselect;
17};
18
19struct omap2_mcspi_device_config {
20 unsigned turbo_mode:1;
21};
22
23#endif
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
index eb3e4d55534..8b4e4f2da2f 100644
--- a/arch/arm/plat-omap/include/plat/mmc.h
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -15,7 +15,6 @@
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/mmc/host.h> 16#include <linux/mmc/host.h>
17 17
18#include <plat/board.h>
19#include <plat/omap_hwmod.h> 18#include <plat/omap_hwmod.h>
20 19
21#define OMAP15XX_NR_MMC 1 20#define OMAP15XX_NR_MMC 1
diff --git a/arch/arm/plat-omap/include/plat/nand.h b/arch/arm/plat-omap/include/plat/nand.h
deleted file mode 100644
index 67fc5060183..00000000000
--- a/arch/arm/plat-omap/include/plat/nand.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/nand.h
3 *
4 * Copyright (C) 2006 Micron Technology Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <plat/gpmc.h>
12#include <linux/mtd/partitions.h>
13
14enum nand_io {
15 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
16 NAND_OMAP_POLLED, /* polled mode, without prefetch */
17 NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */
18 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
19};
20
21struct omap_nand_platform_data {
22 int cs;
23 struct mtd_partition *parts;
24 struct gpmc_timings *gpmc_t;
25 int nr_parts;
26 bool dev_ready;
27 int gpmc_irq;
28 enum nand_io xfer_type;
29 unsigned long phys_base;
30 int devsize;
31 enum omap_ecc ecc_opt;
32};
33
34/* minimum size for IO mapping */
35#define NAND_IO_SIZE 4
36
37#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
38extern int gpmc_nand_init(struct omap_nand_platform_data *d);
39#else
40static inline int gpmc_nand_init(struct omap_nand_platform_data *d)
41{
42 return 0;
43}
44#endif
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
index 1a52725ffcf..f4a4cd01479 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -18,11 +18,9 @@
18#define __OMAP_SERIAL_H__ 18#define __OMAP_SERIAL_H__
19 19
20#include <linux/serial_core.h> 20#include <linux/serial_core.h>
21#include <linux/platform_device.h> 21#include <linux/device.h>
22#include <linux/pm_qos.h> 22#include <linux/pm_qos.h>
23 23
24#include <plat/mux.h>
25
26#define DRIVER_NAME "omap_uart" 24#define DRIVER_NAME "omap_uart"
27 25
28/* 26/*
@@ -42,10 +40,10 @@
42#define OMAP_UART_WER_MOD_WKUP 0X7F 40#define OMAP_UART_WER_MOD_WKUP 0X7F
43 41
44/* Enable XON/XOFF flow control on output */ 42/* Enable XON/XOFF flow control on output */
45#define OMAP_UART_SW_TX 0x04 43#define OMAP_UART_SW_TX 0x8
46 44
47/* Enable XON/XOFF flow control on input */ 45/* Enable XON/XOFF flow control on input */
48#define OMAP_UART_SW_RX 0x04 46#define OMAP_UART_SW_RX 0x2
49 47
50#define OMAP_UART_SYSC_RESET 0X07 48#define OMAP_UART_SYSC_RESET 0X07
51#define OMAP_UART_TCR_TRIG 0X0F 49#define OMAP_UART_TCR_TRIG 0X0F
@@ -54,7 +52,7 @@
54 52
55#define OMAP_UART_DMA_CH_FREE -1 53#define OMAP_UART_DMA_CH_FREE -1
56 54
57#define OMAP_MAX_HSUART_PORTS 4 55#define OMAP_MAX_HSUART_PORTS 6
58 56
59#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA 57#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
60 58
@@ -69,11 +67,14 @@ struct omap_uart_port_info {
69 unsigned int dma_rx_timeout; 67 unsigned int dma_rx_timeout;
70 unsigned int autosuspend_timeout; 68 unsigned int autosuspend_timeout;
71 unsigned int dma_rx_poll_rate; 69 unsigned int dma_rx_poll_rate;
70 int DTR_gpio;
71 int DTR_inverted;
72 int DTR_present;
72 73
73 int (*get_context_loss_count)(struct device *); 74 int (*get_context_loss_count)(struct device *);
74 void (*set_forceidle)(struct platform_device *); 75 void (*set_forceidle)(struct device *);
75 void (*set_noidle)(struct platform_device *); 76 void (*set_noidle)(struct device *);
76 void (*enable_wakeup)(struct platform_device *, bool); 77 void (*enable_wakeup)(struct device *, bool);
77}; 78};
78 79
79struct uart_omap_dma { 80struct uart_omap_dma {
@@ -102,39 +103,4 @@ struct uart_omap_dma {
102 unsigned int rx_timeout; 103 unsigned int rx_timeout;
103}; 104};
104 105
105struct uart_omap_port {
106 struct uart_port port;
107 struct uart_omap_dma uart_dma;
108 struct platform_device *pdev;
109
110 unsigned char ier;
111 unsigned char lcr;
112 unsigned char mcr;
113 unsigned char fcr;
114 unsigned char efr;
115 unsigned char dll;
116 unsigned char dlh;
117 unsigned char mdr1;
118 unsigned char scr;
119
120 int use_dma;
121 /*
122 * Some bits in registers are cleared on a read, so they must
123 * be saved whenever the register is read but the bits will not
124 * be immediately processed.
125 */
126 unsigned int lsr_break_flag;
127 unsigned char msr_saved_flags;
128 char name[20];
129 unsigned long port_activity;
130 u32 context_loss_cnt;
131 u32 errata;
132 u8 wakeups_enabled;
133
134 struct pm_qos_request pm_qos_request;
135 u32 latency;
136 u32 calc_latency;
137 struct work_struct qos_work;
138};
139
140#endif /* __OMAP_SERIAL_H__ */ 106#endif /* __OMAP_SERIAL_H__ */
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index 4327b2c90c3..106f5066580 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -60,6 +60,7 @@ extern struct dev_pm_domain omap_device_pm_domain;
60 * @_dev_wakeup_lat_limit: dev wakeup latency limit in nsec - set by OMAP PM 60 * @_dev_wakeup_lat_limit: dev wakeup latency limit in nsec - set by OMAP PM
61 * @_state: one of OMAP_DEVICE_STATE_* (see above) 61 * @_state: one of OMAP_DEVICE_STATE_* (see above)
62 * @flags: device flags 62 * @flags: device flags
63 * @_driver_status: one of BUS_NOTIFY_*_DRIVER from <linux/device.h>
63 * 64 *
64 * Integrates omap_hwmod data into Linux platform_device. 65 * Integrates omap_hwmod data into Linux platform_device.
65 * 66 *
@@ -73,6 +74,7 @@ struct omap_device {
73 struct omap_device_pm_latency *pm_lats; 74 struct omap_device_pm_latency *pm_lats;
74 u32 dev_wakeup_lat; 75 u32 dev_wakeup_lat;
75 u32 _dev_wakeup_lat_limit; 76 u32 _dev_wakeup_lat_limit;
77 unsigned long _driver_status;
76 u8 pm_lats_cnt; 78 u8 pm_lats_cnt;
77 s8 pm_lat_level; 79 s8 pm_lat_level;
78 u8 hwmods_cnt; 80 u8 hwmods_cnt;
@@ -118,6 +120,10 @@ int omap_device_get_context_loss_count(struct platform_device *pdev);
118 120
119/* Other */ 121/* Other */
120 122
123int omap_device_assert_hardreset(struct platform_device *pdev,
124 const char *name);
125int omap_device_deassert_hardreset(struct platform_device *pdev,
126 const char *name);
121int omap_device_idle_hwmods(struct omap_device *od); 127int omap_device_idle_hwmods(struct omap_device *od);
122int omap_device_enable_hwmods(struct omap_device *od); 128int omap_device_enable_hwmods(struct omap_device *od);
123 129
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 6132972aff3..b3349f7b1a2 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -2,7 +2,7 @@
2 * omap_hwmod macros, structures 2 * omap_hwmod macros, structures
3 * 3 *
4 * Copyright (C) 2009-2011 Nokia Corporation 4 * Copyright (C) 2009-2011 Nokia Corporation
5 * Copyright (C) 2011 Texas Instruments, Inc. 5 * Copyright (C) 2012 Texas Instruments, Inc.
6 * Paul Walmsley 6 * Paul Walmsley
7 * 7 *
8 * Created in collaboration with (alphabetical order): Benoît Cousson, 8 * Created in collaboration with (alphabetical order): Benoît Cousson,
@@ -384,21 +384,38 @@ struct omap_hwmod_omap2_prcm {
384 u8 idlest_stdby_bit; 384 u8 idlest_stdby_bit;
385}; 385};
386 386
387/*
388 * Possible values for struct omap_hwmod_omap4_prcm.flags
389 *
390 * HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT: Some IP blocks don't have a PRCM
391 * module-level context loss register associated with them; this
392 * flag bit should be set in those cases
393 */
394#define HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT (1 << 0)
387 395
388/** 396/**
389 * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data 397 * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
390 * @clkctrl_reg: PRCM address of the clock control register 398 * @clkctrl_reg: PRCM address of the clock control register
391 * @rstctrl_reg: address of the XXX_RSTCTRL register located in the PRM 399 * @rstctrl_reg: address of the XXX_RSTCTRL register located in the PRM
400 * @lostcontext_mask: bitmask for selecting bits from RM_*_CONTEXT register
392 * @rstst_reg: (AM33XX only) address of the XXX_RSTST register in the PRM 401 * @rstst_reg: (AM33XX only) address of the XXX_RSTST register in the PRM
393 * @submodule_wkdep_bit: bit shift of the WKDEP range 402 * @submodule_wkdep_bit: bit shift of the WKDEP range
403 * @flags: PRCM register capabilities for this IP block
404 *
405 * If @lostcontext_mask is not defined, context loss check code uses
406 * whole register without masking. @lostcontext_mask should only be
407 * defined in cases where @context_offs register is shared by two or
408 * more hwmods.
394 */ 409 */
395struct omap_hwmod_omap4_prcm { 410struct omap_hwmod_omap4_prcm {
396 u16 clkctrl_offs; 411 u16 clkctrl_offs;
397 u16 rstctrl_offs; 412 u16 rstctrl_offs;
398 u16 rstst_offs; 413 u16 rstst_offs;
399 u16 context_offs; 414 u16 context_offs;
415 u32 lostcontext_mask;
400 u8 submodule_wkdep_bit; 416 u8 submodule_wkdep_bit;
401 u8 modulemode; 417 u8 modulemode;
418 u8 flags;
402}; 419};
403 420
404 421
@@ -591,9 +608,7 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
591int __init omap_hwmod_setup_one(const char *name); 608int __init omap_hwmod_setup_one(const char *name);
592 609
593int omap_hwmod_enable(struct omap_hwmod *oh); 610int omap_hwmod_enable(struct omap_hwmod *oh);
594int _omap_hwmod_enable(struct omap_hwmod *oh);
595int omap_hwmod_idle(struct omap_hwmod *oh); 611int omap_hwmod_idle(struct omap_hwmod *oh);
596int _omap_hwmod_idle(struct omap_hwmod *oh);
597int omap_hwmod_shutdown(struct omap_hwmod *oh); 612int omap_hwmod_shutdown(struct omap_hwmod *oh);
598 613
599int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name); 614int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name);
@@ -615,6 +630,7 @@ int omap_hwmod_softreset(struct omap_hwmod *oh);
615 630
616int omap_hwmod_count_resources(struct omap_hwmod *oh); 631int omap_hwmod_count_resources(struct omap_hwmod *oh);
617int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res); 632int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res);
633int omap_hwmod_fill_dma_resources(struct omap_hwmod *oh, struct resource *res);
618int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type, 634int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type,
619 const char *name, struct resource *res); 635 const char *name, struct resource *res);
620 636
@@ -626,11 +642,6 @@ int omap_hwmod_add_initiator_dep(struct omap_hwmod *oh,
626int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh, 642int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
627 struct omap_hwmod *init_oh); 643 struct omap_hwmod *init_oh);
628 644
629int omap_hwmod_set_clockact_both(struct omap_hwmod *oh);
630int omap_hwmod_set_clockact_main(struct omap_hwmod *oh);
631int omap_hwmod_set_clockact_iclk(struct omap_hwmod *oh);
632int omap_hwmod_set_clockact_none(struct omap_hwmod *oh);
633
634int omap_hwmod_enable_wakeup(struct omap_hwmod *oh); 645int omap_hwmod_enable_wakeup(struct omap_hwmod *oh);
635int omap_hwmod_disable_wakeup(struct omap_hwmod *oh); 646int omap_hwmod_disable_wakeup(struct omap_hwmod *oh);
636 647
@@ -658,6 +669,7 @@ extern int omap2420_hwmod_init(void);
658extern int omap2430_hwmod_init(void); 669extern int omap2430_hwmod_init(void);
659extern int omap3xxx_hwmod_init(void); 670extern int omap3xxx_hwmod_init(void);
660extern int omap44xx_hwmod_init(void); 671extern int omap44xx_hwmod_init(void);
672extern int am33xx_hwmod_init(void);
661 673
662extern int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois); 674extern int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois);
663 675
diff --git a/arch/arm/plat-omap/include/plat/onenand.h b/arch/arm/plat-omap/include/plat/onenand.h
deleted file mode 100644
index 2858667d2e4..00000000000
--- a/arch/arm/plat-omap/include/plat/onenand.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/onenand.h
3 *
4 * Copyright (C) 2006 Nokia Corporation
5 * Author: Juha Yrjola
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/mtd/mtd.h>
13#include <linux/mtd/partitions.h>
14
15#define ONENAND_SYNC_READ (1 << 0)
16#define ONENAND_SYNC_READWRITE (1 << 1)
17
18struct onenand_freq_info {
19 u16 maf_id;
20 u16 dev_id;
21 u16 ver_id;
22};
23
24struct omap_onenand_platform_data {
25 int cs;
26 int gpio_irq;
27 struct mtd_partition *parts;
28 int nr_parts;
29 int (*onenand_setup)(void __iomem *, int *freq_ptr);
30 int (*get_freq)(const struct onenand_freq_info *freq_info,
31 bool *clk_dep);
32 int dma_channel;
33 u8 flags;
34 u8 regulator_can_sleep;
35 u8 skip_initial_unlocking;
36};
37
38#define ONENAND_MAX_PARTITIONS 8
39
40#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
41 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
42
43extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
44
45#else
46
47#define board_onenand_data NULL
48
49static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
50{
51}
52
53#endif
diff --git a/arch/arm/plat-omap/include/plat/param.h b/arch/arm/plat-omap/include/plat/param.h
deleted file mode 100644
index 1eb4dc32697..00000000000
--- a/arch/arm/plat-omap/include/plat/param.h
+++ /dev/null
@@ -1,8 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/param.h
3 *
4 */
5
6#ifdef CONFIG_OMAP_32K_TIMER_HZ
7#define HZ CONFIG_OMAP_32K_TIMER_HZ
8#endif
diff --git a/arch/arm/plat-omap/include/plat/remoteproc.h b/arch/arm/plat-omap/include/plat/remoteproc.h
deleted file mode 100644
index b10eac89e2e..00000000000
--- a/arch/arm/plat-omap/include/plat/remoteproc.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * Remote Processor - omap-specific bits
3 *
4 * Copyright (C) 2011 Texas Instruments, Inc.
5 * Copyright (C) 2011 Google, Inc.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 * 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#ifndef _PLAT_REMOTEPROC_H
18#define _PLAT_REMOTEPROC_H
19
20struct rproc_ops;
21struct platform_device;
22
23/*
24 * struct omap_rproc_pdata - omap remoteproc's platform data
25 * @name: the remoteproc's name
26 * @oh_name: omap hwmod device
27 * @oh_name_opt: optional, secondary omap hwmod device
28 * @firmware: name of firmware file to load
29 * @mbox_name: name of omap mailbox device to use with this rproc
30 * @ops: start/stop rproc handlers
31 * @device_enable: omap-specific handler for enabling a device
32 * @device_shutdown: omap-specific handler for shutting down a device
33 */
34struct omap_rproc_pdata {
35 const char *name;
36 const char *oh_name;
37 const char *oh_name_opt;
38 const char *firmware;
39 const char *mbox_name;
40 const struct rproc_ops *ops;
41 int (*device_enable) (struct platform_device *pdev);
42 int (*device_shutdown) (struct platform_device *pdev);
43};
44
45#if defined(CONFIG_OMAP_REMOTEPROC) || defined(CONFIG_OMAP_REMOTEPROC_MODULE)
46
47void __init omap_rproc_reserve_cma(void);
48
49#else
50
51void __init omap_rproc_reserve_cma(void)
52{
53}
54
55#endif
56
57#endif /* _PLAT_REMOTEPROC_H */
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index 548a4c8d63d..87ee140fefa 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -4,8 +4,8 @@
4#define __ASM_ARCH_OMAP_USB_H 4#define __ASM_ARCH_OMAP_USB_H
5 5
6#include <linux/io.h> 6#include <linux/io.h>
7#include <linux/platform_device.h>
7#include <linux/usb/musb.h> 8#include <linux/usb/musb.h>
8#include <plat/board.h>
9 9
10#define OMAP3_HS_USB_PORTS 3 10#define OMAP3_HS_USB_PORTS 3
11 11
@@ -64,6 +64,10 @@ struct usbhs_omap_platform_data {
64 struct ehci_hcd_omap_platform_data *ehci_data; 64 struct ehci_hcd_omap_platform_data *ehci_data;
65 struct ohci_hcd_omap_platform_data *ohci_data; 65 struct ohci_hcd_omap_platform_data *ohci_data;
66}; 66};
67
68struct usbtll_omap_platform_data {
69 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
70};
67/*-------------------------------------------------------------------------*/ 71/*-------------------------------------------------------------------------*/
68 72
69struct omap_musb_board_data { 73struct omap_musb_board_data {
@@ -82,6 +86,8 @@ enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
82extern void usb_musb_init(struct omap_musb_board_data *board_data); 86extern void usb_musb_init(struct omap_musb_board_data *board_data);
83 87
84extern void usbhs_init(const struct usbhs_omap_board_data *pdata); 88extern void usbhs_init(const struct usbhs_omap_board_data *pdata);
89extern int omap_tll_enable(void);
90extern int omap_tll_disable(void);
85 91
86extern int omap4430_phy_power(struct device *dev, int ID, int on); 92extern int omap4430_phy_power(struct device *dev, int ID, int on);
87extern int omap4430_phy_set_clk(struct device *dev, int on); 93extern int omap4430_phy_set_clk(struct device *dev, int on);
diff --git a/arch/arm/plat-omap/include/plat/voltage.h b/arch/arm/plat-omap/include/plat/voltage.h
deleted file mode 100644
index 5be4d5def42..00000000000
--- a/arch/arm/plat-omap/include/plat/voltage.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * OMAP Voltage Management Routines
3 *
4 * Copyright (C) 2011, Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ARCH_ARM_OMAP_VOLTAGE_H
12#define __ARCH_ARM_OMAP_VOLTAGE_H
13
14/**
15 * struct omap_volt_data - Omap voltage specific data.
16 * @voltage_nominal: The possible voltage value in uV
17 * @sr_efuse_offs: The offset of the efuse register(from system
18 * control module base address) from where to read
19 * the n-target value for the smartreflex module.
20 * @sr_errminlimit: Error min limit value for smartreflex. This value
21 * differs at differnet opp and thus is linked
22 * with voltage.
23 * @vp_errorgain: Error gain value for the voltage processor. This
24 * field also differs according to the voltage/opp.
25 */
26struct omap_volt_data {
27 u32 volt_nominal;
28 u32 sr_efuse_offs;
29 u8 sr_errminlimit;
30 u8 vp_errgain;
31};
32struct voltagedomain;
33
34struct voltagedomain *voltdm_lookup(const char *name);
35int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt);
36unsigned long voltdm_get_voltage(struct voltagedomain *voltdm);
37struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm,
38 unsigned long volt);
39#endif
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 5e13c3884aa..42377ef9ea3 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -310,7 +310,7 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
310 omap_mbox_disable_irq(mbox, IRQ_RX); 310 omap_mbox_disable_irq(mbox, IRQ_RX);
311 free_irq(mbox->irq, mbox); 311 free_irq(mbox->irq, mbox);
312 tasklet_kill(&mbox->txq->tasklet); 312 tasklet_kill(&mbox->txq->tasklet);
313 flush_work_sync(&mbox->rxq->work); 313 flush_work(&mbox->rxq->work);
314 mbox_queue_free(mbox->txq); 314 mbox_queue_free(mbox->txq);
315 mbox_queue_free(mbox->rxq); 315 mbox_queue_free(mbox->rxq);
316 } 316 }
diff --git a/arch/arm/plat-omap/mux.c b/arch/arm/plat-omap/mux.c
deleted file mode 100644
index cff8712122b..00000000000
--- a/arch/arm/plat-omap/mux.c
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * linux/arch/arm/plat-omap/mux.c
3 *
4 * Utility to set the Omap MUX and PULL_DWN registers from a table in mux.h
5 *
6 * Copyright (C) 2003 - 2008 Nokia Corporation
7 *
8 * Written by Tony Lindgren
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; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25#include <linux/module.h>
26#include <linux/init.h>
27#include <linux/kernel.h>
28#include <linux/io.h>
29#include <linux/spinlock.h>
30
31#include <asm/system.h>
32
33#include <plat/cpu.h>
34#include <plat/mux.h>
35
36#ifdef CONFIG_OMAP_MUX
37
38static struct omap_mux_cfg *mux_cfg;
39
40int __init omap_mux_register(struct omap_mux_cfg *arch_mux_cfg)
41{
42 if (!arch_mux_cfg || !arch_mux_cfg->pins || arch_mux_cfg->size == 0
43 || !arch_mux_cfg->cfg_reg) {
44 printk(KERN_ERR "Invalid pin table\n");
45 return -EINVAL;
46 }
47
48 mux_cfg = arch_mux_cfg;
49
50 return 0;
51}
52
53/*
54 * Sets the Omap MUX and PULL_DWN registers based on the table
55 */
56int __init_or_module omap_cfg_reg(const unsigned long index)
57{
58 struct pin_config *reg;
59
60 if (!cpu_class_is_omap1()) {
61 printk(KERN_ERR "mux: Broken omap_cfg_reg(%lu) entry\n",
62 index);
63 WARN_ON(1);
64 return -EINVAL;
65 }
66
67 if (mux_cfg == NULL) {
68 printk(KERN_ERR "Pin mux table not initialized\n");
69 return -ENODEV;
70 }
71
72 if (index >= mux_cfg->size) {
73 printk(KERN_ERR "Invalid pin mux index: %lu (%lu)\n",
74 index, mux_cfg->size);
75 dump_stack();
76 return -ENODEV;
77 }
78
79 reg = (struct pin_config *)&mux_cfg->pins[index];
80
81 if (!mux_cfg->cfg_reg)
82 return -ENODEV;
83
84 return mux_cfg->cfg_reg(reg);
85}
86EXPORT_SYMBOL(omap_cfg_reg);
87#else
88#define omap_mux_init() do {} while(0)
89#define omap_cfg_reg(x) do {} while(0)
90#endif /* CONFIG_OMAP_MUX */
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c
index 5a97b4d98d4..9722f418ae1 100644
--- a/arch/arm/plat-omap/omap-pm-noop.c
+++ b/arch/arm/plat-omap/omap-pm-noop.c
@@ -38,14 +38,14 @@ int omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t)
38 if (!dev || t < -1) { 38 if (!dev || t < -1) {
39 WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__); 39 WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__);
40 return -EINVAL; 40 return -EINVAL;
41 }; 41 }
42 42
43 if (t == -1) 43 if (t == -1)
44 pr_debug("OMAP PM: remove max MPU wakeup latency constraint: " 44 pr_debug("OMAP PM: remove max MPU wakeup latency constraint: dev %s\n",
45 "dev %s\n", dev_name(dev)); 45 dev_name(dev));
46 else 46 else
47 pr_debug("OMAP PM: add max MPU wakeup latency constraint: " 47 pr_debug("OMAP PM: add max MPU wakeup latency constraint: dev %s, t = %ld usec\n",
48 "dev %s, t = %ld usec\n", dev_name(dev), t); 48 dev_name(dev), t);
49 49
50 /* 50 /*
51 * For current Linux, this needs to map the MPU to a 51 * For current Linux, this needs to map the MPU to a
@@ -67,14 +67,13 @@ int omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r)
67 agent_id != OCP_TARGET_AGENT)) { 67 agent_id != OCP_TARGET_AGENT)) {
68 WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__); 68 WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__);
69 return -EINVAL; 69 return -EINVAL;
70 }; 70 }
71 71
72 if (r == 0) 72 if (r == 0)
73 pr_debug("OMAP PM: remove min bus tput constraint: " 73 pr_debug("OMAP PM: remove min bus tput constraint: dev %s for agent_id %d\n",
74 "dev %s for agent_id %d\n", dev_name(dev), agent_id); 74 dev_name(dev), agent_id);
75 else 75 else
76 pr_debug("OMAP PM: add min bus tput constraint: " 76 pr_debug("OMAP PM: add min bus tput constraint: dev %s for agent_id %d: rate %ld KiB\n",
77 "dev %s for agent_id %d: rate %ld KiB\n",
78 dev_name(dev), agent_id, r); 77 dev_name(dev), agent_id, r);
79 78
80 /* 79 /*
@@ -94,14 +93,14 @@ int omap_pm_set_max_dev_wakeup_lat(struct device *req_dev, struct device *dev,
94 if (!req_dev || !dev || t < -1) { 93 if (!req_dev || !dev || t < -1) {
95 WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__); 94 WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__);
96 return -EINVAL; 95 return -EINVAL;
97 }; 96 }
98 97
99 if (t == -1) 98 if (t == -1)
100 pr_debug("OMAP PM: remove max device latency constraint: " 99 pr_debug("OMAP PM: remove max device latency constraint: dev %s\n",
101 "dev %s\n", dev_name(dev)); 100 dev_name(dev));
102 else 101 else
103 pr_debug("OMAP PM: add max device latency constraint: " 102 pr_debug("OMAP PM: add max device latency constraint: dev %s, t = %ld usec\n",
104 "dev %s, t = %ld usec\n", dev_name(dev), t); 103 dev_name(dev), t);
105 104
106 /* 105 /*
107 * For current Linux, this needs to map the device to a 106 * For current Linux, this needs to map the device to a
@@ -124,14 +123,14 @@ int omap_pm_set_max_sdma_lat(struct device *dev, long t)
124 if (!dev || t < -1) { 123 if (!dev || t < -1) {
125 WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__); 124 WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__);
126 return -EINVAL; 125 return -EINVAL;
127 }; 126 }
128 127
129 if (t == -1) 128 if (t == -1)
130 pr_debug("OMAP PM: remove max DMA latency constraint: " 129 pr_debug("OMAP PM: remove max DMA latency constraint: dev %s\n",
131 "dev %s\n", dev_name(dev)); 130 dev_name(dev));
132 else 131 else
133 pr_debug("OMAP PM: add max DMA latency constraint: " 132 pr_debug("OMAP PM: add max DMA latency constraint: dev %s, t = %ld usec\n",
134 "dev %s, t = %ld usec\n", dev_name(dev), t); 133 dev_name(dev), t);
135 134
136 /* 135 /*
137 * For current Linux PM QOS params, this code should scan the 136 * For current Linux PM QOS params, this code should scan the
@@ -156,11 +155,11 @@ int omap_pm_set_min_clk_rate(struct device *dev, struct clk *c, long r)
156 } 155 }
157 156
158 if (r == 0) 157 if (r == 0)
159 pr_debug("OMAP PM: remove min clk rate constraint: " 158 pr_debug("OMAP PM: remove min clk rate constraint: dev %s\n",
160 "dev %s\n", dev_name(dev)); 159 dev_name(dev));
161 else 160 else
162 pr_debug("OMAP PM: add min clk rate constraint: " 161 pr_debug("OMAP PM: add min clk rate constraint: dev %s, rate = %ld Hz\n",
163 "dev %s, rate = %ld Hz\n", dev_name(dev), r); 162 dev_name(dev), r);
164 163
165 /* 164 /*
166 * Code in a real implementation should keep track of these 165 * Code in a real implementation should keep track of these
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index c490240bb82..7a7d1f2a65e 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -1,4 +1,3 @@
1
2/* 1/*
3 * omap_device implementation 2 * omap_device implementation
4 * 3 *
@@ -153,21 +152,19 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
153 act_lat = timespec_to_ns(&c); 152 act_lat = timespec_to_ns(&c);
154 153
155 dev_dbg(&od->pdev->dev, 154 dev_dbg(&od->pdev->dev,
156 "omap_device: pm_lat %d: activate: elapsed time " 155 "omap_device: pm_lat %d: activate: elapsed time %llu nsec\n",
157 "%llu nsec\n", od->pm_lat_level, act_lat); 156 od->pm_lat_level, act_lat);
158 157
159 if (act_lat > odpl->activate_lat) { 158 if (act_lat > odpl->activate_lat) {
160 odpl->activate_lat_worst = act_lat; 159 odpl->activate_lat_worst = act_lat;
161 if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { 160 if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
162 odpl->activate_lat = act_lat; 161 odpl->activate_lat = act_lat;
163 dev_dbg(&od->pdev->dev, 162 dev_dbg(&od->pdev->dev,
164 "new worst case activate latency " 163 "new worst case activate latency %d: %llu\n",
165 "%d: %llu\n",
166 od->pm_lat_level, act_lat); 164 od->pm_lat_level, act_lat);
167 } else 165 } else
168 dev_warn(&od->pdev->dev, 166 dev_warn(&od->pdev->dev,
169 "activate latency %d " 167 "activate latency %d higher than expected. (%llu > %d)\n",
170 "higher than exptected. (%llu > %d)\n",
171 od->pm_lat_level, act_lat, 168 od->pm_lat_level, act_lat,
172 odpl->activate_lat); 169 odpl->activate_lat);
173 } 170 }
@@ -220,21 +217,19 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
220 deact_lat = timespec_to_ns(&c); 217 deact_lat = timespec_to_ns(&c);
221 218
222 dev_dbg(&od->pdev->dev, 219 dev_dbg(&od->pdev->dev,
223 "omap_device: pm_lat %d: deactivate: elapsed time " 220 "omap_device: pm_lat %d: deactivate: elapsed time %llu nsec\n",
224 "%llu nsec\n", od->pm_lat_level, deact_lat); 221 od->pm_lat_level, deact_lat);
225 222
226 if (deact_lat > odpl->deactivate_lat) { 223 if (deact_lat > odpl->deactivate_lat) {
227 odpl->deactivate_lat_worst = deact_lat; 224 odpl->deactivate_lat_worst = deact_lat;
228 if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { 225 if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
229 odpl->deactivate_lat = deact_lat; 226 odpl->deactivate_lat = deact_lat;
230 dev_dbg(&od->pdev->dev, 227 dev_dbg(&od->pdev->dev,
231 "new worst case deactivate latency " 228 "new worst case deactivate latency %d: %llu\n",
232 "%d: %llu\n",
233 od->pm_lat_level, deact_lat); 229 od->pm_lat_level, deact_lat);
234 } else 230 } else
235 dev_warn(&od->pdev->dev, 231 dev_warn(&od->pdev->dev,
236 "deactivate latency %d " 232 "deactivate latency %d higher than expected. (%llu > %d)\n",
237 "higher than exptected. (%llu > %d)\n",
238 od->pm_lat_level, deact_lat, 233 od->pm_lat_level, deact_lat,
239 odpl->deactivate_lat); 234 odpl->deactivate_lat);
240 } 235 }
@@ -266,10 +261,10 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
266 return; 261 return;
267 } 262 }
268 263
269 r = omap_clk_get_by_name(clk_name); 264 r = clk_get(NULL, clk_name);
270 if (IS_ERR(r)) { 265 if (IS_ERR(r)) {
271 dev_err(&od->pdev->dev, 266 dev_err(&od->pdev->dev,
272 "omap_clk_get_by_name for %s failed\n", clk_name); 267 "clk_get for %s failed\n", clk_name);
273 return; 268 return;
274 } 269 }
275 270
@@ -370,6 +365,14 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
370 goto odbfd_exit1; 365 goto odbfd_exit1;
371 } 366 }
372 367
368 /* Fix up missing resource names */
369 for (i = 0; i < pdev->num_resources; i++) {
370 struct resource *r = &pdev->resource[i];
371
372 if (r->name == NULL)
373 r->name = dev_name(&pdev->dev);
374 }
375
373 if (of_get_property(node, "ti,no_idle_on_suspend", NULL)) 376 if (of_get_property(node, "ti,no_idle_on_suspend", NULL))
374 omap_device_disable_idle_on_suspend(pdev); 377 omap_device_disable_idle_on_suspend(pdev);
375 378
@@ -385,17 +388,21 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
385 unsigned long event, void *dev) 388 unsigned long event, void *dev)
386{ 389{
387 struct platform_device *pdev = to_platform_device(dev); 390 struct platform_device *pdev = to_platform_device(dev);
391 struct omap_device *od;
388 392
389 switch (event) { 393 switch (event) {
390 case BUS_NOTIFY_ADD_DEVICE:
391 if (pdev->dev.of_node)
392 omap_device_build_from_dt(pdev);
393 break;
394
395 case BUS_NOTIFY_DEL_DEVICE: 394 case BUS_NOTIFY_DEL_DEVICE:
396 if (pdev->archdata.od) 395 if (pdev->archdata.od)
397 omap_device_delete(pdev->archdata.od); 396 omap_device_delete(pdev->archdata.od);
398 break; 397 break;
398 case BUS_NOTIFY_ADD_DEVICE:
399 if (pdev->dev.of_node)
400 omap_device_build_from_dt(pdev);
401 /* fall through */
402 default:
403 od = to_omap_device(pdev);
404 if (od)
405 od->_driver_status = event;
399 } 406 }
400 407
401 return NOTIFY_DONE; 408 return NOTIFY_DONE;
@@ -449,8 +456,8 @@ static int omap_device_count_resources(struct omap_device *od)
449 for (i = 0; i < od->hwmods_cnt; i++) 456 for (i = 0; i < od->hwmods_cnt; i++)
450 c += omap_hwmod_count_resources(od->hwmods[i]); 457 c += omap_hwmod_count_resources(od->hwmods[i]);
451 458
452 pr_debug("omap_device: %s: counted %d total resources across %d " 459 pr_debug("omap_device: %s: counted %d total resources across %d hwmods\n",
453 "hwmods\n", od->pdev->name, c, od->hwmods_cnt); 460 od->pdev->name, c, od->hwmods_cnt);
454 461
455 return c; 462 return c;
456} 463}
@@ -486,6 +493,33 @@ static int omap_device_fill_resources(struct omap_device *od,
486} 493}
487 494
488/** 495/**
496 * _od_fill_dma_resources - fill in array of struct resource with dma resources
497 * @od: struct omap_device *
498 * @res: pointer to an array of struct resource to be filled in
499 *
500 * Populate one or more empty struct resource pointed to by @res with
501 * the dma resource data for this omap_device @od. Used by
502 * omap_device_alloc() after calling omap_device_count_resources().
503 *
504 * Ideally this function would not be needed at all. If we have
505 * mechanism to get dma resources from DT.
506 *
507 * Returns 0.
508 */
509static int _od_fill_dma_resources(struct omap_device *od,
510 struct resource *res)
511{
512 int i, r;
513
514 for (i = 0; i < od->hwmods_cnt; i++) {
515 r = omap_hwmod_fill_dma_resources(od->hwmods[i], res);
516 res += r;
517 }
518
519 return 0;
520}
521
522/**
489 * omap_device_alloc - allocate an omap_device 523 * omap_device_alloc - allocate an omap_device
490 * @pdev: platform_device that will be included in this omap_device 524 * @pdev: platform_device that will be included in this omap_device
491 * @oh: ptr to the single omap_hwmod that backs this omap_device 525 * @oh: ptr to the single omap_hwmod that backs this omap_device
@@ -524,24 +558,44 @@ struct omap_device *omap_device_alloc(struct platform_device *pdev,
524 od->hwmods = hwmods; 558 od->hwmods = hwmods;
525 od->pdev = pdev; 559 od->pdev = pdev;
526 560
561 res_count = omap_device_count_resources(od);
527 /* 562 /*
528 * HACK: Ideally the resources from DT should match, and hwmod 563 * DT Boot:
529 * should just add the missing ones. Since the name is not 564 * OF framework will construct the resource structure (currently
530 * properly populated by DT, stick to hwmod resources only. 565 * does for MEM & IRQ resource) and we should respect/use these
566 * resources, killing hwmod dependency.
567 * If pdev->num_resources > 0, we assume that MEM & IRQ resources
568 * have been allocated by OF layer already (through DTB).
569 *
570 * Non-DT Boot:
571 * Here, pdev->num_resources = 0, and we should get all the
572 * resources from hwmod.
573 *
574 * TODO: Once DMA resource is available from OF layer, we should
575 * kill filling any resources from hwmod.
531 */ 576 */
532 if (pdev->num_resources && pdev->resource) 577 if (res_count > pdev->num_resources) {
533 dev_warn(&pdev->dev, "%s(): resources already allocated %d\n", 578 /* Allocate resources memory to account for new resources */
534 __func__, pdev->num_resources);
535
536 res_count = omap_device_count_resources(od);
537 if (res_count > 0) {
538 dev_dbg(&pdev->dev, "%s(): resources allocated from hwmod %d\n",
539 __func__, res_count);
540 res = kzalloc(sizeof(struct resource) * res_count, GFP_KERNEL); 579 res = kzalloc(sizeof(struct resource) * res_count, GFP_KERNEL);
541 if (!res) 580 if (!res)
542 goto oda_exit3; 581 goto oda_exit3;
543 582
544 omap_device_fill_resources(od, res); 583 /*
584 * If pdev->num_resources > 0, then assume that,
585 * MEM and IRQ resources will only come from DT and only
586 * fill DMA resource from hwmod layer.
587 */
588 if (pdev->num_resources && pdev->resource) {
589 dev_dbg(&pdev->dev, "%s(): resources already allocated %d\n",
590 __func__, res_count);
591 memcpy(res, pdev->resource,
592 sizeof(struct resource) * pdev->num_resources);
593 _od_fill_dma_resources(od, &res[pdev->num_resources]);
594 } else {
595 dev_dbg(&pdev->dev, "%s(): using resources from hwmod %d\n",
596 __func__, res_count);
597 omap_device_fill_resources(od, res);
598 }
545 599
546 ret = platform_device_add_resources(pdev, res, res_count); 600 ret = platform_device_add_resources(pdev, res, res_count);
547 kfree(res); 601 kfree(res);
@@ -671,7 +725,7 @@ struct platform_device __init *omap_device_build_ss(const char *pdev_name, int p
671 dev_set_name(&pdev->dev, "%s", pdev->name); 725 dev_set_name(&pdev->dev, "%s", pdev->name);
672 726
673 od = omap_device_alloc(pdev, ohs, oh_cnt, pm_lats, pm_lats_cnt); 727 od = omap_device_alloc(pdev, ohs, oh_cnt, pm_lats, pm_lats_cnt);
674 if (!od) 728 if (IS_ERR(od))
675 goto odbs_exit1; 729 goto odbs_exit1;
676 730
677 ret = platform_device_add_data(pdev, pdata, pdata_len); 731 ret = platform_device_add_data(pdev, pdata, pdata_len);
@@ -752,6 +806,10 @@ static int _od_suspend_noirq(struct device *dev)
752 struct omap_device *od = to_omap_device(pdev); 806 struct omap_device *od = to_omap_device(pdev);
753 int ret; 807 int ret;
754 808
809 /* Don't attempt late suspend on a driver that is not bound */
810 if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER)
811 return 0;
812
755 ret = pm_generic_suspend_noirq(dev); 813 ret = pm_generic_suspend_noirq(dev);
756 814
757 if (!ret && !pm_runtime_status_suspended(dev)) { 815 if (!ret && !pm_runtime_status_suspended(dev)) {
@@ -925,6 +983,61 @@ int omap_device_shutdown(struct platform_device *pdev)
925} 983}
926 984
927/** 985/**
986 * omap_device_assert_hardreset - set a device's hardreset line
987 * @pdev: struct platform_device * to reset
988 * @name: const char * name of the reset line
989 *
990 * Set the hardreset line identified by @name on the IP blocks
991 * associated with the hwmods backing the platform_device @pdev. All
992 * of the hwmods associated with @pdev must have the same hardreset
993 * line linked to them for this to work. Passes along the return value
994 * of omap_hwmod_assert_hardreset() in the event of any failure, or
995 * returns 0 upon success.
996 */
997int omap_device_assert_hardreset(struct platform_device *pdev, const char *name)
998{
999 struct omap_device *od = to_omap_device(pdev);
1000 int ret = 0;
1001 int i;
1002
1003 for (i = 0; i < od->hwmods_cnt; i++) {
1004 ret = omap_hwmod_assert_hardreset(od->hwmods[i], name);
1005 if (ret)
1006 break;
1007 }
1008
1009 return ret;
1010}
1011
1012/**
1013 * omap_device_deassert_hardreset - release a device's hardreset line
1014 * @pdev: struct platform_device * to reset
1015 * @name: const char * name of the reset line
1016 *
1017 * Release the hardreset line identified by @name on the IP blocks
1018 * associated with the hwmods backing the platform_device @pdev. All
1019 * of the hwmods associated with @pdev must have the same hardreset
1020 * line linked to them for this to work. Passes along the return
1021 * value of omap_hwmod_deassert_hardreset() in the event of any
1022 * failure, or returns 0 upon success.
1023 */
1024int omap_device_deassert_hardreset(struct platform_device *pdev,
1025 const char *name)
1026{
1027 struct omap_device *od = to_omap_device(pdev);
1028 int ret = 0;
1029 int i;
1030
1031 for (i = 0; i < od->hwmods_cnt; i++) {
1032 ret = omap_hwmod_deassert_hardreset(od->hwmods[i], name);
1033 if (ret)
1034 break;
1035 }
1036
1037 return ret;
1038}
1039
1040/**
928 * omap_device_align_pm_lat - activate/deactivate device to match wakeup lat lim 1041 * omap_device_align_pm_lat - activate/deactivate device to match wakeup lat lim
929 * @od: struct omap_device * 1042 * @od: struct omap_device *
930 * 1043 *
@@ -1125,3 +1238,41 @@ static int __init omap_device_init(void)
1125 return 0; 1238 return 0;
1126} 1239}
1127core_initcall(omap_device_init); 1240core_initcall(omap_device_init);
1241
1242/**
1243 * omap_device_late_idle - idle devices without drivers
1244 * @dev: struct device * associated with omap_device
1245 * @data: unused
1246 *
1247 * Check the driver bound status of this device, and idle it
1248 * if there is no driver attached.
1249 */
1250static int __init omap_device_late_idle(struct device *dev, void *data)
1251{
1252 struct platform_device *pdev = to_platform_device(dev);
1253 struct omap_device *od = to_omap_device(pdev);
1254
1255 if (!od)
1256 return 0;
1257
1258 /*
1259 * If omap_device state is enabled, but has no driver bound,
1260 * idle it.
1261 */
1262 if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) {
1263 if (od->_state == OMAP_DEVICE_STATE_ENABLED) {
1264 dev_warn(dev, "%s: enabled but no driver. Idling\n",
1265 __func__);
1266 omap_device_idle(pdev);
1267 }
1268 }
1269
1270 return 0;
1271}
1272
1273static int __init omap_device_late_init(void)
1274{
1275 bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle);
1276 return 0;
1277}
1278late_initcall(omap_device_late_init);
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 766181cb5c9..28acb383e7d 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -26,7 +26,6 @@
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27 27
28#include <plat/sram.h> 28#include <plat/sram.h>
29#include <plat/board.h>
30#include <plat/cpu.h> 29#include <plat/cpu.h>
31 30
32#include "sram.h" 31#include "sram.h"
@@ -68,6 +67,7 @@
68 67
69static unsigned long omap_sram_start; 68static unsigned long omap_sram_start;
70static void __iomem *omap_sram_base; 69static void __iomem *omap_sram_base;
70static unsigned long omap_sram_skip;
71static unsigned long omap_sram_size; 71static unsigned long omap_sram_size;
72static void __iomem *omap_sram_ceil; 72static void __iomem *omap_sram_ceil;
73 73
@@ -106,6 +106,7 @@ static int is_sram_locked(void)
106 */ 106 */
107static void __init omap_detect_sram(void) 107static void __init omap_detect_sram(void)
108{ 108{
109 omap_sram_skip = SRAM_BOOTLOADER_SZ;
109 if (cpu_class_is_omap2()) { 110 if (cpu_class_is_omap2()) {
110 if (is_sram_locked()) { 111 if (is_sram_locked()) {
111 if (cpu_is_omap34xx()) { 112 if (cpu_is_omap34xx()) {
@@ -113,6 +114,7 @@ static void __init omap_detect_sram(void)
113 if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) || 114 if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) ||
114 (omap_type() == OMAP2_DEVICE_TYPE_SEC)) { 115 (omap_type() == OMAP2_DEVICE_TYPE_SEC)) {
115 omap_sram_size = 0x7000; /* 28K */ 116 omap_sram_size = 0x7000; /* 28K */
117 omap_sram_skip += SZ_16K;
116 } else { 118 } else {
117 omap_sram_size = 0x8000; /* 32K */ 119 omap_sram_size = 0x8000; /* 32K */
118 } 120 }
@@ -175,8 +177,10 @@ static void __init omap_map_sram(void)
175 return; 177 return;
176 178
177#ifdef CONFIG_OMAP4_ERRATA_I688 179#ifdef CONFIG_OMAP4_ERRATA_I688
180 if (cpu_is_omap44xx()) {
178 omap_sram_start += PAGE_SIZE; 181 omap_sram_start += PAGE_SIZE;
179 omap_sram_size -= SZ_16K; 182 omap_sram_size -= SZ_16K;
183 }
180#endif 184#endif
181 if (cpu_is_omap34xx()) { 185 if (cpu_is_omap34xx()) {
182 /* 186 /*
@@ -203,8 +207,8 @@ static void __init omap_map_sram(void)
203 * Looks like we need to preserve some bootloader code at the 207 * Looks like we need to preserve some bootloader code at the
204 * beginning of SRAM for jumping to flash for reboot to work... 208 * beginning of SRAM for jumping to flash for reboot to work...
205 */ 209 */
206 memset_io(omap_sram_base + SRAM_BOOTLOADER_SZ, 0, 210 memset_io(omap_sram_base + omap_sram_skip, 0,
207 omap_sram_size - SRAM_BOOTLOADER_SZ); 211 omap_sram_size - omap_sram_skip);
208} 212}
209 213
210/* 214/*
@@ -218,7 +222,7 @@ void *omap_sram_push_address(unsigned long size)
218{ 222{
219 unsigned long available, new_ceil = (unsigned long)omap_sram_ceil; 223 unsigned long available, new_ceil = (unsigned long)omap_sram_ceil;
220 224
221 available = omap_sram_ceil - (omap_sram_base + SRAM_BOOTLOADER_SZ); 225 available = omap_sram_ceil - (omap_sram_base + omap_sram_skip);
222 226
223 if (size > available) { 227 if (size > available) {
224 pr_err("Not enough space in SRAM\n"); 228 pr_err("Not enough space in SRAM\n");
diff --git a/arch/arm/plat-orion/Makefile b/arch/arm/plat-orion/Makefile
index c20ce0f5ce3..a82cecb8494 100644
--- a/arch/arm/plat-orion/Makefile
+++ b/arch/arm/plat-orion/Makefile
@@ -1,10 +1,10 @@
1# 1#
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
4 5
5obj-y := irq.o pcie.o time.o common.o mpp.o addr-map.o 6obj-y += addr-map.o
6obj-m :=
7obj-n :=
8obj- :=
9 7
10obj-$(CONFIG_GENERIC_GPIO) += gpio.o 8orion-gpio-$(CONFIG_GENERIC_GPIO) += gpio.o
9obj-$(CONFIG_PLAT_ORION_LEGACY) += irq.o pcie.o time.o common.o mpp.o
10obj-$(CONFIG_PLAT_ORION_LEGACY) += $(orion-gpio-y)
diff --git a/arch/arm/plat-orion/addr-map.c b/arch/arm/plat-orion/addr-map.c
index 367ca89ac40..a7b8060c293 100644
--- a/arch/arm/plat-orion/addr-map.c
+++ b/arch/arm/plat-orion/addr-map.c
@@ -48,7 +48,7 @@ EXPORT_SYMBOL_GPL(mv_mbus_dram_info);
48static void __init __iomem * 48static void __init __iomem *
49orion_win_cfg_base(const struct orion_addr_map_cfg *cfg, int win) 49orion_win_cfg_base(const struct orion_addr_map_cfg *cfg, int win)
50{ 50{
51 return (void __iomem *)(cfg->bridge_virt_base + (win << 4)); 51 return cfg->bridge_virt_base + (win << 4);
52} 52}
53 53
54/* 54/*
@@ -143,19 +143,16 @@ void __init orion_config_wins(struct orion_addr_map_cfg * cfg,
143 * Setup MBUS dram target info. 143 * Setup MBUS dram target info.
144 */ 144 */
145void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg, 145void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg,
146 const u32 ddr_window_cpu_base) 146 const void __iomem *ddr_window_cpu_base)
147{ 147{
148 void __iomem *addr;
149 int i; 148 int i;
150 int cs; 149 int cs;
151 150
152 orion_mbus_dram_info.mbus_dram_target_id = TARGET_DDR; 151 orion_mbus_dram_info.mbus_dram_target_id = TARGET_DDR;
153 152
154 addr = (void __iomem *)ddr_window_cpu_base;
155
156 for (i = 0, cs = 0; i < 4; i++) { 153 for (i = 0, cs = 0; i < 4; i++) {
157 u32 base = readl(addr + DDR_BASE_CS_OFF(i)); 154 u32 base = readl(ddr_window_cpu_base + DDR_BASE_CS_OFF(i));
158 u32 size = readl(addr + DDR_SIZE_CS_OFF(i)); 155 u32 size = readl(ddr_window_cpu_base + DDR_SIZE_CS_OFF(i));
159 156
160 /* 157 /*
161 * Chip select enabled? 158 * Chip select enabled?
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index b8b747a9d36..b8a688cad4c 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -19,8 +19,8 @@
19#include <linux/mv643xx_eth.h> 19#include <linux/mv643xx_eth.h>
20#include <linux/mv643xx_i2c.h> 20#include <linux/mv643xx_i2c.h>
21#include <net/dsa.h> 21#include <net/dsa.h>
22#include <plat/mv_xor.h> 22#include <linux/platform_data/dma-mv_xor.h>
23#include <plat/ehci-orion.h> 23#include <linux/platform_data/usb-ehci-orion.h>
24#include <mach/bridge-regs.h> 24#include <mach/bridge-regs.h>
25 25
26/* Create a clkdev entry for a given device/clk */ 26/* Create a clkdev entry for a given device/clk */
@@ -86,13 +86,13 @@ static void __init uart_complete(
86 struct platform_device *orion_uart, 86 struct platform_device *orion_uart,
87 struct plat_serial8250_port *data, 87 struct plat_serial8250_port *data,
88 struct resource *resources, 88 struct resource *resources,
89 unsigned int membase, 89 void __iomem *membase,
90 resource_size_t mapbase, 90 resource_size_t mapbase,
91 unsigned int irq, 91 unsigned int irq,
92 struct clk *clk) 92 struct clk *clk)
93{ 93{
94 data->mapbase = mapbase; 94 data->mapbase = mapbase;
95 data->membase = (void __iomem *)membase; 95 data->membase = membase;
96 data->irq = irq; 96 data->irq = irq;
97 data->uartclk = uart_get_clk_rate(clk); 97 data->uartclk = uart_get_clk_rate(clk);
98 orion_uart->dev.platform_data = data; 98 orion_uart->dev.platform_data = data;
@@ -120,7 +120,7 @@ static struct platform_device orion_uart0 = {
120 .id = PLAT8250_DEV_PLATFORM, 120 .id = PLAT8250_DEV_PLATFORM,
121}; 121};
122 122
123void __init orion_uart0_init(unsigned int membase, 123void __init orion_uart0_init(void __iomem *membase,
124 resource_size_t mapbase, 124 resource_size_t mapbase,
125 unsigned int irq, 125 unsigned int irq,
126 struct clk *clk) 126 struct clk *clk)
@@ -148,7 +148,7 @@ static struct platform_device orion_uart1 = {
148 .id = PLAT8250_DEV_PLATFORM1, 148 .id = PLAT8250_DEV_PLATFORM1,
149}; 149};
150 150
151void __init orion_uart1_init(unsigned int membase, 151void __init orion_uart1_init(void __iomem *membase,
152 resource_size_t mapbase, 152 resource_size_t mapbase,
153 unsigned int irq, 153 unsigned int irq,
154 struct clk *clk) 154 struct clk *clk)
@@ -176,7 +176,7 @@ static struct platform_device orion_uart2 = {
176 .id = PLAT8250_DEV_PLATFORM2, 176 .id = PLAT8250_DEV_PLATFORM2,
177}; 177};
178 178
179void __init orion_uart2_init(unsigned int membase, 179void __init orion_uart2_init(void __iomem *membase,
180 resource_size_t mapbase, 180 resource_size_t mapbase,
181 unsigned int irq, 181 unsigned int irq,
182 struct clk *clk) 182 struct clk *clk)
@@ -204,7 +204,7 @@ static struct platform_device orion_uart3 = {
204 .id = 3, 204 .id = 3,
205}; 205};
206 206
207void __init orion_uart3_init(unsigned int membase, 207void __init orion_uart3_init(void __iomem *membase,
208 resource_size_t mapbase, 208 resource_size_t mapbase,
209 unsigned int irq, 209 unsigned int irq,
210 struct clk *clk) 210 struct clk *clk)
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index dfda74fae6f..c29ee7ea200 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -23,7 +23,7 @@
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/of_irq.h> 24#include <linux/of_irq.h>
25#include <linux/of_address.h> 25#include <linux/of_address.h>
26#include <plat/gpio.h> 26#include <plat/orion-gpio.h>
27 27
28/* 28/*
29 * GPIO unit register offsets. 29 * GPIO unit register offsets.
diff --git a/arch/arm/plat-orion/include/plat/addr-map.h b/arch/arm/plat-orion/include/plat/addr-map.h
index fd556f77562..ec63e4a627d 100644
--- a/arch/arm/plat-orion/include/plat/addr-map.h
+++ b/arch/arm/plat-orion/include/plat/addr-map.h
@@ -16,7 +16,7 @@ extern struct mbus_dram_target_info orion_mbus_dram_info;
16struct orion_addr_map_cfg { 16struct orion_addr_map_cfg {
17 const int num_wins; /* Total number of windows */ 17 const int num_wins; /* Total number of windows */
18 const int remappable_wins; 18 const int remappable_wins;
19 const u32 bridge_virt_base; 19 void __iomem *bridge_virt_base;
20 20
21 /* If NULL, the default cpu_win_can_remap will be used, using 21 /* If NULL, the default cpu_win_can_remap will be used, using
22 the value in remappable_wins */ 22 the value in remappable_wins */
@@ -49,5 +49,5 @@ void __init orion_setup_cpu_win(const struct orion_addr_map_cfg *cfg,
49 const u8 attr, const int remap); 49 const u8 attr, const int remap);
50 50
51void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg, 51void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg,
52 const u32 ddr_window_cpu_base); 52 const void __iomem *ddr_window_cpu_base);
53#endif 53#endif
diff --git a/arch/arm/plat-orion/include/plat/audio.h b/arch/arm/plat-orion/include/plat/audio.h
deleted file mode 100644
index d6a55bd2e57..00000000000
--- a/arch/arm/plat-orion/include/plat/audio.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __PLAT_AUDIO_H
2#define __PLAT_AUDIO_H
3
4struct kirkwood_asoc_platform_data {
5 int burst;
6};
7#endif
diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h
index ae2377ef63e..6bbc3fe5f58 100644
--- a/arch/arm/plat-orion/include/plat/common.h
+++ b/arch/arm/plat-orion/include/plat/common.h
@@ -13,22 +13,22 @@
13 13
14struct dsa_platform_data; 14struct dsa_platform_data;
15 15
16void __init orion_uart0_init(unsigned int membase, 16void __init orion_uart0_init(void __iomem *membase,
17 resource_size_t mapbase, 17 resource_size_t mapbase,
18 unsigned int irq, 18 unsigned int irq,
19 struct clk *clk); 19 struct clk *clk);
20 20
21void __init orion_uart1_init(unsigned int membase, 21void __init orion_uart1_init(void __iomem *membase,
22 resource_size_t mapbase, 22 resource_size_t mapbase,
23 unsigned int irq, 23 unsigned int irq,
24 struct clk *clk); 24 struct clk *clk);
25 25
26void __init orion_uart2_init(unsigned int membase, 26void __init orion_uart2_init(void __iomem *membase,
27 resource_size_t mapbase, 27 resource_size_t mapbase,
28 unsigned int irq, 28 unsigned int irq,
29 struct clk *clk); 29 struct clk *clk);
30 30
31void __init orion_uart3_init(unsigned int membase, 31void __init orion_uart3_init(void __iomem *membase,
32 resource_size_t mapbase, 32 resource_size_t mapbase,
33 unsigned int irq, 33 unsigned int irq,
34 struct clk *clk); 34 struct clk *clk);
diff --git a/arch/arm/plat-orion/include/plat/ehci-orion.h b/arch/arm/plat-orion/include/plat/ehci-orion.h
deleted file mode 100644
index 6fc78e43042..00000000000
--- a/arch/arm/plat-orion/include/plat/ehci-orion.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * arch/arm/plat-orion/include/plat/ehci-orion.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __PLAT_EHCI_ORION_H
10#define __PLAT_EHCI_ORION_H
11
12#include <linux/mbus.h>
13
14enum orion_ehci_phy_ver {
15 EHCI_PHY_ORION,
16 EHCI_PHY_DD,
17 EHCI_PHY_KW,
18 EHCI_PHY_NA,
19};
20
21struct orion_ehci_data {
22 enum orion_ehci_phy_ver phy_version;
23};
24
25
26#endif
diff --git a/arch/arm/plat-orion/include/plat/mpp.h b/arch/arm/plat-orion/include/plat/mpp.h
index 723adce99f4..254552fee88 100644
--- a/arch/arm/plat-orion/include/plat/mpp.h
+++ b/arch/arm/plat-orion/include/plat/mpp.h
@@ -29,6 +29,6 @@
29#define MPP_OUTPUT_MASK GENERIC_MPP(0, 0x0, 0, 1) 29#define MPP_OUTPUT_MASK GENERIC_MPP(0, 0x0, 0, 1)
30 30
31void __init orion_mpp_conf(unsigned int *mpp_list, unsigned int variant_mask, 31void __init orion_mpp_conf(unsigned int *mpp_list, unsigned int variant_mask,
32 unsigned int mpp_max, unsigned int dev_bus); 32 unsigned int mpp_max, void __iomem *dev_bus);
33 33
34#endif 34#endif
diff --git a/arch/arm/plat-orion/include/plat/mv_xor.h b/arch/arm/plat-orion/include/plat/mv_xor.h
deleted file mode 100644
index 2ba1f7d76ee..00000000000
--- a/arch/arm/plat-orion/include/plat/mv_xor.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * arch/arm/plat-orion/include/plat/mv_xor.h
3 *
4 * Marvell XOR platform device data definition file.
5 */
6
7#ifndef __PLAT_MV_XOR_H
8#define __PLAT_MV_XOR_H
9
10#include <linux/dmaengine.h>
11#include <linux/mbus.h>
12
13#define MV_XOR_SHARED_NAME "mv_xor_shared"
14#define MV_XOR_NAME "mv_xor"
15
16struct mv_xor_platform_data {
17 struct platform_device *shared;
18 int hw_id;
19 dma_cap_mask_t cap_mask;
20 size_t pool_size;
21};
22
23
24#endif
diff --git a/arch/arm/plat-orion/include/plat/mvsdio.h b/arch/arm/plat-orion/include/plat/mvsdio.h
deleted file mode 100644
index 1190efedcb9..00000000000
--- a/arch/arm/plat-orion/include/plat/mvsdio.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/plat-orion/include/plat/mvsdio.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __MACH_MVSDIO_H
10#define __MACH_MVSDIO_H
11
12#include <linux/mbus.h>
13
14struct mvsdio_platform_data {
15 unsigned int clock;
16 int gpio_card_detect;
17 int gpio_write_protect;
18};
19
20#endif
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/orion-gpio.h
index 81c6fc8a7b2..614dcac9dc5 100644
--- a/arch/arm/plat-orion/include/plat/gpio.h
+++ b/arch/arm/plat-orion/include/plat/orion-gpio.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/plat-orion/include/plat/gpio.h 2 * arch/arm/plat-orion/include/plat/orion-gpio.h
3 * 3 *
4 * Marvell Orion SoC GPIO handling. 4 * Marvell Orion SoC GPIO handling.
5 * 5 *
diff --git a/arch/arm/plat-orion/include/plat/orion_nand.h b/arch/arm/plat-orion/include/plat/orion_nand.h
deleted file mode 100644
index 9f3c180834d..00000000000
--- a/arch/arm/plat-orion/include/plat/orion_nand.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * arch/arm/plat-orion/include/plat/orion_nand.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __PLAT_ORION_NAND_H
10#define __PLAT_ORION_NAND_H
11
12/*
13 * Device bus NAND private data
14 */
15struct orion_nand_data {
16 struct mtd_partition *parts;
17 int (*dev_ready)(struct mtd_info *mtd);
18 u32 nr_parts;
19 u8 ale; /* address line number connected to ALE */
20 u8 cle; /* address line number connected to CLE */
21 u8 width; /* buswidth */
22 u8 chip_delay;
23};
24
25
26#endif
diff --git a/arch/arm/plat-orion/include/plat/time.h b/arch/arm/plat-orion/include/plat/time.h
index 4d5f1f6e18d..07527e417c6 100644
--- a/arch/arm/plat-orion/include/plat/time.h
+++ b/arch/arm/plat-orion/include/plat/time.h
@@ -11,9 +11,9 @@
11#ifndef __PLAT_TIME_H 11#ifndef __PLAT_TIME_H
12#define __PLAT_TIME_H 12#define __PLAT_TIME_H
13 13
14void orion_time_set_base(u32 timer_base); 14void orion_time_set_base(void __iomem *timer_base);
15 15
16void orion_time_init(u32 bridge_base, u32 bridge_timer1_clr_mask, 16void orion_time_init(void __iomem *bridge_base, u32 bridge_timer1_clr_mask,
17 unsigned int irq, unsigned int tclk); 17 unsigned int irq, unsigned int tclk);
18 18
19 19
diff --git a/arch/arm/plat-orion/irq.c b/arch/arm/plat-orion/irq.c
index d751964def4..1867944415c 100644
--- a/arch/arm/plat-orion/irq.c
+++ b/arch/arm/plat-orion/irq.c
@@ -16,7 +16,7 @@
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 <plat/irq.h> 18#include <plat/irq.h>
19#include <plat/gpio.h> 19#include <plat/orion-gpio.h>
20 20
21void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr) 21void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
22{ 22{
diff --git a/arch/arm/plat-orion/mpp.c b/arch/arm/plat-orion/mpp.c
index 3b1e17bd3d1..e686fe76a96 100644
--- a/arch/arm/plat-orion/mpp.c
+++ b/arch/arm/plat-orion/mpp.c
@@ -14,18 +14,19 @@
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17#include <plat/orion-gpio.h>
17#include <plat/mpp.h> 18#include <plat/mpp.h>
18 19
19/* Address of the ith MPP control register */ 20/* Address of the ith MPP control register */
20static __init unsigned long mpp_ctrl_addr(unsigned int i, 21static __init void __iomem *mpp_ctrl_addr(unsigned int i,
21 unsigned long dev_bus) 22 void __iomem *dev_bus)
22{ 23{
23 return dev_bus + (i) * 4; 24 return dev_bus + (i) * 4;
24} 25}
25 26
26 27
27void __init orion_mpp_conf(unsigned int *mpp_list, unsigned int variant_mask, 28void __init orion_mpp_conf(unsigned int *mpp_list, unsigned int variant_mask,
28 unsigned int mpp_max, unsigned int dev_bus) 29 unsigned int mpp_max, void __iomem *dev_bus)
29{ 30{
30 unsigned int mpp_nr_regs = (1 + mpp_max/8); 31 unsigned int mpp_nr_regs = (1 + mpp_max/8);
31 u32 mpp_ctrl[mpp_nr_regs]; 32 u32 mpp_ctrl[mpp_nr_regs];
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index 1ed8d1397fc..0f4fa863dd5 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -180,13 +180,13 @@ static struct irqaction orion_timer_irq = {
180}; 180};
181 181
182void __init 182void __init
183orion_time_set_base(u32 _timer_base) 183orion_time_set_base(void __iomem *_timer_base)
184{ 184{
185 timer_base = (void __iomem *)_timer_base; 185 timer_base = _timer_base;
186} 186}
187 187
188void __init 188void __init
189orion_time_init(u32 _bridge_base, u32 _bridge_timer1_clr_mask, 189orion_time_init(void __iomem *_bridge_base, u32 _bridge_timer1_clr_mask,
190 unsigned int irq, unsigned int tclk) 190 unsigned int irq, unsigned int tclk)
191{ 191{
192 u32 u; 192 u32 u;
@@ -194,7 +194,7 @@ orion_time_init(u32 _bridge_base, u32 _bridge_timer1_clr_mask,
194 /* 194 /*
195 * Set SoC-specific data. 195 * Set SoC-specific data.
196 */ 196 */
197 bridge_base = (void __iomem *)_bridge_base; 197 bridge_base = _bridge_base;
198 bridge_timer1_clr_mask = _bridge_timer1_clr_mask; 198 bridge_timer1_clr_mask = _bridge_timer1_clr_mask;
199 199
200 ticks_per_jiffy = (tclk + HZ/2) / HZ; 200 ticks_per_jiffy = (tclk + HZ/2) / HZ;
diff --git a/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h b/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h
deleted file mode 100644
index 5ce8d5e6ea5..00000000000
--- a/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h
+++ /dev/null
@@ -1,73 +0,0 @@
1#ifndef __ASM_ARCH_PXA27x_KEYPAD_H
2#define __ASM_ARCH_PXA27x_KEYPAD_H
3
4#include <linux/input.h>
5#include <linux/input/matrix_keypad.h>
6
7#define MAX_MATRIX_KEY_ROWS (8)
8#define MAX_MATRIX_KEY_COLS (8)
9#define MATRIX_ROW_SHIFT (3)
10#define MAX_DIRECT_KEY_NUM (8)
11
12/* pxa3xx keypad platform specific parameters
13 *
14 * NOTE:
15 * 1. direct_key_num indicates the number of keys in the direct keypad
16 * _plus_ the number of rotary-encoder sensor inputs, this can be
17 * left as 0 if only rotary encoders are enabled, the driver will
18 * automatically calculate this
19 *
20 * 2. direct_key_map is the key code map for the direct keys, if rotary
21 * encoder(s) are enabled, direct key 0/1(2/3) will be ignored
22 *
23 * 3. rotary can be either interpreted as a relative input event (e.g.
24 * REL_WHEEL/REL_HWHEEL) or specific keys (e.g. UP/DOWN/LEFT/RIGHT)
25 *
26 * 4. matrix key and direct key will use the same debounce_interval by
27 * default, which should be sufficient in most cases
28 *
29 * pxa168 keypad platform specific parameter
30 *
31 * NOTE:
32 * clear_wakeup_event callback is a workaround required to clear the
33 * keypad interrupt. The keypad wake must be cleared in addition to
34 * reading the MI/DI bits in the KPC register.
35 */
36struct pxa27x_keypad_platform_data {
37
38 /* code map for the matrix keys */
39 unsigned int matrix_key_rows;
40 unsigned int matrix_key_cols;
41 unsigned int *matrix_key_map;
42 int matrix_key_map_size;
43
44 /* direct keys */
45 int direct_key_num;
46 unsigned int direct_key_map[MAX_DIRECT_KEY_NUM];
47 /* the key output may be low active */
48 int direct_key_low_active;
49 /* give board a chance to choose the start direct key */
50 unsigned int direct_key_mask;
51
52 /* rotary encoders 0 */
53 int enable_rotary0;
54 int rotary0_rel_code;
55 int rotary0_up_key;
56 int rotary0_down_key;
57
58 /* rotary encoders 1 */
59 int enable_rotary1;
60 int rotary1_rel_code;
61 int rotary1_up_key;
62 int rotary1_down_key;
63
64 /* key debounce interval */
65 unsigned int debounce_interval;
66
67 /* clear wakeup event requirement for pxa168 */
68 void (*clear_wakeup_event)(void);
69};
70
71extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info);
72
73#endif /* __ASM_ARCH_PXA27x_KEYPAD_H */
diff --git a/arch/arm/plat-pxa/include/plat/pxa3xx_nand.h b/arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
deleted file mode 100644
index c42f39f2019..00000000000
--- a/arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
+++ /dev/null
@@ -1,79 +0,0 @@
1#ifndef __ASM_ARCH_PXA3XX_NAND_H
2#define __ASM_ARCH_PXA3XX_NAND_H
3
4#include <linux/mtd/mtd.h>
5#include <linux/mtd/partitions.h>
6
7struct pxa3xx_nand_timing {
8 unsigned int tCH; /* Enable signal hold time */
9 unsigned int tCS; /* Enable signal setup time */
10 unsigned int tWH; /* ND_nWE high duration */
11 unsigned int tWP; /* ND_nWE pulse time */
12 unsigned int tRH; /* ND_nRE high duration */
13 unsigned int tRP; /* ND_nRE pulse width */
14 unsigned int tR; /* ND_nWE high to ND_nRE low for read */
15 unsigned int tWHR; /* ND_nWE high to ND_nRE low for status read */
16 unsigned int tAR; /* ND_ALE low to ND_nRE low delay */
17};
18
19struct pxa3xx_nand_cmdset {
20 uint16_t read1;
21 uint16_t read2;
22 uint16_t program;
23 uint16_t read_status;
24 uint16_t read_id;
25 uint16_t erase;
26 uint16_t reset;
27 uint16_t lock;
28 uint16_t unlock;
29 uint16_t lock_status;
30};
31
32struct pxa3xx_nand_flash {
33 char *name;
34 uint32_t chip_id;
35 unsigned int page_per_block; /* Pages per block (PG_PER_BLK) */
36 unsigned int page_size; /* Page size in bytes (PAGE_SZ) */
37 unsigned int flash_width; /* Width of Flash memory (DWIDTH_M) */
38 unsigned int dfc_width; /* Width of flash controller(DWIDTH_C) */
39 unsigned int num_blocks; /* Number of physical blocks in Flash */
40
41 struct pxa3xx_nand_timing *timing; /* NAND Flash timing */
42};
43
44/*
45 * Current pxa3xx_nand controller has two chip select which
46 * both be workable.
47 *
48 * Notice should be taken that:
49 * When you want to use this feature, you should not enable the
50 * keep configuration feature, for two chip select could be
51 * attached with different nand chip. The different page size
52 * and timing requirement make the keep configuration impossible.
53 */
54
55/* The max num of chip select current support */
56#define NUM_CHIP_SELECT (2)
57struct pxa3xx_nand_platform_data {
58
59 /* the data flash bus is shared between the Static Memory
60 * Controller and the Data Flash Controller, the arbiter
61 * controls the ownership of the bus
62 */
63 int enable_arbiter;
64
65 /* allow platform code to keep OBM/bootloader defined NFC config */
66 int keep_config;
67
68 /* indicate how many chip selects will be used */
69 int num_cs;
70
71 const struct mtd_partition *parts[NUM_CHIP_SELECT];
72 unsigned int nr_parts[NUM_CHIP_SELECT];
73
74 const struct pxa3xx_nand_flash * flash;
75 size_t num_flash;
76};
77
78extern void pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info);
79#endif /* __ASM_ARCH_PXA3XX_NAND_H */
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index 21bf6adb919..eef3b6a2f8a 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -6,8 +6,8 @@ config PLAT_S3C24XX
6 bool 6 bool
7 depends on ARCH_S3C24XX 7 depends on ARCH_S3C24XX
8 default y 8 default y
9 select NO_IOPORT
10 select ARCH_REQUIRE_GPIOLIB 9 select ARCH_REQUIRE_GPIOLIB
10 select NO_IOPORT
11 select S3C_DEV_NAND 11 select S3C_DEV_NAND
12 help 12 help
13 Base platform code for any Samsung S3C24XX device 13 Base platform code for any Samsung S3C24XX device
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 9c3b90c3538..59401e1cc53 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -7,9 +7,9 @@
7config PLAT_SAMSUNG 7config PLAT_SAMSUNG
8 bool 8 bool
9 depends on PLAT_S3C24XX || ARCH_S3C64XX || PLAT_S5P 9 depends on PLAT_S3C24XX || ARCH_S3C64XX || PLAT_S5P
10 select NO_IOPORT
11 select GENERIC_IRQ_CHIP
12 default y 10 default y
11 select GENERIC_IRQ_CHIP
12 select NO_IOPORT
13 help 13 help
14 Base platform code for all Samsung SoC based systems 14 Base platform code for all Samsung SoC based systems
15 15
@@ -17,16 +17,16 @@ config PLAT_S5P
17 bool 17 bool
18 depends on (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS) 18 depends on (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS)
19 default y 19 default y
20 select ARM_VIC if !ARCH_EXYNOS 20 select ARCH_REQUIRE_GPIOLIB
21 select ARM_GIC if ARCH_EXYNOS 21 select ARM_GIC if ARCH_EXYNOS
22 select ARM_VIC if !ARCH_EXYNOS
22 select GIC_NON_BANKED if ARCH_EXYNOS4 23 select GIC_NON_BANKED if ARCH_EXYNOS4
23 select NO_IOPORT 24 select NO_IOPORT
24 select ARCH_REQUIRE_GPIOLIB 25 select PLAT_SAMSUNG
25 select S3C_GPIO_TRACK 26 select S3C_GPIO_TRACK
26 select S5P_GPIO_DRVSTR 27 select S5P_GPIO_DRVSTR
27 select SAMSUNG_GPIOLIB_4BIT
28 select PLAT_SAMSUNG
29 select SAMSUNG_CLKSRC 28 select SAMSUNG_CLKSRC
29 select SAMSUNG_GPIOLIB_4BIT
30 select SAMSUNG_IRQ_VIC_TIMER 30 select SAMSUNG_IRQ_VIC_TIMER
31 help 31 help
32 Base platform code for Samsung's S5P series SoC. 32 Base platform code for Samsung's S5P series SoC.
@@ -423,10 +423,10 @@ config S3C_DMA
423 423
424config SAMSUNG_DMADEV 424config SAMSUNG_DMADEV
425 bool 425 bool
426 select ARM_AMBA
426 select DMADEVICES 427 select DMADEVICES
427 select PL330_DMA if (ARCH_EXYNOS5 || ARCH_EXYNOS4 || CPU_S5PV210 || CPU_S5PC100 || \ 428 select PL330_DMA if (ARCH_EXYNOS5 || ARCH_EXYNOS4 || CPU_S5PV210 || CPU_S5PC100 || \
428 CPU_S5P6450 || CPU_S5P6440) 429 CPU_S5P6450 || CPU_S5P6440)
429 select ARM_AMBA
430 help 430 help
431 Use DMA device engine for PL330 DMAC. 431 Use DMA device engine for PL330 DMAC.
432 432
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
index 65c5eca475e..012bbd0b8d8 100644
--- a/arch/arm/plat-samsung/clock.c
+++ b/arch/arm/plat-samsung/clock.c
@@ -119,7 +119,7 @@ void clk_disable(struct clk *clk)
119 119
120unsigned long clk_get_rate(struct clk *clk) 120unsigned long clk_get_rate(struct clk *clk)
121{ 121{
122 if (IS_ERR(clk)) 122 if (IS_ERR_OR_NULL(clk))
123 return 0; 123 return 0;
124 124
125 if (clk->rate != 0) 125 if (clk->rate != 0)
@@ -136,7 +136,7 @@ unsigned long clk_get_rate(struct clk *clk)
136 136
137long clk_round_rate(struct clk *clk, unsigned long rate) 137long clk_round_rate(struct clk *clk, unsigned long rate)
138{ 138{
139 if (!IS_ERR(clk) && clk->ops && clk->ops->round_rate) 139 if (!IS_ERR_OR_NULL(clk) && clk->ops && clk->ops->round_rate)
140 return (clk->ops->round_rate)(clk, rate); 140 return (clk->ops->round_rate)(clk, rate);
141 141
142 return rate; 142 return rate;
@@ -144,9 +144,10 @@ long clk_round_rate(struct clk *clk, unsigned long rate)
144 144
145int clk_set_rate(struct clk *clk, unsigned long rate) 145int clk_set_rate(struct clk *clk, unsigned long rate)
146{ 146{
147 unsigned long flags;
147 int ret; 148 int ret;
148 149
149 if (IS_ERR(clk)) 150 if (IS_ERR_OR_NULL(clk))
150 return -EINVAL; 151 return -EINVAL;
151 152
152 /* We do not default just do a clk->rate = rate as 153 /* We do not default just do a clk->rate = rate as
@@ -159,9 +160,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
159 if (clk->ops == NULL || clk->ops->set_rate == NULL) 160 if (clk->ops == NULL || clk->ops->set_rate == NULL)
160 return -EINVAL; 161 return -EINVAL;
161 162
162 spin_lock(&clocks_lock); 163 spin_lock_irqsave(&clocks_lock, flags);
163 ret = (clk->ops->set_rate)(clk, rate); 164 ret = (clk->ops->set_rate)(clk, rate);
164 spin_unlock(&clocks_lock); 165 spin_unlock_irqrestore(&clocks_lock, flags);
165 166
166 return ret; 167 return ret;
167} 168}
@@ -173,17 +174,18 @@ struct clk *clk_get_parent(struct clk *clk)
173 174
174int clk_set_parent(struct clk *clk, struct clk *parent) 175int clk_set_parent(struct clk *clk, struct clk *parent)
175{ 176{
177 unsigned long flags;
176 int ret = 0; 178 int ret = 0;
177 179
178 if (IS_ERR(clk)) 180 if (IS_ERR_OR_NULL(clk) || IS_ERR_OR_NULL(parent))
179 return -EINVAL; 181 return -EINVAL;
180 182
181 spin_lock(&clocks_lock); 183 spin_lock_irqsave(&clocks_lock, flags);
182 184
183 if (clk->ops && clk->ops->set_parent) 185 if (clk->ops && clk->ops->set_parent)
184 ret = (clk->ops->set_parent)(clk, parent); 186 ret = (clk->ops->set_parent)(clk, parent);
185 187
186 spin_unlock(&clocks_lock); 188 spin_unlock_irqrestore(&clocks_lock, flags);
187 189
188 return ret; 190 return ret;
189} 191}
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index fc49f3dabd7..03f654d55ef 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -35,7 +35,6 @@
35#include <media/s5p_hdmi.h> 35#include <media/s5p_hdmi.h>
36 36
37#include <asm/irq.h> 37#include <asm/irq.h>
38#include <asm/pmu.h>
39#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
40#include <asm/mach/map.h> 39#include <asm/mach/map.h>
41#include <asm/mach/irq.h> 40#include <asm/mach/irq.h>
@@ -48,24 +47,25 @@
48#include <plat/cpu.h> 47#include <plat/cpu.h>
49#include <plat/devs.h> 48#include <plat/devs.h>
50#include <plat/adc.h> 49#include <plat/adc.h>
51#include <plat/ata.h> 50#include <linux/platform_data/ata-samsung_cf.h>
52#include <plat/ehci.h> 51#include <linux/platform_data/usb-ehci-s5p.h>
53#include <plat/fb.h> 52#include <plat/fb.h>
54#include <plat/fb-s3c2410.h> 53#include <plat/fb-s3c2410.h>
55#include <plat/hwmon.h> 54#include <plat/hdmi.h>
56#include <plat/iic.h> 55#include <linux/platform_data/hwmon-s3c.h>
56#include <linux/platform_data/i2c-s3c2410.h>
57#include <plat/keypad.h> 57#include <plat/keypad.h>
58#include <plat/mci.h> 58#include <linux/platform_data/mmc-s3cmci.h>
59#include <plat/nand.h> 59#include <linux/platform_data/mtd-nand-s3c2410.h>
60#include <plat/sdhci.h> 60#include <plat/sdhci.h>
61#include <plat/ts.h> 61#include <linux/platform_data/touchscreen-s3c2410.h>
62#include <plat/udc.h> 62#include <linux/platform_data/usb-s3c2410_udc.h>
63#include <plat/usb-control.h> 63#include <linux/platform_data/usb-ohci-s3c2410.h>
64#include <plat/usb-phy.h> 64#include <plat/usb-phy.h>
65#include <plat/regs-iic.h> 65#include <plat/regs-iic.h>
66#include <plat/regs-serial.h> 66#include <plat/regs-serial.h>
67#include <plat/regs-spi.h> 67#include <plat/regs-spi.h>
68#include <plat/s3c64xx-spi.h> 68#include <linux/platform_data/spi-s3c64xx.h>
69 69
70static u64 samsung_device_dma_mask = DMA_BIT_MASK(32); 70static u64 samsung_device_dma_mask = DMA_BIT_MASK(32);
71 71
@@ -763,7 +763,7 @@ void __init s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *pd)
763 &s5p_device_i2c_hdmiphy); 763 &s5p_device_i2c_hdmiphy);
764} 764}
765 765
766struct s5p_hdmi_platform_data s5p_hdmi_def_platdata; 766static struct s5p_hdmi_platform_data s5p_hdmi_def_platdata;
767 767
768void __init s5p_hdmi_set_platdata(struct i2c_board_info *hdmiphy_info, 768void __init s5p_hdmi_set_platdata(struct i2c_board_info *hdmiphy_info,
769 struct i2c_board_info *mhl_info, int mhl_bus) 769 struct i2c_board_info *mhl_info, int mhl_bus)
@@ -1132,7 +1132,7 @@ static struct resource s5p_pmu_resource[] = {
1132 1132
1133static struct platform_device s5p_device_pmu = { 1133static struct platform_device s5p_device_pmu = {
1134 .name = "arm-pmu", 1134 .name = "arm-pmu",
1135 .id = ARM_PMU_DEVICE_CPU, 1135 .id = -1,
1136 .num_resources = ARRAY_SIZE(s5p_pmu_resource), 1136 .num_resources = ARRAY_SIZE(s5p_pmu_resource),
1137 .resource = s5p_pmu_resource, 1137 .resource = s5p_pmu_resource,
1138}; 1138};
@@ -1591,6 +1591,8 @@ struct platform_device s3c64xx_device_spi1 = {
1591void __init s3c64xx_spi1_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, 1591void __init s3c64xx_spi1_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
1592 int num_cs) 1592 int num_cs)
1593{ 1593{
1594 struct s3c64xx_spi_info pd;
1595
1594 /* Reject invalid configuration */ 1596 /* Reject invalid configuration */
1595 if (!num_cs || src_clk_nr < 0) { 1597 if (!num_cs || src_clk_nr < 0) {
1596 pr_err("%s: Invalid SPI configuration\n", __func__); 1598 pr_err("%s: Invalid SPI configuration\n", __func__);
diff --git a/arch/arm/plat-samsung/dma-ops.c b/arch/arm/plat-samsung/dma-ops.c
index c38d7548924..d088afa034e 100644
--- a/arch/arm/plat-samsung/dma-ops.c
+++ b/arch/arm/plat-samsung/dma-ops.c
@@ -91,7 +91,8 @@ static int samsung_dmadev_prepare(unsigned ch,
91 break; 91 break;
92 case DMA_CYCLIC: 92 case DMA_CYCLIC:
93 desc = dmaengine_prep_dma_cyclic(chan, param->buf, 93 desc = dmaengine_prep_dma_cyclic(chan, param->buf,
94 param->len, param->period, param->direction); 94 param->len, param->period, param->direction,
95 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
95 break; 96 break;
96 default: 97 default:
97 dev_err(&chan->dev->device, "unsupported format\n"); 98 dev_err(&chan->dev->device, "unsupported format\n");
diff --git a/arch/arm/plat-samsung/include/plat/ata.h b/arch/arm/plat-samsung/include/plat/ata.h
deleted file mode 100644
index 2a3855a8372..00000000000
--- a/arch/arm/plat-samsung/include/plat/ata.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/* linux/arch/arm/plat-samsung/include/plat/ata.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Samsung CF-ATA platform_device info
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_PLAT_ATA_H
14#define __ASM_PLAT_ATA_H __FILE__
15
16/**
17 * struct s3c_ide_platdata - S3C IDE driver platform data.
18 * @setup_gpio: Setup the external GPIO pins to the right state for data
19 * transfer in true-ide mode.
20 */
21struct s3c_ide_platdata {
22 void (*setup_gpio)(void);
23};
24
25/*
26 * s3c_ide_set_platdata() - Setup the platform specifc data for IDE driver.
27 * @pdata: Platform data for IDE driver.
28 */
29extern void s3c_ide_set_platdata(struct s3c_ide_platdata *pdata);
30
31/* architecture-specific IDE configuration */
32extern void s3c64xx_ide_setup_gpio(void);
33extern void s5pc100_ide_setup_gpio(void);
34extern void s5pv210_ide_setup_gpio(void);
35
36#endif /*__ASM_PLAT_ATA_H */
diff --git a/arch/arm/plat-samsung/include/plat/audio-simtec.h b/arch/arm/plat-samsung/include/plat/audio-simtec.h
deleted file mode 100644
index 376af5286a3..00000000000
--- a/arch/arm/plat-samsung/include/plat/audio-simtec.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/* arch/arm/plat-samsung/include/plat/audio-simtec.h
2 *
3 * Copyright 2008 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 * Simtec Audio support.
12*/
13
14/**
15 * struct s3c24xx_audio_simtec_pdata - platform data for simtec audio
16 * @use_mpllin: Select codec clock from MPLLin
17 * @output_cdclk: Need to output CDCLK to the codec
18 * @have_mic: Set if we have a MIC socket
19 * @have_lout: Set if we have a LineOut socket
20 * @amp_gpio: GPIO pin to enable the AMP
21 * @amp_gain: Option GPIO to control AMP gain
22 */
23struct s3c24xx_audio_simtec_pdata {
24 unsigned int use_mpllin:1;
25 unsigned int output_cdclk:1;
26
27 unsigned int have_mic:1;
28 unsigned int have_lout:1;
29
30 int amp_gpio;
31 int amp_gain[2];
32
33 void (*startup)(void);
34};
diff --git a/arch/arm/plat-samsung/include/plat/audio.h b/arch/arm/plat-samsung/include/plat/audio.h
deleted file mode 100644
index aa9875f77c4..00000000000
--- a/arch/arm/plat-samsung/include/plat/audio.h
+++ /dev/null
@@ -1,59 +0,0 @@
1/* arch/arm/plat-samsung/include/plat/audio.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co. Ltd
4 * Author: Jaswinder Singh <jassi.brar@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/* The machine init code calls s3c*_ac97_setup_gpio with
12 * one of these defines in order to select appropriate bank
13 * of GPIO for AC97 pins
14 */
15#define S3C64XX_AC97_GPD 0
16#define S3C64XX_AC97_GPE 1
17extern void s3c64xx_ac97_setup_gpio(int);
18
19/*
20 * The machine init code calls s5p*_spdif_setup_gpio with
21 * one of these defines in order to select appropriate bank
22 * of GPIO for S/PDIF pins
23 */
24#define S5PC100_SPDIF_GPD 0
25#define S5PC100_SPDIF_GPG3 1
26extern void s5pc100_spdif_setup_gpio(int);
27
28struct samsung_i2s {
29/* If the Primary DAI has 5.1 Channels */
30#define QUIRK_PRI_6CHAN (1 << 0)
31/* If the I2S block has a Stereo Overlay Channel */
32#define QUIRK_SEC_DAI (1 << 1)
33/*
34 * If the I2S block has no internal prescalar or MUX (I2SMOD[10] bit)
35 * The Machine driver must provide suitably set clock to the I2S block.
36 */
37#define QUIRK_NO_MUXPSR (1 << 2)
38#define QUIRK_NEED_RSTCLR (1 << 3)
39 /* Quirks of the I2S controller */
40 u32 quirks;
41
42 /*
43 * Array of clock names that can be used to generate I2S signals.
44 * Also corresponds to clocks of I2SMOD[10]
45 */
46 const char **src_clk;
47 dma_addr_t idma_addr;
48};
49
50/**
51 * struct s3c_audio_pdata - common platform data for audio device drivers
52 * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode
53 */
54struct s3c_audio_pdata {
55 int (*cfg_gpio)(struct platform_device *);
56 union {
57 struct samsung_i2s i2s;
58 } type;
59};
diff --git a/arch/arm/plat-samsung/include/plat/ehci.h b/arch/arm/plat-samsung/include/plat/ehci.h
deleted file mode 100644
index 5f28cae1858..00000000000
--- a/arch/arm/plat-samsung/include/plat/ehci.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co.Ltd
3 * Author: Joonyoung Shim <jy0922.shim@samsung.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __PLAT_SAMSUNG_EHCI_H
12#define __PLAT_SAMSUNG_EHCI_H __FILE__
13
14struct s5p_ehci_platdata {
15 int (*phy_init)(struct platform_device *pdev, int type);
16 int (*phy_exit)(struct platform_device *pdev, int type);
17};
18
19extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd);
20
21#endif /* __PLAT_SAMSUNG_EHCI_H */
diff --git a/arch/arm/plat-samsung/include/plat/gpio-fns.h b/arch/arm/plat-samsung/include/plat/gpio-fns.h
index bab13920176..d1ecef0e38e 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-fns.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-fns.h
@@ -1,98 +1 @@
1/* arch/arm/mach-s3c2410/include/mach/gpio-fns.h
2 *
3 * Copyright (c) 2003-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - hardware
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 __MACH_GPIO_FNS_H
14#define __MACH_GPIO_FNS_H __FILE__
15
16/* These functions are in the to-be-removed category and it is strongly
17 * encouraged not to use these in new code. They will be marked deprecated
18 * very soon.
19 *
20 * Most of the functionality can be either replaced by the gpiocfg calls
21 * for the s3c platform or by the generic GPIOlib API.
22 *
23 * As of 2.6.35-rc, these will be removed, with the few drivers using them
24 * either replaced or given a wrapper until the calls can be removed.
25*/
26
27#include <plat/gpio-cfg.h> #include <plat/gpio-cfg.h>
28
29static inline void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int cfg)
30{
31 /* 1:1 mapping between cfgpin and setcfg calls at the moment */
32 s3c_gpio_cfgpin(pin, cfg);
33}
34
35/* external functions for GPIO support
36 *
37 * These allow various different clients to access the same GPIO
38 * registers without conflicting. If your driver only owns the entire
39 * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
40*/
41
42extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
43
44/* s3c2410_gpio_getirq
45 *
46 * turn the given pin number into the corresponding IRQ number
47 *
48 * returns:
49 * < 0 = no interrupt for this pin
50 * >=0 = interrupt number for the pin
51*/
52
53extern int s3c2410_gpio_getirq(unsigned int pin);
54
55/* s3c2410_gpio_irqfilter
56 *
57 * set the irq filtering on the given pin
58 *
59 * on = 0 => disable filtering
60 * 1 => enable filtering
61 *
62 * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
63 * width of filter (0 through 63)
64 *
65 *
66*/
67
68extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
69 unsigned int config);
70
71/* s3c2410_gpio_pullup
72 *
73 * This call should be replaced with s3c_gpio_setpull().
74 *
75 * As a note, there is currently no distinction between pull-up and pull-down
76 * in the s3c24xx series devices with only an on/off configuration.
77 */
78
79/* s3c2410_gpio_pullup
80 *
81 * configure the pull-up control on the given pin
82 *
83 * to = 1 => disable the pull-up
84 * 0 => enable the pull-up
85 *
86 * eg;
87 *
88 * s3c2410_gpio_pullup(S3C2410_GPB(0), 0);
89 * s3c2410_gpio_pullup(S3C2410_GPE(8), 0);
90*/
91
92extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
93
94extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
95
96extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
97
98#endif /* __MACH_GPIO_FNS_H */
diff --git a/arch/arm/plat-samsung/include/plat/hwmon.h b/arch/arm/plat-samsung/include/plat/hwmon.h
deleted file mode 100644
index c167e4429bc..00000000000
--- a/arch/arm/plat-samsung/include/plat/hwmon.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/* linux/arch/arm/plat-s3c/include/plat/hwmon.h
2 *
3 * Copyright 2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C - HWMon interface for ADC
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_ADC_HWMON_H
15#define __ASM_ARCH_ADC_HWMON_H __FILE__
16
17/**
18 * s3c_hwmon_chcfg - channel configuration
19 * @name: The name to give this channel.
20 * @mult: Multiply the ADC value read by this.
21 * @div: Divide the value from the ADC by this.
22 *
23 * The value read from the ADC is converted to a value that
24 * hwmon expects (mV) by result = (value_read * @mult) / @div.
25 */
26struct s3c_hwmon_chcfg {
27 const char *name;
28 unsigned int mult;
29 unsigned int div;
30};
31
32/**
33 * s3c_hwmon_pdata - HWMON platform data
34 * @in: One configuration for each possible channel used.
35 */
36struct s3c_hwmon_pdata {
37 struct s3c_hwmon_chcfg *in[8];
38};
39
40/**
41 * s3c_hwmon_set_platdata - Set platform data for S3C HWMON device
42 * @pd: Platform data to register to device.
43 *
44 * Register the given platform data for use with the S3C HWMON device.
45 * The call will copy the platform data, so the board definitions can
46 * make the structure itself __initdata.
47 */
48extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd);
49
50#endif /* __ASM_ARCH_ADC_HWMON_H */
51
diff --git a/arch/arm/plat-samsung/include/plat/iic.h b/arch/arm/plat-samsung/include/plat/iic.h
deleted file mode 100644
index 51d52e767a1..00000000000
--- a/arch/arm/plat-samsung/include/plat/iic.h
+++ /dev/null
@@ -1,77 +0,0 @@
1/* arch/arm/plat-s3c/include/plat/iic.h
2 *
3 * Copyright 2004-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C - I2C Controller platform_device info
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_IIC_H
14#define __ASM_ARCH_IIC_H __FILE__
15
16#define S3C_IICFLG_FILTER (1<<0) /* enable s3c2440 filter */
17
18/**
19 * struct s3c2410_platform_i2c - Platform data for s3c I2C.
20 * @bus_num: The bus number to use (if possible).
21 * @flags: Any flags for the I2C bus (E.g. S3C_IICFLK_FILTER).
22 * @slave_addr: The I2C address for the slave device (if enabled).
23 * @frequency: The desired frequency in Hz of the bus. This is
24 * guaranteed to not be exceeded. If the caller does
25 * not care, use zero and the driver will select a
26 * useful default.
27 * @sda_delay: The delay (in ns) applied to SDA edges.
28 * @cfg_gpio: A callback to configure the pins for I2C operation.
29 */
30struct s3c2410_platform_i2c {
31 int bus_num;
32 unsigned int flags;
33 unsigned int slave_addr;
34 unsigned long frequency;
35 unsigned int sda_delay;
36
37 void (*cfg_gpio)(struct platform_device *dev);
38};
39
40/**
41 * s3c_i2c0_set_platdata - set platform data for i2c0 device
42 * @i2c: The platform data to set, or NULL for default data.
43 *
44 * Register the given platform data for use with the i2c0 device. This
45 * call copies the platform data, so the caller can use __initdata for
46 * their copy.
47 *
48 * This call will set cfg_gpio if is null to the default platform
49 * implementation.
50 *
51 * Any user of s3c_device_i2c0 should call this, even if it is with
52 * NULL to ensure that the device is given the default platform data
53 * as the driver will no longer carry defaults.
54 */
55extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c);
56extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c);
57extern void s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *i2c);
58extern void s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *i2c);
59extern void s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *i2c);
60extern void s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *i2c);
61extern void s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *i2c);
62extern void s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *i2c);
63extern void s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *i2c);
64
65/* defined by architecture to configure gpio */
66extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
67extern void s3c_i2c1_cfg_gpio(struct platform_device *dev);
68extern void s3c_i2c2_cfg_gpio(struct platform_device *dev);
69extern void s3c_i2c3_cfg_gpio(struct platform_device *dev);
70extern void s3c_i2c4_cfg_gpio(struct platform_device *dev);
71extern void s3c_i2c5_cfg_gpio(struct platform_device *dev);
72extern void s3c_i2c6_cfg_gpio(struct platform_device *dev);
73extern void s3c_i2c7_cfg_gpio(struct platform_device *dev);
74
75extern struct s3c2410_platform_i2c default_i2c_data;
76
77#endif /* __ASM_ARCH_IIC_H */
diff --git a/arch/arm/plat-samsung/include/plat/mci.h b/arch/arm/plat-samsung/include/plat/mci.h
deleted file mode 100644
index c42d3171194..00000000000
--- a/arch/arm/plat-samsung/include/plat/mci.h
+++ /dev/null
@@ -1,52 +0,0 @@
1#ifndef _ARCH_MCI_H
2#define _ARCH_MCI_H
3
4/**
5 * struct s3c24xx_mci_pdata - sd/mmc controller platform data
6 * @no_wprotect: Set this to indicate there is no write-protect switch.
7 * @no_detect: Set this if there is no detect switch.
8 * @wprotect_invert: Invert the default sense of the write protect switch.
9 * @detect_invert: Invert the default sense of the write protect switch.
10 * @use_dma: Set to allow the use of DMA.
11 * @gpio_detect: GPIO number for the card detect line.
12 * @gpio_wprotect: GPIO number for the write protect line.
13 * @ocr_avail: The mask of the available power states, non-zero to use.
14 * @set_power: Callback to control the power mode.
15 *
16 * The @gpio_detect is used for card detection when @no_wprotect is unset,
17 * and the default sense is that 0 returned from gpio_get_value() means
18 * that a card is inserted. If @detect_invert is set, then the value from
19 * gpio_get_value() is inverted, which makes 1 mean card inserted.
20 *
21 * The driver will use @gpio_wprotect to signal whether the card is write
22 * protected if @no_wprotect is not set. A 0 returned from gpio_get_value()
23 * means the card is read/write, and 1 means read-only. The @wprotect_invert
24 * will invert the value returned from gpio_get_value().
25 *
26 * Card power is set by @ocr_availa, using MCC_VDD_ constants if it is set
27 * to a non-zero value, otherwise the default of 3.2-3.4V is used.
28 */
29struct s3c24xx_mci_pdata {
30 unsigned int no_wprotect:1;
31 unsigned int no_detect:1;
32 unsigned int wprotect_invert:1;
33 unsigned int detect_invert:1; /* set => detect active high */
34 unsigned int use_dma:1;
35
36 unsigned int gpio_detect;
37 unsigned int gpio_wprotect;
38 unsigned long ocr_avail;
39 void (*set_power)(unsigned char power_mode,
40 unsigned short vdd);
41};
42
43/**
44 * s3c24xx_mci_set_platdata - set platform data for mmc/sdi device
45 * @pdata: The platform data
46 *
47 * Copy the platform data supplied by @pdata so that this can be marked
48 * __initdata.
49 */
50extern void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata);
51
52#endif /* _ARCH_NCI_H */
diff --git a/arch/arm/plat-samsung/include/plat/mipi_csis.h b/arch/arm/plat-samsung/include/plat/mipi_csis.h
deleted file mode 100644
index c45b1e8d4c2..00000000000
--- a/arch/arm/plat-samsung/include/plat/mipi_csis.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
3 *
4 * S5P series MIPI CSI slave device support
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __PLAT_SAMSUNG_MIPI_CSIS_H_
12#define __PLAT_SAMSUNG_MIPI_CSIS_H_ __FILE__
13
14struct platform_device;
15
16/**
17 * struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver
18 * @clk_rate: bus clock frequency
19 * @lanes: number of data lanes used
20 * @alignment: data alignment in bits
21 * @hs_settle: HS-RX settle time
22 * @fixed_phy_vdd: false to enable external D-PHY regulator management in the
23 * driver or true in case this regulator has no enable function
24 * @phy_enable: pointer to a callback controlling D-PHY enable/reset
25 */
26struct s5p_platform_mipi_csis {
27 unsigned long clk_rate;
28 u8 lanes;
29 u8 alignment;
30 u8 hs_settle;
31 bool fixed_phy_vdd;
32 int (*phy_enable)(struct platform_device *pdev, bool on);
33};
34
35/**
36 * s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control
37 * @pdev: MIPI-CSIS platform device
38 * @on: true to enable D-PHY and deassert its reset
39 * false to disable D-PHY
40 */
41int s5p_csis_phy_enable(struct platform_device *pdev, bool on);
42
43#endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */
diff --git a/arch/arm/plat-samsung/include/plat/nand.h b/arch/arm/plat-samsung/include/plat/nand.h
deleted file mode 100644
index b64115fa93a..00000000000
--- a/arch/arm/plat-samsung/include/plat/nand.h
+++ /dev/null
@@ -1,67 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/nand.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - NAND device controller platform_device info
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/**
14 * struct s3c2410_nand_set - define a set of one or more nand chips
15 * @disable_ecc: Entirely disable ECC - Dangerous
16 * @flash_bbt: Openmoko u-boot can create a Bad Block Table
17 * Setting this flag will allow the kernel to
18 * look for it at boot time and also skip the NAND
19 * scan.
20 * @options: Default value to set into 'struct nand_chip' options.
21 * @nr_chips: Number of chips in this set
22 * @nr_partitions: Number of partitions pointed to by @partitions
23 * @name: Name of set (optional)
24 * @nr_map: Map for low-layer logical to physical chip numbers (option)
25 * @partitions: The mtd partition list
26 *
27 * define a set of one or more nand chips registered with an unique mtd. Also
28 * allows to pass flag to the underlying NAND layer. 'disable_ecc' will trigger
29 * a warning at boot time.
30 */
31struct s3c2410_nand_set {
32 unsigned int disable_ecc:1;
33 unsigned int flash_bbt:1;
34
35 unsigned int options;
36 int nr_chips;
37 int nr_partitions;
38 char *name;
39 int *nr_map;
40 struct mtd_partition *partitions;
41 struct nand_ecclayout *ecc_layout;
42};
43
44struct s3c2410_platform_nand {
45 /* timing information for controller, all times in nanoseconds */
46
47 int tacls; /* time for active CLE/ALE to nWE/nOE */
48 int twrph0; /* active time for nWE/nOE */
49 int twrph1; /* time for release CLE/ALE from nWE/nOE inactive */
50
51 unsigned int ignore_unset_ecc:1;
52
53 int nr_sets;
54 struct s3c2410_nand_set *sets;
55
56 void (*select_chip)(struct s3c2410_nand_set *,
57 int chip);
58};
59
60/**
61 * s3c_nand_set_platdata() - register NAND platform data.
62 * @nand: The NAND platform data to register with s3c_device_nand.
63 *
64 * This function copies the given NAND platform data, @nand and registers
65 * it with the s3c_device_nand. This allows @nand to be __initdata.
66*/
67extern void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand);
diff --git a/arch/arm/plat-samsung/include/plat/regs-fb-v4.h b/arch/arm/plat-samsung/include/plat/regs-fb-v4.h
deleted file mode 100644
index 4c3647f8005..00000000000
--- a/arch/arm/plat-samsung/include/plat/regs-fb-v4.h
+++ /dev/null
@@ -1,159 +0,0 @@
1/* arch/arm/plat-samsung/include/plat/regs-fb-v4.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 * S3C64XX - new-style framebuffer register definitions
9 *
10 * This is the register set for the new style framebuffer interface
11 * found from the S3C2443 onwards and specifically the S3C64XX series
12 * S3C6400 and S3C6410.
13 *
14 * The file contains the cpu specific items which change between whichever
15 * architecture is selected. See <plat/regs-fb.h> for the core definitions
16 * that are the same.
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License version 2 as
20 * published by the Free Software Foundation.
21*/
22
23/* include the core definitions here, in case we really do need to
24 * override them at a later date.
25*/
26
27#include <plat/regs-fb.h>
28
29#define S3C_FB_MAX_WIN (5) /* number of hardware windows available. */
30#define VIDCON1_FSTATUS_EVEN (1 << 15)
31
32/* Video timing controls */
33#define VIDTCON0 (0x10)
34#define VIDTCON1 (0x14)
35#define VIDTCON2 (0x18)
36
37/* Window position controls */
38
39#define WINCON(_win) (0x20 + ((_win) * 4))
40
41/* OSD1 and OSD4 do not have register D */
42
43#define VIDOSD_BASE (0x40)
44
45#define VIDINTCON0 (0x130)
46
47/* WINCONx */
48
49#define WINCONx_CSCWIDTH_MASK (0x3 << 26)
50#define WINCONx_CSCWIDTH_SHIFT (26)
51#define WINCONx_CSCWIDTH_WIDE (0x0 << 26)
52#define WINCONx_CSCWIDTH_NARROW (0x3 << 26)
53
54#define WINCONx_ENLOCAL (1 << 22)
55#define WINCONx_BUFSTATUS (1 << 21)
56#define WINCONx_BUFSEL (1 << 20)
57#define WINCONx_BUFAUTOEN (1 << 19)
58#define WINCONx_YCbCr (1 << 13)
59
60#define WINCON1_LOCALSEL_CAMIF (1 << 23)
61
62#define WINCON2_LOCALSEL_CAMIF (1 << 23)
63#define WINCON2_BLD_PIX (1 << 6)
64
65#define WINCON2_ALPHA_SEL (1 << 1)
66#define WINCON2_BPPMODE_MASK (0xf << 2)
67#define WINCON2_BPPMODE_SHIFT (2)
68#define WINCON2_BPPMODE_1BPP (0x0 << 2)
69#define WINCON2_BPPMODE_2BPP (0x1 << 2)
70#define WINCON2_BPPMODE_4BPP (0x2 << 2)
71#define WINCON2_BPPMODE_8BPP_1232 (0x4 << 2)
72#define WINCON2_BPPMODE_16BPP_565 (0x5 << 2)
73#define WINCON2_BPPMODE_16BPP_A1555 (0x6 << 2)
74#define WINCON2_BPPMODE_16BPP_I1555 (0x7 << 2)
75#define WINCON2_BPPMODE_18BPP_666 (0x8 << 2)
76#define WINCON2_BPPMODE_18BPP_A1665 (0x9 << 2)
77#define WINCON2_BPPMODE_19BPP_A1666 (0xa << 2)
78#define WINCON2_BPPMODE_24BPP_888 (0xb << 2)
79#define WINCON2_BPPMODE_24BPP_A1887 (0xc << 2)
80#define WINCON2_BPPMODE_25BPP_A1888 (0xd << 2)
81#define WINCON2_BPPMODE_28BPP_A4888 (0xd << 2)
82
83#define WINCON3_BLD_PIX (1 << 6)
84
85#define WINCON3_ALPHA_SEL (1 << 1)
86#define WINCON3_BPPMODE_MASK (0xf << 2)
87#define WINCON3_BPPMODE_SHIFT (2)
88#define WINCON3_BPPMODE_1BPP (0x0 << 2)
89#define WINCON3_BPPMODE_2BPP (0x1 << 2)
90#define WINCON3_BPPMODE_4BPP (0x2 << 2)
91#define WINCON3_BPPMODE_16BPP_565 (0x5 << 2)
92#define WINCON3_BPPMODE_16BPP_A1555 (0x6 << 2)
93#define WINCON3_BPPMODE_16BPP_I1555 (0x7 << 2)
94#define WINCON3_BPPMODE_18BPP_666 (0x8 << 2)
95#define WINCON3_BPPMODE_18BPP_A1665 (0x9 << 2)
96#define WINCON3_BPPMODE_19BPP_A1666 (0xa << 2)
97#define WINCON3_BPPMODE_24BPP_888 (0xb << 2)
98#define WINCON3_BPPMODE_24BPP_A1887 (0xc << 2)
99#define WINCON3_BPPMODE_25BPP_A1888 (0xd << 2)
100#define WINCON3_BPPMODE_28BPP_A4888 (0xd << 2)
101
102#define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5)
103#define VIDINTCON0_FIFIOSEL_WINDOW3 (0x20 << 5)
104#define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5)
105
106#define DITHMODE (0x170)
107#define WINxMAP(_win) (0x180 + ((_win) * 4))
108
109
110#define DITHMODE_R_POS_MASK (0x3 << 5)
111#define DITHMODE_R_POS_SHIFT (5)
112#define DITHMODE_R_POS_8BIT (0x0 << 5)
113#define DITHMODE_R_POS_6BIT (0x1 << 5)
114#define DITHMODE_R_POS_5BIT (0x2 << 5)
115
116#define DITHMODE_G_POS_MASK (0x3 << 3)
117#define DITHMODE_G_POS_SHIFT (3)
118#define DITHMODE_G_POS_8BIT (0x0 << 3)
119#define DITHMODE_G_POS_6BIT (0x1 << 3)
120#define DITHMODE_G_POS_5BIT (0x2 << 3)
121
122#define DITHMODE_B_POS_MASK (0x3 << 1)
123#define DITHMODE_B_POS_SHIFT (1)
124#define DITHMODE_B_POS_8BIT (0x0 << 1)
125#define DITHMODE_B_POS_6BIT (0x1 << 1)
126#define DITHMODE_B_POS_5BIT (0x2 << 1)
127
128#define DITHMODE_DITH_EN (1 << 0)
129
130#define WPALCON (0x1A0)
131
132/* Palette control */
133/* Note for S5PC100: you can still use those macros on WPALCON (aka WPALCON_L),
134 * but make sure that WPALCON_H W2PAL-W4PAL entries are zeroed out */
135#define WPALCON_W4PAL_16BPP_A555 (1 << 8)
136#define WPALCON_W3PAL_16BPP_A555 (1 << 7)
137#define WPALCON_W2PAL_16BPP_A555 (1 << 6)
138
139
140/* Notes on per-window bpp settings
141 *
142 * Value Win0 Win1 Win2 Win3 Win 4
143 * 0000 1(P) 1(P) 1(P) 1(P) 1(P)
144 * 0001 2(P) 2(P) 2(P) 2(P) 2(P)
145 * 0010 4(P) 4(P) 4(P) 4(P) -none-
146 * 0011 8(P) 8(P) -none- -none- -none-
147 * 0100 -none- 8(A232) 8(A232) -none- -none-
148 * 0101 16(565) 16(565) 16(565) 16(565) 16(565)
149 * 0110 -none- 16(A555) 16(A555) 16(A555) 16(A555)
150 * 0111 16(I555) 16(I565) 16(I555) 16(I555) 16(I555)
151 * 1000 18(666) 18(666) 18(666) 18(666) 18(666)
152 * 1001 -none- 18(A665) 18(A665) 18(A665) 16(A665)
153 * 1010 -none- 19(A666) 19(A666) 19(A666) 19(A666)
154 * 1011 24(888) 24(888) 24(888) 24(888) 24(888)
155 * 1100 -none- 24(A887) 24(A887) 24(A887) 24(A887)
156 * 1101 -none- 25(A888) 25(A888) 25(A888) 25(A888)
157 * 1110 -none- -none- -none- -none- -none-
158 * 1111 -none- -none- -none- -none- -none-
159*/
diff --git a/arch/arm/plat-samsung/include/plat/regs-fb.h b/arch/arm/plat-samsung/include/plat/regs-fb.h
deleted file mode 100644
index 9a78012d6f4..00000000000
--- a/arch/arm/plat-samsung/include/plat/regs-fb.h
+++ /dev/null
@@ -1,403 +0,0 @@
1/* arch/arm/plat-samsung/include/plat/regs-fb.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 * S3C Platform - new-style framebuffer register definitions
9 *
10 * This is the register set for the new style framebuffer interface
11 * found from the S3C2443 onwards into the S3C2416, S3C2450 and the
12 * S3C64XX series such as the S3C6400 and S3C6410.
13 *
14 * The file does not contain the cpu specific items which are based on
15 * whichever architecture is selected, it only contains the core of the
16 * register set. See <mach/regs-fb.h> to get the specifics.
17 *
18 * Note, we changed to using regs-fb.h as it avoids any clashes with
19 * the original regs-lcd.h so out of the way of regs-lcd.h as well as
20 * indicating the newer block is much more than just an LCD interface.
21 *
22 * This program is free software; you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License version 2 as
24 * published by the Free Software Foundation.
25*/
26
27/* Please do not include this file directly, use <mach/regs-fb.h> to
28 * ensure all the localised SoC support is included as necessary.
29*/
30
31/* VIDCON0 */
32
33#define VIDCON0 (0x00)
34#define VIDCON0_INTERLACE (1 << 29)
35#define VIDCON0_VIDOUT_MASK (0x3 << 26)
36#define VIDCON0_VIDOUT_SHIFT (26)
37#define VIDCON0_VIDOUT_RGB (0x0 << 26)
38#define VIDCON0_VIDOUT_TV (0x1 << 26)
39#define VIDCON0_VIDOUT_I80_LDI0 (0x2 << 26)
40#define VIDCON0_VIDOUT_I80_LDI1 (0x3 << 26)
41
42#define VIDCON0_L1_DATA_MASK (0x7 << 23)
43#define VIDCON0_L1_DATA_SHIFT (23)
44#define VIDCON0_L1_DATA_16BPP (0x0 << 23)
45#define VIDCON0_L1_DATA_18BPP16 (0x1 << 23)
46#define VIDCON0_L1_DATA_18BPP9 (0x2 << 23)
47#define VIDCON0_L1_DATA_24BPP (0x3 << 23)
48#define VIDCON0_L1_DATA_18BPP (0x4 << 23)
49#define VIDCON0_L1_DATA_16BPP8 (0x5 << 23)
50
51#define VIDCON0_L0_DATA_MASK (0x7 << 20)
52#define VIDCON0_L0_DATA_SHIFT (20)
53#define VIDCON0_L0_DATA_16BPP (0x0 << 20)
54#define VIDCON0_L0_DATA_18BPP16 (0x1 << 20)
55#define VIDCON0_L0_DATA_18BPP9 (0x2 << 20)
56#define VIDCON0_L0_DATA_24BPP (0x3 << 20)
57#define VIDCON0_L0_DATA_18BPP (0x4 << 20)
58#define VIDCON0_L0_DATA_16BPP8 (0x5 << 20)
59
60#define VIDCON0_PNRMODE_MASK (0x3 << 17)
61#define VIDCON0_PNRMODE_SHIFT (17)
62#define VIDCON0_PNRMODE_RGB (0x0 << 17)
63#define VIDCON0_PNRMODE_BGR (0x1 << 17)
64#define VIDCON0_PNRMODE_SERIAL_RGB (0x2 << 17)
65#define VIDCON0_PNRMODE_SERIAL_BGR (0x3 << 17)
66
67#define VIDCON0_CLKVALUP (1 << 16)
68#define VIDCON0_CLKVAL_F_MASK (0xff << 6)
69#define VIDCON0_CLKVAL_F_SHIFT (6)
70#define VIDCON0_CLKVAL_F_LIMIT (0xff)
71#define VIDCON0_CLKVAL_F(_x) ((_x) << 6)
72#define VIDCON0_VLCKFREE (1 << 5)
73#define VIDCON0_CLKDIR (1 << 4)
74
75#define VIDCON0_CLKSEL_MASK (0x3 << 2)
76#define VIDCON0_CLKSEL_SHIFT (2)
77#define VIDCON0_CLKSEL_HCLK (0x0 << 2)
78#define VIDCON0_CLKSEL_LCD (0x1 << 2)
79#define VIDCON0_CLKSEL_27M (0x3 << 2)
80
81#define VIDCON0_ENVID (1 << 1)
82#define VIDCON0_ENVID_F (1 << 0)
83
84#define VIDCON1 (0x04)
85#define VIDCON1_LINECNT_MASK (0x7ff << 16)
86#define VIDCON1_LINECNT_SHIFT (16)
87#define VIDCON1_LINECNT_GET(_v) (((_v) >> 16) & 0x7ff)
88#define VIDCON1_VSTATUS_MASK (0x3 << 13)
89#define VIDCON1_VSTATUS_SHIFT (13)
90#define VIDCON1_VSTATUS_VSYNC (0x0 << 13)
91#define VIDCON1_VSTATUS_BACKPORCH (0x1 << 13)
92#define VIDCON1_VSTATUS_ACTIVE (0x2 << 13)
93#define VIDCON1_VSTATUS_FRONTPORCH (0x0 << 13)
94#define VIDCON1_VCLK_MASK (0x3 << 9)
95#define VIDCON1_VCLK_HOLD (0x0 << 9)
96#define VIDCON1_VCLK_RUN (0x1 << 9)
97
98#define VIDCON1_INV_VCLK (1 << 7)
99#define VIDCON1_INV_HSYNC (1 << 6)
100#define VIDCON1_INV_VSYNC (1 << 5)
101#define VIDCON1_INV_VDEN (1 << 4)
102
103/* VIDCON2 */
104
105#define VIDCON2 (0x08)
106#define VIDCON2_EN601 (1 << 23)
107#define VIDCON2_TVFMTSEL_SW (1 << 14)
108
109#define VIDCON2_TVFMTSEL1_MASK (0x3 << 12)
110#define VIDCON2_TVFMTSEL1_SHIFT (12)
111#define VIDCON2_TVFMTSEL1_RGB (0x0 << 12)
112#define VIDCON2_TVFMTSEL1_YUV422 (0x1 << 12)
113#define VIDCON2_TVFMTSEL1_YUV444 (0x2 << 12)
114
115#define VIDCON2_ORGYCbCr (1 << 8)
116#define VIDCON2_YUVORDCrCb (1 << 7)
117
118/* PRTCON (S3C6410, S5PC100)
119 * Might not be present in the S3C6410 documentation,
120 * but tests prove it's there almost for sure; shouldn't hurt in any case.
121 */
122#define PRTCON (0x0c)
123#define PRTCON_PROTECT (1 << 11)
124
125/* VIDTCON0 */
126
127#define VIDTCON0_VBPDE_MASK (0xff << 24)
128#define VIDTCON0_VBPDE_SHIFT (24)
129#define VIDTCON0_VBPDE_LIMIT (0xff)
130#define VIDTCON0_VBPDE(_x) ((_x) << 24)
131
132#define VIDTCON0_VBPD_MASK (0xff << 16)
133#define VIDTCON0_VBPD_SHIFT (16)
134#define VIDTCON0_VBPD_LIMIT (0xff)
135#define VIDTCON0_VBPD(_x) ((_x) << 16)
136
137#define VIDTCON0_VFPD_MASK (0xff << 8)
138#define VIDTCON0_VFPD_SHIFT (8)
139#define VIDTCON0_VFPD_LIMIT (0xff)
140#define VIDTCON0_VFPD(_x) ((_x) << 8)
141
142#define VIDTCON0_VSPW_MASK (0xff << 0)
143#define VIDTCON0_VSPW_SHIFT (0)
144#define VIDTCON0_VSPW_LIMIT (0xff)
145#define VIDTCON0_VSPW(_x) ((_x) << 0)
146
147/* VIDTCON1 */
148
149#define VIDTCON1_VFPDE_MASK (0xff << 24)
150#define VIDTCON1_VFPDE_SHIFT (24)
151#define VIDTCON1_VFPDE_LIMIT (0xff)
152#define VIDTCON1_VFPDE(_x) ((_x) << 24)
153
154#define VIDTCON1_HBPD_MASK (0xff << 16)
155#define VIDTCON1_HBPD_SHIFT (16)
156#define VIDTCON1_HBPD_LIMIT (0xff)
157#define VIDTCON1_HBPD(_x) ((_x) << 16)
158
159#define VIDTCON1_HFPD_MASK (0xff << 8)
160#define VIDTCON1_HFPD_SHIFT (8)
161#define VIDTCON1_HFPD_LIMIT (0xff)
162#define VIDTCON1_HFPD(_x) ((_x) << 8)
163
164#define VIDTCON1_HSPW_MASK (0xff << 0)
165#define VIDTCON1_HSPW_SHIFT (0)
166#define VIDTCON1_HSPW_LIMIT (0xff)
167#define VIDTCON1_HSPW(_x) ((_x) << 0)
168
169#define VIDTCON2 (0x18)
170#define VIDTCON2_LINEVAL_E(_x) ((((_x) & 0x800) >> 11) << 23)
171#define VIDTCON2_LINEVAL_MASK (0x7ff << 11)
172#define VIDTCON2_LINEVAL_SHIFT (11)
173#define VIDTCON2_LINEVAL_LIMIT (0x7ff)
174#define VIDTCON2_LINEVAL(_x) (((_x) & 0x7ff) << 11)
175
176#define VIDTCON2_HOZVAL_E(_x) ((((_x) & 0x800) >> 11) << 22)
177#define VIDTCON2_HOZVAL_MASK (0x7ff << 0)
178#define VIDTCON2_HOZVAL_SHIFT (0)
179#define VIDTCON2_HOZVAL_LIMIT (0x7ff)
180#define VIDTCON2_HOZVAL(_x) (((_x) & 0x7ff) << 0)
181
182/* WINCONx */
183
184
185#define WINCONx_BITSWP (1 << 18)
186#define WINCONx_BYTSWP (1 << 17)
187#define WINCONx_HAWSWP (1 << 16)
188#define WINCONx_WSWP (1 << 15)
189#define WINCONx_BURSTLEN_MASK (0x3 << 9)
190#define WINCONx_BURSTLEN_SHIFT (9)
191#define WINCONx_BURSTLEN_16WORD (0x0 << 9)
192#define WINCONx_BURSTLEN_8WORD (0x1 << 9)
193#define WINCONx_BURSTLEN_4WORD (0x2 << 9)
194
195#define WINCONx_ENWIN (1 << 0)
196#define WINCON0_BPPMODE_MASK (0xf << 2)
197#define WINCON0_BPPMODE_SHIFT (2)
198#define WINCON0_BPPMODE_1BPP (0x0 << 2)
199#define WINCON0_BPPMODE_2BPP (0x1 << 2)
200#define WINCON0_BPPMODE_4BPP (0x2 << 2)
201#define WINCON0_BPPMODE_8BPP_PALETTE (0x3 << 2)
202#define WINCON0_BPPMODE_16BPP_565 (0x5 << 2)
203#define WINCON0_BPPMODE_16BPP_1555 (0x7 << 2)
204#define WINCON0_BPPMODE_18BPP_666 (0x8 << 2)
205#define WINCON0_BPPMODE_24BPP_888 (0xb << 2)
206
207#define WINCON1_BLD_PIX (1 << 6)
208
209#define WINCON1_ALPHA_SEL (1 << 1)
210#define WINCON1_BPPMODE_MASK (0xf << 2)
211#define WINCON1_BPPMODE_SHIFT (2)
212#define WINCON1_BPPMODE_1BPP (0x0 << 2)
213#define WINCON1_BPPMODE_2BPP (0x1 << 2)
214#define WINCON1_BPPMODE_4BPP (0x2 << 2)
215#define WINCON1_BPPMODE_8BPP_PALETTE (0x3 << 2)
216#define WINCON1_BPPMODE_8BPP_1232 (0x4 << 2)
217#define WINCON1_BPPMODE_16BPP_565 (0x5 << 2)
218#define WINCON1_BPPMODE_16BPP_A1555 (0x6 << 2)
219#define WINCON1_BPPMODE_16BPP_I1555 (0x7 << 2)
220#define WINCON1_BPPMODE_18BPP_666 (0x8 << 2)
221#define WINCON1_BPPMODE_18BPP_A1665 (0x9 << 2)
222#define WINCON1_BPPMODE_19BPP_A1666 (0xa << 2)
223#define WINCON1_BPPMODE_24BPP_888 (0xb << 2)
224#define WINCON1_BPPMODE_24BPP_A1887 (0xc << 2)
225#define WINCON1_BPPMODE_25BPP_A1888 (0xd << 2)
226#define WINCON1_BPPMODE_28BPP_A4888 (0xd << 2)
227
228/* S5PV210 */
229#define SHADOWCON (0x34)
230#define SHADOWCON_WINx_PROTECT(_win) (1 << (10 + (_win)))
231/* DMA channels (all windows) */
232#define SHADOWCON_CHx_ENABLE(_win) (1 << (_win))
233/* Local input channels (windows 0-2) */
234#define SHADOWCON_CHx_LOCAL_ENABLE(_win) (1 << (5 + (_win)))
235
236#define VIDOSDxA_TOPLEFT_X_E(_x) ((((_x) & 0x800) >> 11) << 23)
237#define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11)
238#define VIDOSDxA_TOPLEFT_X_SHIFT (11)
239#define VIDOSDxA_TOPLEFT_X_LIMIT (0x7ff)
240#define VIDOSDxA_TOPLEFT_X(_x) (((_x) & 0x7ff) << 11)
241
242#define VIDOSDxA_TOPLEFT_Y_E(_x) ((((_x) & 0x800) >> 11) << 22)
243#define VIDOSDxA_TOPLEFT_Y_MASK (0x7ff << 0)
244#define VIDOSDxA_TOPLEFT_Y_SHIFT (0)
245#define VIDOSDxA_TOPLEFT_Y_LIMIT (0x7ff)
246#define VIDOSDxA_TOPLEFT_Y(_x) (((_x) & 0x7ff) << 0)
247
248#define VIDOSDxB_BOTRIGHT_X_E(_x) ((((_x) & 0x800) >> 11) << 23)
249#define VIDOSDxB_BOTRIGHT_X_MASK (0x7ff << 11)
250#define VIDOSDxB_BOTRIGHT_X_SHIFT (11)
251#define VIDOSDxB_BOTRIGHT_X_LIMIT (0x7ff)
252#define VIDOSDxB_BOTRIGHT_X(_x) (((_x) & 0x7ff) << 11)
253
254#define VIDOSDxB_BOTRIGHT_Y_E(_x) ((((_x) & 0x800) >> 11) << 22)
255#define VIDOSDxB_BOTRIGHT_Y_MASK (0x7ff << 0)
256#define VIDOSDxB_BOTRIGHT_Y_SHIFT (0)
257#define VIDOSDxB_BOTRIGHT_Y_LIMIT (0x7ff)
258#define VIDOSDxB_BOTRIGHT_Y(_x) (((_x) & 0x7ff) << 0)
259
260/* For VIDOSD[1..4]C */
261#define VIDISD14C_ALPHA0_R(_x) ((_x) << 20)
262#define VIDISD14C_ALPHA0_G_MASK (0xf << 16)
263#define VIDISD14C_ALPHA0_G_SHIFT (16)
264#define VIDISD14C_ALPHA0_G_LIMIT (0xf)
265#define VIDISD14C_ALPHA0_G(_x) ((_x) << 16)
266#define VIDISD14C_ALPHA0_B_MASK (0xf << 12)
267#define VIDISD14C_ALPHA0_B_SHIFT (12)
268#define VIDISD14C_ALPHA0_B_LIMIT (0xf)
269#define VIDISD14C_ALPHA0_B(_x) ((_x) << 12)
270#define VIDISD14C_ALPHA1_R_MASK (0xf << 8)
271#define VIDISD14C_ALPHA1_R_SHIFT (8)
272#define VIDISD14C_ALPHA1_R_LIMIT (0xf)
273#define VIDISD14C_ALPHA1_R(_x) ((_x) << 8)
274#define VIDISD14C_ALPHA1_G_MASK (0xf << 4)
275#define VIDISD14C_ALPHA1_G_SHIFT (4)
276#define VIDISD14C_ALPHA1_G_LIMIT (0xf)
277#define VIDISD14C_ALPHA1_G(_x) ((_x) << 4)
278#define VIDISD14C_ALPHA1_B_MASK (0xf << 0)
279#define VIDISD14C_ALPHA1_B_SHIFT (0)
280#define VIDISD14C_ALPHA1_B_LIMIT (0xf)
281#define VIDISD14C_ALPHA1_B(_x) ((_x) << 0)
282
283/* Video buffer addresses */
284#define VIDW_BUF_START(_buff) (0xA0 + ((_buff) * 8))
285#define VIDW_BUF_START1(_buff) (0xA4 + ((_buff) * 8))
286#define VIDW_BUF_END(_buff) (0xD0 + ((_buff) * 8))
287#define VIDW_BUF_END1(_buff) (0xD4 + ((_buff) * 8))
288#define VIDW_BUF_SIZE(_buff) (0x100 + ((_buff) * 4))
289
290#define VIDW_BUF_SIZE_OFFSET_E(_x) ((((_x) & 0x2000) >> 13) << 27)
291#define VIDW_BUF_SIZE_OFFSET_MASK (0x1fff << 13)
292#define VIDW_BUF_SIZE_OFFSET_SHIFT (13)
293#define VIDW_BUF_SIZE_OFFSET_LIMIT (0x1fff)
294#define VIDW_BUF_SIZE_OFFSET(_x) (((_x) & 0x1fff) << 13)
295
296#define VIDW_BUF_SIZE_PAGEWIDTH_E(_x) ((((_x) & 0x2000) >> 13) << 26)
297#define VIDW_BUF_SIZE_PAGEWIDTH_MASK (0x1fff << 0)
298#define VIDW_BUF_SIZE_PAGEWIDTH_SHIFT (0)
299#define VIDW_BUF_SIZE_PAGEWIDTH_LIMIT (0x1fff)
300#define VIDW_BUF_SIZE_PAGEWIDTH(_x) (((_x) & 0x1fff) << 0)
301
302/* Interrupt controls and status */
303
304#define VIDINTCON0_FIFOINTERVAL_MASK (0x3f << 20)
305#define VIDINTCON0_FIFOINTERVAL_SHIFT (20)
306#define VIDINTCON0_FIFOINTERVAL_LIMIT (0x3f)
307#define VIDINTCON0_FIFOINTERVAL(_x) ((_x) << 20)
308
309#define VIDINTCON0_INT_SYSMAINCON (1 << 19)
310#define VIDINTCON0_INT_SYSSUBCON (1 << 18)
311#define VIDINTCON0_INT_I80IFDONE (1 << 17)
312
313#define VIDINTCON0_FRAMESEL0_MASK (0x3 << 15)
314#define VIDINTCON0_FRAMESEL0_SHIFT (15)
315#define VIDINTCON0_FRAMESEL0_BACKPORCH (0x0 << 15)
316#define VIDINTCON0_FRAMESEL0_VSYNC (0x1 << 15)
317#define VIDINTCON0_FRAMESEL0_ACTIVE (0x2 << 15)
318#define VIDINTCON0_FRAMESEL0_FRONTPORCH (0x3 << 15)
319
320#define VIDINTCON0_FRAMESEL1 (1 << 13)
321#define VIDINTCON0_FRAMESEL1_MASK (0x3 << 13)
322#define VIDINTCON0_FRAMESEL1_NONE (0x0 << 13)
323#define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 13)
324#define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 13)
325#define VIDINTCON0_FRAMESEL1_FRONTPORCH (0x3 << 13)
326
327#define VIDINTCON0_INT_FRAME (1 << 12)
328#define VIDINTCON0_FIFIOSEL_MASK (0x7f << 5)
329#define VIDINTCON0_FIFIOSEL_SHIFT (5)
330#define VIDINTCON0_FIFIOSEL_WINDOW0 (0x1 << 5)
331#define VIDINTCON0_FIFIOSEL_WINDOW1 (0x2 << 5)
332
333#define VIDINTCON0_FIFOLEVEL_MASK (0x7 << 2)
334#define VIDINTCON0_FIFOLEVEL_SHIFT (2)
335#define VIDINTCON0_FIFOLEVEL_TO25PC (0x0 << 2)
336#define VIDINTCON0_FIFOLEVEL_TO50PC (0x1 << 2)
337#define VIDINTCON0_FIFOLEVEL_TO75PC (0x2 << 2)
338#define VIDINTCON0_FIFOLEVEL_EMPTY (0x3 << 2)
339#define VIDINTCON0_FIFOLEVEL_FULL (0x4 << 2)
340
341#define VIDINTCON0_INT_FIFO_MASK (0x3 << 0)
342#define VIDINTCON0_INT_FIFO_SHIFT (0)
343#define VIDINTCON0_INT_ENABLE (1 << 0)
344
345#define VIDINTCON1 (0x134)
346#define VIDINTCON1_INT_I180 (1 << 2)
347#define VIDINTCON1_INT_FRAME (1 << 1)
348#define VIDINTCON1_INT_FIFO (1 << 0)
349
350/* Window colour-key control registers */
351#define WKEYCON (0x140) /* 6410,V210 */
352
353#define WKEYCON0 (0x00)
354#define WKEYCON1 (0x04)
355
356#define WxKEYCON0_KEYBL_EN (1 << 26)
357#define WxKEYCON0_KEYEN_F (1 << 25)
358#define WxKEYCON0_DIRCON (1 << 24)
359#define WxKEYCON0_COMPKEY_MASK (0xffffff << 0)
360#define WxKEYCON0_COMPKEY_SHIFT (0)
361#define WxKEYCON0_COMPKEY_LIMIT (0xffffff)
362#define WxKEYCON0_COMPKEY(_x) ((_x) << 0)
363#define WxKEYCON1_COLVAL_MASK (0xffffff << 0)
364#define WxKEYCON1_COLVAL_SHIFT (0)
365#define WxKEYCON1_COLVAL_LIMIT (0xffffff)
366#define WxKEYCON1_COLVAL(_x) ((_x) << 0)
367
368
369/* Window blanking (MAP) */
370
371#define WINxMAP_MAP (1 << 24)
372#define WINxMAP_MAP_COLOUR_MASK (0xffffff << 0)
373#define WINxMAP_MAP_COLOUR_SHIFT (0)
374#define WINxMAP_MAP_COLOUR_LIMIT (0xffffff)
375#define WINxMAP_MAP_COLOUR(_x) ((_x) << 0)
376
377#define WPALCON_PAL_UPDATE (1 << 9)
378#define WPALCON_W1PAL_MASK (0x7 << 3)
379#define WPALCON_W1PAL_SHIFT (3)
380#define WPALCON_W1PAL_25BPP_A888 (0x0 << 3)
381#define WPALCON_W1PAL_24BPP (0x1 << 3)
382#define WPALCON_W1PAL_19BPP_A666 (0x2 << 3)
383#define WPALCON_W1PAL_18BPP_A665 (0x3 << 3)
384#define WPALCON_W1PAL_18BPP (0x4 << 3)
385#define WPALCON_W1PAL_16BPP_A555 (0x5 << 3)
386#define WPALCON_W1PAL_16BPP_565 (0x6 << 3)
387
388#define WPALCON_W0PAL_MASK (0x7 << 0)
389#define WPALCON_W0PAL_SHIFT (0)
390#define WPALCON_W0PAL_25BPP_A888 (0x0 << 0)
391#define WPALCON_W0PAL_24BPP (0x1 << 0)
392#define WPALCON_W0PAL_19BPP_A666 (0x2 << 0)
393#define WPALCON_W0PAL_18BPP_A665 (0x3 << 0)
394#define WPALCON_W0PAL_18BPP (0x4 << 0)
395#define WPALCON_W0PAL_16BPP_A555 (0x5 << 0)
396#define WPALCON_W0PAL_16BPP_565 (0x6 << 0)
397
398/* Blending equation control */
399#define BLENDCON (0x260)
400#define BLENDCON_NEW_MASK (1 << 0)
401#define BLENDCON_NEW_8BIT_ALPHA_VALUE (1 << 0)
402#define BLENDCON_NEW_4BIT_ALPHA_VALUE (0 << 0)
403
diff --git a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
deleted file mode 100644
index ceba18d23a5..00000000000
--- a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
+++ /dev/null
@@ -1,68 +0,0 @@
1/* linux/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
2 *
3 * Copyright (C) 2009 Samsung Electronics Ltd.
4 * Jaswinder Singh <jassi.brar@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __S3C64XX_PLAT_SPI_H
12#define __S3C64XX_PLAT_SPI_H
13
14struct platform_device;
15
16/**
17 * struct s3c64xx_spi_csinfo - ChipSelect description
18 * @fb_delay: Slave specific feedback delay.
19 * Refer to FB_CLK_SEL register definition in SPI chapter.
20 * @line: Custom 'identity' of the CS line.
21 *
22 * This is per SPI-Slave Chipselect information.
23 * Allocate and initialize one in machine init code and make the
24 * spi_board_info.controller_data point to it.
25 */
26struct s3c64xx_spi_csinfo {
27 u8 fb_delay;
28 unsigned line;
29};
30
31/**
32 * struct s3c64xx_spi_info - SPI Controller defining structure
33 * @src_clk_nr: Clock source index for the CLK_CFG[SPI_CLKSEL] field.
34 * @num_cs: Number of CS this controller emulates.
35 * @cfg_gpio: Configure pins for this SPI controller.
36 */
37struct s3c64xx_spi_info {
38 int src_clk_nr;
39 int num_cs;
40 int (*cfg_gpio)(void);
41};
42
43/**
44 * s3c64xx_spi_set_platdata - SPI Controller configure callback by the board
45 * initialization code.
46 * @cfg_gpio: Pointer to gpio setup function.
47 * @src_clk_nr: Clock the SPI controller is to use to generate SPI clocks.
48 * @num_cs: Number of elements in the 'cs' array.
49 *
50 * Call this from machine init code for each SPI Controller that
51 * has some chips attached to it.
52 */
53extern void s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
54 int num_cs);
55extern void s3c64xx_spi1_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
56 int num_cs);
57extern void s3c64xx_spi2_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
58 int num_cs);
59
60/* defined by architecture to configure gpio */
61extern int s3c64xx_spi0_cfg_gpio(void);
62extern int s3c64xx_spi1_cfg_gpio(void);
63extern int s3c64xx_spi2_cfg_gpio(void);
64
65extern struct s3c64xx_spi_info s3c64xx_spi0_pdata;
66extern struct s3c64xx_spi_info s3c64xx_spi1_pdata;
67extern struct s3c64xx_spi_info s3c64xx_spi2_pdata;
68#endif /* __S3C64XX_PLAT_SPI_H */
diff --git a/arch/arm/plat-samsung/include/plat/ts.h b/arch/arm/plat-samsung/include/plat/ts.h
deleted file mode 100644
index 26fdb22e0fc..00000000000
--- a/arch/arm/plat-samsung/include/plat/ts.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/* arch/arm/plat-samsung/include/plat/ts.h
2 *
3 * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org>
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 __ASM_ARM_TS_H
11#define __ASM_ARM_TS_H
12
13struct s3c2410_ts_mach_info {
14 int delay;
15 int presc;
16 int oversampling_shift;
17 void (*cfg_gpio)(struct platform_device *dev);
18};
19
20extern void s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *);
21
22/* defined by architecture to configure gpio */
23extern void s3c24xx_ts_cfg_gpio(struct platform_device *dev);
24
25#endif /* __ASM_ARM_TS_H */
diff --git a/arch/arm/plat-samsung/include/plat/udc.h b/arch/arm/plat-samsung/include/plat/udc.h
deleted file mode 100644
index de8e2288a50..00000000000
--- a/arch/arm/plat-samsung/include/plat/udc.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/* arch/arm/plat-samsung/include/plat/udc.h
2 *
3 * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org>
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 *
11 * Changelog:
12 * 14-Mar-2005 RTP Created file
13 * 02-Aug-2005 RTP File rename
14 * 07-Sep-2005 BJD Minor cleanups, changed cmd to enum
15 * 18-Jan-2007 HMW Add per-platform vbus_draw function
16*/
17
18#ifndef __ASM_ARM_ARCH_UDC_H
19#define __ASM_ARM_ARCH_UDC_H
20
21enum s3c2410_udc_cmd_e {
22 S3C2410_UDC_P_ENABLE = 1, /* Pull-up enable */
23 S3C2410_UDC_P_DISABLE = 2, /* Pull-up disable */
24 S3C2410_UDC_P_RESET = 3, /* UDC reset, in case of */
25};
26
27struct s3c2410_udc_mach_info {
28 void (*udc_command)(enum s3c2410_udc_cmd_e);
29 void (*vbus_draw)(unsigned int ma);
30
31 unsigned int pullup_pin;
32 unsigned int pullup_pin_inverted;
33
34 unsigned int vbus_pin;
35 unsigned char vbus_pin_inverted;
36};
37
38extern void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *);
39
40struct s3c24xx_hsudc_platdata;
41
42extern void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd);
43
44#endif /* __ASM_ARM_ARCH_UDC_H */
diff --git a/arch/arm/plat-samsung/include/plat/usb-control.h b/arch/arm/plat-samsung/include/plat/usb-control.h
deleted file mode 100644
index 7fa1fbefc3f..00000000000
--- a/arch/arm/plat-samsung/include/plat/usb-control.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/* arch/arm/plat-samsung/include/plat/usb-control.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C - USB host port information
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_USBCONTROL_H
14#define __ASM_ARCH_USBCONTROL_H
15
16#define S3C_HCDFLG_USED (1)
17
18struct s3c2410_hcd_port {
19 unsigned char flags;
20 unsigned char power;
21 unsigned char oc_status;
22 unsigned char oc_changed;
23};
24
25struct s3c2410_hcd_info {
26 struct usb_hcd *hcd;
27 struct s3c2410_hcd_port port[2];
28
29 void (*power_control)(int port, int to);
30 void (*enable_oc)(struct s3c2410_hcd_info *, int on);
31 void (*report_oc)(struct s3c2410_hcd_info *, int ports);
32};
33
34static void inline s3c2410_usb_report_oc(struct s3c2410_hcd_info *info, int ports)
35{
36 if (info->report_oc != NULL) {
37 (info->report_oc)(info, ports);
38 }
39}
40
41extern void s3c_ohci_set_platdata(struct s3c2410_hcd_info *info);
42
43#endif /*__ASM_ARCH_USBCONTROL_H */
diff --git a/arch/arm/plat-samsung/s5p-irq-gpioint.c b/arch/arm/plat-samsung/s5p-irq-gpioint.c
index f9431fe5b06..23557d30e44 100644
--- a/arch/arm/plat-samsung/s5p-irq-gpioint.c
+++ b/arch/arm/plat-samsung/s5p-irq-gpioint.c
@@ -24,7 +24,7 @@
24 24
25#include <asm/mach/irq.h> 25#include <asm/mach/irq.h>
26 26
27#define GPIO_BASE(chip) (((unsigned long)(chip)->base) & 0xFFFFF000u) 27#define GPIO_BASE(chip) ((void __iomem *)((unsigned long)((chip)->base) & 0xFFFFF000u))
28 28
29#define CON_OFFSET 0x700 29#define CON_OFFSET 0x700
30#define MASK_OFFSET 0x900 30#define MASK_OFFSET 0x900
@@ -153,7 +153,7 @@ static __init int s5p_gpioint_add(struct samsung_gpio_chip *chip)
153 bank->chips[group - bank->start] = chip; 153 bank->chips[group - bank->start] = chip;
154 154
155 gc = irq_alloc_generic_chip("s5p_gpioint", 1, chip->irq_base, 155 gc = irq_alloc_generic_chip("s5p_gpioint", 1, chip->irq_base,
156 (void __iomem *)GPIO_BASE(chip), 156 GPIO_BASE(chip),
157 handle_level_irq); 157 handle_level_irq);
158 if (!gc) 158 if (!gc)
159 return -ENOMEM; 159 return -ENOMEM;
diff --git a/arch/arm/plat-samsung/setup-mipiphy.c b/arch/arm/plat-samsung/setup-mipiphy.c
index 683c466c0e6..14745932760 100644
--- a/arch/arm/plat-samsung/setup-mipiphy.c
+++ b/arch/arm/plat-samsung/setup-mipiphy.c
@@ -14,24 +14,18 @@
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <mach/regs-clock.h> 15#include <mach/regs-clock.h>
16 16
17static int __s5p_mipi_phy_control(struct platform_device *pdev, 17static int __s5p_mipi_phy_control(int id, bool on, u32 reset)
18 bool on, u32 reset)
19{ 18{
20 static DEFINE_SPINLOCK(lock); 19 static DEFINE_SPINLOCK(lock);
21 void __iomem *addr; 20 void __iomem *addr;
22 unsigned long flags; 21 unsigned long flags;
23 int pid;
24 u32 cfg; 22 u32 cfg;
25 23
26 if (!pdev) 24 id = max(0, id);
25 if (id > 1)
27 return -EINVAL; 26 return -EINVAL;
28 27
29 pid = (pdev->id == -1) ? 0 : pdev->id; 28 addr = S5P_MIPI_DPHY_CONTROL(id);
30
31 if (pid != 0 && pid != 1)
32 return -EINVAL;
33
34 addr = S5P_MIPI_DPHY_CONTROL(pid);
35 29
36 spin_lock_irqsave(&lock, flags); 30 spin_lock_irqsave(&lock, flags);
37 31
@@ -52,12 +46,12 @@ static int __s5p_mipi_phy_control(struct platform_device *pdev,
52 return 0; 46 return 0;
53} 47}
54 48
55int s5p_csis_phy_enable(struct platform_device *pdev, bool on) 49int s5p_csis_phy_enable(int id, bool on)
56{ 50{
57 return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_SRESETN); 51 return __s5p_mipi_phy_control(id, on, S5P_MIPI_DPHY_SRESETN);
58} 52}
59 53
60int s5p_dsim_phy_enable(struct platform_device *pdev, bool on) 54int s5p_dsim_phy_enable(struct platform_device *pdev, bool on)
61{ 55{
62 return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_MRESETN); 56 return __s5p_mipi_phy_control(pdev->id, on, S5P_MIPI_DPHY_MRESETN);
63} 57}
diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c
index 4dcb11c3d89..60552e22f22 100644
--- a/arch/arm/plat-samsung/time.c
+++ b/arch/arm/plat-samsung/time.c
@@ -28,7 +28,6 @@
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30 30
31#include <asm/leds.h>
32#include <asm/mach-types.h> 31#include <asm/mach-types.h>
33 32
34#include <asm/irq.h> 33#include <asm/irq.h>
diff --git a/arch/arm/plat-spear/Kconfig b/arch/arm/plat-spear/Kconfig
index 4404f82d597..f8db7b2deb3 100644
--- a/arch/arm/plat-spear/Kconfig
+++ b/arch/arm/plat-spear/Kconfig
@@ -12,10 +12,10 @@ config ARCH_SPEAR13XX
12 bool "ST SPEAr13xx with Device Tree" 12 bool "ST SPEAr13xx with Device Tree"
13 select ARM_GIC 13 select ARM_GIC
14 select CPU_V7 14 select CPU_V7
15 select USE_OF
16 select HAVE_SMP 15 select HAVE_SMP
17 select MIGHT_HAVE_CACHE_L2X0 16 select MIGHT_HAVE_CACHE_L2X0
18 select PINCTRL 17 select PINCTRL
18 select USE_OF
19 help 19 help
20 Supports for ARM's SPEAR13XX family 20 Supports for ARM's SPEAR13XX family
21 21
@@ -23,8 +23,8 @@ config ARCH_SPEAR3XX
23 bool "ST SPEAr3xx with Device Tree" 23 bool "ST SPEAr3xx with Device Tree"
24 select ARM_VIC 24 select ARM_VIC
25 select CPU_ARM926T 25 select CPU_ARM926T
26 select USE_OF
27 select PINCTRL 26 select PINCTRL
27 select USE_OF
28 help 28 help
29 Supports for ARM's SPEAR3XX family 29 Supports for ARM's SPEAR3XX family
30 30
diff --git a/arch/arm/plat-spear/include/plat/gpio.h b/arch/arm/plat-spear/include/plat/gpio.h
deleted file mode 100644
index 40a8c178f10..00000000000
--- a/arch/arm/plat-spear/include/plat/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/plat-spear/include/plat/keyboard.h b/arch/arm/plat-spear/include/plat/keyboard.h
deleted file mode 100644
index 9248e3a7e33..00000000000
--- a/arch/arm/plat-spear/include/plat/keyboard.h
+++ /dev/null
@@ -1,164 +0,0 @@
1/*
2 * Copyright (C) 2010 ST Microelectronics
3 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10#ifndef __PLAT_KEYBOARD_H
11#define __PLAT_KEYBOARD_H
12
13#include <linux/bitops.h>
14#include <linux/input.h>
15#include <linux/input/matrix_keypad.h>
16#include <linux/types.h>
17
18#define DECLARE_9x9_KEYMAP(_name) \
19int _name[] = { \
20 KEY(0, 0, KEY_ESC), \
21 KEY(0, 1, KEY_1), \
22 KEY(0, 2, KEY_2), \
23 KEY(0, 3, KEY_3), \
24 KEY(0, 4, KEY_4), \
25 KEY(0, 5, KEY_5), \
26 KEY(0, 6, KEY_6), \
27 KEY(0, 7, KEY_7), \
28 KEY(0, 8, KEY_8), \
29 KEY(1, 0, KEY_9), \
30 KEY(1, 1, KEY_MINUS), \
31 KEY(1, 2, KEY_EQUAL), \
32 KEY(1, 3, KEY_BACKSPACE), \
33 KEY(1, 4, KEY_TAB), \
34 KEY(1, 5, KEY_Q), \
35 KEY(1, 6, KEY_W), \
36 KEY(1, 7, KEY_E), \
37 KEY(1, 8, KEY_R), \
38 KEY(2, 0, KEY_T), \
39 KEY(2, 1, KEY_Y), \
40 KEY(2, 2, KEY_U), \
41 KEY(2, 3, KEY_I), \
42 KEY(2, 4, KEY_O), \
43 KEY(2, 5, KEY_P), \
44 KEY(2, 6, KEY_LEFTBRACE), \
45 KEY(2, 7, KEY_RIGHTBRACE), \
46 KEY(2, 8, KEY_ENTER), \
47 KEY(3, 0, KEY_LEFTCTRL), \
48 KEY(3, 1, KEY_A), \
49 KEY(3, 2, KEY_S), \
50 KEY(3, 3, KEY_D), \
51 KEY(3, 4, KEY_F), \
52 KEY(3, 5, KEY_G), \
53 KEY(3, 6, KEY_H), \
54 KEY(3, 7, KEY_J), \
55 KEY(3, 8, KEY_K), \
56 KEY(4, 0, KEY_L), \
57 KEY(4, 1, KEY_SEMICOLON), \
58 KEY(4, 2, KEY_APOSTROPHE), \
59 KEY(4, 3, KEY_GRAVE), \
60 KEY(4, 4, KEY_LEFTSHIFT), \
61 KEY(4, 5, KEY_BACKSLASH), \
62 KEY(4, 6, KEY_Z), \
63 KEY(4, 7, KEY_X), \
64 KEY(4, 8, KEY_C), \
65 KEY(5, 0, KEY_V), \
66 KEY(5, 1, KEY_B), \
67 KEY(5, 2, KEY_N), \
68 KEY(5, 3, KEY_M), \
69 KEY(5, 4, KEY_COMMA), \
70 KEY(5, 5, KEY_DOT), \
71 KEY(5, 6, KEY_SLASH), \
72 KEY(5, 7, KEY_RIGHTSHIFT), \
73 KEY(5, 8, KEY_KPASTERISK), \
74 KEY(6, 0, KEY_LEFTALT), \
75 KEY(6, 1, KEY_SPACE), \
76 KEY(6, 2, KEY_CAPSLOCK), \
77 KEY(6, 3, KEY_F1), \
78 KEY(6, 4, KEY_F2), \
79 KEY(6, 5, KEY_F3), \
80 KEY(6, 6, KEY_F4), \
81 KEY(6, 7, KEY_F5), \
82 KEY(6, 8, KEY_F6), \
83 KEY(7, 0, KEY_F7), \
84 KEY(7, 1, KEY_F8), \
85 KEY(7, 2, KEY_F9), \
86 KEY(7, 3, KEY_F10), \
87 KEY(7, 4, KEY_NUMLOCK), \
88 KEY(7, 5, KEY_SCROLLLOCK), \
89 KEY(7, 6, KEY_KP7), \
90 KEY(7, 7, KEY_KP8), \
91 KEY(7, 8, KEY_KP9), \
92 KEY(8, 0, KEY_KPMINUS), \
93 KEY(8, 1, KEY_KP4), \
94 KEY(8, 2, KEY_KP5), \
95 KEY(8, 3, KEY_KP6), \
96 KEY(8, 4, KEY_KPPLUS), \
97 KEY(8, 5, KEY_KP1), \
98 KEY(8, 6, KEY_KP2), \
99 KEY(8, 7, KEY_KP3), \
100 KEY(8, 8, KEY_KP0), \
101}
102
103#define DECLARE_6x6_KEYMAP(_name) \
104int _name[] = { \
105 KEY(0, 0, KEY_RESERVED), \
106 KEY(0, 1, KEY_1), \
107 KEY(0, 2, KEY_2), \
108 KEY(0, 3, KEY_3), \
109 KEY(0, 4, KEY_4), \
110 KEY(0, 5, KEY_5), \
111 KEY(1, 0, KEY_Q), \
112 KEY(1, 1, KEY_W), \
113 KEY(1, 2, KEY_E), \
114 KEY(1, 3, KEY_R), \
115 KEY(1, 4, KEY_T), \
116 KEY(1, 5, KEY_Y), \
117 KEY(2, 0, KEY_D), \
118 KEY(2, 1, KEY_F), \
119 KEY(2, 2, KEY_G), \
120 KEY(2, 3, KEY_H), \
121 KEY(2, 4, KEY_J), \
122 KEY(2, 5, KEY_K), \
123 KEY(3, 0, KEY_B), \
124 KEY(3, 1, KEY_N), \
125 KEY(3, 2, KEY_M), \
126 KEY(3, 3, KEY_COMMA), \
127 KEY(3, 4, KEY_DOT), \
128 KEY(3, 5, KEY_SLASH), \
129 KEY(4, 0, KEY_F6), \
130 KEY(4, 1, KEY_F7), \
131 KEY(4, 2, KEY_F8), \
132 KEY(4, 3, KEY_F9), \
133 KEY(4, 4, KEY_F10), \
134 KEY(4, 5, KEY_NUMLOCK), \
135 KEY(5, 0, KEY_KP2), \
136 KEY(5, 1, KEY_KP3), \
137 KEY(5, 2, KEY_KP0), \
138 KEY(5, 3, KEY_KPDOT), \
139 KEY(5, 4, KEY_RO), \
140 KEY(5, 5, KEY_ZENKAKUHANKAKU), \
141}
142
143#define KEYPAD_9x9 0
144#define KEYPAD_6x6 1
145#define KEYPAD_2x2 2
146
147/**
148 * struct kbd_platform_data - spear keyboard platform data
149 * keymap: pointer to keymap data (table and size)
150 * rep: enables key autorepeat
151 * mode: choose keyboard support(9x9, 6x6, 2x2)
152 * suspended_rate: rate at which keyboard would operate in suspended mode
153 *
154 * This structure is supposed to be used by platform code to supply
155 * keymaps to drivers that implement keyboards.
156 */
157struct kbd_platform_data {
158 const struct matrix_keymap_data *keymap;
159 bool rep;
160 unsigned int mode;
161 unsigned int suspended_rate;
162};
163
164#endif /* __PLAT_KEYBOARD_H */
diff --git a/arch/arm/plat-versatile/Kconfig b/arch/arm/plat-versatile/Kconfig
index 8d5c10a5084..2a4ae8a6a08 100644
--- a/arch/arm/plat-versatile/Kconfig
+++ b/arch/arm/plat-versatile/Kconfig
@@ -16,8 +16,10 @@ config PLAT_VERSATILE_FPGA_IRQ_NR
16 depends on PLAT_VERSATILE_FPGA_IRQ 16 depends on PLAT_VERSATILE_FPGA_IRQ
17 17
18config PLAT_VERSATILE_LEDS 18config PLAT_VERSATILE_LEDS
19 def_bool y if LEDS_CLASS 19 def_bool y if NEW_LEDS
20 depends on ARCH_REALVIEW || ARCH_VERSATILE 20 depends on ARCH_REALVIEW || ARCH_VERSATILE
21 select LEDS_CLASS
22 select LEDS_TRIGGER
21 23
22config PLAT_VERSATILE_SCHED_CLOCK 24config PLAT_VERSATILE_SCHED_CLOCK
23 def_bool y 25 def_bool y
diff --git a/arch/arm/plat-versatile/Makefile b/arch/arm/plat-versatile/Makefile
index 272769a8a7d..74cfd94cbf8 100644
--- a/arch/arm/plat-versatile/Makefile
+++ b/arch/arm/plat-versatile/Makefile
@@ -1,3 +1,5 @@
1ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
2
1obj-$(CONFIG_PLAT_VERSATILE_CLOCK) += clock.o 3obj-$(CONFIG_PLAT_VERSATILE_CLOCK) += clock.o
2obj-$(CONFIG_PLAT_VERSATILE_CLCD) += clcd.o 4obj-$(CONFIG_PLAT_VERSATILE_CLCD) += clcd.o
3obj-$(CONFIG_PLAT_VERSATILE_FPGA_IRQ) += fpga-irq.o 5obj-$(CONFIG_PLAT_VERSATILE_FPGA_IRQ) += fpga-irq.o
diff --git a/arch/arm/plat-versatile/fpga-irq.c b/arch/arm/plat-versatile/fpga-irq.c
index 6e70d03824a..091ae103004 100644
--- a/arch/arm/plat-versatile/fpga-irq.c
+++ b/arch/arm/plat-versatile/fpga-irq.c
@@ -5,6 +5,8 @@
5#include <linux/io.h> 5#include <linux/io.h>
6#include <linux/irqdomain.h> 6#include <linux/irqdomain.h>
7#include <linux/module.h> 7#include <linux/module.h>
8#include <linux/of.h>
9#include <linux/of_address.h>
8 10
9#include <asm/exception.h> 11#include <asm/exception.h>
10#include <asm/mach/irq.h> 12#include <asm/mach/irq.h>
@@ -14,11 +16,17 @@
14#define IRQ_RAW_STATUS 0x04 16#define IRQ_RAW_STATUS 0x04
15#define IRQ_ENABLE_SET 0x08 17#define IRQ_ENABLE_SET 0x08
16#define IRQ_ENABLE_CLEAR 0x0c 18#define IRQ_ENABLE_CLEAR 0x0c
19#define INT_SOFT_SET 0x10
20#define INT_SOFT_CLEAR 0x14
21#define FIQ_STATUS 0x20
22#define FIQ_RAW_STATUS 0x24
23#define FIQ_ENABLE 0x28
24#define FIQ_ENABLE_SET 0x28
25#define FIQ_ENABLE_CLEAR 0x2C
17 26
18/** 27/**
19 * struct fpga_irq_data - irq data container for the FPGA IRQ controller 28 * struct fpga_irq_data - irq data container for the FPGA IRQ controller
20 * @base: memory offset in virtual memory 29 * @base: memory offset in virtual memory
21 * @irq_start: first IRQ number handled by this instance
22 * @chip: chip container for this instance 30 * @chip: chip container for this instance
23 * @domain: IRQ domain for this instance 31 * @domain: IRQ domain for this instance
24 * @valid: mask for valid IRQs on this controller 32 * @valid: mask for valid IRQs on this controller
@@ -26,7 +34,6 @@
26 */ 34 */
27struct fpga_irq_data { 35struct fpga_irq_data {
28 void __iomem *base; 36 void __iomem *base;
29 unsigned int irq_start;
30 struct irq_chip chip; 37 struct irq_chip chip;
31 u32 valid; 38 u32 valid;
32 struct irq_domain *domain; 39 struct irq_domain *domain;
@@ -125,34 +132,79 @@ static struct irq_domain_ops fpga_irqdomain_ops = {
125 .xlate = irq_domain_xlate_onetwocell, 132 .xlate = irq_domain_xlate_onetwocell,
126}; 133};
127 134
128void __init fpga_irq_init(void __iomem *base, const char *name, int irq_start, 135static __init struct fpga_irq_data *
129 int parent_irq, u32 valid, struct device_node *node) 136fpga_irq_prep_struct(void __iomem *base, const char *name, u32 valid) {
130{
131 struct fpga_irq_data *f; 137 struct fpga_irq_data *f;
132 138
133 if (fpga_irq_id >= ARRAY_SIZE(fpga_irq_devices)) { 139 if (fpga_irq_id >= ARRAY_SIZE(fpga_irq_devices)) {
134 printk(KERN_ERR "%s: too few FPGA IRQ controllers, increase CONFIG_PLAT_VERSATILE_FPGA_IRQ_NR\n", __func__); 140 printk(KERN_ERR "%s: too few FPGA IRQ controllers, increase CONFIG_PLAT_VERSATILE_FPGA_IRQ_NR\n", __func__);
135 return; 141 return NULL;
136 } 142 }
137
138 f = &fpga_irq_devices[fpga_irq_id]; 143 f = &fpga_irq_devices[fpga_irq_id];
139 f->base = base; 144 f->base = base;
140 f->irq_start = irq_start;
141 f->chip.name = name; 145 f->chip.name = name;
142 f->chip.irq_ack = fpga_irq_mask; 146 f->chip.irq_ack = fpga_irq_mask;
143 f->chip.irq_mask = fpga_irq_mask; 147 f->chip.irq_mask = fpga_irq_mask;
144 f->chip.irq_unmask = fpga_irq_unmask; 148 f->chip.irq_unmask = fpga_irq_unmask;
145 f->valid = valid; 149 f->valid = valid;
150 fpga_irq_id++;
151
152 return f;
153}
154
155void __init fpga_irq_init(void __iomem *base, const char *name, int irq_start,
156 int parent_irq, u32 valid, struct device_node *node)
157{
158 struct fpga_irq_data *f;
159
160 f = fpga_irq_prep_struct(base, name, valid);
161 if (!f)
162 return;
146 163
147 if (parent_irq != -1) { 164 if (parent_irq != -1) {
148 irq_set_handler_data(parent_irq, f); 165 irq_set_handler_data(parent_irq, f);
149 irq_set_chained_handler(parent_irq, fpga_irq_handle); 166 irq_set_chained_handler(parent_irq, fpga_irq_handle);
150 } 167 }
151 168
152 f->domain = irq_domain_add_legacy(node, fls(valid), f->irq_start, 0, 169 f->domain = irq_domain_add_legacy(node, fls(valid), irq_start, 0,
153 &fpga_irqdomain_ops, f); 170 &fpga_irqdomain_ops, f);
154 pr_info("FPGA IRQ chip %d \"%s\" @ %p, %u irqs\n", 171 pr_info("FPGA IRQ chip %d \"%s\" @ %p, %u irqs\n",
155 fpga_irq_id, name, base, f->used_irqs); 172 fpga_irq_id, name, base, f->used_irqs);
173}
156 174
157 fpga_irq_id++; 175#ifdef CONFIG_OF
176int __init fpga_irq_of_init(struct device_node *node,
177 struct device_node *parent)
178{
179 struct fpga_irq_data *f;
180 void __iomem *base;
181 u32 clear_mask;
182 u32 valid_mask;
183
184 if (WARN_ON(!node))
185 return -ENODEV;
186
187 base = of_iomap(node, 0);
188 WARN(!base, "unable to map fpga irq registers\n");
189
190 if (of_property_read_u32(node, "clear-mask", &clear_mask))
191 clear_mask = 0;
192
193 if (of_property_read_u32(node, "valid-mask", &valid_mask))
194 valid_mask = 0;
195
196 f = fpga_irq_prep_struct(base, node->name, valid_mask);
197 if (!f)
198 return -ENOMEM;
199
200 writel(clear_mask, base + IRQ_ENABLE_CLEAR);
201 writel(clear_mask, base + FIQ_ENABLE_CLEAR);
202
203 f->domain = irq_domain_add_linear(node, fls(valid_mask), &fpga_irqdomain_ops, f);
204 f->used_irqs = hweight32(valid_mask);
205
206 pr_info("FPGA IRQ chip %d \"%s\" @ %p, %u irqs\n",
207 fpga_irq_id, node->name, base, f->used_irqs);
208 return 0;
158} 209}
210#endif
diff --git a/arch/arm/plat-versatile/include/plat/fpga-irq.h b/arch/arm/plat-versatile/include/plat/fpga-irq.h
index 91bcfb67551..1fac9651d3c 100644
--- a/arch/arm/plat-versatile/include/plat/fpga-irq.h
+++ b/arch/arm/plat-versatile/include/plat/fpga-irq.h
@@ -7,5 +7,7 @@ struct pt_regs;
7void fpga_handle_irq(struct pt_regs *regs); 7void fpga_handle_irq(struct pt_regs *regs);
8void fpga_irq_init(void __iomem *, const char *, int, int, u32, 8void fpga_irq_init(void __iomem *, const char *, int, int, u32,
9 struct device_node *node); 9 struct device_node *node);
10int fpga_irq_of_init(struct device_node *node,
11 struct device_node *parent);
10 12
11#endif 13#endif
diff --git a/arch/arm/plat-versatile/include/plat/platsmp.h b/arch/arm/plat-versatile/include/plat/platsmp.h
new file mode 100644
index 00000000000..50fb830192e
--- /dev/null
+++ b/arch/arm/plat-versatile/include/plat/platsmp.h
@@ -0,0 +1,14 @@
1/*
2 * linux/arch/arm/plat-versatile/include/plat/platsmp.h
3 *
4 * Copyright (C) 2011 ARM Ltd.
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12extern void versatile_secondary_startup(void);
13extern void versatile_secondary_init(unsigned int cpu);
14extern int versatile_boot_secondary(unsigned int cpu, struct task_struct *idle);
diff --git a/arch/arm/plat-versatile/leds.c b/arch/arm/plat-versatile/leds.c
index 3169fa555ea..d2490d00b46 100644
--- a/arch/arm/plat-versatile/leds.c
+++ b/arch/arm/plat-versatile/leds.c
@@ -37,10 +37,10 @@ static const struct {
37} versatile_leds[] = { 37} versatile_leds[] = {
38 { "versatile:0", "heartbeat", }, 38 { "versatile:0", "heartbeat", },
39 { "versatile:1", "mmc0", }, 39 { "versatile:1", "mmc0", },
40 { "versatile:2", }, 40 { "versatile:2", "cpu0" },
41 { "versatile:3", }, 41 { "versatile:3", "cpu1" },
42 { "versatile:4", }, 42 { "versatile:4", "cpu2" },
43 { "versatile:5", }, 43 { "versatile:5", "cpu3" },
44 { "versatile:6", }, 44 { "versatile:6", },
45 { "versatile:7", }, 45 { "versatile:7", },
46}; 46};
diff --git a/arch/arm/plat-versatile/platsmp.c b/arch/arm/plat-versatile/platsmp.c
index d7c5c171f5a..04ca4937d8c 100644
--- a/arch/arm/plat-versatile/platsmp.c
+++ b/arch/arm/plat-versatile/platsmp.c
@@ -20,12 +20,6 @@
20#include <asm/hardware/gic.h> 20#include <asm/hardware/gic.h>
21 21
22/* 22/*
23 * control for which core is the next to come out of the secondary
24 * boot "holding pen"
25 */
26volatile int __cpuinitdata pen_release = -1;
27
28/*
29 * 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
30 * observers, irrespective of whether they're taking part in coherency 24 * observers, irrespective of whether they're taking part in coherency
31 * or not. This is necessary for the hotplug code to work reliably. 25 * or not. This is necessary for the hotplug code to work reliably.
@@ -40,7 +34,7 @@ static void __cpuinit write_pen_release(int val)
40 34
41static DEFINE_SPINLOCK(boot_lock); 35static DEFINE_SPINLOCK(boot_lock);
42 36
43void __cpuinit platform_secondary_init(unsigned int cpu) 37void __cpuinit versatile_secondary_init(unsigned int cpu)
44{ 38{
45 /* 39 /*
46 * if any interrupts are already enabled for the primary 40 * if any interrupts are already enabled for the primary
@@ -62,7 +56,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
62 spin_unlock(&boot_lock); 56 spin_unlock(&boot_lock);
63} 57}
64 58
65int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 59int __cpuinit versatile_boot_secondary(unsigned int cpu, struct task_struct *idle)
66{ 60{
67 unsigned long timeout; 61 unsigned long timeout;
68 62
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 2997e56ce0d..831e1fdfdb2 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -66,7 +66,6 @@ iq80321 ARCH_IQ80321 IQ80321 169
66ks8695 ARCH_KS8695 KS8695 180 66ks8695 ARCH_KS8695 KS8695 180
67karo ARCH_KARO KARO 190 67karo ARCH_KARO KARO 190
68smdk2410 ARCH_SMDK2410 SMDK2410 193 68smdk2410 ARCH_SMDK2410 SMDK2410 193
69ceiva ARCH_CEIVA CEIVA 200
70voiceblue MACH_VOICEBLUE VOICEBLUE 218 69voiceblue MACH_VOICEBLUE VOICEBLUE 218
71h5400 ARCH_H5400 H5400 220 70h5400 ARCH_H5400 H5400 220
72omap_innovator MACH_OMAP_INNOVATOR OMAP_INNOVATOR 234 71omap_innovator MACH_OMAP_INNOVATOR OMAP_INNOVATOR 234
@@ -158,7 +157,6 @@ edb9315a MACH_EDB9315A EDB9315A 772
158stargate2 MACH_STARGATE2 STARGATE2 774 157stargate2 MACH_STARGATE2 STARGATE2 774
159intelmote2 MACH_INTELMOTE2 INTELMOTE2 775 158intelmote2 MACH_INTELMOTE2 INTELMOTE2 775
160trizeps4 MACH_TRIZEPS4 TRIZEPS4 776 159trizeps4 MACH_TRIZEPS4 TRIZEPS4 776
161pnx4008 MACH_PNX4008 PNX4008 782
162cpuat91 MACH_CPUAT91 CPUAT91 787 160cpuat91 MACH_CPUAT91 CPUAT91 787
163iq81340sc MACH_IQ81340SC IQ81340SC 799 161iq81340sc MACH_IQ81340SC IQ81340SC 799
164iq81340mc MACH_IQ81340MC IQ81340MC 801 162iq81340mc MACH_IQ81340MC IQ81340MC 801